[PATCH] ethdev: add calculate hash function

Ferruh Yigit ferruh.yigit at amd.com
Wed Oct 11 10:34:50 CEST 2023


On 10/11/2023 3:11 AM, fengchengwen wrote:
> Hi,
> 
> On 2023/10/10 19:05, Ferruh Yigit wrote:
>> On 9/26/2023 12:37 PM, Ori Kam wrote:
>>> rte_flow supports insert by index table[1].
>>>
>>> Using the above table, the application can create rules
>>> that are based on hash.
>>> For example application can create the following logic in order
>>> to create load balancing:
>>> 1. Create insert by index table with 2 rules, that hashes based on dmac
>>> 2. Insert to index 0 a rule that sends the traffic to port A.
>>> 3. Insert to index 1 a rule that sends the traffic to port B.
>>>
>>> Let's also assume that before this table, there is a 5 tuple
>>> match table that jumps to the above table.
>>>
>>> So each packet that matches one of the 5 tuple rules is RSSed
>>> to port A or B, based on dmac hash.
>>>
>>> The issue arises when there is a miss on the 5 tuple table,
>>> which resulted due to the packet being the first packet of this flow, or
>>> fragmented packet or any other reason.
>>> In this case, the application must calculate what would be the
>>> hash calculated by the HW so it can send the packet to the correct
>>> port.
>>>
>>> This new API allows applications to calculate the hash value of a given
>>> packet for a given table.
>>>
>>> [1] - http://patches.dpdk.org/project/dpdk/patch/20230208030624.78465-2-akozyrev@nvidia.com/
>>>
>>> Signed-off-by: Ori Kam <orika at nvidia.com>
>>> ---
>>>  app/test-pmd/cmdline_flow.c  | 86 +++++++++++++++++++++++++++++++++++-
>>>  app/test-pmd/config.c        | 54 ++++++++++++++++++++++
>>>  app/test-pmd/testpmd.h       |  2 +
>>>  lib/ethdev/rte_flow.c        | 21 +++++++++
>>>  lib/ethdev/rte_flow.h        | 32 ++++++++++++++
>>>  lib/ethdev/rte_flow_driver.h |  5 +++
>>>  lib/ethdev/version.map       |  1 +
>>>  7 files changed, 200 insertions(+), 1 deletion(-)
>>>
>>
>> This is a new rte_flow API but unfortunately there isn't any
>> review/comment, at least it is experimental API. If there is no
>> objection/discussion in next few days, I will merge the feature.
>>
>> Probably it will be another rte flow feature that only NVIDIA knows and
>> uses. While mentioned from using, is the driver update for the feature
> 
> The hns3 driver support subset of rte_flow, we found the rte_flow feature is very flexible.
> And its implementation varies according to vendors.
> 
> Can the rte_flow be standardized ?
> 

Hi Chengwen,

Yes rte_flow is already implemented by many vendors, each uses some
subset of it. It is flexible and useful, no concern about it.

My point was, most of the new rte_flow features are coming from single
vendor and most of them are not fully reviewed by the wider community.

As some of the features merged without much review from wider community,
not everyone aware of them, and features are not fully benefited from,
although that is somewhat related to HW support as Jerin pointed before.


As hns3 is a user of the rte_flow already, it would be great to get more
feedback and review from hns3 maintainers, that boosts the confidence to
the new proposed features/APIs.


Thanks,
ferruh


>> planned for this release?
>>
>>
>> Meanwhile, can you please update the documentation, `rte_flow.rst` and
>> `testpmd_funcs.rst`?
>> Also can you please rebase on top of latest next-net, this patch
>> conflicts with merged group set miss action feature.
>>
>> .
>>



More information about the dev mailing list