]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-client.git/commit
virtio_net: clamp rss_max_key_size to NETDEV_RSS_KEY_LEN
authorSrujana Challa <schalla@marvell.com>
Thu, 26 Mar 2026 14:23:44 +0000 (19:53 +0530)
committerJakub Kicinski <kuba@kernel.org>
Thu, 2 Apr 2026 02:47:44 +0000 (19:47 -0700)
commitb4e5f04c58a29c499faa85d12952ca9a4faf1cb9
treef55984db1d7e5a726b25fd45895af57cf8b1a63c
parentd64cb81dcbd54927515a7f65e5e24affdc73c14b
virtio_net: clamp rss_max_key_size to NETDEV_RSS_KEY_LEN

rss_max_key_size in the virtio spec is the maximum key size supported by
the device, not a mandatory size the driver must use. Also the value 40
is a spec minimum, not a spec maximum.

The current code rejects RSS and can fail probe when the device reports a
larger rss_max_key_size than the driver buffer limit. Instead, clamp the
effective key length to min(device rss_max_key_size, NETDEV_RSS_KEY_LEN)
and keep RSS enabled.

This keeps probe working on devices that advertise larger maximum key sizes
while respecting the netdev RSS key buffer size limit.

Fixes: 3f7d9c1964fc ("virtio_net: Add hash_key_length check")
Cc: stable@vger.kernel.org
Signed-off-by: Srujana Challa <schalla@marvell.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Link: https://patch.msgid.link/20260326142344.1171317-1-schalla@marvell.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/virtio_net.c