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 0C286A00C3 for ; Thu, 14 May 2020 10:11:29 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CB7281D6B1; Thu, 14 May 2020 10:11:28 +0200 (CEST) Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80082.outbound.protection.outlook.com [40.107.8.82]) by dpdk.org (Postfix) with ESMTP id C75081BF7B; Thu, 14 May 2020 10:11:25 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JdHFLkjkVIFHHZrugl1/veoX6Sa+cet0yNzu/kYW6V1sTHM4L8XuIYGAfAkTeHKaF+P3Nrkriv1WrmzcTrw+EVRL9nttqTUFh1R84CcEk1gYz42ZFvUUejlswrfwvSi/dOnrlZVaZIzYAfAAapSRnqZlXawouYuVGuHtSljNZkamBJ4DI9mZKggMu8dig5tjPfVGsZZYjOTnrvHX+KtL2AlvAZqxjKpNRrqnooB/eIEpLeBR8jENwrvnf0j3y1u0LGrU0Xrv1/2DgdLDHU21bddcKjq5fzStKNM9Ho7BlW6uYLiv6cdBMeaZpfTQwqx/KSc7R/gYec6bK77mORd0qA== 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=Dz5XFbT0eOUf7183BJLIt2w/ZdO3aj+mrX53GF8NZl8=; b=PFLQybgSANbt8JSgAg5T55tpQSAtfW3slENCpHyHwo9cq0IyvkqVTY5/ypApC0FXANEGCXlHA9bD56n3RiyP2qllnn5sBoK8vEDsFVBZsRJcDvPTWBw627ZfRJPzqnQYnH/v7EOwZZNSQMcu4XniUEt9uj3UUmv2nPh22S5sYmEL3G2qUAt1eJ7lEYmrvVwfu7DHfVm0LjPAal1p+2zJbahqzyE+WYgwsS1RxrXN2vZPBMdiP0pt/1HsLzz3MJban8flScGgbNq9IAtX1x3tklFCxKJQopBH9VSBETz6uy+EKFVn4bGaIqecj05cZ2Lh+FRL2XAXzEPjhAGog13p4A== 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=Dz5XFbT0eOUf7183BJLIt2w/ZdO3aj+mrX53GF8NZl8=; b=lx4LweXOdLfnqNh8dpPUwipXEsYKHxR/3SITW31djedMN8vvL6BC5KHjxIniijwkhy87qI5eLwQ2datu6MQ8hMY8SNWrQJ86SV/vCZXSgw/2gQoE8vyrFcY59XzXnzYcHDi21V0yk/fpIDVT1ybyfWzlEgoDFOHua+6dc9K4bio= Received: from AM0PR05MB6707.eurprd05.prod.outlook.com (2603:10a6:20b:15b::17) by AM0PR05MB5986.eurprd05.prod.outlook.com (2603:10a6:208:125::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.34; Thu, 14 May 2020 08:11:24 +0000 Received: from AM0PR05MB6707.eurprd05.prod.outlook.com ([fe80::508:747b:cc12:5f6e]) by AM0PR05MB6707.eurprd05.prod.outlook.com ([fe80::508:747b:cc12:5f6e%5]) with mapi id 15.20.2979.033; Thu, 14 May 2020 08:11:24 +0000 From: Raslan Darawsheh To: Matan Azrad , "dev@dpdk.org" CC: Slava Ovsiienko , "stable@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] net/mlx5: fix counter container resize Thread-Index: AQHWKFw5mQhvcMnyJEKGLm8MYni13KinPa3A Date: Thu, 14 May 2020 08:11:24 +0000 Message-ID: References: <1589287933-91969-1-git-send-email-matan@mellanox.com> In-Reply-To: <1589287933-91969-1-git-send-email-matan@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: mellanox.com; dkim=none (message not signed) header.d=none;mellanox.com; dmarc=none action=none header.from=mellanox.com; x-originating-ip: [188.161.229.217] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: c884b8c8-aa3a-4833-a718-08d7f7de64f7 x-ms-traffictypediagnostic: AM0PR05MB5986:|AM0PR05MB5986: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7691; x-forefront-prvs: 040359335D x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: xPutdwOsGGCFZ3wAuhmW9JIzzEyOxbs8QnwZQn5tTIOcaiR32Nj2VGpaPv6CtkyoccjOZzRUionJGwBL/YUMbg8vJpN1ay7VMjwbBqv+/WIhZHz+OOaHmExN/yeQL9b+AhH/G5rQzvrRQrR0/c9vyHLkgzm6PafLE4QaXjXOSXmPcYG6J/CqLlWnSuXhBFhDZqfgmiw7T5O5wZY8r+gMBSqNHs7C28XPRcGog3V7q8j42GlexJZh0tIErXBduFz3IDegeVH3wFK8CcOdg4/PF6iJKLfAYpTYcKpSADlH65reVQKyXaqxwTV1dAxsMEv6GNKM3EcI9yklwpUkZyGYBxZsbuH0sZCU+sv0UEFUVXwJ0SPa+SMcCf+JLjp3nezmL/p77jKKEOa80QahyMrj7QKiuPYaRIFRdurq2YH3RIRM9GpgVTeyv3kQbQt/aJ69 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:(4636009)(366004)(346002)(376002)(396003)(39860400002)(136003)(66476007)(186003)(450100002)(33656002)(7696005)(52536014)(55016002)(26005)(8936002)(76116006)(316002)(6506007)(9686003)(71200400001)(53546011)(8676002)(66946007)(478600001)(86362001)(54906003)(64756008)(66446008)(2906002)(5660300002)(66556008)(4326008)(110136005); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: qF7jpKwDRXFpt8ow7fHCin+MWbBs/W1ASjB0Vzz8tcn7UHAcQlsSS4hqzZm11L7ZbDtH6nd6PgqlRehYQYgkFkbbp8pRLnyJJQ0ig3z45kFwfb7PoYo6VTTykmV2dFhmV5Yss88G5ZMNU+W7YDRsem8Rvt04C3kMGp0/fm4k9NXDT6LadvXI8ip3gUTD+6XrJmZazWJfrlp6l4ChrEn3bKUi/LzSlES9VmOYFeYvTx5h0x86UIPQAMDNZCh1uXP2yUYqf1hl1jiKe3IdN2bEWjyMP5PoQQFHsQZKEsUG4lyloGYvf4+QVyQ3ga3/QewSIDquv2qhxyFp3bI3Kx9eXPCm/ha5/jUuTtVEOZQkcxPH3X2C/c5mcNIxmD/hZP8aZtp5f6SnynTbv565TB6kAmR4qlO0/YU2ANsap2XBArAv04C4QkhWNqa7p6WeHK7URs7t3eTXsRYszst9/XOSs0w0ZFqkdZIawcNC4dDRLfCl7kD8IB8w+/E4H/lVOlA3 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: c884b8c8-aa3a-4833-a718-08d7f7de64f7 X-MS-Exchange-CrossTenant-originalarrivaltime: 14 May 2020 08:11:24.3941 (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: bK+bzxMbL6v3pFKaA1qGgXL4IRiqWn84xsruaPswEBFw9+nn5Eiw8pXzcobR8tAqFecOs/ew6y/b7BOWKP5gIw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB5986 Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH] net/mlx5: fix counter container resize X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, > -----Original Message----- > From: dev On Behalf Of Matan Azrad > Sent: Tuesday, May 12, 2020 3:52 PM > To: dev@dpdk.org > Cc: Slava Ovsiienko ; stable@dpdk.org > Subject: [dpdk-dev] [PATCH] net/mlx5: fix counter container resize >=20 > The design of counter container resize used double buffer algorithm in > order to synchronize between the query thread to the control thread. > When the control thread detected resize need, it created new bigger > buffer for the counter pools in a new container and change the container > index atomically. > In case the query thread had not detect the previous resize before a new > one need was detected by the control thread, the control thread returned > EAGAIN to the flow creation API used a COUNT action. >=20 > The rte_flow API doesn't allow unblocked commands and doesn't expect to > get EAGAIN error type. >=20 > So, when a lot of flows were created between 2 different periodic > queries, 2 different resizes might try to be created and caused EAGAIN > error. > This behavior may blame flow creations. >=20 > Change the synchronization way to use lock instead of double buffer > algorithm. >=20 > The critical section of this lock is very small, so flow insertion > rate should not be decreased. >=20 > Fixes: ebbac312e448 ("net/mlx5: resize a full counter container") > Cc: stable@dpdk.org >=20 > Signed-off-by: Matan Azrad > --- > drivers/net/mlx5/mlx5.c | 70 +++++++++++------------ > drivers/net/mlx5/mlx5.h | 23 +++++--- > drivers/net/mlx5/mlx5_flow.c | 37 ++++--------- > drivers/net/mlx5/mlx5_flow.h | 6 -- > drivers/net/mlx5/mlx5_flow_dv.c | 110 +++++++++++++++----------------= -- > ---- > drivers/net/mlx5/mlx5_flow_verbs.c | 6 +- > 6 files changed, 104 insertions(+), 148 deletions(-) >=20 Patch applied to next-net-mlx, Kindest regards, Raslan Darawsheh