diff options
| author | Jakub Kicinski <jakub.kicinski@netronome.com> | 2017-06-21 21:25:04 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2017-06-23 13:42:19 -0400 |
| commit | ee5d032f7d032e2cea354522a46b211de84c4e8c (patch) | |
| tree | 604c77de07871b2d8d955de0b6485f2cc27adf25 /include | |
| parent | 32d602771b624e3a2fc86d5e220e9fa7dced767a (diff) | |
xdp: add HW offload mode flag for installing programs
Add an installation-time flag for requesting that the program
be installed only if it can be offloaded to HW.
Internally new command for ndo_xdp is added, this way we avoid
putting checks into drivers since they all return -EINVAL on
an unknown command.
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>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/netdevice.h | 1 | ||||
| -rw-r--r-- | include/uapi/linux/if_link.h | 7 |
2 files changed, 6 insertions, 2 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index b194817631de..a838591aad28 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
| @@ -807,6 +807,7 @@ enum xdp_netdev_command { | |||
| 807 | * when it is no longer used. | 807 | * when it is no longer used. |
| 808 | */ | 808 | */ |
| 809 | XDP_SETUP_PROG, | 809 | XDP_SETUP_PROG, |
| 810 | XDP_SETUP_PROG_HW, | ||
| 810 | /* Check if a bpf program is set on the device. The callee should | 811 | /* Check if a bpf program is set on the device. The callee should |
| 811 | * return true if a program is currently attached and running. | 812 | * return true if a program is currently attached and running. |
| 812 | */ | 813 | */ |
diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h index dd88375a6580..ce777ec88e1e 100644 --- a/include/uapi/linux/if_link.h +++ b/include/uapi/linux/if_link.h | |||
| @@ -891,9 +891,12 @@ enum { | |||
| 891 | #define XDP_FLAGS_UPDATE_IF_NOEXIST (1U << 0) | 891 | #define XDP_FLAGS_UPDATE_IF_NOEXIST (1U << 0) |
| 892 | #define XDP_FLAGS_SKB_MODE (1U << 1) | 892 | #define XDP_FLAGS_SKB_MODE (1U << 1) |
| 893 | #define XDP_FLAGS_DRV_MODE (1U << 2) | 893 | #define XDP_FLAGS_DRV_MODE (1U << 2) |
| 894 | #define XDP_FLAGS_HW_MODE (1U << 3) | ||
| 895 | #define XDP_FLAGS_MODES (XDP_FLAGS_SKB_MODE | \ | ||
| 896 | XDP_FLAGS_DRV_MODE | \ | ||
| 897 | XDP_FLAGS_HW_MODE) | ||
| 894 | #define XDP_FLAGS_MASK (XDP_FLAGS_UPDATE_IF_NOEXIST | \ | 898 | #define XDP_FLAGS_MASK (XDP_FLAGS_UPDATE_IF_NOEXIST | \ |
| 895 | XDP_FLAGS_SKB_MODE | \ | 899 | XDP_FLAGS_MODES) |
| 896 | XDP_FLAGS_DRV_MODE) | ||
| 897 | 900 | ||
| 898 | /* These are stored into IFLA_XDP_ATTACHED on dump. */ | 901 | /* These are stored into IFLA_XDP_ATTACHED on dump. */ |
| 899 | enum { | 902 | enum { |
