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 12F58A0C45; Wed, 16 Jun 2021 06:10:11 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 99D03410F3; Wed, 16 Jun 2021 06:09:59 +0200 (CEST) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2084.outbound.protection.outlook.com [40.107.236.84]) by mails.dpdk.org (Postfix) with ESMTP id 75C67410ED for ; Wed, 16 Jun 2021 06:09:57 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=F8iIVybTJuZadypXiaof73cPrdadUgUeeox1WnPB1BQC4aAb/QfZpLb6xpnzTpWiYpxxptc1X3y4GSIXhLPO6UBGQChocy6F09rSaCAbnnWKkQr5oDaNYLB/J0P4jqTrLZzANPDwrbtb5vjMW1LNdPNnrMdXAkD0tSFSYbPGCy9DWMhpCnTuhhHyWAbnCw/DevYQfzDLd70d8w8H7u+j42fBB9zCyjrH0UI2bmHQCAWjjifqYPtS9Ncl+ygRnnmypABj9bvGV9aAQQyBXXDxMQr5r69OLSvRlZJgsWSHv08xxjKSQsuuqPTOSwuZrexpRKeJ9y35pU4SizaXNzhEuw== 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=ozKzWz3zVRKjuMcYkBsRPwnk5jBo3DDPZx+a4xUJMBA=; b=adnd8/9grYZYAe51Jvh7eOIUNrQvry2eH6gh7zR9A2EuFUBj5OwoFpIu9tuqH+OWu3NzXSqw4DBKVJatSGTjIbKWh5X3RwOonhqh0mj8lPOB4Y3Y0CIq7nxcZIb6i4YyaygF/Fu/Ukjmcj2HjelV//7UiZlsMZoyF7NGl3z9bvwoG+AUZofKqXd9mbQROfe7hcdDqRopuC4Kiw6Yh0fhG5Z9V1JGbEj5kK3SmVtBxCsNtqxy6AbYLnL29siU8ci1k8iltn3076y1LqtxxiHbKZqSmT+8tlxwq6fM7mLKCvArH47LTs+IZXTTZ9bLo58PkdAIFDqaTyTM4MMpuyNsPA== 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=ozKzWz3zVRKjuMcYkBsRPwnk5jBo3DDPZx+a4xUJMBA=; b=XzvM6gOZ5DKRquFErbc9NJI4fiU0zUpPYJXP6Xkr/iNKOg120dy7LH4axZV/mCO0fA7wuNrqpl1XWYWg/j8kGKbtHxTc4/osFbHGIPTtoAHrGWapRd+gBKGLJcfUN11pmQH+k/zlc2g1gtDer4c08H1HZedLhHSkSZETw2+rHfLY1dRnvK/l9lManKnjVzLkOdh32cZsplVnBE4ZKQlwb0bupTIeyoLshICrYeMxg6TAv7hdBGLsgBvlRk0HDJ6/hgHa8zqhc2nqLBH9mVxq3CuZ4McbWJZPodHKG/bxIEFvZqdUe+VQeMnXwpOKxYYKIrl4S+MAyptoZ2PTq8zlmg== Received: from DM5PR19CA0042.namprd19.prod.outlook.com (2603:10b6:3:9a::28) by BN9PR12MB5289.namprd12.prod.outlook.com (2603:10b6:408:102::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.25; Wed, 16 Jun 2021 04:09:56 +0000 Received: from DM6NAM11FT042.eop-nam11.prod.protection.outlook.com (2603:10b6:3:9a:cafe::96) by DM5PR19CA0042.outlook.office365.com (2603:10b6:3:9a::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.16 via Frontend Transport; Wed, 16 Jun 2021 04:09:56 +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 DM6NAM11FT042.mail.protection.outlook.com (10.13.173.165) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4242.16 via Frontend Transport; Wed, 16 Jun 2021 04:09:55 +0000 Received: from nvidia.com (172.20.187.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 16 Jun 2021 04:09:53 +0000 From: Xueming Li To: Viacheslav Ovsiienko CC: Thomas Monjalon , , , Matan Azrad , Shahaf Shuler Date: Wed, 16 Jun 2021 07:09:23 +0300 Message-ID: <20210616040935.311733-3-xuemingl@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210527133759.17401-2-xuemingl@nvidia.com> References: <20210527133759.17401-2-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.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: fcb7cb6b-e4e7-46c5-285b-08d9307c99a0 X-MS-TrafficTypeDiagnostic: BN9PR12MB5289: 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: g9tHvPxN5vlEmJ9xK5zzTd7edEkvl1rB5BJpZFCzAdjPBf8k47yQUT3NsLvtprBur4nk9EC1dTOiWyQNg57/EwE8C/8KuH2txtRAqug7XsCsP6AwyMwDvWzZSnfgeoHTkDWPAtdYLryjte+Wy+KOsvyIiZPabk1KPgTt5kQJuoV/0YtgFLIw5KufLKdCZDv8VSqY4+F7xy2mGujopBmkKuNzHdmf9zg2b6nDOGgBcgSlaqJf+MZfGFwozlaPeIzh2iuivMcmbybbAgioKFC2Q7ed99mEclziijaYwvWm2XySvi6ascRTCmGKTCumLTmpu9B5OdTtJp3GtZe/RXk+cr1r+5Gql+jG+D6oS1Tp4dlHC3eXlU/IDwY1MXLnaT73rwrsiFeiyGRFSaFDrFuwB7Mkzj1QWCTshShwgNi+tqJH4vssu3/IqXOt9BeK8Cc8ozEvbtLP224iUK0eg3PlsmskyJpUDR7ua670xXI3Nn8IGxlRmVOYxqkI/xA7rQdPsqKQlhDqI/tE+lbz9QTlxNGgai1zdlwR4koDhyUNNIvLxLLkplt17JAgFTnHw9d2dMrqVuRtmn11jU6ixi9EavtVVH3SrvBDQ14Ue9Hqfdtb/vln+nUVux8F/5vj51bHKTVY9lxb72SUMbjn8T0t/eiev3s+U34MK32EA4ic5JA= 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)(136003)(396003)(376002)(346002)(39860400002)(46966006)(36840700001)(316002)(5660300002)(8936002)(26005)(336012)(6862004)(478600001)(55016002)(70586007)(186003)(16526019)(2616005)(36906005)(70206006)(8676002)(6286002)(4326008)(2906002)(6666004)(107886003)(36756003)(86362001)(54906003)(7696005)(82740400003)(7636003)(426003)(6636002)(356005)(37006003)(1076003)(47076005)(82310400003)(36860700001)(83380400001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jun 2021 04:09:55.9964 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fcb7cb6b-e4e7-46c5-285b-08d9307c99a0 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: DM6NAM11FT042.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR12MB5289 Subject: [dpdk-dev] [PATCH v1 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 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 4783fa6303..c0c950f8f9 100644 --- a/drivers/common/mlx5/mlx5_common.h +++ b/drivers/common/mlx5/mlx5_common.h @@ -202,8 +202,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