[dpdk-dev] [RFC PATCH] ethdev: clarify flow action PORT ID semantics

Ivan Malov Ivan.Malov at oktetlabs.ru
Tue Jun 1 16:28:24 CEST 2021


Hi Ilya,

Thank you for reviewing the proposal at such short notice. I'm afraid 
that prior discussions overlook the simple fact that the whole problem 
is not limited to just VF representors. Action PORT_ID is also used with 
respect to the admin PF's ethdev, which "represents itself" (and by no 
means it represents the underlying physical/network port). In this case, 
one cannot state that the application treats it as a physical port, just 
like one states that the application perceives representors as VFs 
themselves.

Given these facts, it would not be quite right to just align the 
documentation with the de-facto action meaning assumed by OvS.

On 01/06/2021 15:10, Ilya Maximets wrote:
> On 6/1/21 1:14 PM, Ivan Malov wrote:
>> By its very name, action PORT_ID means that packets hit an ethdev with the
>> given DPDK port ID. At least the current comments don't state the opposite.
>> That said, since port representors had been adopted, applications like OvS
>> have been misusing the action. They misread its purpose as sending packets
>> to the opposite end of the "wire" plugged to the given ethdev, for example,
>> redirecting packets to the VF itself rather than to its representor ethdev.
>> Another example: OvS relies on this action with the admin PF's ethdev port
>> ID specified in it in order to send offloaded packets to the physical port.
>>
>> Since there might be applications which use this action in its valid sense,
>> one can't just change the documentation to greenlight the opposite meaning.
>> This patch adds an explicit bit to the action configuration which will let
>> applications, depending on their needs, leverage the two meanings properly.
>> Applications like OvS, as well as PMDs, will have to be corrected when the
>> patch has been applied. But the improved clarity of the action is worth it.
>>
>> The proposed change is not the only option. One could avoid changes in OvS
>> and PMDs if the new configuration field had the opposite meaning, with the
>> action itself meaning delivery to the represented port and not to DPDK one.
>> Alternatively, one could define a brand new action with the said behaviour.
> 
> We had already very similar discussions regarding the understanding of what
> the representor really is from the DPDK API's point of view, and the last
> time, IIUC, it was concluded by a tech. board that representor should be
> a "ghost of a VF", i.e. DPDK APIs should apply configuration by default to
> VF and not to the representor device:
>    https://patches.dpdk.org/project/dpdk/cover/20191029185051.32203-1-thomas@monjalon.net/#104376
> This wasn't enforced though, IIUC, for existing code and semantics is still mixed.
> 
> I still think that configuration should be applied to VF, and the same applies
> to rte_flow API.  IMHO, average application should not care if device is
> a VF itself or its representor.  Everything should work exactly the same.
> I think this matches with the original idea/design of the switchdev functionality
> in the linux kernel and also matches with how the average user thinks about
> representor devices.
> 
> If some specific use-case requires to distinguish VF from the representor,
> there should probably be a separate special API/flag for that.
> 
> Best regards, Ilya Maximets.
> 

-- 
Ivan M


More information about the dev mailing list