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 243D0A0A0C for ; Mon, 5 Jul 2021 04:50:35 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D485A40141; Mon, 5 Jul 2021 04:50:34 +0200 (CEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2079.outbound.protection.outlook.com [40.107.93.79]) by mails.dpdk.org (Postfix) with ESMTP id B664F40141; Mon, 5 Jul 2021 04:50:33 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CwkQXwvizzynvrD53r0JUpDNUexV5v37QF5V25qDLnA7eqBeg/puUdW0gSqxu3oE+dZ24VdQKCAT1M2lHB3MJHBcQzxE+6BHvQhlDDZo5lEr+ndbXot5zNPPv8LMMNyitMS7chXGQsNUM33vQyjjH8WwGf2+QFuAqeXPSzo0Ubm3omcAoHBWI066X6Ga5njJd1nbCHeLuTkCEBgHAMowfmzAA49N2axP6uZNpTBv+ki9lxKdN9B/WwqiWqtdGoCYVTyf4Zq9luhHkIgaIolHzlgRTn50Efrcwi/781jWtczIv3rrolW0qsEdnP/zcg9jUAZ2ueIPJh1UKqAgRDlhTw== 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=KD/5QQWcCTDQkutcCXSMQ6w4YnTMnj9P+ARQs4I6sb8=; b=fAOCPhqFE8F8EzfWob73AM9uJrf2uGhOfDhaCJcCdPyJ2ZvJiTuIoTtNpRaOPGx9SWRFFBzdxv6yvJ6vlKXRUjXfm/W8xbJjxBuX8r514tEded+/Bm+RtDp94TJHT8E4Rcv6eXLCryfKJ6NiyJFlXJgqV5ccQcGaWGxVqFg+f0iBh6vzhpzs1m8Ca+MaGeRHN/VxeBYVuelj5H+BW8isvVadGHTdEDOoT0+1HMC4ojRf3iyRFZ5ZPmyN//QMvZIK1B+vDKwsSTK0a3gykSAeQkeb+FVfL8567WD/+PYv1eO60pnbe7F1qFQfhabOr+HhwitthwQx/P0EDIS64WwzxA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KD/5QQWcCTDQkutcCXSMQ6w4YnTMnj9P+ARQs4I6sb8=; b=sJi5HLaJVjd5zHaZ0s9Qh186vyATxNHS9IVgaDYzoy0Jtr+6hThevfqCmSsq+bmMVZijb1gHlCtPk9UfJkmzcT3V7Yt7z0qe/DmKdlFEKa8nF3GyEmwpWUqvYxLkEZ+jvH8OvGR5N2sacwncbl1wCN97CdGBejCwW2DeuPZXiDqCWf/BemFhI/jNfJKOjDtu3J7jFI/CTGR8PzxZ/JrwM8s1468cRl1ilgwZDkShZrbZOriSdp3931xlu01H9z96uRu9H+uLbKBdqt2H/0xIC0wnDKvqi6AQInAwmpOhKpqDoA2tLwFFLJ/pwEfcs9+nsqSdYo2n3JGfVqHmeqdDQw== Received: from DM4PR12MB5373.namprd12.prod.outlook.com (2603:10b6:5:39a::17) by DM6PR12MB5551.namprd12.prod.outlook.com (2603:10b6:5:1bc::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4287.22; Mon, 5 Jul 2021 02:50:32 +0000 Received: from DM4PR12MB5373.namprd12.prod.outlook.com ([fe80::ac75:9b9a:a03f:1676]) by DM4PR12MB5373.namprd12.prod.outlook.com ([fe80::ac75:9b9a:a03f:1676%3]) with mapi id 15.20.4287.033; Mon, 5 Jul 2021 02:50:32 +0000 From: "Xueming(Steven) Li" To: Viacheslav Galaktionov CC: Andrew Rybchenko , Matan Azrad , Shahaf Shuler , Slava Ovsiienko , NBU-Contact-Thomas Monjalon , Ferruh Yigit , "dev@dpdk.org" , "stable@dpdk.org" Thread-Topic: [PATCH] ethdev: keep count of allocated and used representor ranges Thread-Index: AQHXb03kJya602MP90K9lAGikfe6tqswdAtAgACSFoCAAqs8sA== Date: Mon, 5 Jul 2021 02:50:32 +0000 Message-ID: References: <20210702142322.821302-1-andrew.rybchenko@oktetlabs.ru> <6f3f6072c2ff6b1a10214392e41c18af@oktetlabs.ru> In-Reply-To: <6f3f6072c2ff6b1a10214392e41c18af@oktetlabs.ru> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: oktetlabs.ru; dkim=none (message not signed) header.d=none;oktetlabs.ru; dmarc=none action=none header.from=nvidia.com; x-originating-ip: [2409:891e:bc27:4850:a0ec:3889:511c:e330] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 5685fd08-d7d0-4f89-2dfd-08d93f5fa7fd x-ms-traffictypediagnostic: DM6PR12MB5551: x-ld-processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8273; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: ymKb8A1Q30buFsPbVDsPsmpD8VUvd+ssvV6soXTY8NskOfre5s822CtUS+vY6Cc6rX439gQPoNsjMYmMLwGd02pnAcJUBTTY5L8xT6Kr5s0+9HeuhFLqtHWzBdtEnTPQkeyKA0WzSUAlv58+GKYDzQ8WPSGNt3gh+qKJyJ7Zmp4s42YHK2TGeGyF9lsBo1j2YfF322HuEPZMcT8C2YedN0ViaNTAwWrFE0zkHyUbMPTXhXVbYOGdNucDwgWDIeGANq9cE0PZjena02RaXnGzolzRIOTXTgLiwjqfpMq7d2iO/Otl6R/aq7hNSWbv0iC2+xi9UbTOJOehtaXl0mO7S+z5isHS4WVPLPIz8QDGXSvF8D8rTf47jZyAwz7nfrQWblcnomKATPcw1esrS83xv5nJlV1i+P86DUtdEyIGmnPyjiN+UThfyoO15445n+dRRfbP1atdxmVtrKSvY/D3HcjrQaIqv2k7zwIzMEICMJk0JA0k230VWlrmas83GfeY0N1o2rcztrOGv/OsZNCET/Hcj7AnSYmfxGwHNxxxLfaDRfgCOp3sXfs2KGQoNZZvNiIvMuI3wG/weUdKI4W+rYeQ6eHyH8uruCveBT97pBIJdhtAr2VYfu+aIvDGjjyDX/yKCm4rMBwPm1/zr7uU/w== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR12MB5373.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(136003)(376002)(396003)(39860400002)(346002)(7696005)(9686003)(55016002)(8936002)(8676002)(66476007)(186003)(5660300002)(66946007)(66556008)(4326008)(33656002)(64756008)(6916009)(54906003)(86362001)(316002)(122000001)(52536014)(66446008)(38100700002)(53546011)(2906002)(478600001)(83380400001)(76116006)(6506007)(71200400001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?xBPP32apBLPFeGmfNUvWaIEN8HflMi2AAuGUrwa7ADgH7jzbrZyylu58add+?= =?us-ascii?Q?8yloeAi/8SXfuqrXiirNdn41b8euLXufsF/SoqA3NmdykZn6ExUhZutGTmBd?= =?us-ascii?Q?KaA2bWVQDLVPivzmFS5lIem5F/V28xS+Etu8jZJ5447ARpzhyaKl6uyuuzFg?= =?us-ascii?Q?fmZSBt6loMNTyAEvB4BPydaC2DwuonEw6Xkl6tcsYVqns29WOBK7DztHa/66?= =?us-ascii?Q?BsEl1trvOXocn67oaZMpYXmPVhaviD+LrfB2I0k8I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XHAAx2YK8Zf2mL46MsjlkUm3K7HgSs4hE8AA7i?= =?us-ascii?Q?5FAdSzOMgfCS1MVE7h1xjdHINUmp8UdvwHRlho0WjRdxx7CkvsF11abiIuuZ?= =?us-ascii?Q?f9ex9Yz6YwjiVgQbAQRWPjXYdhxVSXr4dOgCKjGj4A72btPRUXtAnQC/ltta?= =?us-ascii?Q?gAa8wM0qP5nCIYH4OFYVmg5JphGAdBhDvq/AbgH/U3G7tmPj1giqKokv6n7n?= =?us-ascii?Q?wYNkaocCEe0wGCOwA7XaH/MzZ27h?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM4PR12MB5373.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5685fd08-d7d0-4f89-2dfd-08d93f5fa7fd X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Jul 2021 02:50:32.1669 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: DbaFuwWT73wTHhocqRJbvPlUhRmo9KFv7Mm5suI9pIKKfFUoqhBInWv0q0xHDmCPQK4iwwvf5xkWbCOYkWWU+Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB5551 Subject: Re: [dpdk-stable] [PATCH] ethdev: keep count of allocated and used representor ranges X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 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" > -----Original Message----- > From: Viacheslav Galaktionov > Sent: Saturday, July 3, 2021 6:01 PM > To: Xueming(Steven) Li > Cc: Andrew Rybchenko ; Matan Azrad ; Shahaf Shuler > ; Slava Ovsiienko ; NBU-Conta= ct-Thomas Monjalon ; > Ferruh Yigit ; dev@dpdk.org; stable@dpdk.org > Subject: Re: [PATCH] ethdev: keep count of allocated and used representor= ranges >=20 > Hello! >=20 > On 2021-07-03 04:32, Xueming(Steven) Li wrote: > >> + if (i =3D=3D n_entries) > >> + break; > >> } > >> out: > >> + info->nb_ranges =3D i; > > > > Here info maybe NULL. >=20 > Good catch, thanks for noticing! >=20 > >> faf3bd901d..d2b27c351f 100644 > >> --- a/lib/ethdev/rte_ethdev.h > >> +++ b/lib/ethdev/rte_ethdev.h > >> @@ -4856,6 +4856,8 @@ struct rte_eth_representor_range { struct > >> rte_eth_representor_info { > >> uint16_t controller; /**< Controller ID of caller device. */ > >> uint16_t pf; /**< Physical function ID of caller device. */ > >> + uint32_t nb_ranges_alloc; /**< Size of the ranges array. */ > >> + uint32_t nb_ranges; /**< Number of initialized ranges. */ > > > > How about rte_eth_representor_info_get(info) return max ranges size if > > info is NULL, return real initialized ranges if info not NULL? >=20 > I'm not sure how I feel about it. I think it'd be best if the function re= turned just one thing. >=20 > Moreover, there are drivers that don't have a fixed structure for represe= ntor IDs, e.g. net/sfc, where every range will contain a single > ID. If a new representor range is created between invocations of this fun= ction, there probably should be a way for the caller to know > about this. >=20 > Perhaps we should move the total number of representors to an out paramet= er and use the return value for the number of initialized > ranges. What do you think about this? No big difference, I'm ok with your original design.