From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80055.outbound.protection.outlook.com [40.107.8.55]) by dpdk.org (Postfix) with ESMTP id BD0AC5323 for ; Thu, 28 Feb 2019 11:04:24 +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=jtv3bJSrhgPxOAoprEoyZFdwQ4Xhft54IMX/zOv22go=; b=oR0ceTHd+Z6WmO5k05OoSYsgcgF/zyxdWBhzdFqzPyIzSqOwLGpq0kSdhO0YjN5S01IO4IW5mRHb2gJ5z8698tDcrBPzT4oJGTd9KmE6eCGumD+QMwKLTQeq0mVUeAQefAIRklMqNLElCfc4B68CUYL85zixggsNcav/7y/xj9E= Received: from VI1PR05MB4224.eurprd05.prod.outlook.com (52.133.12.13) by VI1PR05MB5312.eurprd05.prod.outlook.com (20.178.8.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1643.21; Thu, 28 Feb 2019 10:04:22 +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; Thu, 28 Feb 2019 10:04:22 +0000 From: Dekel Peled To: Shahaf Shuler , Yongseok Koh CC: "dev@dpdk.org" , Ori Kam , Matan Azrad Thread-Topic: [RFC] net/mlx5: support new naming scheme for representors Thread-Index: AdTPTFH4MpatnibtTGCrvY+ZaybrPA== Date: Thu, 28 Feb 2019 10:04:22 +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: b7603d52-0eac-443e-4b03-08d69d641ce8 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:VI1PR05MB5312; x-ms-traffictypediagnostic: VI1PR05MB5312: x-ms-exchange-purlcount: 1 x-microsoft-exchange-diagnostics: =?us-ascii?Q?1; VI1PR05MB5312; 23:ccL5v4JNXFhjHkaCGWmg6JVTKzbIMfcG7fvO4w9iO?= =?us-ascii?Q?NCrRmGp3uALyE7ALIMtUmrZtgCaKEwA3C9AhC/wmbbgEFgptn9OSK8xc99ii?= =?us-ascii?Q?wiIk9FuGhRrfIzG4f/0CNwOV+w+02NTmBdNMokH1zKQPuY/JT0OMAQhTUyM2?= =?us-ascii?Q?WVTXi1GXhhBO4aaTg8balxkupRjZ3px9tdUvLnjIrZVGdX4vUHaGatC/TM3Z?= =?us-ascii?Q?qaqRCHHNzzqi6/5BLGZHkoZD+7Qt2tjvKs0sFDXtRPkm8S65ahv2cCIgRYrs?= =?us-ascii?Q?QzEyREKh8/v+yDx2Z2FbqlyUEoaspGItEEz7gKNZkPTKI8PnvxbfGiXtP8mb?= =?us-ascii?Q?TSAT3eAvpQFIZDpj0qeHrUJjMANUmkvNu3F/NUpWqr33j5IAWlqFEg/SAoPZ?= =?us-ascii?Q?EmG2igyZHLkUy7/t7EeCFs1GT4nG0CADfotxCtdHaX6ip1+/jOkUkkozj7X7?= =?us-ascii?Q?ORcDWjpVAYqoIyACAzXz3jPcL5d/47V8O1BgVf/LdEbr8d6CjBNHwKvwfsPi?= =?us-ascii?Q?0YfduBLdI2d+iC0un9Ev5LsPKA6IMSKnZSnjIOk2kuEgBxiQ7Gg2CGZSFsRF?= =?us-ascii?Q?cTj1aHJfeLuYdVswKxqzRNgAJO4qXVb1cWxaAMXvLyUny9T0lGx0C58G0HAq?= =?us-ascii?Q?3HMbCqLkhgW+fnJqdFgIoBteFW04oexH/Uvme2MYeEL/UyQrEFCbTNyEShwM?= =?us-ascii?Q?w9UaUmPE78jAPk9nIuHEotvEnWWuiVpmfZfMktHS0XHr5nl9AJ+CpKKgTRQY?= =?us-ascii?Q?sHPM4T13FvBNRx2eJSD/O8aE26m+I79l64E1ukgnrskW/6XRjNErSq6SdBa4?= =?us-ascii?Q?7H9UFr/oso7PWkSTt9wwmTxgDpdsDCGrkt1cVjzJsUG7+DiNbmrQ4arVICCN?= =?us-ascii?Q?fazo9yztIw7IzzGipaLyPWpC26lxi3UnTxe2pRsyISguiGKP+X2j1/dYaBDq?= =?us-ascii?Q?xyLp7nSZYx+drYZCkykdNFn8wY7XBLPO6mSRDeBwszrMIg164eaWDKkvbMup?= =?us-ascii?Q?o3tHW9j+CW2xT/PoGXYHmQ+Ggn/kiHPLiqGrWhcLD2118yoUnVWOXEAOL8Os?= =?us-ascii?Q?+osRfGBppifaXrUjb3fUXQz9ciETtNkzL51tc2SuI84En6m0MksjEVcmwZe2?= =?us-ascii?Q?Y0JApHmirj+AeklwVcu5DtGTgUv24KDQ2AfnzLbgyCaH4mRFndUbgSaLjn9I?= =?us-ascii?Q?mbfoNbbubJu/2plTXsIbAYUISNeTy5Yw+H9QqwxEQLv/C3lK0kJFxLjXA=3D?= =?us-ascii?Q?=3D?= x-microsoft-antispam-prvs: x-forefront-prvs: 0962D394D2 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(39860400002)(396003)(366004)(136003)(376002)(199004)(189003)(316002)(110136005)(33656002)(25786009)(71190400001)(71200400001)(2906002)(6636002)(26005)(6306002)(54906003)(55016002)(256004)(9686003)(186003)(6116002)(3846002)(99286004)(305945005)(7736002)(74316002)(81166006)(7696005)(102836004)(14444005)(53936002)(476003)(8936002)(106356001)(8676002)(81156014)(105586002)(6436002)(66066001)(4743002)(52536013)(478600001)(486006)(68736007)(107886003)(6506007)(86362001)(5660300002)(97736004)(4326008)(14454004)(966005); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR05MB5312; H:VI1PR05MB4224.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX: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: XNPdp+2Gs7r330sok5CSALJAc0ipYKQElCNd71MkmX/VmLw4EnA2yLu3D5LPepbiWUbdJXfRF7oiF7+VsP2UtK/B9B1ySeV71OGEuiabBrUds6x8ngh1iZJTnegHJzQmWvxkBh6Dh6gLt1QT2iUapGCJRW3V+TYEb3TRBEO0/dnXaLqTofprdnhrRqCYqbbVcwiYzx54JpNK6eOwo/JbjeQ0o/0qsfcwv6PJdbEf2Z/gGVatX2gnR/gmjBjIEY80KoHzGwB+FlSBfHKj77UI8i9l+TjteJVNR5RM5dYfT4oZzoTln/cB+SEWaL2I8dRnwk5vyelIiLdSb1Y2xUvxqFWnUje9QCY+uLjHVdi8McqvS82wvcCSQkxLd7w46iCOta4p0ljwfVjubuLVMVIkaXvN1b5txtmwtGnIHRXOSsM= 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: b7603d52-0eac-443e-4b03-08d69d641ce8 X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Feb 2019 10:04:22.5769 (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: VI1PR05MB5312 Subject: [dpdk-dev] [RFC] 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: Thu, 28 Feb 2019 10:04:24 -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 port-name. } } /* END OF NEW CODE */ } =09 } 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-name. } /* END OF NEW CODE */ } [1] http://l-gerrit.mtl.labs.mlnx:8080/#/c/upstream/linux/+/160883/