All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Nélio Laranjeiro" <nelio.laranjeiro@6wind.com>
To: Shachar Beiser <shacharbe@mellanox.com>
Cc: dev@dpdk.org, Adrien Mazarguil <adrien.mazarguil@6wind.com>
Subject: Re: [PATCH] net/mlx5: implement drop action in hardware classifier
Date: Mon, 29 May 2017 15:07:46 +0200	[thread overview]
Message-ID: <20170529130746.GB31330@autoinstall.dev.6wind.com> (raw)
In-Reply-To: <1495954160-983-2-git-send-email-shacharbe@mellanox.com>

On Sun, May 28, 2017 at 06:49:20AM +0000, Shachar Beiser wrote:
> 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 | 43 +++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 48 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..e243d39 100644
> --- a/drivers/net/mlx5/mlx5_flow.c
> +++ b/drivers/net/mlx5/mlx5_flow.c
> @@ -994,6 +994,11 @@ 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

Extra empty line before the #ifdef

> +
>  	assert(priv->pd);
>  	assert(priv->ctx);
>  	rte_flow = rte_calloc(__func__, 1, sizeof(*rte_flow), 0);
> @@ -1007,6 +1012,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) {
>[...]

>From what I see by just changing the value of MLX5_DROP_WQ_N when
HAVE_VERBS_IBV_EXP_FLOW_SPEC_ACTION_DROP (in the same source file)
limits the patch to this point.

Am I missing something?

Regards,

-- 
Nélio Laranjeiro
6WIND

  reply	other threads:[~2017-05-29 13:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-28  6:49 [PATCH] net/mlx5: implement drop action in hardware classifier Shachar Beiser
2017-05-28  6:49 ` Shachar Beiser
2017-05-29 13:07   ` Nélio Laranjeiro [this message]
2017-05-29 13:35     ` Shachar Beiser
2017-05-29 14:05       ` Nélio Laranjeiro
     [not found] <1495717559-13005-1-git-send-email-shacharbe@mellanox.com>
2017-05-26  6:56 ` Nélio Laranjeiro

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170529130746.GB31330@autoinstall.dev.6wind.com \
    --to=nelio.laranjeiro@6wind.com \
    --cc=adrien.mazarguil@6wind.com \
    --cc=dev@dpdk.org \
    --cc=shacharbe@mellanox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.