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 D1394A0C51; Tue, 13 Jul 2021 15:17:14 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 90E014129C; Tue, 13 Jul 2021 15:16:53 +0200 (CEST) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2086.outbound.protection.outlook.com [40.107.220.86]) by mails.dpdk.org (Postfix) with ESMTP id 2ED5441289 for ; Tue, 13 Jul 2021 15:16:52 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PRVNuGSWmC4TRRdoysjwsvFjYAPZiYtTaugqbnoOM+kaXtad4Ipu5g9QbgQeQ5D6gAIj+iYVgUNTKd93KQOKFaI4vDr3do8VhHfgYU8x28N35Yn1FRi37R55TbIQ0VBz1bRTVwOMXeTUL26Jn7EoApsmzv/mCCI0DM97VAQnvfbBHc65rWR0ejvuVWXIQ8ULUCO32Pk3OAyqb23rzE75rO3X+tTJ5JjbckyjxL/vDGg0APtRccbJerxs0/p9t8YAMqQRKX/32gwcZpbelPbqQGexTVgOssvt+htGTM6jizYwy2/TNYKNULJqtk77Zc1Ptpv5vDa7+wdYP9Xlfq0FbQ== 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=Um2+NIS2bsshn9iaHiqyoRJHShbG6362EEupZXupkI10Jw6CLnPJElMgvL90C9ZkKgdOHdHUoFH26pw3/ZF0cVOwy8EysWu+ldf9hwJXEXMVYMrRtyFFIG04roOicTXrCRwSA0YLxB899iiFHwHGS7FSaI8t+BMsmiGor0FMrMAIBr5kp2KjSRf2gkpC0HqlVEXJvoahQhLhgbz//5syJ00ayyTXWGlFC0FuWTuDSw5s6bHXVuI5HbJVinH6iZdk1Mx2KTNSB20xJTZEJts+TE6Ylqt39TsfhY1jrWhTtY/XUY9bWYi1nfE//aNaShZWNKRO6PBrsUDMtw7UeHoF0w== 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=iL9i+ngC/REpA8SYXQ42EDbQkof5m1JDE5Vk2wKr+Fg=; b=sXWh4SNkAy9gEe+RZ2FOQDRI4xMShdGxVTvyLNgCeKElGMWWqRPAFtdL04+YLXcpwSRa0EwzzaysnumOGKbka0mK/QaBMqo9ybhjfUBL2sIfXvBo2Tn6swaad4msRSBFj8EvLs9P2GL4mWQ4pDeaPBw9vR/6oMncDGRT92wN0jDmwF8CluLAFhq3fg08xfMvksuV/OXLVCVJFjUe5Ap5uERVcFxRKY2XYt3VHy8mxskGhE8/TDn/N/yQkra8cwMg/r0bbpvWVVf7gE5dNy4wVC4OG/HgyUQIQdlrcMEMKVmmPUfgQ6W6/QnXDyB1uquybK1ynh4O9yfwuibHlTF0qw== Received: from MW4PR03CA0052.namprd03.prod.outlook.com (2603:10b6:303:8e::27) by CY4PR1201MB0151.namprd12.prod.outlook.com (2603:10b6:910:1e::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4308.20; Tue, 13 Jul 2021 13:16:50 +0000 Received: from CO1NAM11FT023.eop-nam11.prod.protection.outlook.com (2603:10b6:303:8e:cafe::e0) by MW4PR03CA0052.outlook.office365.com (2603:10b6:303:8e::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.21 via Frontend Transport; Tue, 13 Jul 2021 13:16:50 +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 CO1NAM11FT023.mail.protection.outlook.com (10.13.175.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4308.20 via Frontend Transport; Tue, 13 Jul 2021 13:16:50 +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; Tue, 13 Jul 2021 13:16:33 +0000 From: Xueming Li To: Viacheslav Ovsiienko CC: Thomas Monjalon , , , Matan Azrad Date: Tue, 13 Jul 2021 21:14:35 +0800 Message-ID: <20210713131437.30170-13-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210616040935.311733-2-xuemingl@nvidia.com> References: <20210616040935.311733-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: HQMAIL107.nvidia.com (172.20.187.13) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8de02cfa-42db-428d-5911-08d94600798f X-MS-TrafficTypeDiagnostic: CY4PR1201MB0151: 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-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: we6n7fe9s9CBQplNIp4dGk1fc8TSe3Kchc8KZeNDfY2FOC9+RgqModUhJh44Tgmf2/F5a9DEmO1bgfO7TKZoGaWBt8tVTXMkbE7XBOBL9kME7kreIprlQWSseNEpQvSqviOEro5cpH9UZcOPBLlTNxtZ7xG4gNBq1AdFpuA9k6+/OLNsHWueDbxz9xwXqtuYt9auwjbFPfm5Jt1BwwaLXpp74KD9AKz58F+AafXMFacElnuVaBr4mN4biogjyFMNUq0TbQaxKV41WNBhm59kOs5Fcy0+IBSB4qM+esURQPOA8s9JK7K7sPzCw41oT+Nknp/8NqiAVO/pZjpOGHYuQfth9bz6+ANZ1EK/BU9YaPTpEd6AlA+NkB5PNpqkbdqL8f7Ep1BVzeQpq3CSn2CQqp9yArtH0JMdBDO/2u0BNz6sDJAm32OrsHO/28PNB06bdluaWoYXdCjHEMUoJwZUd8h31o9wtE9T85WUNEocmuIo87tTeRW3mGdMagwrC3kRRMrr0oNeiApmoWEVL8LNl6/Bd287ckIEIGwOa+YeGPDk+/GzYMfnEvXlpci3QljcDD4AQsxuAAYsRYoBooD/r5lkQbZdxZ7x+bSXDpjmnNRdoQk2pVIryZ7WCpzPW1H1ebbDm2YIbd5Mwg9rmkVplmI7SzlL8D9VDVGEsNepfeVmoOJDzPhYEgLn8tklmEoBXQjTrcR+wB0JaYRORhlILzW64GdTEXXFTt4lcY/tUJ8= 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)(39860400002)(346002)(396003)(136003)(46966006)(36840700001)(82310400003)(34020700004)(316002)(37006003)(55016002)(7696005)(1076003)(54906003)(6862004)(36906005)(478600001)(356005)(8936002)(8676002)(26005)(7636003)(2616005)(36860700001)(6636002)(4326008)(6286002)(47076005)(2906002)(82740400003)(107886003)(16526019)(426003)(86362001)(186003)(70206006)(36756003)(83380400001)(5660300002)(336012)(70586007); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2021 13:16:50.1918 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8de02cfa-42db-428d-5911-08d94600798f 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: CO1NAM11FT023.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR1201MB0151 Subject: [dpdk-dev] [PATCH v2 12/14] 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