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 A15C1A0588; Tue, 21 Apr 2020 10:43:50 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6C49A1C235; Tue, 21 Apr 2020 10:43:49 +0200 (CEST) Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50068.outbound.protection.outlook.com [40.107.5.68]) by dpdk.org (Postfix) with ESMTP id 73FF81C219 for ; Tue, 21 Apr 2020 10:43:48 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FD7Yxi5vESRzlfiIFpX5j5pwlTjQHyTfSojtk7jca3NLq7EKZSjOdsmEXr8GmFFoG8773ANJst723sp5xJPxZckbduqu8rm+aoObdSsbrQ5twb6Jkw/0fAdiViLIi5KUpNwkDUMUCugEFmY6kWx8+fJQL5rBPIQbaHUm8VCurpuKKErj+qEhUN+YNZmzDpYL19eVdZ4IAquqdvoOh+SVpqKIitNGRXBqQJd09S7SzFqZyRGmWl6rdoJXwecbKptkfdv3i8faGjlBQ4k/GA93b85kSgyVJ5CSwhQrgtAc0vJlu1yGVl0C+Lv+/5HF4d5USUCgo8Wk+jWimsHku0SWmw== 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=pXpbiTjk05hETlm0UlHMcJb++raDfH9eKYlL7Rki2BY=; b=CaC1nkVr+9jfWynfUy3V0WN9qKNH5o28sKZtwC3eiyxk/3D4tp4Xp4rtuvq2le0Mc1/cvwly9It6sRqkFJouCwQyMg6zzsKnGnVa8xLd8cK737vu4KjAmx4uxFAQLxNgHeAj8Xc402UIPPGgrL9rFLQVLCnoJzYf+w/HYu+O+C/aRSKJA3yt8eAIv8a6/CwuuznPz80qjHINtmwP6RGxhY0eNLS0J3wv7IwRoSPZXfp2xWzSOrNkKjMB7o3/76FsVyBIHOjgIozEoP0qsDvpmjM6tQkdmrIq/cJcM0Kr1Sysj7tl7b0rurp1zcL57fN1PbjK6v3z1TeTnKhaeriGiA== 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=pXpbiTjk05hETlm0UlHMcJb++raDfH9eKYlL7Rki2BY=; b=FGjYZELjC9jXc3f518mxPbfqrf/5meMZFkBe+eSklbNaKRmjfmBLPo7XmFUzgCJKTfOlSYP9FjpsQirtSpRaG9lojMTApCKdRp3NbnD664v/9tFa3CtlBzFdNM49ClswnuUchuvRINs9gb+VYcHruHqgbeQNfcng1P0fi0TemOY= Received: from AM0PR05MB6707.eurprd05.prod.outlook.com (2603:10a6:20b:15b::17) by AM0PR05MB4801.eurprd05.prod.outlook.com (2603:10a6:208:ce::21) 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 08:43:46 +0000 Received: from AM0PR05MB6707.eurprd05.prod.outlook.com ([fe80::508:747b:cc12:5f6e]) by AM0PR05MB6707.eurprd05.prod.outlook.com ([fe80::508:747b:cc12:5f6e%6]) with mapi id 15.20.2921.030; Tue, 21 Apr 2020 08:43:46 +0000 From: Raslan Darawsheh To: Suanming Mou , Slava Ovsiienko , Matan Azrad CC: "dev@dpdk.org" Thread-Topic: [PATCH] net/mlx5: fix RSS description corrupt issue Thread-Index: AQHWFriwPjysWPr2TEyWC4/emxd45qiDRF5g Date: Tue, 21 Apr 2020 08:43:46 +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=rasland@mellanox.com; x-originating-ip: [188.161.228.234] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 6c918cb2-abd5-4e18-8df8-08d7e5d01b43 x-ms-traffictypediagnostic: AM0PR05MB4801:|AM0PR05MB4801: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:262; x-forefront-prvs: 038002787A x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR05MB6707.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(4636009)(39860400002)(366004)(376002)(136003)(346002)(396003)(66446008)(64756008)(66476007)(66946007)(52536014)(4326008)(66556008)(76116006)(6636002)(478600001)(55016002)(33656002)(71200400001)(2906002)(9686003)(316002)(86362001)(110136005)(5660300002)(186003)(53546011)(26005)(8936002)(6506007)(7696005)(8676002)(81156014); 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: W8E3p93rwiwmX8VhkOE+d2igwdbzAUGQId1a5pbsmW4kwq//OpVcS5Q5SjXKAFl2h/EmZfjuo6FZRB7Iq4AXnE8K8McWRwnRKRHb1hoIs353ToFUwOF5XfV9rK336CQARG3bljm+ODACD56LOjzL6qOLw50jruyGDwE8CTNl/fuZUW7DAgR4n3gfounuPfcTYrm7pLTbMYs2zDwMJz6mkwc12tdh0lT2k5q0NByQSsnBH90m7A77+o+QYh4o2Stx8XuThI30sEYKmYduaFxW51Tj3VSGRaHKwRJRgNoxpUNv3x4/EETBAHRuyzGVI+Rv2vNZ6cfklki9GndRFRPGBJWwMD1bjsbtGm7L4wAavrzu4bD3+YFk8wZ7/KSgH9NrLxoWrZJGpys/aVao4SJ4W+weXhRDdeuYef6FAHUqElOoCY6N22oU53kaeSAdxRpV x-ms-exchange-antispam-messagedata: afmhOdZUc+C82kxoC/hnJaOWYGlSnniHO4HaAG7GB9I4i3X9ow73R/kOf8IyabICccrnn2lHepeoqkDfjHSc6D/CaE4rPHKXNNneTzMdhkXWrtnDO8psdWGY2F+jTUp7cxDysK31hWcqu2Q3Bc5TVQ== 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: 6c918cb2-abd5-4e18-8df8-08d7e5d01b43 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Apr 2020 08:43:46.8569 (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: gvZ5RBZ8x2pvjK3xx0vjKoqdxQp5QXOoffY4ok1ar1lmJ0mPiclEOMFE396jvmcPVeJK+TaSVUXPzYcigFFlXw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB4801 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" Hi, > -----Original Message----- > From: Suanming Mou > Sent: Monday, April 20, 2020 5:09 AM > 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 > dose not support the nest flow_list_create() routine. >=20 > In the case with mark reg copy, the flow_list_create() function will be > called 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 > --- > 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 Patch squashed into relevant commit from next-net-mlx, Kindest regards, Raslan Darawsheh