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 F2195A0C45; Mon, 19 Jul 2021 04:55:15 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3B30A411A2; Mon, 19 Jul 2021 04:55:03 +0200 (CEST) Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam08on2087.outbound.protection.outlook.com [40.107.101.87]) by mails.dpdk.org (Postfix) with ESMTP id 538E541191 for ; Mon, 19 Jul 2021 04:55:01 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=faZTm5hiowMn26zLQK8JRO2z2xP96DgdhykOI5OLJ4gLuNroxyhjZYRfA943I/WILa+J2xX5/vc8Oa4tb4yZ5Si8N/at4q8PS3vXfRYq1t6Pd7UfnzImktAH1Fzye3KNDEW816GI9MLUxNWJCFfVc1aOmnIR/Tw9JpuPz3N1AGzei/zlnvj+dTTdSzdlU/Mqlbm/0zw/nrdacFo//ASKrUqKqAUr95iuL53AM+HcRg4Uz+grHGHqakchnEwrGo/qPw1G/SzzKe+AfF3v194qDdCDZEFZpfdtGACqzVGSvxNOt0gPir4rwsb86QlTUBi7u6X0pfUjMVchU8bMi3cgLA== 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=FCh9S5zFEPt/bVutG4mMx8MTYc17NL0UOAGMgwM9pwo=; b=CV+dLdEW6Bj9Ldnomjlk9u71tocfyFaG6sGHYA50dz3UnlGrfc2WXAcJIjQhD3ypIDaidQ+1bikdw6e1J04vXTSBEYB7RlX0jT86e1/qT82kkRrWGq1yL39/vn3WAMQ2ux46/IgcozY/i1b8nQ3uIxjr0d6KXpmMcZMIn+P/qb7Vm7ycBP4TlkwaRR+EJGxk/uSRrU5apF07M+oXit+lugR5+udX5cQPjprrFdSYWW5pIJZlLKlrRNj/7QfAP4GwgeSAeWUKk6xwzRRWwzA6uE7mpHwDZZtBEQTJh5hNGN/qNMcuD96NRt5JVWNF3Rw8hgc3ZaHJcACqguGWHF5I2Q== 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=FCh9S5zFEPt/bVutG4mMx8MTYc17NL0UOAGMgwM9pwo=; b=kngqJ2KmC0AarSU3N0UKt0mcU0EfL40l3AXUuqGpiAAvfJsfWhYM2hd2g5dQVSLcXHeOtGl2nfXleCU7gDDJ/Y7vKwAmGS2I8wHKkHzP0qnXgMLTrMg/XEj7ZMQefR1cKBhivoIaaOHD3lUfTciQw/uPCU+0onsn/YEoKKstb1e0qm2VhdXdKKVrIsAtSkFw3A6ojvSSqtqu6h8D2n2PNI3DoEzUXX+IAhYMhqgwIBSFj3/imfqITg+mG2F0YreYNt2d2IDkmNiKonFxACBmn1GV7pnM4i/3gm/1uWcFWOoJkJRjZqgwnXK7gyhguUMapbjQh4LPcXnfO+fPER9Eaw== Received: from MW2PR16CA0047.namprd16.prod.outlook.com (2603:10b6:907:1::24) by MN2PR12MB3504.namprd12.prod.outlook.com (2603:10b6:208:d1::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.24; Mon, 19 Jul 2021 02:54:59 +0000 Received: from CO1NAM11FT048.eop-nam11.prod.protection.outlook.com (2603:10b6:907:1:cafe::60) by MW2PR16CA0047.outlook.office365.com (2603:10b6:907:1::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.24 via Frontend Transport; Mon, 19 Jul 2021 02:54:59 +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 CO1NAM11FT048.mail.protection.outlook.com (10.13.175.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4331.21 via Frontend Transport; Mon, 19 Jul 2021 02:54:59 +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; Mon, 19 Jul 2021 02:54:56 +0000 From: Xueming Li To: Viacheslav Ovsiienko CC: Thomas Monjalon , , , Matan Azrad , Shahaf Shuler Date: Mon, 19 Jul 2021 10:53:58 +0800 Message-ID: <20210719025410.15483-4-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210713131437.30170-2-xuemingl@nvidia.com> References: <20210713131437.30170-2-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: 05a2ffea-e362-4c2e-b5eb-08d94a609930 X-MS-TrafficTypeDiagnostic: MN2PR12MB3504: 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: qxuHK2zWRE8t04ect4aZSdE70R5c9QdzyecAUx0LqfS3q0MN+lfby96Ci/SxGjXkt9cNidji1JY9FcSbRm/B8RRoumsxw30dWeK5nRDlZ7YT7BP80KDnrog6hDmB9b5/WTe8E5bM30GRLTdl4u5SK9kFppmUVoEVJXYGXfOLZKdQt4o2P0/k404tEZve+AUOhkYsMvs9IAyi87KOjQyWFTMJWQfpDlG9MPj52mPED6x4vCyi6dk3NwzDyNA62eqPTIeufriCFs6w/Rg/9I+yy/sSP4EbKPbpiYuXFU2cyqWZ7ucusyvIqaom0m1iOgPH/bGfqJVSXaxYN7s78V43PEpDxM/LUI+6UcUnup5AMRVPjKfFOjwcFjjMBB3oj8qMxEwMPw4M7XtPaL94/Wlgc1Knu5eWO2OEWa7U6ZnCgpfqWPDr+NC8NZZmbAekD/BAaxHj4L9W3hNuDHiF9BlpNXEOjuWcgPLVLfUO/iHK0A0oLzxkIxcasb/QLjmxyXngSeyaOK3iiXcDf4KBmhouZWdZQHHE8Som0JLxaiOmomSzfJEBcxw2n1k9+pUihRDS1SHWfkDlIKhBxvdEi7ZgHu7HWZkU44lWdglDCt2QK1QRuyZyv8P7MZ+gZ9NBQ3sAfUgGh8CtqvP3JKIFF++BRluxkulNlEJoFFFJg3DnfFjkUSALmWRwzLtx9vP1IA64CEPo9BnmnLjSwnipxMK/gw== 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)(396003)(346002)(136003)(376002)(39860400002)(36840700001)(46966006)(426003)(37006003)(336012)(5660300002)(2616005)(316002)(70586007)(70206006)(36906005)(16526019)(186003)(83380400001)(7696005)(26005)(1076003)(82310400003)(54906003)(47076005)(8936002)(36756003)(6286002)(356005)(86362001)(4326008)(8676002)(7636003)(55016002)(82740400003)(6862004)(2906002)(478600001)(107886003)(36860700001)(6636002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2021 02:54:59.5948 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 05a2ffea-e362-4c2e-b5eb-08d94a609930 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: CO1NAM11FT048.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB3504 Subject: [dpdk-dev] [PATCH v3 03/15] 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 --- 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 a2a69ebf5e..b83fdc204d 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