[5/5] examples/l3fwd-power: support virtio/vhost

Message ID 20210910130548.127017-6-miao.li@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Maxime Coquelin
Headers
Series CPU Enabling: Implement rte_power_monitor API in virtio/vhost PMD |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/github-robot: build success github build: passed
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS

Commit Message

Li, Miao Sept. 10, 2021, 1:05 p.m. UTC
  This patch adds two command line arguments which will be needed when using
virtio/vhost vdev. One argument sets rx offloads capabilities
DEV_RX_OFFLOAD_VLAN_STRIP. The other argument sets DCB, PSS and VMDQ off
for RX side.

Signed-off-by: Miao Li <miao.li@intel.com>
---
 examples/l3fwd-power/main.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
  

Comments

Maxime Coquelin Sept. 10, 2021, 7:24 a.m. UTC | #1
On 9/10/21 3:05 PM, Miao Li wrote:
> This patch adds two command line arguments which will be needed when using
> virtio/vhost vdev. One argument sets rx offloads capabilities
> DEV_RX_OFFLOAD_VLAN_STRIP. The other argument sets DCB, PSS and VMDQ off
> for RX side.
> 
> Signed-off-by: Miao Li <miao.li@intel.com>
> ---
>  examples/l3fwd-power/main.c | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
> 
> diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c
> index aa7b8db44a..4e28008578 100644
> --- a/examples/l3fwd-power/main.c
> +++ b/examples/l3fwd-power/main.c
> @@ -1811,6 +1811,8 @@ parse_args(int argc, char **argv)
>  		{"high-perf-cores", 1, 0, 0},
>  		{"no-numa", 0, 0, 0},
>  		{"enable-jumbo", 0, 0, 0},
> +		{"vlan-strip", 0, 0, 0},
> +		{"rx-none", 0, 0, 0},
>  		{CMD_LINE_OPT_EMPTY_POLL, 1, 0, 0},
>  		{CMD_LINE_OPT_PARSE_PTYPE, 0, 0, 0},
>  		{CMD_LINE_OPT_LEGACY, 0, 0, 0},
> @@ -1986,6 +1988,19 @@ parse_args(int argc, char **argv)
>  				(unsigned int)port_conf.rxmode.max_rx_pkt_len);
>  			}
>  
> +			if (!strncmp(lgopts[option_index].name,
> +					"vlan-strip", 10)) {
> +				printf("set vlan strip\n");
> +				port_conf.rxmode.offloads =
> +						DEV_RX_OFFLOAD_VLAN_STRIP;
> +			}
> +
> +			if (!strncmp(lgopts[option_index].name,
> +					"rx-none", 7)) {
> +				printf("none of DCB,RSS or VMDQ mode\n");
> +				port_conf.rxmode.mq_mode = ETH_MQ_RX_NONE;
> +			}
> +
>  			if (!strncmp(lgopts[option_index].name,
>  				     CMD_LINE_OPT_PARSE_PTYPE,
>  				     sizeof(CMD_LINE_OPT_PARSE_PTYPE))) {
> 

Why not just rely on the capabilities exposed by the driver?

Maxime
  
Li, Miao Sept. 10, 2021, 8:33 a.m. UTC | #2
In l3fwd-power, there is default port configuration which requires RSS and IPV4/UDP/TCP checksum. Once device does not support these, the l3fwd-power will exit and report an error.

Miao

-----Original Message-----
From: Maxime Coquelin <maxime.coquelin@redhat.com> 
Sent: Friday, September 10, 2021 3:24 PM
To: Li, Miao <miao.li@intel.com>; dev@dpdk.org
Cc: Xia, Chenbo <chenbo.xia@intel.com>; David Marchand <david.marchand@redhat.com>
Subject: Re: [PATCH 5/5] examples/l3fwd-power: support virtio/vhost



On 9/10/21 3:05 PM, Miao Li wrote:
> This patch adds two command line arguments which will be needed when 
> using virtio/vhost vdev. One argument sets rx offloads capabilities 
> DEV_RX_OFFLOAD_VLAN_STRIP. The other argument sets DCB, PSS and VMDQ 
> off for RX side.
> 
> Signed-off-by: Miao Li <miao.li@intel.com>
> ---
>  examples/l3fwd-power/main.c | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
> 
> diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c 
> index aa7b8db44a..4e28008578 100644
> --- a/examples/l3fwd-power/main.c
> +++ b/examples/l3fwd-power/main.c
> @@ -1811,6 +1811,8 @@ parse_args(int argc, char **argv)
>  		{"high-perf-cores", 1, 0, 0},
>  		{"no-numa", 0, 0, 0},
>  		{"enable-jumbo", 0, 0, 0},
> +		{"vlan-strip", 0, 0, 0},
> +		{"rx-none", 0, 0, 0},
>  		{CMD_LINE_OPT_EMPTY_POLL, 1, 0, 0},
>  		{CMD_LINE_OPT_PARSE_PTYPE, 0, 0, 0},
>  		{CMD_LINE_OPT_LEGACY, 0, 0, 0},
> @@ -1986,6 +1988,19 @@ parse_args(int argc, char **argv)
>  				(unsigned int)port_conf.rxmode.max_rx_pkt_len);
>  			}
>  
> +			if (!strncmp(lgopts[option_index].name,
> +					"vlan-strip", 10)) {
> +				printf("set vlan strip\n");
> +				port_conf.rxmode.offloads =
> +						DEV_RX_OFFLOAD_VLAN_STRIP;
> +			}
> +
> +			if (!strncmp(lgopts[option_index].name,
> +					"rx-none", 7)) {
> +				printf("none of DCB,RSS or VMDQ mode\n");
> +				port_conf.rxmode.mq_mode = ETH_MQ_RX_NONE;
> +			}
> +
>  			if (!strncmp(lgopts[option_index].name,
>  				     CMD_LINE_OPT_PARSE_PTYPE,
>  				     sizeof(CMD_LINE_OPT_PARSE_PTYPE))) {
> 

Why not just rely on the capabilities exposed by the driver?

Maxime
  
David Marchand Sept. 10, 2021, 8:50 a.m. UTC | #3
On Fri, Sep 10, 2021 at 10:34 AM Li, Miao <miao.li@intel.com> wrote:
>
> In l3fwd-power, there is default port configuration which requires RSS and IPV4/UDP/TCP checksum. Once device does not support these, the l3fwd-power will exit and report an error.

Maxime suggested to update the port configuration based on its capabilities.

For RSS, it would be something like what I proposed for OVS:
https://patchwork.ozlabs.org/project/openvswitch/patch/20210830101304.13689-1-david.marchand@redhat.com/

As for IPv4/UDP/TCP rx checksums, I am not sure there is any actual
requirement for this app.
Probably something to investigate wrt DO_RFC_1812_CHECKS.
  
Li, Miao Sept. 13, 2021, 1:41 a.m. UTC | #4
Got it. I will change the codes and add the port configuration updating according to the device information. Thanks!

Miao

> -----Original Message-----
> From: David Marchand <david.marchand@redhat.com>
> Sent: Friday, September 10, 2021 4:50 PM
> To: Li, Miao <miao.li@intel.com>
> Cc: Maxime Coquelin <maxime.coquelin@redhat.com>; dev@dpdk.org; Xia,
> Chenbo <chenbo.xia@intel.com>
> Subject: Re: [dpdk-dev] [PATCH 5/5] examples/l3fwd-power: support
> virtio/vhost
> 
> On Fri, Sep 10, 2021 at 10:34 AM Li, Miao <miao.li@intel.com> wrote:
> >
> > In l3fwd-power, there is default port configuration which requires RSS and
> IPV4/UDP/TCP checksum. Once device does not support these, the l3fwd-
> power will exit and report an error.
> 
> Maxime suggested to update the port configuration based on its capabilities.
> 
> For RSS, it would be something like what I proposed for OVS:
> https://patchwork.ozlabs.org/project/openvswitch/patch/20210830101304.1
> 3689-1-david.marchand@redhat.com/
> 
> As for IPv4/UDP/TCP rx checksums, I am not sure there is any actual
> requirement for this app.
> Probably something to investigate wrt DO_RFC_1812_CHECKS.
> 
> 
> --
> David Marchand
  

Patch

diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c
index aa7b8db44a..4e28008578 100644
--- a/examples/l3fwd-power/main.c
+++ b/examples/l3fwd-power/main.c
@@ -1811,6 +1811,8 @@  parse_args(int argc, char **argv)
 		{"high-perf-cores", 1, 0, 0},
 		{"no-numa", 0, 0, 0},
 		{"enable-jumbo", 0, 0, 0},
+		{"vlan-strip", 0, 0, 0},
+		{"rx-none", 0, 0, 0},
 		{CMD_LINE_OPT_EMPTY_POLL, 1, 0, 0},
 		{CMD_LINE_OPT_PARSE_PTYPE, 0, 0, 0},
 		{CMD_LINE_OPT_LEGACY, 0, 0, 0},
@@ -1986,6 +1988,19 @@  parse_args(int argc, char **argv)
 				(unsigned int)port_conf.rxmode.max_rx_pkt_len);
 			}
 
+			if (!strncmp(lgopts[option_index].name,
+					"vlan-strip", 10)) {
+				printf("set vlan strip\n");
+				port_conf.rxmode.offloads =
+						DEV_RX_OFFLOAD_VLAN_STRIP;
+			}
+
+			if (!strncmp(lgopts[option_index].name,
+					"rx-none", 7)) {
+				printf("none of DCB,RSS or VMDQ mode\n");
+				port_conf.rxmode.mq_mode = ETH_MQ_RX_NONE;
+			}
+
 			if (!strncmp(lgopts[option_index].name,
 				     CMD_LINE_OPT_PARSE_PTYPE,
 				     sizeof(CMD_LINE_OPT_PARSE_PTYPE))) {