From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jasvinder Singh Subject: [PATCH] ip_pipeline: enable promiscuous mode configuration Date: Mon, 7 Sep 2015 13:57:42 +0100 Message-ID: <1441630662-15658-1-git-send-email-jasvinder.singh@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable To: dev@dpdk.org Return-path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id CAD1F5A4B for ; Mon, 7 Sep 2015 14:57:45 +0200 (CEST) List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 =3D promiscuous mode on) Example of config file: [LINK0] promisc =3D no; optional parameter, default value is =E2=80=9Cyes=E2=80=9D Signed-off-by: Jasvinder Singh --- examples/ip_pipeline/config_parse.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/examples/ip_pipeline/config_parse.c b/examples/ip_pipeline/c= onfig_parse.c index c9b78f9..e40c4f2 100644 --- a/examples/ip_pipeline/config_parse.c +++ b/examples/ip_pipeline/config_parse.c @@ -1240,7 +1240,13 @@ parse_link(struct app_params *app, struct rte_cfgfile_entry *ent =3D &entries[i]; =20 ret =3D -ESRCH; - if (strcmp(ent->name, "arp_q") =3D=3D 0) + if (strcmp(ent->name, "promisc") =3D=3D 0) { + ret =3D parser_read_arg_bool(ent->value); + if (ret >=3D 0) { + param->promisc =3D ret; + ret =3D 0; + } + } else if (strcmp(ent->name, "arp_q") =3D=3D 0) ret =3D parser_read_uint32(¶m->arp_q, ent->value); else if (strcmp(ent->name, "tcp_syn_q") =3D=3D 0) @@ -1991,6 +1997,7 @@ save_links_params(struct app_params *app, FILE *f) =20 fprintf(f, "[%s]\n", p->name); fprintf(f, "; %s =3D %" PRIu32 "\n", "pmd_id", p->pmd_id); + fprintf(f, "%s =3D %s\n", "promisc", p->promisc ? "yes" : "no"); fprintf(f, "%s =3D %" PRIu32 "\n", "arp_q", p->arp_q); fprintf(f, "%s =3D %" PRIu32 "\n", "tcp_syn_local_q", p->tcp_syn_local_q); --=20 2.1.0