From patchwork Sun Mar 13 12:46:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eli Cohen X-Patchwork-Id: 12779231 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 6FBA2C433F5 for ; Sun, 13 Mar 2022 12:46:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232820AbiCMMr6 (ORCPT ); Sun, 13 Mar 2022 08:47:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35926 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233921AbiCMMrx (ORCPT ); Sun, 13 Mar 2022 08:47:53 -0400 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam08on2046.outbound.protection.outlook.com [40.107.100.46]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D841B3D1E3 for ; Sun, 13 Mar 2022 05:46:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HdZ1S+jCkKKe02onUwi3iAFPsytitWq8kf/aWwlr3jZcI2t+ykbBDdL7uS1j9lWpx/8K/UgsKRkBMDBK962vT9jF9r1TQqPUglQI0w6XhfrWzwdxLgawzA+/RiNDf0XBY0XeAp6AewFoNtVl+sEFqkaAXW3GfdG/7T7it6CtHvshLeCtaPoNajmS/S29jbypLWDkU7DercseJvWD5feQ19mMS+rdeodll67Crx+4RoTqBmE0n20BCM7G8hxd7+Fl2bJFUTHlqg6EQp4eqgSkhK/IyvhxlWsTiNC9gtzLDqfknN4izugYDJzyzdvvwAAmEzlxASZ+D3JyFg6xPvbQGQ== 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=LY8/ucpUz4Ewr/AT+aIj4uK7DsfyXfx4g+xTGLeZ0Mjh+2IQOBgrQ1IJBGAqg/VVmv8vDFdB+8G4MKXzgmj0fVxGKJfe5+95uha+98HnFrRsFk3WK315w2CkPubrRD7k38BWZ0xDwt0AYlPWnFcSGBeWn3Bqc3sLncDW9DqMvPb/sE2j9ezYUiEIJ2toKbwT6WModZ995QPh3ogVnqxDaP24b28T6N/3Whn+o1IXdzkhwOsXSZXF6qcQhbPEXs2TjgqN37cwVbC328tLjbs3thbdQ1BcjPWLa/PlcjMGzyPjdQLUa1eWERCjodeoXBj5goxJr6YIlLAVH3Reiz9eTw== 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=elG1J40xfziWfEzxXTaCmVzClifDsoIWJIaSpNtwrfs=; b=idRVbT2Tn35AozgW/zoV1JvJ7WEJKVbtKzLg6STufKxbjZuu7yY04WfRoykE28GZUHSRCHbwiiCQXo9OUfnZViZgyiSrlb+j+ZMt7buzyEt7zBjMqNuXVIRmTl9srFd3SrSaHAO28Fwcx+GTe0wI5qXsvbHX1LdlC8mHirgAGVX8ynXuAfgqS+4Qsskp7dkT1EH/3+LmYNWVPOBVTYlqGLMfWyI8OQ0tk4O1+/ypQsg3WREVJPk6JhaZzCJI7EguWxFuOQa+aELTctJWeyDJ9/EFPBLD98QMhXMQg9LPGMUY7pwIIWxoMtZJiRUFV+RTAfvtsQAPxHm/7ZXI81BiFg== Received: from MW4PR04CA0343.namprd04.prod.outlook.com (2603:10b6:303:8a::18) by BN8PR12MB3169.namprd12.prod.outlook.com (2603:10b6:408:69::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5061.24; Sun, 13 Mar 2022 12:46:42 +0000 Received: from CO1NAM11FT035.eop-nam11.prod.protection.outlook.com (2603:10b6:303:8a:cafe::8b) by MW4PR04CA0343.outlook.office365.com (2603:10b6:303:8a::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5061.20 via Frontend Transport; Sun, 13 Mar 2022 12:46:41 +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.5061.22 via Frontend Transport; Sun, 13 Mar 2022 12:46:41 +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.32; Sun, 13 Mar 2022 12:46:40 +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.22; Sun, 13 Mar 2022 05:46:38 -0700 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.22 via Frontend Transport; Sun, 13 Mar 2022 05:46:35 -0700 From: Eli Cohen To: , , , , , CC: , , , Eli Cohen , Jianbo Liu Subject: [PATCH v6 1/4] vdpa: Remove unsupported command line option Date: Sun, 13 Mar 2022 14:46:26 +0200 Message-ID: <20220313124629.297014-2-elic@nvidia.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220313124629.297014-1-elic@nvidia.com> References: <20220313124629.297014-1-elic@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 93a8ea3a-4937-40dc-7313-08da04ef85a0 X-MS-TrafficTypeDiagnostic: BN8PR12MB3169: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: qxfEjnAYmrK2RyYx/bQF+AeY46TlUYgo0kGkziOeKsXwheQOID4G8t/z++kM1Gl5V0TLT7HkzBPF0FBs1D5uWY3r7C6Eympv9rbjbKwkbT+yKRHpxb6D8PU65NRArQhnXwyGKo1r9XpYPdWUslWvEWyPUTWjzY/fpHLRUusuMZVIrhIG4W1AgauAZyi17tyImegOSVITfrFVfZjcV0CZ7dmPXX53rQr7CQPnY0bksedmiLf+JDplngdojJBFI9samu8RIlnpxPwfz/nLW6wNG8zMKhikpOhp2ewCzqGaFvcOSy+O37WxpPgYhos6wODzp3l0yxq9cHmFFrujwX7VtEx9mYqP9VuPFtgT0e7vARYYQqRBmVRaG6P6c63mOFiOOlINMVgA0ZSIC28cjUi2gozMeRA+10QsNoGPV4sUDb9RGy6pc9JpXCDoCexzEznyv8DPWyw8jSBJnL/Appyhl4mZryUSBGeknUNnr6FTWN85sw7SP+EtPYMlYJOdTzg/DWdBcTb2W6RC6uc2w76uiupcbfNlT0qH07ESsBa2huN/jhAIXBnwfjBWsRzev0U8IWnHGhLAqz3s2GvPcaGjJ9OwxBifQIkXnNOqGuT+OfX/iT7Vo1HJKqQ7TM36ffCCgaihMnhNVAP8wXcAZ6R26FAs0YaKBTI9YXVtpUZ7YBJC6VDZ/l58QaCqvAMjs9bIrDQFna2+MoWJvLTGJO5ZZA== 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)(81166007)(110136005)(54906003)(356005)(2906002)(4744005)(36756003)(316002)(36860700001)(4326008)(8676002)(70206006)(70586007)(40460700003)(1076003)(426003)(336012)(82310400004)(5660300002)(8936002)(6666004)(7696005)(2616005)(186003)(26005)(86362001)(107886003)(508600001)(47076005)(83380400001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Mar 2022 12:46:41.0676 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 93a8ea3a-4937-40dc-7313-08da04ef85a0 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: BN8PR12MB3169 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 Sun Mar 13 12:46:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eli Cohen X-Patchwork-Id: 12779232 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 0B504C433FE for ; Sun, 13 Mar 2022 12:46:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232892AbiCMMr7 (ORCPT ); Sun, 13 Mar 2022 08:47:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35978 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233950AbiCMMry (ORCPT ); Sun, 13 Mar 2022 08:47:54 -0400 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2086.outbound.protection.outlook.com [40.107.92.86]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 74F213EA9E for ; Sun, 13 Mar 2022 05:46:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MtYeA3Ode9qZfEvFxrraSfDc5o/GFsgh2ACTzJsX0m4o98CKMzOL5Y/y45F7aS5rj+vOooqnokIykmejX+TV5HkVBQItaTQvD4iMA+1YbdsU4dOYSwBsaQD6ouH8DS+jG5b3Dcc6R9Xs/UlHOI5BA1LohGBxzt8ySAfj4DUbPkE8fM1oqNCUWHNie9pzlP4PW4n3L0L4NiVwwady59Cy7JU1xbwXf7hTgSfn6VBBI7ObnkOWLS+8Ds7pD3ba04GTiV8OvUwxVxZQQmXEP26jdhn+nhwVl5m/8MBkYjpGc1zJLq5Qq7fjmQTzaVgohM7qui2DCNsNFyLclcW2bo4MJA== 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=eoHVRnVrmRF9NNmaH/TNIoWNfCD7fURCK5nE4o9Hflk=; b=GNr8OPHV/vBs4PUUeDP6PEX7PqKXJboVnwHoMqxI3F9ggqAWVwe+utA78GFDh4fBvilmYFmeGBoZsk0IvTmhfQpA+cjawdVdCPwNnap8m8tIz0gqKyNXSAXLS8yHvZs8WuciZWJ7Yu+51Bo16eLkX4DxKH1hCxZDKp/olDbSvkmB2qVzcl6WteHA32w3I/Ty63YyUzS93P54THfcPvaXlqDcy/fs3UUMAovTIuFA1uvAEFUfPFBmU8dvt4Doj25wTmeEcinN5mPrs61+kYfEhIj53KC/BknbgasW+1RSq/4thHbBz7u9Hv1edBVi/x1hwup8atJSo7vmlg43qNtmRQ== 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=eoHVRnVrmRF9NNmaH/TNIoWNfCD7fURCK5nE4o9Hflk=; b=i77p0Tir61U26q6PLNTD5Xxs3PhKFY/xcTQK3vZgLPwCnNLOgQ3pt4srtz3nJU75t+1r8AtBuwjxCWgJFN4NkggB/yzpydbpY3Trw4JkOigfwle+QAsl/3k+IYn3EFGF/P0/GuWYhBwBMWHzuKZ11iAqljMuzuATZWN3JEUBfgUuuG0goGRuauBv0iyBgqmoPqu5C3WFbAMqNfaDQQvIB4vm3H545rriD6Nmy5ttmZwhPG2UEbl6653j0T9NfSFDxBdQjOnLPwFBNefmIrOiM7icIzmVJu5NT4md8vYQ6xblDIXsQu38C2hzzqyi6O1te7a9juyIFXavHJ2L7mAt9A== Received: from MW4PR04CA0369.namprd04.prod.outlook.com (2603:10b6:303:81::14) by BN6PR1201MB0052.namprd12.prod.outlook.com (2603:10b6:405:53::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5061.21; Sun, 13 Mar 2022 12:46:44 +0000 Received: from CO1NAM11FT022.eop-nam11.prod.protection.outlook.com (2603:10b6:303:81:cafe::39) by MW4PR04CA0369.outlook.office365.com (2603:10b6:303:81::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5061.20 via Frontend Transport; Sun, 13 Mar 2022 12:46:44 +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 CO1NAM11FT022.mail.protection.outlook.com (10.13.175.199) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5061.22 via Frontend Transport; Sun, 13 Mar 2022 12:46:43 +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.32; Sun, 13 Mar 2022 12:46:43 +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.22; Sun, 13 Mar 2022 05:46:41 -0700 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.22 via Frontend Transport; Sun, 13 Mar 2022 05:46:39 -0700 From: Eli Cohen To: , , , , , CC: , , , Eli Cohen Subject: [PATCH v6 2/4] vdpa: Allow for printing negotiated features of a device Date: Sun, 13 Mar 2022 14:46:27 +0200 Message-ID: <20220313124629.297014-3-elic@nvidia.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220313124629.297014-1-elic@nvidia.com> References: <20220313124629.297014-1-elic@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8416b510-1100-4881-13b7-08da04ef8759 X-MS-TrafficTypeDiagnostic: BN6PR1201MB0052: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: dpezrH/hsBhbbN4fYkt0JnoovnXqMdmxaZ7CRHe1EB7iTHOJ92qtcdRNA0JH2ME6MF9YffD16U6GKj3A3sOhFm12jwypyQDYkAqY/q5TbnFPWf+ddNLJeqwppVQisJImVpft7qDGJiP0+lveLJH8zsfQmKQfFOnR7HH4CHpbbmteBTP4qCjmbf1SZhuRV0qhnVhlESzoRf8i7W3hNT7oU52Z9n9lhHSrY1KI1vKVLMgaB0THanLWAlwh6Q4E5MVYzF9Y3GvRwHlxbBMYqJnHyO8/1kQGZtEpAzl6grQPX/mh2dRCnX01NAQ7RQl+ZbucYnryzWIAMpOwrsMLE8lrRlc2WiUyxCgTdQS72NH2ynfdqN4blsxLw0G4c1xvWrrg8x74/+60ksIoFm7iwq6gPk/z/LQqtMKqXOZR1vp4Dw6c2/hLwEFuSSKx2JMMHJXPBQErOZphyYUdJDLhnYUvbsvPF8q3/+IH7BCoJDVP0Nb37i7kCU7Vmx3lyoPeLAyeCONQp5qBaO4+lFLm363LPgpge+q2JST4QfkBDEuzREkr9jwA2tlly/Dv0O4dUmUxP0c2ffO9p/1HtlFZPDEMAyscsR9LuTuYWfdv4GzL1xY7Piztz4sDv/vAkKakXFPz5Y52HFyAHD+os/pZFFdgLWsevyQHTZ1KfbJ0lecLsrQgGVsHy7MhZOvnXq1b0PLmaU5I2SRiulT38m3Ol3ZHfA== 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)(83380400001)(5660300002)(107886003)(2906002)(8936002)(4326008)(426003)(336012)(186003)(26005)(508600001)(7696005)(2616005)(47076005)(36860700001)(1076003)(6666004)(36756003)(82310400004)(40460700003)(81166007)(356005)(86362001)(70206006)(54906003)(316002)(110136005)(70586007)(8676002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Mar 2022 12:46:43.9865 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8416b510-1100-4881-13b7-08da04ef8759 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: CO1NAM11FT022.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR1201MB0052 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/vdpa.c | 109 +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 107 insertions(+), 2 deletions(-) diff --git a/vdpa/vdpa.c b/vdpa/vdpa.c index 4ccb564872a0..7cc370e34118 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,98 @@ 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, +}; + +#define NUM_FEATURE_BITS 64 + +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 < NUM_FEATURE_BITS; 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 +674,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 +706,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 +724,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 Sun Mar 13 12:46:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eli Cohen X-Patchwork-Id: 12779233 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 C5808C433F5 for ; Sun, 13 Mar 2022 12:46:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233618AbiCMMsA (ORCPT ); Sun, 13 Mar 2022 08:48:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232883AbiCMMr7 (ORCPT ); Sun, 13 Mar 2022 08:47:59 -0400 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2057.outbound.protection.outlook.com [40.107.92.57]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0FD173D1E3 for ; Sun, 13 Mar 2022 05:46:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=A/a87udtxR9rJGgiJHQJwtmC4M8vi4JqdJcJvHHTDaHSQyNAp0YhVOsk6SM+Oz1wHmr7UDdLu8rfysKkd8gESvxmzzSQFq0hPB01cTvBCsWgZayGuONp8byTOpwCmm9BQMD2ZpSXcU4UbC+OtwY4Kx2cOfKIvdXF4eznkRmWm31j9T7jOOGSCm8JShxG6sGs6lhEpKwCdAA6RiE6jk6iSuv1SMqe75TvZQVDxRrNhakSNt8HIZnoETMtufD+qwYJB0TLziugm+Dhe2CIkMqxLCIhIFySIrfFDHGgM5HpUEMqEhhjgTwtkKqMqX27w3nGYW7BLbubizjw4EvATNEhZQ== 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=xWJ8gM2R9umiEzGPKwrLKV6Atc0ly7IuD81qcKCqN9E=; b=aerWjL7oP+nTw6x/78luSsNmZjYJCB3oJQLbBAgmcUwEWptlu2Tpa4lSrGCqmW8E60NdEeM60m4XqkBjbEa0Z9xUMo/gFur6Kqrgox5ca4WZ/HHchR49WRChNIkd6hLi4xGJp1GLC+qE/inY/+JZflgiHPkOnzOKFxwgKs5+A11NGzrRcxjzGvQ1gjdKc3oyp6qfoFr/RjcWnCNieLGVVm55giSLO3wAdnHx0Wf8EkKXuIzgm0GC0mLuvTQmieGqnG8nyBEIAg/hnYtSji9akTkV7seFhpg8fOAweRtsjbkSPzlOUWM5OqEHxRvw+ZaXsGRkj2Wm4UBYNluOPuXvmQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.238) 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=xWJ8gM2R9umiEzGPKwrLKV6Atc0ly7IuD81qcKCqN9E=; b=he3OzEUe4HLW3+k2ZiGQIjC7vfcP+FsPAldb0z4i++1/uYV5neFUU3ubiCzaA/PtQkgWE130mbe/9A+ft40ExjQo2w461MiTgQy+EPClMTHw0/bwhUmSdkvBaqnr4BLd4rY03BV2c5ncesG8+VqVcILuJQdVayJJdhMTzgRud2fXFp2dr0WwMJL+w8TtE51QfFMDjAeD5IYiTh02A8cUFD6YDbWAkTXA9I6mXyTw87ygbT6mTqxKftNgsJt+U5Kw9NTLncSxMbXXovmuu0ah5mRUlAmOHfIY2p3UiiyZq8S+rgD3mpRE+eEyrSGmfqG/X0aUC/8DjA01ElcB/p/azg== Received: from MWHPR04CA0069.namprd04.prod.outlook.com (2603:10b6:300:6c::31) by MN2PR12MB4175.namprd12.prod.outlook.com (2603:10b6:208:1d3::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5061.22; Sun, 13 Mar 2022 12:46:48 +0000 Received: from CO1NAM11FT017.eop-nam11.prod.protection.outlook.com (2603:10b6:300:6c:cafe::8c) by MWHPR04CA0069.outlook.office365.com (2603:10b6:300:6c::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5061.20 via Frontend Transport; Sun, 13 Mar 2022 12:46:47 +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 CO1NAM11FT017.mail.protection.outlook.com (10.13.175.108) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5061.22 via Frontend Transport; Sun, 13 Mar 2022 12:46:47 +0000 Received: from rnnvmail202.nvidia.com (10.129.68.7) by DRHQMAIL105.nvidia.com (10.27.9.14) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Sun, 13 Mar 2022 12:46:47 +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.22; Sun, 13 Mar 2022 05:46:44 -0700 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.22 via Frontend Transport; Sun, 13 Mar 2022 05:46:42 -0700 From: Eli Cohen To: , , , , , CC: , , , Eli Cohen Subject: [PATCH v6 3/4] vdpa: Support for configuring max VQ pairs for a device Date: Sun, 13 Mar 2022 14:46:28 +0200 Message-ID: <20220313124629.297014-4-elic@nvidia.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220313124629.297014-1-elic@nvidia.com> References: <20220313124629.297014-1-elic@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f61d67c4-247d-451f-83df-08da04ef8978 X-MS-TrafficTypeDiagnostic: MN2PR12MB4175: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: WUXGAYj6ZIhcz/DriKUN5bPCVCfLAFzUOgP839Hf6cSJtt3nPz+PN+ieQIT8HbwmP/ilTvzStlxOvD1S9YzF5K+8Ponwohom/P00NCVt+305kyMs4bbuhltaHJhm0muM/rwc3qp+f7KPBolh/pRXm2mn9MlqQHZZJzE/bLAUtQzB+6gZI5HCRlSSoyttRxCEWnSHiLAA85zUuHyjZKBQYQjrg/JRqcPI7bKM36BZDuL/WSGAjIr1I4tpzTqq/scVgfWQOSgau8rXn8axUfCGDcs9xFnCO4GsWgRkwxDYEaI8UWzR8X1rMfBZXAdJQHrLKm7fY5hagfk+UpB+6pQIPnzGrlU7Cw4irA3HH3S0LNkxVKvUEClc0EhQFMpAosnPK4v8plNTTO2AKgoXs67Qn9CvxBUyYP7JQH6PmG79P04FL+AWpKZwxyVv3Wf7PcI2kSl5NcCem4KDCIkGiCv6MjVmCuuglzospLn2cdOdJD9uKZHC0TcbKrWGtN0IqnHBWJsS31AeMkFv4tn+aPTOYtuPVYkS3LxiDzSaAa29CVqeZvhWUiLIbMGHmELvykx1yjIKvs0IMS+XfHnsrnaHTNrJ9lEKGWnKA2g/GkdGKjmKqZQsZ46ziyONeNcjuuTQtjPe3HLvmlZ8jSE0sy7eFKKIO+/oY8NlKQubV03juTF6022ET2Rb52ceQ5pcorRRCNTlupOyivUf4DC3BGu/fg== 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)(8936002)(426003)(47076005)(83380400001)(336012)(54906003)(5660300002)(316002)(1076003)(186003)(26005)(36860700001)(36756003)(110136005)(7696005)(2616005)(2906002)(508600001)(356005)(81166007)(40460700003)(70586007)(8676002)(70206006)(86362001)(4326008)(6666004)(82310400004)(107886003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Mar 2022 12:46:47.5480 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f61d67c4-247d-451f-83df-08da04ef8978 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: CO1NAM11FT017.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4175 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Use VDPA_ATTR_DEV_MGMTDEV_MAX_VQS to specify max number of virtqueue pairs to configure for a vdpa device when adding a device. Examples: 1. Create a device with 3 virtqueue pairs: $ vdpa dev add name vdpa-a mgmtdev auxiliary/mlx5_core.sf.1 max_vqp 3 2. Read the configuration of a vdpa device $ vdpa dev config show vdpa-a vdpa-a: mac 00:00:00:00:88:88 link up link_announce false max_vq_pairs 3 \ mtu 1500 negotiated_features CSUM GUEST_CSUM MTU MAC HOST_TSO4 HOST_TSO6 STATUS \ CTRL_VQ MQ CTRL_MAC_ADDR VERSION_1 ACCESS_PLATFORM Reviewed-by: Si-Wei Liu Acked-by: Jason Wang Signed-off-by: Eli Cohen --- vdpa/vdpa.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/vdpa/vdpa.c b/vdpa/vdpa.c index 7cc370e34118..1326a63e729d 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; @@ -503,6 +516,14 @@ 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; + + print_nl(); + 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); } @@ -563,6 +584,7 @@ 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, " [ max_vqp MAX_VQ_PAIRS ]\n"); fprintf(stderr, " vdpa dev del DEV\n"); fprintf(stderr, "Usage: vdpa dev config COMMAND [ OPTIONS ]\n"); } @@ -652,7 +674,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 Sun Mar 13 12:46:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eli Cohen X-Patchwork-Id: 12779234 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 EB3D2C433EF for ; Sun, 13 Mar 2022 12:47:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233084AbiCMMsc (ORCPT ); Sun, 13 Mar 2022 08:48:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232560AbiCMMsb (ORCPT ); Sun, 13 Mar 2022 08:48:31 -0400 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2069.outbound.protection.outlook.com [40.107.220.69]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 738D960D90 for ; Sun, 13 Mar 2022 05:47:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bniOfE0UY3TrMly2rQU+gvxWFMo8QuVGnDvJEMEYZEZi/AvbikJWT1UPUxy6qQceCLnWInUHeMSSPvMdDb7fn8J0EirRCzS0GnziKqvw/UiXv/Ubeqyd789LM7ReOuscaKzqreg1hQvopxUO+NEsj6v8Vb236wm2zx/yz0Vj/xK6TPLxyDukzXqQtsEULSmMlzZGyO7z8oXrygh/QmGi22hm6RrF8Wsjk9T5bKyWONJr4Jrgp4AhyNAeyjC6sq/GKyvUEiKMHr3QIEWSV1FgpQiPSUE6TJ0rMW4bWTKn+7Tf2oFpw1Q1K4TLuSqH87SIVHhfB/bnO7fslHyLB/6FSA== 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=fd1gJP9AO15sEsh3QfoNcgLvh6JS6DNtsg6WQWoibtU=; b=VVQe1zYiGlYYKwL/+Cd9mcjQ+JRTBLTXKu1vQhE6zuzozi3F+JG5rTnWwoWVYTuQ67MFentaBncpp9N8wWmzWPWfW+kk3lLXJYYNKzTXf7zeVC7g2agiEkaabbxDahkJ9bwb3qgg+QseTgxZr+YHgP2tv+EDxuhIPw4r9eXA+khL7+QGuZQmJalPaI0eKoDwchLNC2MFuM9czWZtnNnkZtSEc2Nb/MBoAdZdr10dZXzDkLSnABnua1gpIm+qf1dhTBi3sjVmRMbQ1mRGQXRr8IUC74qGEjMwRN0uTEm6/hWyy6+5ANZeGSZ2IL7bYyVOIRMGm0dAUOJe3mzS5imjdg== 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=fd1gJP9AO15sEsh3QfoNcgLvh6JS6DNtsg6WQWoibtU=; b=HekotbRwnA/SYzgvSPJSHlKWTQA8rZLGuyJynnEWi8HlTlIaQVHYJGQWeBLorKOFiAAPySh3lVJcAonXlaaFSztUijXlQnhJQST+TJwZI6NzY59WHlJ+Np1ZLuu6olmoT0BBiZcaAfH00bNO+GrUGOJo8S9gjP6QCSpxW9SVz9qRngeNd1iywxcyNr8bX+5XX7OgmnZ6U+6BZx9TLxW/C5OHmILFkLx3TpN/o8/fgy6xIQPWcNZSH2XaLyScAAQ7WQL6aEM3GHNLbr9O77TrzAGyGyh6iUNZ/15cPvSZEUgDU+/UaRns4STO+DSK3K0+xpNlzKt2HdoxwMdZlrtJjw== Received: from BN9PR03CA0425.namprd03.prod.outlook.com (2603:10b6:408:113::10) by SN6PR12MB2720.namprd12.prod.outlook.com (2603:10b6:805:70::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5061.22; Sun, 13 Mar 2022 12:47:20 +0000 Received: from BN8NAM11FT009.eop-nam11.prod.protection.outlook.com (2603:10b6:408:113:cafe::65) by BN9PR03CA0425.outlook.office365.com (2603:10b6:408:113::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5061.25 via Frontend Transport; Sun, 13 Mar 2022 12:47:20 +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 BN8NAM11FT009.mail.protection.outlook.com (10.13.176.65) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5061.22 via Frontend Transport; Sun, 13 Mar 2022 12:47:20 +0000 Received: from rnnvmail202.nvidia.com (10.129.68.7) by DRHQMAIL101.nvidia.com (10.27.9.10) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Sun, 13 Mar 2022 12:46:50 +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.22; Sun, 13 Mar 2022 05:46:48 -0700 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.22 via Frontend Transport; Sun, 13 Mar 2022 05:46:45 -0700 From: Eli Cohen To: , , , , , CC: , , , Eli Cohen Subject: [PATCH v6 4/4] vdpa: Support reading device features Date: Sun, 13 Mar 2022 14:46:29 +0200 Message-ID: <20220313124629.297014-5-elic@nvidia.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220313124629.297014-1-elic@nvidia.com> References: <20220313124629.297014-1-elic@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 253bf52a-29a2-4fca-2e0e-08da04ef9d1f X-MS-TrafficTypeDiagnostic: SN6PR12MB2720: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: WIEjEH+mgFdCWksBRTFuq1cSpDGVNMPdaF6VOo9tgDGgYZmgFQ2GGZ1h1jmLFUS8Gf5yfNn0/h3X+3uVT80LV1K2MniutEDUV/qSgbK1uD7jsgR1t5lLgnvJOMr+o2i+ywf80DqyUu0K/9xXPu4EqVo5QW1CP2YkorpMziuL8ZyfEYtW6T8yB1CC7Oj2n9ltrkVC5azHtd/f7EPZATJ0GovGbQVUBHWZoWzajwFuqRlKoNtdudclMzsYTcFB94c9DHFhKO/JqPHI7nNMrsW8lPOq+w4Ds5kxqByPMImOVjQG1WpL85F3SdZiLCXcZoDT76sE6eAc2hyGHb3Zrt2iDxTVZNngcQjgf/0D6UyKsNAjKBUqR/BqdMqpwBgEkAtlDU3eLczHlERGi7PAIXolnBz0k+zuimavOy/+odBnTLP3WsQ+2OiEPfw6OocO5O9gKrcrTI4/MM0VDve4JNhxOEz3o0VXgN70kODdJk8OvpuNOHAoopYX1OgDR9dwHTXjoAj05c8qlN2dkcDj98uMaeF0IZurX6ym8Vm6efM00hSTyM0dJA6s3H0IAk1IowbSLcIRgqssOFytLzZOOqg2/lbR0rKYbAcnAbziPNKzad8I76NWSm5TjK7c6NWtQDCRRnBQKg/NGLieymnRrLr68aP6hYhN2PdK5yexUqSW7bwoAbiaZUHM/OeAyVcM8jjHmuk2lcaaNZLikWIo6j2eNg== 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)(336012)(47076005)(83380400001)(54906003)(70586007)(7696005)(70206006)(4326008)(8676002)(6666004)(508600001)(86362001)(110136005)(426003)(82310400004)(316002)(26005)(1076003)(107886003)(2616005)(186003)(8936002)(36756003)(2906002)(81166007)(5660300002)(40460700003)(356005)(36860700001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Mar 2022 12:47:20.4389 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 253bf52a-29a2-4fca-2e0e-08da04ef9d1f 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: BN8NAM11FT009.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR12MB2720 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/vdpa.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/vdpa/vdpa.c b/vdpa/vdpa.c index 1326a63e729d..c63bf52d3c49 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) @@ -496,14 +497,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++) { @@ -524,6 +525,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); }