[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <78c1c3cd-f378-ba08-2588-ce982d34479e@gmail.com>
Date: Tue, 12 Oct 2021 14:32:11 -0700
From: Florian Fainelli <f.fainelli@...il.com>
To: Vladimir Oltean <vladimir.oltean@....com>, netdev@...r.kernel.org,
Jakub Kicinski <kuba@...nel.org>,
"David S. Miller" <davem@...emloft.net>, Po Liu <po.liu@....com>
Cc: Andrew Lunn <andrew@...n.ch>,
Vivien Didelot <vivien.didelot@...il.com>,
Vladimir Oltean <olteanv@...il.com>,
Michael Walle <michael@...le.cc>,
Rui Sousa <rui.sousa@....com>, Yangbo Lu <yangbo.lu@....com>,
Xiaoliang Yang <xiaoliang.yang_1@....com>,
Alexandre Belloni <alexandre.belloni@...tlin.com>,
Claudiu Manoil <claudiu.manoil@....com>,
UNGLinuxDriver@...rochip.com
Subject: Re: [PATCH v2 net 06/10] net: dsa: tag_ocelot: break circular
dependency with ocelot switch lib driver
On 10/12/21 4:40 AM, Vladimir Oltean wrote:
> As explained here:
> https://lore.kernel.org/netdev/20210908220834.d7gmtnwrorhharna@skbuf/
> DSA tagging protocol drivers cannot depend on symbols exported by switch
> drivers, because this creates a circular dependency that breaks module
> autoloading.
>
> The tag_ocelot.c file depends on the ocelot_ptp_rew_op() function
> exported by the common ocelot switch lib. This function looks at
> OCELOT_SKB_CB(skb) and computes how to populate the REW_OP field of the
> DSA tag, for PTP timestamping (the command: one-step/two-step, and the
> TX timestamp identifier).
>
> None of that requires deep insight into the driver, it is quite
> stateless, as it only depends upon the skb->cb. So let's make it a
> static inline function and put it in include/linux/dsa/ocelot.h, a
> file that despite its name is used by the ocelot switch driver for
> populating the injection header too - since commit 40d3f295b5fe ("net:
> mscc: ocelot: use common tag parsing code with DSA").
>
> With that function declared as static inline, its body is expanded
> inside each call site, so the dependency is broken and the DSA tagger
> can be built without the switch library, upon which the felix driver
> depends.
>
> Fixes: 39e5308b3250 ("net: mscc: ocelot: support PTP Sync one-step timestamping")
> Signed-off-by: Vladimir Oltean <vladimir.oltean@....com>
Reviewed-by: Florian Fainelli <f.fainelli@...il.com>
--
Florian
Powered by blists - more mailing lists