From: Jiawen Wu <jiawenwu@trustnetic.com>
To: dev@dpdk.org
Cc: Jiawen Wu <jiawenwu@trustnetic.com>
Subject: [dpdk-dev] [PATCH v2 04/17] net/txgbe: get VF device information
Date: Fri, 5 Feb 2021 11:34:36 +0800 [thread overview]
Message-ID: <20210205033449.3813939-5-jiawenwu@trustnetic.com> (raw)
In-Reply-To: <20210205033449.3813939-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 5035c5eea..777ba9183 100644
--- a/doc/guides/nics/features/txgbe_vf.ini
+++ b/doc/guides/nics/features/txgbe_vf.ini
@@ -4,6 +4,13 @@
; Refer to default.ini for the full list of available PMD features.
;
[Features]
+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 f9b30b116..1db944c7b 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
*/
@@ -408,8 +475,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
next prev parent reply other threads:[~2021-02-05 3:34 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-05 3:34 [dpdk-dev] [PATCH v2 00/17] net/txgbe: add VF driver support Jiawen Wu
2021-02-05 3:34 ` [dpdk-dev] [PATCH v2 01/17] net/txgbe: add ethdev probe and remove for VF device Jiawen Wu
2021-02-24 11:39 ` Ferruh Yigit
2021-02-05 3:34 ` [dpdk-dev] [PATCH v2 02/17] net/txgbe: add base code for VF driver Jiawen Wu
2021-02-05 3:34 ` [dpdk-dev] [PATCH v2 03/17] net/txgbe: support add and remove VF device MAC address Jiawen Wu
2021-02-24 11:40 ` Ferruh Yigit
2021-02-05 3:34 ` Jiawen Wu [this message]
2021-02-05 3:34 ` [dpdk-dev] [PATCH v2 05/17] net/txgbe: add interrupt operation for VF device Jiawen Wu
2021-02-05 3:34 ` [dpdk-dev] [PATCH v2 06/17] net/txgbe: get link status of " Jiawen Wu
2021-02-24 11:40 ` Ferruh Yigit
2021-02-05 3:34 ` [dpdk-dev] [PATCH v2 07/17] net/txgbe: add Rx and Tx unit init for " Jiawen Wu
2021-02-05 3:34 ` [dpdk-dev] [PATCH v2 08/17] net/txgbe: add VF device stats and xstats get operation Jiawen Wu
2021-02-05 3:34 ` [dpdk-dev] [PATCH v2 09/17] net/txgbe: add VLAN handle support to VF driver Jiawen Wu
2021-02-05 3:34 ` [dpdk-dev] [PATCH v2 10/17] net/txgbe: add RSS support for VF device Jiawen Wu
2021-02-05 3:34 ` [dpdk-dev] [PATCH v2 11/17] net/txgbe: add VF device promiscuous and allmulticast mode Jiawen Wu
2021-02-05 3:34 ` [dpdk-dev] [PATCH v2 12/17] net/txgbe: support multicast MAC filter for VF driver Jiawen Wu
2021-02-05 3:34 ` [dpdk-dev] [PATCH v2 13/17] net/txgbe: support to update MTU on VF device Jiawen Wu
2021-02-05 3:34 ` [dpdk-dev] [PATCH v2 14/17] net/txgbe: support register dump " Jiawen Wu
2021-02-05 3:34 ` [dpdk-dev] [PATCH v2 15/17] net/txgbe: start and stop " Jiawen Wu
2021-02-05 3:34 ` [dpdk-dev] [PATCH v2 16/17] net/txgbe: add some supports as PF driver implemented Jiawen Wu
2021-02-05 3:34 ` [dpdk-dev] [PATCH v2 17/17] doc: update release note for txgbe Jiawen Wu
2021-02-24 11:41 ` 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=20210205033449.3813939-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).