diff options
author | Paul Blakey <paulb@mellanox.com> | 2017-09-18 07:16:01 +0300 |
---|---|---|
committer | Simon Horman <simon.horman@netronome.com> | 2017-11-16 08:03:05 -0800 |
commit | e5b1657e6f67a28c36d3d22bbe758d451f99ec1f (patch) | |
tree | 38b4acbd47e9abc61195a25cac98119e2dff695d /include/linux | |
parent | fa54741ea53eb863628ba0290ebdbf490dca1ffd (diff) | |
download | openvswitch-e5b1657e6f67a28c36d3d22bbe758d451f99ec1f.tar.gz |
compat: Add act_pedit compatibility for old kernels
Added compatibility for action pedit.
Signed-off-by: Paul Blakey <paulb@mellanox.com>
Reviewed-by: Roi Dayan <roid@mellanox.com>
Signed-off-by: Simon Horman <simon.horman@netronome.com>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/automake.mk | 1 | ||||
-rw-r--r-- | include/linux/tc_act/tc_pedit.h | 72 |
2 files changed, 73 insertions, 0 deletions
diff --git a/include/linux/automake.mk b/include/linux/automake.mk index 093204eb3..b464fe0f5 100644 --- a/include/linux/automake.mk +++ b/include/linux/automake.mk @@ -1,4 +1,5 @@ noinst_HEADERS += \ include/linux/pkt_cls.h \ + include/linux/tc_act/tc_pedit.h \ include/linux/tc_act/tc_tunnel_key.h \ include/linux/tc_act/tc_vlan.h diff --git a/include/linux/tc_act/tc_pedit.h b/include/linux/tc_act/tc_pedit.h new file mode 100644 index 000000000..d9c2af655 --- /dev/null +++ b/include/linux/tc_act/tc_pedit.h @@ -0,0 +1,72 @@ +#ifndef __LINUX_TC_ACT_TC_PEDIT_WRAPPER_H +#define __LINUX_TC_ACT_TC_PEDIT_WRAPPER_H 1 + +#if defined(__KERNEL__) || defined(HAVE_TCA_PEDIT_KEY_EX_HDR_TYPE_UDP) +#include_next <linux/tc_act/tc_pedit.h> +#else + +#include <linux/types.h> +#include <linux/pkt_cls.h> + +#define TCA_ACT_PEDIT 7 + +enum { + TCA_PEDIT_UNSPEC, + TCA_PEDIT_TM, + TCA_PEDIT_PARMS, + TCA_PEDIT_PAD, + TCA_PEDIT_PARMS_EX, + TCA_PEDIT_KEYS_EX, + TCA_PEDIT_KEY_EX, + __TCA_PEDIT_MAX +}; +#define TCA_PEDIT_MAX (__TCA_PEDIT_MAX - 1) + +enum { + TCA_PEDIT_KEY_EX_HTYPE = 1, + TCA_PEDIT_KEY_EX_CMD = 2, + __TCA_PEDIT_KEY_EX_MAX +}; +#define TCA_PEDIT_KEY_EX_MAX (__TCA_PEDIT_KEY_EX_MAX - 1) + + /* TCA_PEDIT_KEY_EX_HDR_TYPE_NETWROK is a special case for legacy users. It + * means no specific header type - offset is relative to the network layer + */ +enum pedit_header_type { + TCA_PEDIT_KEY_EX_HDR_TYPE_NETWORK = 0, + TCA_PEDIT_KEY_EX_HDR_TYPE_ETH = 1, + TCA_PEDIT_KEY_EX_HDR_TYPE_IP4 = 2, + TCA_PEDIT_KEY_EX_HDR_TYPE_IP6 = 3, + TCA_PEDIT_KEY_EX_HDR_TYPE_TCP = 4, + TCA_PEDIT_KEY_EX_HDR_TYPE_UDP = 5, + __PEDIT_HDR_TYPE_MAX, +}; +#define TCA_PEDIT_HDR_TYPE_MAX (__PEDIT_HDR_TYPE_MAX - 1) + +enum pedit_cmd { + TCA_PEDIT_KEY_EX_CMD_SET = 0, + TCA_PEDIT_KEY_EX_CMD_ADD = 1, + __PEDIT_CMD_MAX, +}; +#define TCA_PEDIT_CMD_MAX (__PEDIT_CMD_MAX - 1) + +struct tc_pedit_key { + __u32 mask; /* AND */ + __u32 val; /*XOR */ + __u32 off; /*offset */ + __u32 at; + __u32 offmask; + __u32 shift; +}; + +struct tc_pedit_sel { + tc_gen; + unsigned char nkeys; + unsigned char flags; + struct tc_pedit_key keys[0]; +}; +#define tc_pedit tc_pedit_sel + +#endif /* __KERNEL__ || HAVE_TCA_PEDIT_KEY_EX_HDR_TYPE_UDP */ + +#endif /* __LINUX_TC_ACT_TC_PEDIT_WRAPPER_H */ |