[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201019103047.oq5ki3jlhnwzz2xv@skbuf>
Date: Mon, 19 Oct 2020 10:30:47 +0000
From: Vladimir Oltean <vladimir.oltean@....com>
To: David Laight <David.Laight@...LAB.COM>
CC: 'Florian Fainelli' <f.fainelli@...il.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"andrew@...n.ch" <andrew@...n.ch>,
"vivien.didelot@...il.com" <vivien.didelot@...il.com>,
"kuba@...nel.org" <kuba@...nel.org>,
Christian Eggers <ceggers@...i.de>,
Kurt Kanzenbach <kurt@...utronix.de>
Subject: Re: [RFC PATCH 02/13] net: dsa: implement a central TX reallocation
procedure
On Mon, Oct 19, 2020 at 08:33:27AM +0000, David Laight wrote:
> Is it possible to send the extra bytes from a separate buffer fragment?
> The entire area could be allocated (coherent) when the rings are
> allocated.
> That would save having to modify the skb at all.
>
> Even if some bytes of the frame header need 'adjusting' transmitting
> from a copy may be faster - especially on systems with an iommu.
>
> Many (many) moons ago we found the cutoff point for copying frames
> on a system with an iommu to be around 1k bytes.
Please help me understand better how to implement what you're suggesting.
DSA switches have 3 places where they might insert a tag:
1. Between the source MAC address and the EtherType (this is the most
common)
2. Before the destination MAC address
3. Before the FCS
I imagine that the most common scenario (1) is also the most difficult
to implement using fragments, since I would need to split the Ethernet
header from the rest of the skb data area, which might defeat the
purpose.
Also, simply integrating these 3 code paths into something generic will
bring challenges of its own.
Lastly, I fully expect the buffers to have proper headroom and tailroom
now (if they don't, then it's worth investigating what's the code path
that doesn't observe our dev->needed_headroom and dev->needed_tailroom).
The reallocation code is there just for clones (and as far as I
understand, fragments won't save us from the need of reallocating the
data areas of clones), and for short frames with DSA switches in case
(3).
Powered by blists - more mailing lists