[PATCH v4 2/3] common/sfc_efx/base: add support to enable VLAN stripping

Andrew Rybchenko andrew.rybchenko at oktetlabs.ru
Thu Jun 8 14:37:24 CEST 2023


On 6/8/23 14:16, Artemii Morozov wrote:
> Hello,
> 
> On 6/2/23 12:32, Andrew Rybchenko wrote:
>> On 6/1/23 18:30, Artemii Morozov wrote:
>>> To enable VLAN stripping, two conditions must be met:
>>> the corresponding flag must be set and the appropriate
>>> RX prefix should be requested.
>>
>> RX -> Rx
>>
>>> VLAN stripping is supported for ef100 datapath only.
>>
>> When you read below notes carefully, you'll understand that the
>> patch is very raw yet. There are too many questions below.
>>
>> The major decision to be made is if libefx API should enforce
>> device level offload or should just provide transparent API and
>> driver must be responsible for consistency.
>>
>> If driver must be responsible for consistency, don't try to
>> enforce VLAN stripping enable via filter table. RxQ flags
>> should control stripped VLAN delivery. Filter flag and default
>> RxQ set flag (API should be extended) should control VLAN
>> stripping enabling.
>>
>> If libefx must guarantee consistency, we need a new way to
>> enable device level offload early (efx_rx_init()-like, may
>> be a new API). If so, it should be impossible to control
>> VLAN stripping per Rx filter. It still could be possible
>> to control stripped VLAN delivery per RxQ.
>>
>> Anyway current solution is really inconsistent.
> 
> How about the following concept:
> 
> 1. Add a new negotiated flag for metadata: RTE_ETH_RX_METADATA_VLAN_INFO.
> 
> 2. Extend the driver to allow requesting the delivery of stripped VLAN 
> TCI through the metadata
>      negotiation method. This request will internally affect the Rx 
> prefix configuration via
>      libefx EFX_RXQ_FLAG_VLAN_TCI (or something like that).
> 
> 3.  Set the corresponding boolean flag in the sfc_port(strip_vlan = 
> something like that please advice)
>       structure if RTE_ETH_RX_OFFLOAD_VLAN_STRIP is received. Map this 
> flag to the corresponding flag in
>       efx_nic_t, Then, when generating specs for filters, use the 
> boolean flag from efx_nic_t to determine
>       the VLAN stripping behavior.
> 
> 4. Users can request VLAN strip action. If a user does not request this 
> action, but the driver detects that
>     device-level stripping has been requested, it may implicitly enable 
> VLAN stripping for that specific flow
>     within the efx_mcdi_filter_op_add function.
> 
> In this concept, we allow the enabling of device-level VLAN stripping. 
> Points 1 and 2 concern the delivery of stripped VLAN TCI, while points 3 
> and 4 pertain to the request for VLAN tag stripping.
> 

It does not reply my questions and I see no single point to
complicate VLAN stripping configuration and introduce
corresponding Rx metadata control. Device-level offload is
sufficient and configured early enough to do its job.



More information about the dev mailing list