From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 62296A0544; Tue, 5 Jul 2022 21:50:33 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DBBDA40223; Tue, 5 Jul 2022 21:50:32 +0200 (CEST) Received: from na01-obe.outbound.protection.outlook.com (mail-centralusazon11021015.outbound.protection.outlook.com [52.101.62.15]) by mails.dpdk.org (Postfix) with ESMTP id E49C3400D7 for ; Tue, 5 Jul 2022 21:50:30 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=c1VK01rug1ZjqspDmGo7WZSKGBptOOuYCb3BJbLhO3wa1lXrXzRd/1E10goY41FiXL/YWCEoJZv81+t53wlvhR92J4DtAbQEv+RxHIeU/s+vBT8HNkSN34p1nIEpZv3Mf/wbDj1Mkmimdgaf1LKTfWg0SunuyhZYiaFEuptCejbSKDr2MDOJL7gtwdARl/uOYYjxCv4YrEdJAKNYaM4O6LbQN6XS51gcTR/wj1m9vako7fBja3ztj9j3fVOGf3Dhsm2l24MsTOrO0/nX1YR4y1i6PW1yYk38IGSVzNzob/g9ob8bRrqNS6UmCW9sBszlY1wAX9SqtLO9r8jToxZq/w== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=DxKWf11zGSI9NMZKjhUMg1J9zMeV5414mswaYQlPdAY=; b=lhEOKyNSkAx6z1N6l+J5jhjO0idpBi8DYj7MMGjCYPhunuNXo6c7VwWrEhCLCYbq/UFy6dECgPNsMTqfHaI8lbpbcOvyJQlyd5dNywb0nZhbZ4/s528j6CBcpAehavKYobU6YFb3DsH5JNDn6iSlMTCR41eUiMs0Cx3YQLCHHlo0qaOspUpwZOA9jTelngHvm5ZyXrwhv7YoNg1fj2T0khtC/rydVUnp1+QlZ7EsxaAxj/fxbcgxx6cP2Cvs1FUtSgwDfpGKglhcLLNlybWKbeM5R3xKOgoNvhhrXZaa9ujhtDLkIiFQK8UY2mURKTLkZ8lUAE6DJ77mMkGHyWdDcA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microsoft.com; dmarc=pass action=none header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=DxKWf11zGSI9NMZKjhUMg1J9zMeV5414mswaYQlPdAY=; b=Wj/Id0R/MczLKUSkDQw+lk69u54qqQ5loxPiG++PYVjpGmaIYQEvK6db8KTYd6OTGoQkQ36aoEcsQfvGFpixOBkBX+tl3QtC/t+rOiSYLImy3uT3daLTEYSxkM5fHvSW0rCiOdW2eyVeZLxn3uWz52GznOSTHcil/a9YU1Wtppk= Received: from PH7PR21MB3263.namprd21.prod.outlook.com (2603:10b6:510:1db::16) by PH7PR21MB3071.namprd21.prod.outlook.com (2603:10b6:510:1d0::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.3; Tue, 5 Jul 2022 19:50:28 +0000 Received: from PH7PR21MB3263.namprd21.prod.outlook.com ([fe80::b0e4:2621:c4e0:6e37]) by PH7PR21MB3263.namprd21.prod.outlook.com ([fe80::b0e4:2621:c4e0:6e37%4]) with mapi id 15.20.5438.003; Tue, 5 Jul 2022 19:50:27 +0000 From: Long Li To: Stephen Hemminger CC: "longli@linuxonhyperv.com" , Ferruh Yigit , "dev@dpdk.org" , Ajay Sharma , Stephen Hemminger Subject: RE: [PATCH 01/17] net/mana: add basic driver, build environment and doc Thread-Topic: [PATCH 01/17] net/mana: add basic driver, build environment and doc Thread-Index: AQHYjSlgWjh8SeINWEaYsI8REt0hy61pujUAgAKNmSCAAieigIABxH8A Date: Tue, 5 Jul 2022 19:50:27 +0000 Message-ID: References: <1656666167-26035-1-git-send-email-longli@linuxonhyperv.com> <1656666167-26035-2-git-send-email-longli@linuxonhyperv.com> <20220701094736.7d7589b5@hermes.local> <20220704094117.340d9b46@hermes.local> In-Reply-To: <20220704094117.340d9b46@hermes.local> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ActionId=3e9b0004-3733-4ef6-824e-10f218ce319e; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=true; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Method=Standard; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=Internal; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2022-07-05T19:40:49Z; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47; authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=microsoft.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 0bfd0021-c7eb-490a-ef70-08da5ebf9c2a x-ms-traffictypediagnostic: PH7PR21MB3071:EE_ x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: AX4E0Hc2pnwn5N3Yfv/WTOZaT5AFkqVc9G9iej2HPEH7ync+fE9w04sH+z+OlLXajButl6gSbAawnIkxR9iVGOpeWFIpxhTyiung8+JAkYr/kNyK8dT7Xu4P2vzHPCi8Z1VCqEu5W+kDouyR3KvbAzu2+Di/zifZIA/6FpjeM7uEGwfiittCU/RqgFjjyUW4IYuVOA8TvzvkFXExCyMQONR2QPU1p1eezifftO7jl+j1iRWmUY7fBaNqWvoiPJ6BqhtUidp382fOkAg6cmZfGpFoLuKLcAxIf8/Wtdwzo0NxpHseBGrDZY51unVURDEDBZdaS46b26fxFh0EMn3dIuZjdHguv1PK6Y8q4si8freSF6T937A/ZU9wvNUAJ3Lp7oFQZgOzjyQuqInNAIwyMhZke2Q6i1Q7K7ws9Qkz614ITrVTM6wmzbMsEAazul07pxlQwqOBxi9hlDQLDcq9ytmvf6yEokAe2N4VMY/iep5UIpci0WT0XvG/4jnaB5G+oOFAUtfS3nYBv0/enDbXeUxBspQGLDK/On0O+7ZkLr7BlxBVAuIu6QPySJOc/UaD06IXvU2vWWKbj4EbYywMpEV6UC1rYLQZPoF6aZai0/mvrrOTqcN2XSFJNGGavUJkXLjwBo61mm2SKTRZ2Mmj388pAN91cReOK0gJDJigM98L+qKSntXVuRMQOp2Y3vuIV0qdVQcsjyfd8BSIGFdbjypc4kkAxTTu/dCiukESfPnv5oiaV7siULfZIdb4JOQMF4xB997ch26gHyH2Ng/LwwwymyZrk8q3jRDUP2DID2mLn4FCvGqk5X4Qahij5UmELYLqW1VXHkY2Nglaf+uPIcmTATYFTNFilF8FygvTmGIF7XkxEYMKt2cwWL2gcz+jsomdInUCsgX6zvFhNVkGTQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH7PR21MB3263.namprd21.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(4636009)(346002)(396003)(136003)(39860400002)(366004)(376002)(451199009)(9686003)(83380400001)(186003)(82960400001)(55016003)(82950400001)(38070700005)(122000001)(38100700002)(41300700001)(478600001)(10290500003)(316002)(54906003)(6916009)(966005)(107886003)(2906002)(71200400001)(66476007)(5660300002)(8936002)(8676002)(8990500004)(64756008)(66556008)(76116006)(66946007)(66446008)(6506007)(86362001)(26005)(7696005)(33656002)(4326008)(52536014); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?3ATYnLi4KMI8xZVR8t5awd8EMoayiLJmU8E77+kRw1Z0TGpSJjvpjOV4Kkmp?= =?us-ascii?Q?wtmsp5EnngdN48GbOkhWU8Q8qaceBpNO/L81TF87tiUBdSQ0Fzmz8mxteUGR?= =?us-ascii?Q?Re03bzLu2plTiQZodsnuOh3r1Dg4VZp25wNopHqtIXlJR2laZAgcvaqGYbkk?= =?us-ascii?Q?fKYjsh7zlgwNAbbPE4aiPfo15AsISFaTzMhs5gCR3c1r6jgSsFnjVMZz6pdE?= =?us-ascii?Q?iHADNIKatyaYtcGpAbhOZ5m8yHiEDkYERna8ZNuxJhFmiQaFW7le9/5Xg8NQ?= =?us-ascii?Q?94OWW2evqu4bhyysMr2PIqccl/7xpWlO3bEIaZTuSwDP0ipfeWeG6/dCe9GM?= =?us-ascii?Q?CN5500NzTkWsCVwQ5Mj9CBOqE+rVDOKyuBbgrvfsECDQzPDdINlWWAPWl8f+?= =?us-ascii?Q?A38dTHnPuFqZw/y3zKbToqDlKUaacPm06vaylaaV4c1M+tgEUZdlimN5VFx/?= =?us-ascii?Q?rEqmPORAAoqNyPo3ZutwdpVkF/AVrLAWUGVbXd6+sqW/QgC9cdYMF0R49VyW?= =?us-ascii?Q?fnl8JfysaVh9Gw/UHzV9Ozwbtzd+/I1skRNADAk1dUqDh2mxp2QKEfd0ID68?= =?us-ascii?Q?RzmpCyuhhMYgvIvK9PLiCm5hKdNIyS4Y91TU7decfAkJaKoEZroF4qyKb+7B?= =?us-ascii?Q?u0/djFqv/iGg9cXuEkLNZVOnIKzbpfDJ0PU4YRnJVAujrUBJcOc2Gu2PMKnd?= =?us-ascii?Q?rKAOkNvfflsnJowO/64futT9hggiBEyJiHsOGwdNntuKX/DpQhS8vmZ7AOo2?= =?us-ascii?Q?lXyxpNk0fyDwgA+DRhw16QB3yGyV3oGdWZ1Q5DQ7PLgVz4W4nLqDRwEyyZEj?= =?us-ascii?Q?tDSeb8REOXgjhIS6U4wT+wS03stEOv56eC6sEdA5/C2Xc3xFD6PIk9aUyVuZ?= =?us-ascii?Q?FPbi/2sVxKL4sOmYBHMc++4QYK0/v0F3E35nJoSV39SJVbnbON+LEpD9uq0+?= =?us-ascii?Q?f7NNYy19LleaDwOPH5sYpIUlITbRF/fsp4DYAe6G+WL7Rgp5Gmqa3M2++MWt?= =?us-ascii?Q?iRVobInl0rY6MtBwmwjSkLMUweF9uQ4HZKOoAJp7kbAMo+ETRsIiQFEzGebk?= =?us-ascii?Q?lKwGc+289OZBYSl66xYB48WchW0q+4ox7c5VFFAr28l+YyOqOumpDyMWAtuJ?= =?us-ascii?Q?/hGDd7QKSKPKl4iSzytuWRHNCsQdlgHLmbh4/9oeKQHbIwpmk+hH1j/FHldk?= =?us-ascii?Q?2t0xTUBe3kB1iF/G6jFyXcB88pwDsER6HjgM5J+hrY3EF+XCUBqvfHCpxxCX?= =?us-ascii?Q?F6KfVL4ah0FC65vXdVkgL+MrmO8pD74+x+9JJZLUw1N2k8x2JXc+XM/Pn1e8?= =?us-ascii?Q?Cqe3XEMPTK668RiPetLSGvQzAZuy6B6VgR6zR8EMQdXe8WsdWR4mFDiJSrc5?= =?us-ascii?Q?W4rA3+d7RRrXw7YVHYE5MaGslupr7Oc76q7hIU5srKNpy0GPysdcRlgls+7L?= =?us-ascii?Q?Guilqmu9LhTzqnsaawCNLNQf0N1RQArEMeVfC+R3SKUMrNHD1l3CnThL+rKo?= =?us-ascii?Q?LFImMbyuV+47NWWbhAGliJvUxs221k4VpZ7HqwH2wEGBkB02zuAcqmG9vEhK?= =?us-ascii?Q?Xz7Na9zv0rIuLOmvH1qlVZmwwRNGe1NrLnzOWo9q?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH7PR21MB3263.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0bfd0021-c7eb-490a-ef70-08da5ebf9c2a X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Jul 2022 19:50:27.8013 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: tatsOPw1SlgwEe5oJjPxZuCklKgFQFi9JlCjvh7OFc3gsua+tTfAUUWZtztNdsV+Igoq41yYTkxq0vIzONZo+A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR21MB3071 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org > Subject: Re: [PATCH 01/17] net/mana: add basic driver, build environment = and > doc >=20 > On Sun, 3 Jul 2022 07:56:18 +0000 > Long Li wrote: >=20 > > > Subject: Re: [PATCH 01/17] net/mana: add basic driver, build > > > environment and doc > > > > > > On Fri, 1 Jul 2022 02:02:31 -0700 > > > longli@linuxonhyperv.com wrote: > > > > > > > + uint64_t max_mr_size; > > > > + rte_rwlock_t mr_list_lock; > > > > +}; > > > > > > Reader/Writer locks are slower for the usual uncontended case. > > > Unless you have a reader holding onto the lock for a long time, > > > better to use spin lock. > > > > > > This is Linux wisdom (thank you paulmck), Windows seems to love > > > reader/writer locks. > > > > This lock is used mostly uncontended for readers and allow them concurr= ently > to access the list. It's rare that a writer might want to access it. > > > > But changing it to spinlock will prevent multiple readers from accessin= g the list > at the same time. In this use case, is it beneficial to use spinlocks? >=20 > https://nam06.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fwww.r= e > searchgate.net%2Ffigure%2FCosts-of-Simple-Spinlock-and-Distributed-Reader= - > Writer-Spinlock-To-write-acquire- > the_fig1_244490342&data=3D05%7C01%7Clongli%40microsoft.com%7C51cc > 3d29340347b87b8508da5ddc06c0%7C72f988bf86f141af91ab2d7cd011db47%7 > C1%7C0%7C637925496841806674%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC > 4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C > %7C%7C&sdata=3DbWePngCuLBWN%2FFasdYpTuuCJW6Y8kX6WVTInLYvd1E > c%3D&reserved=3D0 >=20 > Conclusion >=20 > Breakeven curves for the locking primitives were > computed, and the breakeven between simple spinlock > and distributed reader-writer spinlock supports the rule of > thumb that states that simple spinlock should be used in > cases where the update ratio f is greater than the > reciprocal of the number of CPUs, 1/nm. Thank you for the pointer! I think this driver should use spinlocks. I'm sending v2 with this change. Long