From: Jasvinder Singh Date: Mon, 7 Sep 2015 12:57:42 +0000 (+0100) Subject: examples/ip_pipeline: enable promiscuous mode configuration X-Git-Tag: spdx-start~7865 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=6cec95a597b53eba8a1fdec9e22280573635dd8b;hp=2a61c6ec7fe47f14c7c4a44a682df6f5829af8b0;p=dpdk.git examples/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” Signed-off-by: Jasvinder Singh Acked-by: Cristian Dumitrescu --- diff --git a/examples/ip_pipeline/config_parse.c b/examples/ip_pipeline/config_parse.c index d866310596..7b6ea3f7c1 100644 --- a/examples/ip_pipeline/config_parse.c +++ b/examples/ip_pipeline/config_parse.c @@ -1306,7 +1306,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(¶m->arp_q, ent->value); else if (strcmp(ent->name, "tcp_syn_q") == 0) @@ -2125,6 +2131,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);