From: Wenwu Ma <wenwux.ma@intel.com>
To: anatoly.burakov@intel.com
Cc: dev@dpdk.org, jiayu.hu@intel.com, yinan.wang@intel.com,
xingguang.he@intel.com, Wenwu Ma <wenwux.ma@intel.com>
Subject: [PATCH] examples/multi_process: add options to control port configuration
Date: Thu, 17 Feb 2022 15:17:55 +0000 [thread overview]
Message-ID: <20220217151755.442306-1-wenwux.ma@intel.com> (raw)
The default values of rx mq_mode and rx offloads for port
will cause symmetric_mp startup failure if the port do
not support rss or csum. Therefore, we added two new options
--rx-mq-mode and --rx-offloads, through which the user can set
the values appropriately according to the situation to make
app startup normally.
Signed-off-by: Wenwu Ma <wenwux.ma@intel.com>
---
examples/multi_process/symmetric_mp/main.c | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/examples/multi_process/symmetric_mp/main.c b/examples/multi_process/symmetric_mp/main.c
index 050337765f..df41abe682 100644
--- a/examples/multi_process/symmetric_mp/main.c
+++ b/examples/multi_process/symmetric_mp/main.c
@@ -52,6 +52,8 @@
#define PARAM_PROC_ID "proc-id"
#define PARAM_NUM_PROCS "num-procs"
+#define PARAM_RX_OFFLOADS "rx-offloads"
+#define PARAM_RX_MQ_MODE "rx-mq-mode"
/* for each lcore, record the elements of the ports array to use */
struct lcore_ports{
@@ -69,6 +71,8 @@ struct port_stats{
static int proc_id = -1;
static unsigned num_procs = 0;
+static uint64_t rx_offloads = RTE_ETH_RX_OFFLOAD_CHECKSUM;
+static enum rte_eth_rx_mq_mode rx_mq_mode = RTE_ETH_MQ_RX_RSS;
static uint16_t ports[RTE_MAX_ETHPORTS];
static unsigned num_ports = 0;
@@ -84,9 +88,13 @@ smp_usage(const char *prgname, const char *errmsg)
printf("\n%s [EAL options] -- -p <port mask> "
"--"PARAM_NUM_PROCS" <n>"
" --"PARAM_PROC_ID" <id>\n"
+ " --"PARAM_RX_OFFLOADS" <offload>\n"
+ " --"PARAM_RX_MQ_MODE" <mode>\n"
"-p : a hex bitmask indicating what ports are to be used\n"
"--num-procs: the number of processes which will be used\n"
"--proc-id : the id of the current process (id < num-procs)\n"
+ "--rx-offloads : rx offload capabilities of ports\n"
+ "--rx-mq-mode : the multi-queue packet distribution mode, e.g. RSS.\n"
"\n",
prgname);
exit(1);
@@ -119,6 +127,8 @@ smp_parse_args(int argc, char **argv)
static struct option lgopts[] = {
{PARAM_NUM_PROCS, 1, 0, 0},
{PARAM_PROC_ID, 1, 0, 0},
+ {PARAM_RX_OFFLOADS, 1, 0, 0},
+ {PARAM_RX_MQ_MODE, 1, 0, 0},
{NULL, 0, 0, 0}
};
@@ -137,6 +147,10 @@ smp_parse_args(int argc, char **argv)
num_procs = atoi(optarg);
else if (strncmp(lgopts[option_index].name, PARAM_PROC_ID, 7) == 0)
proc_id = atoi(optarg);
+ else if (strncmp(lgopts[option_index].name, PARAM_RX_OFFLOADS, 11) == 0)
+ rx_offloads = atoi(optarg);
+ else if (strncmp(lgopts[option_index].name, PARAM_RX_MQ_MODE, 10) == 0)
+ rx_mq_mode = atoi(optarg);
break;
default:
@@ -175,9 +189,9 @@ smp_port_init(uint16_t port, struct rte_mempool *mbuf_pool,
{
struct rte_eth_conf port_conf = {
.rxmode = {
- .mq_mode = RTE_ETH_MQ_RX_RSS,
+ .mq_mode = rx_mq_mode,
.split_hdr_size = 0,
- .offloads = RTE_ETH_RX_OFFLOAD_CHECKSUM,
+ .offloads = rx_offloads,
},
.rx_adv_conf = {
.rss_conf = {
--
2.25.1
next reply other threads:[~2022-02-17 7:19 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-17 15:17 Wenwu Ma [this message]
2022-02-17 9:06 ` Bruce Richardson
2022-02-18 6:49 ` Ma, WenwuX
2022-02-18 9:41 ` Bruce Richardson
2022-02-18 10:10 ` Ma, WenwuX
2022-02-18 10:22 ` Bruce Richardson
2022-02-21 15:35 ` [PATCH v2] examples/multi_process: reconfigure port when rss or csum isn't supported Wenwu Ma
2022-02-21 9:21 ` Bruce Richardson
2022-02-22 10:51 ` [PATCH v3] " Wenwu Ma
2022-02-22 9:41 ` Bruce Richardson
2022-02-28 7:55 ` Ling, WeiX
2022-03-08 13:22 ` 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=20220217151755.442306-1-wenwux.ma@intel.com \
--to=wenwux.ma@intel.com \
--cc=anatoly.burakov@intel.com \
--cc=dev@dpdk.org \
--cc=jiayu.hu@intel.com \
--cc=xingguang.he@intel.com \
--cc=yinan.wang@intel.com \
/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).