Skip to contentSkip to conversation

iplink: document XDP subcommand to force the XDP mode.

PATCH Applied Matteo Croce 3 participants 5 messages Feb 13, 2019 – Feb 14, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iplink: document XDP subcommand to force the XDP mode.

When attaching an eBPF program to a device, ip link can force the XDP mode by using the xdp{generic,drv,offload} keyword instead of just 'xdp'. Document this behaviour also in the help output.

Fixes 14683814 ("bpf: add xdpdrv for requesting XDP driver mode")
Fixes 1b5e8094 ("bpf: allow requesting XDP HW offload")
---
 ip/iplink.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
ip/iplink.c +1 -1
index b5519201..3a0cf459 100644
@@ -98,7 +98,7 @@ void iplink_usage(void)
 		"				   [ trust { on | off} ] ]\n"
 		"				   [ node_guid { eui64 } ]\n"
 		"				   [ port_guid { eui64 } ]\n"
-		"			  [ xdp { off |\n"
+		"			  [ { xdp | xdpgeneric | xdpdrv | xdpoffload } { off |\n"
 		"				  object FILE [ section NAME ] [ verbose ] |\n"
 		"				  pinned FILE } ]\n"
 		"			  [ master DEVICE ][ vrf NAME ]\n"
Signature · 1 line
2.20.1
#1 lore raw
Quoted 7 lines · On Wed, 13 Feb 2019 15:40:30 +0100 Matteo Croce <[email protected]> wrote:

When attaching an eBPF program to a device, ip link can force the XDP mode by using the xdp{generic,drv,offload} keyword instead of just 'xdp'. Document this behaviour also in the help output.

Fixes 14683814 ("bpf: add xdpdrv for requesting XDP driver mode")
Fixes 1b5e8094 ("bpf: allow requesting XDP HW offload")

Applied, thanks.
The man page already has this as well.

#2 lore raw
Quoted 8 lines · Stephen Hemminger
Quoted 4 lines · On Wed, 13 Feb 2019 15:40:30 +0100 Matteo Croce <[email protected]> wrote:

When attaching an eBPF program to a device, ip link can force the XDP mode by using the xdp{generic,drv,offload} keyword instead of just 'xdp'. Document this behaviour also in the help output.

Quoted 7 lines
Quoted 3 lines
Fixes 14683814 ("bpf: add xdpdrv for requesting XDP driver mode")
Fixes 1b5e8094 ("bpf: allow requesting XDP HW offload")

Applied, thanks.
The man page already has this as well.

Yes, I found it just after I made the patch. However, it could be nice to have the generic "xdp" and a command like "type" or "mode" to specify the XDP mode, eg.
ip link set dev eth0 xdp mode [ auto | generic | drv | offload ] I was trying to add it, but unfortunately it seems that the arguments aren't parsed in a loop, and are required to be in the exact order. Would this change make sense?

Regards,

--
Matteo Croce
per aspera ad upstream

#3 lore raw
Quoted 26 lines · On Thu, 14 Feb 2019 15:01:26 +0100 Matteo Croce <[email protected]> wrote:
Quoted 8 lines · Stephen Hemminger
Quoted 4 lines · On Wed, 13 Feb 2019 15:40:30 +0100 Matteo Croce <[email protected]> wrote:

When attaching an eBPF program to a device, ip link can force the XDP mode by using the xdp{generic,drv,offload} keyword instead of just 'xdp'. Document this behaviour also in the help output.

Quoted 7 lines
Quoted 3 lines
Fixes 14683814 ("bpf: add xdpdrv for requesting XDP driver mode")
Fixes 1b5e8094 ("bpf: allow requesting XDP HW offload")

Applied, thanks.
The man page already has this as well.

Yes, I found it just after I made the patch. However, it could be nice to have the generic "xdp" and a command like "type" or "mode" to specify the XDP mode, eg.
ip link set dev eth0 xdp mode [ auto | generic | drv | offload ] I was trying to add it, but unfortunately it seems that the arguments aren't parsed in a loop, and are required to be in the exact order. Would this change make sense?

Quoted 5 lines

Regards,

--
Matteo Croce
per aspera ad upstream

It would have made sense to start with, but the syntax is more or less fixed by now.

Acked-by on v1 1/1
#4 lore raw
In reply to Matteo Croce
Quoted 7 lines · Matteo Croce

When attaching an eBPF program to a device, ip link can force the XDP mode by using the xdp{generic,drv,offload} keyword instead of just 'xdp'. Document this behaviour also in the help output.

Fixes 14683814 ("bpf: add xdpdrv for requesting XDP driver mode")
Fixes 1b5e8094 ("bpf: allow requesting XDP HW offload")