On 3/31/2019 7:58 PM, Nithin Kumar Dabilpuram wrote:
> Hi Ferruh Yigit,
> 
> Sorry, missed to see your inline comment about the check in v1.
> 
>>> @@ tx_vlan_set(portid_t port_id, uint16_t vlan_id)
>>>     if (vlan_id_is_invalid(vlan_id))
>>>             return;
>>>  
>>> -   vlan_offload = rte_eth_dev_get_vlan_offload(port_id);
>>> -   if (vlan_offload & ETH_VLAN_EXTEND_OFFLOAD) {
>>> -           printf("Error, as QinQ has been enabled.\n");
>>> -           return;
>>> -   }
> 
>> Here I think intention is if QINQ is enabled 'tx_vlan_id' & 
>> 'tx_vlan_id_outer'
>> should be set by tx_qinq_set() not 'tx_vlan_set', and check is for that.
> 
>> What do you think keeping same logic?
>> But of course check should be if 'ports[port_id].dev_conf.txmode.offloads' 
>> has 'DEV_TX_OFFLOAD_QINQ_INSERT' instead of above check.
> 
> Since tx_vlan_set() and tx_qinq_set() are they themselves are 
> resetting/setting those flags in 'ports[port_id].dev_conf.txmode.offloads', 
> do you think having such a check before clearing and setting flags be 
> consistent ?
> Current behavior is to override last setting with new setting. All the 
> settings could be completely disabled by cmdline "tx vlan reset"

When QINQ offload is enabled:
  'vlan_id' & 'vlan_id_outer' should be set together via 'tx_qinq_set()'
  This is "tx_vlan set <port_id> <vlan_id> <outer_vlan_id>" command

When VLAN offload is enabled:
  'vlan_id' should be set via 'tx_vlan_set()'
  This is "tx_vlan set <port_id> <vlan_id>" command

basically, the check above is to prevent to setting only 'vlan_id' once both
"<vlan_id> <outer_vlan_id>" set.

I don't know the main reason of the intention of current implementation, I
assume it is to help user to prevent make mistake.

This patch is to prevent 'ETH_VLAN_EXTEND_OFFLOAD' dependency, I believe it
makes sense.

But my concern this patch is also changing above intention silently, and if we
should keep the intention?

If you think that QINQ protection is also should removed, that is OK, only
please make it separate patch with describing the impact.

Thanks,
ferruh

> 
> --
> Thanks
> Nithin
> 
> 
> 
> -----Original Message-----
> From: Ferruh Yigit <ferruh.yi...@intel.com> 
> Sent: Thursday, March 21, 2019 10:41 PM
> To: Nithin Kumar Dabilpuram <ndabilpu...@marvell.com>; Wenzhuo Lu 
> <wenzhuo...@intel.com>; Jingjing Wu <jingjing...@intel.com>; Bernard 
> Iremonger <bernard.iremon...@intel.com>
> Cc: dev@dpdk.org; xiao.w.w...@intel.com
> Subject: [EXT] Re: [dpdk-dev] [PATCH v2 1/2] app/testpmd: fix tx vlan and 
> qinq dependency
> 
> External Email
> 
> ----------------------------------------------------------------------
> On 3/18/2019 9:56 AM, Nithin Kumar Dabilpuram wrote:
>> Tx VLAN & QinQ insert enable need not depend on Rx VLAN offload 
>> ETH_VLAN_EXTEND_OFFLOAD.
>>
>> Fixes: 6a34f91690d0 ("app/testpmd: fix error message when setting Tx 
>> VLAN")
>> Cc: xiao.w.w...@intel.com
>>
>> Signed-off-by: Nithin Dabilpuram <ndabilpu...@marvell.com>
> 
> <...>
> 
>> @@ -2963,11 +2962,6 @@ tx_vlan_set(portid_t port_id, uint16_t vlan_id)
>>      if (vlan_id_is_invalid(vlan_id))
>>              return;
>>  
>> -    vlan_offload = rte_eth_dev_get_vlan_offload(port_id);
>> -    if (vlan_offload & ETH_VLAN_EXTEND_OFFLOAD) {
>> -            printf("Error, as QinQ has been enabled.\n");
>> -            return;
>> -    }
> 
> It looks like you didn't take account comment on this in previous version, 
> can you please check it?
> 

Reply via email to