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 24B66A0545; Wed, 25 May 2022 02:41:24 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0C17642B6E; Wed, 25 May 2022 02:41:04 +0200 (CEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2046.outbound.protection.outlook.com [40.107.93.46]) by mails.dpdk.org (Postfix) with ESMTP id E6B83400D6 for ; Wed, 25 May 2022 02:40:53 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cho/755sQV0avSprth1bx8hLBcdWx5exLTTwz8+z9yVnvLTqdEQ0ZfOa/3gwhdaLR3sLLaeKgbkLI0aUjIvQZfe9fnX5bIvDHa5egpQah9YYKk+rgKJkRcJV0HQEEibcBQtvtd0bPVS7BpAOGBUaNk+aTcz2uB1dArnAomSC1z7tl5FG1cN55q1udYCsH+0Pq4ScUAVCPwbQ3eDm/81LcgCm1sHIsVn0n4Xp4F5BPHUG5hGuyEanVzgBbmb5VT3nxMpYNUcKpgKJbN6f//MKPG8JIfXhP/K1b1zlBQfKRwRYmcxI5Dj8oVF5oDTN4/2y0daYOqS8HRfWu08vUEA0vA== 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=1XfjfD+mTk2A8kK5ofGwjcdZO539L9riw4F+79FgZbo=; b=iLZgX+5JFq7HA7+6pxYPulRuclRxN1Z9RQcE+WE5xXeuoOu5TxBnd+ullrF28l745Vt6hNbYyi9xkvqMm1gD9+E1Ffsj96vcV06wJRHyQPYyH7hlVLUqBGqD/JMhMyZSlyIywxDWn5NYY1k2e1KHwnaDrQ4lX8piSw+nptgoSrHoSogxtpWGoLgUzZTJ8fiGxPS6+A/YK0nbHz0T+v4RKgmNwXTQKd//aTqwVE4UqiiTHSTNgKUYYW9TYuSuBiKOpIdtzcKsfRdr1jfIeh81419MBVv++QCu0+ZRpfFPxDqCtBCCo2JFolC2ZSq5KQduWOPXlfQ7xcAlhNQjr3FPtQ== 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=1XfjfD+mTk2A8kK5ofGwjcdZO539L9riw4F+79FgZbo=; b=ca+8YHGftcxQLaO8LJrMbujKYyYv7ELSVAC9TpZU9/NQekWob5FxzHM/EltLrpvD2oHXEQEZtR56BUs14d4iVWrtVESsMHBfC2I+vugVdjcXXb+yDWRXXSL4dms9/qw6pQxQ6o+oaO3UHTAyQ5NH4HRTifFvERsi3TbWF0nncM8= 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 MWHPR0501MB3753.namprd05.prod.outlook.com (2603:10b6:301:79::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5293.13; Wed, 25 May 2022 00:40:49 +0000 Received: from BYAPR05MB5624.namprd05.prod.outlook.com ([fe80::49ad:2ac7:16c0:51c8]) by BYAPR05MB5624.namprd05.prod.outlook.com ([fe80::49ad:2ac7:16c0:51c8%6]) with mapi id 15.20.5293.013; Wed, 25 May 2022 00:40:48 +0000 From: Pankaj Gupta To: jbehrens@vmware.com Cc: dev@dpdk.org, pagupta@vmware.com Subject: [PATCH v6 2/9] net/vmxnet3: implement RETA query and RETA update Date: Tue, 24 May 2022 17:40:21 -0700 Message-Id: <20220525004028.24938-3-pagupta@vmware.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220525004028.24938-1-pagupta@vmware.com> References: <20220525004028.24938-1-pagupta@vmware.com> Content-Type: text/plain X-ClientProxiedBy: SJ0PR05CA0056.namprd05.prod.outlook.com (2603:10b6:a03:33f::31) 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: 9ebd9cde-f5a9-4647-db48-08da3de73622 X-MS-TrafficTypeDiagnostic: MWHPR0501MB3753: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: x2SUwjBI3/psry8UwQwIRUfqQxR/J12WQ6g4pviLKS9esZYPeUZq0jADyL9iQfXNWKE9FL0AAoMh3hz+jRnKB2zO/JwTHEnGjolYNOMjW21EMZPzPQTnLtLrCzBSZNfw9FQOmJNQKmHOtjfbl1PN++ka50RjJAn+5tlVP1EgWpQdT6s96ZxD1xW4vm6Y/t3fmNk/jrbDqa1kX78FjTQ9nTBq5hWx7YrqkuHKEt2SsweL+MbKA5AfisUBnvpqUyummaRoJYFhRz74T1zn+Dvc0JpcBoSkacfegez+yj7jokOqxVA71diWY8kaxgBwkHfKUOV8Tazjc245fkAQjBuyq3CrXfWe2RAD3E1BF9WGyTCoS3uqcXI2mQ/Bj9ImUzmWHScZxed+8K8OBcciDEIgP0BH6Y+qf8JpMnlW8vFcUPVcS9HHMnuuP/V184ynDrIEX12DHC23A3kEFLKkIKUKwo2xYERAe3TazBpfOJSmjDMWxROf74vn0Evq6XtAxe/FKqwtr4jGioCfYV/JccXj65TqeEPSMR+vD6h5ko6SCpNeZPlEcuoVOI8/lcUKogJG3IUwlsXUvkyuJBy2jlY1uiUTxB46ktQ2yPZjEMn4l08z9AlgcBdD/Ilag+ldnfzYmH/B8r9T3ZZWD5egJHlCK6tqhDWW2L5dAQySFUrhP4UA8EkuBN0wXoC/CwON7xhkICDSZgvvY9FsNY+EW8vDRg== 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)(186003)(52116002)(1076003)(2616005)(6666004)(8676002)(6506007)(316002)(66476007)(66556008)(66946007)(38100700002)(6512007)(34206002)(4326008)(107886003)(508600001)(6486002)(6636002)(37006003)(36756003)(26005)(38350700002)(2906002)(5660300002)(83380400001)(15650500001)(86362001)(8936002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?4bdQzkFUL+izsMkI74ZELKEInMktCG9k53qslgtV7gQAd8aPkCqt90SzTe2r?= =?us-ascii?Q?1hgDGE22gOUDNHpxOvq9j5JaBP1mI5+3GaN+/EY0DPrGSsIAmAiuDcU1Gi45?= =?us-ascii?Q?ge25pV/TRgxqo0YR10IiGhsvxVHcSObDlja+oer+jITg1UFk9wGd/qX7F4DG?= =?us-ascii?Q?pyrq1tx0ilXQEb79aAnkZX6xCd6lqbRFN97fio4JsLTvsP/T4E5w6owqnly/?= =?us-ascii?Q?nT9mEp/pSsP6A+Zp0LffwLG7dXq3OnY1x4fur3Y/L5AeQbCcJvhiUWziHCkp?= =?us-ascii?Q?7sfG48t6H6/obovq0R5ns27d7nDzh7gIS4wuGo/htlSy30Q/yTaCu8Ah5+uD?= =?us-ascii?Q?lTrqTnRvz68SXIloD+Y9rldzppSz3xx//C8SIwqUSRNqxV7lcOie5bqbSFP8?= =?us-ascii?Q?bPDVXHOXrzqQpgBlgIRvFDcqPYw1eJ6SV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?YC2QZMuPVwfOTCUqkpW3o69Sq8ZQSxVY2Wcw4U5rOLK40u3daRg+l33yU7dT?= =?us-ascii?Q?wmo8bMj9K9NCC6zLlv7zKiXNlijAYIjYAJscDt8SZ2WCKDTR6mL4qaK0KEAC?= =?us-ascii?Q?Gd/muBdAEJrLSPCOtEFw/i6R3FOeEaIv+IYo3qPkOp317PnP4J1HkCC3F4N/?= =?us-ascii?Q?wgCxo/N63V4bwgGHTGULRWP5DQTP8tC8K/NXtMtVcxMf8arev+WV2bWJoLk8?= =?us-ascii?Q?29ayw3oQelxqOrJZoiLvCMzI1tm0QRFIHMQ/LoYON+pojLYpYXDtZMnCDR6L?= =?us-ascii?Q?vUFUBrOsqPuWby4PT/42fFvgd3w4kiImV15tMwFrCH6ulcufgG5mhX73NMS9?= =?us-ascii?Q?ly1HHn+9tKXtCMgTJegdzYXObZTvkzWEMoQvih2Rn9K2/NAQxa1w75Xa3ksQ?= =?us-ascii?Q?uBbWUwXFdw=3D=3D?= X-OriginatorOrg: vmware.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9ebd9cde-f5a9-4647-db48-08da3de73622 X-MS-Exchange-CrossTenant-AuthSource: BYAPR05MB5624.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 May 2022 00:40:48.2433 (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: xHPOvJg2Rq/SrFRAPp0buAkYIXq37B9lELhg+G4co/PppeJPtwHZtWuuqaUcNJqmj+ULi5PtjKUVmvBlju5sSg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR0501MB3753 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 versions on ESXi 7.0 Update 2. Signed-off-by: Pankaj Gupta Reviewed-by: Jochen Behrens --- doc/guides/rel_notes/release_21_08.rst | 2 + drivers/net/vmxnet3/vmxnet3_ethdev.c | 67 ++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) diff --git a/doc/guides/rel_notes/release_21_08.rst b/doc/guides/rel_notes/release_21_08.rst index cc472d7a05..4027bd4390 100644 --- a/doc/guides/rel_notes/release_21_08.rst +++ b/doc/guides/rel_notes/release_21_08.rst @@ -131,6 +131,8 @@ New Features * **Added vmxnet3 version 5 support.** +* **Added RETA query and RETA update support for vmxnet3.** + API Changes ----------- 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