From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0077.outbound.protection.outlook.com [104.47.1.77]) by dpdk.org (Postfix) with ESMTP id C47961B32D for ; Sun, 11 Feb 2018 08:15:26 +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=qUBhmDEZRHmJR1gBELKhOKcD5GE+eI2f3wdKBiG3mh4=; b=EWuPcOGQOPNYzToci+ElrTm2JZC2npsc72+H36x4dw6DcpKcKBPXxpUz9t5JcbkGH0u3RozkP7BRywfwFx3mpR89sbSGzpsf1Jv218Bk28WqCGNFDglOg6oyD156uNoyjIOKKGeEbZUwOTEJvPTKq+pKYR5DFJ2UFZqd+brgvqA= Received: from AM4PR0501MB2657.eurprd05.prod.outlook.com (10.172.215.19) by AM4PR0501MB2644.eurprd05.prod.outlook.com (10.172.215.18) 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 07:15:25 +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 07:15:25 +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/N5CAAAXUAIAABPeQ Date: Sun, 11 Feb 2018 07:15:25 +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> <20180211065400.GK23970@yliu-mob> In-Reply-To: <20180211065400.GK23970@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; AM4PR0501MB2644; 7:XUCloaOI5n3Ur9Gon/F2SN6NxsYAtHL2tEKYXDLYK5QPsCTaPkgCiwH0hstpAghA0oIcERT2JYpNt9KHJRp8PcRkyn3bQfEGhq55T2cX2Vh1dmPFBEpr5UIKDQRn069BWWgU63yaw0U0ol/VjXOQV01SNb/kMa+VcX3BFD8fR/mzPmqq28c7Y0UHiDAYQvnxOPGL0I5/ucYSlDSyOxkzrS/G8Z3lBla4vBErLta0w5joJw/Mf2xcPpa4UewaoUSV x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: ff3c9290-9ddf-4c1b-8f29-08d5711f38ff x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(5600026)(4604075)(3008032)(2017052603307)(7153060)(7193020); SRVR:AM4PR0501MB2644; x-ms-traffictypediagnostic: AM4PR0501MB2644: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(60795455431006)(189930954265078)(788757137089)(45079756050767)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(5005006)(8121501046)(93006095)(93001095)(3002001)(10201501046)(3231101)(2400082)(944501161)(6055026)(6041288)(20161123560045)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(6072148)(201708071742011); SRVR:AM4PR0501MB2644; BCL:0; PCL:0; RULEID:; SRVR:AM4PR0501MB2644; x-forefront-prvs: 058043A388 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(39860400002)(39380400002)(376002)(396003)(366004)(189003)(199004)(28163001)(69234005)(966005)(478600001)(5660300001)(33656002)(45080400002)(55016002)(6436002)(6246003)(14454004)(105586002)(2906002)(186003)(53936002)(106356001)(6306002)(9686003)(93886005)(2900100001)(74316002)(6116002)(3846002)(59450400001)(86362001)(575784001)(8676002)(81156014)(66066001)(25786009)(81166006)(7696005)(8936002)(316002)(26005)(97736004)(4326008)(3280700002)(7736002)(6506007)(3660700001)(305945005)(229853002)(2950100002)(102836004)(68736007)(76176011)(54906003)(5250100002)(99286004)(6916009); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR0501MB2644; 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: /O3lbCGuZS5+JEuZWcdK6z4zzmM3Mv3Y7cvswX10Ch5Mp1X+LVAi88bWsj3Z6oBS6+qAvo8jupzduOGxKbASMw== 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: ff3c9290-9ddf-4c1b-8f29-08d5711f38ff X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Feb 2018 07:15:25.5584 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR0501MB2644 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 07:15:27 -0000 From: Yuanhan Liu, Sent: Sunday, February 11, 2018 8:54 AM > On Sun, Feb 11, 2018 at 06:40:27AM +0000, Matan Azrad wrote: > > 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%2Fdp > > > d > > > 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. > > > > > > It introduced an crash at port allocation. > > > And I have now reverted it. Please do a backport if necessary. > > > > > > > Please read the commit log and let me know if it necessary for this ver= sion - > some secondary scenarios may fail without this patch. > > Please send me the crash details, maybe it exposes new bugs in the stab= le > branch. >=20 > I didn't dig, the error happened at tring to access > rte_eth_dev_data[0].name. >=20 > if (rte_eth_dev_data[i].name[0] =3D=3D '\0') { >=20 > What I observed is "rte_eth_dev_data" is NULL, looks like it haven't been > initiated yet. > Yes, you right. 18.02 following patch (ethdev: add port ownership) took care of it. So, I can backport it easily... will do it soon.=20 =20 > --yliu > > > > > > > Thanks. > > > > > > --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 b= e > 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 unus= ed. > > > > > > > > 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