[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <089f6b41-29ee-7a4a-dde0-c2d5de2534bf@linux.ibm.com>
Date: Wed, 14 Apr 2021 15:33:43 +0200
From: Julian Wiedmann <jwi@...ux.ibm.com>
To: Sven Van Asbroeck <thesven73@...il.com>
Cc: Bryan Whitehead <bryan.whitehead@...rochip.com>,
David S Miller <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
George McCollister <george.mccollister@...il.com>,
Heiner Kallweit <hkallweit1@...il.com>,
Andrew Lunn <andrew@...n.ch>,
Microchip Linux Driver Support <UNGLinuxDriver@...rochip.com>,
netdev <netdev@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH net v1] lan743x: fix ethernet frame cutoff issue
On 14.04.21 15:19, Sven Van Asbroeck wrote:
> Hi Julian,
>
> On Wed, Apr 14, 2021 at 8:53 AM Julian Wiedmann <jwi@...ux.ibm.com> wrote:
>>
>> On a cursory glance, using __netdev_alloc_skb_ip_align() here should
>> allow you to get rid of all the RX_HEAD_PADDING gymnastics.
>>
>> And also avoid the need for setting RX_CFG_B_RX_PAD_2_, as the
>> NET_IP_ALIGN part would no longer get dma-mapped.
>
> That's an excellent suggestion, and I'll definitely keep that in mind
> for the future.
>
> In this case, I'm not sure if it could work. This NIC has multi-buffer
> frames. The dma-ed skbs represent frame fragments. A flag in the
> descriptor ring indicates if an skb is "first". If first, we can
> reserve the padding. Otherwise, we cannot. because that would corrupt
> a fragment in the middle. At the time of skb allocation, we do not
> know whether that skb will be "first".
>
__netdev_alloc_skb_ip_align() already reserves the NET_IP_ALIGN part.
So when the NIC stores into the dma-mapped skb->data parts, each
fragment will automatically have the required alignment - even when
you only care about the first fragment's alignment.
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/net/ethernet/microchip/lan743x_main.c?h=v5.12-rc7#n2125
>
> Maybe I'm missing a trick here? Feel free to suggest improvements,
> it's always much appreciated.
>
> Sven
>
Powered by blists - more mailing lists