From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30063.outbound.protection.outlook.com [40.107.3.63]) by dpdk.org (Postfix) with ESMTP id C0DB01B30C for ; Sun, 11 Feb 2018 07:40:28 +0100 (CET) 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=zSKysm6b9JpcSgO9HjiQ2j7bVXJPVhhg9K7su8PrjM4=; b=K8G18eL/SrZKvyOCSuznvonm3NHgCSApiUMwT0NZHgUueEbIQ6qpbl6bx8HJYEyjArCEdmHgpgi5btrVCO5ZsNfMUSYnRg4rhnBsrqNQrI+s7ANwgIdFTuaTgW4QIruSjUzRfl8m7KWrelaP+gLjpldpERgTiKCwC8cezjnaSs0= Received: from AM4PR0501MB2657.eurprd05.prod.outlook.com (10.172.215.19) by AM4PR0501MB2228.eurprd05.prod.outlook.com (10.165.82.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.485.10; Sun, 11 Feb 2018 06:40:27 +0000 Received: from AM4PR0501MB2657.eurprd05.prod.outlook.com ([fe80::80c6:df5:b1b0:ff05]) by AM4PR0501MB2657.eurprd05.prod.outlook.com ([fe80::80c6:df5:b1b0:ff05%17]) with mapi id 15.20.0485.013; Sun, 11 Feb 2018 06:40:27 +0000 From: Matan Azrad To: Yuanhan Liu CC: Konstantin Ananyev , Thomas Monjalon , dpdk stable Thread-Topic: [dpdk-stable] patch 'ethdev: fix port id allocation' has been queued to LTS release 17.11.1 Thread-Index: AQHTm0H/4zZqgomB3kqFsCXV1kwtTaOejqGAgAA/N5A= Date: Sun, 11 Feb 2018 06:40:27 +0000 Message-ID: References: <1517478479-12417-1-git-send-email-yliu@fridaylinux.org> <1517478479-12417-40-git-send-email-yliu@fridaylinux.org> <20180211024653.GC23970@yliu-mob> In-Reply-To: <20180211024653.GC23970@yliu-mob> Accept-Language: en-US, he-IL Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=matan@mellanox.com; x-originating-ip: [193.47.165.251] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM4PR0501MB2228; 7:jDTVzVeLgjfqJ7vLI5a7RjxKeJmxGOwofRNOagthxvvOM2+yutDJle+BtWC7VCcJC9nZTDOQ4qxQn4fnB+76qcCefY3IAQOR1X/dVq9z7D4LNV2k5MPAzH3ujG5V+wlwool++oQnK6dy5I13UEe8EPwjS2jENnNokh9ZTLzPtDD+2SnjsSRuA0F1bmuCg0lEfe8P4hUDVFNLrxee1BGvKVy3Dwgqgi5383/H9OcB1aEl4sT+cAZSPvJmnhXbE9HA x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: d94a5a4c-38a9-4e3d-0152-08d5711a5682 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603307)(7153060)(7193020); SRVR:AM4PR0501MB2228; x-ms-traffictypediagnostic: AM4PR0501MB2228: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(189930954265078)(788757137089)(45079756050767)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(8121501046)(5005006)(93006095)(93001095)(3002001)(10201501046)(3231101)(944501161)(6055026)(6041288)(20161123562045)(20161123560045)(20161123558120)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:AM4PR0501MB2228; BCL:0; PCL:0; RULEID:; SRVR:AM4PR0501MB2228; x-forefront-prvs: 058043A388 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(366004)(376002)(396003)(39860400002)(39380400002)(189003)(199004)(28163001)(69234005)(105586002)(53936002)(6246003)(86362001)(575784001)(97736004)(54906003)(55016002)(4326008)(25786009)(106356001)(7696005)(99286004)(2950100002)(9686003)(6306002)(6436002)(6916009)(2900100001)(76176011)(5660300001)(5250100002)(81166006)(186003)(2906002)(6116002)(316002)(229853002)(66066001)(3846002)(53546011)(26005)(102836004)(6506007)(81156014)(59450400001)(8936002)(3280700002)(966005)(305945005)(8676002)(33656002)(3660700001)(14454004)(68736007)(478600001)(45080400002)(74316002)(7736002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR0501MB2228; H:AM4PR0501MB2657.eurprd05.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: 2XgeoGIP2CpWjHOg7NTdEFhvZ2TgKCcqJ+N3/xCbC91zMjeiGKYwC77X9gks7X44on18Q7r4c8RZizuNNbDxqg== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM 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: d94a5a4c-38a9-4e3d-0152-08d5711a5682 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Feb 2018 06:40:27.5523 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR0501MB2228 Subject: Re: [dpdk-stable] patch 'ethdev: fix port id allocation' has been queued to LTS release 17.11.1 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: , X-List-Received-Date: Sun, 11 Feb 2018 06:40:28 -0000 Ho Yuanhan From: Yuanhan Liu. Sent: Sunday, February 11, 2018 4:47 AM > On Thu, Feb 01, 2018 at 05:47:54PM +0800, Yuanhan Liu wrote: > > Hi, > > > > FYI, your patch has been queued to LTS release 17.11.1 > > > > Note it hasn't been pushed to > https://emea01.safelinks.protection.outlook.com/?url=3Dhttp%3A%2F%2Fdpd > k.org%2Fbrowse%2Fdpdk- > stable&data=3D02%7C01%7Cmatan%40mellanox.com%7C1d21efdca33143ad70f > 808d570f9b78f%7Ca652971c7d2e4d9ba6a4d149256f461b%7C0%7C0%7C63653 > 9140229336610&sdata=3D2Pgtg0sgIoqPmYRPirEjMi2dmJKVKyFljRZHGLIcz5M%3 > D&reserved=3D0 yet. > > It will be pushed if I get no objections before 02/03/18. So please > > shout if anyone has objections. >=20 > It introduced an crash at port allocation. > And I have now reverted it. Please do a backport if necessary. >=20 Please read the commit log and let me know if it necessary for this version= - some secondary scenarios may fail without this patch. Please send me the crash details, maybe it exposes new bugs in the stable b= ranch. > Thanks. >=20 > --yliu > > > > --- > > >From 67abe74f3c09e6f166902c9fc5f4d7f65f7b3007 Mon Sep 17 00:00:00 > > >2001 > > From: Matan Azrad > > Date: Mon, 22 Jan 2018 16:38:18 +0000 > > Subject: [PATCH] ethdev: fix port id allocation > > > > [ upstream commit 8ee892a2385c50427c03db5cef1789babceb5999 ] > > > > rte_eth_dev_find_free_port() found a free port by state checking. > > The state field are in local process memory, so other DPDK processes > > may get the same port ID because their local states may be different. > > > > Replace the state checking by the ethdev port name checking, so, if > > the name is an empty string the port ID will be detected as unused. > > > > Fixes: d948f596fee2 ("ethdev: fix port data mismatched in multiple > > process model") > > > > Suggested-by: Konstantin Ananyev > > Signed-off-by: Matan Azrad > > Acked-by: Thomas Monjalon > > Acked-by: Konstantin Ananyev > > --- > > lib/librte_ether/rte_ethdev.c | 6 +++++- > > 1 file changed, 5 insertions(+), 1 deletion(-) > > > > diff --git a/lib/librte_ether/rte_ethdev.c > > b/lib/librte_ether/rte_ethdev.c index 9dcb0d2..8ea85cd 100644 > > --- a/lib/librte_ether/rte_ethdev.c > > +++ b/lib/librte_ether/rte_ethdev.c > > @@ -192,8 +192,12 @@ rte_eth_dev_find_free_port(void) > > unsigned i; > > > > for (i =3D 0; i < RTE_MAX_ETHPORTS; i++) { > > - if (rte_eth_devices[i].state =3D=3D RTE_ETH_DEV_UNUSED) > > + /* Using shared name field to find a free port. */ > > + if (rte_eth_dev_data[i].name[0] =3D=3D '\0') { > > + RTE_ASSERT(rte_eth_devices[i].state =3D=3D > > + RTE_ETH_DEV_UNUSED); > > return i; > > + } > > } > > return RTE_MAX_ETHPORTS; > > } > > -- > > 2.7.4