From: Jasvinder Singh <jasvinder.singh@intel.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH] ip_pipeline: enable promiscuous mode configuration
Date: Mon, 7 Sep 2015 13:57:42 +0100 [thread overview]
Message-ID: <1441630662-15658-1-git-send-email-jasvinder.singh@intel.com> (raw)
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 <jasvinder.singh@intel.com>
---
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
next reply other threads:[~2015-09-07 12:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-07 12:57 Jasvinder Singh [this message]
2015-09-07 13:29 ` Dumitrescu, Cristian
2015-12-07 0:32 ` Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1441630662-15658-1-git-send-email-jasvinder.singh@intel.com \
--to=jasvinder.singh@intel.com \
--cc=dev@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).