From: Wenzhuo Lu <wenzhuo.lu@intel.com>
To: dev@dpdk.org
Cc: Wenzhuo Lu <wenzhuo.lu@intel.com>
Subject: [dpdk-dev] [RFC PATCH 3/3] app/testpmd: a parameter to set max queue per VF
Date: Tue, 1 Aug 2017 03:27:20 +0800 [thread overview]
Message-ID: <1501529240-64181-4-git-send-email-wenzhuo.lu@intel.com> (raw)
In-Reply-To: <1501529240-64181-1-git-send-email-wenzhuo.lu@intel.com>
Add a parameter in testpmd CLI. This parameter is used
to set the max queue number per VF.
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
---
app/test-pmd/parameters.c | 33 ++++++++++++++++++++++++++++++++-
app/test-pmd/testpmd.c | 2 ++
app/test-pmd/testpmd.h | 1 +
3 files changed, 35 insertions(+), 1 deletion(-)
diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c
index 2f7f70f..2dd806d 100644
--- a/app/test-pmd/parameters.c
+++ b/app/test-pmd/parameters.c
@@ -100,7 +100,7 @@
"--rss-ip | --rss-udp | "
"--rxpt= | --rxht= | --rxwt= | --rxfreet= | "
"--txpt= | --txht= | --txwt= | --txfreet= | "
- "--txrst= | --txqflags= ]\n",
+ "--txrst= | --txqflags= | --vf-max-queue= ]\n",
progname);
#ifdef RTE_LIBRTE_CMDLINE
printf(" --interactive: run in interactive mode.\n");
@@ -216,6 +216,8 @@
"disable print of designated event or all of them.\n");
printf(" --flow-isolate-all: "
"requests flow API isolated mode on all ports at initialization time.\n");
+ printf(" --vf-max-queue=N: set the maximum queue number per VF "
+ "(N: positive integer).\n");
}
#ifdef RTE_LIBRTE_CMDLINE
@@ -638,6 +640,7 @@
{ "no-rmv-interrupt", 0, 0, 0 },
{ "print-event", 1, 0, 0 },
{ "mask-event", 1, 0, 0 },
+ { "vf-max-queue", 1, 0, 0 },
{ 0, 0, 0, 0 },
};
@@ -1133,3 +1136,31 @@
}
}
}
+
+void
+pre_launch_args_parse(int argc, char **argv)
+{
+ int i;
+ char *tmp;
+ int nb_queue = 0;
+
+ /**
+ * Don't want to check the first string.
+ * It should not be a parameter.
+ */
+ for (i = 1; i < argc; i++) {
+ tmp = *(argv + i);
+ if (!strncmp(tmp, "--vf-max-queue=", 15)) {
+ tmp += 15;
+ nb_queue = atoi(tmp);
+ if (nb_queue > 0)
+ g_max_queue_number_per_vf = nb_queue;
+ else
+ rte_exit(EXIT_FAILURE,
+ "vf-max-queue must be > 0\n");
+
+ /* delete it if more than 1 patameters to check */
+ break;
+ }
+ }
+}
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index e754d12..b374f38 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -2289,6 +2289,8 @@ uint8_t port_is_bonding_slave(portid_t slave_pid)
signal(SIGINT, signal_handler);
signal(SIGTERM, signal_handler);
+ pre_launch_args_parse(argc, argv);
+
diag = rte_eal_init(argc, argv);
if (diag < 0)
rte_panic("Cannot init EAL\n");
diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index c9d7739..8d0e72b 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -650,6 +650,7 @@ void port_rss_hash_key_update(portid_t port_id, char rss_type[],
uint8_t *open_ddp_package_file(const char *file_path, uint32_t *size);
int save_ddp_package_file(const char *file_path, uint8_t *buf, uint32_t size);
int close_ddp_package_file(uint8_t *buf);
+void pre_launch_args_parse(int argc, char **argv);
enum print_warning {
ENABLED_WARN = 0,
--
1.9.3
next prev parent reply other threads:[~2017-07-31 19:26 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-31 19:27 [dpdk-dev] [RFC PATCH 0/3] configurable max queue number " Wenzhuo Lu
2017-07-31 19:27 ` [dpdk-dev] [RFC PATCH 1/3] librte_ether: VF max queue number setting Wenzhuo Lu
2017-07-31 19:27 ` [dpdk-dev] [RFC PATCH 2/3] net/i40e: max VF " Wenzhuo Lu
2017-07-31 19:27 ` Wenzhuo Lu [this message]
2017-12-15 19:24 ` [dpdk-dev] [RFC PATCH 0/3] configurable max queue number per VF Ferruh Yigit
2017-12-22 2:26 ` Ferruh Yigit
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=1501529240-64181-4-git-send-email-wenzhuo.lu@intel.com \
--to=wenzhuo.lu@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).