From patchwork Wed Mar 9 16:46:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eli Cohen X-Patchwork-Id: 12775296 X-Patchwork-Delegate: dsahern@gmail.com 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 9F9CEC433EF for ; Wed, 9 Mar 2022 16:58:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235884AbiCIQ7u (ORCPT ); Wed, 9 Mar 2022 11:59:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237408AbiCIQ7n (ORCPT ); Wed, 9 Mar 2022 11:59:43 -0500 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on20622.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe5b::622]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B843CA0F8 for ; Wed, 9 Mar 2022 08:46:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YF939Kxc0ffPwCz4i9+JDskU2SsV1CsZZpalHSdmT0OD3xhzJ7byB79ii8DXXqpLgkzbRpAKcSVwcDW3co23npy9WQglOGve7zqXO3Fw5dAXBR+OttmWNDGjA4ATRWM/M+d18kds49iQG1x0nt4vMpMP7RcjBM8y3lw4zSk3IaL0OjxCsCsPBiusK7S2T2ieF08njP8HBpuDyl1HkaRUPcxAJFrOylYHyl7hxywymTS2jNLVHdkZRJyPivLu/WtuXduAbvGjWDYSXLDo/6Z4JJfMuBXFUI7D62OymZh3szV/J/7jisIjeAHgc3xth/ClqxOP5+RqXIG2xh2b9f/XBg== 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=elG1J40xfziWfEzxXTaCmVzClifDsoIWJIaSpNtwrfs=; b=fUAYCeAIp3zCQANG/0FNtXZoiNMSNgAxlaY7Gu3TxVf5fBkH2NZWaIsH1tB1aOAPWRRUmJkJ+5jlbUP1QMzNFdZOkMQntL+3OS6ND3cbCYf/FzPIyrqYbENua8hxZ0B3pHTmnaj66wO1tpcDhIOtryY+xTdxoBGZ7ehWhWPF4dto89PTg9rSbhLgqWwEjYugC9i3YmEWHORqT+RtErd7+VQxSpAWM76cUOgFI+paikVRWmocAMSEjq5rA5waOfcI/Z3l+7gI0WgTjCCIUxH88cSB6Cr2hmBNfgkroNoHirXWHadkGEeDNcOM2l2kCDfB1YQ2EkLvcvYFPxxvQYoHUg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.234) smtp.rcpttodomain=oracle.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=elG1J40xfziWfEzxXTaCmVzClifDsoIWJIaSpNtwrfs=; b=Pmn3o6PM2VVv/pmQXQ/PecteTab5Kv846wYFkQ7sedIToVxzkSRnEhOYwXiwG6lB6ZdVeZxKFRLJ44eMwa+7YAmHOd90UAnaXXy8wUjsx+osQKGYPioEVqURkD6lYUPRakhs7pb45mLufq5fekS7AcLo6by/L6EffbisbkMM4V/gaey/gb/QVMk52/aKVmV1iyjeOlo90IpbKhJ2pYxdIzkYjY+SYc8zd7vbFO229TDN8z2qcgqXEuhfBbH3NCJfIsKCjmnJdsaJ2n4riIo04QSzFnZS/kFpAJCWQk8mcbnHvzG6P2QeQXiaZqp6R3GbUQiHUe3Ni8GLJWqooyDDJw== Received: from DM5PR18CA0065.namprd18.prod.outlook.com (2603:10b6:3:22::27) by DM4PR12MB5213.namprd12.prod.outlook.com (2603:10b6:5:394::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5038.14; Wed, 9 Mar 2022 16:46:21 +0000 Received: from DM6NAM11FT006.eop-nam11.prod.protection.outlook.com (2603:10b6:3:22:cafe::ae) by DM5PR18CA0065.outlook.office365.com (2603:10b6:3:22::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5038.29 via Frontend Transport; Wed, 9 Mar 2022 16:46:21 +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 DM6NAM11FT006.mail.protection.outlook.com (10.13.173.104) 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, 9 Mar 2022 16:46:20 +0000 Received: from rnnvmail203.nvidia.com (10.129.68.9) by DRHQMAIL101.nvidia.com (10.27.9.10) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 9 Mar 2022 16:46:20 +0000 Received: from rnnvmail203.nvidia.com (10.129.68.9) by rnnvmail203.nvidia.com (10.129.68.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.9; Wed, 9 Mar 2022 08:46:19 -0800 Received: from vdi.nvidia.com (10.127.8.13) by mail.nvidia.com (10.129.68.9) with Microsoft SMTP Server id 15.2.986.9 via Frontend Transport; Wed, 9 Mar 2022 08:46:16 -0800 From: Eli Cohen To: , , , , , CC: , , , Eli Cohen , Jianbo Liu Subject: [PATCH v5 1/4] vdpa: Remove unsupported command line option Date: Wed, 9 Mar 2022 18:46:06 +0200 Message-ID: <20220309164609.7233-2-elic@nvidia.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220309164609.7233-1-elic@nvidia.com> References: <20220309164609.7233-1-elic@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 60310f61-7e18-4b8e-432f-08da01ec570c X-MS-TrafficTypeDiagnostic: DM4PR12MB5213: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: SC+muak+UKyyX56y/clj5FWeQqIHSpA+gpKlUh9+/WWs0J1KCdBngJ1KB3Hg/G3JCN9FeyzIhTnW6D7Be1HQmJMturSVn8ukVIaLg1c+eHSbG2+VVePSkVQ4tfCaSIcVLWGgb7VZubk8MsAmSWnZ40ABOHijy6/BU4SCsooOQYUlbg4cAKGBR8JrLo1PLOqhiPYBWA3hSDTJoI+fIrIZcU27f3GSBZtMm2D+WpgLC8TAFdAUbiPjcEPIwCJIlyeKrX4vllHq78Gc1pE6rttWUZ61BQVsQ6Q9yUUnN8yKyc8MAPJbH0NI1jyFVu2XNvM7OKLX4dPCAA7Pzu+nCJGTFUGgYcc+7sYSgsdj9ec0mhdX211Amjg8YZLiIzNUnvJb5I/saCmC+InjtrWmFoEoWecpNG3wZjSydKgFkSegdqaz+lmLz8SbRTdXb1TTBT1WtOv3VZQCpNRukMtgmhDeK0ygEc6C8MbB+q8I+6AnK8yRp+Bw3ioc5gB0gNLTY0Sc2kSon8djW+nzgxsv1R++bE2YET7eV3hkE7Bt+NyjdvpMze82GeUsdRefPf6Nt44ARyiBdHpkZjzEPyYwMQ4Bs+AD3Lr+xgcNA6MFV0Fikp7AHFtowgcNW5cdv2ZQxtw8K863IJQ+x2wEgbLRzkDel7x6JkjFUvC09giTtyqubta8uBsr7xN+Ky4yo57YAchNKBPBlbc3jpZRBC9lGrCZTA== 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)(46966006)(36840700001)(40470700004)(82310400004)(70206006)(81166007)(86362001)(2906002)(356005)(4744005)(508600001)(40460700003)(6666004)(7696005)(8676002)(4326008)(316002)(70586007)(110136005)(54906003)(36860700001)(26005)(5660300002)(186003)(1076003)(107886003)(83380400001)(2616005)(336012)(426003)(8936002)(36756003)(47076005)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Mar 2022 16:46:20.9583 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 60310f61-7e18-4b8e-432f-08da01ec570c 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: DM6NAM11FT006.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5213 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org "-v[erbose]" option is not supported. Remove it. Reviewed-by: Parav Pandit Reviewed-by: Jianbo Liu Reviewed-by: Si-Wei Liu Acked-by: Jason Wang Signed-off-by: Eli Cohen --- 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 9 16:46:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eli Cohen X-Patchwork-Id: 12775303 X-Patchwork-Delegate: dsahern@gmail.com 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 8AEE2C433FE for ; Wed, 9 Mar 2022 16:59:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235564AbiCIRAS (ORCPT ); Wed, 9 Mar 2022 12:00:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236291AbiCIQ7v (ORCPT ); Wed, 9 Mar 2022 11:59:51 -0500 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2052.outbound.protection.outlook.com [40.107.94.52]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8D2C81AF8C9 for ; Wed, 9 Mar 2022 08:47:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Mxh6adh7CFcmHST6Hzv3uVFIkIJF00kXMT/R9WzdLczLaI4QIoAFHwHp4H0KLHKqykVVzEAgdwq6WiHTqR55vfJsFpvw0KM6Fr0CG0+PVnbT9O3enTM1xg1J935hnG3k8dLA2eRvrW+ZHIudHuHpBiZaZwpQ74bGKox8mXwgFBUhBsCNFcA+V2YVQQkV8ZJ+cuS1gdMRBbl8vBThZewBHPFJyhPId9fZQerWgAXODRxGqPzWRCVRO2AooeMaEWhycfMCuXf9kLzXzmKPvy8qDz/UwU3n+Vn5qBfTr+aFw3/5KTN9m2HglzfTP9ZuKwQM3TLs7Qn1z9h2NPNBKuZElA== 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=CHA4h4kygOBmvIeXjOpkuYmbGHQy3aA+MrJwUYp4tYNu1+oJNfWaQofir3QtHn3pqBeFOl9NYMcv0sQSxLk/Ht22NSG3wWWu0FvCCBcb28ycE5/yS7EEVVRiBJGCIAshLz3bqU4h5QhuMDsqmOpe/m0g4LtIzmMUfbJf804iOIRrDJv6j7gk7CRXOcG7zv9piFlq8T6CVy7odMBQpSMb8llo5IZoA05EIxKVtKT47mKlyfGR88iRFQXShGYulkovg30dSUiIM2urvDdelVxRV3vm+QZeu9M5Ultc2gfKq22JwhrmqJ8z9fW1HDYI6NZQ7EWOPJmzCWlSTh8a4Tqk4g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.235) smtp.rcpttodomain=oracle.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=ImY0VyTHzdTydhq5oQRRGmTgI29i9n7d57vnrUkXCGhYhmVI7sc+NiS+UfTxCwZaijKvhvs+CtRRD/afuyX5DCB0jiuMTaP2p529vvQQFF0gYC3jImehQNT46J4BtlJy+7QJgg9hzKhebIOpb9C653Kc5+BFd1sBwVHOTwFNK5Q3UzdQgHHpnsJUM1YUd/Di5Ld/Azj5mN9drLXpg2PybgJXz+1djSafImFnBFZrVlnFbgqUc+9Ly6uDxuhcE7zA6rHojCbC/yXbpgDsAVimEopav4MN7mFSE7tCJ+LPkmL7x1egDBONvK2plo/PmyWZrDSZxj+mLCIAOz5JQBcXIg== Received: from BN9PR03CA0230.namprd03.prod.outlook.com (2603:10b6:408:f8::25) by BN8PR12MB3137.namprd12.prod.outlook.com (2603:10b6:408:48::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5038.14; Wed, 9 Mar 2022 16:46:25 +0000 Received: from BN8NAM11FT039.eop-nam11.prod.protection.outlook.com (2603:10b6:408:f8:cafe::d4) by BN9PR03CA0230.outlook.office365.com (2603:10b6:408:f8::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5061.20 via Frontend Transport; Wed, 9 Mar 2022 16:46:25 +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 BN8NAM11FT039.mail.protection.outlook.com (10.13.177.169) 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, 9 Mar 2022 16:46:25 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL107.nvidia.com (10.27.9.16) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 9 Mar 2022 16:46:23 +0000 Received: from rnnvmail203.nvidia.com (10.129.68.9) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.9; Wed, 9 Mar 2022 08:46:22 -0800 Received: from vdi.nvidia.com (10.127.8.13) by mail.nvidia.com (10.129.68.9) with Microsoft SMTP Server id 15.2.986.9 via Frontend Transport; Wed, 9 Mar 2022 08:46:20 -0800 From: Eli Cohen To: , , , , , CC: , , , Eli Cohen Subject: [PATCH v5 2/4] vdpa: Allow for printing negotiated features of a device Date: Wed, 9 Mar 2022 18:46:07 +0200 Message-ID: <20220309164609.7233-3-elic@nvidia.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220309164609.7233-1-elic@nvidia.com> References: <20220309164609.7233-1-elic@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: be67e6ef-24ad-4776-723e-08da01ec59c5 X-MS-TrafficTypeDiagnostic: BN8PR12MB3137: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: cRYJEBEpU6LDiv0xd3+6xEJw2b3XCyZ6DGm5QCt1wkUfITBFalCZuunsOJCUldqUZ5+s3GXKjzlEqU38QhbLJNytSMI8vHynDgNdKELAKJyXwJfmToekCiZI+QKDZqDe87dim/Fv9pfIfLY2d0UQ0cGjGzwrQ3wTqT+DW+4xSIy1ESaTCwaswDkQk9MiBRMt0nD9uzBM8oOoI1IsOdVCaMnxUV2oV78LktVPt2OBnD/1dF5AURTM8/aK6kZwAwgCJgfnGsqEoo5fzMdw4BM0/6REvNbvSL0KySarYSgf0VWpJeZYCShAwKtOIzmnWmyT0RB1KbpqkkbiGDvHJu+HHUlkzgpjxT+zyz8f05b3RVPTYKHWSYQAAsKT3wM/h84UWJKV8EIfQgKPrBGPBAa6z6vzh4wzlDgub7DiniLatAW8cyerrEkC3GZpaIPAfA2r3xKPh4HYgAnGCqBGqmi8WwfTnlebPUmASAGt3y3YsDy31sp+Zb+lfP5dDBKj+ysQkwdDxEgROrMhIk2vHUpOxHqKNuni27/PU5vQhKnK8Nt4NUiFgfjEVoK8cyE0t4OELPchaWa8c11zZqBePQmyK6Roqf4tyY0qMcPwKDxvvWuOY3tevnh8KVFrOlDnTHWAe6Qi+Vt15MgPa+ZXvDTuOl2gmilSIQMj/w2yqZqzMz3oUtCKT1THMIhcqwuF7e6dXqiPVMNIOdb7Cuv0gUVUgw== 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)(36840700001)(40470700004)(82310400004)(47076005)(86362001)(4326008)(70206006)(508600001)(70586007)(26005)(36860700001)(6666004)(7696005)(83380400001)(336012)(2906002)(426003)(36756003)(5660300002)(8936002)(110136005)(40460700003)(54906003)(356005)(1076003)(107886003)(81166007)(2616005)(186003)(316002)(8676002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Mar 2022 16:46:25.4024 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: be67e6ef-24ad-4776-723e-08da01ec59c5 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: BN8NAM11FT039.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR12MB3137 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 9 16:46:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eli Cohen X-Patchwork-Id: 12775297 X-Patchwork-Delegate: dsahern@gmail.com 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 07AAEC433F5 for ; Wed, 9 Mar 2022 16:58:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234467AbiCIQ7w (ORCPT ); Wed, 9 Mar 2022 11:59:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237450AbiCIQ7o (ORCPT ); Wed, 9 Mar 2022 11:59:44 -0500 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam07on2061e.outbound.protection.outlook.com [IPv6:2a01:111:f400:7eb2::61e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1731D1AE655 for ; Wed, 9 Mar 2022 08:46:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i2giQ6w8KNFFJkdXEPYWVPvWgNuXXWJ0irMtxxsw6myYac/LEwlqB4uwBndb2IqYKpwSeD6tCznx5P209KLMwTe8/hCRIpNkJDe4RQg0Ig2JMtQHglyNO1bSCo0EzDZrSiFMwtnNes1VXuQt7x5CT6joxwJBrH+xo0SdKuj+bKL8tjnUCgSqMLpvQBN6BeVFwUb666ytWa7NKBP6EKW0aeBl2g7BNRwjulGNx1mS2Pc6pY8vmBL0kl7kSQzc4AJbzLEYvtNsMsSSzLIYuhiBCocCZHgvoi81ypzy07q/+tSTXsLA75txzcfXgx8heCac2His6BYDdn4v5uHylALERQ== 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=AEX3g++mu7xh2dD8MqNl3I7Lg2dW5QLXO8AxiX6qhD0=; b=eMbTq1i6annfqvraa8Cx/c+h1Kw/CTX3MSWK2Ob8ofwgUVJVHJmlinv6KkDnce0szxLRh2/ZhAMfZbOPHRWXnUBKxPWByfXEYlYuSNNT7UAFqtJTPU5Lldh+ejp2UBGYxjfHP8YdvBzPD+870A/fV7WKSAKROQj5bYxx60VlFiRYSa8Se0CpkvVBMvi18inF5u3AGTR3I3k0z3VsnQdOf6Xv/kU29ialG48NuUVeLns23U72EKcwDz9Jz4UuvquXwVsWPeAXuFntGcSOaYRAOE70tVa/TnWQsv2XntPv2FOqvZcG7MWi8Qt32XiFgSRw6nI10fpFqbEQn6zlVhkTYA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.236) smtp.rcpttodomain=oracle.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=AEX3g++mu7xh2dD8MqNl3I7Lg2dW5QLXO8AxiX6qhD0=; b=B4TMMCYzBXCFkAgxHargcvsmU8gcz5462seJpYacj1lt416wwP3NpzFROp6xbrqTpGfWj5lF5uXpvQcDolQaSgra9C6Lj0pGsVbCNhfXktc1O/7kZEwxia5QCSrzvNsig5+ZyBFvYj78vmbsA7Tc2G/IJ6zgJVEK31hmbdBl/uUAy92F0JhYc5gk6HON93DjHcoBAY7fQ4wzURyAlEPQa3TcWmq5+1a3vtbYxfJQ0KfhlAxZu0RWXqsvmFeaduRrtPrMf1Q+bMfiqIDg0l7qkh28gewskdMjVji0xXuypHIKfwxujQSiFjDhbj7Js97/bW/ojCmpcXZfgL41pubnFw== Received: from BN0PR10CA0004.namprd10.prod.outlook.com (2603:10b6:408:143::18) by BY5PR12MB4227.namprd12.prod.outlook.com (2603:10b6:a03:206::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5061.21; Wed, 9 Mar 2022 16:46:29 +0000 Received: from BN8NAM11FT008.eop-nam11.prod.protection.outlook.com (2603:10b6:408:143:cafe::75) by BN0PR10CA0004.outlook.office365.com (2603:10b6:408:143::18) 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, 9 Mar 2022 16:46:29 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.236) 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.236 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.236; helo=mail.nvidia.com; Received: from mail.nvidia.com (12.22.5.236) by BN8NAM11FT008.mail.protection.outlook.com (10.13.177.95) 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, 9 Mar 2022 16:46:28 +0000 Received: from rnnvmail202.nvidia.com (10.129.68.7) by DRHQMAIL109.nvidia.com (10.27.9.19) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 9 Mar 2022 16:46:27 +0000 Received: from rnnvmail203.nvidia.com (10.129.68.9) 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; Wed, 9 Mar 2022 08:46:25 -0800 Received: from vdi.nvidia.com (10.127.8.13) by mail.nvidia.com (10.129.68.9) with Microsoft SMTP Server id 15.2.986.9 via Frontend Transport; Wed, 9 Mar 2022 08:46:23 -0800 From: Eli Cohen To: , , , , , CC: , , , Eli Cohen Subject: [PATCH v5 3/4] vdpa: Support for configuring max VQ pairs for a device Date: Wed, 9 Mar 2022 18:46:08 +0200 Message-ID: <20220309164609.7233-4-elic@nvidia.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220309164609.7233-1-elic@nvidia.com> References: <20220309164609.7233-1-elic@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8cd9184c-4d94-40a4-a4d0-08da01ec5bca X-MS-TrafficTypeDiagnostic: BY5PR12MB4227: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: YUXcE63y54l9wVmZOGsVrEl+u4FJquiYIpTlCpZVJkLamffedLrzNExi0CsyhQIU+6R+bnX/FYCwvB9IC6uowR/RELtg9R3pOGXiAbPgAFYgniATECvf1bjjDw+TzK6CHrFWFxZHRL0ioE9I/b6Pt2M/ydv0tgAsWnFjPvb8LPyd/WCi8qFt6hJvbW48m523O4xmcNLTegrjjywGfFCleczFd+MGc1LRn+cgFgK7MTF6LITEfF6U6yp6YjxIbQ/tkW+4MoczYB2754KvH2bf5P8xdRyvn8s14ZS51JKiIRGCqdQx5Nzv4mZrtRAuwoYwOjU+/sLAKh8F/eZgQ5n+UnrREk0LtwT5QfrlGpvZj69Im2EINa/UThPQMcAwqi0Q3Y/X5dvGTNjUn4MPSr8gf+eEhibpyoIBTxQFfBDyUsEiQtmd3RlDJBAP83b5SaWj7kBELTjEpAZ+/yLO0LvhKZ831yCk1ZU/GFeVfSSyzsoT9aeN78FYHBiF+zwQ/lv7LJRB0lTBYWcZiO3K085Bo0pfpwkVxG8h3zsXQZYVRmPK9bhDw3Aoh/vWuF2MhihGc4L0dS6VkHSNPM7H+3OQeb/xXliF27bDolbey66xzBxQpjMJn3SJW0o8+fQiXl9zaJtITHlhieZFodDKeT8klh0DbQVOc7mQIGjPwl+rYCONf9DkPKa1OclovuTQJsrwvWYda6Yvm0RhA9S4DI+1iQ== X-Forefront-Antispam-Report: CIP:12.22.5.236;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)(6666004)(7696005)(40460700003)(8676002)(2906002)(186003)(70206006)(86362001)(4326008)(110136005)(81166007)(36756003)(316002)(356005)(36860700001)(2616005)(1076003)(426003)(26005)(107886003)(5660300002)(82310400004)(336012)(8936002)(83380400001)(70586007)(54906003)(47076005)(508600001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Mar 2022 16:46:28.8544 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8cd9184c-4d94-40a4-a4d0-08da01ec5bca 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.236];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT008.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4227 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 Signed-off-by: Eli Cohen --- v4 -> v5: 1. Use u32 arithmetic in pr_out_mgmtdev_show() to be consistend with attribute width. 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..8b34e29394b2 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]) { + uint32_t num_vqs; + + if (!vdpa->json_output) + printf("\n"); + num_vqs = mnl_attr_get_u32(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 9 16:46:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eli Cohen X-Patchwork-Id: 12775304 X-Patchwork-Delegate: dsahern@gmail.com 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 7A133C433EF for ; Wed, 9 Mar 2022 16:59:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236937AbiCIRAw (ORCPT ); Wed, 9 Mar 2022 12:00:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237252AbiCIRAK (ORCPT ); Wed, 9 Mar 2022 12:00:10 -0500 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2077.outbound.protection.outlook.com [40.107.94.77]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7FB81B0BC7 for ; Wed, 9 Mar 2022 08:47:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aj7Gn60WTtcLtR0YytnNHW7oIRyRfkG8ibRHWgzxdb+vHNguRWOp9INnnk+j6YrAttX/Nl8J4gbYwPiCU7ibFbOt3DAZVMh0bYKnbFNCsSMmrXVw/IS1VFjSmgC30KtfNUk4xVtyPipO9eIiPJJrKKkFkpLeKBm+20zntMp7eOKjUQDdcL5f4T65ts0sCQ3Ubg3d4Zv/GKY11EKHCtTMNnT3GpjJWMSPl67RpLhHrh5KQs4vU2rbxED7CZvI0afAa4VzneuB5dTShAJ019fyYoHxiS+IixpMBdkSLc3Grx06v8ioXwGTrZ6sC+HKj6rKCx4T1UkyokspSapvBXsNIQ== 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=6Q+nIJQk4LNHbvIVVGWco8dE1Tr0LsJH6Q6X6NlBYuU=; b=HmhhTN2PWYH/uUIVe+2/yW1uF3dGw6JpCL3QqXTdDQ2d6XeaSVUYa0nQVFVekE/8/24MZfBu2A1byKoA2BN6KwgItn8UrhQWQr6YswIzSS5mEBXipAH+N8Erhx7LSr0MmMQ4ctdMWICjKvp7EkutzngF6tleFSW13ejtK2bTNCf+PqTZ4uXzjucXsdI0mLNorf1FDuc4AZmnUe2yoxa7b/3EwUQvDhwfHAm2QDqyXjC1Dtrg1p9qvLC2cg8uSmc7DL6dXUsI4ELDbOH4l6C4rqmd96kaHOgUKSBFWAf6AWOLakaHxHMbhLw2Xr44eZx3l4A2ieA6fyyVavBH6e1LWg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.235) smtp.rcpttodomain=oracle.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=6Q+nIJQk4LNHbvIVVGWco8dE1Tr0LsJH6Q6X6NlBYuU=; b=CX/W85MxUHeJ9j5GpGcjbucnAMwyzVv/SRQ63arjAW6+rvQO1nWMgH/0AXZWM6XvhCepyYJXlDrzJ8moRQdA9Y287A9KNAFe/tfqmcUBl40NJROy1+9yB4nTMhBL2+4q15tnFKX7Sj34BYw1MvOYKy5j4QlGlkFcvBGiBKZjVMzglXG+Qh+IiCgp9avzwyG9Onc7P5uou+8pQfWZ+5JQLHTewmA1c6VWr0B1ersqxMJrE20GTYXeZovuA7ENsP5EgrKvIDqqYzhMbgcjtq9Vm6/izbrIWnhszxKJP6ReZcVG58i17uoRpR5DxEeFJ+PogYemh9lk4+U5eRcor5ud9w== Received: from BN0PR02CA0030.namprd02.prod.outlook.com (2603:10b6:408:e4::35) by MN2PR12MB3069.namprd12.prod.outlook.com (2603:10b6:208:c4::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5038.15; Wed, 9 Mar 2022 16:46:31 +0000 Received: from BN8NAM11FT014.eop-nam11.prod.protection.outlook.com (2603:10b6:408:e4:cafe::7d) by BN0PR02CA0030.outlook.office365.com (2603:10b6:408:e4::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5038.29 via Frontend Transport; Wed, 9 Mar 2022 16:46:31 +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 BN8NAM11FT014.mail.protection.outlook.com (10.13.177.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, 9 Mar 2022 16:46:31 +0000 Received: from rnnvmail203.nvidia.com (10.129.68.9) by DRHQMAIL107.nvidia.com (10.27.9.16) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 9 Mar 2022 16:46:30 +0000 Received: from rnnvmail203.nvidia.com (10.129.68.9) by rnnvmail203.nvidia.com (10.129.68.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.9; Wed, 9 Mar 2022 08:46:28 -0800 Received: from vdi.nvidia.com (10.127.8.13) by mail.nvidia.com (10.129.68.9) with Microsoft SMTP Server id 15.2.986.9 via Frontend Transport; Wed, 9 Mar 2022 08:46:26 -0800 From: Eli Cohen To: , , , , , CC: , , , Eli Cohen Subject: [PATCH v5 4/4] vdpa: Support reading device features Date: Wed, 9 Mar 2022 18:46:09 +0200 Message-ID: <20220309164609.7233-5-elic@nvidia.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220309164609.7233-1-elic@nvidia.com> References: <20220309164609.7233-1-elic@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0bd11147-cba5-405b-2b25-08da01ec5d53 X-MS-TrafficTypeDiagnostic: MN2PR12MB3069: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: LqA6Zw5gJ8l6bdDGcmAvGRHghfFSMFDe0OcarU5JhNHXkq8NDG7wjptN9IZ5U0tQRwBrtAa9dyZpVWBKxL8gQShvhtpNNr7hs7+aEkEMjT9V72NW66V7rSKkQUSiUK4fBZBIgtmmRmvPKL2fWK1SoIQAGmO/TlSTL8WC3iTlt5SKSbS2QTmB/R4q+dI9d1VQRLctdYcrQIpl5wHyOxTZsvYpSpw9/aWkDQp5P8RL+GG1gJ1KJ8XGdUPpSEOKt9rWvhFyjpxIvAR0QTfjxvk3U7Cu6uSyw50Y7EDyHJAbgeyjTq7ILHhbBTrouUSfvNjmEGPlwkKys9f0TDzys1BXaVHWrhIFueCQahFu+C0dvVS4iGke6JwkZunP+as9v+/ydeTCE9wMfwU40aSEqeSnbrxn5qyH4mjIg0lUKXDK0FND4lzvYB7EMTiIsRl5Sws5ZJZpZPzeFruK6m0J5FAd3u+8510Csnyk9o0B47RJbgl+5kEK6YVuyxW6KDznHOErk+hbSCDY7MiCUof4VQfRrB3xiOMIuHvAe2u+wJ4JFZH8kefHBIolLbTicnHGbJoSrq5QlapRlZKrLerwK0SJPz9J6UknoVg4Oa8GIUc4K5EcmjSvYfa+tvdKLvTXWapTDZc1t3b/76rmskMVqjyBeWyScmKvxpBrq8nIAO59OSF3GVl52JxhD84f1xRn63YCo2XWOhqHpD9MxSbtsvb/cQ== 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)(508600001)(6666004)(2616005)(8936002)(107886003)(4326008)(8676002)(70206006)(5660300002)(2906002)(83380400001)(86362001)(1076003)(36756003)(316002)(70586007)(36860700001)(7696005)(186003)(54906003)(110136005)(26005)(81166007)(426003)(47076005)(336012)(40460700003)(356005)(82310400004)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Mar 2022 16:46:31.4112 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0bd11147-cba5-405b-2b25-08da01ec5d53 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: BN8NAM11FT014.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB3069 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 8b34e29394b2..ae2503435911 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); }