xdp: add reporting of offload mode
Extend the XDP_ATTACHED_* values to include offloaded mode. Let drivers report whether program is installed in the driver or the HW by changing the prog_attached field from bool to u8 (type of the netlink attribute). Exploit the fact that the value of XDP_ATTACHED_DRV is 1, therefore since all drivers currently assign the mode with double negation: mode = !!xdp_prog; no drivers have to be modified. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Acked-by: Daniel Borkmann <daniel@iogearbox.net> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
cafa92ac25
commit
ce158e580a
@@ -903,6 +903,7 @@ enum {
|
||||
XDP_ATTACHED_NONE = 0,
|
||||
XDP_ATTACHED_DRV,
|
||||
XDP_ATTACHED_SKB,
|
||||
XDP_ATTACHED_HW,
|
||||
};
|
||||
|
||||
enum {
|
||||
|
Reference in New Issue
Block a user