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 810DDA0501; Fri, 6 May 2022 00:00:50 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 42E8E42825; Fri, 6 May 2022 00:00:39 +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 86ED540042 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=Df9DTIrs/z1QDHcJQ3wd9OCU4NxvUZG8TjcI6F95JnzC+JBI4p3m5UT1A4qFOXQcYp/5GxwGjlgeK9ILuH+MDpR4Gf7xP1Ur0DS5quIcZt6z9eqHeAMdz7S7Xa8drJ/lsAKMhtZGi2J6aB4i/yDk30aI9aSjP/iiytfjRkZh4zYrPBidmxzK/TAvTjc6Mx9tdsM8pTXDJLhgKb5GZezwO68rcXydKzH5AbmJj+JDfuPkjaqTLbHXpiDc/Ho8ugvD2EgIOqQzyLbfGAX52gQgTp+lMszpw/goFMTAx4v+Ys7+5V8EkXK+rzGo7ny5JK7G4KX6vWlf/C77elkqwIPz/g== 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=bRuxC7SikfrhLDfoN7CoOeFSapH8mjw4pHF/dZtLwkc=; b=Z73GOrE7JVPsjhLUpMfMlRsKLmEA+hllL5d+OBtIiKtwDwYH9NUJ1Z9Hb5ZKBfM4GE9urL9DaXhqtR74P3YmrbacMuQXchOk/rKuHhh10C1N1kbs/2hd8NjziMwkPEpUeLXjmkOZw53qZfXMZrd0zVL+usPcs131wf7rg6x8Un1UQEQGphG3wR2HDc1gvrXJyeHIHj5or2MRAk/cG596+EI54ZyJCqpkSFyTUYaBF/5opXR0uVFFc9YJBEgJNELVzZgtk786zQh1IpNunKvLgjMoiR6T57JgYjUuNLitiXNQA0cKAjjfpYdliM9wbzZ0EUe545cKJWASLDzpGwursQ== 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=bRuxC7SikfrhLDfoN7CoOeFSapH8mjw4pHF/dZtLwkc=; b=umzv8893+KqJVuBXiy1y4NhB/lWVrqorMfMvHYmxozDe8PKImoYVW1NCsNRCrCyHv013uWKfboxMXJGtKCZKIGLO1Uh3ktzd7TW272SrNFq1OW1KpYVld/zo9u7plAVw+ydCf4RPICvbbM+/apDXT50PQCYhiNPzNNOrMD0ALI8= 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 2/8] net/vmxnet3: implement reta query and reta update Date: Thu, 5 May 2022 18:00:13 -0400 Message-Id: <20220505220019.31166-3-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: 8181a5dd-a6f3-4480-b0eb-08da2ee2ad27 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: kyasPK1EW4EnWYKztMQQV8cLw0b1kjd3GEYfajo9B1hDt266TptAPegAEM26R5IswGALbsUT57w2e06nX+pqv1kvryoZW0sfD64KiNiF++DZcZs99AoyzBEbAQm1KyC1Mfwp1Q47dEHACVYaUxtqza4tYohnxpXhInLlOj99xwDsrepfrYbmhp1WMd6AOORH6wwmLo1rPPyJUB3fI1qe0g/VGJhRPWGmJGW1NCrwpTzowDJhCWKYzFQc9V9Q1Fgptz/KF3I4OmI+8DVtI0dxOnnvcBWByYzVFCQKHz3eQCzakm2VrbMD4VP6W8gZQF4KjNN+E0PN9Fyv5zqjELiCmGqN8HEfEKEsWvYQoEY6CNSIb2PIRA5DCFUf5MtNf2yKMGmbA4urWUptQcWVq4Yudrlm4UrdFFfC6gNDslO+4V1W9m9wjIndgIe8o+kYbaqj8X4PgNN1QYvcuYFd9PowUMO0zw1nILIWTiq7Xa27z9qLVKneS6fu64pRhFGUn9F83O+k+/NsYFG7lpk/6h3XKPQ0NzJbwQJRsQwvfHEjutR034zaasKEDwOPGVKZFLRScQXGRqP3SPzVDHjuMFM9D7qex7PaOUZClpny61MFaLRhLO1iuSsW2vEYI5solEU/b1JqKJOTK6TFOHfEqZ/EcjESvzWQtqVYsyOD4msHHgAJWI6ac+PzrtsNTkqI5EMS31EiaHqjiYFfR2PV6XsXfw== 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)(15650500001)(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?+WP3SNWedje0EIUIeo3fzzaLSHUBbTCLu7jZKxf2Gk6DHJu/1txB8VtOro7z?= =?us-ascii?Q?jwU9/jiPE2l+838gjNB4g5/gj57sU4uivsd4u52tdEeXLeKgPmATEIsRI6vZ?= =?us-ascii?Q?nmn27oaiGzuHyF3BP2uJjVzXOHx/rw7gi9BFh8yeFZuqt7IbNB2zZkI+7y+E?= =?us-ascii?Q?TGB/cQGih7F1j3aBDC9kc8QDSzJyOjtu/pqMGxWMZuobCA6UDdiGOxdsOk/A?= =?us-ascii?Q?YahRH2gn0Tpa1RVw18DsxwRFqnlOBnaEsgid+WZFiMz+17jGrISaPPe6HCcf?= =?us-ascii?Q?X+Q0X4/2eDHmxQgpcvpRMRGY0kRiJkhkYKrQ8dGVo5Bec1gSmeXjoV3z5x73?= =?us-ascii?Q?h2l0IPEdzKOPsii6h7UUVRky9dKVMveeh9IshXhk5I+GjNcLFB3SAgHzwq0H?= =?us-ascii?Q?ZGcyspiTDdQeJZ1XucCMxJsx8A5/hRrdVJF2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AFK62yBnCiYDOHUAOZlDvFtl/Cw2xPsOkZBlOqiIH?= =?us-ascii?Q?GQ7neaKHQwQ/hXvYNj2kpPbIwKzMIEGPTRqydLUfxag8t4hzw9fDeHLDsq/1?= =?us-ascii?Q?aE7fopq2e8HYRUjtIrkyP+QU4Tall3upJsJNXH9g8MEGi5Ofmd1WUQb0aCKj?= =?us-ascii?Q?welRryLa52OY3ZG5dqOQO650u82cThTqQevHYsp5zqQgiFMI+lfvkiMnEbhm?= =?us-ascii?Q?V0D5KuJzFL24MZt/YrCLtL7fdv2+2/V7KPfrBoFqr42CtF7J1tB7SkTr0h7W?= =?us-ascii?Q?VGwYyBEoNKMg3ZhBOdCtSTXzI7OmGLMCezwKbUpLYdBrkg+u0OY2PCYLOX72?= =?us-ascii?Q?DAnrwVRcPndVzmYp1DbWckrP9jGY8czp4P5zjjDvyF2Z0u9pVfYltKoEhX6f?= =?us-ascii?Q?r5g4U0bRCw=3D=3D?= X-OriginatorOrg: vmware.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8181a5dd-a6f3-4480-b0eb-08da2ee2ad27 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.9986 (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: wz0JUeXszv9G+b/JBMoxZhVqhQCHF45/S6kYAE6eO5TsAlPvtbEZ2hyZaJ294NkaTArrMijuS/X9gt32dxN/WQ== 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 reta query and reta update support for VMXNET3 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 | 67 ++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c index a7e1e5fef5..d5f9903946 100644 --- a/drivers/net/vmxnet3/vmxnet3_ethdev.c +++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c @@ -95,6 +95,14 @@ static int vmxnet3_mac_addr_set(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr); static void vmxnet3_process_events(struct rte_eth_dev *dev); static void vmxnet3_interrupt_handler(void *param); +static int +vmxnet3_rss_reta_update(struct rte_eth_dev *dev, + struct rte_eth_rss_reta_entry64 *reta_conf, + uint16_t reta_size); +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_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, @@ -137,6 +145,8 @@ static const struct eth_dev_ops vmxnet3_eth_dev_ops = { .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, + .reta_update = vmxnet3_rss_reta_update, + .reta_query = vmxnet3_rss_reta_query, }; struct vmxnet3_xstats_name_off { @@ -1696,3 +1706,60 @@ RTE_PMD_REGISTER_PCI_TABLE(net_vmxnet3, pci_id_vmxnet3_map); RTE_PMD_REGISTER_KMOD_DEP(net_vmxnet3, "* igb_uio | uio_pci_generic | vfio-pci"); RTE_LOG_REGISTER_SUFFIX(vmxnet3_logtype_init, init, NOTICE); RTE_LOG_REGISTER_SUFFIX(vmxnet3_logtype_driver, driver, NOTICE); + +static int +vmxnet3_rss_reta_update(struct rte_eth_dev *dev, + struct rte_eth_rss_reta_entry64 *reta_conf, + uint16_t reta_size) +{ + int i, idx, shift; + struct vmxnet3_hw *hw = dev->data->dev_private; + struct VMXNET3_RSSConf *dev_rss_conf = hw->rss_conf; + + if (reta_size != dev_rss_conf->indTableSize) { + PMD_DRV_LOG(ERR, + "The size of hash lookup table configured (%d) doesn't match " + "the supported number (%d)", + reta_size, dev_rss_conf->indTableSize); + return -EINVAL; + } + + for (i = 0; i < reta_size; i++) { + idx = i / RTE_ETH_RETA_GROUP_SIZE; + shift = i % RTE_ETH_RETA_GROUP_SIZE; + if (reta_conf[idx].mask & RTE_BIT64(shift)) + dev_rss_conf->indTable[i] = (uint8_t)reta_conf[idx].reta[shift]; + } + + VMXNET3_WRITE_BAR1_REG(hw, VMXNET3_REG_CMD, + VMXNET3_CMD_UPDATE_RSSIDT); + + return 0; +} + +static int +vmxnet3_rss_reta_query(struct rte_eth_dev *dev, + struct rte_eth_rss_reta_entry64 *reta_conf, + uint16_t reta_size) +{ + int i, idx, shift; + struct vmxnet3_hw *hw = dev->data->dev_private; + struct VMXNET3_RSSConf *dev_rss_conf = hw->rss_conf; + + if (reta_size != dev_rss_conf->indTableSize) { + PMD_DRV_LOG(ERR, + "Size of requested hash lookup table (%d) doesn't " + "match the configured size (%d)", + reta_size, dev_rss_conf->indTableSize); + return -EINVAL; + } + + for (i = 0; i < reta_size; i++) { + idx = i / RTE_ETH_RETA_GROUP_SIZE; + shift = i % RTE_ETH_RETA_GROUP_SIZE; + if (reta_conf[idx].mask & RTE_BIT64(shift)) + reta_conf[idx].reta[shift] = dev_rss_conf->indTable[i]; + } + + return 0; +} -- 2.17.1