@@ -1818,6 +1818,11 @@ static int ib_spec_to_kern_spec(struct ibv_flow_spec *ib_spec,
memcpy(&kern_spec->tunnel.mask, (void *)&ib_spec->tunnel.val
+ ib_filter_size, kern_filter_size);
break;
+ case IBV_FLOW_SPEC_ACTION_TAG:
+ kern_spec->flow_tag.size =
+ sizeof(struct ibv_kern_spec_action_tag);
+ kern_spec->flow_tag.tag_id = ib_spec->flow_tag.tag_id;
+ break;
default:
return EINVAL;
}
@@ -918,6 +918,13 @@ struct ibv_kern_spec_tcp_udp {
struct ibv_kern_tcp_udp_filter mask;
};
+struct ibv_kern_spec_action_tag {
+ __u32 type;
+ __u16 size;
+ __u16 reserved;
+ __u32 tag_id;
+ __u32 reserved1;
+};
struct ibv_kern_tunnel_filter {
__u32 tunnel_id;
@@ -944,6 +951,7 @@ struct ibv_kern_spec {
struct ibv_kern_spec_tcp_udp tcp_udp;
struct ibv_kern_spec_ipv6 ipv6;
struct ibv_kern_spec_tunnel tunnel;
+ struct ibv_kern_spec_action_tag flow_tag;
};
};
@@ -68,6 +68,7 @@ IBV_FLOW_SPEC_TCP = 0x40, /* Flow specification of TCP h
IBV_FLOW_SPEC_UDP = 0x41, /* Flow specification of UDP header */
IBV_FLOW_SPEC_VXLAN_TUNNEL = 0x50, /* Flow specification of VXLAN header */
IBV_FLOW_SPEC_INNER = 0x100, /* Flag making L2/L3/L4 specifications to be applied on the inner header */
+IBV_FLOW_SPEC_ACTION_TAG = 0x1000, /* Action tagging matched packet */
.in -8
};
.br
@@ -1224,7 +1224,8 @@ enum ibv_flow_spec_type {
IBV_FLOW_SPEC_TCP = 0x40,
IBV_FLOW_SPEC_UDP = 0x41,
IBV_FLOW_SPEC_VXLAN_TUNNEL = 0x50,
- IBV_FLOW_SPEC_INNER = 0x100
+ IBV_FLOW_SPEC_INNER = 0x100,
+ IBV_FLOW_SPEC_ACTION_TAG = 0x1000
};
struct ibv_flow_eth_filter {
@@ -1311,6 +1312,12 @@ struct ibv_flow_spec_tunnel {
struct ibv_flow_tunnel_filter mask;
};
+struct ibv_flow_spec_action_tag {
+ enum ibv_flow_spec_type type;
+ uint16_t size;
+ uint32_t tag_id;
+};
+
struct ibv_flow_spec {
union {
struct {
@@ -1323,6 +1330,7 @@ struct ibv_flow_spec {
struct ibv_flow_spec_ipv4_ext ipv4_ext;
struct ibv_flow_spec_ipv6 ipv6;
struct ibv_flow_spec_tunnel tunnel;
+ struct ibv_flow_spec_action_tag flow_tag;
};
};