lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Mon, 30 Jan 2023 15:09:35 +0100
From:   Gerhard Engleder <gerhard@...leder-embedded.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, simon.horman@...igine.com,
        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
Subject: Re: [PATCH v2 bpf-next 2/8] drivers: net: turn on XDP features

On 29.01.2023 14:05, Lorenzo Bianconi wrote:
>> On 25.01.23 01:33, 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
>> >
>> > 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
>> 
>> XDP support for tsnep was merged to net-next last week. So this driver
>> cannot get XDP feature support in bpf-next as it is not there 
>> currently.
>> Should I add these flags with a fix afterwards? Or would net-next be 
>> the
>> better target for this patch series?
> 
> bpf-next has been rebased on top of net-next so we can add tsnep 
> support to the
> series. Do you think the patch below is fine?
> 
> Regards,
> Lorenzo
> 
> diff --git a/drivers/net/ethernet/engleder/tsnep_main.c
> b/drivers/net/ethernet/engleder/tsnep_main.c
> index c3cf427a9409..6982aaa928b5 100644
> --- a/drivers/net/ethernet/engleder/tsnep_main.c
> +++ b/drivers/net/ethernet/engleder/tsnep_main.c
> @@ -1926,6 +1926,10 @@ static int tsnep_probe(struct platform_device 
> *pdev)
>  	netdev->features = NETIF_F_SG;
>  	netdev->hw_features = netdev->features | NETIF_F_LOOPBACK;
> 
> +	netdev->xdp_features = NETDEV_XDP_ACT_BASIC | NETDEV_XDP_ACT_REDIRECT 
> |
> +			       NETDEV_XDP_ACT_NDO_XMIT |
> +			       NETDEV_XDP_ACT_NDO_XMIT_SG;
> +

Looks good. Thanks!

Gerhard

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ