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 8B077A0A03; Tue, 19 Jan 2021 08:36:50 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0F211140CF4; Tue, 19 Jan 2021 08:36:50 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id 2EF2F140CCF for ; Tue, 19 Jan 2021 08:36:48 +0100 (CET) IronPort-SDR: 2LimHK7tMqHkeLCy+fGM1d66OnXcsYI2C+ISt5xALviqrnGSfipcuknbavAF2cWo1JGsFQZZGU uck7wK/9YOyA== X-IronPort-AV: E=McAfee;i="6000,8403,9868"; a="178977214" X-IronPort-AV: E=Sophos;i="5.79,358,1602572400"; d="scan'208";a="178977214" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jan 2021 23:36:45 -0800 IronPort-SDR: tJ/ALVBAU/hjrLt0tqnVoqaNZemgajmlrJjOwBFE9kv/Mfv/4BTcmhgapKmfWB2RXD0Jw63sJQ NtxTMUaFUfIA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.79,358,1602572400"; d="scan'208";a="426374376" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orsmga001.jf.intel.com with ESMTP; 18 Jan 2021 23:36:45 -0800 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 18 Jan 2021 23:36:44 -0800 Received: from fmsmsx601.amr.corp.intel.com (10.18.126.81) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 18 Jan 2021 23:36:44 -0800 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Mon, 18 Jan 2021 23:36:43 -0800 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.175) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Mon, 18 Jan 2021 23:36:43 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AVHs03UM87zuyvEn9B4LB15+9lspSdGRICCI29Msht4Kat57TRFWHUXJ1lBtAp/hNunRS2oZ5R0ckY0BJjzeg5ihYajgG4BGZmgQHw/Z+2IDj/hjL3646AC+GLNPyaXtlcgh3jluTtBi+PksNSZ1lHQgIvkp106AlRuKnVgnCcLqtJ3SOOS27sqhvyF94IckXai3Xaa8Hu1jzkF4GVfrr8fRrnfpgXXkP5cVxI5RLILBlTM9Kh0mYXIg6nF4tuLEDxRnIE+27Xf7F6MSM0/LH5Tz9oz/RPPY/7V7WBYJq29eTrXHElCmSRxf5DmjBdl5ADcuEeNdOHEN1ABTSdbDvg== 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=6g59MOyyv0HFkP+3igLDA8vt8xCvLWf45mFehPe9Ddg=; b=YhThPLHiMjVVRQHP15anUN9TtyfqxThGVKBvZSlBxUPj91CcEJ7eVxmww+Tf0cXIJg0EyWNwSaQW63paIHqrUexSle7EXF4oyJe3i2dEzSLA8BBY3etGipSsCu2T9FMpfDbeLpYJ7uM+i4l0LfNQCKmohKCVDcZQ8trQsC5JPpHDeTriVdfJ+YGxC1kPXduIvgd2CNwQS3EeRSP3svq8A4/oFVI57p78TXfnKJBp5VrHux2dN3kNQkqxm07eNirZRfTe2aIfKKDa/70RCqZL4rcMwUw7CWCCQm/3LvTDIRYoWI6Kl++6psbDfMzLnYTfhhc8sGkZbGfWa1WpgqiA6g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6g59MOyyv0HFkP+3igLDA8vt8xCvLWf45mFehPe9Ddg=; b=h87EIG4ei1Hs0OPLsCDISJGiHtmD//9uFvH+AEcd3vRrOZbMmmG/B1PhO3NZGQGNypdlKc1a/CjwZONfwNROk8qkZord9r7SSFOAaaIK6KVN4cF2z7xebsXyihFIMadDgLI5CpFAAeHeJEC1RdckDOslSJ7aHF/c9heXTibTLuA= Received: from BN8PR11MB3795.namprd11.prod.outlook.com (2603:10b6:408:82::31) by BN6PR11MB1715.namprd11.prod.outlook.com (2603:10b6:404:49::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3742.6; Tue, 19 Jan 2021 07:36:39 +0000 Received: from BN8PR11MB3795.namprd11.prod.outlook.com ([fe80::b50a:60a1:8190:c67f]) by BN8PR11MB3795.namprd11.prod.outlook.com ([fe80::b50a:60a1:8190:c67f%6]) with mapi id 15.20.3763.014; Tue, 19 Jan 2021 07:36:39 +0000 From: "Wang, Haiyue" To: Xueming Li CC: "dev@dpdk.org" , Viacheslav Ovsiienko , Asaf Penso , Ajit Khaparde , Somnath Kotur , "Daley, John" , Hyong Youb Kim , "Xing, Beilei" , "Guo, Jia" , "Matan Azrad" , Shahaf Shuler , "Thomas Monjalon" , "Yigit, Ferruh" , Andrew Rybchenko , Ray Kinsella , Neil Horman Thread-Topic: [PATCH v5 7/9] devarg: change representor ID to bitmap Thread-Index: AQHW7jLt6SykajKrDUucGEWmWRxZEaoujhDw Date: Tue, 19 Jan 2021 07:36:39 +0000 Message-ID: References: <1608303356-13089-2-git-send-email-xuemingl@nvidia.com> <1611040501-11666-7-git-send-email-xuemingl@nvidia.com> In-Reply-To: <1611040501-11666-7-git-send-email-xuemingl@nvidia.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.6.0.76 authentication-results: nvidia.com; dkim=none (message not signed) header.d=none;nvidia.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.55.46.36] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 6606761b-c179-4d85-84b4-08d8bc4cf594 x-ms-traffictypediagnostic: BN6PR11MB1715: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: H6s4FeB5z+Vgx7N2u3R1MzuEGN6R8UssqdfSOWSZAhMXuFc+eck0kYeU9y9C+LSeUbvaDnnOV9+0vNknDIkDQDIZJnWSKyGt98r0FU5O8EbG+SL4nOpG391M3Zf+rJYFHjZug2iGN646dkegPWPRUse+p141Hs5RbANp6SU9QOzN93rpddm2+i3WTL5t2xxca0RTQtoN/Q67E+8b6zySDdPtqIPbcCXLcHseZ1yEjpnnTtVtlT2pP9n3Nn5qZYSz+Y5HSM5ZEOhe5HXii66Rikqp6l7KjNRQbTBFd90/trqQcgvc6q/JGbGhrPzIN7o23+Yvf4eFK+EGQme/P10QOjDx854ciLboD1sqXX9872c1jTdpXbWx5W+AyWQerj7K9lzPJrAJX9ejx+7jiuwPJA== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN8PR11MB3795.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(366004)(396003)(346002)(136003)(39860400002)(7416002)(83380400001)(52536014)(8676002)(33656002)(71200400001)(2906002)(5660300002)(55016002)(66556008)(8936002)(26005)(6916009)(64756008)(6506007)(316002)(66946007)(66476007)(86362001)(9686003)(7696005)(54906003)(4326008)(76116006)(478600001)(186003)(66446008); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?uarrR7Nl1rdskficf6XJzksM+e/eugDkugY8Txk4wm8jj/gEPPpcrnnWmnGf?= =?us-ascii?Q?CN3qYYC/V0TbVG5scIrZE5TOnip8Zf83qO0ZhABxpKKcibeOSvm34njomF+J?= =?us-ascii?Q?xUOmrzBloLjeO/608cE5wSwpyagj6w8iO4wAWvDiwZ6C3DDBBONfrM9yMa5c?= =?us-ascii?Q?pgiALR5upjtz0j+eObWSYGfvy3HSzn814OFZVBuFt+4DUmP7GW+E12/seWIp?= =?us-ascii?Q?Mxch02mxC6bU9QiJq2Jwwb94XGN6iup4irj1oAmMSP8MnExPBMU5qG0NLkOX?= =?us-ascii?Q?9nSSdkM4asckv8qbXvye7jOVhcLulR68VOyVUoIRYhvPo2fF0EslaZvh2QeQ?= =?us-ascii?Q?FddE7vhg59D7jrO+HZNetvj2swcapN2fM1f8itAKzyrwcsIWUeeQW5zyS/Mf?= =?us-ascii?Q?Mr0Mox+2D1wRKQi7wNLXU4e5hO328m4XLZDDkD4L1fpGvXDv6q3Syx90UM4e?= =?us-ascii?Q?5MvSL1QKcnbikJmzchEhc2yrIpV78anoyXbmrylYTvh8PQ38KuslstnRwPqr?= =?us-ascii?Q?v03ZcXkD6TL31KjPndpk1TiRmtHhfh5jFhAM6RgirRvbi5qVPyvb5V19gUfX?= =?us-ascii?Q?ljrBT3lztIGW/FoFSiSi/ZkTNMtNiNR82lXpptL0wvKfhIUhi+JxXzpZ0OSM?= =?us-ascii?Q?GOMpnr6Lcdh3Dta1lV6J9/+TP5R+2FtVLpVEdwWuNOtGR5k0hygA9mco2LXR?= =?us-ascii?Q?Uk1D8PGclZ9ktRS7SV+ltpkwt6Hjeq0jX6ujMCA3+UJMPRf+l8QQilbKmNd2?= =?us-ascii?Q?qSI9NyviQVVxRnNLbBMtiazS+u5y1ghsz3s3A2YxIIvmwlKW9ETvf56w3u8N?= =?us-ascii?Q?Yuhz7fi5mv/57vWewQmbohZqVtJ53oFQ2e3eDBYKRpHWCCDRRZ0fLhbbZ6ur?= =?us-ascii?Q?aQfu5aqq+ZxHMvdyQneWqauZVoDhubYHSrmwT9Z5K2qmwEm4LxFTi7E8gNrF?= =?us-ascii?Q?f9XC0845Cia701ljOJGHWxsyUyzqzS6NMwR6tDUlqk8=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN8PR11MB3795.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6606761b-c179-4d85-84b4-08d8bc4cf594 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Jan 2021 07:36:39.4234 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: PhC6Pz54zvn4b9XepP+qnLIVEu/IuosXVRqbjGA5Dd84zX6kIs5nHX3U8dPCkGb/OFRFw93usxAiQw8w2zriPA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB1715 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v5 7/9] devarg: change representor ID to bitmap 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 Sender: "dev" > -----Original Message----- > From: Xueming Li > Sent: Tuesday, January 19, 2021 15:15 > Cc: dev@dpdk.org; Viacheslav Ovsiienko ; xuemingl= @nvidia.com; Asaf Penso > ; Ajit Khaparde ; Somnath K= otur > ; Daley, John ; Hyong You= b Kim ; > Xing, Beilei ; Guo, Jia ; Wang,= Haiyue > ; Matan Azrad ; Shahaf Shuler ; Thomas > Monjalon ; Yigit, Ferruh ; A= ndrew Rybchenko > ; Ray Kinsella ; Neil Horma= n > Subject: [PATCH v5 7/9] devarg: change representor ID to bitmap >=20 > The NIC can have multiple PCIe links and can be attached to multiple > hosts, for example the same single NIC can be shared for multiple server > units in the rack. On each PCIe link NIC can provide multiple PFs and > VFs/SFs based on these ones. The full representor identifier consists of > three indices - controller index, PF index, and VF or SF index (if any). >=20 > SR-IOV and SubFunction are created on top of PF. PF index is introduced > because there might be multiple PFs in the bonding configuration and > only bonding device is probed. >=20 > In eth representor comparator callback, ethdev was compared with devarg. > Since ethdev representor port didn't contain controller index and PF > index information, callback returned representor from other PF or > controller. >=20 > This patch changes representor ID to bitmap so that the ethdev > representor comparer callback returns correct ethdev by comparing full > representor information including: controller index, PF index, > representor type, SF or VF index. >=20 > Representor ID bitmap definition: > xxxx xxxx xxxx xxxx > |||| |LLL LLLL LLLL vf/sf id > |||| L 1:sf, 0:vf > ||LL pf id > LL controller(host) id >=20 > This approach keeps binary compatibility with all drivers, VF > representor id matches with simple id for non-bonding and non-multi-host > configurations. >=20 > In the future, the representor ID field and each section should extend > to bigger width to support more devices. >=20 > Signed-off-by: Xueming Li > Acked-by: Viacheslav Ovsiienko > Acked-by: Thomas Monjalon > --- > drivers/net/bnxt/bnxt_reps.c | 3 +- > drivers/net/enic/enic_vf_representor.c | 3 +- > drivers/net/i40e/i40e_vf_representor.c | 3 +- > drivers/net/ixgbe/ixgbe_vf_representor.c | 3 +- > drivers/net/mlx5/linux/mlx5_os.c | 4 +- > lib/librte_ethdev/rte_class_eth.c | 38 +++++++++++++---- > lib/librte_ethdev/rte_ethdev.c | 26 ++++++++++++ > lib/librte_ethdev/rte_ethdev_driver.h | 53 ++++++++++++++++++++++++ > lib/librte_ethdev/version.map | 2 + > 9 files changed, 122 insertions(+), 13 deletions(-) >=20 > +uint16_t > +rte_eth_representor_id_encode(uint16_t controller, uint16_t pf, > + enum rte_eth_representor_type type, > + uint16_t representor_port) > +{ > + return (((controller & 3) << 14) | > + ((pf & 3) << 12) | > + (!!(type =3D=3D RTE_ETH_REPRESENTOR_SF) << 11) | > + (representor_port & 0x7ff)); > +} > + > +uint16_t > +rte_eth_representor_id_parse(const uint16_t representor_id, > + uint16_t *controller, uint16_t *pf, > + enum rte_eth_representor_type *type) > +{ > + if (controller) > + *controller =3D (representor_id >> 14) & 3; > + if (pf) > + *pf =3D (representor_id >> 12) & 3; > + if (type) > + *type =3D ((representor_id >> 11) & 1) ? > + RTE_ETH_REPRESENTOR_SF : RTE_ETH_REPRESENTOR_VF; > + return representor_id & 0x7ff; > +} > + Rename 'parse' to 'decode' ? Since not parse from string. ;-) The these two functions are pair style. rte_eth_representor_id_encode / rte_eth_representor_id_decode ? > 2.25.1