From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30074.outbound.protection.outlook.com [40.107.3.74]) by dpdk.org (Postfix) with ESMTP id 802B97CEA for ; Mon, 29 May 2017 15:35:59 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=hI3vxxL3eIydG2/A+zTsAfMTvWvKZBIJK+yhkCaSO+s=; b=yb+wXyVerFOmeRPfwVcMZTj2+1diK55Okunv1mMUgsKuAn4uSVv46C8I/0ABCS9ab3xB13OAwrKxUxND9F1CnUz50/xtCn+s39+pEnUagxOy5xqPBDDA5gIoDvaNnQDdiQ5gFweOMljYxwuXuAIM7Ycrjrj4B6EiUJLFJD+Uc5s= Received: from AM2PR05MB0689.eurprd05.prod.outlook.com (10.161.20.16) by AM2PR05MB0691.eurprd05.prod.outlook.com (10.161.20.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1124.9; Mon, 29 May 2017 13:35:58 +0000 Received: from AM2PR05MB0689.eurprd05.prod.outlook.com ([fe80::c1ef:796f:5681:cbdb]) by AM2PR05MB0689.eurprd05.prod.outlook.com ([fe80::c1ef:796f:5681:cbdb%14]) with mapi id 15.01.1124.016; Mon, 29 May 2017 13:35:58 +0000 From: Shachar Beiser To: =?iso-8859-1?Q?N=E9lio_Laranjeiro?= CC: "dev@dpdk.org" , Adrien Mazarguil Thread-Topic: [PATCH] net/mlx5: implement drop action in hardware classifier Thread-Index: AQHS136NymUCHVf8t0WaQCGvxkL2UaIJThMAgAH8EQCAAAS9UA== Date: Mon, 29 May 2017 13:35:57 +0000 Message-ID: References: <1495954160-983-1-git-send-email-shacharbe@mellanox.com> <1495954160-983-2-git-send-email-shacharbe@mellanox.com> <20170529130746.GB31330@autoinstall.dev.6wind.com> In-Reply-To: <20170529130746.GB31330@autoinstall.dev.6wind.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: 6wind.com; dkim=none (message not signed) header.d=none;6wind.com; dmarc=none action=none header.from=mellanox.com; x-originating-ip: [193.47.165.251] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM2PR05MB0691; 7:uUkmK7Sb40TF6SGZZTulfRcS22PakHd9y15SRDE2J50Dh1Ic233nR0Mc6VdEvwH1l4ufsOkWYbfJL4OQeyuVVrsQ1ETXuqMrzrJ1SaEZBNGbVZ3EvsLrlDsr1VmzJeoK0IG1jlDui8mH7/ZutN/w474BM9ZyT21tPdJBZEMStzq0r/FznIskHhRR2nGg2MpHMSU8J2izZY4AlIw/8+VlXA9kIYXKcpwC8Ds7tQrIrTUe1iQmfdmAc5QZYvTd9AfKZKZfHsBf8HrsNplB2q+iD0fABxF9Bg5CYdRX0DgWWL3N9oAgaXjw49RwA2J0DNzgzdvLShQqV3AXJrTpoyPttQ== x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-ms-traffictypediagnostic: AM2PR05MB0691: x-ms-office365-filtering-correlation-id: c0bfaebd-6287-48be-b17b-08d4a697a38f x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254075)(48565401081)(201703131423075)(201703031133081); SRVR:AM2PR05MB0691; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(93006095)(93001095)(6055026)(6041248)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123555025)(20161123562025)(20161123564025)(6072148); SRVR:AM2PR05MB0691; BCL:0; PCL:0; RULEID:; SRVR:AM2PR05MB0691; x-forefront-prvs: 0322B4EDE1 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(39850400002)(39400400002)(39410400002)(39840400002)(39450400003)(39860400002)(377454003)(24454002)(13464003)(5660300001)(3660700001)(2950100002)(3280700002)(86362001)(6916009)(76176999)(50986999)(229853002)(8936002)(66066001)(4326008)(2900100001)(81166006)(53546009)(25786009)(189998001)(8676002)(54356999)(3846002)(102836003)(6116002)(33656002)(7736002)(74316002)(2906002)(7696004)(110136004)(55016002)(5250100002)(6506006)(54906002)(9686003)(478600001)(53936002)(99286003)(6246003)(38730400002)(14454004)(6436002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM2PR05MB0691; H:AM2PR05MB0689.eurprd05.prod.outlook.com; FPR:; SPF:None; MLV:sfv; LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-originalarrivaltime: 29 May 2017 13:35:57.7802 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM2PR05MB0691 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: Mon, 29 May 2017 13:35:59 -0000 The current firmware version does not implement queue tail drop therefore q= ueue allocation is not required by firmware. Unfortunately, the ibverbs API= s requires to allocate WQ & CQ .In the future this allocation will be save= d . Right now, you are right.=20 -----Original Message----- From: N=E9lio Laranjeiro [mailto:nelio.laranjeiro@6wind.com]=20 Sent: Monday, May 29, 2017 4:08 PM To: Shachar Beiser Cc: dev@dpdk.org; Adrien Mazarguil Subject: Re: [PATCH] net/mlx5: implement drop action in hardware classifier 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. >=20 > Signed-off-by: Shachar Beiser > --- > drivers/net/mlx5/Makefile | 5 +++++ > drivers/net/mlx5/mlx5_flow.c | 43 ++++++++++++++++++++++++++++++++++++++= +++++ > 2 files changed, 48 insertions(+) >=20 > 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; > =20 > +#ifdef HAVE_VERBS_IBV_EXP_FLOW_SPEC_ACTION_DROP > + struct ibv_exp_flow_spec_action_drop *drop; > + unsigned int size =3D sizeof(struct ibv_exp_flow_spec_action_drop); > +#endif Extra empty line before the #ifdef > + > assert(priv->pd); > assert(priv->ctx); > rte_flow =3D rte_calloc(__func__, 1, sizeof(*rte_flow), 0); > @@ -1007,6 +1012,15 @@ struct mlx5_flow_action { > rte_flow->qp =3D priv->flow_drop_queue->qp; > if (!priv->started) > return rte_flow; > +#ifdef HAVE_VERBS_IBV_EXP_FLOW_SPEC_ACTION_DROP > + drop =3D (void *)((uintptr_t)flow->ibv_attr + flow->offset); > + *drop =3D (struct ibv_exp_flow_spec_action_drop){ > + .type =3D IBV_EXP_FLOW_SPEC_ACTION_DROP, > + .size =3D size, > + }; > + ++flow->ibv_attr->num_of_specs; > + flow->offset +=3D sizeof(struct ibv_exp_flow_spec_action_drop); > +#endif > rte_flow->ibv_flow =3D 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, --=20 N=E9lio Laranjeiro 6WIND