[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <03f987ab-2cc1-21f6-a4cb-2df1273a8560@intel.com>
Date: Tue, 28 Feb 2023 16:47:25 +0100
From: Alexander Lobakin <aleksander.lobakin@...el.com>
To: Jakub Kicinski <kuba@...nel.org>
CC: Geoff Levand <geoff@...radead.org>, <netdev@...r.kernel.org>,
"David S. Miller" <davem@...emloft.net>,
Alexander Lobakin <alexandr.lobakin@...el.com>,
Alexander Duyck <alexander.duyck@...il.com>,
Paolo Abeni <pabeni@...hat.com>
Subject: Re: [PATCH net v6 1/2] net/ps3_gelic_net: Fix RX sk_buff length
From: Jakub Kicinski <kuba@...nel.org>
Date: Mon, 27 Feb 2023 18:20:40 -0800
> On Sun, 26 Feb 2023 02:25:42 +0000 Geoff Levand wrote:
>> + napi_buff = napi_alloc_frag_align(GELIC_NET_MAX_MTU,
>> + GELIC_NET_RXBUF_ALIGN);
>
> You're changing how the buffers are allocated.
>
>> + if (unlikely(!napi_buff)) {
>> + descr->skb = NULL;
>> + descr->buf_addr = 0;
>> + descr->buf_size = 0;
>
> Wiping the descriptors on failure.
>
>> + return -ENOMEM;
>> + }
>
> And generally reshuffling the code.
>
> Once again - please don't do any of that in a bug fix.
> Describe precisely what the problem is and fix that problem,
IIRC the original problem is that the skb linear parts are not always
aligned to a boundary which this particular HW requires. So initially
there was something like "allocate len + alignment - 1, then
PTR_ALIGN()", but I said that it's a waste of memory and we shouldn't do
that, using napi_alloc_frag_align() instead.
I guess if that would've been described, this could go as a fix? I don't
think wasting memory is a good fix, even if we need to change the
allocation scheme...
> Once the fix is accepted you can send separate patches with
> other improvements.
Thanks,
Olek
Powered by blists - more mailing lists