From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0044.outbound.protection.outlook.com [104.47.2.44]) by dpdk.org (Postfix) with ESMTP id E0D9229D2; Sun, 29 Apr 2018 07:51:04 +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=ICSsnsIqSyDn2lIF28eJwaWzJVJU8+tuLmgTEnc7S9Q=; b=MVeQOeuabNQqpmrFoEROEXckQMU1d8EZOm9bMhv2mwQOyJclh/1HwRafAT8OtCWadP764ewwtNca3yFJwW5s7QdrRY4jYwbMAi1vdNK/iTsJO0VCpAWVDYjFkuJhk0JV6ZS9+xQmsK9BlnOXzmgt1DET9ktf7AN38Lxg8Soi5Y0= Received: from DB7PR05MB4426.eurprd05.prod.outlook.com (52.134.109.15) by DB7PR05MB4314.eurprd05.prod.outlook.com (52.134.108.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.715.18; Sun, 29 Apr 2018 05:51:03 +0000 Received: from DB7PR05MB4426.eurprd05.prod.outlook.com ([fe80::f116:5be4:ba29:fed8]) by DB7PR05MB4426.eurprd05.prod.outlook.com ([fe80::f116:5be4:ba29:fed8%13]) with mapi id 15.20.0715.022; Sun, 29 Apr 2018 05:51:03 +0000 From: Shahaf Shuler To: =?iso-8859-1?Q?N=E9lio_Laranjeiro?= , "Adrien Mazarguil" CC: "dev@dpdk.org" , "stable@dpdk.org" Thread-Topic: [PATCH v1] net/mlx5: fix flow director rule deletion crash Thread-Index: AQHT3Xon4BdAZoDda0yoocVUfynCqaQULmQAgAMSrAA= Date: Sun, 29 Apr 2018 05:51:03 +0000 Message-ID: References: <20180426161641.5788-1-adrien.mazarguil@6wind.com> <20180427065506.hl4bfncfyw4nyd23@laranjeiro-vm.dev.6wind.com> In-Reply-To: <20180427065506.hl4bfncfyw4nyd23@laranjeiro-vm.dev.6wind.com> 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.107] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB7PR05MB4314; 7:FyZ+4nq0CKBtn2SxHaxJYOhiBwZ/MHYQ6zJ1BymTiRfLjyE1Cm4fWU9/kdjf3Hwe1y4Dve1sIHnGn9nnuU6JlxpUiFdb7GBGVMU3G+ETvykkIELUTXqITLBLwaK7cffAJftIyKsDMMSx2xvL/QkzYaLxjXdRW1M6q5EClRnZ4b4n3b7nr2jnAH9vV+AbYuIO9k+tecFLQEnFmu707l1nnAGDff8CP8NxewRFVBNVWY75+mrI7SYwxoA7W+bdNdKd x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:DB7PR05MB4314; x-ms-traffictypediagnostic: DB7PR05MB4314: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(3231254)(944501410)(52105095)(3002001)(10201501046)(6055026)(6041310)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123560045)(6072148)(201708071742011); SRVR:DB7PR05MB4314; BCL:0; PCL:0; RULEID:; SRVR:DB7PR05MB4314; x-forefront-prvs: 0657D528EC x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39380400002)(376002)(39860400002)(346002)(396003)(366004)(189003)(199004)(316002)(6506007)(59450400001)(476003)(446003)(3280700002)(3660700001)(86362001)(7696005)(99286004)(486006)(5250100002)(76176011)(2900100001)(2906002)(229853002)(186003)(6436002)(54906003)(26005)(11346002)(5660300001)(102836004)(14454004)(110136005)(8936002)(74316002)(55016002)(7736002)(66066001)(33656002)(305945005)(68736007)(4326008)(3846002)(6116002)(97736004)(478600001)(8676002)(81166006)(81156014)(53936002)(105586002)(9686003)(106356001)(25786009)(6246003); DIR:OUT; SFP:1101; SCL:1; SRVR:DB7PR05MB4314; H:DB7PR05MB4426.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-microsoft-antispam-message-info: iyVudbQYbS0GpDh0DFlHA3JKwpEhJK2HCIKVbDMcGn4snXLPLls0TWg2nwF4xz4B+K9hD/0X8fvzMPnxt3lIjnhHWMEWiTSwCqXjPf9McImBIQfC8q7jcIEV5QTYeOCO8bmw4E9b0Aph/iLPP7PF40kIimJ2rVugQSEEbOH1rIDRevOF1lH8Bn7CUXp6UV3y spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: f445a7be-a717-4443-b24f-08d5ad953185 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: f445a7be-a717-4443-b24f-08d5ad953185 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Apr 2018 05:51:03.5058 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR05MB4314 Subject: Re: [dpdk-dev] [PATCH v1] net/mlx5: fix flow director rule deletion crash 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: Sun, 29 Apr 2018 05:51:05 -0000 Friday, April 27, 2018 9:55 AM, N=E9lio Laranjeiro: > Subject: Re: [PATCH v1] net/mlx5: fix flow director rule deletion crash >=20 > On Thu, Apr 26, 2018 at 06:17:46PM +0200, Adrien Mazarguil wrote: > > Flow director rules matching traffic properties above layer 2 do not > > target a fixed hash Rx queue (HASH_RXQ_ETH), it actually depends on > > the highest protocol layer specified by each flow rule. > > > > mlx5_fdir_filter_delete() makes this wrong assumption and causes a > > crash when attempting to destroy flow rules with L3/L4 specifications. > > > > Fixes: 4c3e9bcdd52e ("net/mlx5: support flow director") > > Cc: Nelio Laranjeiro > > Cc: stable@dpdk.org > > > > Signed-off-by: Adrien Mazarguil >=20 > Acked-by: Nelio Laranjeiro >=20 > > --- > > drivers/net/mlx5/mlx5_flow.c | 10 +++++----- > > 1 file changed, 5 insertions(+), 5 deletions(-) > > > > diff --git a/drivers/net/mlx5/mlx5_flow.c > > b/drivers/net/mlx5/mlx5_flow.c index 8f5fcf4d6..05def2b14 100644 > > --- a/drivers/net/mlx5/mlx5_flow.c > > +++ b/drivers/net/mlx5/mlx5_flow.c > > @@ -3409,13 +3409,13 @@ mlx5_fdir_filter_delete(struct rte_eth_dev > *dev, > > if (parser.drop) { > > struct ibv_flow_spec_action_drop *drop; > > > > - drop =3D (void > *)((uintptr_t)parser.queue[HASH_RXQ_ETH].ibv_attr + > > - parser.queue[HASH_RXQ_ETH].offset); > > + drop =3D (void > *)((uintptr_t)parser.queue[parser.layer].ibv_attr + > > + parser.queue[parser.layer].offset); > > *drop =3D (struct ibv_flow_spec_action_drop){ > > .type =3D IBV_FLOW_SPEC_ACTION_DROP, > > .size =3D sizeof(struct ibv_flow_spec_action_drop), > > }; > > - parser.queue[HASH_RXQ_ETH].ibv_attr->num_of_specs++; > > + parser.queue[parser.layer].ibv_attr->num_of_specs++; > > } > > TAILQ_FOREACH(flow, &priv->flows, next) { > > struct ibv_flow_attr *attr; > > @@ -3426,8 +3426,8 @@ mlx5_fdir_filter_delete(struct rte_eth_dev *dev, > > void *flow_spec; > > unsigned int specs_n; > > > > - attr =3D parser.queue[HASH_RXQ_ETH].ibv_attr; > > - flow_attr =3D flow->frxq[HASH_RXQ_ETH].ibv_attr; > > + attr =3D parser.queue[parser.layer].ibv_attr; > > + flow_attr =3D flow->frxq[parser.layer].ibv_attr; > > /* Compare first the attributes. */ > > if (memcmp(attr, flow_attr, sizeof(struct ibv_flow_attr))) > > continue; > > -- > > 2.11.0 Applied to next-net-mlx, thanks.=20 >=20 > -- > N=E9lio Laranjeiro > 6WIND