public inbox for bpf@vger.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <simon.horman@corigine.com>
To: Lorenzo Bianconi <lorenzo@kernel.org>
Cc: netdev@vger.kernel.org, bpf@vger.kernel.org, davem@davemloft.net,
	kuba@kernel.org, pabeni@redhat.com, edumazet@google.com,
	hawk@kernel.org, toke@redhat.com, memxor@gmail.com,
	alardam@gmail.com, lorenzo.bianconi@redhat.com
Subject: Re: [RFC net-next] ethtool: provide XDP information with XDP_FEATURES_GET
Date: Mon, 6 Mar 2023 14:20:10 +0100	[thread overview]
Message-ID: <ZAXoik8Y4OboNRAT@corigine.com> (raw)
In-Reply-To: <ced8d727138d487332e32739b392ec7554e7a241.1678098067.git.lorenzo@kernel.org>

On Mon, Mar 06, 2023 at 11:26:10AM +0100, Lorenzo Bianconi wrote:
> Implement XDP_FEATURES_GET request to get network device information
> about supported xdp functionalities through ethtool.
> 
> Tested-by: Matteo Croce <teknoraver@meta.com>
> Co-developed-by: Marek Majtyka <alardam@gmail.com>
> Signed-off-by: Marek Majtyka <alardam@gmail.com>
> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>

...

> @@ -1429,6 +1431,18 @@ struct ethtool_sfeatures {
>  	struct ethtool_set_features_block features[];
>  };
>  
> +/**
> + * struct ethtool_xdp_gfeatures - command to get supported XDP features
> + * @cmd: command number = %ETHTOOL_XDP_GFEATURES
> + * size: array size of the features[] array

nit: 'size' -> '@size'

> + * @features: XDP feature masks
> + */
> +struct ethtool_xdp_gfeatures {
> +	__u32	cmd;
> +	__u32	size;
> +	__u32	features[];
> +};
> +
>  /**
>   * struct ethtool_ts_info - holds a device's timestamping and PHC association
>   * @cmd: command number = %ETHTOOL_GET_TS_INFO

...

> diff --git a/net/ethtool/common.c b/net/ethtool/common.c
> index 5fb19050991e..2be672c601ad 100644
> --- a/net/ethtool/common.c
> +++ b/net/ethtool/common.c
> @@ -465,6 +465,17 @@ const char udp_tunnel_type_names[][ETH_GSTRING_LEN] = {
>  static_assert(ARRAY_SIZE(udp_tunnel_type_names) ==
>  	      __ETHTOOL_UDP_TUNNEL_TYPE_CNT);
>  
> +const char xdp_features_strings[][ETH_GSTRING_LEN] = {
> +	[NETDEV_XDP_ACT_BIT_BASIC_BIT] =	"xdp-basic",
> +	[NETDEV_XDP_ACT_BIT_REDIRECT_BIT] =	"xdp-redirect",
> +	[NETDEV_XDP_ACT_BIT_NDO_XMIT_BIT] =	"xdp-ndo-xmit",
> +	[NETDEV_XDP_ACT_BIT_XSK_ZEROCOPY_BIT] =	"xdp-xsk-zerocopy",
> +	[NETDEV_XDP_ACT_BIT_HW_OFFLOAD_BIT] =	"xdp-hw-offload",
> +	[NETDEV_XDP_ACT_BIT_RX_SG_BIT] =	"xdp-rx-sg",
> +	[NETDEV_XDP_ACT_BIT_NDO_XMIT_SG_BIT] =	"xdp-ndo-xmit-sg",
> +};

nit: blank line here

> +static_assert(ARRAY_SIZE(xdp_features_strings) == __NETDEV_XDP_ACT_BIT_MAX);
> +
>  /* return false if legacy contained non-0 deprecated fields
>   * maxtxpkt/maxrxpkt. rest of ksettings always updated
>   */

...

  reply	other threads:[~2023-03-06 13:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-06 10:26 [RFC net-next] ethtool: provide XDP information with XDP_FEATURES_GET Lorenzo Bianconi
2023-03-06 13:20 ` Simon Horman [this message]
2023-03-06 13:27   ` Lorenzo Bianconi
2023-03-06 18:21 ` Jakub Kicinski
2023-03-06 18:32   ` Lorenzo Bianconi
2023-03-06 19:32     ` Jakub Kicinski
2023-03-07  0:15       ` Lorenzo Bianconi

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=ZAXoik8Y4OboNRAT@corigine.com \
    --to=simon.horman@corigine.com \
    --cc=alardam@gmail.com \
    --cc=bpf@vger.kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hawk@kernel.org \
    --cc=kuba@kernel.org \
    --cc=lorenzo.bianconi@redhat.com \
    --cc=lorenzo@kernel.org \
    --cc=memxor@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=toke@redhat.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