netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Colin Foster <colin.foster@in-advantage.com>
To: Vladimir Oltean <vladimir.oltean@nxp.com>
Cc: netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Xiaoliang Yang <xiaoliang.yang_1@nxp.com>,
	Claudiu Manoil <claudiu.manoil@nxp.com>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	UNGLinuxDriver@microchip.com, Andrew Lunn <andrew@lunn.ch>,
	Vivien Didelot <vivien.didelot@gmail.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Vinicius Costa Gomes <vinicius.gomes@intel.com>,
	Maxim Kochetkov <fido_max@inbox.ru>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next 1/2] net: sched: provide shim definitions for taprio_offload_{get,free}
Date: Tue, 5 Jul 2022 07:47:47 -0700	[thread overview]
Message-ID: <20220705144747.GA1522144@euler> (raw)
In-Reply-To: <20220704190241.1288847-1-vladimir.oltean@nxp.com>

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>

  parent reply	other threads:[~2022-07-05 14:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2022-07-05 22:21 ` [PATCH net-next 1/2] net: sched: provide shim definitions for taprio_offload_{get,free} Vinicius Costa Gomes
2022-07-06  1:30 ` patchwork-bot+netdevbpf

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=20220705144747.GA1522144@euler \
    --to=colin.foster@in-advantage.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=andrew@lunn.ch \
    --cc=claudiu.manoil@nxp.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=fido_max@inbox.ru \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=vinicius.gomes@intel.com \
    --cc=vivien.didelot@gmail.com \
    --cc=vladimir.oltean@nxp.com \
    --cc=xiaoliang.yang_1@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).