From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f52.google.com (mail-wm0-f52.google.com [74.125.82.52]) by dpdk.org (Postfix) with ESMTP id 7144E99A8 for ; Fri, 26 May 2017 08:56:37 +0200 (CEST) Received: by mail-wm0-f52.google.com with SMTP id e127so9427184wmg.1 for ; Thu, 25 May 2017 23:56:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=vdSmNVfCU1tvzITEfLrk55pRvpWEEiGCOerD55/Vc9o=; b=ZQGszYU4PIoq74ESR0vv3x6z0HZF94MTgBw5VfI6cNWJa7uwRr8FFauJlu4eFAY0oU FabJDz+4GTjhaXxh6f1duSRUDoEjxeQ2vrtH3MBKylhV5XKvhaax3AN8E3T0gam+PvDH 5AWRYOjBUward86yi0Yy0PDUTqfKUIzbWiqJOOPfmuVDH+p21mJvKcZlnifoWPZ+ItX+ zuEAUd1JMtVdjWZx3W2NgyXdYha5u3d7yM2o2sMRNhoJbcvcsAnAeLsX0hvmftWddDpb ApRWGCwG863W6hgVpPD5A0KuX8QiYTwlCLuy10ArTkL1aHIvu/Q9y5FhaR0/6XAAvwjK JKUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=vdSmNVfCU1tvzITEfLrk55pRvpWEEiGCOerD55/Vc9o=; b=isGp1Qr/W5bZorDZGPICWB3Ib13GK4AhdmMp1QuftwSZcM+F1mWlqAX9RRttvYMmZ/ PHwkZMYrHbPy032rXH66Bn46Bq2lguN7R+SeaNjr3XV5P8Ih0d8Odbc2uXUSeAMVsIKy t6M9Svy/FGfQ/pAeMZUbXLNfcqLugcUxMRvc9u6Sy3pj9Yv0ZZy7A5WZE+cNx7WCgnKP fxbFFpvLnQbpRk0Ki5/LZ/Z1frY+67NrMAD0krYatVC3eZtCoNxKWUT6aFyTauCcIjkG 4efCd5vHOk9iT+gDpRQbW6pcsesqzabvqPty7nJ7iSfWvdu1X3duJMLEW6CH1PDvaH9m g5Iw== X-Gm-Message-State: AODbwcCtvcrfuEi5o9UFFN3NxX/UwFwzdv8Tum8TV4z9jgDeMxfOXWsI MWlWuPo5mEz0JNCJ X-Received: by 10.28.93.10 with SMTP id r10mr866549wmb.68.1495781797096; Thu, 25 May 2017 23:56:37 -0700 (PDT) Received: from autoinstall.dev.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id l1sm10925977wrl.15.2017.05.25.23.56.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 May 2017 23:56:36 -0700 (PDT) Date: Fri, 26 May 2017 08:56:31 +0200 From: =?iso-8859-1?Q?N=E9lio?= Laranjeiro To: Shachar Beiser Cc: adrien.mazarguil@6wind.com, dev@dpdk.org Message-ID: <20170526065631.GP31330@autoinstall.dev.6wind.com> References: <1495717559-13005-1-git-send-email-shacharbe@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1495717559-13005-1-git-send-email-shacharbe@mellanox.com> User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [dpdk-dev] [PATCH] net/mlx5: implement drop action in hardware classifier X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 May 2017 06:56:37 -0000 Shachar, Please see the few comments above, On Thu, May 25, 2017 at 01:05:58PM +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 > --- > drivers/net/mlx5/Makefile | 5 ++++ > drivers/net/mlx5/mlx5_flow.c | 56 ++++++++++++++++++++++++++++++++++++++++++++ > 2 files changed, 61 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..d132d85 100644 > --- a/drivers/net/mlx5/mlx5_flow.c > +++ b/drivers/net/mlx5/mlx5_flow.c > @@ -994,6 +994,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 Remove those extra lines, it does not respect the file coding style. > assert(priv->pd); > assert(priv->ctx); > rte_flow = rte_calloc(__func__, 1, sizeof(*rte_flow), 0); > @@ -1007,6 +1013,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) { > @@ -1370,8 +1385,10 @@ struct rte_flow * > priv_flow_create_drop_queue(struct priv *priv) > { > struct rte_flow_drop *fdq = NULL; > +#ifndef HAVE_VERBS_IBV_EXP_FLOW_SPEC_ACTION_DROP > unsigned int i; > > +#endif The empty line should be after the #endif not before. > assert(priv->pd); > assert(priv->ctx); > fdq = rte_calloc(__func__, 1, sizeof(*fdq), 0); > @@ -1387,6 +1404,7 @@ struct rte_flow * > WARN("cannot allocate CQ for drop queue"); > goto error; > } > +#ifndef HAVE_VERBS_IBV_EXP_FLOW_SPEC_ACTION_DROP > for (i = 0; i != MLX5_DROP_WQ_N; ++i) { > fdq->wqs[i] = ibv_exp_create_wq(priv->ctx, > &(struct ibv_exp_wq_init_attr){ > @@ -1412,6 +1430,31 @@ struct rte_flow * > WARN("cannot allocate indirection table for drop queue"); > goto error; > } > +#else > + fdq->wqs[0] = ibv_exp_create_wq(priv->ctx, > + &(struct ibv_exp_wq_init_attr){ > + .wq_type = IBV_EXP_WQT_RQ, > + .max_recv_wr = 1, > + .max_recv_sge = 1, > + .pd = priv->pd, > + .cq = fdq->cq, > + }); > + if (!fdq->wqs[0]) { > + WARN("cannot allocate WQ for drop queue"); > + goto error; > + } >>From here... > + fdq->ind_table = ibv_exp_create_rwq_ind_table(priv->ctx, > + &(struct ibv_exp_rwq_ind_table_init_attr){ > + .pd = priv->pd, > + .log_ind_tbl_size = 0, > + .ind_tbl = fdq->wqs, > + .comp_mask = 0, > + }); > + if (!fdq->ind_table) { > + WARN("cannot allocate indirection table for drop queue"); > + goto error; > + } > +#endif >[...] To this point, the code is copy/paste from the block above, it should not be present. Please keep the diff as small as possible. Thanks, -- Nélio Laranjeiro 6WIND