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 44F05A0C51; Wed, 21 Jul 2021 16:38:53 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 24BFA4111A; Wed, 21 Jul 2021 16:38:43 +0200 (CEST) Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam08on2083.outbound.protection.outlook.com [40.107.102.83]) by mails.dpdk.org (Postfix) with ESMTP id B7604410FD for ; Wed, 21 Jul 2021 16:38:41 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bMcwmBl1RZNnYOWSBeBh3oe5qFsAUwN936wYRiAvzNa1Q160UWjUwKJ+FaD7xWHalNTA99VS+nK674QEH158965WtjuCAWPgtqXmWhWGHfBB53sF569+0vg//zAAYl1tcJgWwQ/wqS07L+LX7dr7vSZbRpSRYBTJrCF2p4yooDCsp+o2pQ51w6ant6cpW5kNCwn4DtagdueKsRdQyij34ap9P1SoMgZVudF5YcL7HVhFPND4QvVwqKAet3GJLQngkFtiYCVZTYvdazzmW/dYcTLS73OLCn012rUlbRrcjdoebu1zP4wzCeYka8ATmfm3FFpK32vaZBTcJHOuqLqodA== 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=XQtjscw4A12R0J+oKs8bFj6NCV8/bucOpOdNXyOy6ZA=; b=c3hQ7KvBDFO6FTiF2FRNCoM8vsaFlkgtynkhU5C+CReNEMFxho1nIjDzV0WHD1AicAMVOLYdas+fcMtuHIvL6u81FOMHLbt85jf0+amGFj9UqzqRSiYCLc8Qy/ipqGmvN7QGEtTXCTH1ethiqcGH/B78/qH3g/zh49hIp3HZFqZK8Vjx0aOhly8C7CBQL7VsAqosY4knyUHxI7WJfkt6L1LOwP2I71a9ncHg016JEkVEIZNNDg8JmY+gVkh04i7z1RK01edqWB0NsSKkLkhLSZHnfJmerwyX0nCm92cO3clzeUx0zi6o6DCCgYVSs3Qffje1TqfMin0gmqvOMp2+yg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=none pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); 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=XQtjscw4A12R0J+oKs8bFj6NCV8/bucOpOdNXyOy6ZA=; b=i2LZXhyQiEHhTjAZApWgxuHE6l5i52FEX6tPU1omaQ6a/qqBpU/v27NnpAhHztbnNW4t6rhTjNSGNqzVNrMK16oWf8KrJaaCUnZix0LZWS153Cn5HhuvEkwt/FWp1XaGOZVg09HtKK4TmEfa1Y3xareZrO/wrD/7zozn75v9A8ofiz9W4q5uyJpQrPUN3R67SDdwCte8ZFO88Cg305Fh6ZP7phTdvgpJXeT4y24I+GRbegkbiLOH2ShzjeOTV444qe4hXMvNyWxV4NYDpq4m4xUjYSBAcGckrN4gXrsselomduIeMQQB/dLlxKFORSp6/MuSYAnUHKaITpAZF/c61w== Received: from BN9PR03CA0658.namprd03.prod.outlook.com (2603:10b6:408:13b::33) by BN6PR12MB1633.namprd12.prod.outlook.com (2603:10b6:405:5::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.26; Wed, 21 Jul 2021 14:38:38 +0000 Received: from BN8NAM11FT019.eop-nam11.prod.protection.outlook.com (2603:10b6:408:13b:cafe::20) by BN9PR03CA0658.outlook.office365.com (2603:10b6:408:13b::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.24 via Frontend Transport; Wed, 21 Jul 2021 14:38:38 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by BN8NAM11FT019.mail.protection.outlook.com (10.13.176.158) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4352.24 via Frontend Transport; Wed, 21 Jul 2021 14:38:38 +0000 Received: from nvidia.com (172.20.187.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 21 Jul 2021 14:38:35 +0000 From: Xueming Li To: Viacheslav Ovsiienko CC: Thomas Monjalon , , , Matan Azrad , Shahaf Shuler Date: Wed, 21 Jul 2021 22:37:30 +0800 Message-ID: <20210721143743.24626-4-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210721143743.24626-1-xuemingl@nvidia.com> References: <20210616040935.311733-1-xuemingl@nvidia.com> <20210721143743.24626-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.5] X-ClientProxiedBy: HQMAIL105.nvidia.com (172.20.187.12) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7c3dfb37-c255-413a-4a97-08d94c553aa0 X-MS-TrafficTypeDiagnostic: BN6PR12MB1633: X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:923; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ccX7mlsAq7DHthpOX/yc6Bs+gqbnJpHCegRhrNq0UHXafhA9O9DU1zlXz5xmsuFbF3o/BZbRkdriFgS6HbHF2KFaVfUAZdvLz4sLe5PtAvRJ9sc3+9PUM7ByFcImozkCPBP2LZc7blNXnv33YcFAq7eQ656klNQwI9jrMJm2mr9/1ajXQnRVM3hWKX9qSFvk/MQif4Q3jLWopz4wirGVmk6jt/tB/OlW1dNsQrc9J/a4MIYg9rC4nGmk8eaDkI+0BgcPa/08QIouRQj87YYVo89bKFpllCjg/D4evzGwMsXgKgxNDT/uoPbuT4bJzQjTZwzedqiwciDTIkp/RYvA131p19Wfg5wvvTdV5Kv3uTpNlNtxwY3kXNm+HPWNAlDdMUgPCNEdjIMDalEHJBpO7kxk9or69jI+TwG+4l4AIVjzKqf4PQmpIgB0Zfz097TJQiM1CioVglXBfdlRsHWqMgZGkNGAPsnUXVzEYPLZ69RbxvFrb+dUv4y4BgQ7/9dO/El/3G7eZCtg5AqJcXa6nEtGhvIl0PUIb4eMDrl3ih9O9g/fwwhLHo8PxqRoXmW5RCH81rZ4ytyAjWWU++JqM827p/GufEPBP2lrAYxZq0nOGDfAQY3U7WT3MAXLPUipCP9sKHoCTG9Hn8yr+T59CsRT/APIAaa8v/aJFQ1qpTmU1LgJ/SWLbfh3zlNHBbterCbK1MjNQiZC7+HrFqrp9w== X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(376002)(136003)(39860400002)(396003)(346002)(46966006)(36840700001)(356005)(1076003)(82740400003)(83380400001)(2906002)(86362001)(478600001)(54906003)(47076005)(16526019)(6666004)(36860700001)(36906005)(186003)(426003)(55016002)(7636003)(8936002)(336012)(37006003)(2616005)(316002)(36756003)(26005)(5660300002)(6636002)(6286002)(4326008)(7696005)(6862004)(82310400003)(107886003)(70586007)(8676002)(70206006); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2021 14:38:38.7581 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7c3dfb37-c255-413a-4a97-08d94c553aa0 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT019.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1633 Subject: [dpdk-dev] [PATCH v4 03/16] common/mlx5: move description of PCI sysfs functions 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" From: Thomas Monjalon The Linux-specific functions mlx5_get_pci_addr() and mlx5_get_ifname_sysfs() are better described in the .h file. The requirement for using mlx5_get_pci_addr() is explicit: the node /device must exist in the provided sysfs path. Signed-off-by: Thomas Monjalon Acked-by: Viacheslav Ovsiienko --- drivers/common/mlx5/linux/mlx5_common_os.c | 22 ------------------ drivers/common/mlx5/mlx5_common.h | 26 ++++++++++++++++++++++ 2 files changed, 26 insertions(+), 22 deletions(-) diff --git a/drivers/common/mlx5/linux/mlx5_common_os.c b/drivers/common/mlx5/linux/mlx5_common_os.c index 78a9723075..337e9df8cb 100644 --- a/drivers/common/mlx5/linux/mlx5_common_os.c +++ b/drivers/common/mlx5/linux/mlx5_common_os.c @@ -23,17 +23,6 @@ const struct mlx5_glue *mlx5_glue; #endif -/** - * Get PCI information by sysfs device path. - * - * @param dev_path - * Pointer to device sysfs folder name. - * @param[out] pci_addr - * PCI bus address output buffer. - * - * @return - * 0 on success, a negative errno value otherwise and rte_errno is set. - */ int mlx5_dev_to_pci_addr(const char *dev_path, struct rte_pci_addr *pci_addr) @@ -159,17 +148,6 @@ mlx5_translate_port_name(const char *port_name_in, port_info_out->name_type = MLX5_PHYS_PORT_NAME_TYPE_UNKNOWN; } -/** - * Get kernel interface name from IB device path. - * - * @param[in] ibdev_path - * Pointer to IB device path. - * @param[out] ifname - * Interface name output buffer. - * - * @return - * 0 on success, a negative errno value otherwise and rte_errno is set. - */ int mlx5_get_ifname_sysfs(const char *ibdev_path, char *ifname) { diff --git a/drivers/common/mlx5/mlx5_common.h b/drivers/common/mlx5/mlx5_common.h index 6ba1e70223..1b811f2509 100644 --- a/drivers/common/mlx5/mlx5_common.h +++ b/drivers/common/mlx5/mlx5_common.h @@ -204,8 +204,34 @@ check_cqe(volatile struct mlx5_cqe *cqe, const uint16_t cqes_n, return MLX5_CQE_STATUS_SW_OWN; } +/* + * Get PCI address from sysfs of a PCI-related device. + * + * @param[in] dev_path + * The sysfs path should not point to the direct plain PCI device. + * Instead, the node "/device/" is used to access the real device. + * @param[out] pci_addr + * Parsed PCI address. + * + * @return + * - 0 on success. + * - Negative value and rte_errno is set otherwise. + */ __rte_internal int mlx5_dev_to_pci_addr(const char *dev_path, struct rte_pci_addr *pci_addr); + +/* + * Get kernel network interface name from sysfs IB device path. + * + * @param[in] ibdev_path + * The sysfs path to IB device. + * @param[out] ifname + * Interface name output of size IF_NAMESIZE. + * + * @return + * - 0 on success. + * - Negative value and rte_errno is set otherwise. + */ __rte_internal int mlx5_get_ifname_sysfs(const char *ibdev_path, char *ifname); -- 2.25.1