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-next>] [day] [month] [year] [list]
Message-ID: <20200819092811.GA2420@lore-desk>
Date:   Wed, 19 Aug 2020 11:28:11 +0200
From:   Lorenzo Bianconi <lorenzo@...nel.org>
To:     andriin@...com
Cc:     bpf@...r.kernel.org, netdev@...r.kernel.org,
        Jesper Dangaard Brouer <brouer@...hat.com>,
        David Miller <davem@...emloft.net>, ast@...nel.org
Subject: xdp generic default option

Hi Andrii,

working on xdp multi-buff I figured out now xdp generic is the default choice
if not specified by userspace. In particular after commit 7f0a838254bd
("bpf, xdp: Maintain info on attached XDP BPF programs in net_device"), running
the command below, XDP will run in generic mode even if the underlay driver
support XDP in native mode:

$ip link set dev eth0 xdp obj prog.o
$ip link show dev eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 xdpgeneric qdisc mq state UP mode DEFAULT
   group default qlen 1024
   link/ether f0:ad:4e:09:6b:57 brd ff:ff:ff:ff:ff:ff
   prog/xdp id 1 tag 3b185187f1855c4c jited 

Is it better to use xdpdrv as default choice if not specified by userspace?
doing something like:

diff --git a/net/core/dev.c b/net/core/dev.c
index a00aa737ce29..1f85880ee412 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -8747,9 +8747,9 @@ static enum bpf_xdp_mode dev_xdp_mode(u32 flags)
 {
 	if (flags & XDP_FLAGS_HW_MODE)
 		return XDP_MODE_HW;
-	if (flags & XDP_FLAGS_DRV_MODE)
-		return XDP_MODE_DRV;
-	return XDP_MODE_SKB;
+	if (flags & XDP_FLAGS_SKB_MODE)
+		return XDP_MODE_SKB;
+	return XDP_MODE_DRV;
 }
 
 static bpf_op_t dev_xdp_bpf_op(struct net_device *dev, enum bpf_xdp_mode mode)

Regards,
Lorenzo

Download attachment "signature.asc" of type "application/pgp-signature" (229 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ