lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9b1a6360-7228-4310-b000-0273a50ab38d@iogearbox.net>
Date: Wed, 19 Mar 2025 15:24:23 +0100
From: Daniel Borkmann <daniel@...earbox.net>
To: Maxim Mikityanskiy <maxtram95@...il.com>,
 Saeed Mahameed <saeedm@...dia.com>, Tariq Toukan <tariqt@...dia.com>
Cc: Leon Romanovsky <leon@...nel.org>, Andrew Lunn <andrew+netdev@...n.ch>,
 "David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
 Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
 netdev@...r.kernel.org, Maxim Mikityanskiy <maxim@...valent.com>
Subject: Re: [PATCH net] net/mlx5e: Fix ethtool -N flow-type ip4 to RSS
 context

On 3/19/25 1:45 PM, 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.
> 
> Fixes: 248d3b4c9a39 ("net/mlx5e: Support flow classification into RSS contexts")
> Signed-off-by: Maxim Mikityanskiy <maxim@...valent.com>

Awesome, thanks Max!

Tested-by: Daniel Borkmann <daniel@...earbox.net>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ