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 23932A0548; Thu, 27 May 2021 15:39:09 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0E67A4110F; Thu, 27 May 2021 15:38:59 +0200 (CEST) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2070.outbound.protection.outlook.com [40.107.220.70]) by mails.dpdk.org (Postfix) with ESMTP id A32DE410F9 for ; Thu, 27 May 2021 15:38:56 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Bc1bJyAg9KgdFBKeV0Bdqgwpw3fuxP3PU3SAHGf3WKa/Ar4rdvVK6lEW2XCHBpoelxD8z02R++kBftZ4Pbv1Kr0CntNsS2yLVCbUKR4wfcVpTU4UvT56R4+HlU9OxaDtZQ9wuuTAIBch8C81K5dtqCjz4shjqLdCXhmg9TmIz32gJWRcVZachfHXRkjnV+7b5frtC+IF+8qlVm91tBFLFRTP/niM2xajsIg7KJqKRLKHhdOnWyoNqxxsb4Di4RxVpEAtv1QhkGz3ljdVmdsRDiX0iM+6Wdm1CmfcTNRV/RsMs2M5ElB7J2BshJ2eEHjaEs/hNqiTURVceUsx2OeiTg== 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=geuzaiPLSwWztewXrfbHVLKXwLV81veeSz22ZuWlIVI=; b=h6lho5vCtFHztIfWZHIgMeWd/TauvCfi6wQRVv4mlVfq9mV/miGJuuC0zKbHsu3/uovD4lAf1j6YDKfqAMMDXBV+L8jXVK5s1PpG8c1HqJk+WjqI4EvrjPSwnbmi3dalZmnqmJUgIVV54LkxsqTm4ENNyjKX7gsgnsH4MqWz8dhFHqrt9HsWfPRA0n5iuJz7yaDODLC6tTr4dylr0gNXlbxGAhVZX3LeM77LQR6VxK5H4H9k5eso52H4t8eeVOtYKJ2b8stmHL72hZWVLxYV0XKzhPxOt7dpyAI8z5HesJM1YC/E1fvaGvZKOZ2fbDtaurFVEobZNjzUMs+LYjgFuQ== 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=none 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=geuzaiPLSwWztewXrfbHVLKXwLV81veeSz22ZuWlIVI=; b=DPzt2vGXwYpjEdcvHcka8eh97WJRI4fcCSK9MHv9JzMTwT7Mei/3ySe09xc8XNZlOWflPYReGkLFL4EEGx43G+1nWBC0kFMveZk0gxMfe5Guh+V6owZtDF18ZZsPtoLKo8ttnStjCyQSzVkADPQwJ5ToGqU2IKP7pYi2rzFU/OrpMaGmfBpf27uydOMOIj6eEBvtfEhe14fi8/Oc8F4xF533JDa9r7Tgwvl5k2V9mDYMjkROhwbSn4gNnw/jsFqQQD7v6ZcJ+ExIxc9iRRXLIKWE2jqGcCivlyLdn7/orVYwBDYnSLHxmFIh/AB3ySxI9HNDfDeT9pcyru7pRVK/iw== Received: from CO2PR05CA0058.namprd05.prod.outlook.com (2603:10b6:102:2::26) by BL1PR12MB5144.namprd12.prod.outlook.com (2603:10b6:208:316::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4173.20; Thu, 27 May 2021 13:38:55 +0000 Received: from CO1NAM11FT063.eop-nam11.prod.protection.outlook.com (2603:10b6:102:2:cafe::8a) by CO2PR05CA0058.outlook.office365.com (2603:10b6:102:2::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.9 via Frontend Transport; Thu, 27 May 2021 13:38:55 +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 CO1NAM11FT063.mail.protection.outlook.com (10.13.175.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4150.30 via Frontend Transport; Thu, 27 May 2021 13:38:54 +0000 Received: from nvidia.com (172.20.145.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 27 May 2021 13:38:52 +0000 From: Xueming Li To: Viacheslav Ovsiienko CC: Thomas Monjalon , , , Matan Azrad , Shahaf Shuler Date: Thu, 27 May 2021 16:37:47 +0300 Message-ID: <20210527133759.17401-3-xuemingl@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210527133759.17401-1-xuemingl@nvidia.com> References: <20210527133759.17401-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.145.6] X-ClientProxiedBy: HQMAIL111.nvidia.com (172.20.187.18) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e06cc344-b2a2-4a2f-7d7c-08d92114c5b4 X-MS-TrafficTypeDiagnostic: BL1PR12MB5144: 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-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /EZYA2GduTjZ7rAoBpeqJrv8te4ZyPAeqs+x56gl5EXNTK6l97riXgkAhFmSFuhHsHQMl5hteah3kkRFfl23qLWXwDsENSTBTyzgFhJuIEcck8CK56hqbp6q07Hs8tszXo0dmvVBiu42AKDBic60r7QiDtDszwu6UDQh4P12ZHNas8+OhF4LSIjmUPfkvk/2I48EkOScDulWulYFExakNL6AShhrVH6E23GXcuxL0AUEEZxbO0UCA2PaEEZScP1y7HZAVxtveRsJrnD2wefMFhUQwnuDRDkjyAeeseE4B05KnHer4zBTMsGE4m3c5F4h+v9hcV6TU7nue7Y1D0wfchg+3BNjgzMYRoaLGESxavdTCnxQTQlbgtXvPjTffT30GEsId4P2ZII1OUl8/MsDDmzOu1nZh8ZjAHWSsGXOfHCF4p+RX4s4wDtdRkxoYz6MxC82Hp93snL06ecQmjf2ZUJiVC2jcjHac2N8fFB0akOzklg+qy/524pvIlh1pp4r2Mkj/SvkYcZ7dLRssPPTutQrQwBIOTeLjcxjV05UiRzb2qU6A3BVtaKCaZ4A/n34qbR+nC+6p1xp0g0J22wp08Zy2xgfmLXxW9mY0rp77VEytEeSZfOUGDME6pEFv00xrl5+QFhh1FgsVBlwje9MwNLK6mQfblXPLn8PCbb9/9c= 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)(346002)(136003)(39860400002)(396003)(376002)(46966006)(36840700001)(6636002)(478600001)(8936002)(82310400003)(8676002)(6862004)(36860700001)(55016002)(36906005)(83380400001)(5660300002)(426003)(7696005)(336012)(1076003)(82740400003)(86362001)(7636003)(54906003)(70206006)(26005)(356005)(2906002)(6286002)(36756003)(107886003)(6666004)(316002)(37006003)(2616005)(186003)(47076005)(16526019)(4326008)(70586007); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 May 2021 13:38:54.8609 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e06cc344-b2a2-4a2f-7d7c-08d92114c5b4 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: CO1NAM11FT063.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5144 Subject: [dpdk-dev] [RFC 02/14] 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 explicited: the node /device must exist in the provided sysfs path. Signed-off-by: Thomas Monjalon --- 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 ea0b71e425..ea6001e6b2 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 0e67a36d0c..62a0dc4bad 100644 --- a/drivers/common/mlx5/mlx5_common.h +++ b/drivers/common/mlx5/mlx5_common.h @@ -208,8 +208,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