From patchwork Thu Feb 10 13:31:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eli Cohen X-Patchwork-Id: 12741930 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 D099AC433EF for ; Thu, 10 Feb 2022 13:31:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242240AbiBJNb0 (ORCPT ); Thu, 10 Feb 2022 08:31:26 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:57438 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240549AbiBJNbZ (ORCPT ); Thu, 10 Feb 2022 08:31:25 -0500 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2053.outbound.protection.outlook.com [40.107.243.53]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0466BBF for ; Thu, 10 Feb 2022 05:31:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gE+lLdF9Iz33dwx21kf+cfzOaBVq0X8ERy6kk38bfGgzA8KN5GldQ+De5QV7I7w+eN5t8TWNA6Jn+J097tK3Guewe85WXRaghzum5F/UIKt5czvQ+tB9ekP8+2Apcdx3QOEf6RvdMkkfYQEkvoLD863Xz9Y+my1ldJBFPcoBQN3ximvM6CV7PT39x6t7jOtxvgWroof4yFlO87YPK4GdbEyoFOGtCiAHUg9qa1Sk1QeNw1nvtw5zfitn+lc+CrnJluG6SssZlJrsikUjfKXGNRfV6IW0CZ+/ry3DfNeiPzgL0w6Oj6My6Ay5ruCgufidSpN+Vc24ytAax8pduz7cSw== 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=DEXYspyvetfSO/JZLn5KaJGALOTyjyv04/DCckWcPHE=; b=nrXlKlTHTKhxyJPK6Iapf35+dx09+DXMeawKmpRGW3oWu1AzeQGw2QJQketc6rxOpRDqpr+/n/dpDWH613pK6ZFkEMuI3SAxfZ/tIObk2eAaKGGHvOLy2l3b9OcqnyP1bbIGhOVJQrUE6xVQKk844OmqOkiKM1UckQc72/AME27jVl5P1tkvWNWT05eHLCOtSCnAPUb9+dq2I6z4XvlxoC48dfIHuAC4f+m+vR9bN2VFwsyt+44Wm0hH1fu39MZEhmmNhSK3jtF7FsNQQSxjMyFy9umzd2ZQ3mKV1wioL6UnD2q899QKO5siKLqLdQG97jMf2qApkkvWo/pIEkVlsg== 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=DEXYspyvetfSO/JZLn5KaJGALOTyjyv04/DCckWcPHE=; b=NbPNZEGcgvoggTmnJnbumUnOxG0dzNrbzsi9iTSf3QrxtQr4b4XzTMMg68bXtTdUj+0LPiRFJer7stID93nvOeKN0Ku5f5MrpjSlB8hQ8WZ5CUGaoHU2A9ChFJ1pD9xk+dfdgh0APGww9XyR0oPVFp0rJLrv8kbECuJxBXeliHmSWX/2a6Yq+f9DU8nncE59rRgsgaMLejoF9qvhzcGN5zy6p6o+TIZTfr9IOXJwHFjH3/wkRWS6pvn/vdyBAUUQXAfD7bMeTNdupUpDncp+qubrwEk4A2HAN2xtX8GNGODDUcRfjc2yDtBYVAqvuKyqaOoGslNk/6W2cS6FgPKFSw== Received: from MW4PR03CA0028.namprd03.prod.outlook.com (2603:10b6:303:8f::33) by DM6PR12MB3130.namprd12.prod.outlook.com (2603:10b6:5:11b::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.12; Thu, 10 Feb 2022 13:31:25 +0000 Received: from CO1NAM11FT064.eop-nam11.prod.protection.outlook.com (2603:10b6:303:8f:cafe::c4) by MW4PR03CA0028.outlook.office365.com (2603:10b6:303:8f::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.12 via Frontend Transport; Thu, 10 Feb 2022 13:31:25 +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 CO1NAM11FT064.mail.protection.outlook.com (10.13.175.77) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4975.11 via Frontend Transport; Thu, 10 Feb 2022 13:31:24 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL101.nvidia.com (10.27.9.10) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Thu, 10 Feb 2022 13:31:24 +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; Thu, 10 Feb 2022 05:31:23 -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; Thu, 10 Feb 2022 05:31:21 -0800 From: Eli Cohen To: , CC: , , , "Eli Cohen" , Jianbo Liu Subject: [PATCH v1 1/4] vdpa: Remove unsupported command line option Date: Thu, 10 Feb 2022 15:31:12 +0200 Message-ID: <20220210133115.115967-2-elic@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220210133115.115967-1-elic@nvidia.com> References: <20220210133115.115967-1-elic@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4a20bf40-5d6f-4990-8ea5-08d9ec99a271 X-MS-TrafficTypeDiagnostic: DM6PR12MB3130:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:510; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2OZUmlQZ4ujESiTjN1nSf9kg03gPlOqqkfb6CAVcfO+iPRu75KTtoa24o6OhqMvBFHtMp8TOPDekniuTjdVxQO+NRCFS+nL0BSVGkCBFLoKE24hkHE+9bLYyJ6m1c//bE84r2bpqkqzACiEmWXszuj2Vp7Lpnw0EiMvf1CGCSI/i6LIDlXunRJYtZVvFHmHMKXV2xL7grNKrH9I1nQo1XTNLCVEPNeJl2Es5SALr14D70NzvQnpy192V4iqa994frFnf8QqMZKYq2RuJBwt4Viu9JU0qH3WJjAzHVdWd0N7Rl2UOfDSPqwZhD1Iw+yZKAojHikpQ/cM7oBa4L8IQfcyMYpdpMCjTkOadxK+DYsM2UA9PuHDl+VvhirWWS4Npd/8pZBicxXdnEkv4NBs3rjJLMdpkfsn02qHTDiRipygCTpEV0h85byTUGrCAK6/gu9erwPtSjQlYSodNrVWYSKbptMMMxWQufI4bfXKgg2FkKq3bnHZjg/V35J5WHtPKGSbVPeCCjXzWsHJiu0D6Ctmtb0xQe+7ubuqHK503/iPmR4oj0Kqg/YkSwuFchMkMlu3ro8QZV4+j9gl4+OwFZIyMxJuIbP0aE1CY8FvlDyt7veY6fmJfmbyG6nCC7uhSYJU75FazoS/tfNmrD/GQVjZX8qLEBknQ4MZHA20+LLqgjInNUW3ywwvQ/kftk+kPw/uEqMV0iLL8UPtIUH+E/Q== 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)(4326008)(508600001)(5660300002)(8936002)(82310400004)(336012)(70206006)(426003)(110136005)(54906003)(186003)(26005)(83380400001)(47076005)(8676002)(2616005)(36756003)(6666004)(7696005)(107886003)(1076003)(356005)(316002)(81166007)(2906002)(40460700003)(70586007)(86362001)(4744005)(36860700001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Feb 2022 13:31:24.8044 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4a20bf40-5d6f-4990-8ea5-08d9ec99a271 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: CO1NAM11FT064.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB3130 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org "-v[erbose]" option is not supported. Remove it. Acked-by: Jason Wang Reviewed-by: Jianbo Liu Signed-off-by: Eli Cohen Reviewed-by: Si-Wei Liu --- 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 Thu Feb 10 13:31:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eli Cohen X-Patchwork-Id: 12741932 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 99181C433EF for ; Thu, 10 Feb 2022 13:31:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242242AbiBJNbf (ORCPT ); Thu, 10 Feb 2022 08:31:35 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:57484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238351AbiBJNb3 (ORCPT ); Thu, 10 Feb 2022 08:31:29 -0500 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2048.outbound.protection.outlook.com [40.107.92.48]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5079DBDA for ; Thu, 10 Feb 2022 05:31:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dgU8IIWMJ1/PIhZPDVz9f8chxwsuQNwHTw3HgFkPy5nouu52ceDYR+tcprcfqVTMeLNAfC1M3VFlPTHCKGW14Jb99Gkt0+qixnDuwnvNYaeg7ubM+REzGy3OP3tyjeKFu+/O57lYR6Cw/TJrW/m7tPz47JQDU0XALee0LiPLOdGFHdub0ugv0+w1th34QhitLk5vMXdG2f9f/wR06JNVuprRNJiSH2url0i0F+8DmVte1L0uzA0bZLJ5GHkjwwyNRiSMW+vH4awO/tYeKHZv8TXZCWlJVn9NgYSJDQRB0F1vtJonXpewJ+oihizOk7GQY+RiIRwSdPX/uGOt9xjVjg== 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=+x91k3lvKrzKozK058sQ+Idezv5Izj9Jn/XeooB3ngQ=; b=HwZ20Hc64Inat3hirBnr4Me4LQ3uUG2ftoaSS1fJWoPzfdt2yEcb3QGjIfo2YZJj6rvrYWspxOPEaUrReNpxrLltPyXCLnDmCy9Y9/0bOKhVFwt4NPOGz940rT5uR54Cwt+uxbsopDqZPhilvan10jOS3TzwqGOQHlYX0FPTYURqUssSje92k5/uLERYRhG8M0kKdhbqHv/nqmgOa32aRwmDlzVXRbU9IG2UFU4n7v9pYHB6pdZkd7/42zuBvq3mDdGJLzuSK3qNsOPHk3Oib9B1kLgH2m6uoE2N3s7ePVEXoJRsmMMw2JnC3a5lrtKM/Y8nt+a9+tlt5uH9l96t6Q== 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=+x91k3lvKrzKozK058sQ+Idezv5Izj9Jn/XeooB3ngQ=; b=ZoHVJHJsAfGLGtKvtDzF2w1eTd2Ugf+JtOIdrCJADIsciCKlnmR4d8wrv1F0MBoCvh/vqJ6l3n806Mxp6mvxXGa2QVQ/epXsaxUleavNWrIq8tuOHd/GSGX54cn6YGuACtSfx5vpwJUd0A5NMoYy1SAmk+CYLSvLaYkUkSpBekcbmqAff+uY7IfNpqAf4GjfQmIyon6yFwRnJzKdmB1NlP7oJDIGGtYCQEpDt91/wc59/Yrd1wyfbbZ1rwNngmm8qn9vgKOK1WNtZWPs1CSyVQl9dwkJIUuFc8HgjVfTnKbHO34M1Xs1o3DNGDm4SANwZjHUpN9H5OQ6n1Ir867iRA== Received: from BN9P222CA0025.NAMP222.PROD.OUTLOOK.COM (2603:10b6:408:10c::30) by SA1PR12MB5640.namprd12.prod.outlook.com (2603:10b6:806:238::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.11; Thu, 10 Feb 2022 13:31:28 +0000 Received: from BN8NAM11FT036.eop-nam11.prod.protection.outlook.com (2603:10b6:408:10c:cafe::36) by BN9P222CA0025.outlook.office365.com (2603:10b6:408:10c::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.13 via Frontend Transport; Thu, 10 Feb 2022 13:31:28 +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 BN8NAM11FT036.mail.protection.outlook.com (10.13.177.168) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4975.11 via Frontend Transport; Thu, 10 Feb 2022 13:31:27 +0000 Received: from rnnvmail205.nvidia.com (10.129.68.10) by DRHQMAIL107.nvidia.com (10.27.9.16) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Thu, 10 Feb 2022 13:31:26 +0000 Received: from rnnvmail203.nvidia.com (10.129.68.9) by rnnvmail205.nvidia.com (10.129.68.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.9; Thu, 10 Feb 2022 05:31: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; Thu, 10 Feb 2022 05:31:24 -0800 From: Eli Cohen To: , CC: , , , "Eli Cohen" Subject: [PATCH v1 2/4] vdpa: Allow for printing negotiated features of a device Date: Thu, 10 Feb 2022 15:31:13 +0200 Message-ID: <20220210133115.115967-3-elic@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220210133115.115967-1-elic@nvidia.com> References: <20220210133115.115967-1-elic@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 25d5fe95-f3b9-4155-c74f-08d9ec99a481 X-MS-TrafficTypeDiagnostic: SA1PR12MB5640:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:660; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jyXScTPiFulnzW5OL5tQiS4s2nrcdxfNipU9FBr2pr+yiq/j15HOVBkQmDuueVvwsmk+jFXT8nU63R5NibYys9xvzj1s8wXZSbRPMipcZYjFRUV6H0kMUY9xpgKziA1tsgaPAaceybgZmA38e11i1CtTyIeHQirbbm1VdRgVfJXb7rN9LGhlRq/AiFQXOfrpfDPTbtRvl3teqCMGQA8j8VMawnSJGOm2mzM4Pkwo1M/R929ON4I16skT4ZgqJm1vhTLMC15vN/PQ6BwAhZdiLxcCzvxTmH1fD1LdG2OVot7krM1sb/KEl6Fa+wlb70GBaAw7YpTWsRStk3H5IGGPZ5Ln70G30JIrB8V1WFQn5YQES6ez4swDddX/TBTA0UDFHjfIP+6J9QFVTlg+gyfC4GvGqtajGRjtGGcopKtjhi5hujY4WCut7eLEqokUIM2fCJV5J2oTJQYmXbSiMSgkYNYOW7QQ5EryrlvwrU2kMSKQvUYiLyZaU5ucAPxqZWUpQAFuYPm1TmTz2EgmoIobB7GIq1Izg/SQ1wg4unRgJAp6Nf7H550jf5c9Ihvg9bgn8SchVFFcWv89CMKpVg7YBRYDdQmYOdScz8pZC0wzrwmirsLvTVsAeFObabkCk1mphngk0GzWYFDmYukdIr9c6F3HsCQnh8aAZ/slwm8L+ynnwxT5BT+RZbIVLAc8cCbo6trYeMGNr8u4gX1vmJBp5A== 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)(426003)(336012)(70586007)(4326008)(186003)(5660300002)(26005)(82310400004)(70206006)(86362001)(83380400001)(2906002)(81166007)(8676002)(356005)(6666004)(2616005)(54906003)(110136005)(7696005)(40460700003)(36860700001)(107886003)(36756003)(8936002)(47076005)(508600001)(1076003)(316002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Feb 2022 13:31:27.7662 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 25d5fe95-f3b9-4155-c74f-08d9ec99a481 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: BN8NAM11FT036.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB5640 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. $ 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 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":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"]}}} 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": 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 --- vdpa/include/uapi/linux/vdpa.h | 2 + vdpa/vdpa.c | 126 +++++++++++++++++++++++++++++++-- 2 files changed, 124 insertions(+), 4 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..7deab710913d 100644 --- a/vdpa/vdpa.c +++ b/vdpa/vdpa.c @@ -10,6 +10,7 @@ #include #include #include +#include #include "mnl_utils.h" #include @@ -78,6 +79,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,17 +387,120 @@ 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 void print_net_features(struct vdpa *vdpa, uint64_t features, bool maxf) +{ + const char *s; + int i; + + if (maxf) + 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) + s = ext_feature_strs[i - VIRTIO_TRANSPORT_F_START]; + else + s = net_feature_strs[i]; + + if (!s) + print_uint(PRINT_ANY, NULL, " unrecognized_bit_%d", i); + else + print_string(PRINT_ANY, NULL, " %s", s); + } + pr_out_array_end(vdpa); +} + +static void print_generic_features(struct vdpa *vdpa, uint64_t features, bool maxf) +{ + const char *s; + int i; + + if (maxf) + 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) + s = ext_feature_strs[i - VIRTIO_TRANSPORT_F_START]; + else + s = NULL; + + 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) { + 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++) { @@ -579,9 +684,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 +716,18 @@ 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]); + if (tb[VDPA_ATTR_DEV_NEGOTIATED_FEATURES] && dev_id == VIRTIO_ID_NET) + print_net_features(vdpa, val_u64, false); + else + print_generic_features(vdpa, val_u64, true); + } } static void pr_out_dev_config(struct vdpa *vdpa, struct nlattr **tb) @@ -619,7 +737,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 Thu Feb 10 13:31:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eli Cohen X-Patchwork-Id: 12741934 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 E24FFC433EF for ; Thu, 10 Feb 2022 13:31:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238672AbiBJNbl (ORCPT ); Thu, 10 Feb 2022 08:31:41 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:57558 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242243AbiBJNbg (ORCPT ); Thu, 10 Feb 2022 08:31:36 -0500 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2070.outbound.protection.outlook.com [40.107.236.70]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B510BD9 for ; Thu, 10 Feb 2022 05:31:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lXJj8d7xu22dhVCkpryQSr4e6D/iKAsnLZFc1q1szoecoPpRNBohg+lP/8lzlPF5ckdoO2PdzpfVnIAv5xWwKqZrjUbubaXmhUGcxalZrIxVKiA1E8dSgKqnlH/1SXJFk0L/HfVMxKdjnp9y+fvkrIYfgbqHGxOpeWFsjZmSOw+YUDVRWI01qLXUjJ87Dr/V4BEs0GVEjZKZ2tNReFOvo/OzIzTS4Q8MSREXQhubHT7bkshArLUDPfiApFmDE3recTdxRsXU9SCfSdVLnafPfXtp1cKQF7p7jLUh+W/AGYmiPRCrQpmQvU9M+ST/eqX0CXn2CO6eREclPTGMTOUNWQ== 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=VSfMbxPbxhzj5rycIW/cFFylDGzKH40EPGQQbDR/rBA=; b=cp7KMok+FSCTZThp5tWFa2Fts5iKyGVpgx25Ry5p+vtEX8oe8tzHbhJ1uq/CCldtQrooPINBNPxkDwS9+h3myARia9UfAUWqwMbovJ4WuPeDzTa+ExeA+G5ZXUL8KR1/rB1PtIVRcfArLjn4FbIZF3ljGY6c+Xjy3nnQiggdz3ZMdIBDUBS4FsQgsItRJh/TxLHm6kXucf2AXLRPcDV1IAfnjqAyAUhRNMbB4mjUGIpDIC7LQ5zSQhAUFdW9ZIv7qnWrRpDPb/LycG6cTBDe11Ph/HY4Hqy3I1L7OaKqTVdEIhFMY9VViCdilfjFpSSS1ZMuCttkrH+Le82OaoOC5g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.236) 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=VSfMbxPbxhzj5rycIW/cFFylDGzKH40EPGQQbDR/rBA=; b=pt6xlKfSa4BTqQSxIh7FXcHJtPCHWFlg0dB9BUEeVGCDjULr9A0oafK7RZCF7cqdDhflKBmktOENJYVfFdLRuEVOmyFICvpi5FEoumkD2ICH1PPk4n5blMcFsjcPp0TAchaYmTSNcog9cGC177Nf4oU7qd6bx5BDiG2Ixw7KN5TgoCqVZrSRBuTmNlcB8EviAqiqsAg5587OHQXLuL1mUrKiY7MYfplzsFKgQFiVcef8aj8xYJ0mAPda9j2qZ5+h6+HCttXsCsFDDaJBQmdnMe4sJvVH4tW817R3/zdJesj74/LRbbizYjhplBdHuUDTj15YYEDcXl56hKXv1PLpMg== Received: from DM3PR14CA0129.namprd14.prod.outlook.com (2603:10b6:0:53::13) by MN2PR12MB3246.namprd12.prod.outlook.com (2603:10b6:208:af::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.18; Thu, 10 Feb 2022 13:31:34 +0000 Received: from DM6NAM11FT052.eop-nam11.prod.protection.outlook.com (2603:10b6:0:53:cafe::8e) by DM3PR14CA0129.outlook.office365.com (2603:10b6:0:53::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.11 via Frontend Transport; Thu, 10 Feb 2022 13:31:34 +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 DM6NAM11FT052.mail.protection.outlook.com (10.13.172.111) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4975.11 via Frontend Transport; Thu, 10 Feb 2022 13:31:34 +0000 Received: from rnnvmail204.nvidia.com (10.129.68.6) by DRHQMAIL109.nvidia.com (10.27.9.19) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Thu, 10 Feb 2022 13:31:28 +0000 Received: from rnnvmail203.nvidia.com (10.129.68.9) 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; Thu, 10 Feb 2022 05:31: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; Thu, 10 Feb 2022 05:31:26 -0800 From: Eli Cohen To: , CC: , , , "Eli Cohen" Subject: [PATCH v1 3/4] vdpa: Support for configuring max VQ pairs for a device Date: Thu, 10 Feb 2022 15:31:14 +0200 Message-ID: <20220210133115.115967-4-elic@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220210133115.115967-1-elic@nvidia.com> References: <20220210133115.115967-1-elic@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 34d185e3-4895-4337-3c38-08d9ec99a82b X-MS-TrafficTypeDiagnostic: MN2PR12MB3246:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5236; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: CMhYhkrZetnelL91KF06varWbivfpMHOc1XOUUFIhcKCt/2Z58v176fXIhXPNTxScyPe6JwC6hHEI4yXji58Zct4KEMFfUHkqBARQj/sZvoi9D7TsogGOjBrvaUWnVK0wKSZuwuXI76ULvdyraZdfmAIp2XxHnBGCc5FN+7pkfPLeGoFW/kepy5qyB3bCyCMF0pzGIWI+GfC2gJ/HVUEu1UwBlbt+OQlg8rAVby9FNww/mmcX4EB7tuqtCCpQ37SuztcLIvHPxMyzt9fpidQk/7r364D+Oh7AhV2d4nDoLyaXlncBhX2o8LgGP/HaidZ3vnXUVx9QkHH3rE37rRdeAOIXhEHlP4j5nhHNwcsEp78dhD0y5pJru/0b6skXeqmh/Z6A4bTr8fdgPq0sU/ebtAwqCs8VY+ENEFiYis8GfL4OQjpCwpoIKEMP4fyWiwEwUsRoNhSyZTTlZ/fc9ZsWqP+TtXFQWbgBrqnYhlpdEGbheJtnddea0gk7E9R0wLNtOK9tN7q6lCE5RtPuqDTnGwGLLmftO2+zRjJLK7lqFNlEEAa68S2uXx9X4OJwMC890Jxx+byYsrvtbWQxryfWo29qOkUrg+cXK9JVW22JcFBptjHr55Z7DKfSnE5Be2k2VUzR0He7J7yfE7SnENZweKN0of2oAWPQVt7eFVlwtnwRTSPnERLgid8CbWRZX84yOYjh3Mb8b8jjAhDcBPSFQ== 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)(40470700004)(46966006)(36840700001)(110136005)(508600001)(6666004)(54906003)(86362001)(316002)(356005)(81166007)(7696005)(4326008)(36860700001)(8676002)(107886003)(336012)(2616005)(1076003)(186003)(426003)(82310400004)(70206006)(40460700003)(36756003)(8936002)(83380400001)(2906002)(5660300002)(70586007)(47076005)(26005)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Feb 2022 13:31:34.3786 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 34d185e3-4895-4337-3c38-08d9ec99a82b 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: DM6NAM11FT052.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB3246 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 Reviewed-by: Si-Wei Liu --- vdpa/include/uapi/linux/vdpa.h | 1 + vdpa/vdpa.c | 25 ++++++++++++++++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) 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 7deab710913d..99ee828630cc 100644 --- a/vdpa/vdpa.c +++ b/vdpa/vdpa.c @@ -24,6 +24,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 */ @@ -33,6 +34,7 @@ struct vdpa_opts { unsigned int device_id; char mac[ETH_ALEN]; uint16_t mtu; + uint16_t max_vqp; }; struct vdpa { @@ -80,6 +82,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) @@ -221,6 +224,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, @@ -289,6 +294,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; @@ -513,6 +526,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); } @@ -662,7 +684,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 Thu Feb 10 13:31:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eli Cohen X-Patchwork-Id: 12741933 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 A93DEC433FE for ; Thu, 10 Feb 2022 13:31:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242246AbiBJNbf (ORCPT ); Thu, 10 Feb 2022 08:31:35 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:57510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242243AbiBJNbc (ORCPT ); Thu, 10 Feb 2022 08:31:32 -0500 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2058.outbound.protection.outlook.com [40.107.92.58]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BB880BBF for ; Thu, 10 Feb 2022 05:31:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jxut6K1FRpBSh+g0TNsQqtmv1j1vn6a8BCID/IGRmr6cUFq8AfwGPl0GxcC03Qx04wK818QbAPWbOWCRADD+59Gg9w33va97RYj9Hvfwi5dd/diyOrMFoQV3FmUhG+3VMrpkajvnv2aOV1SbIY5m5BlC76igO2j0/GwSGCEJPU5L1hUIEAcEGk7QSBwTxMvJBG+3k2AKOTb/t9qEGzzGzZy+b0CjgEjjPyNwlNoYdpmnDSufjcHa6k5OGrJpTbvlC6pDpizpIsi/dSYJhZXsqDKQX8fe1LUvBeDHKgTWQtGV1kChY3tIOs+dCpO6euWrF3PhgnQivv34QRBF43SclQ== 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=CDakSM0HrmXSBPClR2t8m3EX4a4hnvGJz5Gzytmd/go=; b=gIObEXYvs7Jf3Ar0Bg/1/2ZXib2jl6NndmsyM71fruhbh4zLP00OlNAsJ8FI5tzzqlONTS+dRdEzkrQMSfWIywBbS2h/BGOolF9AP8beFzL4M0wgyzx/b+qCD6lABUg8bae9eVxFQj7+2sCesEWa8i0ZUd09/EXVPbiLxyc4zn/yfndb342CgAPagaF4Yi0lcdiy+8iiDW+bZ5C0IahfPBc7IKpmshSRWb+6qPhu3bEJcnzsS+NctiSusOqKPBqNQK1JEQ6V+Ez11cceJXERLjBe5eBOoEsBqji+CKecpvpqiHD9jsdqdYEYJrQ8x5FWNpyJMu6SskfRSebZ93seQw== 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=CDakSM0HrmXSBPClR2t8m3EX4a4hnvGJz5Gzytmd/go=; b=RkLNL6mJZ4ArXsMUHEPhFQ48Igpv0hh+d00fiIRJO11HiNhhZRyBVHKRDUkGKJFeAhllB5uYcQ4slGoJiYZUU4bRwkf7eJJAoqE6K1wLo7XxsfBOTEGtwKHecK9lSAkKm3uFCFf0ErhDJWQ4KwfXzH942N7JRmBRc+Q6txjcKPE1BhtNl25YgtSejMa3J2fcZPLXwafecXOeci2vyokLcvFBmtNH/Qrr6HaZgG7oZcscuRKZ740+jegtHBK5oP+tG2rx8olNgN+K0+nGbbWDwnqiuqET7JbrbV2TaWQ0hUvo/IBDxr2zVbtVubBIZTTYtvtQJiryv1HUjsvt28LrUg== Received: from BN8PR15CA0061.namprd15.prod.outlook.com (2603:10b6:408:80::38) by DM6PR12MB2940.namprd12.prod.outlook.com (2603:10b6:5:15f::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.18; Thu, 10 Feb 2022 13:31:32 +0000 Received: from BN8NAM11FT019.eop-nam11.prod.protection.outlook.com (2603:10b6:408:80:cafe::b1) by BN8PR15CA0061.outlook.office365.com (2603:10b6:408:80::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.19 via Frontend Transport; Thu, 10 Feb 2022 13:31:31 +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 BN8NAM11FT019.mail.protection.outlook.com (10.13.176.158) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4975.11 via Frontend Transport; Thu, 10 Feb 2022 13:31:31 +0000 Received: from rnnvmail205.nvidia.com (10.129.68.10) by DRHQMAIL105.nvidia.com (10.27.9.14) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Thu, 10 Feb 2022 13:31:31 +0000 Received: from rnnvmail203.nvidia.com (10.129.68.9) by rnnvmail205.nvidia.com (10.129.68.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.9; Thu, 10 Feb 2022 05:31:30 -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; Thu, 10 Feb 2022 05:31:28 -0800 From: Eli Cohen To: , CC: , , , "Eli Cohen" Subject: [PATCH v1 4/4] vdpa: Support reading device features Date: Thu, 10 Feb 2022 15:31:15 +0200 Message-ID: <20220210133115.115967-5-elic@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220210133115.115967-1-elic@nvidia.com> References: <20220210133115.115967-1-elic@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 99af2189-35b8-4eee-a4f7-08d9ec99a690 X-MS-TrafficTypeDiagnostic: DM6PR12MB2940:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4303; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DdA15txyIMjeYGkHUINdOd7adTIHZS8Jrgx1LFJYPd36mYiXdL4UeI5UGcfBrAhvOvCGLV+9+b2343gi+lRsHNPHjSNZwKnxgxoR5Fuf1y2ypw1G5m4fRQrsHTXl3yBur7ZqzG5ocRHx6MDwW6PuORoOJMEdhiW7GYwaO1CkfqDvVrjkU175EscqMn6K+2uFlu3PyADtxJ1/kUXTRDkdcxRyOduVFp9DNIwa+ucmg9dpKzdXgex8Wi1AouaAZPsOzjhk0DpkNpUJ2DxuB4RUCRBQsBSwcbBz0EpLC3sN8sPAyy9w7hLI/gSP9FcKmSVpQeIX2afBN8G+iyfiC+uYWzP66iBO+bx1mhNzy4Mxd+Tb0F3BrmI50pAtd8YTmGWabAJm15BmUfNCT5AHuXw7VBBf5huN24Xpb3Y+NMVvyx47zEd91qHK2O+Js9tpISXdMiKiqWDXg2dngzfUt71m2MqAIcjrPyMbW0gtMMxr/OvGvN/Lmy+Enx34PSUFIzEkEVhOR43/SZV+foLYnqz19cegZTWoGwSvS218OWgTCOf+62FU3L0MmXLhjY+4HzJFPpi2XyFv1b9WI/qXVRCAOp/MX7/RslwGaeyP6K6ZRtSk2UiY2uqgibqRVwe37Gq493R+PY4S5/HvmWGR7KESg9dqcdpzQFoSHbu9q2VcJ7vDQHSWmDctLm83aupgbR/+P658wjyri1NQIbweJ+JOoQ== 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)(40470700004)(46966006)(36840700001)(107886003)(1076003)(426003)(2616005)(8676002)(186003)(5660300002)(26005)(336012)(4326008)(8936002)(70206006)(7696005)(6666004)(36860700001)(54906003)(508600001)(82310400004)(86362001)(40460700003)(316002)(47076005)(36756003)(110136005)(2906002)(83380400001)(356005)(70586007)(81166007)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Feb 2022 13:31:31.6409 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 99af2189-35b8-4eee-a4f7-08d9ec99a690 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: BN8NAM11FT019.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB2940 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. Example: $ 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 Signed-off-by: Eli Cohen Reviewed-by: Si-Wei Liu --- vdpa/include/uapi/linux/vdpa.h | 1 + vdpa/vdpa.c | 11 +++++++++++ 2 files changed, 12 insertions(+) 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 99ee828630cc..44b2a3e9e78a 100644 --- a/vdpa/vdpa.c +++ b/vdpa/vdpa.c @@ -83,6 +83,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) @@ -535,6 +536,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_net_features(vdpa, features, true); + else + print_generic_features(vdpa, features, true); + } + pr_out_handle_end(vdpa); }