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 4EBD1A0C45; Mon, 19 Jul 2021 04:56:16 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 08538411AB; Mon, 19 Jul 2021 04:56:01 +0200 (CEST) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1anam02on2070.outbound.protection.outlook.com [40.107.96.70]) by mails.dpdk.org (Postfix) with ESMTP id 5CB884119F for ; Mon, 19 Jul 2021 04:55:58 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Otonf2ez1bnfI5i8h6zCs+ox+yigw5HE0POTsTq5IQUYz80Sk7p999ohiIBKM4dXP73ok8iZTQ+gVXZwRu9xs4AHckidEUjkBPF2Ttc6GwJ/eXdOj6OxzwFJuCxmGuQjr8v+5iJakYxgC9Ztt2YVEmXxyD7HW4mZTx6U/2ZaTnk5uoVOFON8b6vSxHWf2TieDHn9I/rv0hY5hp4Q88nfp2ci3Qc3jsMxl0TXpngqrLiiJmsIRhiwTdIq98ZcpTQ0tYUjU1cnaRdh5zpWHBWxBoZGYo91nKKZ95Agyl5eOWjiaP7ICkbg1dS60AW/YQjszQ6CobA7acHIzkkigsLE9A== 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=iL9i+ngC/REpA8SYXQ42EDbQkof5m1JDE5Vk2wKr+Fg=; b=Pc8bwJ3pYj7Nuuuovb2UtgcF+aGLItw4leBmtUKJVaFISgoLYc7dVyKMZEoWbNe0LYOQKcXJPvbjP4O1750AJAtc8WmQbLmgyozceWQhOduA2LigVkTcgrMXvc17qb2EjdnvqnmOjGPRWgRhdnCJhofJsQtPh7uT6Y84KHZGupVpnomITBGlQc8d7t/88uevdC9JGb8zBj0UeRZE61qrH+Nn4xMvFQNIxZI5HbBoGpvtpoxq5xTKObnGEPIcqVXYvTWdij1cqHbPbmd58n2Nirqn3gptE4h6rV7X8fCDMOMmD6iO5xcMdp9qIEFJ252T6RknQ+5i4Bya05NoV6gNrQ== 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=iL9i+ngC/REpA8SYXQ42EDbQkof5m1JDE5Vk2wKr+Fg=; b=h1xhwOJbQ+91EnngD69O6h6ZY9dwWSK9BNZDJDDAJD2qndSFzsqKJKL0btQqo+pb2+dSIC1ZF894b7o/gonj7CqwSopISdbIxJS8qw0JtBHBSfuvZOiGH+bQt0w9BPkz9IwFfhN/EcfVL/M7TCDgYrErE2wYeu6/l1VpEGNG3psvQNN7SqQLh65lK685AXSBWIwIsazOJAgb58pK4O3qss5o7W+ArsqiZ69r8sP87+O7xHekyEzujomzX0aGSo2SVjJySKhwv4p53sks80Kg47q8rpQ+w3UIGqWyXEYVuxs3HyTlO7Un6N9N2+/KJUOFpbxw5Wf4qHFRoyDW3mtl5w== Received: from MWHPR19CA0004.namprd19.prod.outlook.com (2603:10b6:300:d4::14) by CY4PR1201MB0216.namprd12.prod.outlook.com (2603:10b6:910:18::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.22; Mon, 19 Jul 2021 02:55:56 +0000 Received: from CO1NAM11FT032.eop-nam11.prod.protection.outlook.com (2603:10b6:300:d4:cafe::78) by MWHPR19CA0004.outlook.office365.com (2603:10b6:300:d4::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.21 via Frontend Transport; Mon, 19 Jul 2021 02:55: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 CO1NAM11FT032.mail.protection.outlook.com (10.13.174.218) 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:55:56 +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:55:54 +0000 From: Xueming Li To: Viacheslav Ovsiienko CC: Thomas Monjalon , , , Matan Azrad Date: Mon, 19 Jul 2021 10:54:08 +0800 Message-ID: <20210719025410.15483-14-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: caa09a5d-39ea-4db9-71ab-08d94a60bb3a X-MS-TrafficTypeDiagnostic: CY4PR1201MB0216: X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:565; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WJuhfajePOUfTkqwhmUNb20amG5JyZLgGHv5qWcSdWDTDUu79fI+n8oowhbH7kXiIywhdLCJrwBgpy8grAQT2iKI77ms004yos1XspWbJjmFmKA+RyIRHwcosUq4FZuqKHRgCPbVGRD1hULiFG5Q9qM+ziJRtSjH1zgvfLz7nCfePral9cOm0MQSO2iLrq+cPKRXizOruF4YEX/5yplkCwElZi8I7vwLMoS6dho9Fi/urif6LULu1rxL2hYmRpAWHLp7KDsX5830mDJYOcxmE3C9Dsj1qQUHIIjS36spMZu/JzSoZswXcCHrFd6QjOqJmGnLMl+gR+D9Eqmkk6gqx1RIoru6JJRaFMJCOQARd8+Dm2IzY96q+CejgXgweic8RQ2Ru8zkGZHm5TMU1lzW4Nv3nYe2Rvyy/NloouX88lt/esHh5l3NhcIfUd/Hm7Kpvhy/avHlsAPWJsVJnQZzbKJ8GrSlLqhC6yC9Vvd7UF3v2t1oeS3I7S7klG08fn2t2OqqmOxXMLNSnNkQhOZG4THcW7SvxMhPNFYsgdEpnT9e9rkZ222xph7Ty4udtiqFT0ye5Rp8PEnLKgRr9ttiL7SKJGMf8pWPKpNbACFrk03M97QuK26Ccu5BZkCyE59nuhetKIuYOMefDb3yGGNG3xUgxbHdReHpPe1sYvHzmghkIMbpfXsYxNipQ/QpNHIdd+kHcpTvxIJ8RUa7dGrTeA== 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)(36840700001)(46966006)(36756003)(70586007)(54906003)(186003)(16526019)(6862004)(508600001)(83380400001)(36906005)(356005)(70206006)(107886003)(26005)(426003)(336012)(2616005)(5660300002)(4326008)(8936002)(7696005)(6286002)(86362001)(1076003)(55016002)(82310400003)(6636002)(36860700001)(37006003)(316002)(2906002)(6666004)(7636003)(8676002)(47076005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2021 02:55:56.7061 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: caa09a5d-39ea-4db9-71ab-08d94a60bb3a 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: CO1NAM11FT032.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR1201MB0216 Subject: [dpdk-dev] [PATCH v3 13/15] vdpa/mlx5: support SubFunction 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 Supports SubFunction on auxiliary bus. SF probe devargs: auxiliary:mlx5_core.sf.,class=vdpa Signed-off-by: Thomas Monjalon --- doc/guides/vdpadevs/mlx5.rst | 10 ++++++++++ drivers/vdpa/mlx5/mlx5_vdpa.c | 8 ++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/doc/guides/vdpadevs/mlx5.rst b/doc/guides/vdpadevs/mlx5.rst index 9b2f9f12c7..e81dbd0004 100644 --- a/doc/guides/vdpadevs/mlx5.rst +++ b/doc/guides/vdpadevs/mlx5.rst @@ -162,6 +162,16 @@ Driver options - 0, HW default. +Devargs example +^^^^^^^^^^^^^^^ + +- PCI devargs: + + -a 0000:03:00.2,class=vdpa + +- Auxiliary devargs: + + -a auxiliary:mlx5_core.sf.2,class=vdpa Error handling ^^^^^^^^^^^^^^ diff --git a/drivers/vdpa/mlx5/mlx5_vdpa.c b/drivers/vdpa/mlx5/mlx5_vdpa.c index 9c9a552ba0..6d17d7a6f3 100644 --- a/drivers/vdpa/mlx5/mlx5_vdpa.c +++ b/drivers/vdpa/mlx5/mlx5_vdpa.c @@ -553,9 +553,13 @@ mlx5_vdpa_sys_roce_disable(const char *addr) static int mlx5_vdpa_roce_disable(struct rte_device *dev) { + char pci_addr[PCI_PRI_STR_SIZE] = { 0 }; + + if (mlx5_dev_to_pci_str(dev, pci_addr, sizeof(pci_addr)) < 0) + return -rte_errno; /* Firstly try to disable ROCE by Netlink and fallback to sysfs. */ - if (mlx5_vdpa_nl_roce_disable(dev->name) != 0 && - mlx5_vdpa_sys_roce_disable(dev->name) != 0) + if (mlx5_vdpa_nl_roce_disable(pci_addr) != 0 && + mlx5_vdpa_sys_roce_disable(pci_addr) != 0) return -rte_errno; return 0; } -- 2.25.1