@@ -984,6 +984,19 @@ struct ib_uverbs_flow_spec_action_drop {
};
};
+struct ib_uverbs_flow_spec_action_handle {
+ union {
+ struct ib_uverbs_flow_spec_hdr hdr;
+ struct {
+ __u32 type;
+ __u16 size;
+ __u16 reserved;
+ };
+ };
+ __u32 handle;
+ __u32 reserved1;
+};
+
struct ib_uverbs_flow_tunnel_filter {
__be32 tunnel_id;
};
@@ -1778,6 +1778,14 @@ static int ib_spec_to_kern_spec(struct ibv_flow_spec *ib_spec,
case IBV_FLOW_SPEC_ACTION_DROP:
kern_spec->drop.size = sizeof(struct ib_uverbs_flow_spec_action_drop);
break;
+ case IBV_FLOW_SPEC_ACTION_HANDLE: {
+ const struct verbs_flow_action *vaction =
+ container_of((const struct ibv_flow_action *)ib_spec->handle.action,
+ const struct verbs_flow_action, action);
+ kern_spec->handle.size = sizeof(struct ib_uverbs_flow_spec_action_handle);
+ kern_spec->handle.handle = vaction->handle;
+ break;
+ }
default:
return EINVAL;
}
@@ -262,6 +262,7 @@ struct ibv_kern_spec {
struct ib_uverbs_flow_spec_tunnel tunnel;
struct ib_uverbs_flow_spec_action_tag flow_tag;
struct ib_uverbs_flow_spec_action_drop drop;
+ struct ib_uverbs_flow_spec_action_handle handle;
};
};
@@ -72,6 +72,7 @@ IBV_FLOW_SPEC_VXLAN_TUNNEL = 0x50, /* Flow specification of VXLAN
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 */
IBV_FLOW_SPEC_ACTION_DROP = 0x1001, /* Action dropping matched packet */
+IBV_FLOW_SPEC_ACTION_HANDLE = 0x1002, /* Carry out an action created by ibv_create_flow_action_xxxx verb */
.in -8
};
.br
@@ -1387,6 +1387,7 @@ enum ibv_flow_spec_type {
IBV_FLOW_SPEC_INNER = 0x100,
IBV_FLOW_SPEC_ACTION_TAG = 0x1000,
IBV_FLOW_SPEC_ACTION_DROP = 0x1001,
+ IBV_FLOW_SPEC_ACTION_HANDLE = 0x1002,
};
struct ibv_flow_eth_filter {
@@ -1496,6 +1497,12 @@ struct ibv_flow_spec_action_drop {
uint16_t size;
};
+struct ibv_flow_spec_action_handle {
+ enum ibv_flow_spec_type type;
+ uint16_t size;
+ const struct ibv_flow_action *action;
+};
+
struct ibv_flow_spec {
union {
struct {
@@ -1511,6 +1518,7 @@ struct ibv_flow_spec {
struct ibv_flow_spec_tunnel tunnel;
struct ibv_flow_spec_action_tag flow_tag;
struct ibv_flow_spec_action_drop drop;
+ struct ibv_flow_spec_action_handle handle;
};
};