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 88139A034C; Mon, 2 May 2022 21:47:53 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BAF6D42831; Mon, 2 May 2022 21:47:38 +0200 (CEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2075.outbound.protection.outlook.com [40.107.93.75]) by mails.dpdk.org (Postfix) with ESMTP id 9D29242823 for ; Mon, 2 May 2022 21:47:36 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=B8hNWwZo4cxrrTjFIEq0lozJfutgzgdngsMH2AuYj7ETOnu8bO9hhvOvNktZYDoRuAustcxDKpyeEDg1WQ69hbi0oJp9MsGT0lTmqLjSnGKUEFaQIJjc9YoTfaUtY1I+k3LctydRY+0XLrwD9qsSDaJU1qZ5MkK6XV4okr56tqDDaJhUdv1F3g/t/FUTlQPmfh2K1yQl69qBY7NyZfNqB0WZvjQgqNsxsSVilnSlepC7ahkUYTDtiEYNcgemdibkRkSkWbS8L41RaXTXRbb3VPk17rEciLOx6v2wE5QAt3OR34IF1gyE2XN0lEEYqUP/C41MpMZKeVbpKBBeR7OcoQ== 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=Mndm74YxyHwM/qk2lVT+KKVW/WMZZej6IEOZbMKefEk=; b=fxadNcN+CvR8uBn95jk0iHMD9PockaPlGxBwcYAu3eWFujFDqA4dSyzV+iMOTcw7fp65UBxoV7sSuCCLKqioBLwaG+EI1QAnFJRhYzf1eQ19hueZqGeyOZx2gD1xk3R+dA55YlAl1kyFvpaF2La5LZOPfJ3oAZCko0h6HZ3sP88F3Eklrn8wYwJYWzziW4nsItnsAbBwmQtivXkLg7/DkUzPuz/H/7TN5bA/7lceddCoVowJ+TC8Sb58fjV/YhdnbBeiHNYfUY0SBBapx8IoJiSaQVr308wKP4QVzVEJmPpwGCTassgfyn5WEOY/HNBMalCBu5QBOHK60krWQ+g6yw== 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=Mndm74YxyHwM/qk2lVT+KKVW/WMZZej6IEOZbMKefEk=; b=R/yLUs/8Wy2NfHdgii1RXGAdLcVqqPIswhxHxs9Mn8xnOdxr1dbTGBLYQIoYoydw40tzmSP+dVVnZjGbCSIMw2wjtIJOhEskyPe1XDpZazCtALJ7bITpP9aw/k5iXDdAf2ZGzCQM+vJ31t7C9HGQSYPaoeS3SHt/PqkfVMSCuuk= 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 MWHPR05MB3294.namprd05.prod.outlook.com (2603:10b6:301:41::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.12; Mon, 2 May 2022 19:47:33 +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; Mon, 2 May 2022 19:47:33 +0000 From: Pankaj Gupta To: jbehrens@vmware.com, yongwang@vmware.com Cc: dev@dpdk.org, pagupta@vmware.com Subject: [PATCH 4/8] vmxnet3: add get hw version api Date: Mon, 2 May 2022 15:45:53 -0400 Message-Id: <20220502194557.16016-5-pagupta@vmware.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220502194557.16016-1-pagupta@vmware.com> References: <20220502194557.16016-1-pagupta@vmware.com> Content-Type: text/plain X-ClientProxiedBy: BYAPR01CA0049.prod.exchangelabs.com (2603:10b6:a03:94::26) 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: 2e32dddb-ecf6-4fed-826a-08da2c749971 X-MS-TrafficTypeDiagnostic: MWHPR05MB3294: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: /5OTWfawd5y1CTUuhKuYbl2RDmDjDX9YewnFRj0PyBrScDHWX98X/Chf28HTVXz9oHyJjQE/DVaGOx+XE0fIQCC4yUI1C+tGJGaC1MJEoB2heF3hInIEQfWC0qK4RfPvY1Cc/44uhNAwNDq3iBDZMH52hPJ0pPI17ADgImverIZYkptUz+OA/lG44wdqZTlY/voGVc+y3jFHgYyF7gPXE+pUb4k+jC9a5DhQJ9/MMQYqXhaDwtVzjpZ8OXbLnZ/AUnR1PDLqmrqgKpFtpJQVLaMsEquf3vi5I77TROBszG0XV/rtQnDJV3cCRsy9MlXXVMzztRxZjeyC4eydXCaBHEy8XCm0Ta3wlK8ndXPq5q2DlIMEtk2ue5GyLr2274XIk39nLAyPLRH3Waut1bbVdNkExp9ne6PIQhvPYasYhiqdg6p2WCex40gMD+bv9ObpK4IpAM4QIRvCVS0CH/6BjOTJxjyXJFDKUiNHHtrLU2Hj7tz/To+AJ7fQaJHkGoJ7/LyNwqEqIINqgthu6J/Fy44Btig8OXlcUW8B1aCUtREg75MjSd/DvvC845I2nTG09aYmEOeTMNEamWvAg42ifhwhmQIcaLdJGwpRkPEhyHDX4yx4x04ZaqqLIMen7z8srVHuQCpA0pd3EkUh20Igj40S4MeJBe10NMY6e8OGyRO8Iq9jIKkYLXoFwrjVdL9/SvzfwjN+avmlS8v3GfZhPQ== 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)(6666004)(1076003)(4326008)(6486002)(508600001)(86362001)(186003)(83380400001)(38350700002)(8676002)(52116002)(6636002)(2616005)(316002)(36756003)(107886003)(66476007)(38100700002)(66556008)(66946007)(8936002)(6506007)(5660300002)(2906002)(26005)(6512007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?zT0Sp99BFps9L1p/I+J4va/LvzDaGuDx1XviPcjePIYhIpNlMU82ceIuAfDg?= =?us-ascii?Q?NktY7/PQPbXcte1E5puULHfn7M0NtYhEOtXtGO7MVkb9Z60fKQJjCyyoKPmX?= =?us-ascii?Q?4DqYPMm/Tv8CEjmNNWnjQL75HUCowkUc00M6zDCLleY8Ysj9yUGvAkqDcQ+e?= =?us-ascii?Q?ocOTpd4WJrTND2m513+ct4EF/5RVQqnxKdXgrjOCYw9F9mN0Z7/791WF3TSM?= =?us-ascii?Q?/ild6nqZDIADZj73MSGibIKByje7wZoghWG9gqJp/i7wGQN/JSwYWtHdKLEV?= =?us-ascii?Q?oSQddcYMtwIKGo6lTXZrYfU7UpH1aM3uBP5p9VfXFIMuEiDX+y0HjRY5M4+g?= =?us-ascii?Q?mSaOtzcH0jVjeKfcY4CEfrQ/HVnsRJuvaJ9A+MV3UlQ4Wmh8QvnWLHhky11t?= =?us-ascii?Q?/lVT38pHPeS/ijzf93XUMZjUF20/3FtNRXvwi7x7ePgBrE8ZMGnSckn2A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ytZypxTMzBI3MZ8BevJxRt1Flc2uxJ9l6U?= =?us-ascii?Q?7uDPfRbvAPSPt10LTVfbxS0Cd6x+Fgw1MiKs3uaR40M+afbqvqFt1XLskcv9?= =?us-ascii?Q?/7+kJR8Hde5AFq/F8LTFAt5mzYNwr4I0BEWvyXYswscn1kdyunLsMZCCuFVd?= =?us-ascii?Q?O7RanvpdG5EjxulaIvANTieHdkyd+N5AGvTz8iqs6PT1GzgvHaiiSXyO3Mdi?= =?us-ascii?Q?+YphoViPbOuWY8V18TytBTsBxAQ9ELaVGoUmnzKfr96VUmUB9EWA23flFTaz?= =?us-ascii?Q?4oa9xz+O1Y5ZyP57vLsmRpOt7/94YtB8tntxhIBX1FbSt3MvCIxJXq3S84aD?= =?us-ascii?Q?lC0OAYLlue/ko/nacZRgP1PqBzFmmj6954hZhUwWrwJ6iPE76YPAg2Y6iCT8?= =?us-ascii?Q?2Jyhm2dbKg=3D=3D?= X-OriginatorOrg: vmware.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2e32dddb-ecf6-4fed-826a-08da2c749971 X-MS-Exchange-CrossTenant-AuthSource: BYAPR05MB5624.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 May 2022 19:47:32.9934 (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: Ovz/z/2sqky704CF/9csrWHY2FIirvbXZLZD+3tFoLrFLgkOV8ZLtisLBcYJENmrD/EL3wx+0j2UivFH558Y8w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR05MB3294 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 Tested, using testpmd, for different hardware version on ESXi 7.0 Update 2. Signed-off-by: Pankaj Gupta --- drivers/net/vmxnet3/vmxnet3_ethdev.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c index a76796716b..f77399f145 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, @@ -147,6 +151,7 @@ static const struct eth_dev_ops vmxnet3_eth_dev_ops = { .rx_queue_intr_disable = vmxnet3_dev_rx_queue_intr_disable, .reta_update = vmxnet3_rss_reta_update, .reta_query = vmxnet3_rss_reta_query, + .fw_version_get = vmxnet3_hw_ver_get, }; struct vmxnet3_xstats_name_off { @@ -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