From: Vladimir Oltean <olteanv@gmail.com>
To: Yangbo Lu <yangbo.lu@nxp.com>
Cc: netdev@vger.kernel.org,
Richard Cochran <richardcochran@gmail.com>,
Vladimir Oltean <vladimir.oltean@nxp.com>,
"David S . Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
Jonathan Corbet <corbet@lwn.net>,
Kurt Kanzenbach <kurt@linutronix.de>,
Andrew Lunn <andrew@lunn.ch>,
Vivien Didelot <vivien.didelot@gmail.com>,
Florian Fainelli <f.fainelli@gmail.com>,
Claudiu Manoil <claudiu.manoil@nxp.com>,
Alexandre Belloni <alexandre.belloni@bootlin.com>,
UNGLinuxDriver@microchip.com, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [net-next, v2, 3/7] net: dsa: free skb->cb usage in core driver
Date: Mon, 26 Apr 2021 21:16:37 +0300 [thread overview]
Message-ID: <20210426181637.2rneohfxkrvwctf2@skbuf> (raw)
In-Reply-To: <20210426093802.38652-4-yangbo.lu@nxp.com>
On Mon, Apr 26, 2021 at 05:37:58PM +0800, Yangbo Lu wrote:
> Free skb->cb usage in core driver and let device drivers decide to
> use or not. The reason having a DSA_SKB_CB(skb)->clone was because
> dsa_skb_tx_timestamp() which may set the clone pointer was called
> before p->xmit() which would use the clone if any, and the device
> driver has no way to initialize the clone pointer.
>
> Although for now putting memset(skb->cb, 0, 48) at beginning of
> dsa_slave_xmit() by this patch is not very good, there is still way
> to improve this. Otherwise, some other new features, like one-step
> timestamp which needs a flag of skb marked in dsa_skb_tx_timestamp(),
> and handles as one-step timestamp in p->xmit() will face same
> situation.
>
> Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
> ---
> Changes for v2:
> - Added this patch.
> ---
> drivers/net/dsa/ocelot/felix.c | 1 +
> drivers/net/dsa/sja1105/sja1105_main.c | 2 +-
> drivers/net/dsa/sja1105/sja1105_ptp.c | 4 +++-
> drivers/net/ethernet/mscc/ocelot.c | 6 +++---
> drivers/net/ethernet/mscc/ocelot_net.c | 2 +-
> include/linux/dsa/sja1105.h | 3 ++-
> include/net/dsa.h | 14 --------------
> include/soc/mscc/ocelot.h | 8 ++++++++
> net/dsa/slave.c | 3 +--
> net/dsa/tag_ocelot.c | 8 ++++----
> net/dsa/tag_ocelot_8021q.c | 8 ++++----
> 11 files changed, 28 insertions(+), 31 deletions(-)
>
> diff --git a/drivers/net/dsa/ocelot/felix.c b/drivers/net/dsa/ocelot/felix.c
> index d679f023dc00..8980d56ee793 100644
> --- a/drivers/net/dsa/ocelot/felix.c
> +++ b/drivers/net/dsa/ocelot/felix.c
> @@ -1403,6 +1403,7 @@ static bool felix_txtstamp(struct dsa_switch *ds, int port,
>
> if (ocelot->ptp && ocelot_port->ptp_cmd == IFH_REW_OP_TWO_STEP_PTP) {
> ocelot_port_add_txtstamp_skb(ocelot, port, clone);
> + OCELOT_SKB_CB(skb)->clone = clone;
> return true;
> }
>
Uh-oh, this patch fails to build:
In file included from ./include/soc/mscc/ocelot_vcap.h:9:0,
from drivers/net/dsa/ocelot/felix.c:9:
drivers/net/dsa/ocelot/felix.c: In function ‘felix_txtstamp’:
drivers/net/dsa/ocelot/felix.c:1406:17: error: ‘skb’ undeclared (first use in this function)
OCELOT_SKB_CB(skb)->clone = clone;
^
./include/soc/mscc/ocelot.h:698:29: note: in definition of macro ‘OCELOT_SKB_CB’
((struct ocelot_skb_cb *)((skb)->cb))
^~~
drivers/net/dsa/ocelot/felix.c:1406:17: note: each undeclared identifier is reported only once for each function it appears in
OCELOT_SKB_CB(skb)->clone = clone;
^
./include/soc/mscc/ocelot.h:698:29: note: in definition of macro ‘OCELOT_SKB_CB’
((struct ocelot_skb_cb *)((skb)->cb))
^~~
It depends on changes made in patch 3.
next prev parent reply other threads:[~2021-04-26 18:16 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-26 9:37 [net-next, v2, 0/7] Support Ocelot PTP Sync one-step timestamping Yangbo Lu
2021-04-26 9:37 ` [net-next, v2, 1/7] net: dsa: check tx timestamp request in core driver Yangbo Lu
2021-04-26 18:36 ` Florian Fainelli
2021-04-26 9:37 ` [net-next, v2, 2/7] net: dsa: no longer identify PTP packet " Yangbo Lu
2021-04-26 18:39 ` Florian Fainelli
2021-04-26 9:37 ` [net-next, v2, 3/7] net: dsa: free skb->cb usage " Yangbo Lu
2021-04-26 13:38 ` Richard Cochran
2021-04-26 18:39 ` Vladimir Oltean
2021-04-27 4:25 ` Y.b. Lu
2021-04-27 15:56 ` Richard Cochran
2021-04-27 4:26 ` Y.b. Lu
2021-04-26 18:16 ` Vladimir Oltean [this message]
2021-04-27 4:13 ` Y.b. Lu
2021-04-28 20:29 ` Tobias Waldekranz
2021-05-07 11:26 ` Y.b. Lu
2021-05-07 11:48 ` Vladimir Oltean
2021-04-26 9:37 ` [net-next, v2, 4/7] net: dsa: no longer clone skb " Yangbo Lu
2021-04-26 9:38 ` [net-next, v2, 5/7] docs: networking: timestamping: update for DSA switches Yangbo Lu
2021-04-26 9:38 ` [net-next, v2, 6/7] net: mscc: ocelot: convert to ocelot_port_txtstamp_request() Yangbo Lu
2021-04-26 9:38 ` [net-next, v2, 7/7] net: mscc: ocelot: support PTP Sync one-step timestamping Yangbo Lu
2021-04-26 13:47 ` [net-next, v2, 0/7] Support Ocelot " Richard Cochran
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=20210426181637.2rneohfxkrvwctf2@skbuf \
--to=olteanv@gmail.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=alexandre.belloni@bootlin.com \
--cc=andrew@lunn.ch \
--cc=claudiu.manoil@nxp.com \
--cc=corbet@lwn.net \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=kuba@kernel.org \
--cc=kurt@linutronix.de \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=richardcochran@gmail.com \
--cc=vivien.didelot@gmail.com \
--cc=vladimir.oltean@nxp.com \
--cc=yangbo.lu@nxp.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).