From: Florian Fainelli <f.fainelli@gmail.com>
To: Vladimir Oltean <olteanv@gmail.com>,
vivien.didelot@gmail.com, andrew@lunn.ch, davem@davemloft.net
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH net-next v3 06/10] net: dsa: Add support for deferred xmit
Date: Sun, 5 May 2019 10:03:24 -0700 [thread overview]
Message-ID: <f921e950-cd69-501e-0278-7afb8a34cca7@gmail.com> (raw)
In-Reply-To: <20190505101929.17056-7-olteanv@gmail.com>
On 5/5/2019 3:19 AM, Vladimir Oltean wrote:
> Some hardware needs to take work to get convinced to receive frames on
> the CPU port (such as the sja1105 which takes temporary L2 forwarding
> rules over SPI that last for a single frame). Such work needs a
> sleepable context, and because the regular .ndo_start_xmit is atomic,
> this cannot be done in the tagger. So introduce a generic DSA mechanism
> that sets up a transmit skb queue and a workqueue for deferred
> transmission.
>
> The new driver callback (.port_deferred_xmit) is in dsa_switch and not
> in the tagger because the operations that require sleeping typically
> also involve interacting with the hardware, and not simply skb
> manipulations. Therefore having it there simplifies the structure a bit
> and makes it unnecessary to export functions from the driver to the
> tagger.
>
> The driver is responsible of calling dsa_enqueue_skb which transfers it
> to the master netdevice. This is so that it has a chance of performing
> some more work afterwards, such as cleanup or TX timestamping.
>
> To tell DSA that skb xmit deferral is required, I have thought about
> changing the return type of the tagger .xmit from struct sk_buff * into
> a enum dsa_tx_t that could potentially encode a DSA_XMIT_DEFER value.
>
> But the trailer tagger is reallocating every skb on xmit and therefore
> making a valid use of the pointer return value. So instead of reworking
> the API in complicated ways, right now a boolean property in the newly
> introduced DSA_SKB_CB is set.
>
> Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
--
Florian
next prev parent reply other threads:[~2019-05-05 17:03 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-05 10:19 [PATCH net-next v3 00/10] Traffic support for SJA1105 DSA driver Vladimir Oltean
2019-05-05 10:19 ` [PATCH net-next v3 01/10] net: dsa: Call driver's setup callback after setting up its switchdev notifier Vladimir Oltean
2019-05-05 10:19 ` [PATCH net-next v3 02/10] net: dsa: Export symbols for dsa_port_vid_{add,del} Vladimir Oltean
2019-05-05 17:01 ` Florian Fainelli
2019-05-05 10:19 ` [PATCH net-next v3 03/10] net: dsa: Optional VLAN-based port separation for switches without tagging Vladimir Oltean
2019-05-05 10:19 ` [PATCH net-next v3 04/10] net: dsa: Allow drivers to filter packets they can decode source port from Vladimir Oltean
2019-05-05 17:02 ` Florian Fainelli
2019-05-05 18:29 ` Vladimir Oltean
2019-05-05 10:19 ` [PATCH net-next v3 05/10] net: dsa: Keep private info in the skb->cb Vladimir Oltean
2019-05-05 10:19 ` [PATCH net-next v3 06/10] net: dsa: Add support for deferred xmit Vladimir Oltean
2019-05-05 17:03 ` Florian Fainelli [this message]
2019-05-05 10:19 ` [PATCH net-next v3 07/10] net: dsa: Add a private structure pointer to dsa_port Vladimir Oltean
2019-05-05 10:19 ` [PATCH net-next v3 08/10] net: dsa: sja1105: Add support for traffic through standalone ports Vladimir Oltean
2019-05-05 10:19 ` [PATCH net-next v3 09/10] net: dsa: sja1105: Add support for Spanning Tree Protocol Vladimir Oltean
2019-05-05 10:19 ` [PATCH net-next v3 10/10] Documentation: net: dsa: sja1105: Add info about supported traffic modes Vladimir Oltean
2019-05-05 17:04 ` Florian Fainelli
2019-05-05 18:34 ` Vladimir Oltean
2019-05-06 4:52 ` [PATCH net-next v3 00/10] Traffic support for SJA1105 DSA driver David Miller
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=f921e950-cd69-501e-0278-7afb8a34cca7@gmail.com \
--to=f.fainelli@gmail.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--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).