On 07/14/2018 12:54 AM, Jakub Kicinski wrote: > Kernel now supports attaching XDP programs in the driver > and hardware at the same time. Print that information > correctly. > > In case there are multiple programs attached kernel will > not provide IFLA_XDP_PROG_ID, so don't expect it to be > there (this also improves the printing for very old kernels > slightly, as it avoids unnecessary "prog/xdp" line). > > In short mode preserve the current outputs but don't print > IDs if there are multiple. > > 6: netdevsim0: <BROADCAST,NOARP> mtu 1500 xdpoffload/id:11 qdisc [...] > > and: > > 6: netdevsim0: <BROADCAST,NOARP> mtu 1500 xdpmulti qdisc [...] > > ip link output will keep using prog/xdp prefix if only one program > is attached, but can also print multiple program lines: > > prog/xdp id 8 tag fc7a51d1a693a99e jited > > vs: > > prog/xdpdrv id 8 tag fc7a51d1a693a99e jited > prog/xdpoffload id 9 tag fc7a51d1a693a99e > > JSON output gains a new array called "attached" which will > contain the full list of attached programs along with their > attachment modes: > > "xdp": { > "mode": 3, > "prog": { > "id": 11, > "tag": "fc7a51d1a693a99e", > "jited": 0 > }, > "attached": [ { > "mode": 3, > "prog": { > "id": 11, > "tag": "fc7a51d1a693a99e", > "jited": 0 > } > } ] > }, > > In case there are multiple programs attached the general "xdp" > section will not contain program information: > > "xdp": { > "mode": 4, > "attached": [ { > "mode": 1, > "prog": { > "id": 10, > "tag": "fc7a51d1a693a99e", > "jited": 1 > } > },{ > "mode": 3, > "prog": { > "id": 11, > "tag": "fc7a51d1a693a99e", > "jited": 0 > } > } ] > }, > > Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> > Reviewed-by: Quentin Monnet <quentin.mon...@netronome.com>
LGTM, thanks! Acked-by: Daniel Borkmann <dan...@iogearbox.net>