[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <a7b27541-0ebb-4f2d-bd06-270a4d404613@app.fastmail.com>
Date: Thu, 22 Jun 2023 13:28:25 +0200
From: "Arnd Bergmann" <arnd@...db.de>
To: "Maxim Mikityanskiy" <maxtram95@...il.com>,
"Arnd Bergmann" <arnd@...nel.org>
Cc: "Saeed Mahameed" <saeedm@...dia.com>, "Leon Romanovsky" <leon@...nel.org>,
"David S . Miller" <davem@...emloft.net>,
"Eric Dumazet" <edumazet@...gle.com>, "Jakub Kicinski" <kuba@...nel.org>,
"Paolo Abeni" <pabeni@...hat.com>, "Nathan Chancellor" <nathan@...nel.org>,
"Nick Desaulniers" <ndesaulniers@...gle.com>, "Tom Rix" <trix@...hat.com>,
"Tariq Toukan" <tariqt@...dia.com>, "Adham Faris" <afaris@...dia.com>,
Netdev <netdev@...r.kernel.org>, linux-rdma@...r.kernel.org,
linux-kernel@...r.kernel.org, llvm@...ts.linux.dev
Subject: Re: [PATCH] mlx5: avoid integer overflow warning for large page size
On Thu, Jun 22, 2023, at 13:23, Maxim Mikityanskiy wrote:
> On Thu, 22 Jun 2023 at 12:15:02 +0200, Arnd Bergmann wrote:
>
> I recall you already sent a fix to silence this warning before:
>
> https://lore.kernel.org/netdev/20211015152056.2434853-1-arnd@kernel.org/
>
> I prefer that old one, as it's more future-proof to cast to size_t here
> in place (chunk_size won't be bigger than size_t for sure). With your
> new patch, if chunk_size is ever changed from u16 to u32, it's likely
> that this place will be unnoticed, and a bug will be introduced.
>
>> mlx5_core_err(mdev, "XSK chunk size %u out of bounds [%u, %lu]\n", xsk->chunk_size,
>> MLX5E_MIN_XSK_CHUNK_SIZE, PAGE_SIZE);
Indeed, I don't know why I no longer had the old patch in my randconfig
tree, I completely forgot about that. The old patch is also ok.
Arnd
Powered by blists - more mailing lists