All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] implement drop action in hardware classifier
@ 2017-05-29 15:28 Shachar Beiser
  2017-05-29 15:28 ` [PATCH v2] net/mlx5: " Shachar Beiser
  0 siblings, 1 reply; 7+ messages in thread
From: Shachar Beiser @ 2017-05-29 15:28 UTC (permalink / raw)
  To: dev; +Cc: Adrien Mazarguil, Nelio Laranjeiro, Shachar Beiser

This revision change the define MLX5_DROP_WQ_N according to the 
OFED support . #ifdef HAVE_.... MLX5_DROP_WQ_N = 1 #else 
MLX5_DROP_WQ_N = 4

Shachar Beiser (1):
  net/mlx5: implement drop action in hardware classifier

 drivers/net/mlx5/Makefile    |  5 +++++
 drivers/net/mlx5/mlx5_flow.c | 19 +++++++++++++++++++
 2 files changed, 24 insertions(+)

-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v2] net/mlx5: implement drop action in hardware classifier
  2017-05-29 15:28 [PATCH v2] implement drop action in hardware classifier Shachar Beiser
@ 2017-05-29 15:28 ` Shachar Beiser
  2017-05-30  7:39   ` [PATCH v3]net/mlx5: " Shachar Beiser
  2017-06-04  5:25   ` Shachar Beiser
  0 siblings, 2 replies; 7+ messages in thread
From: Shachar Beiser @ 2017-05-29 15:28 UTC (permalink / raw)
  To: dev; +Cc: Adrien Mazarguil, Nelio Laranjeiro, Shachar Beiser

The current drop action is implemented as a queue tail drop,
requiring to instantiate multiple WQs to maintain high drop rate.
This commit, implements the drop action in hardware classifier.
This enables to reduce the amount of contexts needed for the drop,
without affecting the drop rate.

Signed-off-by: Shachar Beiser <shacharbe@mellanox.com>
---
 drivers/net/mlx5/Makefile    |  5 +++++
 drivers/net/mlx5/mlx5_flow.c | 19 +++++++++++++++++++
 2 files changed, 24 insertions(+)

diff --git a/drivers/net/mlx5/Makefile b/drivers/net/mlx5/Makefile
index c079959..daf8013 100644
--- a/drivers/net/mlx5/Makefile
+++ b/drivers/net/mlx5/Makefile
@@ -101,6 +101,11 @@ mlx5_autoconf.h.new: FORCE
 mlx5_autoconf.h.new: $(RTE_SDK)/buildtools/auto-config-h.sh
 	$Q $(RM) -f -- '$@'
 	$Q sh -- '$<' '$@' \
+		HAVE_VERBS_IBV_EXP_FLOW_SPEC_ACTION_DROP \
+		infiniband/verbs_exp.h \
+		enum IBV_EXP_FLOW_SPEC_ACTION_DROP \
+		$(AUTOCONF_OUTPUT)
+	$Q sh -- '$<' '$@' \
 		HAVE_VERBS_IBV_EXP_CQ_COMPRESSED_CQE \
 		infiniband/verbs_exp.h \
 		enum IBV_EXP_CQ_COMPRESSED_CQE \
diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index adcbe3f..15f7516 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -53,7 +53,11 @@
 #include "mlx5_prm.h"
 
 /* Number of Work Queue necessary for the DROP queue. */
+#ifndef HAVE_VERBS_IBV_EXP_FLOW_SPEC_ACTION_DROP
 #define MLX5_DROP_WQ_N 4
+#else
+#define MLX5_DROP_WQ_N 1
+#endif
 
 static int
 mlx5_flow_create_eth(const struct rte_flow_item *item,
@@ -994,6 +998,12 @@ struct mlx5_flow_action {
 {
 	struct rte_flow *rte_flow;
 
+#ifdef HAVE_VERBS_IBV_EXP_FLOW_SPEC_ACTION_DROP
+
+	struct ibv_exp_flow_spec_action_drop *drop;
+
+	unsigned int size = sizeof(struct ibv_exp_flow_spec_action_drop);
+#endif
 	assert(priv->pd);
 	assert(priv->ctx);
 	rte_flow = rte_calloc(__func__, 1, sizeof(*rte_flow), 0);
@@ -1007,6 +1017,15 @@ struct mlx5_flow_action {
 	rte_flow->qp = priv->flow_drop_queue->qp;
 	if (!priv->started)
 		return rte_flow;
+#ifdef HAVE_VERBS_IBV_EXP_FLOW_SPEC_ACTION_DROP
+	drop = (void *)((uintptr_t)flow->ibv_attr + flow->offset);
+	*drop = (struct ibv_exp_flow_spec_action_drop){
+			.type = IBV_EXP_FLOW_SPEC_ACTION_DROP,
+			.size = size,
+	};
+	++flow->ibv_attr->num_of_specs;
+	flow->offset += sizeof(struct ibv_exp_flow_spec_action_drop);
+#endif
 	rte_flow->ibv_flow = ibv_exp_create_flow(rte_flow->qp,
 						 rte_flow->ibv_attr);
 	if (!rte_flow->ibv_flow) {
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v3]net/mlx5: implement drop action in hardware classifier
  2017-05-29 15:28 ` [PATCH v2] net/mlx5: " Shachar Beiser
@ 2017-05-30  7:39   ` Shachar Beiser
  2017-06-04  5:25   ` Shachar Beiser
  1 sibling, 0 replies; 7+ messages in thread
From: Shachar Beiser @ 2017-05-30  7:39 UTC (permalink / raw)
  To: dev; +Cc: Adrien Mazarguil, Nelio Laranjeiro, Shachar Beiser

remove/add blank line according to convensions

Shachar Beiser (1):
  net/mlx5: implement drop action in hardware classifier

 drivers/net/mlx5/Makefile    |  5 +++++
 drivers/net/mlx5/mlx5_flow.c | 17 +++++++++++++++++
 2 files changed, 22 insertions(+)

-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v3]net/mlx5: implement drop action in hardware classifier
  2017-05-29 15:28 ` [PATCH v2] net/mlx5: " Shachar Beiser
  2017-05-30  7:39   ` [PATCH v3]net/mlx5: " Shachar Beiser
@ 2017-06-04  5:25   ` Shachar Beiser
  2017-06-04  5:25     ` [PATCH v3] net/mlx5: " Shachar Beiser
  2017-06-05  8:30     ` [PATCH v3]net/mlx5: " Nélio Laranjeiro
  1 sibling, 2 replies; 7+ messages in thread
From: Shachar Beiser @ 2017-06-04  5:25 UTC (permalink / raw)
  To: dev; +Cc: Adrien Mazarguil, Nelio Laranjeiro, Shachar Beiser

remove/add blank line according to convensions

Shachar Beiser (1):
  net/mlx5: implement drop action in hardware classifier

 drivers/net/mlx5/Makefile    |  5 +++++
 drivers/net/mlx5/mlx5_flow.c | 17 +++++++++++++++++
 2 files changed, 22 insertions(+)

-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v3] net/mlx5: implement drop action in hardware classifier
  2017-06-04  5:25   ` Shachar Beiser
@ 2017-06-04  5:25     ` Shachar Beiser
  2017-06-05  8:30     ` [PATCH v3]net/mlx5: " Nélio Laranjeiro
  1 sibling, 0 replies; 7+ messages in thread
From: Shachar Beiser @ 2017-06-04  5:25 UTC (permalink / raw)
  To: dev; +Cc: Adrien Mazarguil, Nelio Laranjeiro, Shachar Beiser

The current drop action is implemented as a queue tail drop,
requiring to instantiate multiple WQs to maintain high drop rate.
This commit, implements the drop action in hardware classifier.
This enables to reduce the amount of contexts needed for the drop,
without affecting the drop rate.

Signed-off-by: Shachar Beiser <shacharbe@mellanox.com>
---
 drivers/net/mlx5/Makefile    |  5 +++++
 drivers/net/mlx5/mlx5_flow.c | 17 +++++++++++++++++
 2 files changed, 22 insertions(+)

diff --git a/drivers/net/mlx5/Makefile b/drivers/net/mlx5/Makefile
index c079959..daf8013 100644
--- a/drivers/net/mlx5/Makefile
+++ b/drivers/net/mlx5/Makefile
@@ -101,6 +101,11 @@ mlx5_autoconf.h.new: FORCE
 mlx5_autoconf.h.new: $(RTE_SDK)/buildtools/auto-config-h.sh
 	$Q $(RM) -f -- '$@'
 	$Q sh -- '$<' '$@' \
+		HAVE_VERBS_IBV_EXP_FLOW_SPEC_ACTION_DROP \
+		infiniband/verbs_exp.h \
+		enum IBV_EXP_FLOW_SPEC_ACTION_DROP \
+		$(AUTOCONF_OUTPUT)
+	$Q sh -- '$<' '$@' \
 		HAVE_VERBS_IBV_EXP_CQ_COMPRESSED_CQE \
 		infiniband/verbs_exp.h \
 		enum IBV_EXP_CQ_COMPRESSED_CQE \
diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index adcbe3f..77a8c04 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -53,7 +53,11 @@
 #include "mlx5_prm.h"
 
 /* Number of Work Queue necessary for the DROP queue. */
+#ifndef HAVE_VERBS_IBV_EXP_FLOW_SPEC_ACTION_DROP
 #define MLX5_DROP_WQ_N 4
+#else
+#define MLX5_DROP_WQ_N 1
+#endif
 
 static int
 mlx5_flow_create_eth(const struct rte_flow_item *item,
@@ -993,6 +997,10 @@ struct mlx5_flow_action {
 				   struct rte_flow_error *error)
 {
 	struct rte_flow *rte_flow;
+#ifdef HAVE_VERBS_IBV_EXP_FLOW_SPEC_ACTION_DROP
+	struct ibv_exp_flow_spec_action_drop *drop;
+	unsigned int size = sizeof(struct ibv_exp_flow_spec_action_drop);
+#endif
 
 	assert(priv->pd);
 	assert(priv->ctx);
@@ -1007,6 +1015,15 @@ struct mlx5_flow_action {
 	rte_flow->qp = priv->flow_drop_queue->qp;
 	if (!priv->started)
 		return rte_flow;
+#ifdef HAVE_VERBS_IBV_EXP_FLOW_SPEC_ACTION_DROP
+	drop = (void *)((uintptr_t)flow->ibv_attr + flow->offset);
+	*drop = (struct ibv_exp_flow_spec_action_drop){
+			.type = IBV_EXP_FLOW_SPEC_ACTION_DROP,
+			.size = size,
+	};
+	++flow->ibv_attr->num_of_specs;
+	flow->offset += sizeof(struct ibv_exp_flow_spec_action_drop);
+#endif
 	rte_flow->ibv_flow = ibv_exp_create_flow(rte_flow->qp,
 						 rte_flow->ibv_attr);
 	if (!rte_flow->ibv_flow) {
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v3]net/mlx5: implement drop action in hardware classifier
  2017-06-04  5:25   ` Shachar Beiser
  2017-06-04  5:25     ` [PATCH v3] net/mlx5: " Shachar Beiser
@ 2017-06-05  8:30     ` Nélio Laranjeiro
  2017-06-15  9:52       ` Ferruh Yigit
  1 sibling, 1 reply; 7+ messages in thread
From: Nélio Laranjeiro @ 2017-06-05  8:30 UTC (permalink / raw)
  To: Shachar Beiser; +Cc: dev, Adrien Mazarguil

On Sun, Jun 04, 2017 at 05:25:20AM +0000, Shachar Beiser wrote:
> remove/add blank line according to convensions
> 
> Shachar Beiser (1):
>   net/mlx5: implement drop action in hardware classifier
> 
>  drivers/net/mlx5/Makefile    |  5 +++++
>  drivers/net/mlx5/mlx5_flow.c | 17 +++++++++++++++++
>  2 files changed, 22 insertions(+)
> 
> -- 
> 1.8.3.1

For the series:

Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>

-- 
Nélio Laranjeiro
6WIND

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v3]net/mlx5: implement drop action in hardware classifier
  2017-06-05  8:30     ` [PATCH v3]net/mlx5: " Nélio Laranjeiro
@ 2017-06-15  9:52       ` Ferruh Yigit
  0 siblings, 0 replies; 7+ messages in thread
From: Ferruh Yigit @ 2017-06-15  9:52 UTC (permalink / raw)
  To: Nélio Laranjeiro, Shachar Beiser; +Cc: dev, Adrien Mazarguil

On 6/5/2017 9:30 AM, Nélio Laranjeiro wrote:
> On Sun, Jun 04, 2017 at 05:25:20AM +0000, Shachar Beiser wrote:
>> remove/add blank line according to convensions
>>
>> Shachar Beiser (1):
>>   net/mlx5: implement drop action in hardware classifier
>>
>>  drivers/net/mlx5/Makefile    |  5 +++++
>>  drivers/net/mlx5/mlx5_flow.c | 17 +++++++++++++++++
>>  2 files changed, 22 insertions(+)
>>
>> -- 
>> 1.8.3.1
> 
> For the series:
> 
> Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>

Applied to dpdk-next-net/master, thanks.

(Shachar, welcome to the DPDK community)

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-06-15  9:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-29 15:28 [PATCH v2] implement drop action in hardware classifier Shachar Beiser
2017-05-29 15:28 ` [PATCH v2] net/mlx5: " Shachar Beiser
2017-05-30  7:39   ` [PATCH v3]net/mlx5: " Shachar Beiser
2017-06-04  5:25   ` Shachar Beiser
2017-06-04  5:25     ` [PATCH v3] net/mlx5: " Shachar Beiser
2017-06-05  8:30     ` [PATCH v3]net/mlx5: " Nélio Laranjeiro
2017-06-15  9:52       ` Ferruh Yigit

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.