[dpdk-dev] [PATCH] app/testpmd:vlan filter fail

Wu, Yanglong yanglong.wu at intel.com
Mon Feb 5 02:51:38 CET 2018


Hi,
Thanks for your review. I got it!

Yanglong Wu
-----Original Message-----
From: Shahaf Shuler [mailto:shahafs at mellanox.com] 
Sent: Sunday, February 4, 2018 2:27 PM
To: Wu, Yanglong <yanglong.wu at intel.com>; dev at dpdk.org
Cc: Lu, Wenzhuo <wenzhuo.lu at intel.com>
Subject: RE: [PATCH] app/testpmd:vlan filter fail

Hi Wu,

Indeed there is an issue here, but this is not the right fix.

Friday, February 2, 2018 7:10 AM, Yanglong Wu:
> Subject: [PATCH] app/testpmd:vlan filter fail
> 
> Removing out port_conf.rxmode.hw_vlan_filter = 1 will let it equal to 
> 0 and port_conf.rxmode.offloads is assigned as 0 again if 
> hw_vlan_filter = 1. So it will always lead to fail for vlan filter 
> setting
> 
> Fix:0074d02fc(convert to new Rx offloads API)
> Signed-off-by: Yanglong Wu <yanglong.wu at intel.com>
> ---
>  app/test-pmd/testpmd.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 
> 5dc8ccac5..0751e573c 100644
> --- a/app/test-pmd/testpmd.c
> +++ b/app/test-pmd/testpmd.c
> @@ -2328,7 +2328,7 @@ init_port_dcb_config(portid_t pid,
>  	retval = get_eth_dcb_conf(&port_conf, dcb_mode, num_tcs, pfc_en);
>  	if (retval < 0)
>  		return retval;
> -	port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_VLAN_FILTER;
> +	port_conf.rxmode.hw_vlan_filter = 1;

The VLAN filter resets because the rxmode.ignore_offload_bitfield is not set. If it was set, the ethdev rxmode convert functions would have convert the new flag to the old API (rxmode.hw_vlan_filter).

Am not much familiar with this configuration but here is a suggested fix:

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index d8ac43268..caf282386 100644                           
--- a/app/test-pmd/testpmd.c                                
+++ b/app/test-pmd/testpmd.c                                
@@ -2324,6 +2324,8 @@ init_port_dcb_config(portid_t pid,    
        rte_port = &ports[pid];                             
                                                            
        memset(&port_conf, 0, sizeof(struct rte_eth_conf)); 
+       port_conf.rxmode = rte_port->dev_conf.rxmode;       
+       port_conf.txmode = rte_port->dev_conf.txmode;       
        /* Enter DCB configuration status */                
        dcb_config = 1;                                     
                                                            

The port_conf for the dcb configuration will inherit the same configuration of the port (which has the ignore_offload_bitfield set).
Otherwise, at least the rxmode.ignore_offload_bitfield must be set. 
> 
>  	/**
>  	 * Write the configuration into the device.
> --
> 2.11.0



More information about the dev mailing list