@@ -1001,6 +1001,24 @@ struct ib_uverbs_flow_spec_tunnel {
struct ib_uverbs_flow_tunnel_filter mask;
};
+struct ib_uverbs_flow_spec_esp_filter {
+ __u32 spi;
+ __u32 seq;
+};
+
+struct ib_uverbs_flow_spec_esp {
+ union {
+ struct ib_uverbs_flow_spec_hdr hdr;
+ struct {
+ __u32 type;
+ __u16 size;
+ __u16 reserved;
+ };
+ };
+ struct ib_uverbs_flow_spec_esp_filter val;
+ struct ib_uverbs_flow_spec_esp_filter mask;
+};
+
struct ib_uverbs_flow_attr {
__u32 type;
__u16 size;
@@ -1739,6 +1739,14 @@ static int ib_spec_to_kern_spec(struct ibv_flow_spec *ib_spec,
memcpy(&kern_spec->ipv6.mask, (void *)&ib_spec->ipv6.val
+ ib_filter_size, kern_filter_size);
break;
+ case IBV_FLOW_SPEC_ESP:
+ case IBV_FLOW_SPEC_ESP | IBV_FLOW_SPEC_INNER:
+ kern_spec->esp.size = sizeof(struct ib_uverbs_flow_spec_esp);
+ memcpy(&kern_spec->esp.val, &ib_spec->esp.val,
+ sizeof(struct ib_uverbs_flow_spec_esp_filter));
+ memcpy(&kern_spec->esp.mask, (void *)&ib_spec->esp.mask,
+ sizeof(struct ib_uverbs_flow_spec_esp_filter));
+ break;
case IBV_FLOW_SPEC_TCP:
case IBV_FLOW_SPEC_UDP:
case IBV_FLOW_SPEC_TCP | IBV_FLOW_SPEC_INNER:
@@ -256,6 +256,7 @@ struct ibv_kern_spec {
struct ib_uverbs_flow_spec_eth eth;
struct ibv_kern_spec_ipv4 ipv4;
struct ib_uverbs_flow_spec_ipv4 ipv4_ext;
+ struct ib_uverbs_flow_spec_esp esp;
struct ib_uverbs_flow_spec_tcp_udp tcp_udp;
struct ib_uverbs_flow_spec_ipv6 ipv6;
struct ib_uverbs_flow_spec_tunnel tunnel;
@@ -65,6 +65,7 @@ IBV_FLOW_SPEC_ETH = 0x20, /* Flow specification of L2 he
IBV_FLOW_SPEC_IPV4 = 0x30, /* Flow specification of IPv4 header */
IBV_FLOW_SPEC_IPV6 = 0x31, /* Flow specification of IPv6 header */
IBV_FLOW_SPEC_IPV4_EXT = 0x32, /* Extended flow specification of IPv4 */
+IBV_FLOW_SPEC_ESP = 0x34, /* Flow specification of ESP (IPSec) header */
IBV_FLOW_SPEC_TCP = 0x40, /* Flow specification of TCP header */
IBV_FLOW_SPEC_UDP = 0x41, /* Flow specification of UDP header */
IBV_FLOW_SPEC_VXLAN_TUNNEL = 0x50, /* Flow specification of VXLAN header */
@@ -1380,6 +1380,7 @@ enum ibv_flow_spec_type {
IBV_FLOW_SPEC_IPV4 = 0x30,
IBV_FLOW_SPEC_IPV6 = 0x31,
IBV_FLOW_SPEC_IPV4_EXT = 0x32,
+ IBV_FLOW_SPEC_ESP = 0x34,
IBV_FLOW_SPEC_TCP = 0x40,
IBV_FLOW_SPEC_UDP = 0x41,
IBV_FLOW_SPEC_VXLAN_TUNNEL = 0x50,
@@ -1449,6 +1450,18 @@ struct ibv_flow_spec_ipv6 {
struct ibv_flow_ipv6_filter mask;
};
+struct ibv_flow_esp_filter {
+ uint32_t spi;
+ uint32_t seq;
+};
+
+struct ibv_flow_spec_esp {
+ enum ibv_flow_spec_type type;
+ uint16_t size;
+ struct ibv_flow_esp_filter val;
+ struct ibv_flow_esp_filter mask;
+};
+
struct ibv_flow_tcp_udp_filter {
uint16_t dst_port;
uint16_t src_port;
@@ -1494,6 +1507,7 @@ struct ibv_flow_spec {
struct ibv_flow_spec_tcp_udp tcp_udp;
struct ibv_flow_spec_ipv4_ext ipv4_ext;
struct ibv_flow_spec_ipv6 ipv6;
+ struct ibv_flow_spec_esp esp;
struct ibv_flow_spec_tunnel tunnel;
struct ibv_flow_spec_action_tag flow_tag;
struct ibv_flow_spec_action_drop drop;