All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] examples/multi_process: add options to control port configuration
  2022-02-17 15:17 [PATCH] examples/multi_process: add options to control port configuration Wenwu Ma
@ 2022-02-17  9:06 ` Bruce Richardson
  2022-02-18  6:49   ` Ma, WenwuX
  2022-02-21 15:35 ` [PATCH v2] examples/multi_process: reconfigure port when rss or csum isn't supported Wenwu Ma
  2022-02-22 10:51 ` [PATCH v3] " Wenwu Ma
  2 siblings, 1 reply; 12+ messages in thread
From: Bruce Richardson @ 2022-02-17  9:06 UTC (permalink / raw)
  To: Wenwu Ma; +Cc: anatoly.burakov, dev, jiayu.hu, yinan.wang, xingguang.he

On Thu, Feb 17, 2022 at 03:17:55PM +0000, Wenwu Ma wrote:
> 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> ---

The idea seems reasonable enough, but I think the implementation requiring
the user to pass in special "magic numbers" for the offload values is not a
good idea. Perhaps add in a separate flag for "no-csum" to disable that.

For the no-rss case, can you explain how you would see this app being used
in the absense of RSS support to distribute traffic among the separate
processes?

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH] examples/multi_process: add options to control port configuration
@ 2022-02-17 15:17 Wenwu Ma
  2022-02-17  9:06 ` Bruce Richardson
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Wenwu Ma @ 2022-02-17 15:17 UTC (permalink / raw)
  To: anatoly.burakov; +Cc: dev, jiayu.hu, yinan.wang, xingguang.he, Wenwu Ma

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


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* RE: [PATCH] examples/multi_process: add options to control port configuration
  2022-02-17  9:06 ` Bruce Richardson
@ 2022-02-18  6:49   ` Ma, WenwuX
  2022-02-18  9:41     ` Bruce Richardson
  0 siblings, 1 reply; 12+ messages in thread
From: Ma, WenwuX @ 2022-02-18  6:49 UTC (permalink / raw)
  To: Richardson, Bruce
  Cc: Burakov, Anatoly, dev, Hu, Jiayu, Wang, Yinan, He, Xingguang



> -----Original Message-----
> From: Richardson, Bruce <bruce.richardson@intel.com>
> Sent: 2022年2月17日 17:06
> To: Ma, WenwuX <wenwux.ma@intel.com>
> Cc: Burakov, Anatoly <anatoly.burakov@intel.com>; dev@dpdk.org; Hu,
> Jiayu <jiayu.hu@intel.com>; Wang, Yinan <yinan.wang@intel.com>; He,
> Xingguang <xingguang.he@intel.com>
> Subject: Re: [PATCH] examples/multi_process: add options to control port
> configuration
> 
> On Thu, Feb 17, 2022 at 03:17:55PM +0000, Wenwu Ma wrote:
> > 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> ---
> 
> The idea seems reasonable enough, but I think the implementation requiring
> the user to pass in special "magic numbers" for the offload values is not a
> good idea. Perhaps add in a separate flag for "no-csum" to disable that.
> 
> For the no-rss case, can you explain how you would see this app being used
> in the absense of RSS support to distribute traffic among the separate
> processes?

When app run in qemu vm and the backend is dpdk vhost, it will report error below:
"virtio_dev_configure(): RSS support requested but not supported by the device"

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] examples/multi_process: add options to control port configuration
  2022-02-18  6:49   ` Ma, WenwuX
@ 2022-02-18  9:41     ` Bruce Richardson
  2022-02-18 10:10       ` Ma, WenwuX
  0 siblings, 1 reply; 12+ messages in thread
From: Bruce Richardson @ 2022-02-18  9:41 UTC (permalink / raw)
  To: Ma, WenwuX; +Cc: Burakov, Anatoly, dev, Hu, Jiayu, Wang, Yinan, He, Xingguang

On Fri, Feb 18, 2022 at 06:49:19AM +0000, Ma, WenwuX wrote:
> 
> 
> > -----Original Message-----
> > From: Richardson, Bruce <bruce.richardson@intel.com>
> > Sent: 2022年2月17日 17:06
> > To: Ma, WenwuX <wenwux.ma@intel.com>
> > Cc: Burakov, Anatoly <anatoly.burakov@intel.com>; dev@dpdk.org; Hu,
> > Jiayu <jiayu.hu@intel.com>; Wang, Yinan <yinan.wang@intel.com>; He,
> > Xingguang <xingguang.he@intel.com>
> > Subject: Re: [PATCH] examples/multi_process: add options to control port
> > configuration
> >
> > On Thu, Feb 17, 2022 at 03:17:55PM +0000, Wenwu Ma wrote:
> > > 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> ---
> >
> > The idea seems reasonable enough, but I think the implementation requiring
> > the user to pass in special "magic numbers" for the offload values is not a
> > good idea. Perhaps add in a separate flag for "no-csum" to disable that.
> >
> > For the no-rss case, can you explain how you would see this app being used
> > in the absense of RSS support to distribute traffic among the separate
> > processes?
> 
> When app run in qemu vm and the backend is dpdk vhost, it will report error below:
> "virtio_dev_configure(): RSS support requested but not supported by the device"

Sure, I understand that. But how does it make sense to run multiple copies
of the app if RSS cannot be used to spread the traffic between the
instances?

^ permalink raw reply	[flat|nested] 12+ messages in thread

* RE: [PATCH] examples/multi_process: add options to control port configuration
  2022-02-18  9:41     ` Bruce Richardson
@ 2022-02-18 10:10       ` Ma, WenwuX
  2022-02-18 10:22         ` Bruce Richardson
  0 siblings, 1 reply; 12+ messages in thread
From: Ma, WenwuX @ 2022-02-18 10:10 UTC (permalink / raw)
  To: Richardson, Bruce
  Cc: Burakov, Anatoly, dev, Hu, Jiayu, Wang, Yinan, He, Xingguang



> -----Original Message-----
> From: Richardson, Bruce <bruce.richardson@intel.com>
> Sent: 2022年2月18日 17:42
> To: Ma, WenwuX <wenwux.ma@intel.com>
> Cc: Burakov, Anatoly <anatoly.burakov@intel.com>; dev@dpdk.org; Hu,
> Jiayu <jiayu.hu@intel.com>; Wang, Yinan <yinan.wang@intel.com>; He,
> Xingguang <xingguang.he@intel.com>
> Subject: Re: [PATCH] examples/multi_process: add options to control port
> configuration
> 
> On Fri, Feb 18, 2022 at 06:49:19AM +0000, Ma, WenwuX wrote:
> >
> >
> > > -----Original Message-----
> > > From: Richardson, Bruce <bruce.richardson@intel.com>
> > > Sent: 2022年2月17日 17:06
> > > To: Ma, WenwuX <wenwux.ma@intel.com>
> > > Cc: Burakov, Anatoly <anatoly.burakov@intel.com>; dev@dpdk.org; Hu,
> > > Jiayu <jiayu.hu@intel.com>; Wang, Yinan <yinan.wang@intel.com>; He,
> > > Xingguang <xingguang.he@intel.com>
> > > Subject: Re: [PATCH] examples/multi_process: add options to control
> > > port configuration
> > >
> > > On Thu, Feb 17, 2022 at 03:17:55PM +0000, Wenwu Ma wrote:
> > > > 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> ---
> > >
> > > The idea seems reasonable enough, but I think the implementation
> > > requiring the user to pass in special "magic numbers" for the
> > > offload values is not a good idea. Perhaps add in a separate flag for "no-
> csum" to disable that.
> > >
> > > For the no-rss case, can you explain how you would see this app
> > > being used in the absense of RSS support to distribute traffic among
> > > the separate processes?
> >
> > When app run in qemu vm and the backend is dpdk vhost, it will report
> error below:
> > "virtio_dev_configure(): RSS support requested but not supported by the
> device"
> 
> Sure, I understand that. But how does it make sense to run multiple copies of
> the app if RSS cannot be used to spread the traffic between the instances?

in test case, vhost backend has 2 queues, and we set fwd as txonly, and in vm, we run app as follows

./examples/multi_process/symmetric_mp/build/symmetric_mp -l 1 -n 4 --proc-type=auto -- -p 3 --num-procs=2 --proc-id=0
./examples/multi_process/symmetric_mp/build/symmetric_mp -l 2 -n 4 --proc-type=secondary -- -p 3 --num-procs=2 --proc-id=1

So,  instance 0 receive pkts in queue 0, and instance 1 receive pkts in queue 1.



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] examples/multi_process: add options to control port configuration
  2022-02-18 10:10       ` Ma, WenwuX
@ 2022-02-18 10:22         ` Bruce Richardson
  0 siblings, 0 replies; 12+ messages in thread
From: Bruce Richardson @ 2022-02-18 10:22 UTC (permalink / raw)
  To: Ma, WenwuX; +Cc: Burakov, Anatoly, dev, Hu, Jiayu, Wang, Yinan, He, Xingguang

On Fri, Feb 18, 2022 at 10:10:58AM +0000, Ma, WenwuX wrote:
> 
> 
> > -----Original Message-----
> > From: Richardson, Bruce <bruce.richardson@intel.com>
> > Sent: 2022年2月18日 17:42
> > To: Ma, WenwuX <wenwux.ma@intel.com>
> > Cc: Burakov, Anatoly <anatoly.burakov@intel.com>; dev@dpdk.org; Hu,
> > Jiayu <jiayu.hu@intel.com>; Wang, Yinan <yinan.wang@intel.com>; He,
> > Xingguang <xingguang.he@intel.com>
> > Subject: Re: [PATCH] examples/multi_process: add options to control port
> > configuration
> >
> > On Fri, Feb 18, 2022 at 06:49:19AM +0000, Ma, WenwuX wrote:
> > >
> > >
> > > > -----Original Message-----
> > > > From: Richardson, Bruce <bruce.richardson@intel.com>
> > > > Sent: 2022年2月17日 17:06
> > > > To: Ma, WenwuX <wenwux.ma@intel.com>
> > > > Cc: Burakov, Anatoly <anatoly.burakov@intel.com>; dev@dpdk.org; Hu,
> > > > Jiayu <jiayu.hu@intel.com>; Wang, Yinan <yinan.wang@intel.com>; He,
> > > > Xingguang <xingguang.he@intel.com>
> > > > Subject: Re: [PATCH] examples/multi_process: add options to control
> > > > port configuration
> > > >
> > > > On Thu, Feb 17, 2022 at 03:17:55PM +0000, Wenwu Ma wrote:
> > > > > 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> ---
> > > >
> > > > The idea seems reasonable enough, but I think the implementation
> > > > requiring the user to pass in special "magic numbers" for the
> > > > offload values is not a good idea. Perhaps add in a separate flag for "no-
> > csum" to disable that.
> > > >
> > > > For the no-rss case, can you explain how you would see this app
> > > > being used in the absense of RSS support to distribute traffic among
> > > > the separate processes?
> > >
> > > When app run in qemu vm and the backend is dpdk vhost, it will report
> > error below:
> > > "virtio_dev_configure(): RSS support requested but not supported by the
> > device"
> >
> > Sure, I understand that. But how does it make sense to run multiple copies of
> > the app if RSS cannot be used to spread the traffic between the instances?
> 
> in test case, vhost backend has 2 queues, and we set fwd as txonly, and in vm, we run app as follows
> 
> ./examples/multi_process/symmetric_mp/build/symmetric_mp -l 1 -n 4 --proc-type=auto -- -p 3 --num-procs=2 --proc-id=0
> ./examples/multi_process/symmetric_mp/build/symmetric_mp -l 2 -n 4 --proc-type=secondary -- -p 3 --num-procs=2 --proc-id=1
> 
> So,  instance 0 receive pkts in queue 0, and instance 1 receive pkts in queue 1.
> 
Interesting. So with vhost/virtio, the distribution of the traffic to
queues in entirely controls by the backend without the virtio PMD being
able to control it?

Anyway, if we want to allow running the app without rss, I would echo the
comment I made about "csum", in that we probably just want a suitably named
flag for it, rather than just requiring magic numbers from the user.

Two options therefore I'd suggest:
1. just make the app ignore errors with csum and RSS - if they are not
supported by a NIC, just log a warning and run the app anyway,
reconfiguring the NIC without them. Only quit the app if the second
reconfiguration fails.
2. Add explicit --no-csum and --no-rss flags.

I would actually tend towards the first option as more usable, but the
second could work too.

/Bruce

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2] examples/multi_process: reconfigure port when rss or csum isn't supported
  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
  0 siblings, 0 replies; 12+ messages in thread
From: Bruce Richardson @ 2022-02-21  9:21 UTC (permalink / raw)
  To: Wenwu Ma; +Cc: anatoly.burakov, dev, jiayu.hu, yinan.wang, xingguang.he

On Mon, Feb 21, 2022 at 03:35:18PM +0000, Wenwu Ma wrote:
> 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. This Patch make the app to reconfigure
> the NIC without them. Only quit the app if the second
> reconfiguration fails.
> 
> Signed-off-by: Wenwu Ma <wenwux.ma@intel.com>
> ---
>  examples/multi_process/symmetric_mp/main.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/examples/multi_process/symmetric_mp/main.c b/examples/multi_process/symmetric_mp/main.c
> index 050337765f..c0e7ed70e0 100644
> --- a/examples/multi_process/symmetric_mp/main.c
> +++ b/examples/multi_process/symmetric_mp/main.c
> @@ -232,6 +232,20 @@ smp_port_init(uint16_t port, struct rte_mempool *mbuf_pool,
>  	}
>  
>  	retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
> +	if (retval == -EINVAL) {
> +		printf("Maybe port %u don't have csum offloads capabilities, "
> +			"so clear csum config and try again.\n", port);

Two comments for here and below:
1. Don't split error messages across multiple lines, as it means the
user/developer cannot find them using "grep" on the code.
2. Text should try and be shorter and clearer. I'd suggest:
"Port configuration failed. Re-attempting with HW checksum disabled"


> +		port_conf.rxmode.offloads &= ~(RTE_ETH_RX_OFFLOAD_CHECKSUM);
> +		retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
> +	}
> +
> +	if (retval == -ENOTSUP) {
> +		printf("Maybe port %u don't support rss, "
> +			"so clear rss config and try again.\n", port);

Same two comments from above apply here.

> +		port_conf.rxmode.mq_mode &= ~(RTE_ETH_MQ_RX_RSS);
> +		retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
> +	}
> +
>  	if (retval < 0)
>  		return retval;
>  
> -- 
> 2.25.1
> 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH v2] examples/multi_process: reconfigure port when rss or csum isn't supported
  2022-02-17 15:17 [PATCH] examples/multi_process: add options to control port configuration Wenwu Ma
  2022-02-17  9:06 ` Bruce Richardson
@ 2022-02-21 15:35 ` Wenwu Ma
  2022-02-21  9:21   ` Bruce Richardson
  2022-02-22 10:51 ` [PATCH v3] " Wenwu Ma
  2 siblings, 1 reply; 12+ messages in thread
From: Wenwu Ma @ 2022-02-21 15:35 UTC (permalink / raw)
  To: anatoly.burakov; +Cc: dev, jiayu.hu, yinan.wang, xingguang.he, Wenwu Ma

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. This Patch make the app to reconfigure
the NIC without them. Only quit the app if the second
reconfiguration fails.

Signed-off-by: Wenwu Ma <wenwux.ma@intel.com>
---
 examples/multi_process/symmetric_mp/main.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/examples/multi_process/symmetric_mp/main.c b/examples/multi_process/symmetric_mp/main.c
index 050337765f..c0e7ed70e0 100644
--- a/examples/multi_process/symmetric_mp/main.c
+++ b/examples/multi_process/symmetric_mp/main.c
@@ -232,6 +232,20 @@ smp_port_init(uint16_t port, struct rte_mempool *mbuf_pool,
 	}
 
 	retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
+	if (retval == -EINVAL) {
+		printf("Maybe port %u don't have csum offloads capabilities, "
+			"so clear csum config and try again.\n", port);
+		port_conf.rxmode.offloads &= ~(RTE_ETH_RX_OFFLOAD_CHECKSUM);
+		retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
+	}
+
+	if (retval == -ENOTSUP) {
+		printf("Maybe port %u don't support rss, "
+			"so clear rss config and try again.\n", port);
+		port_conf.rxmode.mq_mode &= ~(RTE_ETH_MQ_RX_RSS);
+		retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
+	}
+
 	if (retval < 0)
 		return retval;
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH v3] examples/multi_process: reconfigure port when rss or csum isn't supported
  2022-02-22 10:51 ` [PATCH v3] " Wenwu Ma
@ 2022-02-22  9:41   ` Bruce Richardson
  2022-02-28  7:55     ` Ling, WeiX
  0 siblings, 1 reply; 12+ messages in thread
From: Bruce Richardson @ 2022-02-22  9:41 UTC (permalink / raw)
  To: Wenwu Ma; +Cc: anatoly.burakov, dev, jiayu.hu, yinan.wang, xingguang.he

On Tue, Feb 22, 2022 at 10:51:27AM +0000, Wenwu Ma wrote:
> 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. This Patch make the app to reconfigure
> the NIC without them. Only quit the app if the second
> reconfiguration fails.
> 
> Signed-off-by: Wenwu Ma <wenwux.ma@intel.com>
> ---

While I am surprised to see different error codes for different essentially
the same issue - lack of HW support, that is a separate problem to the one
this is addressing. Given this is just a sample app, I think this approach
is fine for configuring things - keeping things simple for the user.

Acked-by: Bruce Richardson <bruce.richardson@intel.com>

>  examples/multi_process/symmetric_mp/main.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/examples/multi_process/symmetric_mp/main.c b/examples/multi_process/symmetric_mp/main.c
> index 050337765f..0e991acdf2 100644
> --- a/examples/multi_process/symmetric_mp/main.c
> +++ b/examples/multi_process/symmetric_mp/main.c
> @@ -232,6 +232,20 @@ smp_port_init(uint16_t port, struct rte_mempool *mbuf_pool,
>  	}
>  
>  	retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
> +	if (retval == -EINVAL) {
> +		printf("Port %u configuration failed. Re-attempting with HW checksum disabled.\n",
> +			port);
> +		port_conf.rxmode.offloads &= ~(RTE_ETH_RX_OFFLOAD_CHECKSUM);
> +		retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
> +	}
> +
> +	if (retval == -ENOTSUP) {
> +		printf("Port %u configuration failed. Re-attempting with HW rss disabled.\n",
> +			port);
> +		port_conf.rxmode.mq_mode &= ~(RTE_ETH_MQ_RX_RSS);
> +		retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
> +	}
> +
>  	if (retval < 0)
>  		return retval;
>  
> -- 
> 2.25.1
> 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH v3] examples/multi_process: reconfigure port when rss or csum isn't supported
  2022-02-17 15:17 [PATCH] examples/multi_process: add options to control port configuration Wenwu Ma
  2022-02-17  9:06 ` 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-22 10:51 ` Wenwu Ma
  2022-02-22  9:41   ` Bruce Richardson
  2 siblings, 1 reply; 12+ messages in thread
From: Wenwu Ma @ 2022-02-22 10:51 UTC (permalink / raw)
  To: anatoly.burakov; +Cc: dev, jiayu.hu, yinan.wang, xingguang.he, Wenwu Ma

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. This Patch make the app to reconfigure
the NIC without them. Only quit the app if the second
reconfiguration fails.

Signed-off-by: Wenwu Ma <wenwux.ma@intel.com>
---
 examples/multi_process/symmetric_mp/main.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/examples/multi_process/symmetric_mp/main.c b/examples/multi_process/symmetric_mp/main.c
index 050337765f..0e991acdf2 100644
--- a/examples/multi_process/symmetric_mp/main.c
+++ b/examples/multi_process/symmetric_mp/main.c
@@ -232,6 +232,20 @@ smp_port_init(uint16_t port, struct rte_mempool *mbuf_pool,
 	}
 
 	retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
+	if (retval == -EINVAL) {
+		printf("Port %u configuration failed. Re-attempting with HW checksum disabled.\n",
+			port);
+		port_conf.rxmode.offloads &= ~(RTE_ETH_RX_OFFLOAD_CHECKSUM);
+		retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
+	}
+
+	if (retval == -ENOTSUP) {
+		printf("Port %u configuration failed. Re-attempting with HW rss disabled.\n",
+			port);
+		port_conf.rxmode.mq_mode &= ~(RTE_ETH_MQ_RX_RSS);
+		retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
+	}
+
 	if (retval < 0)
 		return retval;
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* RE: [PATCH v3] examples/multi_process: reconfigure port when rss or csum isn't supported
  2022-02-22  9:41   ` Bruce Richardson
@ 2022-02-28  7:55     ` Ling, WeiX
  2022-03-08 13:22       ` Thomas Monjalon
  0 siblings, 1 reply; 12+ messages in thread
From: Ling, WeiX @ 2022-02-28  7:55 UTC (permalink / raw)
  To: Richardson, Bruce, Ma, WenwuX
  Cc: Burakov, Anatoly, dev, Hu, Jiayu, Wang, Yinan, He, Xingguang

> -----Original Message-----
> From: Bruce Richardson <bruce.richardson@intel.com>
> Sent: Tuesday, February 22, 2022 5:41 PM
> To: Ma, WenwuX <wenwux.ma@intel.com>
> Cc: Burakov, Anatoly <anatoly.burakov@intel.com>; dev@dpdk.org; Hu,
> Jiayu <jiayu.hu@intel.com>; Wang, Yinan <yinan.wang@intel.com>; He,
> Xingguang <xingguang.he@intel.com>
> Subject: Re: [PATCH v3] examples/multi_process: reconfigure port when rss
> or csum isn't supported
> 
> On Tue, Feb 22, 2022 at 10:51:27AM +0000, Wenwu Ma wrote:
> > 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.
> > This Patch make the app to reconfigure the NIC without them. Only quit
> > the app if the second reconfiguration fails.
> >
> > Signed-off-by: Wenwu Ma <wenwux.ma@intel.com>
> > ---
> 
> While I am surprised to see different error codes for different essentially the
> same issue - lack of HW support, that is a separate problem to the one this is
> addressing. Given this is just a sample app, I think this approach is fine for
> configuring things - keeping things simple for the user.
> 
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> 
Tested-by: Wei Ling <weix.ling@intel.com>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v3] examples/multi_process: reconfigure port when rss or csum isn't supported
  2022-02-28  7:55     ` Ling, WeiX
@ 2022-03-08 13:22       ` Thomas Monjalon
  0 siblings, 0 replies; 12+ messages in thread
From: Thomas Monjalon @ 2022-03-08 13:22 UTC (permalink / raw)
  To: Richardson, Bruce, Ma, WenwuX
  Cc: dev, Burakov, Anatoly, Hu, Jiayu, Wang, Yinan, He, Xingguang, Ling, WeiX

28/02/2022 08:55, Ling, WeiX:
> From: Bruce Richardson <bruce.richardson@intel.com>
> > On Tue, Feb 22, 2022 at 10:51:27AM +0000, Wenwu Ma wrote:
> > > 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.
> > > This Patch make the app to reconfigure the NIC without them. Only quit
> > > the app if the second reconfiguration fails.
> > >
> > > Signed-off-by: Wenwu Ma <wenwux.ma@intel.com>
> > > ---
> > 
> > While I am surprised to see different error codes for different essentially the
> > same issue - lack of HW support, that is a separate problem to the one this is
> > addressing. Given this is just a sample app, I think this approach is fine for
> > configuring things - keeping things simple for the user.
> > 
> > Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> > 
> Tested-by: Wei Ling <weix.ling@intel.com>

Applied with title "examples/multi_process: make RSS and checksum optional"



^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2022-03-08 13:22 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-17 15:17 [PATCH] examples/multi_process: add options to control port configuration Wenwu Ma
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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.