From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id E945FA00E6 for ; Thu, 18 Apr 2019 20:14:11 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C7E161B49A; Thu, 18 Apr 2019 20:14:11 +0200 (CEST) Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70048.outbound.protection.outlook.com [40.107.7.48]) by dpdk.org (Postfix) with ESMTP id 23C621B14C for ; Thu, 18 Apr 2019 20:14:10 +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:X-MS-Exchange-SenderADCheck; bh=jvV6gr+1OPh1QVadFTezjd/K9JpL9KbnPPlMPxBmQio=; b=S8eP01zfG4PiNy3REC6Q+hZBlgDcsNk+f+WQHRTBTtyvVLxmBvCHEjwz6OA7CLV1elJ0XdkS6Gt94sKd3kVGRNPuSi97je8Gf12/ds0RPFsmUYVQZPs3zW/Onigt1inAxk6S4VEYE6xWnyy5pHXtNCU3InWPdiVbdSBh6F0je5c= Received: from AM6PR0502MB3797.eurprd05.prod.outlook.com (52.133.22.13) by AM6PR0502MB3703.eurprd05.prod.outlook.com (52.133.23.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1813.11; Thu, 18 Apr 2019 18:14:08 +0000 Received: from AM6PR0502MB3797.eurprd05.prod.outlook.com ([fe80::5db8:12bc:aff3:5048]) by AM6PR0502MB3797.eurprd05.prod.outlook.com ([fe80::5db8:12bc:aff3:5048%6]) with mapi id 15.20.1792.022; Thu, 18 Apr 2019 18:14:08 +0000 From: Shahaf Shuler To: Ori Kam , Yongseok Koh CC: Matan Azrad , Slava Ovsiienko , Moti Haimovsky , "dev@dpdk.org" Thread-Topic: [PATCH v3 9/9] net/mlx5: add drop action to Direct Verbs E-Switch Thread-Index: AQHU9engaW0SsXyT1E6AM1R95iMeDqZB7tUAgABKQWA= Date: Thu, 18 Apr 2019 18:14:08 +0000 Message-ID: References: <1555276357-4892-1-git-send-email-orika@mellanox.com> <1555593367-144772-1-git-send-email-orika@mellanox.com> <1555593367-144772-10-git-send-email-orika@mellanox.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=shahafs@mellanox.com; x-originating-ip: [31.154.10.105] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 802d00d7-5a88-487e-4502-08d6c429a670 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600141)(711020)(4605104)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7193020); SRVR:AM6PR0502MB3703; x-ms-traffictypediagnostic: AM6PR0502MB3703: x-ms-exchange-purlcount: 1 x-microsoft-antispam-prvs: x-forefront-prvs: 0011612A55 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(136003)(396003)(366004)(376002)(39860400002)(189003)(13464003)(199004)(229853002)(6436002)(55016002)(86362001)(26005)(6636002)(7696005)(8676002)(9686003)(2906002)(8936002)(81156014)(6306002)(33656002)(68736007)(81166006)(76176011)(186003)(53546011)(71200400001)(93886005)(71190400001)(66066001)(6506007)(102836004)(25786009)(316002)(446003)(99286004)(256004)(97736004)(54906003)(11346002)(53936002)(486006)(476003)(110136005)(74316002)(305945005)(7736002)(3846002)(14454004)(4326008)(5660300002)(478600001)(966005)(6246003)(6116002)(52536014); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR0502MB3703; H:AM6PR0502MB3797.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: Q3PgYbLb746Q6/1PHoJNdonWhe5jvRu0aB8YIbiGFI2GhdFu03kxSfYXlQeh0Yzlf+bMZloXZ8KC4xVMrg7Kx/60ggREcOChTmGqbVJol9qKYYnkLlI2oJXarJJBQbTTyerxBHB/GPWfxXVs4E738Dgqq4iQAOra36rqrWbbWfWweV/LLf+YictuMTWUuHW4wEhvbjlPA4szQtyDR+ZozFyFDBTu52hhnboqu+V42jNgiALu4B1f2JVq6EaQLj8vEic2OUvvTA1TGnPf+uJw9OoLEh2xvygnrp3OZ/wQokNPJYynR5QD5FGhQRv9NzPN7yLvL1Q97TLWyzsFchZw6f6rl8xDvyha5EQ3H429XGSAeqqVKRanIxEeMqEDJw5ZVFyqvBvAQWmVOlK+5bAh1Pru5wpCDe9Gol1RBAbKFTo= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 802d00d7-5a88-487e-4502-08d6c429a670 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Apr 2019 18:14:08.2761 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR0502MB3703 Subject: Re: [dpdk-dev] [PATCH v3 9/9] net/mlx5: add drop action to Direct Verbs E-Switch 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Message-ID: <20190418181408.Am3gMqup4sycXl82GkJ3PuYWNxmztBHOpk5Xr2IWxqo@z> Thursday, April 18, 2019 4:48 PM, Ori Kam: > Subject: RE: [PATCH v3 9/9] net/mlx5: add drop action to Direct Verbs E- > Switch >=20 > Hi Shahaf, >=20 > Can you please fix it when you take it? Yes took care. >=20 > Thanks, > Ori >=20 > > -----Original Message----- > > From: Yongseok Koh > > Sent: Thursday, April 18, 2019 4:23 PM > > To: Ori Kam > > Cc: Shahaf Shuler ; Matan Azrad > > ; Slava Ovsiienko ; > Moti > > Haimovsky ; dev@dpdk.org > > Subject: Re: [PATCH v3 9/9] net/mlx5: add drop action to Direct Verbs > > E-Switch > > > > > On Apr 18, 2019, at 6:16 AM, Ori Kam wrote: > > > > > > This commit adds support for drop action when creating E-Switch flow > > > using DV. > > > > > > Signed-off-by: Ori Kam > > > Acked-by: Yongseok Koh > > > --- > > > drivers/net/mlx5/mlx5.c | 9 +++++++++ > > > drivers/net/mlx5/mlx5.h | 1 + > > > drivers/net/mlx5/mlx5_flow_dv.c | 22 ++++++++++++++-------- > > > drivers/net/mlx5/mlx5_glue.c | 12 ++++++++++++ > > > drivers/net/mlx5/mlx5_glue.h | 1 + > > > 5 files changed, 37 insertions(+), 8 deletions(-) > > > > > > diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index > > > ff24e1d..65c69af 100644 > > > --- a/drivers/net/mlx5/mlx5.c > > > +++ b/drivers/net/mlx5/mlx5.c > > > @@ -357,6 +357,7 @@ struct mlx5_dev_spawn_data { > > > goto error; > > > } > > > sh->fdb_ns =3D ns; > > > + sh->esw_drop_action =3D mlx5_glue- > > >dr_create_flow_action_drop(); > > > } > > > #endif > > > sh->dv_refcnt++; > > > @@ -377,6 +378,10 @@ struct mlx5_dev_spawn_data { > > > mlx5_glue->dr_destroy_ns(sh->fdb_ns); > > > sh->fdb_ns =3D NULL; > > > } > > > + if (sh->esw_drop_action) { > > > + mlx5_glue->destroy_flow_action(sh->esw_drop_action); > > > + sh->esw_drop_action =3D NULL; > > > + } > > > return err; > > > #else > > > (void)priv; > > > @@ -417,6 +422,10 @@ struct mlx5_dev_spawn_data { > > > mlx5_glue->dr_destroy_ns(sh->fdb_ns); > > > sh->fdb_ns =3D NULL; > > > } > > > + if (sh->esw_drop_action) { > > > + mlx5_glue->destroy_flow_action(sh->esw_drop_action); > > > + sh->esw_drop_action =3D NULL; > > > + } > > > #endif > > > pthread_mutex_destroy(&sh->dv_mutex); > > > #else > > > diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h index > > > 907d5c3..443625e 100644 > > > --- a/drivers/net/mlx5/mlx5.h > > > +++ b/drivers/net/mlx5/mlx5.h > > > @@ -276,6 +276,7 @@ struct mlx5_ibv_shared { > > > /* RX Direct Rules tables. */ > > > void *tx_ns; /* TX Direct Rules name space handle. */ > > > struct mlx5_flow_tbl_resource tx_tbl[MLX5_MAX_TABLES]; > > > + void *esw_drop_action; /* Pointer to DR E-Switch drop action. */ > > > /* TX Direct Rules tables/ */ > > > LIST_HEAD(matchers, mlx5_flow_dv_matcher) matchers; > > > LIST_HEAD(encap_decap, mlx5_flow_dv_encap_decap_resource) > > encaps_decaps; > > > diff --git a/drivers/net/mlx5/mlx5_flow_dv.c > > b/drivers/net/mlx5/mlx5_flow_dv.c > > > index 5997182..4352d48 100644 > > > --- a/drivers/net/mlx5/mlx5_flow_dv.c > > > +++ b/drivers/net/mlx5/mlx5_flow_dv.c > > > @@ -4049,6 +4049,7 @@ struct field_modify_info modify_tcp[] =3D { { > > > struct mlx5_flow_dv *dv; > > > struct mlx5_flow *dev_flow; > > > + struct mlx5_priv *priv =3D dev->data->dev_private; > > > int n; > > > int err; > > > > > > @@ -4056,15 +4057,20 @@ struct field_modify_info modify_tcp[] =3D { > > > dv =3D &dev_flow->dv; > > > n =3D dv->actions_n; > > > if (flow->actions & MLX5_FLOW_ACTION_DROP) { > > > - dv->hrxq =3D mlx5_hrxq_drop_new(dev); > > > - if (!dv->hrxq) { > > > - rte_flow_error_set > > > - (error, errno, > > > - > > RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL, > > > - "cannot get drop hash queue"); > > > - goto error; > > > + if (flow->transfer) > > > + dv->actions[n++] =3D priv->sh- > >esw_drop_action; > > > + else { > > > > Please fix the coding style issue. > > http://mails.dpdk.org/archives/test-report/2019-April/080992.html > > > > > + dv->hrxq =3D mlx5_hrxq_drop_new(dev); > > > + if (!dv->hrxq) { > > > + rte_flow_error_set > > > + (error, errno, > > > + > > RTE_FLOW_ERROR_TYPE_UNSPECIFIED, > > > + NULL, > > > + "cannot get drop hash > > queue"); > > > + goto error; > > > + } > > > + dv->actions[n++] =3D dv->hrxq->action; > > > } > > > - dv->actions[n++] =3D dv->hrxq->action; > > > } else if (flow->actions & > > > (MLX5_FLOW_ACTION_QUEUE | > > MLX5_FLOW_ACTION_RSS)) { > > > struct mlx5_hrxq *hrxq; > > > diff --git a/drivers/net/mlx5/mlx5_glue.c > > > b/drivers/net/mlx5/mlx5_glue.c index 117190f..b32cd09c 100644 > > > --- a/drivers/net/mlx5/mlx5_glue.c > > > +++ b/drivers/net/mlx5/mlx5_glue.c > > > @@ -394,6 +394,16 @@ > > > } > > > > > > static void * > > > +mlx5_glue_dr_create_flow_action_drop(void) > > > +{ > > > +#ifdef HAVE_MLX5DV_DR_ESWITCH > > > + return mlx5dv_dr_create_action_drop(); #else > > > + return NULL; > > > +#endif > > > +} > > > + > > > +static void * > > > mlx5_glue_dr_create_flow_tbl(void *ns, uint32_t level) { #ifdef > > > HAVE_MLX5DV_DR @@ -861,6 +871,8 @@ > > > mlx5_glue_dr_create_flow_action_dest_flow_tbl, > > > .dr_create_flow_action_dest_vport =3D > > > mlx5_glue_dr_create_flow_action_dest_vport, > > > + .dr_create_flow_action_drop =3D > > > + mlx5_glue_dr_create_flow_action_drop, > > > .dr_create_flow_tbl =3D mlx5_glue_dr_create_flow_tbl, > > > .dr_destroy_flow_tbl =3D mlx5_glue_dr_destroy_flow_tbl, > > > .dr_create_ns =3D mlx5_glue_dr_create_ns, diff --git > > > a/drivers/net/mlx5/mlx5_glue.h b/drivers/net/mlx5/mlx5_glue.h index > > > 26f5cb3..1d06583 100644 > > > --- a/drivers/net/mlx5/mlx5_glue.h > > > +++ b/drivers/net/mlx5/mlx5_glue.h > > > @@ -147,6 +147,7 @@ struct mlx5_glue { > > > struct ibv_cq *(*cq_ex_to_cq)(struct ibv_cq_ex *cq); > > > void *(*dr_create_flow_action_dest_flow_tbl)(void *tbl); > > > void *(*dr_create_flow_action_dest_vport)(void *ns, uint32_t > > > vport); > > > + void *(*dr_create_flow_action_drop)(); > > > void *(*dr_create_flow_tbl)(void *ns, uint32_t level); > > > int (*dr_destroy_flow_tbl)(void *tbl); > > > void *(*dr_create_ns)(struct ibv_context *ctx, > > > -- > > > 1.8.3.1 > > >