[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y9Dn/O+UInsY6rZI@corigine.com>
Date: Wed, 25 Jan 2023 09:27:40 +0100
From: Simon Horman <simon.horman@...igine.com>
To: Lorenzo Bianconi <lorenzo@...nel.org>
Cc: bpf@...r.kernel.org, netdev@...r.kernel.org, ast@...nel.org,
daniel@...earbox.net, andrii@...nel.org, davem@...emloft.net,
kuba@...nel.org, hawk@...nel.org, pabeni@...hat.com,
edumazet@...gle.com, toke@...hat.com, memxor@...il.com,
alardam@...il.com, saeedm@...dia.com, anthony.l.nguyen@...el.com,
gospo@...adcom.com, vladimir.oltean@....com, nbd@....name,
john@...ozen.org, leon@...nel.org, aelior@...vell.com,
christophe.jaillet@...adoo.fr, ecree.xilinx@...il.com,
mst@...hat.com, bjorn@...nel.org, magnus.karlsson@...el.com,
maciej.fijalkowski@...el.com, intel-wired-lan@...ts.osuosl.org,
lorenzo.bianconi@...hat.com, martin.lau@...ux.dev,
Niklas Söderlund <niklas.soderlund@...igine.com>,
oss-drivers@...igine.com
Subject: Re: [PATCH v2 bpf-next 2/8] drivers: net: turn on XDP features
+ Niklas, oss-drivers@...igine
On Wed, Jan 25, 2023 at 01:33:22AM +0100, Lorenzo Bianconi wrote:
> From: Marek Majtyka <alardam@...il.com>
>
> A summary of the flags being set for various drivers is given below.
> Note that XDP_F_REDIRECT_TARGET and XDP_F_FRAG_TARGET are features
> that can be turned off and on at runtime. This means that these flags
> may be set and unset under RTNL lock protection by the driver. Hence,
> READ_ONCE must be used by code loading the flag value.
>
> Also, these flags are not used for synchronization against the availability
> of XDP resources on a device. It is merely a hint, and hence the read
> may race with the actual teardown of XDP resources on the device. This
> may change in the future, e.g. operations taking a reference on the XDP
> resources of the driver, and in turn inhibiting turning off this flag.
> However, for now, it can only be used as a hint to check whether device
> supports becoming a redirection target.
>
> Turn 'hw-offload' feature flag on for:
> - netronome (nfp)
> - netdevsim.
>
> Turn 'native' and 'zerocopy' features flags on for:
> - intel (i40e, ice, ixgbe, igc)
> - mellanox (mlx5).
> - stmmac
nit: possibly nfp goes in the above list too.
> Turn 'native' features flags on for:
> - amazon (ena)
> - broadcom (bnxt)
> - freescale (dpaa, dpaa2, enetc)
> - funeth
> - intel (igb)
> - marvell (mvneta, mvpp2, octeontx2)
> - mellanox (mlx4)
> - qlogic (qede)
> - sfc
> - socionext (netsec)
> - ti (cpsw)
> - tap
> - veth
> - xen
> - virtio_net.
>
> Turn 'basic' (tx, pass, aborted and drop) features flags on for:
> - netronome (nfp)
> - cavium (thunder)
> - hyperv.
>
> Turn 'redirect_target' feature flag on for:
> - amanzon (ena)
> - broadcom (bnxt)
> - freescale (dpaa, dpaa2)
> - intel (i40e, ice, igb, ixgbe)
> - ti (cpsw)
> - marvell (mvneta, mvpp2)
> - sfc
> - socionext (netsec)
> - qlogic (qede)
> - mellanox (mlx5)
> - tap
> - veth
> - virtio_net
> - xen
>
> Co-developed-by: Kumar Kartikeya Dwivedi <memxor@...il.com>
> Signed-off-by: Kumar Kartikeya Dwivedi <memxor@...il.com>
> Co-developed-by: Lorenzo Bianconi <lorenzo@...nel.org>
> Signed-off-by: Lorenzo Bianconi <lorenzo@...nel.org>
> Signed-off-by: Marek Majtyka <alardam@...il.com>
The code below matches my understanding of what was discussed wrt
earlier versions of this patchset.
For the nfp driver portion:
Reviewed-by: Simon Horman <simon.horman@...igine.com>
> diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
> index 18fc9971f1c8..e4825d885560 100644
> --- a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
> +++ b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
> @@ -2529,10 +2529,15 @@ static void nfp_net_netdev_init(struct nfp_net *nn)
> netdev->features &= ~NETIF_F_HW_VLAN_STAG_RX;
> nn->dp.ctrl &= ~NFP_NET_CFG_CTRL_RXQINQ;
>
> + netdev->xdp_features = NETDEV_XDP_ACT_BASIC;
> + if (nn->app && nn->app->type->id == NFP_APP_BPF_NIC)
> + netdev->xdp_features |= NETDEV_XDP_ACT_HW_OFFLOAD;
> +
> /* Finalise the netdev setup */
> switch (nn->dp.ops->version) {
> case NFP_NFD_VER_NFD3:
> netdev->netdev_ops = &nfp_nfd3_netdev_ops;
> + netdev->xdp_features |= NETDEV_XDP_ACT_XSK_ZEROCOPY;
> break;
> case NFP_NFD_VER_NFDK:
> netdev->netdev_ops = &nfp_nfdk_netdev_ops;
Powered by blists - more mailing lists