From mboxrd@z Thu Jan 1 00:00:00 1970 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) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP; 07 Sep 2015 05:57:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,485,1437462000"; d="scan'208";a="784407032" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga001.fm.intel.com with ESMTP; 07 Sep 2015 05:57:43 -0700 Received: from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com [10.237.217.46]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id t87CvgvR009664; Mon, 7 Sep 2015 13:57:42 +0100 Received: from sivswdev02.ir.intel.com (localhost [127.0.0.1]) by sivswdev02.ir.intel.com with ESMTP id t87CvgtJ015692; Mon, 7 Sep 2015 13:57:42 +0100 Received: (from jasvinde@localhost) by sivswdev02.ir.intel.com with id t87Cvgnx015688; Mon, 7 Sep 2015 13:57:42 +0100 From: Jasvinder Singh To: dev@dpdk.org Date: Mon, 7 Sep 2015 13:57:42 +0100 Message-Id: <1441630662-15658-1-git-send-email-jasvinder.singh@intel.com> X-Mailer: git-send-email 1.7.4.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH] ip_pipeline: enable promiscuous mode configuration X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Sep 2015 12:57:46 -0000 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 --- 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/config_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 = &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) @@ -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); -- 2.1.0