linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Julian Wiedmann <jwi@linux.ibm.com>
To: Sven Van Asbroeck <thesven73@gmail.com>
Cc: Bryan Whitehead <bryan.whitehead@microchip.com>,
	David S Miller <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	George McCollister <george.mccollister@gmail.com>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Andrew Lunn <andrew@lunn.ch>,
	Microchip Linux Driver Support <UNGLinuxDriver@microchip.com>,
	netdev <netdev@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net v1] lan743x: fix ethernet frame cutoff issue
Date: Wed, 14 Apr 2021 15:33:43 +0200	[thread overview]
Message-ID: <089f6b41-29ee-7a4a-dde0-c2d5de2534bf@linux.ibm.com> (raw)
In-Reply-To: <CAGngYiXyQEui8+OiVQXe1UeypQvny_hr=qtuOri7r2guxVDm9g@mail.gmail.com>

On 14.04.21 15:19, Sven Van Asbroeck wrote:
> Hi Julian,
> 
> On Wed, Apr 14, 2021 at 8:53 AM Julian Wiedmann <jwi@linux.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
> 


  reply	other threads:[~2021-04-14 13:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-09  0:39 [PATCH net v1] lan743x: fix ethernet frame cutoff issue Sven Van Asbroeck
2021-04-09  1:02 ` Andrew Lunn
2021-04-09  1:13   ` Sven Van Asbroeck
2021-04-09 14:12 ` George McCollister
2021-04-09 14:38   ` Sven Van Asbroeck
2021-04-09 20:00 ` patchwork-bot+netdevbpf
2021-04-14 12:53 ` Julian Wiedmann
2021-04-14 13:19   ` Sven Van Asbroeck
2021-04-14 13:33     ` Julian Wiedmann [this message]
2021-04-14 13:40       ` Sven Van Asbroeck

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=089f6b41-29ee-7a4a-dde0-c2d5de2534bf@linux.ibm.com \
    --to=jwi@linux.ibm.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=andrew@lunn.ch \
    --cc=bryan.whitehead@microchip.com \
    --cc=davem@davemloft.net \
    --cc=george.mccollister@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=thesven73@gmail.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;
as well as URLs for NNTP newsgroup(s).