From: "Michael S. Tsirkin" <mst@redhat.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: Srujana Challa <schalla@marvell.com>,
netdev@vger.kernel.org, virtualization@lists.linux.dev,
pabeni@redhat.com, jasowang@redhat.com,
xuanzhuo@linux.alibaba.com, eperezma@redhat.com,
davem@davemloft.net, edumazet@google.com,
ndabilpuram@marvell.com, kshankar@marvell.com
Subject: Re: [PATCH v2 net-next] virtio_net: Improve RSS key size validation and use NETDEV_RSS_KEY_LEN
Date: Sat, 7 Feb 2026 05:36:53 -0500 [thread overview]
Message-ID: <20260207052531-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20260206191308.7fdbfef4@kernel.org>
On Fri, Feb 06, 2026 at 07:13:08PM -0800, Jakub Kicinski wrote:
> On Fri, 6 Feb 2026 17:31:54 +0530 Srujana Challa wrote:
> > Replace hardcoded RSS max key size limit with NETDEV_RSS_KEY_LEN to
> > align with kernel's standard RSS key length. Add validation for RSS
> > key size against spec minimum (40 bytes) and driver maximum. When
> > validation fails, gracefully disable RSS features and continue
> > initialization rather than failing completely.
>
> Hm, FWIW clang says:
>
> drivers/net/virtio_net.c:6841:31: warning: result of comparison of constant 256 with expression of type 'u8' (aka 'unsigned char') is always false [-Wtautological-constant-out-of-range-compare]
> 6841 | } else if (vi->rss_key_size > VIRTIO_NET_RSS_MAX_KEY_SIZE) {
> | ~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Which is kinda annoying because the value was increased in net-next.
> If Machael wants this backported then we need to keep the check
> and follow up in net-next? We could try to cast the u32 away but
> that feels dirty..
for net next we will presumably replace with
BUILD_BUG_ON(type_max(vi->rss_key_size) > NETDEV_RSS_KEY_LEN)
and I think we should get rid of VIRTIO_NET_RSS_MAX_KEY_SIZE while
we are at it.
--
MST
next prev parent reply other threads:[~2026-02-07 10:37 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-06 12:01 [PATCH v2 net-next] virtio_net: Improve RSS key size validation and use NETDEV_RSS_KEY_LEN Srujana Challa
2026-02-06 15:02 ` Michael S. Tsirkin
2026-02-11 7:22 ` [EXTERNAL] " Srujana Challa
2026-02-07 3:13 ` Jakub Kicinski
2026-02-07 9:56 ` Michael S. Tsirkin
2026-02-11 7:44 ` [EXTERNAL] " Srujana Challa
2026-02-11 8:09 ` Michael S. Tsirkin
2026-02-11 9:33 ` Srujana Challa
2026-02-11 9:36 ` Michael S. Tsirkin
2026-02-11 9:48 ` Srujana Challa
2026-02-07 10:36 ` Michael S. Tsirkin [this message]
2026-02-07 5:03 ` kernel test robot
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=20260207052531-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=eperezma@redhat.com \
--cc=jasowang@redhat.com \
--cc=kshankar@marvell.com \
--cc=kuba@kernel.org \
--cc=ndabilpuram@marvell.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=schalla@marvell.com \
--cc=virtualization@lists.linux.dev \
--cc=xuanzhuo@linux.alibaba.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