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

Maxime Coquelin maxime.coquelin at redhat.com
Fri Sep 10 09:24:21 CEST 2021



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 at 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



More information about the dev mailing list