From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0065.outbound.protection.outlook.com [104.47.1.65]) by dpdk.org (Postfix) with ESMTP id 36E331B33B for ; Thu, 18 Jan 2018 21:52:16 +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=P6JjnvL5My80fxLOkdXs2730n7YPPYHuOG4CuQq51Ig=; b=ck9McJpYK1kHHS5gTPyfeEMxyn9VSvg9EdlrW1Eeu4uyiujYUxeGYOZj8ERqRJTUEhPy9bmN6Ske11+tjuxL/lqGIsNjLr4bFGSp62H1qRsHMk6SrGCaSVbKC4RzW/dYvJn4D9EsQglSq+qs61NItAvlMeWZnCgZkV3pfKZaydw= Received: from AM6PR0502MB3797.eurprd05.prod.outlook.com (52.133.21.26) by AM6PR0502MB3910.eurprd05.prod.outlook.com (52.133.21.159) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.428.17; Thu, 18 Jan 2018 20:52:13 +0000 Received: from AM6PR0502MB3797.eurprd05.prod.outlook.com ([fe80::6c28:c6b3:de94:a733]) by AM6PR0502MB3797.eurprd05.prod.outlook.com ([fe80::6c28:c6b3:de94:a733%13]) with mapi id 15.20.0428.014; Thu, 18 Jan 2018 20:52:13 +0000 From: Matan Azrad To: Thomas Monjalon CC: Gaetan Rivet , Jingjing Wu , "dev@dpdk.org" , Neil Horman , Bruce Richardson , Konstantin Ananyev Thread-Topic: [PATCH v3 4/7] ethdev: synchronize port allocation Thread-Index: AQHTkJ0fL1QkZ2259kiEr3+FegF+xKN6Gjew Date: Thu, 18 Jan 2018 20:52:13 +0000 Message-ID: References: <1515318351-4756-1-git-send-email-matan@mellanox.com> <1516293317-30748-1-git-send-email-matan@mellanox.com> <1516293317-30748-5-git-send-email-matan@mellanox.com> <1777810.s1WQivID2Y@xps> In-Reply-To: <1777810.s1WQivID2Y@xps> 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: [85.64.136.190] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM6PR0502MB3910; 6:LKhpg+jyrVHWQ73xpkFeEq58NL1d7j+kV9t8320pJnHlKN1wDuuLUYjMJEOH5fX1L7capFZrh0FC2G+lNT2ajiUGGR+8tM0a1OaTLqo7BoQPeTSTGoVZnUtZXCnzjmiAkIXh3ysUXruhT+8jPOEdFOtyOt+ElJHFQySQDdMTwjgHZmRPg0EqNTaCyBweHotiB/8BdjMxHFeyIg8M3BmDlnUtzyDp1BtzTysZLi0vnF6wK7Z0AncQkP+/NAGu2cqc3oA0mCrUuOxj5DSDhxXm19Vg5aD8WXlgEJnjMAOZ49wV0cIhBfWXn/Ag7U35cxERqOxHCI+UQGaXADTxiFdg15c3w8dQJ8tXPLvxld4vKhfHpB5ZbcQtHy+84N3wh5jc; 5:Q0eQUJLhkshhUoZMVY6NeyKzTf7Be6hdv4W/XCliQ0ngfvBcnLj3hW1T1+OyBPCliEYXAIUhdXsHyMNHJFDJG5hP1DaA54jvFaEFbnjNV/JvurUw48z9LNrS3DouK9hzHbu/GsWEjkX4ARqqYQtOBFg+MAEbIGQPedGEMBso/js=; 24:J/6PTWTkrq//uxQFBU+nMGqRLZ5m7oMchaal2k9uHuiJm7iM6ZqiBOtJIDkgKDQTTw7ROS/fu9Jd/IrMELUfDnxdMmS2tOcrPanLrvWnPYY=; 7:MFVOysYgurbZz/+1Zpd2T/uDXxUVL9xplVrpwL8FR4tgHrFYNB5EylqqxfXEDZ7klnAO5wMlgyC4zyMpIuHpswk/ppBYd4dxILwHixXJCZnZF7zKt4SxFiPsmIy+fd/mGSg2Z/xJGXXJxg8159haOKOJeUMlerLCpbrJ/PWcn2OhJXx4beNn73dDgYVWJhg8j1K9Yk+qP8C50NC3/odK4Nu4yMBR3aWuoe+k9kxV+X0jI7hRhs4szaNq4OvJww2b x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: 55a37084-fe33-4bf2-6bac-08d55eb55a29 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(3008032)(48565401081)(2017052603307)(7153060)(7193020); SRVR:AM6PR0502MB3910; x-ms-traffictypediagnostic: AM6PR0502MB3910: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(5005006)(8121501046)(10201501046)(3231023)(2400067)(944501161)(3002001)(93006095)(93001095)(6055026)(6041268)(20161123564045)(20161123560045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011); SRVR:AM6PR0502MB3910; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:AM6PR0502MB3910; x-forefront-prvs: 05568D1FF7 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(39860400002)(366004)(39380400002)(396003)(346002)(199004)(189003)(55016002)(6436002)(3280700002)(86362001)(2900100001)(106356001)(8936002)(3660700001)(68736007)(2906002)(99286004)(5250100002)(229853002)(97736004)(54906003)(478600001)(316002)(14454004)(102836004)(6916009)(2950100002)(66066001)(6116002)(3846002)(76176011)(93886005)(6506007)(26005)(59450400001)(7696005)(33656002)(53936002)(4326008)(81156014)(6246003)(81166006)(7736002)(9686003)(8676002)(74316002)(305945005)(25786009)(105586002)(5660300001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR0502MB3910; H:AM6PR0502MB3797.eurprd05.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: PXKiWTW4qDXOWb8/ppk4DXQQKXJfdXlF/0iin5V7px7uhCX0JI8EkVOQoUxY6vxfi7IWAbFQYfVjcp9Srlb/Qg== 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: 55a37084-fe33-4bf2-6bac-08d55eb55a29 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Jan 2018 20:52:13.6767 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR0502MB3910 Subject: Re: [dpdk-dev] [PATCH v3 4/7] ethdev: synchronize port allocation 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: , X-List-Received-Date: Thu, 18 Jan 2018 20:52:16 -0000 From: Thomas Monjalon, Thursday, January 18, 2018 10:44 PM > 18/01/2018 17:35, Matan Azrad: > > rte_eth_dev_allocate(const char *name) { > > uint16_t port_id; > > - struct rte_eth_dev *eth_dev; > > + struct rte_eth_dev *eth_dev =3D NULL; > > + > > + /* Synchronize share data one time allocation between local > > + threads. */ >=20 > I don't understand the "one time" part of this comment. > Please could you try to rephrase it? >=20 One-time means this allocation will run only 1 time. After the first allocation the pointer is not null, so no calling anymore t= o this function. =20 > > + rte_spinlock_lock(&rte_eth_share_data_alloc); > > + if (rte_eth_dev_share_data =3D=3D NULL) > > + rte_eth_dev_share_data_alloc(); > > + rte_spinlock_unlock(&rte_eth_share_data_alloc); >=20 > I think the correct wording is "shared data", instead of "share data". Yes you right - will change it.