Subject: Re: [PATCH net-next 3/4] net: stmmac: add Rx HWTS metadata to XDP receive pkt

From: Simon Horman <[email-masked]>
Date: Mon, 10 Apr 2023 16:13:13 +0200

On Mon, Apr 10, 2023 at 06:09:38PM +0800, Song Yoong Siang wrote:
> Add receive hardware timestamp metadata support via kfunc to XDP receive
> packets.
> 
> Signed-off-by: Song Yoong Siang <[email-masked]>

...

> @@ -7071,6 +7073,22 @@ void stmmac_fpe_handshake(struct stmmac_priv *priv, bool enable)
>  	}
>  }
>  
> +static int stmmac_xdp_rx_timestamp(const struct xdp_md *_ctx, u64 *timestamp)
> +{
> +	const struct stmmac_xdp_buff *ctx = (void *)_ctx;
> +
> +	if (ctx->rx_hwts) {
> +		*timestamp = ctx->rx_hwts;
> +		return 0;
> +	}
> +
> +	return -ENODATA;
> +}
> +
> +const struct xdp_metadata_ops stmmac_xdp_metadata_ops = {
> +	.xmo_rx_timestamp		= stmmac_xdp_rx_timestamp,
> +};

sparse seems to think this should be static.

drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:7082:31: warning: symbol 'stmmac_xdp_metadata_ops' was not declared. Should it be static?

Link: https://patchwork.kernel.org/project/netdevbpf/patch/[email-masked]/

> +
>  /**
>   * stmmac_dvr_probe
>   * @device: device pointer