@@ -1795,6 +1795,15 @@ static int ib_spec_to_kern_spec(struct ibv_flow_spec *ib_spec,
kern_spec->handle.handle = vaction->handle;
break;
}
+ case IBV_FLOW_SPEC_ACTION_COUNT: {
+ const struct verbs_counters *vcounters =
+ container_of(ib_spec->flow_count.counters,
+ const struct verbs_counters, counters);
+ kern_spec->flow_count.size =
+ sizeof(struct ib_uverbs_flow_spec_action_count);
+ kern_spec->flow_count.handle = vcounters->handle;
+ break;
+ }
default:
return EINVAL;
}
@@ -271,6 +271,7 @@ struct ibv_kern_spec {
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;
+ struct ib_uverbs_flow_spec_action_count flow_count;
};
};
@@ -73,6 +73,7 @@ IBV_FLOW_SPEC_INNER = 0x100, /* Flag making L2/L3/L4 specif
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 */
+IBV_FLOW_SPEC_ACTION_COUNT = 0x1003, /* Action count matched packet with a ibv_counters handle */
.in -8
};
.br
@@ -1404,6 +1404,7 @@ enum ibv_flow_spec_type {
IBV_FLOW_SPEC_ACTION_TAG = 0x1000,
IBV_FLOW_SPEC_ACTION_DROP = 0x1001,
IBV_FLOW_SPEC_ACTION_HANDLE = 0x1002,
+ IBV_FLOW_SPEC_ACTION_COUNT = 0x1003,
};
struct ibv_flow_eth_filter {
@@ -1519,6 +1520,12 @@ struct ibv_flow_spec_action_handle {
const struct ibv_flow_action *action;
};
+struct ibv_flow_spec_counter_action {
+ enum ibv_flow_spec_type type;
+ uint16_t size;
+ struct ibv_counters *counters;
+};
+
struct ibv_flow_spec {
union {
struct {
@@ -1535,6 +1542,7 @@ struct ibv_flow_spec {
struct ibv_flow_spec_action_tag flow_tag;
struct ibv_flow_spec_action_drop drop;
struct ibv_flow_spec_action_handle handle;
+ struct ibv_flow_spec_counter_action flow_count;
};
};