From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1C38EA0561; Tue, 21 Apr 2020 09:44:52 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EE6461D8F0; Tue, 21 Apr 2020 09:44:51 +0200 (CEST) Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80088.outbound.protection.outlook.com [40.107.8.88]) by dpdk.org (Postfix) with ESMTP id 7608F1D8DF for ; Tue, 21 Apr 2020 09:44:51 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=e1wbdsCAjDwM7OulAZnVhUBKuuyTpFH8RbTdDHeZWerVZ2dwuZpzMrN77Fv98yDLTVvmx1xXToX3Uou9RUpj80L+l7D8TtTFMSBOu/D9+m4HviqOag7eC7uf9g0Nwg8YXC+BsqB58pz7LsxQHZriuZUliicyENwQyIooufrXKmfMFJn0VPkFbT43LgQi0xzeTHTxjRltSF+03uSdeCM5kDYgnpQBiK90w3YH1MmTVfy/bm2o+VzJSDbMdLyqBlcSJMlwKIA1gLgG4YjoLqIFuQcc4vH08DZbXtswB0lib5+u4vvMKMy36JFXZQyANcFd58btPSgLo+Rsx695XTwIGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Y1miARF+zpQVTIpves2hOUVZ5Jg7NelBjv4uB2LVras=; b=X6Z8spmtvHfckppc6cnKGCXBU5Vnb476IsK2kiwnQ2IjCLhu+hCqley0PN6imqY6gqUKwFn5PmJbZSvq/MmrJPcxXzkp7MIZs+r8KgVdXjJ6O/zaxu5inm2UL4PRCiilYx+vPODhOhBcVYqlwWMddioYTZ7MbwSS08vRySRZlaBolQckSTnwcgxaGWp1RF76bwd4oOSDuNUJ3jm7mVs9GmxpWvNZ6ovE8SXT09e3edACTrGBSIaqgQpXHCKvwfOZZFuHmuhurYb2mQdGd4c1WTjSPO8Djqvffw2QTFprZjBM9vUMY9/ToUoosrz28vx3OivYEB8Fcx8eNWsoQA5ayQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none 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=Y1miARF+zpQVTIpves2hOUVZ5Jg7NelBjv4uB2LVras=; b=Mv9se/UmB3uEzO1DF12KeLQoRrIaJU/Hykro9mNK9Ce5ihoomD31fMPcPnQDpQ+ChTJOgn9o+rypUppGRTm8JRsgxOQ4Og3d/dAWKdmHzLMkusFDwQY2LMVZ0uALnFoYN3gfcGdspasbrj2AYirLVh3ctzAmPUXJTaNCnMUd08Y= Received: from AM4PR05MB3265.eurprd05.prod.outlook.com (2603:10a6:205:8::26) by AM4PR05MB3268.eurprd05.prod.outlook.com (2603:10a6:205:4::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2921.29; Tue, 21 Apr 2020 07:44:50 +0000 Received: from AM4PR05MB3265.eurprd05.prod.outlook.com ([fe80::bdf0:88a3:3a39:4be4]) by AM4PR05MB3265.eurprd05.prod.outlook.com ([fe80::bdf0:88a3:3a39:4be4%7]) with mapi id 15.20.2921.030; Tue, 21 Apr 2020 07:44:50 +0000 From: Slava Ovsiienko To: Suanming Mou , Matan Azrad CC: Raslan Darawsheh , "dev@dpdk.org" Thread-Topic: [PATCH] net/mlx5: fix RSS description corrupt issue Thread-Index: AQHWFriwHF0mLNcs3k+UpgtN1o3UmKiDM/2Q Date: Tue, 21 Apr 2020 07:44:50 +0000 Message-ID: References: <1587348545-57200-1-git-send-email-suanmingm@mellanox.com> In-Reply-To: <1587348545-57200-1-git-send-email-suanmingm@mellanox.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=viacheslavo@mellanox.com; x-originating-ip: [95.164.10.10] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 0a7505f2-6c4b-4f27-ffdc-08d7e5c7df30 x-ms-traffictypediagnostic: AM4PR05MB3268:|AM4PR05MB3268: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5516; x-forefront-prvs: 038002787A x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM4PR05MB3265.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(4636009)(396003)(346002)(39860400002)(136003)(376002)(366004)(8676002)(26005)(2906002)(186003)(53546011)(5660300002)(9686003)(55016002)(6506007)(4326008)(54906003)(64756008)(66556008)(66446008)(66946007)(66476007)(316002)(71200400001)(478600001)(86362001)(7696005)(110136005)(8936002)(76116006)(81156014)(6636002)(33656002)(52536014); DIR:OUT; SFP:1101; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: P21Ezkx/RrvrRpgTzpLC1ISmHiSd/95c0fCjXmdEaYQCZ7x8p8D9cTnUH8Cb0hCN+WWG3JRfcBVZTLjCNLg7D4qeyqTu2dAnOcQE+TEtxgutRdxyuSnpMYh9l47AtczjW/S6hN+YPz82Kko71eRCRnr/oVvpPaRY8R0eQx6kQNFt/VRmtLIP0kkO4lZ2uPyvR7kzxIvIs43WTYnVm3oeLmuG654AjLW9s+mHl2hGXosA8a5jEr4ry76GtLfc4m+M3tQthH/Mr2mg/BZW+WqU2XqKTQVK0PTpB4c4BzkQPq/kXITNSUJGtJKuiNmEON7cOZK0VQKcm8dxONF9DfNLc5PSpYGW7eYRll8VjYJKd76e33cleyeZS2ap/N1sH5p8jTClG2gzy5mledo+Cc5eOWoZ+Xarl7Bh+7IvBHJf2RNv0KzPFOCC0MLavwnWHYks x-ms-exchange-antispam-messagedata: GI16ne1fy23TMc70NxiFuVZ79dvt8O1bEcMgFzVwmqV0wf4juAp65n/A3b3dPB62G9VEeBP4hOoMw62p6aOceH5Dczaqm8Y0zz2zRKMgKwOqetkWZuMzNb7tqzelFvuoxMdoCuGNUN6HYFRBCZFCDQ== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0a7505f2-6c4b-4f27-ffdc-08d7e5c7df30 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Apr 2020 07:44:50.0798 (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-CrossTenant-userprincipalname: YOSRfgXARXVjk79sPp467Nvc8IeZdZ8e1PuiLN9FBYZKBU201ez1sCZWcbyOahzXSir+x3C8LkjEAbx/FTGCEslI6RatO+bqfMUO6mgIOCc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB3268 Subject: Re: [dpdk-dev] [PATCH] net/mlx5: fix RSS description corrupt issue 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" > -----Original Message----- > From: Suanming Mou > Sent: Monday, April 20, 2020 5:09 > To: Slava Ovsiienko ; Matan Azrad > > Cc: Raslan Darawsheh ; dev@dpdk.org > Subject: [PATCH] net/mlx5: fix RSS description corrupt issue >=20 > Currently, RSS description data is saved in the mlx5 private data. It dos= e not > support the nest flow_list_create() routine. >=20 > In the case with mark reg copy, the flow_list_create() function will be c= alled > nested. The RSS description data will be cleared in the nested case. >=20 > Allocate one more RSS description to avoid the nested case. >=20 > Fixes: bb7e7801704e ("net/mlx5: optimize mlx5 flow RSS struct") >=20 > Signed-off-by: Suanming Mou Acked-by: Viacheslav Ovsiienko > --- > drivers/net/mlx5/mlx5_flow.c | 10 ++++++---- > drivers/net/mlx5/mlx5_flow_dv.c | 8 +++++--- > drivers/net/mlx5/mlx5_flow_verbs.c | 8 +++++--- > 3 files changed, 16 insertions(+), 10 deletions(-) >=20 > diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c > index c529aa3..109d71e 100644 > --- a/drivers/net/mlx5/mlx5_flow.c > +++ b/drivers/net/mlx5/mlx5_flow.c > @@ -4266,7 +4266,8 @@ uint32_t mlx5_flow_adjust_priority(struct > rte_eth_dev *dev, int32_t priority, > uint8_t buffer[2048]; > } items_tx; > struct rte_flow_expand_rss *buf =3D &expand_buffer.buf; > - struct mlx5_flow_rss_desc *rss_desc =3D priv->rss_desc; > + struct mlx5_flow_rss_desc *rss_desc =3D &((struct mlx5_flow_rss_desc > *) > + priv->rss_desc)[!!priv->flow_idx]; > const struct rte_flow_action *p_actions_rx =3D actions; > uint32_t i; > uint32_t idx =3D 0; > @@ -4684,10 +4685,11 @@ struct rte_flow * > struct mlx5_priv *priv =3D dev->data->dev_private; >=20 > if (!priv->inter_flows) { > - priv->inter_flows =3D rte_calloc(__func__, > MLX5_NUM_MAX_DEV_FLOWS, > + priv->inter_flows =3D rte_calloc(__func__, 1, > + MLX5_NUM_MAX_DEV_FLOWS * > sizeof(struct mlx5_flow) + > - sizeof(struct mlx5_flow_rss_desc) + > - sizeof(uint16_t) * UINT16_MAX, 0); > + (sizeof(struct mlx5_flow_rss_desc) + > + sizeof(uint16_t) * UINT16_MAX) * 2, 0); > if (!priv->inter_flows) { > DRV_LOG(ERR, "can't allocate intermediate > memory."); > return; > diff --git a/drivers/net/mlx5/mlx5_flow_dv.c > b/drivers/net/mlx5/mlx5_flow_dv.c index cfc911c..fd8f936 100644 > --- a/drivers/net/mlx5/mlx5_flow_dv.c > +++ b/drivers/net/mlx5/mlx5_flow_dv.c > @@ -7377,8 +7377,9 @@ struct field_modify_info modify_tcp[] =3D { > struct mlx5_dev_config *dev_conf =3D &priv->config; > struct rte_flow *flow =3D dev_flow->flow; > struct mlx5_flow_handle *handle =3D dev_flow->handle; > - struct mlx5_flow_rss_desc *rss_desc =3D (struct mlx5_flow_rss_desc *) > - priv->rss_desc; > + struct mlx5_flow_rss_desc *rss_desc =3D &((struct mlx5_flow_rss_desc > *) > + priv->rss_desc) > + [!!priv->flow_nested_idx]; > uint64_t item_flags =3D 0; > uint64_t last_item =3D 0; > uint64_t action_flags =3D 0; > @@ -8148,7 +8149,8 @@ struct field_modify_info modify_tcp[] =3D { > struct mlx5_hrxq *hrxq; > uint32_t hrxq_idx; > struct mlx5_flow_rss_desc *rss_desc =3D > - (struct mlx5_flow_rss_desc *)priv->rss_desc; > + &((struct mlx5_flow_rss_desc *)priv- > >rss_desc) > + [!!priv->flow_nested_idx]; >=20 > MLX5_ASSERT(rss_desc->queue_num); > hrxq_idx =3D mlx5_hrxq_get(dev, rss_desc->key, diff -- > git a/drivers/net/mlx5/mlx5_flow_verbs.c > b/drivers/net/mlx5/mlx5_flow_verbs.c > index a246917..722220c 100644 > --- a/drivers/net/mlx5/mlx5_flow_verbs.c > +++ b/drivers/net/mlx5/mlx5_flow_verbs.c > @@ -1570,8 +1570,9 @@ > uint64_t priority =3D attr->priority; > uint32_t subpriority =3D 0; > struct mlx5_priv *priv =3D dev->data->dev_private; > - struct mlx5_flow_rss_desc *rss_desc =3D (struct mlx5_flow_rss_desc *) > - priv->rss_desc; > + struct mlx5_flow_rss_desc *rss_desc =3D &((struct mlx5_flow_rss_desc > *) > + priv->rss_desc) > + [!!priv->flow_nested_idx]; >=20 > if (priority =3D=3D MLX5_FLOW_PRIO_RSVD) > priority =3D priv->config.flow_prio - 1; @@ -1844,7 +1845,8 > @@ > } else { > uint32_t hrxq_idx; > struct mlx5_flow_rss_desc *rss_desc =3D > - (struct mlx5_flow_rss_desc *)priv->rss_desc; > + &((struct mlx5_flow_rss_desc *)priv- > >rss_desc) > + [!!priv->flow_nested_idx]; >=20 > MLX5_ASSERT(rss_desc->queue_num); > hrxq_idx =3D mlx5_hrxq_get(dev, rss_desc->key, > -- > 1.8.3.1