From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00044.outbound.protection.outlook.com [40.107.0.44]) by dpdk.org (Postfix) with ESMTP id 676452B9E for ; Sun, 3 Mar 2019 08:14:09 +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:X-MS-Exchange-SenderADCheck; bh=CpzM2I2dntZ8WTVP/aihT1MPEDAwD8JwwZqgGOHzf8A=; b=ySauIBxtZh2O3xF/4GBsRlzPnDqfsp+otl1kn5d8Afz17taKn+2xBwKfuPB+MYBSEdQrK3QlQXBhZwDRgHdicU0WkSdPk5LG4vpgq563ljaeycjRyWMG9zEqOl+6r+KQfR3QW5sGgAseBgOY4RUg9bZ+kg0+vIshFUFBExC7LUo= Received: from VI1PR05MB4224.eurprd05.prod.outlook.com (52.133.12.13) by VI1PR05MB4207.eurprd05.prod.outlook.com (10.171.183.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1665.19; Sun, 3 Mar 2019 07:14:08 +0000 Received: from VI1PR05MB4224.eurprd05.prod.outlook.com ([fe80::5d47:817f:9302:23b5]) by VI1PR05MB4224.eurprd05.prod.outlook.com ([fe80::5d47:817f:9302:23b5%3]) with mapi id 15.20.1643.019; Sun, 3 Mar 2019 07:14:07 +0000 From: Dekel Peled To: Shahaf Shuler , Yongseok Koh CC: "dev@dpdk.org" , Ori Kam , Matan Azrad Thread-Topic: [RFC v2] net/mlx5: support new naming scheme for representors Thread-Index: AdTRj0Q1eGhB2zxMSxKdcshNEsEZEw== Date: Sun, 3 Mar 2019 07:14:07 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=dekelp@mellanox.com; x-originating-ip: [193.47.165.251] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 2fb9b7c0-7fe4-4818-fdf3-08d69fa7d3b8 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020); SRVR:VI1PR05MB4207; x-ms-traffictypediagnostic: VI1PR05MB4207: x-ms-exchange-purlcount: 1 x-microsoft-exchange-diagnostics: =?us-ascii?Q?1; VI1PR05MB4207; 23:1pVcyz2qD+HmC0BsFZTkb7Cj9McOCRMlVFm9/biM8?= =?us-ascii?Q?b24DywP11n2cNBqDAkOmlTss8jhvfKwvul/cPFDmvLsRcjWhjN7gZhk2tmLL?= =?us-ascii?Q?reyLu7YevVqGFdaf4fpptOj0eIVFMcN0hd7KzogEJVf4FirYq/u3Cy9Pw/Vp?= =?us-ascii?Q?oLyUeN4+3v0edlRitI/p5OyJtcA6o7gFQy/nG/ESgiP25cTyq6qSjnufIeO6?= =?us-ascii?Q?cZDrOeh0/IN5dE9Uxg99DxyoGnAB76FDNv3swhO3kvz0hofEytEOQZNfEf3c?= =?us-ascii?Q?F4N6c+jU7f0HPxlw+M+JpsVcXwrwqAg/oasWMtmh2DXooGqDyVjkR3hYSGuv?= =?us-ascii?Q?fOXG1dzi4P19B/22FrqjlN8W/09fFA/g31swIT9eVYJD50bMmOJ01u1easBT?= =?us-ascii?Q?2nTIns8Hmwxf4XZz6tAEZyVetO6sbWfQawVvDGs/nGt5KlgHskwtqGN3yvgs?= =?us-ascii?Q?i3Xz93BoOvXTSS2dtevJttkw4H/N7KtVUazT2DskJon7pMzCjYAL2VXlJOuR?= =?us-ascii?Q?PqdBlAo4peslGKShAMH789+f57SJsrkdgmQ0O24eC40Q7/j/xYdUUZIkX4B4?= =?us-ascii?Q?jQ5eF6FXWcb7BGx+hCzD64H6bZZnJv3/0QX8vWejm1XBC8CBLR8Bk4JN3f53?= =?us-ascii?Q?ysiBZu9kWQWkwSzSzZ0ivhTUzXMPtSIQ7uNjhDDY2LReYuY53n7vymBQFQ5n?= =?us-ascii?Q?DjnlN3tjZaoSVl5DYPSthsVhrO0RP3RoU9xfwrdxCbbcAt5paA/zOtdfUCmj?= =?us-ascii?Q?OVtj/Bbu26AoMRXmvmOg0GOfJmt6Ut5QuqUkEpsHJ6acEzzxgfS1fckkHB1q?= =?us-ascii?Q?ObHY3SsOq/NqHPdR18dZ3RVGiMVLDarHg8kOaVkHlzK5zahk5HfGxyfL1nCT?= =?us-ascii?Q?R9C3nUbn+bhNm0NltmWI+wXBlEMfqXeZHo2GDMT41Qq5UCNTpKm/iGuDDo6r?= =?us-ascii?Q?FDyEBOg1jTkv/NFdx9S7Z3kDJoxRwO0kO63vnxO04VUCI2luJP+lbnWj4TLK?= =?us-ascii?Q?gCS64r6sTRlJF4nEAEzUUtlJ4SodtXWCKGWjT8rPlzWPysX6w6kHkmXiC5fS?= =?us-ascii?Q?iFhtkKeRmhpdvwTx/DO4VnP0AxhzFbgxacwrpF4Hih2P27uWtZUzgAcOo/wH?= =?us-ascii?Q?BD6cfYfzbki6+bXCXEjOdQbokaQFHluVqitkyfdI1mZ4cHRqOsz2u0u3eq2N?= =?us-ascii?Q?Bw0Pjr27LMyr6l2e/9h8EKek1zBQcLH3XJ0I3wilTyOLzE6oHInTLzfigs0H?= =?us-ascii?Q?6GC0pt4p4TP7DM0Qrt9NMChFzQqFgEx3vkhNxZoDGDXdG3dJdd2G8w6yd5uV?= =?us-ascii?B?dz09?= x-microsoft-antispam-prvs: x-forefront-prvs: 096507C068 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(376002)(366004)(346002)(39850400004)(136003)(189003)(199004)(7696005)(102836004)(186003)(6636002)(6506007)(71190400001)(53936002)(71200400001)(99286004)(9686003)(54896002)(6306002)(55016002)(2906002)(236005)(486006)(6436002)(476003)(5660300002)(66066001)(26005)(68736007)(14444005)(256004)(4743002)(106356001)(33656002)(478600001)(74316002)(105586002)(25786009)(606006)(4326008)(86362001)(7736002)(107886003)(14454004)(8936002)(316002)(966005)(97736004)(81166006)(790700001)(81156014)(110136005)(54906003)(3846002)(52536013)(6116002)(8676002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR05MB4207; H:VI1PR05MB4224.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: ZDLKbnI/laF0ttJICDszkwuTIjdeKvx/Y91rr6q7AX5Jt4k9fEnp708rR0/bykI84/s4HF9NVCCtdTY2LmQzzGYUte7Zqx2Qji2K6Ps1bMsNQVG/nCAS4bvsjnFtpr5anoFM+5tLyOKqaVqv+I58F7TpoWvlJXDPGWUOkANtUzUYGj3jUdrzZQ0RBHZFumEoFpwYTcNuShWlhMAK/zSwsb8cziVSiGhAa+rVyES21hFPzpIqDuVFULQRw0oueiuuP4OgIHE6CgloPdnuEQCdIJlenzfbta7UDybYoHVgdN1jg1ytvJkGULGHjyJxOAuZB5GYQbvCK3Eg3AEkg7mUg6LN4naOoVwCCbOdo8fhbMYeMA9nN1oiDI04madtDqwk3FjSYHCmAI52peeui5sMoXp8cYbv+1bszw1U2bTKRz8= MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2fb9b7c0-7fe4-4818-fdf3-08d69fa7d3b8 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Mar 2019 07:14:07.8703 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB4207 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: [dpdk-dev] [RFC v2] net/mlx5: support new naming scheme for representors 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: Sun, 03 Mar 2019 07:14:09 -0000 In current kernel implementation, the physical port name for representors i= s a numeric string (i.e. '0', '1', etc.). Kernel patch [1] implements an updated scheme for naming of representors po= rts. The new scheme gives a unique name for each port using the PF ID and the VF= ID. Uplink representors are named 'p0', 'p1', etc. VF representors are named 'pf0vf0', 'pf0vf1', 'pf1vf0', 'pf1vf1', etc. This RFC describes the suggested changes to MLX5 PMD, in order to support t= he new naming scheme, while maintaining support of the existing naming sche= me. During PCI probing, MLX5 PMD uses Netlink to query the kernel for switch in= formation. The response is processed by mlx5_nl_switch_info_cb(). If this query fails, MLX5 PMD attempts to use sysfs to query for switch inf= ormation. This query is implemented in mlx5_sysfs_switch_info(); The following section describes the suggested changes by pseudocode: mlx5_nl_switch_info_cb() { Parse the netlink response message. If found type IFLA_PHYS_PORT_NAME { Convert payload string to number, store as = port-name. /* START NEW CODE */ If convert failed { If found substring "vf" in = payload string { Convert the= remainder of payload string to number Store as po= rt-name. } } /* END OF NEW CODE */ } } mlx5_sysfs_switch_info() { Convert ifindex to ifname. Open file /sys/class/net//phys_port_name Try to convert file contents to number, if succeeded store = as port-name. /* START NEW CODE */ If convert failed { Try to convert file contents to 'pf'/number= /'vf'/number. If succeeded, store last number as port-nam= e. } /* END OF NEW CODE */ } [1] https://github.com/torvalds/linux/commit/c12ecc230564882297000287123097= 9359edb2c0 --- v2: Use public link to kernel patch. --- Signed-off-by: Dekel Peled = >