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 4BA92A0C52; Wed, 21 Jul 2021 16:40:02 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 81E0E41153; Wed, 21 Jul 2021 16:39:36 +0200 (CEST) Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam08on2077.outbound.protection.outlook.com [40.107.100.77]) by mails.dpdk.org (Postfix) with ESMTP id 26A5F41120 for ; Wed, 21 Jul 2021 16:39:35 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oH8DEoZnEOCqmqA6mTGOupIUV2VNobknOUGMPt/YHsOafuklZ9A/rxCeaqhhudurQv+cdR2gEHdBGzyH8SC/XEFv1zEyb9jreYRZEfBiffJ3/z1jyjqpBtP8VDzJH/px8az6KmzLZGfC18SjUZKJHALE4n09llUbXAoDasMvd7ChLZj4iDrsZpKQBmK6RSdFp6zu7ZHjlSF9HVRj5uMT9Cvt042HMsghGkZVdjixUvTde8J2FR++1LWVezdNGtTy7JqM6VUwI2c5MQjoAIIZ7IDbqLUDcOylRXiwJSNsHaRZ5WU5eAXRk4pNrI9muHOh+GiKmhZgLlrusmXSPm772A== 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=1cbfXDhn2HIAmQnVJZOhmDE92rUwWIoEL1zGkoAe0M0=; b=HEpBTQHYQ8En1BZC7mD9tGWHnlqXRHYFydDguUQEz72Z+jgPuhy9RQ1gVTtDxmg4U8MM1Og1aymK5dW8kj1llt0AkmPgqO2sWr3WshRkJdDTMPCPNgqnx4AxoX8tCqDpMqeVyiTJlF44TQ0LlWR5fes/01rJQZoJJTfb+f9i22bw0bLTjbfVN+b9NhroZfEoH+Q0OocLI4Iz8bxuLCqD+FUY9fVgS0Hi+FbkiWiwnUEZNTC7yWSBVIPYJ/sYWiUWv57eQG+Mj8fKnfR6YE6iMZ7UR5JQ0DUKVHLs9F6fyQGM147N111heom+9hbnjqU+UZDc0rRl8U2h2tfvLXSfsw== 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=1cbfXDhn2HIAmQnVJZOhmDE92rUwWIoEL1zGkoAe0M0=; b=kQOAP0KPffCFGP7FSEeyu4TKlEwFTkTumvIv93S+AfAPl+uIK9Iha9W6rzdv9BR5VNPHaSVs6kMZ4p1R0UQnh3+CEci/eBl7nD3gLWgorOHaBNUUkGkPnE6OSxp2wES3eC5eCvlY7UyRhXtCCjpckFbWGH/7+jhKLLPNj2Lrt3CTpxMESaP0jDXklif6Y4gSFQTH8bkQiH/LCz5a0rYqoj8GhEAco1PMSdt3vTc6qJv3FEDx5JKEApz79aaJGABJb03xPd00y+7evtxdeWYrxzV9D0Io0aq/ve5wKxwyNqtn+fWvznegiUyDuUYz6AAVA5nyTRmi08WHnoMajvaCZg== Received: from BN9PR03CA0217.namprd03.prod.outlook.com (2603:10b6:408:f8::12) by DM5PR1201MB0090.namprd12.prod.outlook.com (2603:10b6:4:53::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.22; Wed, 21 Jul 2021 14:39:33 +0000 Received: from BN8NAM11FT060.eop-nam11.prod.protection.outlook.com (2603:10b6:408:f8:cafe::c1) by BN9PR03CA0217.outlook.office365.com (2603:10b6:408:f8::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.21 via Frontend Transport; Wed, 21 Jul 2021 14:39:33 +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 BN8NAM11FT060.mail.protection.outlook.com (10.13.177.211) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4352.24 via Frontend Transport; Wed, 21 Jul 2021 14:39:33 +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, 21 Jul 2021 14:39:31 +0000 From: Xueming Li To: Viacheslav Ovsiienko CC: Thomas Monjalon , , , Matan Azrad Date: Wed, 21 Jul 2021 22:37:40 +0800 Message-ID: <20210721143743.24626-14-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210721143743.24626-1-xuemingl@nvidia.com> References: <20210616040935.311733-1-xuemingl@nvidia.com> <20210721143743.24626-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.6] 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: 40960335-de23-4202-78ed-08d94c555b65 X-MS-TrafficTypeDiagnostic: DM5PR1201MB0090: 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: Z1IgaKrYRdGn2ZhHlh2ie+NUUyzdmzc0HJ43DRADVoUIXu2PrwpuHJW9ut4rDPiwx/uqxMUQ2ywTg004PA/hN2Rym+twi1HSwqNQ2xkfysTkIGwowDpDdQbL1iPeGqdTbcAF4E5bCbcICIUUH+IImFdO7kIkABqnD4RhjWy5noWyJ6HJ4rAwewAX+j1Br/Z2YCiRtMb6JZJMAE8eXfp4gojSApAtASWjKr5C0rUQ7TiejpRfrqsxAGggMGDvIiRI3Uan1Ze2CB8qBs9HL4PsM7X4KwbFHbkFaQBEJObVHeHw/lR1DcAijMmeq3xFHlYStHlMZN1uH7papCYgOIEBtckj52M7qiZlAI3bMb8ZAQMsXL9yG6+iYf9B5ZuPbU+nFpzK0inVV6yRHlCBnxB+jO8kqDgY121DdTwonCoZYZ7FLL491AUm/6CKaGtpj7A0JsJQNdkUA7bIuiQ3q+58EmGTMxqS3t1x3+u1YZW+gENoulwNrz19OUVjLydjnfB74wNlDJktbdz6wW3dPXiDSrNkIsFu3Hxop1JmvrOfYDbo+gEqGJ3QKrG/llwBPRJe7OlVAJP/C3scyPy7EEWaRwdvcIXaNLfzXQJa7dX5ak+rEWVH/iQs5/3q7fXEdrkoJegdz2ZvJqgnZS/w89+yFhM+Qzr9NHsem69Np0FGTgM4LSoTV2UBI+/58DZ4SEeAMOu1NrCZs2EFMDWj/R+Bog== 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)(46966006)(36840700001)(2616005)(6666004)(86362001)(16526019)(336012)(426003)(70206006)(186003)(54906003)(70586007)(508600001)(8936002)(8676002)(7636003)(356005)(36756003)(6286002)(36860700001)(36906005)(55016002)(26005)(83380400001)(2906002)(316002)(7696005)(47076005)(107886003)(6862004)(4326008)(5660300002)(6636002)(1076003)(82310400003)(37006003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2021 14:39:33.7424 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 40960335-de23-4202-78ed-08d94c555b65 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: BN8NAM11FT060.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR1201MB0090 Subject: [dpdk-dev] [PATCH v4 13/16] 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 Acked-by: Viacheslav Ovsiienko --- 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