[dpdk-dev] [PATCH v2 08/15] ethdev: add hash function to RSS flow API action
Andrew Rybchenko
arybchenko at solarflare.com
Fri Apr 6 17:41:35 CEST 2018
On 04/06/2018 04:25 PM, Adrien Mazarguil wrote:
> By definition, RSS involves some kind of hash algorithm, usually Toeplitz.
>
> Until now it could not be modified on a flow rule basis and PMDs had to
> always assume RTE_ETH_HASH_FUNCTION_DEFAULT, which remains the default
> behavior when unspecified (0).
>
> This breaks ABI compatibility for the following public functions:
>
> - rte_flow_copy()
> - rte_flow_create()
> - rte_flow_query()
> - rte_flow_validate()
>
> Signed-off-by: Adrien Mazarguil <adrien.mazarguil at 6wind.com>
> Cc: Ferruh Yigit <ferruh.yigit at intel.com>
> Cc: Thomas Monjalon <thomas at monjalon.net>
> Cc: Wenzhuo Lu <wenzhuo.lu at intel.com>
> Cc: Jingjing Wu <jingjing.wu at intel.com>
> Cc: Beilei Xing <beilei.xing at intel.com>
> Cc: Qi Zhang <qi.z.zhang at intel.com>
> Cc: Konstantin Ananyev <konstantin.ananyev at intel.com>
> Cc: Nelio Laranjeiro <nelio.laranjeiro at 6wind.com>
> Cc: Yongseok Koh <yskoh at mellanox.com>
> Cc: Andrew Rybchenko <arybchenko at solarflare.com>
> Cc: Pascal Mazon <pascal.mazon at 6wind.com>
> ---
> app/test-pmd/cmdline_flow.c | 72 ++++++++++++++++++++++++
> app/test-pmd/config.c | 1 +
> doc/guides/prog_guide/rte_flow.rst | 2 +
> doc/guides/testpmd_app_ug/testpmd_funcs.rst | 3 +
> drivers/net/e1000/igb_flow.c | 4 ++
> drivers/net/e1000/igb_rxtx.c | 4 +-
> drivers/net/i40e/i40e_ethdev.c | 4 +-
> drivers/net/i40e/i40e_flow.c | 4 ++
> drivers/net/ixgbe/ixgbe_flow.c | 4 ++
> drivers/net/ixgbe/ixgbe_rxtx.c | 4 +-
> drivers/net/mlx4/mlx4_flow.c | 7 +++
> drivers/net/mlx5/mlx5_flow.c | 13 +++++
> drivers/net/sfc/sfc_flow.c | 3 +
> drivers/net/tap/tap_flow.c | 6 ++
> lib/librte_ether/rte_flow.c | 1 +
> lib/librte_ether/rte_flow.h | 2 +
> 16 files changed, 131 insertions(+), 3 deletions(-)
<...>
> diff --git a/drivers/net/sfc/sfc_flow.c b/drivers/net/sfc/sfc_flow.c
> index 1a2c0299c..dbe4c2baa 100644
> --- a/drivers/net/sfc/sfc_flow.c
> +++ b/drivers/net/sfc/sfc_flow.c
> @@ -1261,6 +1261,9 @@ sfc_flow_parse_rss(struct sfc_adapter *sa,
> rxq_hw_index_max = rxq->hw_index;
> }
>
> + if (rss->func)
May be it is better to compare with RTE_ETH_HASH_FUNCTION_DEFAULT
explicitly? I think it is more readable. If so, it is applicable to all
similar checks
in the patch.
In the case of sfc, please, allow RTE_ETH_HASH_FUNCTION_TOEPLITZ as well.
I'd suggest:
switch (rss->func) {
case RTE_ETH_HASH_FUNCTION_DEFAULT:
case RTE_ETH_HASH_FUNCTION_TOEPLITZ:
break;
default:
return -EINVAL;
}
> + return -EINVAL;
> +
> if ((rss->types & ~SFC_RSS_OFFLOADS) != 0)
> return -EINVAL;
>
<...>
More information about the dev
mailing list