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 C4D2EA0581; Thu, 20 Oct 2022 12:39:10 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1CB9742D45; Thu, 20 Oct 2022 12:38:52 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id A78D942D3A for ; Thu, 20 Oct 2022 12:38:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666262329; x=1697798329; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=+ftQCRhTVozVP7bcdM+MfqRffvLXfBxLiszsPb0xGEQ=; b=Wg0r4kLlLF54QQrGwWeoYUhgh2YJHr8gDzMxDItpbr6X+V0/YCiJ3MHG jqkdqrBD77tDvlVYzYJtOT1AJIEZQDx4tC13xk5lhiGVlrjDMk2Xt2I5y mkkz1YOXjs63y7+oP/I46cP5KFS92OUYn2OA+bEtN3Ik6Xfsr3HkIQAbK QutoEwbSNoCKlc4BOHFJxaOdmMsuBabey8PfgBQr250+8OcClz9UoRe61 YbjwrW9SdCjDkVP8oaJbyqfGcI9RfKQJnzydUwhAyhOlItKfYmE8y7WaF rx9BR2fgs3yocTsRJI9oJ1oiU42AbdxtcDK13nYZZi5nVlTQI3Rv6FFhV w==; X-IronPort-AV: E=McAfee;i="6500,9779,10505"; a="308354925" X-IronPort-AV: E=Sophos;i="5.95,198,1661842800"; d="scan'208";a="308354925" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Oct 2022 03:38:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10505"; a="698582908" X-IronPort-AV: E=Sophos;i="5.95,198,1661842800"; d="scan'208";a="698582908" Received: from dpdk-jf-ntb-one.sh.intel.com ([10.67.111.104]) by fmsmga004.fm.intel.com with ESMTP; 20 Oct 2022 03:38:46 -0700 From: Junfeng Guo 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 Subject: [PATCH v6 6/8] net/gve: add support for dev info get and dev configure Date: Thu, 20 Oct 2022 18:36:54 +0800 Message-Id: <20221020103656.1068036-7-junfeng.guo@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221020103656.1068036-1-junfeng.guo@intel.com> References: <20221010101757.878317-2-junfeng.guo@intel.com> <20221020103656.1068036-1-junfeng.guo@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 dev_ops dev_infos_get. Complete dev_configure with RX offloads configuration. Signed-off-by: Xiaoyun Li Signed-off-by: Junfeng Guo --- doc/guides/nics/features/gve.ini | 2 ++ doc/guides/nics/gve.rst | 1 + drivers/net/gve/gve_ethdev.c | 56 +++++++++++++++++++++++++++++++- 3 files changed, 58 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 1968f38eb6..5be8d664f3 100644 --- a/drivers/net/gve/gve_ethdev.c +++ b/drivers/net/gve/gve_ethdev.c @@ -29,8 +29,13 @@ 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.offloads & RTE_ETH_RX_OFFLOAD_TCP_LRO) + priv->enable_rsc = 1; + return 0; } @@ -94,6 +99,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 = RTE_ETHER_MTU; + dev_info->min_mtu = RTE_ETHER_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) { @@ -125,6 +178,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, }; -- 2.34.1