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 9CBD5A0501; Fri, 6 May 2022 00:00:43 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 57E5C4280D; Fri, 6 May 2022 00:00:38 +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 349834014F for ; Fri, 6 May 2022 00:00:35 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l7WLrSTkK7cjlzz3K9G4woydhauxAGX2kgz5HQXZXuXbbwZWAYH2/UXFtlNiICBOz3D1xGcEgLVqJxLIWzhZFKWbevVhFz6OHElsiUSeRmlREryNl+rZKzUZOhd8L3Y+Ifj3UiNq9VxaLsINRAUKdo7MEE07mBIeJDGe3/j8m4VKBBh+JlXmEG0xilSmJkYyKjoMAtIU7BpfWA4FzO6X6ionbEl7fyYhlILyARUDddKrxOtBjOdB6BDkCNpoSE2XqYqyuFjZv0jYqQoD4igt3rT1zABDlN1/DvJ0G75VCUT1E7RRKl/HnrIldX4Z3s7jMENRc50A4gFR6hB8wPO1XA== 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=UWMSCO+z1vp8h7il4BLIAdIhEMk5oScAvqiln5qQfH0=; b=iKrWzE48rre49okZjfMfNGwVjVB8e2q5bvCMz3mWEYDvsTafv//MYswKg56IyKw5FNgeDtOmLTqpFpeJa79LOc28U59yc0TihoMrQze6/1pxD13Kj26nsAx+78aRW4lsFlOknoVNaApM//8VAzVZ7mlxXVglr5E02mldnrlZZH77L6Jt7qkDifzSC0lNRUZ+PaMPKY7cQd3/9WZ46ACk9r7+tcVq9ynlwbRvAkZ8O3E9TG9BF+ZEYpYAM5vJi2XQMUG615ax8R0qxa8YQ6L9ygsc21bmCbf0afFgbhtoqIL2s3GZ1rRIqP0xUtd+bZ13b8SoVSY7da6L5NmOENPZTA== 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=UWMSCO+z1vp8h7il4BLIAdIhEMk5oScAvqiln5qQfH0=; b=LcR8r47mx2L5FHFwtpd8LrDRI+I0yQFpUOZtT8wck3qY/mTf/Jq5vRIm0Z1lFnCw+xy4Mv6ZzIr+9Xu+6XucysBLXoe6Abg2ZZfYmsvsN6H8pcfvRN8hPksGgVchVm5Zpq2dlayENSK0KDhYsBbVpVi2puWcGSIjf05wxdMYpdg= 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: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; Thu, 5 May 2022 22:00:33 +0000 From: Pankaj Gupta To: jbehrens@vmware.com, yongwang@vmware.com Cc: dev@dpdk.org, pagupta@vmware.com Subject: [PATCH v4 1/8] net/vmxnet3: add V5 support Date: Thu, 5 May 2022 18:00:12 -0400 Message-Id: <20220505220019.31166-2-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: 565ac6d8-4e31-4d03-02c6-08da2ee2acf8 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: oGt3+kGKraQQwxMrFoEKigo6nLc2oCrYSD0WOssGBWASiqEsaRpc4lV/MW7kb0vI9Z5309s60hEBj9pcRDXGVfdKeXfAC7amus8sdAQul5BcWnkAXGP1byYSYfMb07e+Fj2e3zdkUa69O5oBrxubZpAJd8FrlX472s+ovcdvTDSVTHoXVQ262NQYvFtTZWYvkUhx6m2eG/IWZSMDwCjIDVh5Y9KznABONK7hEwAbPP1lB221uJnSkRLMlMRyYpZRDYM93SefvX8rwgiGA+h/nWahoIHj2n7oNxCyKwn01QY8fZBbEEFTUwyh4Cs6/AKe9bZ8yrNclRPdA7XhGbq7xDGXjraJf2FldrrqUVUldYZyvDn46M976X53/CV0V+XuHGqrWWLyaKfzYxbboK3fDC3181LNO71PmmNqJiVvmfbmYNTEA3H8xKNwi4FJ9lPH+gbDysEpTgMEsY02JPzCppQIk3hGUQ7BvPWJhaWKRmqlJwi1UyNRfE9yVApZJ0HKUvfrYqDKfJX2UmzqQuCvJem/Igh173gXK/ol2I3kXCs1xcN4zy4m5xhpqBir8HIaxjFxALp2PPPXA6emcZ1vDSUdfizmMWzVmWJWsbGYp5KA9oX5hS95Y1VO5iIaQwaHc1nD6ol25iMERqEZUOK3brZXtRHozYzY1z5Y3BjhqCcA6FrHdyA6f5rvQteLMYDTKHwco15kJ1pDxlqIT09zkg== 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?g4zTayTBp3yNLhNEDicgcSYkF5KD+i2tPNxzvdI1h9YlQY9w8ZyaQ5r1bAF/?= =?us-ascii?Q?AezRKWXshPl6BheXGXRegD2EaJfnI2OzsErghrhtZcmN3BTnCitDt55Xh4iA?= =?us-ascii?Q?n5ca+kvCSuCUS2Jr5KsjBcy7+L/OMoOQ6tTXjITIMCrqQcj2RIEvC8bfit08?= =?us-ascii?Q?fezJAKnZvuJODLijgFg//rmN7NCB7mgfMuDW25obvIAkZqy2CRxWZMhF6PWa?= =?us-ascii?Q?yoHfZDu337pzXwmWTeBKeGmlibhL3jCCaEGPOnSZKMv93iNrsJyyWby6SZrg?= =?us-ascii?Q?cAr3Mo1MVEiahjUVeN2L7t5D7ioXfBA/ry2DmuON6bVeoE+U68Lm7VYYxj5A?= =?us-ascii?Q?ctzmBkoD8JaR4N902ee5++EUOdk5O8O7jcYL68Nejxdw6kWsVjS8nUoeQcbW?= =?us-ascii?Q?hmXg4jiNZ9GYWWAW/HsODqBM+EtSndPy+7zAN6B56bmr8IdPti7vHiHel+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W1vo43L5gybw+guoifDqMnetG0MlSVhuAB3HWnik?= =?us-ascii?Q?3b3Re4NeyzyBb9KvviekaFXzM01lqcPXVqSwbkIp0J6hJFDdqZr/QObgg+jO?= =?us-ascii?Q?cjJ3qLETWSARyVAQnOoX1b21tbVCpXjy9MHS4zOPl5WU5ipMJjn2dDNdE9Zg?= =?us-ascii?Q?ANin8JD4hYGuGKRklQAoDIZmlldUvcslKKOQl9ZmnnsnGMv5AozYqFfMBwh8?= =?us-ascii?Q?MqDm8wX6COFAb4gOGz8aeEidRVHL3utGIldiUaAK52u6ALj+us/xEeXxHP8U?= =?us-ascii?Q?HakWN2plDo6F9JHQq3KK8b7UPrAj2/pS/X8ZPoO2spoEa1XuKXQm+Zo9eocD?= =?us-ascii?Q?CU3P0MhFgmMzJexK5vZET1wuescbsb7hwZTurGDWCW8mMckYIfYVzj9J1UiW?= =?us-ascii?Q?EKOOtRdtqA=3D=3D?= X-OriginatorOrg: vmware.com X-MS-Exchange-CrossTenant-Network-Message-Id: 565ac6d8-4e31-4d03-02c6-08da2ee2acf8 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:32.7486 (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: c0gmlEUO4Enk8BoThogTFlfFcuigDxCpeuShCYbgaxSD8Pjsi0DwaBLaOOtRXo5AYDYgXyInyOniGan+YnmQ/w== 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 Add VMXNET3 v5 support 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 | 7 +++++-- drivers/net/vmxnet3/vmxnet3_ethdev.h | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c index d1ef1cad08..a7e1e5fef5 100644 --- a/drivers/net/vmxnet3/vmxnet3_ethdev.c +++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c @@ -316,9 +316,12 @@ eth_vmxnet3_dev_init(struct rte_eth_dev *eth_dev) /* Check h/w version compatibility with driver. */ ver = VMXNET3_READ_BAR1_REG(hw, VMXNET3_REG_VRRS); - PMD_INIT_LOG(DEBUG, "Hardware version : %d", ver); - if (ver & (1 << VMXNET3_REV_4)) { + if (ver & (1 << VMXNET3_REV_5)) { + VMXNET3_WRITE_BAR1_REG(hw, VMXNET3_REG_VRRS, + 1 << VMXNET3_REV_5); + hw->version = VMXNET3_REV_5 + 1; + } else if (ver & (1 << VMXNET3_REV_4)) { VMXNET3_WRITE_BAR1_REG(hw, VMXNET3_REG_VRRS, 1 << VMXNET3_REV_4); hw->version = VMXNET3_REV_4 + 1; diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.h b/drivers/net/vmxnet3/vmxnet3_ethdev.h index ef858ac951..7ec3b2e1f0 100644 --- a/drivers/net/vmxnet3/vmxnet3_ethdev.h +++ b/drivers/net/vmxnet3/vmxnet3_ethdev.h @@ -124,11 +124,13 @@ struct vmxnet3_hw { UPT1_RxStats snapshot_rx_stats[VMXNET3_MAX_RX_QUEUES]; }; +#define VMXNET3_REV_5 4 /* Vmxnet3 Rev. 5 */ #define VMXNET3_REV_4 3 /* Vmxnet3 Rev. 4 */ #define VMXNET3_REV_3 2 /* Vmxnet3 Rev. 3 */ #define VMXNET3_REV_2 1 /* Vmxnet3 Rev. 2 */ #define VMXNET3_REV_1 0 /* Vmxnet3 Rev. 1 */ +#define VMXNET3_VERSION_GE_5(hw) ((hw)->version >= VMXNET3_REV_5 + 1) #define VMXNET3_VERSION_GE_4(hw) ((hw)->version >= VMXNET3_REV_4 + 1) #define VMXNET3_VERSION_GE_3(hw) ((hw)->version >= VMXNET3_REV_3 + 1) #define VMXNET3_VERSION_GE_2(hw) ((hw)->version >= VMXNET3_REV_2 + 1) -- 2.17.1