Skip to contentSkip to conversation

ip_pipeline: enable promiscuous mode configuration

PATCH Applied Jasvinder Singh 3 participants 3 messages Sep 7, 2015 – Dec 7, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ip_pipeline: enable promiscuous mode configuration

This patch allows parser to read promisc entry from the LINK section defined in configuration file. It is an optional parameter: if present, value should be read (yes/no, on/off), else the value is the default value (i.e. 1 = promiscuous mode on)

Example of config file:
[LINK0]
promisc = no; optional parameter, default value is “yes”

---
 examples/ip_pipeline/config_parse.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
examples/ip_pipeline/config_parse.c +8 -1
index c9b78f9..e40c4f2 100644
@@ -1240,7 +1240,13 @@ parse_link(struct app_params *app,
 		struct rte_cfgfile_entry *ent = &entries[i];
 
 		ret = -ESRCH;
-		if (strcmp(ent->name, "arp_q") == 0)
+		if (strcmp(ent->name, "promisc") == 0) {
+			ret = parser_read_arg_bool(ent->value);
+			if (ret >= 0) {
+				param->promisc = ret;
+				ret = 0;
+			}
+		} else if (strcmp(ent->name, "arp_q") == 0)
 			ret = parser_read_uint32(&param->arp_q,
 				ent->value);
 		else if (strcmp(ent->name, "tcp_syn_q") == 0)
@@ -1991,6 +1997,7 @@ save_links_params(struct app_params *app, FILE *f)
 
 		fprintf(f, "[%s]\n", p->name);
 		fprintf(f, "; %s = %" PRIu32 "\n", "pmd_id", p->pmd_id);
+		fprintf(f, "%s = %s\n", "promisc", p->promisc ? "yes" : "no");
 		fprintf(f, "%s = %" PRIu32 "\n", "arp_q", p->arp_q);
 		fprintf(f, "%s = %" PRIu32 "\n", "tcp_syn_local_q",
 			p->tcp_syn_local_q);
Signature · 1 line
2.1.0
Acked-by on v1 1/1
#1 lore raw
Quoted 15 lines

-----Original Message-----
From: Singh, Jasvinder
Sent: Monday, September 7, 2015 3:58 PM
To: [email protected]
Cc: Dumitrescu, Cristian
Subject: [PATCH] ip_pipeline: enable promiscuous mode configuration

This patch allows parser to read promisc entry from the LINK section defined in configuration file. It is an optional parameter: if present, value should be read (yes/no, on/off), else the value is the default value (i.e. 1 = promiscuous mode on)

Quoted 6 lines

Example of config file:
[LINK0]
promisc = no; optional parameter, default value is “yes”

---

#2 lore raw
Quoted 6 lines
Quoted 6 lines

This patch allows parser to read promisc entry from the LINK section defined in configuration file. It is an optional parameter: if present, value should be read (yes/no, on/off), else the value is the default value (i.e. 1 = promiscuous mode on)

Quoted 7 lines
Quoted 5 lines

Example of config file:
[LINK0]
promisc = no; optional parameter, default value is “yes”

Applied, thanks