[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZAXoik8Y4OboNRAT@corigine.com>
Date: Mon, 6 Mar 2023 14:20:10 +0100
From: Simon Horman <simon.horman@...igine.com>
To: Lorenzo Bianconi <lorenzo@...nel.org>
Cc: netdev@...r.kernel.org, bpf@...r.kernel.org, davem@...emloft.net,
kuba@...nel.org, pabeni@...hat.com, edumazet@...gle.com,
hawk@...nel.org, toke@...hat.com, memxor@...il.com,
alardam@...il.com, lorenzo.bianconi@...hat.com
Subject: Re: [RFC net-next] ethtool: provide XDP information with
XDP_FEATURES_GET
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@...a.com>
> Co-developed-by: Marek Majtyka <alardam@...il.com>
> Signed-off-by: Marek Majtyka <alardam@...il.com>
> Signed-off-by: Lorenzo Bianconi <lorenzo@...nel.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' -> '@...e'
> + * @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
> */
...
Powered by blists - more mailing lists