From: Vladimir Oltean <vladimir.oltean@nxp.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: Florian Fainelli <f.fainelli@gmail.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"andrew@lunn.ch" <andrew@lunn.ch>,
"vivien.didelot@gmail.com" <vivien.didelot@gmail.com>,
Christian Eggers <ceggers@arri.de>,
Kurt Kanzenbach <kurt@linutronix.de>
Subject: Re: [PATCH v3 net-next 09/12] net: dsa: tag_brcm: let DSA core deal with TX reallocation
Date: Tue, 3 Nov 2020 18:15:29 +0000 [thread overview]
Message-ID: <20201103181528.tyvythhy2ynyjx4a@skbuf> (raw)
In-Reply-To: <20201103090411.64f785cc@kicinski-fedora-PC1C0HJN.hsd1.ca.comcast.net>
On Tue, Nov 03, 2020 at 09:04:11AM -0800, Jakub Kicinski wrote:
> In a recent discussion I was wondering if it makes sense to add the
> padding len to struct net_device, with similar best-effort semantics
> to needed_*room. It'd be a u8, so little worry about struct size.
What would that mean in practice? Modify the existing alloc_skb calls
which have an expression e that depends on LL_RESERVED_SPACE(dev), into
max(e, dev->padding_len)? There's a lot of calls to alloc_skb to modify
though...
> You could also make sure DSA always provisions for padding if it has to
> reallocate, you don't need to actually pad:
>
> @@ -568,6 +568,9 @@ static int dsa_realloc_skb(struct sk_buff *skb, struct net_device *dev)
> /* No reallocation needed, yay! */
> return 0;
>
> + if (skb->len < ETH_ZLEN)
> + needed_tailroom += ETH_ZLEN;
> +
> return pskb_expand_head(skb, needed_headroom, needed_tailroom,
> GFP_ATOMIC);
> }
>
> That should save the realloc for all reasonable drivers while not
> costing anything (other than extra if()) to drivers which don't care.
DSA does already provision for padding if it has to reallocate, but only
for the case where it needs to add a frame header at the end of the skb
(i.e. "tail taggers"). My question here was whether there would be any
drawback to doing that for all types of switches, including ones that
might deal with padding in some other way (i.e. in hardware).
next prev parent reply other threads:[~2020-11-03 18:15 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-01 19:16 [PATCH v3 net-next 00/12] Generic TX reallocation for DSA Vladimir Oltean
2020-11-01 19:16 ` [PATCH v3 net-next 01/12] net: dsa: implement a central TX reallocation procedure Vladimir Oltean
2020-11-02 20:43 ` Florian Fainelli
2020-11-01 19:16 ` [PATCH v3 net-next 02/12] net: dsa: tag_ksz: don't allocate additional memory for padding/tagging Vladimir Oltean
2020-11-02 20:44 ` Florian Fainelli
2020-11-01 19:16 ` [PATCH v3 net-next 03/12] net: dsa: trailer: " Vladimir Oltean
2020-11-02 20:44 ` Florian Fainelli
2020-11-01 19:16 ` [PATCH v3 net-next 04/12] net: dsa: tag_qca: let DSA core deal with TX reallocation Vladimir Oltean
2020-11-02 20:45 ` Florian Fainelli
2020-11-01 19:16 ` [PATCH v3 net-next 05/12] net: dsa: tag_ocelot: " Vladimir Oltean
2020-11-02 20:45 ` Florian Fainelli
2020-11-01 19:16 ` [PATCH v3 net-next 06/12] net: dsa: tag_mtk: " Vladimir Oltean
2020-11-02 20:45 ` Florian Fainelli
2020-11-01 19:16 ` [PATCH v3 net-next 07/12] net: dsa: tag_lan9303: " Vladimir Oltean
2020-11-02 20:51 ` Florian Fainelli
2020-11-01 19:16 ` [PATCH v3 net-next 08/12] net: dsa: tag_edsa: " Vladimir Oltean
2020-11-02 20:51 ` Florian Fainelli
2020-11-01 19:16 ` [PATCH v3 net-next 09/12] net: dsa: tag_brcm: " Vladimir Oltean
2020-11-02 20:34 ` Florian Fainelli
2020-11-03 10:51 ` Vladimir Oltean
2020-11-03 17:04 ` Jakub Kicinski
2020-11-03 18:15 ` Vladimir Oltean [this message]
2020-11-03 18:34 ` Jakub Kicinski
2020-11-03 17:32 ` Florian Fainelli
2020-11-03 18:00 ` Vladimir Oltean
2020-11-01 19:16 ` [PATCH v3 net-next 10/12] net: dsa: tag_dsa: " Vladimir Oltean
2020-11-02 20:52 ` Florian Fainelli
2020-11-01 19:16 ` [PATCH v3 net-next 11/12] net: dsa: tag_gswip: " Vladimir Oltean
2020-11-02 20:52 ` Florian Fainelli
2020-11-01 19:16 ` [PATCH v3 net-next 12/12] net: dsa: tag_ar9331: " Vladimir Oltean
2020-11-02 20:52 ` Florian Fainelli
2020-11-03 1:43 ` [PATCH v3 net-next 00/12] Generic TX reallocation for DSA Jakub Kicinski
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=20201103181528.tyvythhy2ynyjx4a@skbuf \
--to=vladimir.oltean@nxp.com \
--cc=andrew@lunn.ch \
--cc=ceggers@arri.de \
--cc=f.fainelli@gmail.com \
--cc=kuba@kernel.org \
--cc=kurt@linutronix.de \
--cc=netdev@vger.kernel.org \
--cc=vivien.didelot@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).