From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8B5123D3492 for ; Wed, 8 Apr 2026 14:24:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775658256; cv=none; b=oJbsFJeeaCpz1wixvLxBktPTw55YAulkxVgtgNRbOgVJjm7FbWjjXdxOhk8CD4SNAheY2W9vvKip23+lWxSrrHGv20nLw9vNZihtG+MTAfN9uVTcIWWUML8459trwChyaNG2PzdCDbt9QQovSid6gddGjvbzmayarDujimKVCM4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775658256; c=relaxed/simple; bh=EA0LUlzTmwQYUylZWstpx5RpK7BRBsExeu87PuVHmpE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=PP2JEasf7u6N5SA4JQc84kmV41g5pGPAOpkfmX+izqDa+Jxo8FEV0vPzAbrSz+r6Z+OkHZqE/eGmZbfkgI86UXaKxhzSAl5cwE++6DDJbrh6qWtcbEribnJUBwHbu8uRLY+18CTXs4jHxJKZPA3I2UcpPD6JqWBcjEjaC9Q9sEE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=M9mhvM51; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="M9mhvM51" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E5B55C19421; Wed, 8 Apr 2026 14:24:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775658256; bh=EA0LUlzTmwQYUylZWstpx5RpK7BRBsExeu87PuVHmpE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=M9mhvM517UcelJp0XcWBPh5mJ9HOoEdEe2XFTK68rcD0wC8fQc8rxIRQc0KIElW16 0BR3/+e7Fp/GOYS6sTT8fVp2WgJ6tUk1wai5poBNIos7haFcF68OPUERBZXYq4cOgf WNorEDp1ybJphwqK3P91fbmklyiWkxrdvP2G8C6+OZ3sROD1naGkIq5KcpqG4BZc7x Q65lDHYWNvNckI9pnvewTeyK8Cpma5wj/+4+qrXo/DOQLrpgjmnoweFNdV2t+zbEbp A20gLvPINOJ7431yawtJkustRk7EKAz729xC2niX1FiiOPWPvv5qmFhg+qBlDNmCSz xziGAVADvF3lg== Date: Wed, 8 Apr 2026 10:24:14 -0400 From: Sasha Levin To: "Michael S. Tsirkin" Cc: stable@vger.kernel.org, Srujana Challa , Jakub Kicinski Subject: Re: [PATCH 6.1.y] virtio_net: clamp rss_max_key_size to NETDEV_RSS_KEY_LEN Message-ID: References: <2026040856-ploy-antiviral-fecc@gregkh> <20260408134351.1100654-1-sashal@kernel.org> <20260408095309-mutt-send-email-mst@kernel.org> <20260408101810-mutt-send-email-mst@kernel.org> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20260408101810-mutt-send-email-mst@kernel.org> On Wed, Apr 08, 2026 at 10:20:50AM -0400, Michael S. Tsirkin wrote: >On Wed, Apr 08, 2026 at 10:15:48AM -0400, Sasha Levin wrote: >> On Wed, Apr 08, 2026 at 09:54:33AM -0400, Michael S. Tsirkin wrote: >> > On Wed, Apr 08, 2026 at 09:43:51AM -0400, Sasha Levin wrote: >> > > From: Srujana Challa >> > > >> > > [ Upstream commit b4e5f04c58a29c499faa85d12952ca9a4faf1cb9 ] >> > > >> > > 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 >> > > Acked-by: Michael S. Tsirkin >> > > Link: https://patch.msgid.link/20260326142344.1171317-1-schalla@marvell.com >> > > Signed-off-by: Jakub Kicinski >> > > [ changed clamp target from NETDEV_RSS_KEY_LEN to VIRTIO_NET_RSS_MAX_KEY_SIZE ] >> > >> > Does this not make the subject and the commit log misleading? >> >> Probably, but changing the commit subject will just create more confusion. >> >> -- >> Thanks, >> Sasha > >It's not just the subject. The commit log says: > > Also the value 40 is a spec minimum, not a spec maximum. > >but the changed patch seems to treat it as a maximum: > >+ vi->rss_key_size = min_t(u16, key_sz, VIRTIO_NET_RSS_MAX_KEY_SIZE); > > >so unless I misread the code, the value is never > 40. I tried to explain it here: https://lore.kernel.org/all/adZitVex9UGVyH-V@laps/ -- Thanks, Sasha