OpenCloudOS-Kernel/drivers/net/ethernet/mscc
Vladimir Oltean deab6b1cd9 net: dsa: tag_ocelot: break circular dependency with ocelot switch lib driver
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 40d3f295b5 ("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: 39e5308b32 ("net: mscc: ocelot: support PTP Sync one-step timestamping")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2021-10-12 17:35:18 -07:00
..
Kconfig net: mscc: ocelot: convert to phylink 2021-08-16 11:19:34 +01:00
Makefile net: mscc: ocelot: Add support for MRP 2021-02-16 14:47:46 -08:00
ocelot.c net: dsa: tag_ocelot: break circular dependency with ocelot switch lib driver 2021-10-12 17:35:18 -07:00
ocelot.h net: mscc: ocelot: convert to phylink 2021-08-16 11:19:34 +01:00
ocelot_devlink.c net: update NXP copyright text 2021-09-17 13:52:17 +01:00
ocelot_flower.c flow_offload: reject configuration of packet-per-second policing in offload drivers 2021-03-13 14:18:09 -08:00
ocelot_io.c net: mscc: Fix non-GPL export of regmap APIs 2021-08-12 09:44:31 +01:00
ocelot_mrp.c net: update NXP copyright text 2021-09-17 13:52:17 +01:00
ocelot_net.c net: dsa: tag_ocelot: break circular dependency with ocelot switch lib driver 2021-10-12 17:35:18 -07:00
ocelot_police.c net: mscc: ocelot: move net_device related functions to ocelot_net.c 2020-06-20 17:25:23 -07:00
ocelot_police.h net: mscc: ocelot: unexpose ocelot_vcap_policer_{add,del} 2020-06-20 17:25:23 -07:00
ocelot_ptp.c time64.h: Consolidated PSEC_PER_SEC definition 2021-04-06 16:32:17 -07:00
ocelot_qs.h
ocelot_rew.h
ocelot_vcap.c net: mscc: ocelot: fix VCAP filters remaining active after being deleted 2021-10-01 15:13:20 -07:00
ocelot_vcap.h net: dsa: felix: perform switch setup for tag_8021q 2021-01-29 21:25:27 -08:00
ocelot_vsc7514.c net: mscc: ocelot: allow probing to continue with ports that fail to register 2021-08-20 14:36:42 +01:00