diff options
author | Daniel Borkmann <daniel@iogearbox.net> | 2016-03-15 20:42:51 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-03-18 19:38:46 -0400 |
commit | fca5fdf67de9e092fda23c9eb059ba968e7b5267 (patch) | |
tree | 06aa42e0d7679a15e223a05acd202d2897252bb1 /include/net/ip_tunnels.h | |
parent | 808c1b697c3c4dd2a7132882424c390b0d0acfb9 (diff) |
ip_tunnels, bpf: define IP_TUNNEL_OPTS_MAX and use it
eBPF defines this as BPF_TUNLEN_MAX and OVS just uses the hard-coded
value inside struct sw_flow_key. Thus, add and use IP_TUNNEL_OPTS_MAX
for this, which makes the code a bit more generic and allows to remove
BPF_TUNLEN_MAX from eBPF code.
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/ip_tunnels.h')
-rw-r--r-- | include/net/ip_tunnels.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/net/ip_tunnels.h b/include/net/ip_tunnels.h index 5dc2e454f866..c35dda9ec991 100644 --- a/include/net/ip_tunnels.h +++ b/include/net/ip_tunnels.h | |||
@@ -7,6 +7,8 @@ | |||
7 | #include <linux/socket.h> | 7 | #include <linux/socket.h> |
8 | #include <linux/types.h> | 8 | #include <linux/types.h> |
9 | #include <linux/u64_stats_sync.h> | 9 | #include <linux/u64_stats_sync.h> |
10 | #include <linux/bitops.h> | ||
11 | |||
10 | #include <net/dsfield.h> | 12 | #include <net/dsfield.h> |
11 | #include <net/gro_cells.h> | 13 | #include <net/gro_cells.h> |
12 | #include <net/inet_ecn.h> | 14 | #include <net/inet_ecn.h> |
@@ -57,6 +59,11 @@ struct ip_tunnel_key { | |||
57 | #define IP_TUNNEL_INFO_TX 0x01 /* represents tx tunnel parameters */ | 59 | #define IP_TUNNEL_INFO_TX 0x01 /* represents tx tunnel parameters */ |
58 | #define IP_TUNNEL_INFO_IPV6 0x02 /* key contains IPv6 addresses */ | 60 | #define IP_TUNNEL_INFO_IPV6 0x02 /* key contains IPv6 addresses */ |
59 | 61 | ||
62 | /* Maximum tunnel options length. */ | ||
63 | #define IP_TUNNEL_OPTS_MAX \ | ||
64 | GENMASK((FIELD_SIZEOF(struct ip_tunnel_info, \ | ||
65 | options_len) * BITS_PER_BYTE) - 1, 0) | ||
66 | |||
60 | struct ip_tunnel_info { | 67 | struct ip_tunnel_info { |
61 | struct ip_tunnel_key key; | 68 | struct ip_tunnel_key key; |
62 | #ifdef CONFIG_DST_CACHE | 69 | #ifdef CONFIG_DST_CACHE |