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 EB415A0C45; Wed, 16 Jun 2021 06:11:23 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 93A7E4115D; Wed, 16 Jun 2021 06:10:22 +0200 (CEST) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2044.outbound.protection.outlook.com [40.107.94.44]) by mails.dpdk.org (Postfix) with ESMTP id E40A741151 for ; Wed, 16 Jun 2021 06:10:19 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kUpNTaEsqzKeJJbHiFvjiCwRakz8jWsW5SKwLcthVNFnOnmhCiskjid+pRAfuH5Lfbakka85Q15bA3T2Z8h86x6P0+/VMcxmKtjQ3bIlhm+JC9wMMrkpAn9vTiE96BzDeqOAvIRpEVHU36dkNQCVc7WKVwQ5yyakiK+HCdhfAbLnIm8G/Ak3lKxViy87Y8/kPol16Af2EkK6jwYDrwQB5Kfdp4H1DFW+Uhui95s0isNMvgnsyicxD4U6Z/ToCuhtGriWkzHUkjdrTrixysH6YT0zXbGwWXNY3Qa4ViFvnYASv1xraGnnzh8wpq7SuGvRrpGw7j3e19yizXQ45VaxUQ== 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=eRNeJHThQpWB0ldTm+e1eZLAJH1YatrtqvsoZbGh/yVuTSDfyf6G0Yr3YV9sFSGBbLuxojlHNg30X89OPsRv+KZKq1AZgD5CsP+cwxtZBy7cRj3qSR5Ghpzcjs4TqusoQMQCuz3TV9vsbIfqmu0+aYAnJFFJGyGEJvWAD6oO3y2abtFkeigK0g56b2a4yJTBUuyWp+ahoXl9I2pxuv72sD5xVmZBpQ0Z8SixVaCpyYNJtt3Uxkqko/ixavNmS5erQFaWajga+vOOSIXKFWfz7nNL4LTANqGglJse3MpZ5IP89dE54GZiR5JI7mcWWg0s97iudKMbdBRdWkNNfTPrmg== 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=JSrkwCXq9XiflmCtcnge7xkwHTXvpLxk4gOLVn2+yHD3tBWJuRv/eXm5dKF8JlP1io+H/WQBYSaP1n2J6um+qB8hq4yBT5C7fMFFQm6Hh1+Ovfhd/VLtthSk9qNMgmiACiO7i6/jQOEVAW3zR2Zef243TsFy4aykIBVZ4JbcJfMarQNkQ2mbmQOmZ/YyrCvnl3KelB4W3EWnI+zdyU2NBhihxdDyB+bSQDB5QO66URWfqaxlYltoPOMiNdDfvZW0oOKtfESN63lIPwB4zXL553qEQb6PUXnqDRImlGbLxo9i6pXW0LR9d+PXknPRczbLsA3vCOx+lwDJHmXePZUBPw== Received: from BN0PR04CA0094.namprd04.prod.outlook.com (2603:10b6:408:ec::9) by BN8PR12MB3171.namprd12.prod.outlook.com (2603:10b6:408:99::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.24; Wed, 16 Jun 2021 04:10:16 +0000 Received: from BN8NAM11FT049.eop-nam11.prod.protection.outlook.com (2603:10b6:408:ec:cafe::85) by BN0PR04CA0094.outlook.office365.com (2603:10b6:408:ec::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.20 via Frontend Transport; Wed, 16 Jun 2021 04:10:16 +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 BN8NAM11FT049.mail.protection.outlook.com (10.13.177.157) 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:10:16 +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:10:10 +0000 From: Xueming Li To: Viacheslav Ovsiienko CC: Thomas Monjalon , , , Matan Azrad Date: Wed, 16 Jun 2021 07:09:33 +0300 Message-ID: <20210616040935.311733-13-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: 37ce5800-d97b-426b-818e-08d9307ca5eb X-MS-TrafficTypeDiagnostic: BN8PR12MB3171: 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: q6uHk7zM/K6njyNfUvUhsHibgfsmt9FMZUGyOdjIqhvtX1lBclmQoj1kYaIvhL09rNrYxI8iTiN6VWMQeQS72DCMYZyUZCJzZGPJWDgvux8v541/Tx0oybJ505ubqUD4BdzCeHTcWH9nRUJIG7VDF2gmZdofHlZ6L8lZNpJemOwCMyHjr3EKAo1tom7nLcXWQ5vF3ijQpC3nPTC35XfCg909eiduB+wjlatDk4gwRCWagBXNioyjoGd4Y6ZkezfgmTGTrXfh8atqNjNVbIWKMU0sqCzYxfG+Wzu6r2kebQrD+Noj0h6pw15ThMalsJrBVD+fbTQ5esziILMe0OQ/17ruXWtdFwCjCduS86nb6rd1HkGesVEqEZeGiNLPzkBfQfQ+ug8bE979pBMJv2z9zFbD81fWBTdxfCLI78VzdfyDtYW3LB47aqvygahKxJKSxFxOpPom3e2RyRiCSxBnim3F7VMUj3tJX4wXyr+V3OdIjYhyo6CeoZY+FknD4saKx3WltHCDkAZOHHtmsh95vzQ/rjpvu8dJvcZS4dW5ayXOu54MhylDdakpz+kkzmLUObgSqvYGQ9SLL/J25UtjOGlpWfIb33low02Fl2rCeoaS402dDzEExLbB9BEUfi9xrxnyDcNxSJ/A8WYGHqjijw== 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)(376002)(346002)(396003)(39860400002)(36840700001)(46966006)(47076005)(70586007)(2616005)(7636003)(36756003)(36906005)(356005)(8936002)(6862004)(1076003)(316002)(83380400001)(2906002)(54906003)(70206006)(86362001)(82740400003)(6636002)(336012)(36860700001)(37006003)(82310400003)(8676002)(16526019)(6666004)(55016002)(7696005)(26005)(5660300002)(6286002)(478600001)(4326008)(426003)(186003)(107886003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jun 2021 04:10:16.4790 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 37ce5800-d97b-426b-818e-08d9307ca5eb 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: BN8NAM11FT049.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR12MB3171 Subject: [dpdk-dev] [PATCH v1 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