DPDK patches and discussions
 help / color / mirror / Atom feed
From: Junfeng Guo <junfeng.guo@intel.com>
To: qi.z.zhang@intel.com, jingjing.wu@intel.com,
	ferruh.yigit@xilinx.com, beilei.xing@intel.com
Cc: dev@dpdk.org, xiaoyun.li@intel.com, awogbemila@google.com,
	bruce.richardson@intel.com, hemant.agrawal@nxp.com,
	stephen@networkplumber.org, chenbo.xia@intel.com,
	helin.zhang@intel.com, Junfeng Guo <junfeng.guo@intel.com>
Subject: [PATCH v7 6/8] net/gve: add support for dev info get and dev configure
Date: Fri, 21 Oct 2022 17:19:26 +0800	[thread overview]
Message-ID: <20221021091928.2674471-7-junfeng.guo@intel.com> (raw)
In-Reply-To: <20221021091928.2674471-1-junfeng.guo@intel.com>

Add dev_ops dev_infos_get.
Complete dev_configure with RX offloads force enabling.

Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
---
 doc/guides/nics/features/gve.ini |  2 ++
 doc/guides/nics/gve.rst          |  1 +
 drivers/net/gve/gve_ethdev.c     | 59 +++++++++++++++++++++++++++++++-
 drivers/net/gve/gve_ethdev.h     |  3 ++
 4 files changed, 64 insertions(+), 1 deletion(-)

diff --git a/doc/guides/nics/features/gve.ini b/doc/guides/nics/features/gve.ini
index d1703d8dab..986df7f94a 100644
--- a/doc/guides/nics/features/gve.ini
+++ b/doc/guides/nics/features/gve.ini
@@ -4,8 +4,10 @@
 ; Refer to default.ini for the full list of available PMD features.
 ;
 [Features]
+Speed capabilities   = Y
 Link status          = Y
 MTU update           = Y
+RSS hash             = Y
 Linux                = Y
 x86-32               = Y
 x86-64               = Y
diff --git a/doc/guides/nics/gve.rst b/doc/guides/nics/gve.rst
index c42ff23841..8c09a5a7fa 100644
--- a/doc/guides/nics/gve.rst
+++ b/doc/guides/nics/gve.rst
@@ -62,6 +62,7 @@ In this release, the GVE PMD provides the basic functionality of packet
 reception and transmission.
 Supported features of the GVE PMD are:
 
+- Receiver Side Scaling (RSS)
 - Link state information
 
 Currently, only GQI_QPL and GQI_RDA queue format are supported in PMD.
diff --git a/drivers/net/gve/gve_ethdev.c b/drivers/net/gve/gve_ethdev.c
index 554f58640d..7fbe0c78c9 100644
--- a/drivers/net/gve/gve_ethdev.c
+++ b/drivers/net/gve/gve_ethdev.c
@@ -29,8 +29,16 @@ gve_write_version(uint8_t *driver_version_register)
 }
 
 static int
-gve_dev_configure(__rte_unused struct rte_eth_dev *dev)
+gve_dev_configure(struct rte_eth_dev *dev)
 {
+	struct gve_priv *priv = dev->data->dev_private;
+
+	if (dev->data->dev_conf.rxmode.mq_mode & RTE_ETH_MQ_RX_RSS_FLAG)
+		dev->data->dev_conf.rxmode.offloads |= RTE_ETH_RX_OFFLOAD_RSS_HASH;
+
+	if (dev->data->dev_conf.rxmode.offloads & RTE_ETH_RX_OFFLOAD_TCP_LRO)
+		priv->enable_rsc = 1;
+
 	return 0;
 }
 
@@ -96,6 +104,54 @@ gve_dev_close(struct rte_eth_dev *dev)
 	return err;
 }
 
+static int
+gve_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
+{
+	struct gve_priv *priv = dev->data->dev_private;
+
+	dev_info->device = dev->device;
+	dev_info->max_mac_addrs = 1;
+	dev_info->max_rx_queues = priv->max_nb_rxq;
+	dev_info->max_tx_queues = priv->max_nb_txq;
+	dev_info->min_rx_bufsize = GVE_MIN_BUF_SIZE;
+	dev_info->max_rx_pktlen = GVE_MAX_RX_PKTLEN;
+	dev_info->max_mtu = GVE_MAX_MTU;
+	dev_info->min_mtu = GVE_MIN_MTU;
+
+	dev_info->rx_offload_capa = 0;
+	dev_info->tx_offload_capa = 0;
+
+	if (priv->queue_format == GVE_DQO_RDA_FORMAT)
+		dev_info->rx_offload_capa |= RTE_ETH_RX_OFFLOAD_TCP_LRO;
+
+	dev_info->default_rxconf = (struct rte_eth_rxconf) {
+		.rx_free_thresh = GVE_DEFAULT_RX_FREE_THRESH,
+		.rx_drop_en = 0,
+		.offloads = 0,
+	};
+
+	dev_info->default_txconf = (struct rte_eth_txconf) {
+		.tx_free_thresh = GVE_DEFAULT_TX_FREE_THRESH,
+		.offloads = 0,
+	};
+
+	dev_info->default_rxportconf.ring_size = priv->rx_desc_cnt;
+	dev_info->rx_desc_lim = (struct rte_eth_desc_lim) {
+		.nb_max = priv->rx_desc_cnt,
+		.nb_min = priv->rx_desc_cnt,
+		.nb_align = 1,
+	};
+
+	dev_info->default_txportconf.ring_size = priv->tx_desc_cnt;
+	dev_info->tx_desc_lim = (struct rte_eth_desc_lim) {
+		.nb_max = priv->tx_desc_cnt,
+		.nb_min = priv->tx_desc_cnt,
+		.nb_align = 1,
+	};
+
+	return 0;
+}
+
 static int
 gve_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
 {
@@ -128,6 +184,7 @@ static const struct eth_dev_ops gve_eth_dev_ops = {
 	.dev_start            = gve_dev_start,
 	.dev_stop             = gve_dev_stop,
 	.dev_close            = gve_dev_close,
+	.dev_infos_get        = gve_dev_info_get,
 	.link_update          = gve_link_update,
 	.mtu_set              = gve_dev_mtu_set,
 };
diff --git a/drivers/net/gve/gve_ethdev.h b/drivers/net/gve/gve_ethdev.h
index 2ac2a46ac1..57c29374b5 100644
--- a/drivers/net/gve/gve_ethdev.h
+++ b/drivers/net/gve/gve_ethdev.h
@@ -18,6 +18,9 @@
 #define GVE_MIN_BUF_SIZE	    1024
 #define GVE_MAX_RX_PKTLEN	    65535
 
+#define GVE_MAX_MTU	RTE_ETHER_MTU
+#define GVE_MIN_MTU	RTE_ETHER_MIN_MTU
+
 /* A list of pages registered with the device during setup and used by a queue
  * as buffers
  */
-- 
2.34.1


  parent reply	other threads:[~2022-10-21  9:21 UTC|newest]

Thread overview: 192+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-29 19:30 [PATCH 00/10] introduce GVE PMD Xiaoyun Li
2022-07-29 19:30 ` [PATCH 01/10] net/gve: introduce GVE PMD base code Xiaoyun Li
2022-07-29 22:42   ` Stephen Hemminger
2022-07-29 22:45     ` Stephen Hemminger
2022-08-23  8:44       ` Guo, Junfeng
2022-08-29  8:41   ` [PATCH v2 00/10] introduce GVE PMD Junfeng Guo
2022-08-29  8:41     ` [PATCH v2 01/10] net/gve: introduce GVE PMD base code Junfeng Guo
2022-09-01 17:19       ` Ferruh Yigit
2022-09-01 18:23         ` Stephen Hemminger
2022-09-01 20:49           ` Thomas Monjalon
2022-09-06  9:31             ` Guo, Junfeng
2022-09-14 10:38               ` Thomas Monjalon
2022-08-29  8:41     ` [PATCH v2 02/10] net/gve: add logs and OS specific implementation Junfeng Guo
2022-09-01 17:20       ` Ferruh Yigit
2022-09-07  6:58         ` Guo, Junfeng
2022-09-07 11:16           ` Ferruh Yigit
2022-09-08  8:09             ` Guo, Junfeng
2022-08-29  8:41     ` [PATCH v2 03/10] net/gve: support device initialization Junfeng Guo
2022-09-01 17:21       ` Ferruh Yigit
2022-09-23  9:38         ` Guo, Junfeng
2022-09-01 17:22       ` Ferruh Yigit
2022-08-29  8:41     ` [PATCH v2 04/10] net/gve: add link update support Junfeng Guo
2022-09-01 17:23       ` Ferruh Yigit
2022-09-23  9:38         ` Guo, Junfeng
2022-08-29  8:41     ` [PATCH v2 05/10] net/gve: add MTU set support Junfeng Guo
2022-08-29  8:41     ` [PATCH v2 06/10] net/gve: add queue operations Junfeng Guo
2022-08-29  8:41     ` [PATCH v2 07/10] net/gve: add Rx/Tx support Junfeng Guo
2022-08-29  8:41     ` [PATCH v2 08/10] net/gve: add support to get dev info and configure dev Junfeng Guo
2022-09-01 17:23       ` Ferruh Yigit
2022-09-23  9:38         ` Guo, Junfeng
2022-08-29  8:41     ` [PATCH v2 09/10] net/gve: add stats support Junfeng Guo
2022-09-01 17:24       ` Ferruh Yigit
2022-09-23  9:38         ` Guo, Junfeng
2022-08-29  8:41     ` [PATCH v2 10/10] doc: update documentation Junfeng Guo
2022-09-01 17:20       ` Ferruh Yigit
2022-09-23  9:38       ` [PATCH v3 0/9] introduce GVE PMD Junfeng Guo
2022-09-23  9:38         ` [PATCH v3 1/9] net/gve: introduce GVE PMD base code Junfeng Guo
2022-09-23 18:57           ` Stephen Hemminger
2022-09-27  7:27             ` Guo, Junfeng
2022-09-23 18:58           ` Stephen Hemminger
2022-09-27  7:27             ` Guo, Junfeng
2022-09-27  7:32           ` [PATCH v4 0/9] introduce GVE PMD Junfeng Guo
2022-09-27  7:32             ` [PATCH v4 1/9] net/gve/base: introduce GVE PMD base code Junfeng Guo
2022-10-06 14:19               ` Ferruh Yigit
2022-10-09  9:14                 ` Guo, Junfeng
2022-10-10 10:17               ` [PATCH v5 0/8] introduce GVE PMD Junfeng Guo
2022-10-10 10:17                 ` [PATCH v5 1/8] net/gve/base: introduce GVE PMD base code Junfeng Guo
2022-10-19 13:45                   ` Ferruh Yigit
2022-10-19 15:13                     ` Hemant Agrawal
2022-10-19 15:18                       ` Ferruh Yigit
2022-10-20  3:33                         ` Hemant Agrawal
2022-10-19 15:48                     ` Li, Xiaoyun
2022-10-19 20:52                       ` Ferruh Yigit
2022-10-20  8:50                         ` Li, Xiaoyun
2022-10-20 10:36                   ` [PATCH v6 0/8] introduce GVE PMD Junfeng Guo
2022-10-20 10:36                     ` [PATCH v6 1/8] net/gve/base: introduce GVE PMD base code Junfeng Guo
2022-10-20 14:39                       ` Ferruh Yigit
2022-10-24  2:10                         ` Guo, Junfeng
2022-10-20 14:40                       ` Ferruh Yigit
2022-10-24  2:10                         ` Guo, Junfeng
2022-10-20 10:36                     ` [PATCH v6 2/8] net/gve/base: add OS specific implementation Junfeng Guo
2022-10-20 10:36                     ` [PATCH v6 3/8] net/gve: add support for device initialization Junfeng Guo
2022-10-20 14:42                       ` Ferruh Yigit
2022-10-24  2:10                         ` Guo, Junfeng
2022-10-20 10:36                     ` [PATCH v6 4/8] net/gve: add support for link update Junfeng Guo
2022-10-20 10:36                     ` [PATCH v6 5/8] net/gve: add support for MTU setting Junfeng Guo
2022-10-20 14:45                       ` Ferruh Yigit
2022-10-24  2:10                         ` Guo, Junfeng
2022-10-20 10:36                     ` [PATCH v6 6/8] net/gve: add support for dev info get and dev configure Junfeng Guo
2022-10-20 14:45                       ` Ferruh Yigit
2022-10-24  2:10                         ` Guo, Junfeng
2022-10-20 10:36                     ` [PATCH v6 7/8] net/gve: add support for queue operations Junfeng Guo
2022-10-20 10:36                     ` [PATCH v6 8/8] net/gve: add support for Rx/Tx Junfeng Guo
2022-10-20 14:47                       ` Ferruh Yigit
2022-10-24  2:10                         ` Guo, Junfeng
2022-10-21  9:19                     ` [PATCH v7 0/8] introduce GVE PMD Junfeng Guo
2022-10-21  9:19                       ` [PATCH v7 1/8] net/gve/base: introduce base code Junfeng Guo
2022-10-21  9:49                         ` Ferruh Yigit
2022-10-24  5:04                           ` Guo, Junfeng
2022-10-24 10:47                             ` Ferruh Yigit
2022-10-24 13:23                               ` Guo, Junfeng
2022-10-24 10:50                         ` Ferruh Yigit
2022-10-24 13:26                           ` Guo, Junfeng
2022-10-25  9:07                         ` [PATCH v8 0/8] introduce GVE PMD Junfeng Guo
2022-10-25  9:07                           ` [PATCH v8 1/8] net/gve/base: introduce base code Junfeng Guo
2022-10-25  9:07                           ` [PATCH v8 2/8] net/gve/base: add OS specific implementation Junfeng Guo
2022-10-25  9:07                           ` [PATCH v8 3/8] net/gve: add support for device initialization Junfeng Guo
2022-10-25  9:07                           ` [PATCH v8 4/8] net/gve: add support for link update Junfeng Guo
2022-10-25  9:07                           ` [PATCH v8 5/8] net/gve: add support for MTU setting Junfeng Guo
2022-10-25 15:55                             ` Stephen Hemminger
2022-10-26  2:15                               ` Guo, Junfeng
2022-10-25  9:07                           ` [PATCH v8 6/8] net/gve: add support for dev info get and dev configure Junfeng Guo
2022-10-25  9:07                           ` [PATCH v8 7/8] net/gve: add support for queue operations Junfeng Guo
2022-10-25  9:07                           ` [PATCH v8 8/8] net/gve: add support for Rx/Tx Junfeng Guo
2022-10-25 12:33                           ` [PATCH v8 0/8] introduce GVE PMD Ferruh Yigit
2022-10-26  2:05                             ` Guo, Junfeng
2022-10-21  9:19                       ` [PATCH v7 2/8] net/gve/base: add OS specific implementation Junfeng Guo
2022-10-21  9:19                       ` [PATCH v7 3/8] net/gve: add support for device initialization Junfeng Guo
2022-10-21  9:49                         ` Ferruh Yigit
2022-10-24  5:04                           ` Guo, Junfeng
2022-10-24 10:47                             ` Ferruh Yigit
2022-10-24 13:22                               ` Guo, Junfeng
2022-10-21  9:19                       ` [PATCH v7 4/8] net/gve: add support for link update Junfeng Guo
2022-10-21  9:19                       ` [PATCH v7 5/8] net/gve: add support for MTU setting Junfeng Guo
2022-10-21  9:50                         ` Ferruh Yigit
2022-10-24  5:04                           ` Guo, Junfeng
2022-10-24 10:47                             ` Ferruh Yigit
2022-10-24 13:23                               ` Guo, Junfeng
2022-10-21  9:19                       ` Junfeng Guo [this message]
2022-10-21  9:51                         ` [PATCH v7 6/8] net/gve: add support for dev info get and dev configure Ferruh Yigit
2022-10-24  5:04                           ` Guo, Junfeng
2022-10-24 10:48                             ` Ferruh Yigit
2022-10-24 13:23                               ` Guo, Junfeng
2022-10-21  9:19                       ` [PATCH v7 7/8] net/gve: add support for queue operations Junfeng Guo
2022-10-21  9:19                       ` [PATCH v7 8/8] net/gve: add support for Rx/Tx Junfeng Guo
2022-10-21  9:52                         ` Ferruh Yigit
2022-10-24  5:04                           ` Guo, Junfeng
2022-10-24 10:50                             ` Ferruh Yigit
2022-10-24 13:25                               ` Guo, Junfeng
2022-10-25  9:07                                 ` Guo, Junfeng
2022-10-21 13:12                       ` [PATCH v7 0/8] introduce GVE PMD Ferruh Yigit
2022-10-24 10:50                         ` Ferruh Yigit
2022-10-24 13:25                           ` Guo, Junfeng
2022-10-10 10:17                 ` [PATCH v5 2/8] net/gve/base: add OS specific implementation Junfeng Guo
2022-10-10 10:17                 ` [PATCH v5 3/8] net/gve: add support for device initialization Junfeng Guo
2022-10-19 13:46                   ` Ferruh Yigit
2022-10-19 15:59                     ` Li, Xiaoyun
2022-10-19 21:00                       ` Ferruh Yigit
2022-10-20  9:29                         ` Guo, Junfeng
2022-10-20 11:15                           ` Ferruh Yigit
2022-10-21  4:46                             ` Guo, Junfeng
2022-10-19 13:47                   ` Ferruh Yigit
2022-10-19 14:02                     ` Xia, Chenbo
2022-10-19 14:24                     ` Zhang, Helin
2022-10-19 21:16                       ` Ferruh Yigit
2022-10-19 16:20                     ` Li, Xiaoyun
2022-10-10 10:17                 ` [PATCH v5 4/8] net/gve: add support for link update Junfeng Guo
2022-10-10 10:17                 ` [PATCH v5 5/8] net/gve: add support for MTU setting Junfeng Guo
2022-10-19 13:47                   ` Ferruh Yigit
2022-10-20 10:14                     ` Guo, Junfeng
2022-10-10 10:17                 ` [PATCH v5 6/8] net/gve: add support for dev info get and dev configure Junfeng Guo
2022-10-19 13:49                   ` Ferruh Yigit
2022-10-20  9:29                     ` Guo, Junfeng
2022-10-20 11:19                       ` Ferruh Yigit
2022-10-21  5:22                         ` Guo, Junfeng
2022-10-10 10:17                 ` [PATCH v5 7/8] net/gve: add support for queue operations Junfeng Guo
2022-10-10 10:17                 ` [PATCH v5 8/8] net/gve: add support for Rx/Tx Junfeng Guo
2022-10-19 13:47                   ` Ferruh Yigit
2022-10-20  9:34                     ` Guo, Junfeng
2022-09-27  7:32             ` [PATCH v4 2/9] net/gve/base: add logs and OS specific implementation Junfeng Guo
2022-10-06 14:20               ` Ferruh Yigit
2022-10-09  9:14                 ` Guo, Junfeng
2022-09-27  7:32             ` [PATCH v4 3/9] net/gve: add support for device initialization Junfeng Guo
2022-10-06 14:22               ` Ferruh Yigit
2022-10-09  9:14                 ` Guo, Junfeng
2022-09-27  7:32             ` [PATCH v4 4/9] net/gve: add support for link update Junfeng Guo
2022-10-06 14:23               ` Ferruh Yigit
2022-10-09  9:14                 ` Guo, Junfeng
2022-09-27  7:32             ` [PATCH v4 5/9] net/gve: add support for MTU setting Junfeng Guo
2022-09-27  7:32             ` [PATCH v4 6/9] net/gve: add support for queue operations Junfeng Guo
2022-09-27  7:32             ` [PATCH v4 7/9] net/gve: add support for Rx/Tx Junfeng Guo
2022-10-06 14:24               ` Ferruh Yigit
2022-10-09  9:14                 ` Guo, Junfeng
2022-10-10  9:39                   ` Li, Xiaoyun
2022-10-10 10:18                     ` Guo, Junfeng
2022-09-27  7:32             ` [PATCH v4 8/9] net/gve: add support for dev info get and dev configure Junfeng Guo
2022-10-06 14:25               ` Ferruh Yigit
2022-10-09  9:14                 ` Guo, Junfeng
2022-09-27  7:32             ` [PATCH v4 9/9] net/gve: add support for stats Junfeng Guo
2022-10-06 14:25               ` Ferruh Yigit
2022-10-09  9:15                 ` Guo, Junfeng
2022-09-23  9:38         ` [PATCH v3 2/9] net/gve: add logs and OS specific implementation Junfeng Guo
2022-09-23 19:01           ` Stephen Hemminger
2022-09-27  7:27             ` Guo, Junfeng
2022-09-23  9:38         ` [PATCH v3 3/9] net/gve: support device initialization Junfeng Guo
2022-09-23  9:38         ` [PATCH v3 4/9] net/gve: add link update support Junfeng Guo
2022-09-23  9:38         ` [PATCH v3 5/9] net/gve: add MTU set support Junfeng Guo
2022-09-23  9:38         ` [PATCH v3 6/9] net/gve: add queue operations Junfeng Guo
2022-09-23  9:38         ` [PATCH v3 7/9] net/gve: add Rx/Tx support Junfeng Guo
2022-09-23  9:38         ` [PATCH v3 8/9] net/gve: add support to get dev info and configure dev Junfeng Guo
2022-09-23  9:38         ` [PATCH v3 9/9] net/gve: add stats support Junfeng Guo
2022-09-01 17:19     ` [PATCH v2 00/10] introduce GVE PMD Ferruh Yigit
2022-09-07  2:09       ` Guo, Junfeng
2022-07-29 19:30 ` [PATCH 02/10] net/gve: add logs and OS specific implementation Xiaoyun Li
2022-07-29 19:30 ` [PATCH 03/10] net/gve: support device initialization Xiaoyun Li
2022-07-29 19:30 ` [PATCH 04/10] net/gve: add link update support Xiaoyun Li
2022-07-29 19:30 ` [PATCH 05/10] net/gve: add MTU set support Xiaoyun Li
2022-07-29 19:30 ` [PATCH 06/10] net/gve: add queue operations Xiaoyun Li
2022-07-29 19:30 ` [PATCH 07/10] net/gve: add Rx/Tx support Xiaoyun Li
2022-07-29 19:30 ` [PATCH 08/10] net/gve: add support to get dev info and configure dev Xiaoyun Li
2022-07-29 19:30 ` [PATCH 09/10] net/gve: add stats support Xiaoyun Li
2022-07-29 19:30 ` [PATCH 10/10] doc: update documentation Xiaoyun Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221021091928.2674471-7-junfeng.guo@intel.com \
    --to=junfeng.guo@intel.com \
    --cc=awogbemila@google.com \
    --cc=beilei.xing@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=chenbo.xia@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@xilinx.com \
    --cc=helin.zhang@intel.com \
    --cc=hemant.agrawal@nxp.com \
    --cc=jingjing.wu@intel.com \
    --cc=qi.z.zhang@intel.com \
    --cc=stephen@networkplumber.org \
    --cc=xiaoyun.li@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).