* [PATCH rdma-core] verbs: Introduce flow steering drop action
@ 2017-06-01 15:47 Yishai Hadas
[not found] ` <1496332034-14758-1-git-send-email-yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Yishai Hadas @ 2017-06-01 15:47 UTC (permalink / raw)
To: dledford-H+wXaHxf7aLQT0dZR+AlfA
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, yishaih-VPRAkNaXOzVWk0Htik3J/w,
slavash-VPRAkNaXOzVWk0Htik3J/w, majd-VPRAkNaXOzVWk0Htik3J/w
From: Slava Shwartsman <slavash-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
This flow steering specification identifies a drop flow to the
hardware.
If user creates a flow only with the drop specification, then all the
packets that hit this flow will be dropped, otherwise the hardware will
drop only the packets that match the other L2/L3/L4 specifications.
Signed-off-by: Slava Shwartsman <slavash-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Reviewed-by: Maor Gottlieb <maorg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Reviewed-by: Yishai Hadas <yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
This is the complementary user space part of the kernel code that was merged
into 4.12.
libibverbs/cmd.c | 3 +++
libibverbs/kern-abi.h | 7 +++++++
libibverbs/man/ibv_create_flow.3 | 1 +
libibverbs/verbs.h | 9 ++++++++-
4 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/libibverbs/cmd.c b/libibverbs/cmd.c
index 3a5aa4e..7a266ee 100644
--- a/libibverbs/cmd.c
+++ b/libibverbs/cmd.c
@@ -1823,6 +1823,9 @@ static int ib_spec_to_kern_spec(struct ibv_flow_spec *ib_spec,
sizeof(struct ibv_kern_spec_action_tag);
kern_spec->flow_tag.tag_id = ib_spec->flow_tag.tag_id;
break;
+ case IBV_FLOW_SPEC_ACTION_DROP:
+ kern_spec->drop.size = sizeof(struct ibv_kern_spec_action_drop);
+ break;
default:
return EINVAL;
}
diff --git a/libibverbs/kern-abi.h b/libibverbs/kern-abi.h
index 448b2e8..8d42faf 100644
--- a/libibverbs/kern-abi.h
+++ b/libibverbs/kern-abi.h
@@ -938,6 +938,12 @@ struct ibv_kern_spec_tunnel {
struct ibv_kern_tunnel_filter mask;
};
+struct ibv_kern_spec_action_drop {
+ __u32 type;
+ __u16 size;
+ __u16 reserved;
+};
+
struct ibv_kern_spec {
union {
struct {
@@ -952,6 +958,7 @@ struct ibv_kern_spec {
struct ibv_kern_spec_ipv6 ipv6;
struct ibv_kern_spec_tunnel tunnel;
struct ibv_kern_spec_action_tag flow_tag;
+ struct ibv_kern_spec_action_drop drop;
};
};
diff --git a/libibverbs/man/ibv_create_flow.3 b/libibverbs/man/ibv_create_flow.3
index 32d47ad..48bbb14 100644
--- a/libibverbs/man/ibv_create_flow.3
+++ b/libibverbs/man/ibv_create_flow.3
@@ -69,6 +69,7 @@ IBV_FLOW_SPEC_UDP = 0x41, /* Flow specification of UDP h
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 */
+IBV_FLOW_SPEC_ACTION_DROP = 0x1001, /* Action dropping matched packet */
.in -8
};
.br
diff --git a/libibverbs/verbs.h b/libibverbs/verbs.h
index b27dfd1..4f0765e 100644
--- a/libibverbs/verbs.h
+++ b/libibverbs/verbs.h
@@ -1233,7 +1233,8 @@ enum ibv_flow_spec_type {
IBV_FLOW_SPEC_UDP = 0x41,
IBV_FLOW_SPEC_VXLAN_TUNNEL = 0x50,
IBV_FLOW_SPEC_INNER = 0x100,
- IBV_FLOW_SPEC_ACTION_TAG = 0x1000
+ IBV_FLOW_SPEC_ACTION_TAG = 0x1000,
+ IBV_FLOW_SPEC_ACTION_DROP = 0x1001,
};
struct ibv_flow_eth_filter {
@@ -1326,6 +1327,11 @@ struct ibv_flow_spec_action_tag {
uint32_t tag_id;
};
+struct ibv_flow_spec_action_drop {
+ enum ibv_flow_spec_type type;
+ uint16_t size;
+};
+
struct ibv_flow_spec {
union {
struct {
@@ -1339,6 +1345,7 @@ struct ibv_flow_spec {
struct ibv_flow_spec_ipv6 ipv6;
struct ibv_flow_spec_tunnel tunnel;
struct ibv_flow_spec_action_tag flow_tag;
+ struct ibv_flow_spec_action_drop drop;
};
};
--
1.8.3.1
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH rdma-core] verbs: Introduce flow steering drop action
[not found] ` <1496332034-14758-1-git-send-email-yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
@ 2017-06-09 21:20 ` Doug Ledford
0 siblings, 0 replies; 2+ messages in thread
From: Doug Ledford @ 2017-06-09 21:20 UTC (permalink / raw)
To: Yishai Hadas
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, slavash-VPRAkNaXOzVWk0Htik3J/w,
majd-VPRAkNaXOzVWk0Htik3J/w
On Thu, 2017-06-01 at 18:47 +0300, Yishai Hadas wrote:
> From: Slava Shwartsman <slavash-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
>
> This flow steering specification identifies a drop flow to the
> hardware.
>
> If user creates a flow only with the drop specification, then all the
> packets that hit this flow will be dropped, otherwise the hardware
> will
> drop only the packets that match the other L2/L3/L4 specifications.
>
> Signed-off-by: Slava Shwartsman <slavash-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> Reviewed-by: Maor Gottlieb <maorg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> Reviewed-by: Yishai Hadas <yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Thanks, applied.
--
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
GPG KeyID: B826A3330E572FDD
Key fingerprint = AE6B 1BDA 122B 23B4 265B 1274 B826 A333 0E57 2FDD
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-06-09 21:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-01 15:47 [PATCH rdma-core] verbs: Introduce flow steering drop action Yishai Hadas
[not found] ` <1496332034-14758-1-git-send-email-yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2017-06-09 21:20 ` Doug Ledford
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox