All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next 1/2] net: sched: provide shim definitions for taprio_offload_{get,free}
@ 2022-07-04 19:02 Vladimir Oltean
  2022-07-04 19:02 ` [PATCH net-next 2/2] net: dsa: felix: build as module when tc-taprio is module Vladimir Oltean
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Vladimir Oltean @ 2022-07-04 19:02 UTC (permalink / raw)
  To: netdev
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Xiaoliang Yang, Claudiu Manoil, Alexandre Belloni,
	UNGLinuxDriver, Andrew Lunn, Vivien Didelot, Florian Fainelli,
	Vinicius Costa Gomes, Maxim Kochetkov, Colin Foster,
	linux-kernel

All callers of taprio_offload_get() and taprio_offload_free() prior to
the blamed commit are conditionally compiled based on CONFIG_NET_SCH_TAPRIO.

felix_vsc9959.c is different; it provides vsc9959_qos_port_tas_set()
even when taprio is compiled out.

Provide shim definitions for the functions exported by taprio so that
felix_vsc9959.c is able to compile. vsc9959_qos_port_tas_set() in that
case is dead code anyway, and ocelot_port->taprio remains NULL, which is
fine for the rest of the logic.

Fixes: 1c9017e44af2 ("net: dsa: felix: keep reference on entire tc-taprio config")
Reported-by: Colin Foster <colin.foster@in-advantage.com>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
 include/net/pkt_sched.h | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h
index 44a35531952e..3372a1f67cf4 100644
--- a/include/net/pkt_sched.h
+++ b/include/net/pkt_sched.h
@@ -173,11 +173,28 @@ struct tc_taprio_qopt_offload {
 	struct tc_taprio_sched_entry entries[];
 };
 
+#if IS_ENABLED(CONFIG_NET_SCH_TAPRIO)
+
 /* Reference counting */
 struct tc_taprio_qopt_offload *taprio_offload_get(struct tc_taprio_qopt_offload
 						  *offload);
 void taprio_offload_free(struct tc_taprio_qopt_offload *offload);
 
+#else
+
+/* Reference counting */
+static inline struct tc_taprio_qopt_offload *
+taprio_offload_get(struct tc_taprio_qopt_offload *offload)
+{
+	return NULL;
+}
+
+static inline void taprio_offload_free(struct tc_taprio_qopt_offload *offload)
+{
+}
+
+#endif
+
 /* Ensure skb_mstamp_ns, which might have been populated with the txtime, is
  * not mistaken for a software timestamp, because this will otherwise prevent
  * the dispatch of hardware timestamps to the socket.
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH net-next 2/2] net: dsa: felix: build as module when tc-taprio is module
  2022-07-04 19:02 [PATCH net-next 1/2] net: sched: provide shim definitions for taprio_offload_{get,free} Vladimir Oltean
@ 2022-07-04 19:02 ` Vladimir Oltean
  2022-07-05 14:47 ` [PATCH net-next 1/2] net: sched: provide shim definitions for taprio_offload_{get,free} Colin Foster
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Vladimir Oltean @ 2022-07-04 19:02 UTC (permalink / raw)
  To: netdev
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Xiaoliang Yang, Claudiu Manoil, Alexandre Belloni,
	UNGLinuxDriver, Andrew Lunn, Vivien Didelot, Florian Fainelli,
	Vinicius Costa Gomes, Maxim Kochetkov, Colin Foster,
	linux-kernel

felix_vsc9959.c calls taprio_offload_get() and taprio_offload_free(),
symbols exported by net/sched/sch_taprio.c. As such, we must disallow
building the Felix driver as built-in when the symbol exported by
tc-taprio isn't present in the kernel image.

Fixes: 1c9017e44af2 ("net: dsa: felix: keep reference on entire tc-taprio config")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
 drivers/net/dsa/ocelot/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/dsa/ocelot/Kconfig b/drivers/net/dsa/ocelot/Kconfig
index 220b0b027b55..08db9cf76818 100644
--- a/drivers/net/dsa/ocelot/Kconfig
+++ b/drivers/net/dsa/ocelot/Kconfig
@@ -6,6 +6,7 @@ config NET_DSA_MSCC_FELIX
 	depends on NET_VENDOR_FREESCALE
 	depends on HAS_IOMEM
 	depends on PTP_1588_CLOCK_OPTIONAL
+	depends on NET_SCH_TAPRIO || NET_SCH_TAPRIO=n
 	select MSCC_OCELOT_SWITCH_LIB
 	select NET_DSA_TAG_OCELOT_8021Q
 	select NET_DSA_TAG_OCELOT
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next 1/2] net: sched: provide shim definitions for taprio_offload_{get,free}
  2022-07-04 19:02 [PATCH net-next 1/2] net: sched: provide shim definitions for taprio_offload_{get,free} Vladimir Oltean
  2022-07-04 19:02 ` [PATCH net-next 2/2] net: dsa: felix: build as module when tc-taprio is module Vladimir Oltean
@ 2022-07-05 14:47 ` Colin Foster
  2022-07-05 22:21 ` Vinicius Costa Gomes
  2022-07-06  1:30 ` patchwork-bot+netdevbpf
  3 siblings, 0 replies; 5+ messages in thread
From: Colin Foster @ 2022-07-05 14:47 UTC (permalink / raw)
  To: Vladimir Oltean
  Cc: netdev, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Xiaoliang Yang, Claudiu Manoil, Alexandre Belloni,
	UNGLinuxDriver, Andrew Lunn, Vivien Didelot, Florian Fainelli,
	Vinicius Costa Gomes, Maxim Kochetkov, linux-kernel

On Mon, Jul 04, 2022 at 10:02:40PM +0300, Vladimir Oltean wrote:
> All callers of taprio_offload_get() and taprio_offload_free() prior to
> the blamed commit are conditionally compiled based on CONFIG_NET_SCH_TAPRIO.
> 
> felix_vsc9959.c is different; it provides vsc9959_qos_port_tas_set()
> even when taprio is compiled out.
> 
> Provide shim definitions for the functions exported by taprio so that
> felix_vsc9959.c is able to compile. vsc9959_qos_port_tas_set() in that
> case is dead code anyway, and ocelot_port->taprio remains NULL, which is
> fine for the rest of the logic.
> 
> Fixes: 1c9017e44af2 ("net: dsa: felix: keep reference on entire tc-taprio config")
> Reported-by: Colin Foster <colin.foster@in-advantage.com>
> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
> ---
>  include/net/pkt_sched.h | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
> 
> diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h
> index 44a35531952e..3372a1f67cf4 100644
> --- a/include/net/pkt_sched.h
> +++ b/include/net/pkt_sched.h
> @@ -173,11 +173,28 @@ struct tc_taprio_qopt_offload {
>  	struct tc_taprio_sched_entry entries[];
>  };
>  
> +#if IS_ENABLED(CONFIG_NET_SCH_TAPRIO)
> +
>  /* Reference counting */
>  struct tc_taprio_qopt_offload *taprio_offload_get(struct tc_taprio_qopt_offload
>  						  *offload);
>  void taprio_offload_free(struct tc_taprio_qopt_offload *offload);
>  
> +#else
> +
> +/* Reference counting */
> +static inline struct tc_taprio_qopt_offload *
> +taprio_offload_get(struct tc_taprio_qopt_offload *offload)
> +{
> +	return NULL;
> +}
> +
> +static inline void taprio_offload_free(struct tc_taprio_qopt_offload *offload)
> +{
> +}
> +
> +#endif
> +
>  /* Ensure skb_mstamp_ns, which might have been populated with the txtime, is
>   * not mistaken for a software timestamp, because this will otherwise prevent
>   * the dispatch of hardware timestamps to the socket.
> -- 
> 2.25.1
> 

Fixes my build!

Tested-by: Colin Foster <colin.foster@in-advantage.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next 1/2] net: sched: provide shim definitions for taprio_offload_{get,free}
  2022-07-04 19:02 [PATCH net-next 1/2] net: sched: provide shim definitions for taprio_offload_{get,free} Vladimir Oltean
  2022-07-04 19:02 ` [PATCH net-next 2/2] net: dsa: felix: build as module when tc-taprio is module Vladimir Oltean
  2022-07-05 14:47 ` [PATCH net-next 1/2] net: sched: provide shim definitions for taprio_offload_{get,free} Colin Foster
@ 2022-07-05 22:21 ` Vinicius Costa Gomes
  2022-07-06  1:30 ` patchwork-bot+netdevbpf
  3 siblings, 0 replies; 5+ messages in thread
From: Vinicius Costa Gomes @ 2022-07-05 22:21 UTC (permalink / raw)
  To: Vladimir Oltean, netdev
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Xiaoliang Yang, Claudiu Manoil, Alexandre Belloni,
	UNGLinuxDriver, Andrew Lunn, Vivien Didelot, Florian Fainelli,
	Maxim Kochetkov, Colin Foster, linux-kernel

Vladimir Oltean <vladimir.oltean@nxp.com> writes:

> All callers of taprio_offload_get() and taprio_offload_free() prior to
> the blamed commit are conditionally compiled based on CONFIG_NET_SCH_TAPRIO.
>
> felix_vsc9959.c is different; it provides vsc9959_qos_port_tas_set()
> even when taprio is compiled out.
>
> Provide shim definitions for the functions exported by taprio so that
> felix_vsc9959.c is able to compile. vsc9959_qos_port_tas_set() in that
> case is dead code anyway, and ocelot_port->taprio remains NULL, which is
> fine for the rest of the logic.
>
> Fixes: 1c9017e44af2 ("net: dsa: felix: keep reference on entire tc-taprio config")
> Reported-by: Colin Foster <colin.foster@in-advantage.com>
> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
> ---

Acked-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>


-- 
Vinicius

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next 1/2] net: sched: provide shim definitions for taprio_offload_{get,free}
  2022-07-04 19:02 [PATCH net-next 1/2] net: sched: provide shim definitions for taprio_offload_{get,free} Vladimir Oltean
                   ` (2 preceding siblings ...)
  2022-07-05 22:21 ` Vinicius Costa Gomes
@ 2022-07-06  1:30 ` patchwork-bot+netdevbpf
  3 siblings, 0 replies; 5+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-07-06  1:30 UTC (permalink / raw)
  To: Vladimir Oltean
  Cc: netdev, davem, edumazet, kuba, pabeni, xiaoliang.yang_1,
	claudiu.manoil, alexandre.belloni, UNGLinuxDriver, andrew,
	vivien.didelot, f.fainelli, vinicius.gomes, fido_max,
	colin.foster, linux-kernel

Hello:

This series was applied to netdev/net-next.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Mon,  4 Jul 2022 22:02:40 +0300 you wrote:
> All callers of taprio_offload_get() and taprio_offload_free() prior to
> the blamed commit are conditionally compiled based on CONFIG_NET_SCH_TAPRIO.
> 
> felix_vsc9959.c is different; it provides vsc9959_qos_port_tas_set()
> even when taprio is compiled out.
> 
> Provide shim definitions for the functions exported by taprio so that
> felix_vsc9959.c is able to compile. vsc9959_qos_port_tas_set() in that
> case is dead code anyway, and ocelot_port->taprio remains NULL, which is
> fine for the rest of the logic.
> 
> [...]

Here is the summary with links:
  - [net-next,1/2] net: sched: provide shim definitions for taprio_offload_{get,free}
    https://git.kernel.org/netdev/net-next/c/d7be266adbfd
  - [net-next,2/2] net: dsa: felix: build as module when tc-taprio is module
    https://git.kernel.org/netdev/net-next/c/10ed11ab6399

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-07-06  1:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-04 19:02 [PATCH net-next 1/2] net: sched: provide shim definitions for taprio_offload_{get,free} Vladimir Oltean
2022-07-04 19:02 ` [PATCH net-next 2/2] net: dsa: felix: build as module when tc-taprio is module Vladimir Oltean
2022-07-05 14:47 ` [PATCH net-next 1/2] net: sched: provide shim definitions for taprio_offload_{get,free} Colin Foster
2022-07-05 22:21 ` Vinicius Costa Gomes
2022-07-06  1:30 ` patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.