DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jiawen Wu <jiawenwu@trustnetic.com>
To: dev@dpdk.org
Cc: Jiawen Wu <jiawenwu@trustnetic.com>
Subject: [dpdk-dev] [PATCH v3 04/17] net/txgbe: get VF device information
Date: Thu, 25 Feb 2021 16:08:48 +0800	[thread overview]
Message-ID: <20210225080901.3645291-5-jiawenwu@trustnetic.com> (raw)
In-Reply-To: <20210225080901.3645291-1-jiawenwu@trustnetic.com>

Add information get operation for VF device.
RX and TX offload capabilities are same as the PF device.

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
---
 doc/guides/nics/features/txgbe_vf.ini |  7 +++
 drivers/net/txgbe/txgbe_ethdev_vf.c   | 70 +++++++++++++++++++++++++++
 2 files changed, 77 insertions(+)

diff --git a/doc/guides/nics/features/txgbe_vf.ini b/doc/guides/nics/features/txgbe_vf.ini
index 97c881d96..266bc68c6 100644
--- a/doc/guides/nics/features/txgbe_vf.ini
+++ b/doc/guides/nics/features/txgbe_vf.ini
@@ -5,6 +5,13 @@
 ;
 [Features]
 Unicast MAC filter   = Y
+CRC offload          = P
+VLAN offload         = P
+QinQ offload         = P
+L3 checksum offload  = P
+L4 checksum offload  = P
+Inner L3 checksum    = P
+Inner L4 checksum    = P
 Multiprocess aware   = Y
 Linux                = Y
 ARMv8                = Y
diff --git a/drivers/net/txgbe/txgbe_ethdev_vf.c b/drivers/net/txgbe/txgbe_ethdev_vf.c
index 86b1e2bfb..5dec29ab2 100644
--- a/drivers/net/txgbe/txgbe_ethdev_vf.c
+++ b/drivers/net/txgbe/txgbe_ethdev_vf.c
@@ -15,6 +15,8 @@
 #include "txgbe_ethdev.h"
 #include "txgbe_rxtx.h"
 
+static int txgbevf_dev_info_get(struct rte_eth_dev *dev,
+				 struct rte_eth_dev_info *dev_info);
 static int txgbevf_dev_close(struct rte_eth_dev *dev);
 static void txgbevf_intr_disable(struct rte_eth_dev *dev);
 static void txgbevf_intr_enable(struct rte_eth_dev *dev);
@@ -29,6 +31,20 @@ static const struct rte_pci_id pci_id_txgbevf_map[] = {
 	{ .vendor_id = 0, /* sentinel */ },
 };
 
+static const struct rte_eth_desc_lim rx_desc_lim = {
+	.nb_max = TXGBE_RING_DESC_MAX,
+	.nb_min = TXGBE_RING_DESC_MIN,
+	.nb_align = TXGBE_RXD_ALIGN,
+};
+
+static const struct rte_eth_desc_lim tx_desc_lim = {
+	.nb_max = TXGBE_RING_DESC_MAX,
+	.nb_min = TXGBE_RING_DESC_MIN,
+	.nb_align = TXGBE_TXD_ALIGN,
+	.nb_seg_max = TXGBE_TX_MAX_SEG,
+	.nb_mtu_seg_max = TXGBE_TX_MAX_SEG,
+};
+
 static const struct eth_dev_ops txgbevf_eth_dev_ops;
 
 /*
@@ -246,6 +262,57 @@ static struct rte_pci_driver rte_txgbevf_pmd = {
 	.remove = eth_txgbevf_pci_remove,
 };
 
+static int
+txgbevf_dev_info_get(struct rte_eth_dev *dev,
+		     struct rte_eth_dev_info *dev_info)
+{
+	struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
+	struct txgbe_hw *hw = TXGBE_DEV_HW(dev);
+
+	dev_info->max_rx_queues = (uint16_t)hw->mac.max_rx_queues;
+	dev_info->max_tx_queues = (uint16_t)hw->mac.max_tx_queues;
+	dev_info->min_rx_bufsize = 1024;
+	dev_info->max_rx_pktlen = TXGBE_FRAME_SIZE_MAX;
+	dev_info->max_mac_addrs = hw->mac.num_rar_entries;
+	dev_info->max_hash_mac_addrs = TXGBE_VMDQ_NUM_UC_MAC;
+	dev_info->max_vfs = pci_dev->max_vfs;
+	dev_info->max_vmdq_pools = ETH_64_POOLS;
+	dev_info->rx_queue_offload_capa = txgbe_get_rx_queue_offloads(dev);
+	dev_info->rx_offload_capa = (txgbe_get_rx_port_offloads(dev) |
+				     dev_info->rx_queue_offload_capa);
+	dev_info->tx_queue_offload_capa = txgbe_get_tx_queue_offloads(dev);
+	dev_info->tx_offload_capa = txgbe_get_tx_port_offloads(dev);
+	dev_info->hash_key_size = TXGBE_HKEY_MAX_INDEX * sizeof(uint32_t);
+	dev_info->reta_size = ETH_RSS_RETA_SIZE_128;
+	dev_info->flow_type_rss_offloads = TXGBE_RSS_OFFLOAD_ALL;
+
+	dev_info->default_rxconf = (struct rte_eth_rxconf) {
+		.rx_thresh = {
+			.pthresh = TXGBE_DEFAULT_RX_PTHRESH,
+			.hthresh = TXGBE_DEFAULT_RX_HTHRESH,
+			.wthresh = TXGBE_DEFAULT_RX_WTHRESH,
+		},
+		.rx_free_thresh = TXGBE_DEFAULT_RX_FREE_THRESH,
+		.rx_drop_en = 0,
+		.offloads = 0,
+	};
+
+	dev_info->default_txconf = (struct rte_eth_txconf) {
+		.tx_thresh = {
+			.pthresh = TXGBE_DEFAULT_TX_PTHRESH,
+			.hthresh = TXGBE_DEFAULT_TX_HTHRESH,
+			.wthresh = TXGBE_DEFAULT_TX_WTHRESH,
+		},
+		.tx_free_thresh = TXGBE_DEFAULT_TX_FREE_THRESH,
+		.offloads = 0,
+	};
+
+	dev_info->rx_desc_lim = rx_desc_lim;
+	dev_info->tx_desc_lim = tx_desc_lim;
+
+	return 0;
+}
+
 /*
  * Virtual Function operations
  */
@@ -406,8 +473,11 @@ txgbevf_set_default_mac_addr(struct rte_eth_dev *dev,
  * operation have been implemented
  */
 static const struct eth_dev_ops txgbevf_eth_dev_ops = {
+	.dev_infos_get        = txgbevf_dev_info_get,
 	.mac_addr_add         = txgbevf_add_mac_addr,
 	.mac_addr_remove      = txgbevf_remove_mac_addr,
+	.rxq_info_get         = txgbe_rxq_info_get,
+	.txq_info_get         = txgbe_txq_info_get,
 	.mac_addr_set         = txgbevf_set_default_mac_addr,
 };
 
-- 
2.27.0




  parent reply	other threads:[~2021-02-25  8:09 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-25  8:08 [dpdk-dev] [PATCH v3 00/17] net/txgbe: add VF driver support Jiawen Wu
2021-02-25  8:08 ` [dpdk-dev] [PATCH v3 01/17] net/txgbe: add ethdev probe and remove for VF device Jiawen Wu
2021-02-25  8:08 ` [dpdk-dev] [PATCH v3 02/17] net/txgbe: add base code for VF driver Jiawen Wu
2021-02-25  8:08 ` [dpdk-dev] [PATCH v3 03/17] net/txgbe: support add and remove VF device MAC address Jiawen Wu
2021-02-25  8:08 ` Jiawen Wu [this message]
2021-02-25  8:08 ` [dpdk-dev] [PATCH v3 05/17] net/txgbe: add interrupt operation for VF device Jiawen Wu
2021-02-25  8:08 ` [dpdk-dev] [PATCH v3 06/17] net/txgbe: get link status of " Jiawen Wu
2021-02-25  8:08 ` [dpdk-dev] [PATCH v3 07/17] net/txgbe: add Rx and Tx unit init for " Jiawen Wu
2021-02-25  8:08 ` [dpdk-dev] [PATCH v3 08/17] net/txgbe: add VF device stats and xstats get operation Jiawen Wu
2021-02-25  8:08 ` [dpdk-dev] [PATCH v3 09/17] net/txgbe: add VLAN handle support to VF driver Jiawen Wu
2021-02-25  8:08 ` [dpdk-dev] [PATCH v3 10/17] net/txgbe: add RSS support for VF device Jiawen Wu
2021-02-25  8:08 ` [dpdk-dev] [PATCH v3 11/17] net/txgbe: add VF device promiscuous and allmulticast mode Jiawen Wu
2021-02-25  8:08 ` [dpdk-dev] [PATCH v3 12/17] net/txgbe: support multicast MAC filter for VF driver Jiawen Wu
2021-02-25  8:08 ` [dpdk-dev] [PATCH v3 13/17] net/txgbe: support to update MTU on VF device Jiawen Wu
2021-02-25  8:08 ` [dpdk-dev] [PATCH v3 14/17] net/txgbe: support register dump " Jiawen Wu
2021-02-25  8:08 ` [dpdk-dev] [PATCH v3 15/17] net/txgbe: start and stop " Jiawen Wu
2021-02-25  8:09 ` [dpdk-dev] [PATCH v3 16/17] net/txgbe: add some supports as PF driver implemented Jiawen Wu
2021-02-25  8:09 ` [dpdk-dev] [PATCH v3 17/17] doc: update release note for txgbe Jiawen Wu
2021-02-26 13:27 ` [dpdk-dev] [PATCH v3 00/17] net/txgbe: add VF driver support Ferruh Yigit

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=20210225080901.3645291-5-jiawenwu@trustnetic.com \
    --to=jiawenwu@trustnetic.com \
    --cc=dev@dpdk.org \
    /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).