From patchwork Thu Feb 17 12:30:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eli Cohen X-Patchwork-Id: 12749993 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 A6CC9C433EF for ; Thu, 17 Feb 2022 12:30:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240453AbiBQMa5 (ORCPT ); Thu, 17 Feb 2022 07:30:57 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:37594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240389AbiBQMau (ORCPT ); Thu, 17 Feb 2022 07:30:50 -0500 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2079.outbound.protection.outlook.com [40.107.236.79]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 406372AE285 for ; Thu, 17 Feb 2022 04:30:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d9rdXTr5yK8n293hjIeNCh345As+/oLn+yGyxtuKAbY9Sb82/g7Up2ucbPXxn0G2YkPIZvzDi3WrL7K9Fh85LJ6cdzj0ckahdGss4n/lzvKn2a/FOPhhjsqoCDKVFBTY/VuZG5rEcX5f1luWiT3h9bnF2nNx0Bon7yXzD/uFbuTPrxmu7I6VhfG2bWyIHghSi+xp8rsRw/mQq65BvR810dGj4Vzwfla6eZJrVl6yTEiF4t+5B7R/d/ngubWfmkVN8W0I/fGlreB7Dqn0FT9XYrV1FdOtZ9EE7PrAoOSm1r/p/Akm1MaEUr+uuF1HeyvqwljlYQcpkgSDSumvbcbDcg== 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=vqd1bV42DTyPW9q1B6EotDRiKAzl2TFfYZq4u8ZPlqc=; b=epao9FXs4GiA0NDIIRjS1HU57L+z1Mr28G5vQsSaTH/wlYgGQ8+wXm5AATuTmI+OXx4iClPe/XgA2q8xBy3bpBAL67Syio6iKu1LCQSNGAl6pesCX+ZFU60zSlAsAci3RLbEDNOdCgzgdi19xamJwb3FgIVr+vUCZn8w8AODs0Jqmgt2ZDTHlpFLUrJwR0cqHn8OQ9CcQkhhqszoSIlceceLPNA2LjRlEaDfLoeDP3/YYrxxJAH6GF61ENNEb8p+9Y1uKg/PWU3YLCOD+JhVygCGPaYfVdeuCXrqeETK0yhW2a3tiERrY4KsPHxEG1YTabVb8qSWDJC9XGQQLPzPFw== 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=vqd1bV42DTyPW9q1B6EotDRiKAzl2TFfYZq4u8ZPlqc=; b=ShHgwh0B2XUnSQil0bY0Tkl6ESY+LTX8Kl1Krj4IEVEgv1HH1KxMAvy/eW4oi2B43HuT9IoNU6mbGi9ibTbqiDkaWbjypXuyIPNn7Hdj69xqoHOgCg5gvf6pjycsg1DE/oTZgWMJG2wg/JxdCKPPUW39gEmelzdB8//1iob3GmrPqOdO6str0wLnKZnQ7vdbyh//F94nP+AwTTaN/N7LiznvLCcSeoq0IHQAUIZWoUohOTpRGZ/k6wKWx74ZbvwpiEwCar46L5nWMpDf9LGErybJGje40ggo0h+6FNcihZh35NDC1Maq9vU9Hb2W454SquTksy64rQOGKIzpFP7Rog== Received: from DM6PR01CA0024.prod.exchangelabs.com (2603:10b6:5:296::29) by BN9PR12MB5179.namprd12.prod.outlook.com (2603:10b6:408:11c::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.17; Thu, 17 Feb 2022 12:30:34 +0000 Received: from DM6NAM11FT057.eop-nam11.prod.protection.outlook.com (2603:10b6:5:296:cafe::4) by DM6PR01CA0024.outlook.office365.com (2603:10b6:5:296::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4995.14 via Frontend Transport; Thu, 17 Feb 2022 12:30:34 +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 DM6NAM11FT057.mail.protection.outlook.com (10.13.172.252) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4995.15 via Frontend Transport; Thu, 17 Feb 2022 12:30:34 +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; Thu, 17 Feb 2022 12:30:32 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) 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; Thu, 17 Feb 2022 04:30:32 -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; Thu, 17 Feb 2022 04:30:30 -0800 From: Eli Cohen To: , CC: , , , "Eli Cohen" , Jianbo Liu Subject: [PATCH v2 1/4] vdpa: Remove unsupported command line option Date: Thu, 17 Feb 2022 14:30:21 +0200 Message-ID: <20220217123024.33201-2-elic@nvidia.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220217123024.33201-1-elic@nvidia.com> References: <20220217123024.33201-1-elic@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cd9ec239-138c-4a74-b8b0-08d9f2114b5e X-MS-TrafficTypeDiagnostic: BN9PR12MB5179: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: ngZmz8pVIPg2rxr89NkMfaBFKAMzmUQtmv5VUZrAyMGfx0eJdP73epYCnkzh8PZPPEFdLVCylpM59Z9hG8+kQE3IR65f1g0oPTYrtUOuRtcWj39jqeZqr3ZPrBzY8XOurDIfAlOn3ork/C9gEPw2kya1R6I3u2RUBfzjHDM+6VoHGWGZ4w6IxX53KASs1lLipWx6y+TLcVJV6rhWqESaaqRFuS0q5PkYbxdhs2VUo0GqJ2eT10LTENlHrTNhXwOxCAij+y5xiIdjWMstmH2IAiM1SZ8dpIQQvltgJQdNCe4nbDspY+dbYPdkNVfgQLkqUytDxYknTPlL2xVpstezkc41JR50/nFv+Tlyvd/oPO9tWg8tGhoswuigCt3USJz2RsGgbfilkJmct/ZizMOV0WXbDduJMlbl94seB6AadlYr0juhF6S+9tFcu/W+Hj456SumNI13k2uPhlwKQX1dg/hWWdsZsc15gc4GLT3UOJ+XK2hlUTABdPNd+8QFL1svtlsQ5bDayZpA5AIcdDKS4aml8htrq/gSawyl6aKBhJMWG3zUhK6MNhVlu3uXgzWPXE0VctPURztq2XbCUWNaeC7xSMmXH+xL1sO330OpEv8qfLW262vP6m6SlIriK4/QK0+lHhK6huWnXN3QbFdIhYY2dxlbINHKxKjJGYtEjSYDEidwEkXNV8LUruJD+ft9MHx00ZuN7SAVFjQMOBTNIg== 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)(46966006)(40470700004)(107886003)(82310400004)(2906002)(6666004)(8936002)(7696005)(8676002)(4744005)(36860700001)(5660300002)(40460700003)(83380400001)(47076005)(110136005)(54906003)(508600001)(2616005)(36756003)(81166007)(356005)(86362001)(4326008)(316002)(426003)(70586007)(70206006)(336012)(186003)(1076003)(26005)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Feb 2022 12:30:34.1094 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cd9ec239-138c-4a74-b8b0-08d9f2114b5e 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: DM6NAM11FT057.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR12MB5179 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 17 12:30:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eli Cohen X-Patchwork-Id: 12749995 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 E8729C433F5 for ; Thu, 17 Feb 2022 12:30:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231592AbiBQMa7 (ORCPT ); Thu, 17 Feb 2022 07:30:59 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:38150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240469AbiBQMa5 (ORCPT ); Thu, 17 Feb 2022 07:30:57 -0500 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2089.outbound.protection.outlook.com [40.107.94.89]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BFE132AE2AE for ; Thu, 17 Feb 2022 04:30:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S3aegGs9+6tkwPuKHrsyJXJN3JGLNnrL08XIE51xYkpqU3KPAiKF5eGoeRqbc6WHd/AMdP/hVqg6wSSQx7AvGJPzYezRpFpPwOo+TZQnobzhkKbRlKutGJO+lzuzEj2+jkpJ1JEgN9Z4TWComnrlFA78hNXoLCJCdoR+hif8Lo1yeJ1EnP3O0apWlEQPfWvdnbNcTd3FoD/bjLm1/zBSoOwHMzGI14uh0E74/gW6dEperH1Q7QVxhG6iAIrLLmLM9XFJZK+TZjy8xQBnIwF7m0p9liy4j+5lvEnZ9zqey8lHPMXGiCy5g66Cl74L/TLQF7zjKGwVM6eGpCn6Nv2nhg== 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=8kPbF5jfqKpVao7jJiAEpEv2Pa2bKwfjdpeEryaWNYQ=; b=cYIEHVdNxr+yQvPACSdcMaPMRkcOnXn+Bl5GVYIzP2uyi3zYHyw196+QSFbwN5T8VTrGS2SAIPNjW0cpt9GVplBxpUFnQPjbfs3YTThxLhZJsbdnJIn2kQp7MJsbMkhUmvMVfdG8FBFqP5F88yng58BDWcCHjx4kHZbbr540JKIJMP/gK2gkhCwAeQGd7Uy9uBESuD5MC7ORZiCImcybL6E0cqcvj+j/kWqIZuMxTBDQtVAVU8oYCyE7OQU9k/4TzYKcTh1XdP4zgTERC6GKz4N1bRKBo1VBXy3kkNxsRQKMwArzWWpk2owVVAdWnqw9bbXSdZtBua8XAPU1etzwMQ== 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=8kPbF5jfqKpVao7jJiAEpEv2Pa2bKwfjdpeEryaWNYQ=; b=nrw1UE3HQaCqozQVVLe0D6FV7m1wZneiRzikUJdJ5pnQVzISCDWxDHHPGnBat7pwo3S4ZDtG94f/hVbVptAqiAiBAb3c1LZ7qhz9dN3HDBwTj6zrJpbkRfaz17RnKqr5KVtc/rT6fEyZYEmNxsP6Z9gHZySSkqqrtPqgS/3bkPGI2r2psTP5Ql7uoQA4yhHnfo3SSZG8qSTXKIzKuiSA5OEBQb05IOFBXJ8vY9C91nWbytxc550WJniHNYk1B5nNpOnMqjWtxizVyM/xsmdkUUMVXEVIP4NRmnSHCx+PdVqWxYzCy1cTdVkwVQdhISbqRTpbRmEW3I2QU0SRCmfVBQ== Received: from BN0PR04CA0203.namprd04.prod.outlook.com (2603:10b6:408:e9::28) by DM6PR12MB3401.namprd12.prod.outlook.com (2603:10b6:5:39::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4995.15; Thu, 17 Feb 2022 12:30:38 +0000 Received: from BN8NAM11FT064.eop-nam11.prod.protection.outlook.com (2603:10b6:408:e9:cafe::46) by BN0PR04CA0203.outlook.office365.com (2603:10b6:408:e9::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4995.14 via Frontend Transport; Thu, 17 Feb 2022 12:30:36 +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 BN8NAM11FT064.mail.protection.outlook.com (10.13.176.160) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4995.15 via Frontend Transport; Thu, 17 Feb 2022 12:30:36 +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, 17 Feb 2022 12:30:35 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) 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, 17 Feb 2022 04:30: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; Thu, 17 Feb 2022 04:30:32 -0800 From: Eli Cohen To: , CC: , , , "Eli Cohen" Subject: [PATCH v2 2/4] vdpa: Allow for printing negotiated features of a device Date: Thu, 17 Feb 2022 14:30:22 +0200 Message-ID: <20220217123024.33201-3-elic@nvidia.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220217123024.33201-1-elic@nvidia.com> References: <20220217123024.33201-1-elic@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bd12a678-c30a-4e19-618f-08d9f2114cab X-MS-TrafficTypeDiagnostic: DM6PR12MB3401:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:935; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: yRGb3fsJann0Sreke4P2dhOLYxEkhcNwmE0aO/JHHbbbR+2gNRXeFqRYj3KekSrkzhvKISnpmJhK1N8dulcGd1cSdmFtw5JkGC7OQg5SuROdX7NcniZWgEfLEEUHwdz24rgPRjlwJGBnMXAy0ckXxxmIUnuX3RYYsXc79fYuBExb682oEewqf2PEHJoH1l1JJ+QejO+FUiwO25xABcnxn/ScH9C/3rFfKL5DgMpAsfxkdRgss1eh893RYWoP8LLfrT3I1ogzba/yJYL4YP6yre+0Y/b2L+fn9g8biGVuBJ52zq6gND+RoSFBv4WmHy92xdMQkQK3qA809JoYhpcQBATQy6UoZKm/xDFWaU0zQxaaib032edbyToeDrwEFhLAJw4Un9za2dKupZ/QYYkR/20i71Bg1JWJwCNqHLhZFYoVP5SFVCWYFqV1RkAN8V9UcUuIcHZxZgF136yY9fhn3cNiGOMh0Hhkl1db+G1Ib/M3o/DZyWho9rNRyWL1n4z/r8n4zMrsDHSktMO0RKPoxekur20ANWuYdU+CBQ6NtFRtKwBNtMmKbCl/R2SZESXFytXwbA2JyYaCyO8f78LdHoU2mc5a/OSKTVQMR0ljX2nB9S62dDBEJ8SDhjGKtavFpuyFKQTuQkLThbZ9Gh/JReSSBTogR3mqUbY+hIPbB8RDk5KA0b5aBBaEamc2n0v2uC4rIRSkPSqkG2DR0BddOw== 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)(316002)(336012)(508600001)(2906002)(70206006)(81166007)(356005)(82310400004)(110136005)(4326008)(54906003)(5660300002)(7696005)(40460700003)(6666004)(8676002)(36860700001)(86362001)(36756003)(47076005)(8936002)(26005)(426003)(186003)(83380400001)(107886003)(70586007)(2616005)(1076003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Feb 2022 12:30:36.2583 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bd12a678-c30a-4e19-618f-08d9f2114cab 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: BN8NAM11FT064.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB3401 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" ] } } } Signed-off-by: Eli Cohen Reviewed-by: Si-Wei Liu --- vdpa/include/uapi/linux/vdpa.h | 2 + vdpa/vdpa.c | 108 ++++++++++++++++++++++++++++++++- 2 files changed, 107 insertions(+), 3 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..f60e647b8cf8 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) { @@ -395,7 +488,6 @@ static void pr_out_mgmtdev_show(struct vdpa *vdpa, const struct nlmsghdr *nlh, if (tb[VDPA_ATTR_MGMTDEV_SUPPORTED_CLASSES]) { uint64_t 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 +671,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 +703,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 +721,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 17 12:30:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eli Cohen X-Patchwork-Id: 12749994 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 C4E6EC433EF for ; Thu, 17 Feb 2022 12:30:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240468AbiBQMa6 (ORCPT ); Thu, 17 Feb 2022 07:30:58 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:37932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240485AbiBQMax (ORCPT ); Thu, 17 Feb 2022 07:30:53 -0500 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2044.outbound.protection.outlook.com [40.107.236.44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8D3582AE29E for ; Thu, 17 Feb 2022 04:30:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HHoAoLxvJ8Rf2SP4u4Q2cZkZmE+tPi99y3tEpq7Xn5+SH1R/BkCWX8aDOADkckylsmAIpt6lX/0E6QaUMpRM5Lnwscu2HFQEKD+iPDKGFNNtJ6C6De3kqQBLVJBL1ghe5okjwkxfxSR1sVC5puiHHjPmaFrY42iFO2glHD4ImFA+5lH/I9zjXgQa0dg1JJU0Jn80ChUd/EYkQMfZAGdYlv4ZumVrZLknNHDHOYC5cBfSKMytvUECaChLa5i8+I0A6WKEmF3fIA24okvaWs41QGjjWsNxJFftYodZ9ijrz8u7z10qNgKZg5tC0JathbUTYwVqvE3w4/SQfKcxzXxS+Q== 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=uZED+5AbRTZYloNKXrZy1erv8I3NY4hiT+u1mey0Dns=; b=e7uSL+vqq0vSj8pUc/u/GvVeAzpUQCgVL0ckqoSbInT92GVDXFC9b9G0HdsiqZLr4UFRo8O2JEMPB8Hn5LFmM2DqQ156GJ73mWkOYiqn9csbdfPU3q7o/Pl8XgQD146f64iHGOuxzJPtIyLdvVEGewH7jLGXT25g8+ZLfd8yO8MtpdPTTq5lnRqjF6v/Jdwzdb0CGCHhBEEBaB3byzZexrVZASs10a6cA72SVWFXm1N065GE36ZDsbMM6a7PpoJ0xtINkCqAt456g3LtmaJTfdauEdNl74CpGdE1q5J0jTcL9QHExabZOjn2YsDFCNG6TC4Xf5ufypyX9tn6nie4UQ== 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=uZED+5AbRTZYloNKXrZy1erv8I3NY4hiT+u1mey0Dns=; b=VgLAXNNR8CHSeuWZOTp0/MOU2ak3qgsP5CM1y30kDkfxHRyQU2rbn8caX3145vjWH2T+pLIM1MWO45vkHfltvGPFAe50bwLWQ3QWdj7uWw1vZP0Wrn/ezjFMvqCPyv+QxammW796ojEwE/bC3r8W/SMSgyXg+hiCN37J3/3mjfE+xjLe7epqBUNpPSD3Fzw6Obys7OdrwhR6ZohwQcVBiL7WIdbR+gcH6LXmRghekeXDlBI/U1Fzgd9YObFiTR94WzMpnD25pPlVa4Q51awcm1ywf2cJ3Apc+G7oJm9yehd471znnZA9F0DoPdrSEpfi9PBvBOMakHM6g+XSIej7vA== Received: from MW2PR16CA0055.namprd16.prod.outlook.com (2603:10b6:907:1::32) by DM6PR12MB3739.namprd12.prod.outlook.com (2603:10b6:5:1c4::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.17; Thu, 17 Feb 2022 12:30:37 +0000 Received: from CO1NAM11FT068.eop-nam11.prod.protection.outlook.com (2603:10b6:907:1:cafe::8d) by MW2PR16CA0055.outlook.office365.com (2603:10b6:907:1::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4995.19 via Frontend Transport; Thu, 17 Feb 2022 12:30:37 +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 CO1NAM11FT068.mail.protection.outlook.com (10.13.175.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4995.15 via Frontend Transport; Thu, 17 Feb 2022 12:30:37 +0000 Received: from rnnvmail205.nvidia.com (10.129.68.10) by DRHQMAIL109.nvidia.com (10.27.9.19) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Thu, 17 Feb 2022 12:30:37 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) 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, 17 Feb 2022 04:30:36 -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; Thu, 17 Feb 2022 04:30:34 -0800 From: Eli Cohen To: , CC: , , , "Eli Cohen" Subject: [PATCH v2 3/4] vdpa: Support for configuring max VQ pairs for a device Date: Thu, 17 Feb 2022 14:30:23 +0200 Message-ID: <20220217123024.33201-4-elic@nvidia.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220217123024.33201-1-elic@nvidia.com> References: <20220217123024.33201-1-elic@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6e951f94-cbcb-4acc-e51a-08d9f2114d58 X-MS-TrafficTypeDiagnostic: DM6PR12MB3739: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: H3gAWNUdGQp/MTxBfCxgwbPdmsJZIbO2G6EOZ8XEkZ+2Q8WrfU+if1KFB6HianMEeMl4s459UGlVvNS/6qtaIs99iAta6TetTz5lzXqAAarxjOGVbFHJtJRe0gaOIO3JfvFoThkyFcztpF7KPTUkI8gywlP3Q0UVT68hDLCNJITmTg9FHqkd/Xd+SMuKInA3rVaXFVEXgK2DmeIbLbFjTiDB0rU6UoM2AvKiKPawSdf9oW9VUfnpgXzNDGujNQ4difH7xTughWOiTI2vuUFFoZTeCbtY6ERHxzLCqdNWoace0pDwGns5lF5HeueCIQNLz+RQKnaE8MMmQHGCrplUtYE057Fh6nFvVm0e+SDbq5MEKIP88kaPbYTAs4Ni0CS+OEy4Dr+OMTI1tgF+VJy93gpoVYG92ujY3z1qDOa/uB9Wf+P+OXswUHWCk4qraeKlzO4KZDtV2fwmru0YoHH1yTplHcg8XWV1Mnl3/bGo7NWZlYrTlUy2FBMS996C7NFyyKzElDQS44DxLHk6CGpeRh8/fsxCIR1YNCLLqPO2RfAZIXd5l+4GrCFPcwRCoG4eoigJJTwpoykWjmftvBV1sd1E4hykri1gJVH2RQrGssBDWzdtqF41vK5AGPBguoGRit4YqvucXI7vK3I8D7d2pvOwAIs1as+qss3wuONF56FK83eu6VFTcOljCOOdK+KD9TG8llWlliyCm9SMmLHy0w== 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)(36840700001)(46966006)(54906003)(36860700001)(2906002)(110136005)(2616005)(36756003)(7696005)(86362001)(8936002)(186003)(70206006)(6666004)(356005)(26005)(426003)(107886003)(70586007)(83380400001)(336012)(47076005)(40460700003)(1076003)(4326008)(508600001)(8676002)(81166007)(316002)(82310400004)(5660300002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Feb 2022 12:30:37.4579 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6e951f94-cbcb-4acc-e51a-08d9f2114d58 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: CO1NAM11FT068.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB3739 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 Signed-off-by: Eli Cohen Acked-by: Jason Wang --- 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 f60e647b8cf8..78736b1422b6 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; @@ -500,6 +513,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); } @@ -559,7 +581,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"); } @@ -649,7 +671,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 17 12:30:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eli Cohen X-Patchwork-Id: 12749996 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 2A857C433F5 for ; Thu, 17 Feb 2022 12:31:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240445AbiBQMbL (ORCPT ); Thu, 17 Feb 2022 07:31:11 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:38790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240466AbiBQMbD (ORCPT ); Thu, 17 Feb 2022 07:31:03 -0500 Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam08on2043.outbound.protection.outlook.com [40.107.101.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E69F02AE285 for ; Thu, 17 Feb 2022 04:30:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lkMGHhbNNgWtqbT/ik6tLXcgnP/VlXInSfHTZ2V9BSxebOcRtwkS+CykRx9dsN2/813J/J7UkeI+O/KHaFqqCpRcjPTYaFsCnnsXFfr9lnTSrQKVd4bAGPJbeSHKz+EVVcn14RE72U6OoNGiygBgsK9NC5qDiqkM8Pft9U8tqI0hutaSKjHOsoCNRXUuVi0UCDRLIlYqi/1XsvTdrEo077yE3MCSvI6fwyCjvFedEcUvhinYbi6XWQXRxEWHB23wSd36cTr0C1R3FRd4YWSDOQZZ/zX3oz38cwQ0SP1bC0FhBeNdYk1MHf+MU6a/vMy0YU6m2ze3J66biTiIOPbSPQ== 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=iN4Ek6wjJtFoCabV8LWa89JIOALbln+927Jyd3Ub49M=; b=M2EYasUroQGn0fxnjpAWXL6ZVNrHzaz0cPJJ4PE9+bN2YLwoaTVa+cpaKWnmb+2I1z/a5yJweJb89Beh6g2INXMxNtHtbIY7AYv9BRxE9h+nscSBUiATtJbOTM2e97RKAjBSTV9UzMdIy/vHHZVPM75nOX9t/gaGL5jD8sCLD2qhiiTVrtRysk48FSGLfBjfmunGEtBYHreCnDeCFhW0oLhMElbnkH8a5vWw6NVIDUTRcM9kon/OK+z9PsKtEuo3YtRpb18+UMFLVTMu4ahFo8Z6lb5T5Ur+/lzd1n2kCvN6GxHmQ9tjw5GtpHxb6oA9LyCAXZ/DyTlkm1FJ4fT4CQ== 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=iN4Ek6wjJtFoCabV8LWa89JIOALbln+927Jyd3Ub49M=; b=GROAq+rX+X36HUCtpXbhgRG0KakIrp6a59KjtyYNdSuY+hca7dPsgj4SQMZIaJLetIH7FRJZNvxG6EO5BpZXOtEtowE/8YGf+vjcgC7hHkfYN5l4Z5X7TbNRk0MQal/iBX7jIdVihIa33w6VqCg7Cdr980KEtD6W4N83N510L1HjtG2DXpIesRmsxpR4hENvt4n8NZeANh8qRwX6x3/FSU4zvV51s3jLsBPNM64CCv0iMGajD0hF6asOWww9sriX6QhC3EaWeRl811Zlgr66AtAdTd5JwiG8rlsXSoJ5FI9ciPTEUcG36h0kIyCezdpXabL7vrAfK7ivRhSTHcLsJg== Received: from MWHPR22CA0062.namprd22.prod.outlook.com (2603:10b6:300:12a::24) by MWHPR1201MB0047.namprd12.prod.outlook.com (2603:10b6:301:54::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4995.16; Thu, 17 Feb 2022 12:30:40 +0000 Received: from CO1NAM11FT035.eop-nam11.prod.protection.outlook.com (2603:10b6:300:12a:cafe::40) by MWHPR22CA0062.outlook.office365.com (2603:10b6:300:12a::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4995.19 via Frontend Transport; Thu, 17 Feb 2022 12:30:40 +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 CO1NAM11FT035.mail.protection.outlook.com (10.13.175.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4995.15 via Frontend Transport; Thu, 17 Feb 2022 12:30:40 +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; Thu, 17 Feb 2022 12:30:39 +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; Thu, 17 Feb 2022 04:30:38 -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; Thu, 17 Feb 2022 04:30:37 -0800 From: Eli Cohen To: , CC: , , , "Eli Cohen" Subject: [PATCH v2 4/4] vdpa: Support reading device features Date: Thu, 17 Feb 2022 14:30:24 +0200 Message-ID: <20220217123024.33201-5-elic@nvidia.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220217123024.33201-1-elic@nvidia.com> References: <20220217123024.33201-1-elic@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a7c5dcc1-d62d-461f-97cc-08d9f2114f28 X-MS-TrafficTypeDiagnostic: MWHPR1201MB0047:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3513; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: b2DsKLMYkHJin32TmqrNj8Kj9WWxc1AZ5XjrDCG5Kt01qUoUXyVswAqoIz0gMd4dyBDet95hqKQ9Li2j6tt21U7aOW4EQtSyT1qtgeJbSy6aO9WHxTZhaDJeqOqW4Cu9LtWvaDe4BcgpmbfgN1KHFVQtXx9DEFprWfvWnOoKobUQdbWgAsAkbO3vwmdNEwGbr1TNHhm+kAsYaDxLx1CiTvVqhRqNApDrqtktuKBs9nYh3NXu8vp6Ojmrdq6E+fJK89A/q/6p7sMbDJ2qT3PKbUeTESXhfofgpv+G8zWGk5N9FXLLFOCBC8Z4EfEBNrnioTP0NYWaclTAfMklPxm1BNBXq1OvhbGmCcVkn2Xs/ztH0Mdu0/tkdsZYvPx2bKRwDUjo1RF61VPqU6xKKkUDFsw6KTxZ63jKaGvmzBJU2PbMvzjIFddd2uKvH+1XwUAse2u0+7hZykrXDftvVcMm/2wpgNPQDoR+llpkO+rEwG0kXtvY2XGVZzBhKwvqlcnS22A8IC1FAha8enVjt4HDrBP2pH67hNcBQZrja1uampbz3KIvr4aIiK/r9SDosBNYPxDR53366ykwQmuYb5qyO/FbWbNBrUk4jVwvzXseOTtvTD2Eo7cctBA2bfj89eGXeErk63my+TtxQ41LPhYLM6cGKTWuv0eZX0bqBvzdMwWV3n325bxkrYZvie9vRLvrYnRLhH/KTfpTahs0pkogRQ== 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)(8936002)(70206006)(2906002)(86362001)(316002)(5660300002)(508600001)(186003)(26005)(2616005)(7696005)(6666004)(1076003)(426003)(336012)(107886003)(47076005)(356005)(81166007)(83380400001)(40460700003)(4326008)(8676002)(110136005)(54906003)(82310400004)(36860700001)(36756003)(70586007)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Feb 2022 12:30:40.4968 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a7c5dcc1-d62d-461f-97cc-08d9f2114f28 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: CO1NAM11FT035.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR1201MB0047 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 Signed-off-by: Eli Cohen --- vdpa/include/uapi/linux/vdpa.h | 1 + vdpa/vdpa.c | 14 +++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) 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 78736b1422b6..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,13 +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++) { @@ -522,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); }