From patchwork Wed Mar 2 06:54:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eli Cohen X-Patchwork-Id: 12765557 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 71DDDC433F5 for ; Wed, 2 Mar 2022 06:56:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239783AbiCBG5F (ORCPT ); Wed, 2 Mar 2022 01:57:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239778AbiCBG5E (ORCPT ); Wed, 2 Mar 2022 01:57:04 -0500 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1anam02on2056.outbound.protection.outlook.com [40.107.96.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 45ACDB16D5 for ; Tue, 1 Mar 2022 22:56:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=U/GLelKxIjg/yhi8sDTAO8wukTk8p+dyR7IU+8KBt0Wcl1T/zk/I0SBaGL3u/f5McRxuTspjaZ84oPDiL0xsFHKp+IKuscHfBs2DUnM8E05GEpsqN2lob8BkmU1PVoT7w7UzM+vcJ2OomAXUBxsMbX1A/sn1LatQ5ae7j706dSNqJX5kjfiBg4DjExCd87ZdVFwCHwmLU9sKqGF5HM/XPIpzWc5VMPwkL2DYiedJ9N50Bpgkn/8Vujh85LdBHxv2p/COqbaJxemsu0k5LqYqP3njZhoO+1leWUo1kH2uNTYROw18e0yCZBsGCtPwUz/QT8mZZgFuuZUnehZgXOeTAA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=W4i2wM42sRbk7uM+bRoMb0tmUy1kZxWcl/SClPkAcEU=; b=ZGHUHJTPTY0253U8/vZAAMnJyCwgUFsZE/jjp66UT8jSs0q2k+xBin3vy6ZcXWMpCseiiRWGN9v0euI7G+GqHLIdZmD2S4GEEwKkU/IOpzQPB1BjRhT92UL8XWykNA8BMZ7W/S03CMYieO6dLfSNVyCyGHMJLau8HBwpV5imYuJyX8rE431IKn4bRBsgXg7qC4nxvXCYTLdRYC0Gv1mM7Niodv9QWQY0V6ij5fuf0tV4iIkJMWIBBn6aENWrybYJA2gx1Q9wRNBuXG3T4Cl+jMsmI4skRhJoBFWllNCAxlqIn5d8lj2VFSb6ChB7XaXKrIiaXEtM9Y7edQ4Y90aEOg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.235) smtp.rcpttodomain=redhat.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject 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=W4i2wM42sRbk7uM+bRoMb0tmUy1kZxWcl/SClPkAcEU=; b=UHFQ0Djme02PtRQNy+9QMOUjyTkHM5su9Mx0XmtpG2GTREv9r3CmWo09L+PMJD/gbbqOT44r9mY4tcYYrow7CK16xPbRBAcqWYcOJJUyljiucp5VbfN7RHMwvdTvG3S/7vv34rI9g6y0wH+o014SEFaghK1hWP5QfuAzzOjhDqmuSCROSCpe1TrnYK2dX2Xk1c/0cG9E5+iawo3cPcpS3xLjSS6cxY6XTvLaywJQiEXZxeC8H4Qff9HwU//oH48adt1lPAdfTYUSYuHCnmQ9/lG+Iq5mJ7Mr8GrzWBh/jvdj5yOKG3vb0753geWxwwJJV1TdjyYhyyw5HqRFbZGJWQ== Received: from BN6PR14CA0005.namprd14.prod.outlook.com (2603:10b6:404:79::15) by BN6PR12MB1345.namprd12.prod.outlook.com (2603:10b6:404:18::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5017.26; Wed, 2 Mar 2022 06:56:20 +0000 Received: from BN8NAM11FT047.eop-nam11.prod.protection.outlook.com (2603:10b6:404:79:cafe::b0) by BN6PR14CA0005.outlook.office365.com (2603:10b6:404:79::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5038.14 via Frontend Transport; Wed, 2 Mar 2022 06:56:20 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.235) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 12.22.5.235 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.235; helo=mail.nvidia.com; Received: from mail.nvidia.com (12.22.5.235) by BN8NAM11FT047.mail.protection.outlook.com (10.13.177.220) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5038.14 via Frontend Transport; Wed, 2 Mar 2022 06:56:19 +0000 Received: from rnnvmail202.nvidia.com (10.129.68.7) by DRHQMAIL107.nvidia.com (10.27.9.16) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 2 Mar 2022 06:55:29 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by rnnvmail202.nvidia.com (10.129.68.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.9; Tue, 1 Mar 2022 22:55:28 -0800 Received: from vdi.nvidia.com (10.127.8.13) by mail.nvidia.com (10.129.68.8) with Microsoft SMTP Server id 15.2.986.9 via Frontend Transport; Tue, 1 Mar 2022 22:55:26 -0800 From: Eli Cohen To: , , CC: , , , , , Eli Cohen , Jianbo Liu Subject: [PATCH v4 1/4] vdpa: Remove unsupported command line option Date: Wed, 2 Mar 2022 08:54:41 +0200 Message-ID: <20220302065444.138615-2-elic@nvidia.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220302065444.138615-1-elic@nvidia.com> References: <20220302065444.138615-1-elic@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 62da41f8-0e74-45d6-d2f3-08d9fc19c172 X-MS-TrafficTypeDiagnostic: BN6PR12MB1345:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: dbv7M3sXHMVn6NfkoSwalFpxulZT2+QtPF7vS//g/qCcp8Z8K9jN/NQyounGLc/abY6Wc4JlWmEp7CURW2NzwyCJSr88qJu2kZgmUtGs5mXnLkCL6/sTB2TR01zvYYp5bA7O+2+hv7RGTknD4j618zB4yy0NspRG6wZVKhtI9jK7IOGpNj2InKVVYT63xszo9tSD4+Z5PAON4OOIebEEjCaSiDfqJ1jFaHThefwy3ExR9ZLxvGhcVhW3ZM2GYRHAXcrWIzxvGISdjx+x5IK/hrMlAIKVayPGnN+ZJpun1ggXabw17nDLEfwILN8TBuL3sO2JihuD0EehYMJeU4fwyVsQ/M/OWNKKaB/3walrnBvKYNVLeqctLiTUvX06yEQJ7RCYy0cP7UCR9e/uxKqS/7jIgEJWAHFZqbL4m4hfilLipv+m7ujdRKik32Idsllvabo5yxYX8I8IvYyinEmWWtFuo/w6oGSEprOT13UDbJ8hMK9ox7unNGJtqG1ghun3t0whuHMqBlC6zmBKQPLjf0kpa+YCNucJOl0PVlQzo3vwcEbyY5zwI0ewD//vagGalv0/b81fXaGCYP9AfJPfIXUDh/w70uL/0nQE6iAmdNsQBAY7DRP3/rHlCmn4A+YB/+tQu7R/kT1bLUVQpcBfYJNu0VQAaqyYQmDATzEuJuVIUGj7kpzwaNgYGmrKx5OM0+CfIPb84SX0SmO2U7prqQ== X-Forefront-Antispam-Report: CIP:12.22.5.235;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:mail.nvidia.com;PTR:InfoNoRecords;CAT:NONE;SFS:(13230001)(4636009)(36840700001)(40470700004)(46966006)(36756003)(81166007)(356005)(316002)(2906002)(36860700001)(8936002)(4744005)(40460700003)(5660300002)(47076005)(83380400001)(336012)(2616005)(426003)(508600001)(110136005)(4326008)(70586007)(26005)(6666004)(186003)(86362001)(8676002)(7696005)(70206006)(107886003)(54906003)(1076003)(82310400004)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Mar 2022 06:56:19.7983 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 62da41f8-0e74-45d6-d2f3-08d9fc19c172 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[12.22.5.235];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT047.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1345 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org "-v[erbose]" option is not supported. Remove it. Reviewed-by: Jianbo Liu Reviewed-by: Si-Wei Liu Acked-by: Jason Wang Signed-off-by: Eli Cohen Reviewed-by: Parav Pandit --- vdpa/vdpa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vdpa/vdpa.c b/vdpa/vdpa.c index f048e470c929..4ccb564872a0 100644 --- a/vdpa/vdpa.c +++ b/vdpa/vdpa.c @@ -711,7 +711,7 @@ static void help(void) fprintf(stderr, "Usage: vdpa [ OPTIONS ] OBJECT { COMMAND | help }\n" "where OBJECT := { mgmtdev | dev }\n" - " OPTIONS := { -V[ersion] | -n[o-nice-names] | -j[son] | -p[retty] | -v[erbose] }\n"); + " OPTIONS := { -V[ersion] | -n[o-nice-names] | -j[son] | -p[retty] }\n"); } static int vdpa_cmd(struct vdpa *vdpa, int argc, char **argv) From patchwork Wed Mar 2 06:54:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eli Cohen X-Patchwork-Id: 12765555 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B61C9C433EF for ; Wed, 2 Mar 2022 06:55:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239755AbiCBG4U (ORCPT ); Wed, 2 Mar 2022 01:56:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239478AbiCBG4S (ORCPT ); Wed, 2 Mar 2022 01:56:18 -0500 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2047.outbound.protection.outlook.com [40.107.236.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3FC73B2E28 for ; Tue, 1 Mar 2022 22:55:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oNTMMUYusHNc/Eu8OLRUW3GSVFG7UX8o8GRgJCl90DTQ24qUc1CEgFjN8nt2HEYi7DU9yyl/kqsu3RTZGzXncr/wENAKzycqFDIAAxLG8JL5YdS27g1Kp+QuQDByO1zhSQr95DWJrTEigC78bdiciTkTcZ+urX/BGoSwSJXb3Xl5WuaLw+WFhHzjXXyyELtjOR/ij9YluDTn1LrytTOW1ack1B6z6uckuQ7kJMOj4daaB6ZMxj8RwqfR7B0jgcTosN3wLxvubwuuhMFLBZJyFsrOX7ipPL71LWBnoUn1jDvucAc8rpKbgyfR/p6iXREiGIJqM+oA1IQMMXt1MMNvFA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=RawkQa0mj6SlpfKIO3QgQxIcaj+O0L1+XWuGmmQRusM=; b=K9xPsXfJQ5vClsUo7KPawF0pf9ejVYoZkg9XwgW7P6C5jNnjRAkSb7oscwdbX4VW5a8xAw1AbUrapZvibOvRix7DiPhAuaRRVdoh04322fm+uwCd3B5Uh6FDAJdAkQovPmacXUXf2vTYqol26MWd45irtwvxDutJjM4XHH/wCpl8HhwKsJyFXAIw3OF0rrR2U+aoeYvgpEcFDC1TA7wBlh0kUg8RRhunXWKwxo4wu56eBBcdUqd674Fii8fg/uIX/2V3zlTQmonjRZ5I/Ys2Nm9ui4AHVN49WIDBJ2t+E4Y3F+xIqSJSOA+me1pn5ww9PLw9Q+EcCCg6ebRwUHsUpg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.234) smtp.rcpttodomain=redhat.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject 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=RawkQa0mj6SlpfKIO3QgQxIcaj+O0L1+XWuGmmQRusM=; b=QcGO/3nVdlND6KQjr957fsQjh5VXKu34XVLnJeA+WzvP3Vt3DyP3Hqf/v/b6JmqGwQ1YWvHanYykspgtUA/ESgBwecEVx8qH4PZdCMkMd2ZDtvN9lv1DK8+h4so9mGW3Xw2Bp+0hk8D4DoURZyTledgOKm4e5USx5dhF1ncvk7oIlQrn2lgPCVrrXB4tI1t3yLmPo2/O9H3mag+t1LUlNRe0OvF4iVlNrTd4uI9T2DjysfvcSimKTHiB7/1GGDpDUeWeZSzm/yxZnt43aTIQ02rqHlfI9fDcOLb7VvxpZjTslVtUO0r05XeYxykGMMNete8LUlQlnrSJNWk5UEvX3A== Received: from DM5PR06CA0031.namprd06.prod.outlook.com (2603:10b6:3:5d::17) by DM4PR12MB5245.namprd12.prod.outlook.com (2603:10b6:5:398::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5017.23; Wed, 2 Mar 2022 06:55:32 +0000 Received: from DM6NAM11FT013.eop-nam11.prod.protection.outlook.com (2603:10b6:3:5d:cafe::60) by DM5PR06CA0031.outlook.office365.com (2603:10b6:3:5d::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5038.14 via Frontend Transport; Wed, 2 Mar 2022 06:55:32 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.234) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 12.22.5.234 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.234; helo=mail.nvidia.com; Received: from mail.nvidia.com (12.22.5.234) by DM6NAM11FT013.mail.protection.outlook.com (10.13.173.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5038.14 via Frontend Transport; Wed, 2 Mar 2022 06:55:32 +0000 Received: from rnnvmail204.nvidia.com (10.129.68.6) by DRHQMAIL101.nvidia.com (10.27.9.10) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 2 Mar 2022 06:55:32 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by rnnvmail204.nvidia.com (10.129.68.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.9; Tue, 1 Mar 2022 22:55:31 -0800 Received: from vdi.nvidia.com (10.127.8.13) by mail.nvidia.com (10.129.68.8) with Microsoft SMTP Server id 15.2.986.9 via Frontend Transport; Tue, 1 Mar 2022 22:55:29 -0800 From: Eli Cohen To: , , CC: , , , , , Eli Cohen Subject: [PATCH v4 2/4] vdpa: Allow for printing negotiated features of a device Date: Wed, 2 Mar 2022 08:54:42 +0200 Message-ID: <20220302065444.138615-3-elic@nvidia.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220302065444.138615-1-elic@nvidia.com> References: <20220302065444.138615-1-elic@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e69ebd6d-9b5b-4fc0-9dbd-08d9fc19a55b X-MS-TrafficTypeDiagnostic: DM4PR12MB5245:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tWWYomRuWGQB0bztIQjCp7zwaw3sHxHbDOQMHb/snZk0sI0XJYtUH5r6nxhLBH6wLxGiAom6ahboh3b0JbQne3cDJ1MTl5Vytod3zzGB18SvTktzciRreDScaYCU6tvnLcR5gKDHvVeICor7FAo37h51yjNCOs/EFxwvuGTzQc0WE9+VEdJQsaqAZVVxhUbksPafE26z3kYkzYvfa8wG8LWBClweHkUwt9ul7pVhkifaplAMlrlgWbiYsblXx48p57SIi+L25azT3v8IJ/53+bVW1JGS8bT0C6BtWx+Cc5ubYOSZrKhlmWRlHgnctp2cNT+HvY35fA8DlVR+VPJJm80lwcG+/pHIkBqiTaG6tqVQRcdKrXz2Y+zW300k4FUUpgQGTZgqVRWeypUgCXRCe+S+wK7+B043PJXHxreLnYA9bZCA8reapAP1+nGu52CD1SioAGiYQaWNp29Bsbo+YfxEBO0RL1KKiDbHzh1jOk30Ol7qo0RMIan2+axDKx48WZ3daw+zkD5HujhonzCSiaqvcUPuaeaRFO8geBR6IoevODn++JBNBN6GwnshN+Mw7SJhFOVmgp0Kbeddz3aqSvLFg4jTh6VUysCgB/HKHijdojrHapv7cJa0izf9dif3cDhapSQkhewHsqjE+9ea//cXtYcZ8r4PBFjUbHF0jcnwpcrR9vQ9mXDQ15dNEbFCr9vXgVBuV3lPso0js40cHw== X-Forefront-Antispam-Report: CIP:12.22.5.234;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:mail.nvidia.com;PTR:InfoNoRecords;CAT:NONE;SFS:(13230001)(4636009)(40470700004)(36840700001)(46966006)(7696005)(81166007)(6666004)(36756003)(356005)(83380400001)(36860700001)(40460700003)(47076005)(508600001)(110136005)(54906003)(426003)(336012)(8936002)(86362001)(1076003)(107886003)(5660300002)(316002)(26005)(186003)(82310400004)(70586007)(70206006)(8676002)(2906002)(4326008)(2616005)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Mar 2022 06:55:32.6856 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e69ebd6d-9b5b-4fc0-9dbd-08d9fc19a55b X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[12.22.5.234];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT013.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5245 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org When reading the configuration of a vdpa device, check if the VDPA_ATTR_DEV_NEGOTIATED_FEATURES is available. If it is, parse the feature bits and print a string representation of each of the feature bits. We keep the strings in two different arrays. One for net device related devices and one for generic feature bits. In this patch we parse only net device specific features. Support for other devices can be added later. If the device queried is not a net device, we print its bit number only. Examples: 1. Standard presentation $ vdpa dev config show vdpa-a vdpa-a: mac 00:00:00:00:88:88 link up link_announce false max_vq_pairs 2 mtu 9000 negotiated_features CSUM GUEST_CSUM MTU MAC HOST_TSO4 HOST_TSO6 STATUS \ CTRL_VQ MQ CTRL_MAC_ADDR VERSION_1 ACCESS_PLATFORM 2. json output $ vdpa -j dev config show vdpa-a {"config":{"vdpa-a":{"mac":"00:00:00:00:88:88","link":"up","link_announce":false,\ "max_vq_pairs":2,"mtu":9000,"negotiated_features":["CSUM","GUEST_CSUM",\ "MTU","MAC","HOST_TSO4","HOST_TSO6","STATUS","CTRL_VQ","MQ","CTRL_MAC_ADDR",\ "VERSION_1","ACCESS_PLATFORM"]}}} 3. Pretty json $ vdpa -jp dev config show vdpa-a { "config": { "vdpa-a": { "mac": "00:00:00:00:88:88", "link ": "up", "link_announce ": false, "max_vq_pairs": 2, "mtu": 9000, "negotiated_features": [ "CSUM","GUEST_CSUM","MTU","MAC","HOST_TSO4","HOST_TSO6","STATUS","CTRL_VQ",\ "MQ","CTRL_MAC_ADDR","VERSION_1","ACCESS_PLATFORM" ] } } } Reviewed-by: Si-Wei Liu Acked-by: Jason Wang Signed-off-by: Eli Cohen --- vdpa/include/uapi/linux/vdpa.h | 2 + vdpa/vdpa.c | 107 ++++++++++++++++++++++++++++++++- 2 files changed, 107 insertions(+), 2 deletions(-) diff --git a/vdpa/include/uapi/linux/vdpa.h b/vdpa/include/uapi/linux/vdpa.h index b7eab069988a..748c350450b2 100644 --- a/vdpa/include/uapi/linux/vdpa.h +++ b/vdpa/include/uapi/linux/vdpa.h @@ -40,6 +40,8 @@ enum vdpa_attr { VDPA_ATTR_DEV_NET_CFG_MAX_VQP, /* u16 */ VDPA_ATTR_DEV_NET_CFG_MTU, /* u16 */ + VDPA_ATTR_DEV_NEGOTIATED_FEATURES, /* u64 */ + /* new attributes must be added above here */ VDPA_ATTR_MAX, }; diff --git a/vdpa/vdpa.c b/vdpa/vdpa.c index 4ccb564872a0..5f1aa91a4b96 100644 --- a/vdpa/vdpa.c +++ b/vdpa/vdpa.c @@ -10,6 +10,8 @@ #include #include #include +#include +#include #include "mnl_utils.h" #include @@ -78,6 +80,7 @@ static const enum mnl_attr_data_type vdpa_policy[VDPA_ATTR_MAX + 1] = { [VDPA_ATTR_DEV_VENDOR_ID] = MNL_TYPE_U32, [VDPA_ATTR_DEV_MAX_VQS] = MNL_TYPE_U32, [VDPA_ATTR_DEV_MAX_VQ_SIZE] = MNL_TYPE_U16, + [VDPA_ATTR_DEV_NEGOTIATED_FEATURES] = MNL_TYPE_U64, }; static int attr_cb(const struct nlattr *attr, void *data) @@ -385,6 +388,96 @@ static const char *parse_class(int num) return class ? class : "< unknown class >"; } +static const char * const net_feature_strs[64] = { + [VIRTIO_NET_F_CSUM] = "CSUM", + [VIRTIO_NET_F_GUEST_CSUM] = "GUEST_CSUM", + [VIRTIO_NET_F_CTRL_GUEST_OFFLOADS] = "CTRL_GUEST_OFFLOADS", + [VIRTIO_NET_F_MTU] = "MTU", + [VIRTIO_NET_F_MAC] = "MAC", + [VIRTIO_NET_F_GUEST_TSO4] = "GUEST_TSO4", + [VIRTIO_NET_F_GUEST_TSO6] = "GUEST_TSO6", + [VIRTIO_NET_F_GUEST_ECN] = "GUEST_ECN", + [VIRTIO_NET_F_GUEST_UFO] = "GUEST_UFO", + [VIRTIO_NET_F_HOST_TSO4] = "HOST_TSO4", + [VIRTIO_NET_F_HOST_TSO6] = "HOST_TSO6", + [VIRTIO_NET_F_HOST_ECN] = "HOST_ECN", + [VIRTIO_NET_F_HOST_UFO] = "HOST_UFO", + [VIRTIO_NET_F_MRG_RXBUF] = "MRG_RXBUF", + [VIRTIO_NET_F_STATUS] = "STATUS", + [VIRTIO_NET_F_CTRL_VQ] = "CTRL_VQ", + [VIRTIO_NET_F_CTRL_RX] = "CTRL_RX", + [VIRTIO_NET_F_CTRL_VLAN] = "CTRL_VLAN", + [VIRTIO_NET_F_CTRL_RX_EXTRA] = "CTRL_RX_EXTRA", + [VIRTIO_NET_F_GUEST_ANNOUNCE] = "GUEST_ANNOUNCE", + [VIRTIO_NET_F_MQ] = "MQ", + [VIRTIO_F_NOTIFY_ON_EMPTY] = "NOTIFY_ON_EMPTY", + [VIRTIO_NET_F_CTRL_MAC_ADDR] = "CTRL_MAC_ADDR", + [VIRTIO_F_ANY_LAYOUT] = "ANY_LAYOUT", + [VIRTIO_NET_F_RSC_EXT] = "RSC_EXT", + [VIRTIO_NET_F_HASH_REPORT] = "HASH_REPORT", + [VIRTIO_NET_F_RSS] = "RSS", + [VIRTIO_NET_F_STANDBY] = "STANDBY", + [VIRTIO_NET_F_SPEED_DUPLEX] = "SPEED_DUPLEX", +}; + +#define VIRTIO_F_IN_ORDER 35 +#define VIRTIO_F_NOTIFICATION_DATA 38 +#define VDPA_EXT_FEATURES_SZ (VIRTIO_TRANSPORT_F_END - \ + VIRTIO_TRANSPORT_F_START + 1) + +static const char * const ext_feature_strs[VDPA_EXT_FEATURES_SZ] = { + [VIRTIO_RING_F_INDIRECT_DESC - VIRTIO_TRANSPORT_F_START] = "RING_INDIRECT_DESC", + [VIRTIO_RING_F_EVENT_IDX - VIRTIO_TRANSPORT_F_START] = "RING_EVENT_IDX", + [VIRTIO_F_VERSION_1 - VIRTIO_TRANSPORT_F_START] = "VERSION_1", + [VIRTIO_F_ACCESS_PLATFORM - VIRTIO_TRANSPORT_F_START] = "ACCESS_PLATFORM", + [VIRTIO_F_RING_PACKED - VIRTIO_TRANSPORT_F_START] = "RING_PACKED", + [VIRTIO_F_IN_ORDER - VIRTIO_TRANSPORT_F_START] = "IN_ORDER", + [VIRTIO_F_ORDER_PLATFORM - VIRTIO_TRANSPORT_F_START] = "ORDER_PLATFORM", + [VIRTIO_F_SR_IOV - VIRTIO_TRANSPORT_F_START] = "SR_IOV", + [VIRTIO_F_NOTIFICATION_DATA - VIRTIO_TRANSPORT_F_START] = "NOTIFICATION_DATA", +}; + +static const char * const *dev_to_feature_str[] = { + [VIRTIO_ID_NET] = net_feature_strs, +}; + +static void print_features(struct vdpa *vdpa, uint64_t features, bool mgmtdevf, + uint16_t dev_id) +{ + const char * const *feature_strs = NULL; + const char *s; + int i; + + if (dev_id < ARRAY_SIZE(dev_to_feature_str)) + feature_strs = dev_to_feature_str[dev_id]; + + if (mgmtdevf) + pr_out_array_start(vdpa, "dev_features"); + else + pr_out_array_start(vdpa, "negotiated_features"); + + for (i = 0; i < 64; i++) { + if (!(features & (1ULL << i))) + continue; + + if (i < VIRTIO_TRANSPORT_F_START || i > VIRTIO_TRANSPORT_F_END) { + if (feature_strs) { + s = feature_strs[i]; + } else { + s = NULL; + } + } else { + s = ext_feature_strs[i - VIRTIO_TRANSPORT_F_START]; + } + if (!s) + print_uint(PRINT_ANY, NULL, " bit_%d", i); + else + print_string(PRINT_ANY, NULL, " %s", s); + } + + pr_out_array_end(vdpa); +} + static void pr_out_mgmtdev_show(struct vdpa *vdpa, const struct nlmsghdr *nlh, struct nlattr **tb) { @@ -579,9 +672,10 @@ static int cmd_dev_del(struct vdpa *vdpa, int argc, char **argv) return mnlu_gen_socket_sndrcv(&vdpa->nlg, nlh, NULL, NULL); } -static void pr_out_dev_net_config(struct nlattr **tb) +static void pr_out_dev_net_config(struct vdpa *vdpa, struct nlattr **tb) { SPRINT_BUF(macaddr); + uint64_t val_u64; uint16_t val_u16; if (tb[VDPA_ATTR_DEV_NET_CFG_MACADDR]) { @@ -610,6 +704,15 @@ static void pr_out_dev_net_config(struct nlattr **tb) val_u16 = mnl_attr_get_u16(tb[VDPA_ATTR_DEV_NET_CFG_MTU]); print_uint(PRINT_ANY, "mtu", "mtu %d ", val_u16); } + if (tb[VDPA_ATTR_DEV_NEGOTIATED_FEATURES]) { + uint16_t dev_id = 0; + + if (tb[VDPA_ATTR_DEV_ID]) + dev_id = mnl_attr_get_u32(tb[VDPA_ATTR_DEV_ID]); + + val_u64 = mnl_attr_get_u64(tb[VDPA_ATTR_DEV_NEGOTIATED_FEATURES]); + print_features(vdpa, val_u64, false, dev_id); + } } static void pr_out_dev_config(struct vdpa *vdpa, struct nlattr **tb) @@ -619,7 +722,7 @@ static void pr_out_dev_config(struct vdpa *vdpa, struct nlattr **tb) pr_out_vdev_handle_start(vdpa, tb); switch (device_id) { case VIRTIO_ID_NET: - pr_out_dev_net_config(tb); + pr_out_dev_net_config(vdpa, tb); break; default: break; From patchwork Wed Mar 2 06:54:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eli Cohen X-Patchwork-Id: 12765558 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 29689C433EF for ; Wed, 2 Mar 2022 06:56:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239775AbiCBG5K (ORCPT ); Wed, 2 Mar 2022 01:57:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49902 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235576AbiCBG5H (ORCPT ); Wed, 2 Mar 2022 01:57:07 -0500 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2078.outbound.protection.outlook.com [40.107.220.78]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4FBD8B3E66 for ; Tue, 1 Mar 2022 22:56:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kFG4uc3BDXpmmTm8K3ZKOggXKFGYSpvIDz5wj20IEYoley0jGv1CV3VI2ZcFo5CMxSdzP8UWFTGLecFLDjoud0e9rGfaXUEnGkIgffQtDAyrX35prPa2LVUCzwE20Zd0UzT4kM3qgZ7lL8S3d3yhh9LH8+wTHvnbn7GtlyJXfualRhJWRCYKUj+nNyL8gGxt4xUGDXtpmhr/c3qfRByxJjzTMfKeMoHkFoVG4aONIg2AJoN8xphdu3dJRq2yw6sjcNl49f8vCgNztZS4CwoAZuKBElNFiCEV9AY62mooAbxnorUWYJStHWM5k0OjqeZLAQ10v3YIJEu2oBnH90Glog== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=oqNcRLmq8KV3ZHlT0wHDLTk+5RNhOWksF0I/KQO2HTI=; b=CqCTKzXKUEsLWWXHZytXRJvX/W9ZfrWeGq1/HnZJmBq6WzHbymPaw/4EudvRaLezKITdi1KMTij0fEaXbrmGA6oGt/AiX/rcEc5Kw0WLh5yhW38AXH3GRhYsTNdH+ZloNqckPpKOKR2FCqC4I8QtkUwzSo2rmC5YLxJeZCHRM964osKmuhV3dR/tTedfzAMb99FQOwPWZ07F0mdtamN7vQvCcDzU/HnTbUuuHG59JqIeDb6QUIZ2BKXjhB1B6KX3WFYrOK7vPPnSniVfRFdB1TTPC1BjE9uJcPoeMJbXAcRST3vUMSdKmKN+R3P/yPZK8gxUD6u9qkmt1BAeOjN/iw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.235) smtp.rcpttodomain=redhat.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject 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=oqNcRLmq8KV3ZHlT0wHDLTk+5RNhOWksF0I/KQO2HTI=; b=DV35BMhJSYMT0hT/xuMz+8DCxdMg2Mxt8UQb80MsAVGWCyBC7z9mUmQ8Yaq3lhsMz7p6Lp9KsPh0CNXLXNXfYMiUCHMotq6FOHNMQAITdARvacq+MgPUEXXa6Zs76J3k+/md6Etp5pistqTRSbEZluBmXRh3Z6EE4zQe1bv0hk9CkdQmxQw0wqUvEAUyKm0liudYhskBpEHFmG3owxc29YALcBQGoZmR4pv8Ob2rF3CvNN5U66FsAol3t2p4vTxmEio2ejnek8se6VtinKkjIjBiEHQZ1P0YQbX2JtOF2lH+AQ2T6h38LgAFQsAwA1uOcxPy1Z3iJAg9c7MBGuxY9A== Received: from BN6PR14CA0024.namprd14.prod.outlook.com (2603:10b6:404:79::34) by BY5PR12MB4968.namprd12.prod.outlook.com (2603:10b6:a03:1d2::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5017.22; Wed, 2 Mar 2022 06:56:21 +0000 Received: from BN8NAM11FT047.eop-nam11.prod.protection.outlook.com (2603:10b6:404:79:cafe::9f) by BN6PR14CA0024.outlook.office365.com (2603:10b6:404:79::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5038.14 via Frontend Transport; Wed, 2 Mar 2022 06:56:21 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.235) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 12.22.5.235 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.235; helo=mail.nvidia.com; Received: from mail.nvidia.com (12.22.5.235) by BN8NAM11FT047.mail.protection.outlook.com (10.13.177.220) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5038.14 via Frontend Transport; Wed, 2 Mar 2022 06:56:21 +0000 Received: from rnnvmail202.nvidia.com (10.129.68.7) by DRHQMAIL107.nvidia.com (10.27.9.16) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 2 Mar 2022 06:55:35 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by rnnvmail202.nvidia.com (10.129.68.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.9; Tue, 1 Mar 2022 22:55:34 -0800 Received: from vdi.nvidia.com (10.127.8.13) by mail.nvidia.com (10.129.68.8) with Microsoft SMTP Server id 15.2.986.9 via Frontend Transport; Tue, 1 Mar 2022 22:55:32 -0800 From: Eli Cohen To: , , CC: , , , , , Eli Cohen Subject: [PATCH v4 3/4] vdpa: Support for configuring max VQ pairs for a device Date: Wed, 2 Mar 2022 08:54:43 +0200 Message-ID: <20220302065444.138615-4-elic@nvidia.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220302065444.138615-1-elic@nvidia.com> References: <20220302065444.138615-1-elic@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ec2e741e-7f5e-4e62-ed73-08d9fc19c233 X-MS-TrafficTypeDiagnostic: BY5PR12MB4968:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ODY4ZdEv0Z7eJ50pl+xLLlaRJJiggl/XiaHkXhAgJ05wmM8nucwzV8pRm5ItLp1gRy/g05k2FjvxO1UL3ImgPanqbXvhNyqkirngYH/8pVgZHCFpDJJwT7h+iDyN/1mcgQhhNLNMNKWcByIhVb2ISOmccBoKlSuBgPTW6aSLtIBTbJhYGhPAVgVAHzNqvPeFxrgvwGxI1gfz6OXBdwFzwuFlAnS2TO5zeB7xM0yWC0sAFcDYHzNtgVpOnT3SkjAlRstI6z+F4nB9XswHdHLBeuURVxGU3SbDRrYgAYaY3rtSQhKpdqwX2VRAtyD38WIXgObEGBh58Y5ec3mbXFffdsTx55ftIBsMPcJ1S2su0EoLkZyLq8SUrXoe3oeJdxg7+JZQjqFUKUJmBNoyg+PvJYgx47amJIsmr+W5AYRLLwvwH46Mxf42l7pEKuaD9WRYJxuiX4JrJiYQ1K29pwxpiaF+jy7NI7ZkRr6Wyg1kad1cYF/RpSSYA9bqyJlvPhsB0KFIY9edO/3keT11PdSMO8BrzBZhNNh669qL7H1T54HYLkqvvbIykDum12f1QsXR4oSm7MMIfrkS9BUeb5me5GmLaKUSN55Bcv/0rj1amRYkcQoakZcQl4amtO/SD22nAy4eipOHhRm3VcfRLqXRw2s9XmA1nUP4JLflyUwu6cmUTZxVfapRpkZ2/CrsHWTXiM4ZPSPJtp//yyz2kEi2dg== X-Forefront-Antispam-Report: CIP:12.22.5.235;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:mail.nvidia.com;PTR:InfoNoRecords;CAT:NONE;SFS:(13230001)(4636009)(46966006)(40470700004)(36840700001)(6666004)(186003)(1076003)(336012)(36756003)(7696005)(26005)(426003)(508600001)(81166007)(356005)(54906003)(316002)(110136005)(82310400004)(86362001)(47076005)(5660300002)(2906002)(36860700001)(107886003)(40460700003)(8936002)(83380400001)(2616005)(8676002)(70586007)(70206006)(4326008)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Mar 2022 06:56:21.0482 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ec2e741e-7f5e-4e62-ed73-08d9fc19c233 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[12.22.5.235];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT047.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4968 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Use VDPA_ATTR_DEV_MGMTDEV_MAX_VQS to specify max number of virtqueue pairs to configure for a vdpa device when adding a device. Examples: 1. Create a device with 3 virtqueue pairs: $ vdpa dev add name vdpa-a mgmtdev auxiliary/mlx5_core.sf.1 max_vqp 3 2. Read the configuration of a vdpa device $ vdpa dev config show vdpa-a vdpa-a: mac 00:00:00:00:88:88 link up link_announce false max_vq_pairs 3 \ mtu 1500 negotiated_features CSUM GUEST_CSUM MTU MAC HOST_TSO4 HOST_TSO6 STATUS \ CTRL_VQ MQ CTRL_MAC_ADDR VERSION_1 ACCESS_PLATFORM Reviewed-by: Si-Wei Liu Acked-by: Jason Wang Signed-off-by: Eli Cohen --- vdpa/include/uapi/linux/vdpa.h | 1 + vdpa/vdpa.c | 27 +++++++++++++++++++++++++-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/vdpa/include/uapi/linux/vdpa.h b/vdpa/include/uapi/linux/vdpa.h index 748c350450b2..a3ebf4d4d9b8 100644 --- a/vdpa/include/uapi/linux/vdpa.h +++ b/vdpa/include/uapi/linux/vdpa.h @@ -41,6 +41,7 @@ enum vdpa_attr { VDPA_ATTR_DEV_NET_CFG_MTU, /* u16 */ VDPA_ATTR_DEV_NEGOTIATED_FEATURES, /* u64 */ + VDPA_ATTR_DEV_MGMTDEV_MAX_VQS, /* u32 */ /* new attributes must be added above here */ VDPA_ATTR_MAX, diff --git a/vdpa/vdpa.c b/vdpa/vdpa.c index 5f1aa91a4b96..22064c755baa 100644 --- a/vdpa/vdpa.c +++ b/vdpa/vdpa.c @@ -25,6 +25,7 @@ #define VDPA_OPT_VDEV_HANDLE BIT(3) #define VDPA_OPT_VDEV_MAC BIT(4) #define VDPA_OPT_VDEV_MTU BIT(5) +#define VDPA_OPT_MAX_VQP BIT(6) struct vdpa_opts { uint64_t present; /* flags of present items */ @@ -34,6 +35,7 @@ struct vdpa_opts { unsigned int device_id; char mac[ETH_ALEN]; uint16_t mtu; + uint16_t max_vqp; }; struct vdpa { @@ -81,6 +83,7 @@ static const enum mnl_attr_data_type vdpa_policy[VDPA_ATTR_MAX + 1] = { [VDPA_ATTR_DEV_MAX_VQS] = MNL_TYPE_U32, [VDPA_ATTR_DEV_MAX_VQ_SIZE] = MNL_TYPE_U16, [VDPA_ATTR_DEV_NEGOTIATED_FEATURES] = MNL_TYPE_U64, + [VDPA_ATTR_DEV_MGMTDEV_MAX_VQS] = MNL_TYPE_U32, }; static int attr_cb(const struct nlattr *attr, void *data) @@ -222,6 +225,8 @@ static void vdpa_opts_put(struct nlmsghdr *nlh, struct vdpa *vdpa) sizeof(opts->mac), opts->mac); if (opts->present & VDPA_OPT_VDEV_MTU) mnl_attr_put_u16(nlh, VDPA_ATTR_DEV_NET_CFG_MTU, opts->mtu); + if (opts->present & VDPA_OPT_MAX_VQP) + mnl_attr_put_u16(nlh, VDPA_ATTR_DEV_NET_CFG_MAX_VQP, opts->max_vqp); } static int vdpa_argv_parse(struct vdpa *vdpa, int argc, char **argv, @@ -290,6 +295,14 @@ static int vdpa_argv_parse(struct vdpa *vdpa, int argc, char **argv, NEXT_ARG_FWD(); o_found |= VDPA_OPT_VDEV_MTU; + } else if ((matches(*argv, "max_vqp") == 0) && (o_optional & VDPA_OPT_MAX_VQP)) { + NEXT_ARG_FWD(); + err = vdpa_argv_u16(vdpa, argc, argv, &opts->max_vqp); + if (err) + return err; + + NEXT_ARG_FWD(); + o_found |= VDPA_OPT_MAX_VQP; } else { fprintf(stderr, "Unknown option \"%s\"\n", *argv); return -EINVAL; @@ -501,6 +514,15 @@ static void pr_out_mgmtdev_show(struct vdpa *vdpa, const struct nlmsghdr *nlh, pr_out_array_end(vdpa); } + if (tb[VDPA_ATTR_DEV_MGMTDEV_MAX_VQS]) { + uint16_t num_vqs; + + if (!vdpa->json_output) + printf("\n"); + num_vqs = mnl_attr_get_u16(tb[VDPA_ATTR_DEV_MGMTDEV_MAX_VQS]); + print_uint(PRINT_ANY, "max_supported_vqs", " max_supported_vqs %d", num_vqs); + } + pr_out_handle_end(vdpa); } @@ -560,7 +582,7 @@ static int cmd_mgmtdev(struct vdpa *vdpa, int argc, char **argv) static void cmd_dev_help(void) { fprintf(stderr, "Usage: vdpa dev show [ DEV ]\n"); - fprintf(stderr, " vdpa dev add name NAME mgmtdev MANAGEMENTDEV [ mac MACADDR ] [ mtu MTU ]\n"); + fprintf(stderr, " vdpa dev add name NAME mgmtdev MANAGEMENTDEV [ mac MACADDR ] [ mtu MTU ] [max_vqp MAX_VQ_PAIRS]\n"); fprintf(stderr, " vdpa dev del DEV\n"); fprintf(stderr, "Usage: vdpa dev config COMMAND [ OPTIONS ]\n"); } @@ -650,7 +672,8 @@ static int cmd_dev_add(struct vdpa *vdpa, int argc, char **argv) NLM_F_REQUEST | NLM_F_ACK); err = vdpa_argv_parse_put(nlh, vdpa, argc, argv, VDPA_OPT_VDEV_MGMTDEV_HANDLE | VDPA_OPT_VDEV_NAME, - VDPA_OPT_VDEV_MAC | VDPA_OPT_VDEV_MTU); + VDPA_OPT_VDEV_MAC | VDPA_OPT_VDEV_MTU | + VDPA_OPT_MAX_VQP); if (err) return err; From patchwork Wed Mar 2 06:54:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eli Cohen X-Patchwork-Id: 12765556 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9A003C433EF for ; Wed, 2 Mar 2022 06:55:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239478AbiCBG41 (ORCPT ); Wed, 2 Mar 2022 01:56:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239775AbiCBG4Y (ORCPT ); Wed, 2 Mar 2022 01:56:24 -0500 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam07on2046.outbound.protection.outlook.com [40.107.95.46]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3840B2E35 for ; Tue, 1 Mar 2022 22:55:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=D/VRkkL2lN6/Xa+JEG7iN0d3aSQJaQzkz1YbuJo3FHL7osFVabxpuKDGf4JkdlwubaO62L7OgKxCW8a9qK0lG0fyoTkBppSIsXeg5KV8jqij6NYwaZ5NTEb5RvYwD3mxYwsBb1h+VS7NtyItb0XMkfK4dknkG7WJEZWUcrhQEuPD1J9ovFgI9VLpAwe6w+kGJWgWrrcKsgWoy4LlQZ+f1CfbCKgJr59RSQ/TE4xaKR8z7K8pm0oO6R/L50kOxpvoRzjd+7iKwj/I7KcIlbCl5+lO/HgIC4tJpmzKqeZACn7pFuiFfPgCsYUpwHw5I4v4U0nKopb7jhu2aNX6jx1QXg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=iNE7NKvefSNVY50Z2uZ04J33GI4GxkgfZXXCuGVdfbw=; b=lNSzDLfWQiNsJ27kt8gdYC4+TdL+mrFjZo01wYJ6YAM30Jdale7mNY/4oYOk0KeAn9NvJCzEFC0eZhMOr/ADT3IMEDPc69RnHPPaD8JUPRCnAAHGMueXq0Gv2ADUstNSSg4ru212CBIVJrrMi3Oja4UAV25Vk7Qf++AsiToIXAYDjiZU9Vq5cMIC3HkS2T7YIWOebBj6s4M8xVGaK3L8XP+fVgJ2eOfBLd5RVAg/5COLUEt5PYaD1ik2iAY8SnjMFgY28X/DMNoKnzL1Kv41tCHIJ7DyzCob/MJAz4iOZXQRH4tBEeV+yPrO9Vbl29dxvNgZ94msJgm+2x0w0udwJg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.238) smtp.rcpttodomain=redhat.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject 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=iNE7NKvefSNVY50Z2uZ04J33GI4GxkgfZXXCuGVdfbw=; b=dVVlQvLy6u065vMO7Vo3VwC5RmFpk8hHTCHCyPnWjfctzueu98JFlel/gc22V8zftQWCO5pYocT+QsamPv1sCD3JFEph5v/gnLqYuceS6QMAJCjD0zZtZttPO5bNKzmWvXumU8yHYutpkjSpsznZ/f4vuCUcT+AHV06VCYot8Isj3UoRJRf1iwYNNFJeBJvSNMDShpSm3JU4ZPX8wmkN27qN1Kx5WoI99+l4ImdKzhAEtSry5qCnltY4lj8tMsXz5jH+QMdGD63evCnyvg5ab+hq75rOx5/tiAnQ8IyF6CLHEM1t86oPx8oTzpjWepjveOfp0UvafxFuP5BCDx3j0g== Received: from DM3PR12CA0077.namprd12.prod.outlook.com (2603:10b6:0:57::21) by CY4PR12MB1813.namprd12.prod.outlook.com (2603:10b6:903:124::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5038.13; Wed, 2 Mar 2022 06:55:39 +0000 Received: from DM6NAM11FT022.eop-nam11.prod.protection.outlook.com (2603:10b6:0:57:cafe::f3) by DM3PR12CA0077.outlook.office365.com (2603:10b6:0:57::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5038.14 via Frontend Transport; Wed, 2 Mar 2022 06:55:39 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.238) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 12.22.5.238 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.238; helo=mail.nvidia.com; Received: from mail.nvidia.com (12.22.5.238) by DM6NAM11FT022.mail.protection.outlook.com (10.13.172.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5038.14 via Frontend Transport; Wed, 2 Mar 2022 06:55:39 +0000 Received: from rnnvmail202.nvidia.com (10.129.68.7) by DRHQMAIL105.nvidia.com (10.27.9.14) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 2 Mar 2022 06:55:38 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by rnnvmail202.nvidia.com (10.129.68.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.9; Tue, 1 Mar 2022 22:55:37 -0800 Received: from vdi.nvidia.com (10.127.8.13) by mail.nvidia.com (10.129.68.8) with Microsoft SMTP Server id 15.2.986.9 via Frontend Transport; Tue, 1 Mar 2022 22:55:35 -0800 From: Eli Cohen To: , , CC: , , , , , Eli Cohen Subject: [PATCH v4 4/4] vdpa: Support reading device features Date: Wed, 2 Mar 2022 08:54:44 +0200 Message-ID: <20220302065444.138615-5-elic@nvidia.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220302065444.138615-1-elic@nvidia.com> References: <20220302065444.138615-1-elic@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 36bb148c-6f62-4fee-becb-08d9fc19a926 X-MS-TrafficTypeDiagnostic: CY4PR12MB1813:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: u96bWN9DtaqjcOQY8OTXYtxxhMRBDO//zA1eL6qv8+RK31JVVJOHJMUkVmkb8QgW13jkMTK+Unde9BhviCMVkXDPZsUcvtQ7wAppqQiiRd36cj60tWazXejJ+BupMG/33Fq5Gz+kKZTghSMl+/d+YTvRJHDBF+PeGdeyPOLEkgN3juIiK9E3p6FKvjGa1yaNpJWk8EdHEOrLD3cL38KFUkCutWm4pGZ2DKFNYU1QEKe/0byUwYkabUP0b9mFs83Aic1nJIk3jIYVgn8K41n/mpML3xVTwW53mZZvD3mPfa+fgG11Zqu5PcWWH6sES1Fb69JkSGweNHuc0pxzjRuk3JpMS7MXgNxdL8HMxxD5RujKQcnpH242FWHXfMfA74CWsvNk8oEOlJonFR+E638UeSdlGeQQC+D/Wzad7c5aJEtoP3YOtvRRBhG6YZomjnexoPbPxBKVsPhMIQVYJUQLdQa5zFNcvG3UHxmN9KaROZuvwnC/HVbK8tVjz+VdyBcxjevjchqfUc8l4WPk2mHWUO12CfIV+eGng5/1+nYvk/ePIjBZizTYeaQfbiDaWKNLbQWWO7r2xSjAqeZgSsywe+TFeLeYL9bfziHTqTB5bQl9bxc/rqp/rmXKYDGZTLPX/29R29IF9X+rQ4g1rIcbf2dHhSqKW36xwQxj0H3zcJ7fNzp/+XJKB9qz5j2+mFVAEZoYpMR9mnAjQuFFoS9qTg== X-Forefront-Antispam-Report: CIP:12.22.5.238;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:mail.nvidia.com;PTR:InfoNoRecords;CAT:NONE;SFS:(13230001)(4636009)(46966006)(36840700001)(40470700004)(110136005)(316002)(8936002)(4326008)(8676002)(5660300002)(2906002)(26005)(54906003)(1076003)(40460700003)(86362001)(36756003)(508600001)(6666004)(70206006)(70586007)(36860700001)(107886003)(7696005)(356005)(81166007)(2616005)(82310400004)(426003)(336012)(47076005)(83380400001)(186003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Mar 2022 06:55:39.0812 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 36bb148c-6f62-4fee-becb-08d9fc19a926 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[12.22.5.238];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT022.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1813 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org When showing the available management devices, check if VDPA_ATTR_DEV_SUPPORTED_FEATURES feature is available and print the supported features for a management device. Examples: $ vdpa mgmtdev show auxiliary/mlx5_core.sf.1: supported_classes net max_supported_vqs 257 dev_features CSUM GUEST_CSUM MTU HOST_TSO4 HOST_TSO6 STATUS CTRL_VQ MQ \ CTRL_MAC_ADDR VERSION_1 ACCESS_PLATFORM $ vdpa -jp mgmtdev show { "mgmtdev": { "auxiliary/mlx5_core.sf.1": { "supported_classes": [ "net" ], "max_supported_vqs": 257, "dev_features": [ "CSUM","GUEST_CSUM","MTU","HOST_TSO4","HOST_TSO6","STATUS","CTRL_VQ","MQ",\ "CTRL_MAC_ADDR","VERSION_1","ACCESS_PLATFORM" ] } } } Reviewed-by: Si-Wei Liu Acked-by: Jason Wang Signed-off-by: Eli Cohen --- vdpa/include/uapi/linux/vdpa.h | 1 + vdpa/vdpa.c | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/vdpa/include/uapi/linux/vdpa.h b/vdpa/include/uapi/linux/vdpa.h index a3ebf4d4d9b8..96ccbf305d14 100644 --- a/vdpa/include/uapi/linux/vdpa.h +++ b/vdpa/include/uapi/linux/vdpa.h @@ -42,6 +42,7 @@ enum vdpa_attr { VDPA_ATTR_DEV_NEGOTIATED_FEATURES, /* u64 */ VDPA_ATTR_DEV_MGMTDEV_MAX_VQS, /* u32 */ + VDPA_ATTR_DEV_SUPPORTED_FEATURES, /* u64 */ /* new attributes must be added above here */ VDPA_ATTR_MAX, diff --git a/vdpa/vdpa.c b/vdpa/vdpa.c index 22064c755baa..bdc366880ab9 100644 --- a/vdpa/vdpa.c +++ b/vdpa/vdpa.c @@ -84,6 +84,7 @@ static const enum mnl_attr_data_type vdpa_policy[VDPA_ATTR_MAX + 1] = { [VDPA_ATTR_DEV_MAX_VQ_SIZE] = MNL_TYPE_U16, [VDPA_ATTR_DEV_NEGOTIATED_FEATURES] = MNL_TYPE_U64, [VDPA_ATTR_DEV_MGMTDEV_MAX_VQS] = MNL_TYPE_U32, + [VDPA_ATTR_DEV_SUPPORTED_FEATURES] = MNL_TYPE_U64, }; static int attr_cb(const struct nlattr *attr, void *data) @@ -494,14 +495,14 @@ static void print_features(struct vdpa *vdpa, uint64_t features, bool mgmtdevf, static void pr_out_mgmtdev_show(struct vdpa *vdpa, const struct nlmsghdr *nlh, struct nlattr **tb) { + uint64_t classes = 0; const char *class; unsigned int i; pr_out_handle_start(vdpa, tb); if (tb[VDPA_ATTR_MGMTDEV_SUPPORTED_CLASSES]) { - uint64_t classes = mnl_attr_get_u64(tb[VDPA_ATTR_MGMTDEV_SUPPORTED_CLASSES]); - + classes = mnl_attr_get_u64(tb[VDPA_ATTR_MGMTDEV_SUPPORTED_CLASSES]); pr_out_array_start(vdpa, "supported_classes"); for (i = 1; i < 64; i++) { @@ -523,6 +524,16 @@ static void pr_out_mgmtdev_show(struct vdpa *vdpa, const struct nlmsghdr *nlh, print_uint(PRINT_ANY, "max_supported_vqs", " max_supported_vqs %d", num_vqs); } + if (tb[VDPA_ATTR_DEV_SUPPORTED_FEATURES]) { + uint64_t features; + + features = mnl_attr_get_u64(tb[VDPA_ATTR_DEV_SUPPORTED_FEATURES]); + if (classes & BIT(VIRTIO_ID_NET)) + print_features(vdpa, features, true, VIRTIO_ID_NET); + else + print_features(vdpa, features, true, 0); + } + pr_out_handle_end(vdpa); }