netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tariq Toukan <ttoukan.linux@gmail.com>
To: Maxim Mikityanskiy <maxtram95@gmail.com>,
	Saeed Mahameed <saeedm@nvidia.com>
Cc: Leon Romanovsky <leon@kernel.org>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	netdev@vger.kernel.org, Maxim Mikityanskiy <maxim@isovalent.com>,
	Tariq Toukan <tariqt@nvidia.com>
Subject: Re: [PATCH net] net/mlx5e: Fix ethtool -N flow-type ip4 to RSS context
Date: Thu, 20 Mar 2025 09:32:26 +0200	[thread overview]
Message-ID: <0fa82602-3b4c-46a7-bdfc-e8a9535e74c1@gmail.com> (raw)
In-Reply-To: <20250319124508.3979818-1-maxim@isovalent.com>



On 19/03/2025 14:45, Maxim Mikityanskiy wrote:
> There commands can be used to add an RSS context and steer some traffic
> into it:
> 
>      # ethtool -X eth0 context new
>      New RSS context is 1
>      # ethtool -N eth0 flow-type ip4 dst-ip 1.1.1.1 context 1
>      Added rule with ID 1023
> 
> However, the second command fails with EINVAL on mlx5e:
> 
>      # ethtool -N eth0 flow-type ip4 dst-ip 1.1.1.1 context 1
>      rmgr: Cannot insert RX class rule: Invalid argument
>      Cannot insert classification rule
> 
> It happens when flow_get_tirn calls flow_type_to_traffic_type with
> flow_type = IP_USER_FLOW or IPV6_USER_FLOW. That function only handles
> IPV4_FLOW and IPV6_FLOW cases, but unlike all other cases which are
> common for hash and spec, IPv4 and IPv6 defines different contants for
> hash and for spec:
> 
>      #define	TCP_V4_FLOW	0x01	/* hash or spec (tcp_ip4_spec) */
>      #define	UDP_V4_FLOW	0x02	/* hash or spec (udp_ip4_spec) */
>      ...
>      #define	IPV4_USER_FLOW	0x0d	/* spec only (usr_ip4_spec) */
>      #define	IP_USER_FLOW	IPV4_USER_FLOW
>      #define	IPV6_USER_FLOW	0x0e	/* spec only (usr_ip6_spec; nfc only) */
>      #define	IPV4_FLOW	0x10	/* hash only */
>      #define	IPV6_FLOW	0x11	/* hash only */
> 
> Extend the switch in flow_type_to_traffic_type to support both, which
> fixes the failing ethtool -N command with flow-type ip4 or ip6.
> 

Hi Maxim,
Thanks for your patch!

> Fixes: 248d3b4c9a39 ("net/mlx5e: Support flow classification into RSS contexts")

Seems that the issue originates in commit 756c41603a18 ("net/mlx5e: 
ethtool, Support user configuration for RX hash fields"), when directly 
classifying into an RQ, before the multi RSS context support.

> Signed-off-by: Maxim Mikityanskiy <maxim@isovalent.com>
> ---
>   drivers/net/ethernet/mellanox/mlx5/core/en_fs_ethtool.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_fs_ethtool.c b/drivers/net/ethernet/mellanox/mlx5/core/en_fs_ethtool.c
> index 773624bb2c5d..d68230a7b9f4 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en_fs_ethtool.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_fs_ethtool.c
> @@ -884,8 +884,10 @@ static int flow_type_to_traffic_type(u32 flow_type)
>   	case ESP_V6_FLOW:
>   		return MLX5_TT_IPV6_IPSEC_ESP;
>   	case IPV4_FLOW:
> +	case IP_USER_FLOW:
>   		return MLX5_TT_IPV4;
>   	case IPV6_FLOW:
> +	case IPV6_USER_FLOW:
>   		return MLX5_TT_IPV6;
>   	default:
>   		return -EINVAL;


  parent reply	other threads:[~2025-03-20  7:32 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-19 12:45 [PATCH net] net/mlx5e: Fix ethtool -N flow-type ip4 to RSS context Maxim Mikityanskiy
2025-03-19 14:24 ` Daniel Borkmann
2025-03-19 15:46 ` Joe Damato
2025-03-20  7:32 ` Tariq Toukan [this message]
2025-03-20  7:43   ` Maxim Mikityanskiy
2025-03-20  8:09     ` Tariq Toukan
2025-03-20  8:25 ` Gal Pressman
2025-03-20  8:28   ` Maxim Mikityanskiy
2025-03-20  8:44     ` Gal Pressman
2025-03-20  8:58       ` Tariq Toukan
2025-03-20  9:20         ` Maxim Mikityanskiy
2025-03-24 20:50 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0fa82602-3b4c-46a7-bdfc-e8a9535e74c1@gmail.com \
    --to=ttoukan.linux@gmail.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=leon@kernel.org \
    --cc=maxim@isovalent.com \
    --cc=maxtram95@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=saeedm@nvidia.com \
    --cc=tariqt@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).