From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 33966A0501; Fri, 6 May 2022 00:01:08 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9D7C84283D; Fri, 6 May 2022 00:00:42 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2061.outbound.protection.outlook.com [40.107.237.61]) by mails.dpdk.org (Postfix) with ESMTP id 3C1E74014F for ; Fri, 6 May 2022 00:00:36 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DJ+lqyJWuqEZ15QQr0bmBN4f879zWzxCXV9tSnAkCeMkhz5ISZ0t4X1nNi2Q7BLA8I/0fG56wP1uIz81B0D87WRB3qKLQNEohdhlZqspdXs5sZzghRFpTO8XPG4PfrTU2RHI945zOUmPRsTcmVBu8Jgv+QrREX3VvsRFu4YcxYZHt5PJqeTbUfE94vakp1nfk6sEgtohyDnKQRIPpa0RUr+unuzp3jZvMirqs0PGL0lN9s3/1y31X3AtJ6TN0QhmMt16HgHW6MIti51tR7FV5yHB2cv4sF0JdmHcysOMObki5i/cZkCFuDMO3hBjjkBKOiOk+vGXZwxYrh93KbJ9HA== 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=iLH9mSZi/A2H1bXBuZMpkLUxrjfMkAz1hIVosPGZvZQ=; b=dHvGjoEXXi2C4kYS97liy/tbSD9BgUdKKpMZkFr8AaaRa9/rSrcVAM3GFdZqMy+TYQBz6NfAB+WI6rPtTqY0nt/veYrJEbdQEUaTLR81SaKOnYioddaM1EAyUY0Ep7rBmXr6gCZxlof1MjwROHJXWY92CDubJE760USGa5NyllE4VGAw/Tb6eQij1cRjInflXGuKbCgQwUl8N5pwUrms77cK5XOtcVxEK9HOrU/sl8OnDyIjK+Ec8ZX+G5mKew34orOQ1LLl04uTWQfvYa/38Lf3k5mNoiO6SURmNQQJcoa4S3DZtBYWUGbDRtSmWnJD43kysblbvZ1WXW+V6c8inw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vmware.com; dmarc=pass action=none header.from=vmware.com; dkim=pass header.d=vmware.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vmware.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=iLH9mSZi/A2H1bXBuZMpkLUxrjfMkAz1hIVosPGZvZQ=; b=Qg2JcqHnNA3FFJ2CaskO3OTHOxJvpWmwLLgDjfmhRqe5Bq2JFa3TxUNaA8KmOyxwOK/xRuR1a6HgY4qfQlYYhrrZfYzafSJqT/oLwA/0ZVjYM8/ews25GnNp7usP30VAa+y0HuPtJMZzxf61O3S0gqINdxXKAWMfzi4c2vNI57E= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vmware.com; Received: from BYAPR05MB5624.namprd05.prod.outlook.com (2603:10b6:a03:1d::13) by PH0PR05MB7883.namprd05.prod.outlook.com (2603:10b6:510:97::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.9; Thu, 5 May 2022 22:00:34 +0000 Received: from BYAPR05MB5624.namprd05.prod.outlook.com ([fe80::5161:a7c5:8c7d:f3b2]) by BYAPR05MB5624.namprd05.prod.outlook.com ([fe80::5161:a7c5:8c7d:f3b2%7]) with mapi id 15.20.5206.024; Thu, 5 May 2022 22:00:34 +0000 From: Pankaj Gupta To: jbehrens@vmware.com, yongwang@vmware.com Cc: dev@dpdk.org, pagupta@vmware.com Subject: [PATCH v4 4/8] net/vmxnet3: report HW version on FW version get Date: Thu, 5 May 2022 18:00:15 -0400 Message-Id: <20220505220019.31166-5-pagupta@vmware.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220505220019.31166-1-pagupta@vmware.com> References: <20220505220019.31166-1-pagupta@vmware.com> Content-Type: text/plain X-ClientProxiedBy: SJ0PR03CA0354.namprd03.prod.outlook.com (2603:10b6:a03:39c::29) To BYAPR05MB5624.namprd05.prod.outlook.com (2603:10b6:a03:1d::13) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9f0dc01b-667d-4717-5d1c-08da2ee2ad76 X-MS-TrafficTypeDiagnostic: PH0PR05MB7883: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: AriS0UWDLJwZFkPuM0M4gYLbzHGmIoE1csnrc52Ft8CaOy1BvTPzuKDa9xeCh1cp2N84Ut4A+AIIz0BOuvm/pUBd+lk4ynAVj/BAzvLwBZ5rIyN/uBApdyJQY7QFwMRkCUzVf68WUIaQvGx/djUwF1/CODkLSvWJWpytY5kwgWm8ckSEWgwgE5epkaelDdeDw4BrVFoj6TqzgbeehvvGbYdoyPPYc0ZFBPa9ZtaJvxblhThNPhNeMUaQvw5xx9ylyIZCjr+EV8Riae+0YT0xTKWj4HwBvcP9tWHBL84e4REgYRN1UCwbaiYLljeqLFo7GxMLmRcFrU0wdFz69whghapG85W94IgVQx7MNlvPQjxdM0DjARcsVm1KR4aNyMUB4AT2Z4nxstE4FcurIJgPpw4OOkFtvPqsmqK/F69BsS061s67ztQjEI/BQTOUGWBeUPGQTwcVaFi7jyWbjpVI4MpX3tXoTC+IcbPu8EKhGju6RAmNV7tRSAV2rdyDt3VkIMRj+49bUhSv73pKWHEQliZddbvStca0OuLP7lLkfS8O/7wZklUqKz9aZxH0jOAObOx+RyGFqVwvL+ynmpe+5FQTCWnH8jhvpp/2/72OsrhDWCxaxL/sIcG+ssmV/pJcWm18q34WlGbGVSjjS/lYsUBDpXgvZYW0wxX14j1AJwpIK/L0KXpBwvoQtchWBQibQ3l0LNXw2JEkSHC0tH2wNg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR05MB5624.namprd05.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(316002)(38100700002)(38350700002)(83380400001)(6666004)(36756003)(26005)(2616005)(6636002)(6512007)(4326008)(52116002)(66946007)(186003)(66556008)(8676002)(66476007)(1076003)(2906002)(508600001)(6486002)(86362001)(5660300002)(6506007)(8936002)(107886003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?ZT9PBIM8UEg/SfGFIpQ8kO0CmRYuuCJHJyYHi+FAvEcgrjB03EOLa3cFrUMK?= =?us-ascii?Q?Cx4xExVv6YUBAy2rsrm9tNZkgy380MxYxlMCpYTlSh2+nlXA/CyBlRLQ8a+b?= =?us-ascii?Q?EcoPFVGLRIUKY30UpsldQhfESiBoGNva2Bfz3/fEQBJd2tBPwVgp/iC1okPr?= =?us-ascii?Q?V4gpb62qM+RwCYO/oKcp6gpmtrtesenfd2OWpGUkfkodn2gtbGwmCQKK/VXO?= =?us-ascii?Q?3ScAiXY9xs3Ddj2VzbDG7MxMhVvENxwDaCCb/FD2e/WBI6DEPA7ac/LQHcty?= =?us-ascii?Q?fk+gzJhOawFL8UvoFVPDGNvUgxvAN1klPjo85G41GjutdHXmYIWMNCy02I7o?= =?us-ascii?Q?u43dYQUriEw+5oAy54rQohca0hjXmhxGNeq4sU7ma2II6o8iGxmTR93ys/OC?= =?us-ascii?Q?Bxv5AzpuV57P/dD6rB3lSK7vc2d9kneAAEmXbsC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KX3FayVahjOw54AtZb+iQ+atZwdMDE3mdNo4K8/pFVI8W29uSZACdOsVSIz?= =?us-ascii?Q?HJieeBtJHzTcBopBJWmSXCGKcHG2RcGIfQitG8hWE2ndnkVIYXV9Nd/2Q3Ey?= =?us-ascii?Q?/ABP53zSf4ZelXAGq590TDelLL6RI6oIZi2fmuC1tSgpBtP/nU/dO2EGTSLv?= =?us-ascii?Q?PgiivzbRCBdEvy/gY09wFspQsDmFd6ZA07A9wH+F1VG1EcchEswRVXPIJ4L2?= =?us-ascii?Q?jwzkrxfLOOKvl5UQ9CQSwCCDfxjjZjAXFFv/yLLImAdwCeFVr75G+PlbTp/U?= =?us-ascii?Q?EoS3LQ4KfJnVsTKz6dTQOMzmhIp9kYswu9YveX60GtFz/Mh9n+ZPGUPgWE6b?= =?us-ascii?Q?D7trqqkVxZu84EZDVVJrcjCLnRl/nFxarluqLShFamV25DVnRk0krxMDJYcg?= =?us-ascii?Q?r+P2mnSaIg=3D=3D?= X-OriginatorOrg: vmware.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9f0dc01b-667d-4717-5d1c-08da2ee2ad76 X-MS-Exchange-CrossTenant-AuthSource: BYAPR05MB5624.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 May 2022 22:00:33.4985 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b39138ca-3cee-4b4a-a4d6-cd83d9dd62f0 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: zt37HyktvJWOaJ6uKKpPM0EpzGnaupl18ge1Suig67eIiNTL3N6/CoOu2wAw9mNeP5d1vJWCxL4frcACccI9Uw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR05MB7883 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Implement fw_version_get API for vmxnet3 Align addition order in vmxnet3_eth_dev_ops with eth_dev_ops Tested, using testpmd, for different hardware version on ESXi 7.0 Update 2. Signed-off-by: Pankaj Gupta Reviewed-by: Jochen Behrens --- drivers/net/vmxnet3/vmxnet3_ethdev.c | 35 ++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c index 2725e49ae9..30a0026ade 100644 --- a/drivers/net/vmxnet3/vmxnet3_ethdev.c +++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c @@ -103,6 +103,10 @@ static int vmxnet3_rss_reta_query(struct rte_eth_dev *dev, struct rte_eth_rss_reta_entry64 *reta_conf, uint16_t reta_size); +static int +vmxnet3_hw_ver_get(struct rte_eth_dev *dev, + char *fw_version, size_t fw_size); + static int vmxnet3_dev_rx_queue_intr_enable(struct rte_eth_dev *dev, uint16_t queue_id); static int vmxnet3_dev_rx_queue_intr_disable(struct rte_eth_dev *dev, @@ -124,27 +128,28 @@ static const struct eth_dev_ops vmxnet3_eth_dev_ops = { .dev_stop = vmxnet3_dev_stop, .dev_close = vmxnet3_dev_close, .dev_reset = vmxnet3_dev_reset, + .link_update = vmxnet3_dev_link_update, .promiscuous_enable = vmxnet3_dev_promiscuous_enable, .promiscuous_disable = vmxnet3_dev_promiscuous_disable, .allmulticast_enable = vmxnet3_dev_allmulticast_enable, .allmulticast_disable = vmxnet3_dev_allmulticast_disable, - .link_update = vmxnet3_dev_link_update, + .mac_addr_set = vmxnet3_mac_addr_set, + .mtu_set = vmxnet3_dev_mtu_set, .stats_get = vmxnet3_dev_stats_get, - .xstats_get_names = vmxnet3_dev_xstats_get_names, - .xstats_get = vmxnet3_dev_xstats_get, .stats_reset = vmxnet3_dev_stats_reset, - .mac_addr_set = vmxnet3_mac_addr_set, + .xstats_get = vmxnet3_dev_xstats_get, + .xstats_get_names = vmxnet3_dev_xstats_get_names, + .fw_version_get = vmxnet3_hw_ver_get, .dev_infos_get = vmxnet3_dev_info_get, .dev_supported_ptypes_get = vmxnet3_dev_supported_ptypes_get, - .mtu_set = vmxnet3_dev_mtu_set, .vlan_filter_set = vmxnet3_dev_vlan_filter_set, .vlan_offload_set = vmxnet3_dev_vlan_offload_set, .rx_queue_setup = vmxnet3_dev_rx_queue_setup, .rx_queue_release = vmxnet3_dev_rx_queue_release, - .tx_queue_setup = vmxnet3_dev_tx_queue_setup, - .tx_queue_release = vmxnet3_dev_tx_queue_release, .rx_queue_intr_enable = vmxnet3_dev_rx_queue_intr_enable, .rx_queue_intr_disable = vmxnet3_dev_rx_queue_intr_disable, + .tx_queue_setup = vmxnet3_dev_tx_queue_setup, + .tx_queue_release = vmxnet3_dev_tx_queue_release, .reta_update = vmxnet3_rss_reta_update, .reta_query = vmxnet3_rss_reta_query, }; @@ -1764,3 +1769,19 @@ vmxnet3_rss_reta_query(struct rte_eth_dev *dev, return 0; } + +static int +vmxnet3_hw_ver_get(struct rte_eth_dev *dev, + char *fw_version, size_t fw_size) +{ + int ret; + struct vmxnet3_hw *hw = dev->data->dev_private; + + ret = snprintf(fw_version, fw_size, "v%d", hw->version); + + ret += 1; /* add the size of '\0' */ + if (fw_size < (uint32_t)ret) + return ret; + else + return 0; +} -- 2.17.1