* [PATCH 0/8] vmxnet3 version V5 and V6
@ 2022-05-03 4:22 Pankaj Gupta
2022-05-03 4:22 ` [PATCH 1/8] vmxnet3: Added V5 support Pankaj Gupta
` (10 more replies)
0 siblings, 11 replies; 38+ messages in thread
From: Pankaj Gupta @ 2022-05-03 4:22 UTC (permalink / raw)
To: jbehrens, yongwang; +Cc: dev, pagupta
Pankaj Gupta (8):
vmxnet3: Added V5 support
vmxnet3: implement reta query and reta update
vmxnet3: add rx queue usage count utility
vmxnet3: add get hw version api
vmxnet3, version 6
vmxnet3: set reta size
vmxnet3: Set packet for fragmented packet
vmxnet3: Fix merge error in initialization for rxDataRing feature
drivers/net/vmxnet3/base/vmxnet3_defs.h | 135 ++++++----
drivers/net/vmxnet3/vmxnet3_ethdev.c | 329 +++++++++++++++++++-----
drivers/net/vmxnet3/vmxnet3_ethdev.h | 15 +-
drivers/net/vmxnet3/vmxnet3_rxtx.c | 49 +++-
4 files changed, 416 insertions(+), 112 deletions(-)
--
2.17.1
^ permalink raw reply [flat|nested] 38+ messages in thread
* [PATCH 1/8] vmxnet3: Added V5 support
2022-05-03 4:22 [PATCH 0/8] vmxnet3 version V5 and V6 Pankaj Gupta
@ 2022-05-03 4:22 ` Pankaj Gupta
2022-05-03 4:22 ` [PATCH 2/8] vmxnet3: implement reta query and reta update Pankaj Gupta
` (9 subsequent siblings)
10 siblings, 0 replies; 38+ messages in thread
From: Pankaj Gupta @ 2022-05-03 4:22 UTC (permalink / raw)
To: jbehrens, yongwang; +Cc: dev, pagupta
Add VMXNET3 v5 support
Tested, using testpmd, for different hardware version on ESXi 7.0 Update 2.
Signed-off-by: Pankaj Gupta <pagupta@vmware.com>
---
drivers/net/vmxnet3/vmxnet3_ethdev.c | 7 +++++--
drivers/net/vmxnet3/vmxnet3_ethdev.h | 2 ++
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
index d1ef1cad08..a7e1e5fef5 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -316,9 +316,12 @@ eth_vmxnet3_dev_init(struct rte_eth_dev *eth_dev)
/* Check h/w version compatibility with driver. */
ver = VMXNET3_READ_BAR1_REG(hw, VMXNET3_REG_VRRS);
- PMD_INIT_LOG(DEBUG, "Hardware version : %d", ver);
- if (ver & (1 << VMXNET3_REV_4)) {
+ if (ver & (1 << VMXNET3_REV_5)) {
+ VMXNET3_WRITE_BAR1_REG(hw, VMXNET3_REG_VRRS,
+ 1 << VMXNET3_REV_5);
+ hw->version = VMXNET3_REV_5 + 1;
+ } else if (ver & (1 << VMXNET3_REV_4)) {
VMXNET3_WRITE_BAR1_REG(hw, VMXNET3_REG_VRRS,
1 << VMXNET3_REV_4);
hw->version = VMXNET3_REV_4 + 1;
diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.h b/drivers/net/vmxnet3/vmxnet3_ethdev.h
index ef858ac951..7ec3b2e1f0 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.h
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.h
@@ -124,11 +124,13 @@ struct vmxnet3_hw {
UPT1_RxStats snapshot_rx_stats[VMXNET3_MAX_RX_QUEUES];
};
+#define VMXNET3_REV_5 4 /* Vmxnet3 Rev. 5 */
#define VMXNET3_REV_4 3 /* Vmxnet3 Rev. 4 */
#define VMXNET3_REV_3 2 /* Vmxnet3 Rev. 3 */
#define VMXNET3_REV_2 1 /* Vmxnet3 Rev. 2 */
#define VMXNET3_REV_1 0 /* Vmxnet3 Rev. 1 */
+#define VMXNET3_VERSION_GE_5(hw) ((hw)->version >= VMXNET3_REV_5 + 1)
#define VMXNET3_VERSION_GE_4(hw) ((hw)->version >= VMXNET3_REV_4 + 1)
#define VMXNET3_VERSION_GE_3(hw) ((hw)->version >= VMXNET3_REV_3 + 1)
#define VMXNET3_VERSION_GE_2(hw) ((hw)->version >= VMXNET3_REV_2 + 1)
--
2.17.1
^ permalink raw reply [flat|nested] 38+ messages in thread
* [PATCH 2/8] vmxnet3: implement reta query and reta update
2022-05-03 4:22 [PATCH 0/8] vmxnet3 version V5 and V6 Pankaj Gupta
2022-05-03 4:22 ` [PATCH 1/8] vmxnet3: Added V5 support Pankaj Gupta
@ 2022-05-03 4:22 ` Pankaj Gupta
2022-05-04 14:23 ` Andrew Rybchenko
2022-05-03 4:22 ` [PATCH 3/8] vmxnet3: add rx queue usage count utility Pankaj Gupta
` (8 subsequent siblings)
10 siblings, 1 reply; 38+ messages in thread
From: Pankaj Gupta @ 2022-05-03 4:22 UTC (permalink / raw)
To: jbehrens, yongwang; +Cc: dev, pagupta
Added reta query and reta update support for VMXNET3
Tested, using testpmd, for different hardware version on ESXi 7.0 Update 2.
Signed-off-by: Pankaj Gupta <pagupta@vmware.com>
---
drivers/net/vmxnet3/vmxnet3_ethdev.c | 67 ++++++++++++++++++++++++++++
1 file changed, 67 insertions(+)
diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
index a7e1e5fef5..eb65499cf2 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 & (1ULL << 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 & (1ULL << shift))
+ reta_conf[idx].reta[shift] = dev_rss_conf->indTable[i];
+ }
+
+ return 0;
+}
--
2.17.1
^ permalink raw reply [flat|nested] 38+ messages in thread
* [PATCH 3/8] vmxnet3: add rx queue usage count utility
2022-05-03 4:22 [PATCH 0/8] vmxnet3 version V5 and V6 Pankaj Gupta
2022-05-03 4:22 ` [PATCH 1/8] vmxnet3: Added V5 support Pankaj Gupta
2022-05-03 4:22 ` [PATCH 2/8] vmxnet3: implement reta query and reta update Pankaj Gupta
@ 2022-05-03 4:22 ` Pankaj Gupta
2022-05-04 14:27 ` Andrew Rybchenko
2022-05-03 4:22 ` [PATCH 4/8] vmxnet3: add get hw version api Pankaj Gupta
` (7 subsequent siblings)
10 siblings, 1 reply; 38+ messages in thread
From: Pankaj Gupta @ 2022-05-03 4:22 UTC (permalink / raw)
To: jbehrens, yongwang; +Cc: dev, pagupta
Count the number of entries in the rx queue for debugging.
Tested, using testpmd, for different hardware version on ESXi 7.0 Update 2
Signed-off-by: Pankaj Gupta <pagupta@vmware.com>
---
drivers/net/vmxnet3/vmxnet3_ethdev.c | 1 +
drivers/net/vmxnet3/vmxnet3_ethdev.h | 3 +++
drivers/net/vmxnet3/vmxnet3_rxtx.c | 30 ++++++++++++++++++++++++++++
3 files changed, 34 insertions(+)
diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
index eb65499cf2..a76796716b 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -294,6 +294,7 @@ eth_vmxnet3_dev_init(struct rte_eth_dev *eth_dev)
eth_dev->rx_pkt_burst = &vmxnet3_recv_pkts;
eth_dev->tx_pkt_burst = &vmxnet3_xmit_pkts;
eth_dev->tx_pkt_prepare = vmxnet3_prep_pkts;
+ eth_dev->rx_queue_count = vmxnet3_dev_rx_queue_count,
pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
/* extra mbuf field is required to guess MSS */
diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.h b/drivers/net/vmxnet3/vmxnet3_ethdev.h
index 7ec3b2e1f0..ceaeb66392 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.h
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.h
@@ -193,6 +193,9 @@ int vmxnet3_dev_rx_queue_setup(struct rte_eth_dev *dev, uint16_t rx_queue_id,
uint16_t nb_rx_desc, unsigned int socket_id,
const struct rte_eth_rxconf *rx_conf,
struct rte_mempool *mb_pool);
+
+uint32_t vmxnet3_dev_rx_queue_count(void *rx_queue);
+
int vmxnet3_dev_tx_queue_setup(struct rte_eth_dev *dev, uint16_t tx_queue_id,
uint16_t nb_tx_desc, unsigned int socket_id,
const struct rte_eth_txconf *tx_conf);
diff --git a/drivers/net/vmxnet3/vmxnet3_rxtx.c b/drivers/net/vmxnet3/vmxnet3_rxtx.c
index d745064bc4..e15b377d8c 100644
--- a/drivers/net/vmxnet3/vmxnet3_rxtx.c
+++ b/drivers/net/vmxnet3/vmxnet3_rxtx.c
@@ -1019,6 +1019,36 @@ vmxnet3_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
return nb_rx;
}
+uint32_t
+vmxnet3_dev_rx_queue_count(void *rx_queue)
+{
+ const vmxnet3_rx_queue_t *rxq;
+ const Vmxnet3_RxCompDesc *rcd;
+ uint32_t idx, nb_rxd = 0;
+ uint8_t gen;
+
+ rxq = rx_queue;
+ if (unlikely(rxq->stopped)) {
+ PMD_RX_LOG(DEBUG, "Rx queue is stopped.");
+ return 0;
+ }
+
+ gen = rxq->comp_ring.gen;
+ idx = rxq->comp_ring.next2proc;
+ rcd = &rxq->comp_ring.base[idx].rcd;
+ while (rcd->gen == gen) {
+ if (rcd->eop)
+ ++nb_rxd;
+ if (++idx == rxq->comp_ring.size) {
+ idx = 0;
+ gen ^= 1;
+ }
+ rcd = &rxq->comp_ring.base[idx].rcd;
+ }
+
+ return nb_rxd;
+}
+
int
vmxnet3_dev_tx_queue_setup(struct rte_eth_dev *dev,
uint16_t queue_idx,
--
2.17.1
^ permalink raw reply [flat|nested] 38+ messages in thread
* [PATCH 4/8] vmxnet3: add get hw version api
2022-05-03 4:22 [PATCH 0/8] vmxnet3 version V5 and V6 Pankaj Gupta
` (2 preceding siblings ...)
2022-05-03 4:22 ` [PATCH 3/8] vmxnet3: add rx queue usage count utility Pankaj Gupta
@ 2022-05-03 4:22 ` Pankaj Gupta
2022-05-04 14:35 ` Andrew Rybchenko
2022-05-03 4:22 ` [PATCH 5/8] vmxnet3, version 6 Pankaj Gupta
` (6 subsequent siblings)
10 siblings, 1 reply; 38+ messages in thread
From: Pankaj Gupta @ 2022-05-03 4:22 UTC (permalink / raw)
To: jbehrens, yongwang; +Cc: dev, pagupta
Implement fw_version_get API for vmxnet3
Tested, using testpmd, for different hardware version on
ESXi 7.0 Update 2.
Signed-off-by: Pankaj Gupta <pagupta@vmware.com>
---
drivers/net/vmxnet3/vmxnet3_ethdev.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
index a76796716b..f77399f145 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -103,6 +103,10 @@ 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_hw_ver_get(struct rte_eth_dev *dev,
+ char *fw_version, size_t fw_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,
@@ -147,6 +151,7 @@ static const struct eth_dev_ops vmxnet3_eth_dev_ops = {
.rx_queue_intr_disable = vmxnet3_dev_rx_queue_intr_disable,
.reta_update = vmxnet3_rss_reta_update,
.reta_query = vmxnet3_rss_reta_query,
+ .fw_version_get = vmxnet3_hw_ver_get,
};
struct vmxnet3_xstats_name_off {
@@ -1764,3 +1769,19 @@ vmxnet3_rss_reta_query(struct rte_eth_dev *dev,
return 0;
}
+
+static int
+vmxnet3_hw_ver_get(struct rte_eth_dev *dev,
+ char *fw_version, size_t fw_size)
+{
+ int ret;
+ struct vmxnet3_hw *hw = dev->data->dev_private;
+
+ ret = snprintf(fw_version, fw_size, "v%d", hw->version);
+
+ ret += 1; /* add the size of '\0' */
+ if (fw_size < (uint32_t)ret)
+ return ret;
+ else
+ return 0;
+}
--
2.17.1
^ permalink raw reply [flat|nested] 38+ messages in thread
* [PATCH 5/8] vmxnet3, version 6
2022-05-03 4:22 [PATCH 0/8] vmxnet3 version V5 and V6 Pankaj Gupta
` (3 preceding siblings ...)
2022-05-03 4:22 ` [PATCH 4/8] vmxnet3: add get hw version api Pankaj Gupta
@ 2022-05-03 4:22 ` Pankaj Gupta
2022-05-04 14:46 ` Andrew Rybchenko
2022-05-03 4:22 ` [PATCH 6/8] vmxnet3: set reta size Pankaj Gupta
` (5 subsequent siblings)
10 siblings, 1 reply; 38+ messages in thread
From: Pankaj Gupta @ 2022-05-03 4:22 UTC (permalink / raw)
To: jbehrens, yongwang; +Cc: dev, pagupta
vmxnet3 version 6 supports some new features, including but
not limited to:
- Increased max MTU up to 9190
- Increased max number of queues, both for RX and TX
- Removes power-of-two limitations
- Extended interrupt structures, required implementation for
additional number of queues
Tested, using testpmd, for different hardware version on
ESXi 7.0 Update 2.
Signed-off-by: Pankaj Gupta <pagupta@vmware.com>
---
drivers/net/vmxnet3/base/vmxnet3_defs.h | 135 +++++++++-----
drivers/net/vmxnet3/vmxnet3_ethdev.c | 223 +++++++++++++++++-------
drivers/net/vmxnet3/vmxnet3_ethdev.h | 10 +-
drivers/net/vmxnet3/vmxnet3_rxtx.c | 2 +-
4 files changed, 260 insertions(+), 110 deletions(-)
diff --git a/drivers/net/vmxnet3/base/vmxnet3_defs.h b/drivers/net/vmxnet3/base/vmxnet3_defs.h
index 8d62b3e116..ceac5d64db 100644
--- a/drivers/net/vmxnet3/base/vmxnet3_defs.h
+++ b/drivers/net/vmxnet3/base/vmxnet3_defs.h
@@ -72,38 +72,42 @@
#endif
typedef enum {
- VMXNET3_CMD_FIRST_SET = 0xCAFE0000,
- VMXNET3_CMD_ACTIVATE_DEV = VMXNET3_CMD_FIRST_SET,
- VMXNET3_CMD_QUIESCE_DEV,
- VMXNET3_CMD_RESET_DEV,
- VMXNET3_CMD_UPDATE_RX_MODE,
- VMXNET3_CMD_UPDATE_MAC_FILTERS,
- VMXNET3_CMD_UPDATE_VLAN_FILTERS,
- VMXNET3_CMD_UPDATE_RSSIDT,
- VMXNET3_CMD_UPDATE_IML,
- VMXNET3_CMD_UPDATE_PMCFG,
- VMXNET3_CMD_UPDATE_FEATURE,
- VMXNET3_CMD_STOP_EMULATION,
- VMXNET3_CMD_LOAD_PLUGIN,
- VMXNET3_CMD_ACTIVATE_VF,
- VMXNET3_CMD_RESERVED3,
- VMXNET3_CMD_RESERVED4,
- VMXNET3_CMD_REGISTER_MEMREGS,
- VMXNET3_CMD_SET_RSS_FIELDS,
-
- VMXNET3_CMD_FIRST_GET = 0xF00D0000,
- VMXNET3_CMD_GET_QUEUE_STATUS = VMXNET3_CMD_FIRST_GET,
- VMXNET3_CMD_GET_STATS,
- VMXNET3_CMD_GET_LINK,
- VMXNET3_CMD_GET_PERM_MAC_LO,
- VMXNET3_CMD_GET_PERM_MAC_HI,
- VMXNET3_CMD_GET_DID_LO,
- VMXNET3_CMD_GET_DID_HI,
- VMXNET3_CMD_GET_DEV_EXTRA_INFO,
- VMXNET3_CMD_GET_CONF_INTR,
- VMXNET3_CMD_GET_ADAPTIVE_RING_INFO,
- VMXNET3_CMD_GET_TXDATA_DESC_SIZE,
- VMXNET3_CMD_RESERVED5,
+ VMXNET3_CMD_FIRST_SET = 0xCAFE0000,
+ VMXNET3_CMD_ACTIVATE_DEV = VMXNET3_CMD_FIRST_SET,
+ VMXNET3_CMD_QUIESCE_DEV,
+ VMXNET3_CMD_RESET_DEV,
+ VMXNET3_CMD_UPDATE_RX_MODE,
+ VMXNET3_CMD_UPDATE_MAC_FILTERS,
+ VMXNET3_CMD_UPDATE_VLAN_FILTERS,
+ VMXNET3_CMD_UPDATE_RSSIDT,
+ VMXNET3_CMD_UPDATE_IML,
+ VMXNET3_CMD_UPDATE_PMCFG,
+ VMXNET3_CMD_UPDATE_FEATURE,
+ VMXNET3_CMD_STOP_EMULATION,
+ VMXNET3_CMD_LOAD_PLUGIN,
+ VMXNET3_CMD_ACTIVATE_VF,
+ VMXNET3_CMD_RESERVED3,
+ VMXNET3_CMD_RESERVED4,
+ VMXNET3_CMD_REGISTER_MEMREGS,
+ VMXNET3_CMD_SET_RSS_FIELDS,
+
+ VMXNET3_CMD_FIRST_GET = 0xF00D0000,
+ VMXNET3_CMD_GET_QUEUE_STATUS = VMXNET3_CMD_FIRST_GET,
+ VMXNET3_CMD_GET_STATS,
+ VMXNET3_CMD_GET_LINK,
+ VMXNET3_CMD_GET_PERM_MAC_LO,
+ VMXNET3_CMD_GET_PERM_MAC_HI,
+ VMXNET3_CMD_GET_DID_LO,
+ VMXNET3_CMD_GET_DID_HI,
+ VMXNET3_CMD_GET_DEV_EXTRA_INFO,
+ VMXNET3_CMD_GET_CONF_INTR,
+ VMXNET3_CMD_GET_ADAPTIVE_RING_INFO,
+ VMXNET3_CMD_GET_TXDATA_DESC_SIZE,
+ VMXNET3_CMD_RESERVED5,
+ VMXNET3_CMD_RESERVED6,
+ VMXNET3_CMD_RESERVED7,
+ VMXNET3_CMD_RESERVED8,
+ VMXNET3_CMD_GET_MAX_QUEUES_CONF,
} Vmxnet3_Cmd;
/* Adaptive Ring Info Flags */
@@ -571,6 +575,24 @@ enum vmxnet3_intr_type {
/* addition 1 for events */
#define VMXNET3_MAX_INTRS 25
+/* Version 6 and later will use below macros */
+#define VMXNET3_EXT_MAX_TX_QUEUES 32
+#define VMXNET3_EXT_MAX_RX_QUEUES 32
+
+/* Version-dependent MAX RX/TX queues macro */
+#define MAX_RX_QUEUES \
+ (VMXNET3_VERSION_GE_6(hw) ? \
+ VMXNET3_EXT_MAX_RX_QUEUES : \
+ VMXNET3_MAX_RX_QUEUES)
+#define MAX_TX_QUEUES \
+ (VMXNET3_VERSION_GE_6(hw) ? \
+ VMXNET3_EXT_MAX_TX_QUEUES : \
+ VMXNET3_MAX_TX_QUEUES)
+
+/* addition 1 for events */
+#define VMXNET3_EXT_MAX_INTRS 65
+#define VMXNET3_FIRST_SET_INTRS 64
+
/* value of intrCtrl */
#define VMXNET3_IC_DISABLE_ALL 0x1 /* bit 0 */
@@ -587,6 +609,21 @@ struct Vmxnet3_IntrConf {
#include "vmware_pack_end.h"
Vmxnet3_IntrConf;
+typedef
+#include "vmware_pack_begin.h"
+struct Vmxnet3_IntrConfExt {
+ uint8 autoMask;
+ uint8 numIntrs; /* # of interrupts */
+ uint8 eventIntrIdx;
+ uint8 reserved;
+ __le32 intrCtrl;
+ __le32 reserved1;
+ uint8 modLevels[VMXNET3_EXT_MAX_INTRS]; /* moderation level for each intr */
+ uint8 reserved2[3];
+}
+#include "vmware_pack_end.h"
+Vmxnet3_IntrConfExt;
+
/* one bit per VLAN ID, the size is in the units of uint32 */
#define VMXNET3_VFT_SIZE (4096 / (sizeof(uint32) * 8))
@@ -692,6 +729,15 @@ struct Vmxnet3_DSDevRead {
#include "vmware_pack_end.h"
Vmxnet3_DSDevRead;
+typedef
+#include "vmware_pack_begin.h"
+struct Vmxnet3_DSDevReadExt {
+ /* read-only region for device, read by dev in response to a SET cmd */
+ struct Vmxnet3_IntrConfExt intrConfExt;
+}
+#include "vmware_pack_end.h"
+Vmxnet3_DSDevReadExt;
+
typedef
#include "vmware_pack_begin.h"
struct Vmxnet3_TxQueueDesc {
@@ -778,18 +824,18 @@ Vmxnet3_CmdInfo;
typedef
#include "vmware_pack_begin.h"
struct Vmxnet3_DriverShared {
- __le32 magic;
- __le32 pad; /* make devRead start at 64-bit boundaries */
- Vmxnet3_DSDevRead devRead;
- __le32 ecr;
- __le32 reserved;
-
- union {
- __le32 reserved1[4];
- Vmxnet3_CmdInfo cmdInfo; /* only valid in the context of executing the
- * relevant command
- */
- } cu;
+ __le32 magic;
+ __le32 size; /* size of DriverShared */
+ Vmxnet3_DSDevRead devRead;
+ __le32 ecr;
+ __le32 reserved;
+
+ union {
+ __le32 reserved1[4];
+ /* only valid in the context of executing the relevant command */
+ Vmxnet3_CmdInfo cmdInfo;
+ } cu;
+ struct Vmxnet3_DSDevReadExt devReadExt;
}
#include "vmware_pack_end.h"
Vmxnet3_DriverShared;
@@ -821,6 +867,7 @@ do {\
((vfTable[vid >> 5] & (1 << (vid & 31))) != 0)
#define VMXNET3_MAX_MTU 9000
+#define VMXNET3_V6_MAX_MTU 9190
#define VMXNET3_MIN_MTU 60
#define VMXNET3_LINK_UP (10000 << 16 | 1) // 10 Gbps, up
diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
index f77399f145..f65b3d3113 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -222,24 +222,20 @@ vmxnet3_disable_intr(struct vmxnet3_hw *hw, unsigned int intr_idx)
}
/*
- * Enable all intrs used by the device
+ * Simple helper to get intrCtrl and eventIntrIdx based on config and hw version
*/
static void
-vmxnet3_enable_all_intrs(struct vmxnet3_hw *hw)
+vmxnet3_get_intr_ctrl_ev(struct vmxnet3_hw *hw,
+ uint8 **out_eventIntrIdx,
+ uint32 **out_intrCtrl)
{
- Vmxnet3_DSDevRead *devRead = &hw->shared->devRead;
-
- PMD_INIT_FUNC_TRACE();
- devRead->intrConf.intrCtrl &= rte_cpu_to_le_32(~VMXNET3_IC_DISABLE_ALL);
-
- if (hw->intr.lsc_only) {
- vmxnet3_enable_intr(hw, devRead->intrConf.eventIntrIdx);
+ if (VMXNET3_VERSION_GE_6(hw) && hw->queuesExtEnabled) {
+ *out_eventIntrIdx = &hw->shared->devReadExt.intrConfExt.eventIntrIdx;
+ *out_intrCtrl = &hw->shared->devReadExt.intrConfExt.intrCtrl;
} else {
- int i;
-
- for (i = 0; i < hw->intr.num_intrs; i++)
- vmxnet3_enable_intr(hw, i);
+ *out_eventIntrIdx = &hw->shared->devRead.intrConf.eventIntrIdx;
+ *out_intrCtrl = &hw->shared->devRead.intrConf.intrCtrl;
}
}
@@ -250,15 +246,42 @@ static void
vmxnet3_disable_all_intrs(struct vmxnet3_hw *hw)
{
int i;
+ uint8 *eventIntrIdx;
+ uint32 *intrCtrl;
PMD_INIT_FUNC_TRACE();
+ vmxnet3_get_intr_ctrl_ev(hw, &eventIntrIdx, &intrCtrl);
+
+ *intrCtrl |= rte_cpu_to_le_32(VMXNET3_IC_DISABLE_ALL);
- hw->shared->devRead.intrConf.intrCtrl |=
- rte_cpu_to_le_32(VMXNET3_IC_DISABLE_ALL);
- for (i = 0; i < hw->num_intrs; i++)
+ for (i = 0; i < hw->intr.num_intrs; i++)
vmxnet3_disable_intr(hw, i);
}
+/*
+ * Enable all intrs used by the device
+ */
+static void
+vmxnet3_enable_all_intrs(struct vmxnet3_hw *hw)
+{
+ uint8 *eventIntrIdx;
+ uint32 *intrCtrl;
+
+ PMD_INIT_FUNC_TRACE();
+ vmxnet3_get_intr_ctrl_ev(hw, &eventIntrIdx, &intrCtrl);
+
+ *intrCtrl &= rte_cpu_to_le_32(~VMXNET3_IC_DISABLE_ALL);
+
+ if (hw->intr.lsc_only) {
+ vmxnet3_enable_intr(hw, *eventIntrIdx);
+ } else {
+ int i;
+
+ for (i = 0; i < hw->intr.num_intrs; i++)
+ vmxnet3_enable_intr(hw, i);
+ }
+}
+
/*
* Gets tx data ring descriptor size.
*/
@@ -333,7 +356,11 @@ eth_vmxnet3_dev_init(struct rte_eth_dev *eth_dev)
/* Check h/w version compatibility with driver. */
ver = VMXNET3_READ_BAR1_REG(hw, VMXNET3_REG_VRRS);
- if (ver & (1 << VMXNET3_REV_5)) {
+ if (ver & (1 << VMXNET3_REV_6)) {
+ VMXNET3_WRITE_BAR1_REG(hw, VMXNET3_REG_VRRS,
+ 1 << VMXNET3_REV_6);
+ hw->version = VMXNET3_REV_6 + 1;
+ } else if (ver & (1 << VMXNET3_REV_5)) {
VMXNET3_WRITE_BAR1_REG(hw, VMXNET3_REG_VRRS,
1 << VMXNET3_REV_5);
hw->version = VMXNET3_REV_5 + 1;
@@ -508,15 +535,22 @@ vmxnet3_dev_configure(struct rte_eth_dev *dev)
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->nb_tx_queues > VMXNET3_MAX_TX_QUEUES ||
- dev->data->nb_rx_queues > VMXNET3_MAX_RX_QUEUES) {
- PMD_INIT_LOG(ERR, "ERROR: Number of queues not supported");
- return -EINVAL;
+ if (!VMXNET3_VERSION_GE_6(hw)) {
+ if (!rte_is_power_of_2(dev->data->nb_rx_queues)) {
+ PMD_INIT_LOG(ERR,
+ "ERROR: Number of rx queues not power of 2");
+ return -EINVAL;
+ }
}
- if (!rte_is_power_of_2(dev->data->nb_rx_queues)) {
- PMD_INIT_LOG(ERR, "ERROR: Number of rx queues not power of 2");
- return -EINVAL;
+ /* At this point, the number of queues requested has already
+ * been validated against dev_infos max queues by EAL
+ */
+ if (dev->data->nb_rx_queues > VMXNET3_MAX_RX_QUEUES ||
+ dev->data->nb_tx_queues > VMXNET3_MAX_TX_QUEUES) {
+ hw->queuesExtEnabled = 1;
+ } else {
+ hw->queuesExtEnabled = 0;
}
size = dev->data->nb_rx_queues * sizeof(struct Vmxnet3_TxQueueDesc) +
@@ -627,9 +661,9 @@ vmxnet3_configure_msix(struct rte_eth_dev *dev)
return -1;
intr_vector = dev->data->nb_rx_queues;
- if (intr_vector > VMXNET3_MAX_RX_QUEUES) {
+ if (intr_vector > MAX_RX_QUEUES) {
PMD_INIT_LOG(ERR, "At most %d intr queues supported",
- VMXNET3_MAX_RX_QUEUES);
+ MAX_RX_QUEUES);
return -ENOTSUP;
}
@@ -777,6 +811,7 @@ vmxnet3_setup_driver_shared(struct rte_eth_dev *dev)
uint32_t mtu = dev->data->mtu;
Vmxnet3_DriverShared *shared = hw->shared;
Vmxnet3_DSDevRead *devRead = &shared->devRead;
+ struct Vmxnet3_DSDevReadExt *devReadExt = &shared->devReadExt;
uint64_t rx_offloads = dev->data->dev_conf.rxmode.offloads;
uint32_t i;
int ret;
@@ -853,13 +888,27 @@ vmxnet3_setup_driver_shared(struct rte_eth_dev *dev)
}
/* intr settings */
- devRead->intrConf.autoMask = hw->intr.mask_mode == VMXNET3_IMM_AUTO;
- devRead->intrConf.numIntrs = hw->intr.num_intrs;
- for (i = 0; i < hw->intr.num_intrs; i++)
- devRead->intrConf.modLevels[i] = hw->intr.mod_levels[i];
+ if (VMXNET3_VERSION_GE_6(hw) && hw->queuesExtEnabled) {
+ devReadExt->intrConfExt.autoMask = hw->intr.mask_mode ==
+ VMXNET3_IMM_AUTO;
+ devReadExt->intrConfExt.numIntrs = hw->intr.num_intrs;
+ for (i = 0; i < hw->intr.num_intrs; i++)
+ devReadExt->intrConfExt.modLevels[i] =
+ hw->intr.mod_levels[i];
+
+ devReadExt->intrConfExt.eventIntrIdx = hw->intr.event_intr_idx;
+ devReadExt->intrConfExt.intrCtrl |=
+ rte_cpu_to_le_32(VMXNET3_IC_DISABLE_ALL);
+ } else {
+ devRead->intrConf.autoMask = hw->intr.mask_mode ==
+ VMXNET3_IMM_AUTO;
+ devRead->intrConf.numIntrs = hw->intr.num_intrs;
+ for (i = 0; i < hw->intr.num_intrs; i++)
+ devRead->intrConf.modLevels[i] = hw->intr.mod_levels[i];
- devRead->intrConf.eventIntrIdx = hw->intr.event_intr_idx;
- devRead->intrConf.intrCtrl |= rte_cpu_to_le_32(VMXNET3_IC_DISABLE_ALL);
+ devRead->intrConf.eventIntrIdx = hw->intr.event_intr_idx;
+ devRead->intrConf.intrCtrl |= rte_cpu_to_le_32(VMXNET3_IC_DISABLE_ALL);
+ }
/* RxMode set to 0 of VMXNET3_RXM_xxx */
devRead->rxFilterConf.rxMode = 0;
@@ -937,18 +986,24 @@ vmxnet3_dev_start(struct rte_eth_dev *dev)
return -EINVAL;
}
- /* Setup memory region for rx buffers */
- ret = vmxnet3_dev_setup_memreg(dev);
- if (ret == 0) {
- VMXNET3_WRITE_BAR1_REG(hw, VMXNET3_REG_CMD,
- VMXNET3_CMD_REGISTER_MEMREGS);
- ret = VMXNET3_READ_BAR1_REG(hw, VMXNET3_REG_CMD);
- if (ret != 0)
- PMD_INIT_LOG(DEBUG,
- "Failed in setup memory region cmd\n");
- ret = 0;
+ /* Check memregs restrictions first */
+ if (dev->data->nb_rx_queues <= VMXNET3_MAX_RX_QUEUES &&
+ dev->data->nb_tx_queues <= VMXNET3_MAX_TX_QUEUES) {
+ ret = vmxnet3_dev_setup_memreg(dev);
+ if (ret == 0) {
+ VMXNET3_WRITE_BAR1_REG(hw, VMXNET3_REG_CMD,
+ VMXNET3_CMD_REGISTER_MEMREGS);
+ ret = VMXNET3_READ_BAR1_REG(hw, VMXNET3_REG_CMD);
+ if (ret != 0)
+ PMD_INIT_LOG(DEBUG,
+ "Failed in setup memory region cmd\n");
+ ret = 0;
+ } else {
+ PMD_INIT_LOG(DEBUG, "Failed to setup memory region\n");
+ }
} else {
- PMD_INIT_LOG(DEBUG, "Failed to setup memory region\n");
+ PMD_INIT_LOG(WARNING, "Memregs can't init (rx: %d, tx: %d)",
+ dev->data->nb_rx_queues, dev->data->nb_tx_queues);
}
if (VMXNET3_VERSION_GE_4(hw) &&
@@ -1203,8 +1258,6 @@ vmxnet3_hw_stats_save(struct vmxnet3_hw *hw)
VMXNET3_WRITE_BAR1_REG(hw, VMXNET3_REG_CMD, VMXNET3_CMD_GET_STATS);
- RTE_BUILD_BUG_ON(RTE_ETHDEV_QUEUE_STAT_CNTRS < VMXNET3_MAX_TX_QUEUES);
-
for (i = 0; i < hw->num_tx_queues; i++)
vmxnet3_hw_tx_stats_get(hw, i, &hw->saved_tx_stats[i]);
for (i = 0; i < hw->num_rx_queues; i++)
@@ -1306,7 +1359,6 @@ vmxnet3_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
VMXNET3_WRITE_BAR1_REG(hw, VMXNET3_REG_CMD, VMXNET3_CMD_GET_STATS);
- RTE_BUILD_BUG_ON(RTE_ETHDEV_QUEUE_STAT_CNTRS < VMXNET3_MAX_TX_QUEUES);
for (i = 0; i < hw->num_tx_queues; i++) {
vmxnet3_tx_stats_get(hw, i, &txStats);
@@ -1323,7 +1375,6 @@ vmxnet3_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
stats->oerrors += txStats.pktsTxError + txStats.pktsTxDiscard;
}
- RTE_BUILD_BUG_ON(RTE_ETHDEV_QUEUE_STAT_CNTRS < VMXNET3_MAX_RX_QUEUES);
for (i = 0; i < hw->num_rx_queues; i++) {
vmxnet3_rx_stats_get(hw, i, &rxStats);
@@ -1377,9 +1428,30 @@ vmxnet3_dev_info_get(struct rte_eth_dev *dev,
struct rte_eth_dev_info *dev_info)
{
struct vmxnet3_hw *hw = dev->data->dev_private;
+ int queues = 0;
+
+ if (VMXNET3_VERSION_GE_6(hw)) {
+ VMXNET3_WRITE_BAR1_REG(hw, VMXNET3_REG_CMD,
+ VMXNET3_CMD_GET_MAX_QUEUES_CONF);
+ queues = VMXNET3_READ_BAR1_REG(hw, VMXNET3_REG_CMD);
+
+ if (queues > 0) {
+#ifndef MIN
+#define MIN(x, y) (((x) < (y)) ? (x) : (y))
+#endif
+ dev_info->max_rx_queues =
+ MIN(VMXNET3_EXT_MAX_RX_QUEUES, ((queues >> 8) & 0xff));
+ dev_info->max_tx_queues =
+ MIN(VMXNET3_EXT_MAX_TX_QUEUES, (queues & 0xff));
+ } else {
+ dev_info->max_rx_queues = VMXNET3_MAX_RX_QUEUES;
+ dev_info->max_tx_queues = VMXNET3_MAX_TX_QUEUES;
+ }
+ } else {
+ dev_info->max_rx_queues = VMXNET3_MAX_RX_QUEUES;
+ dev_info->max_tx_queues = VMXNET3_MAX_TX_QUEUES;
+ }
- dev_info->max_rx_queues = VMXNET3_MAX_RX_QUEUES;
- dev_info->max_tx_queues = VMXNET3_MAX_TX_QUEUES;
dev_info->min_rx_bufsize = 1518 + RTE_PKTMBUF_HEADROOM;
dev_info->max_rx_pktlen = 16384; /* includes CRC, cf MAXFRS register */
dev_info->min_mtu = VMXNET3_MIN_MTU;
@@ -1430,24 +1502,50 @@ vmxnet3_dev_supported_ptypes_get(struct rte_eth_dev *dev)
}
static int
-vmxnet3_dev_mtu_set(struct rte_eth_dev *dev, __rte_unused uint16_t mtu)
+vmxnet3_mac_addr_set(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr)
{
- if (dev->data->dev_started) {
- PMD_DRV_LOG(ERR, "Port %d must be stopped to configure MTU",
- dev->data->port_id);
- return -EBUSY;
- }
+ struct vmxnet3_hw *hw = dev->data->dev_private;
+ rte_ether_addr_copy(mac_addr, (struct rte_ether_addr *)(hw->perm_addr));
+ vmxnet3_write_mac(hw, mac_addr->addr_bytes);
return 0;
}
static int
-vmxnet3_mac_addr_set(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr)
+vmxnet3_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
{
struct vmxnet3_hw *hw = dev->data->dev_private;
+ uint32_t frame_size = mtu + RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN + 4;
+
+ if (mtu < VMXNET3_MIN_MTU)
+ return -EINVAL;
+
+ if (VMXNET3_VERSION_GE_6(hw)) {
+ if (mtu > VMXNET3_V6_MAX_MTU)
+ return -EINVAL;
+ } else {
+ if (mtu > VMXNET3_MAX_MTU) {
+ PMD_DRV_LOG(ERR, "MTU %d too large in device version v%d",
+ mtu, hw->version);
+ return -EINVAL;
+ }
+ }
+
+ dev->data->mtu = mtu;
+ /* update max frame size */
+ dev->data->dev_conf.rxmode.mtu = frame_size;
+
+ if (dev->data->dev_started == 0)
+ return 0;
+
+ /* changing mtu for vmxnet3 pmd does not require a restart
+ * as it does not need to repopulate the rx rings to support
+ * different mtu size. We stop and restart the device here
+ * just to pass the mtu info to the backend.
+ */
+ vmxnet3_dev_stop(dev);
+ vmxnet3_dev_start(dev);
- rte_ether_addr_copy(mac_addr, (struct rte_ether_addr *)(hw->perm_addr));
- vmxnet3_write_mac(hw, mac_addr->addr_bytes);
return 0;
}
@@ -1668,11 +1766,14 @@ vmxnet3_interrupt_handler(void *param)
{
struct rte_eth_dev *dev = param;
struct vmxnet3_hw *hw = dev->data->dev_private;
- Vmxnet3_DSDevRead *devRead = &hw->shared->devRead;
uint32_t events;
+ uint8 *eventIntrIdx;
+ uint32 *intrCtrl;
PMD_INIT_FUNC_TRACE();
- vmxnet3_disable_intr(hw, devRead->intrConf.eventIntrIdx);
+
+ vmxnet3_get_intr_ctrl_ev(hw, &eventIntrIdx, &intrCtrl);
+ vmxnet3_disable_intr(hw, *eventIntrIdx);
events = VMXNET3_READ_BAR1_REG(hw, VMXNET3_REG_ECR);
if (events == 0)
@@ -1681,7 +1782,7 @@ vmxnet3_interrupt_handler(void *param)
RTE_LOG(DEBUG, PMD, "Reading events: 0x%X", events);
vmxnet3_process_events(dev);
done:
- vmxnet3_enable_intr(hw, devRead->intrConf.eventIntrIdx);
+ vmxnet3_enable_intr(hw, *eventIntrIdx);
}
static int
diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.h b/drivers/net/vmxnet3/vmxnet3_ethdev.h
index ceaeb66392..5a303717b1 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.h
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.h
@@ -70,7 +70,7 @@ struct vmxnet3_intr {
enum vmxnet3_intr_type type; /* MSI-X, MSI, or INTx? */
uint8_t num_intrs; /* # of intr vectors */
uint8_t event_intr_idx; /* idx of the intr vector for event */
- uint8_t mod_levels[VMXNET3_MAX_MSIX_VECT]; /* moderation level */
+ uint8_t mod_levels[VMXNET3_EXT_MAX_INTRS]; /* moderation level */
bool lsc_only; /* no Rx queue interrupt */
};
@@ -108,6 +108,7 @@ struct vmxnet3_hw {
uint64_t queueDescPA;
uint16_t queue_desc_len;
uint16_t mtu;
+ bool queuesExtEnabled;
VMXNET3_RSSConf *rss_conf;
uint64_t rss_confPA;
@@ -117,19 +118,20 @@ struct vmxnet3_hw {
Vmxnet3_MemRegs *memRegs;
uint64_t memRegsPA;
#define VMXNET3_VFT_TABLE_SIZE (VMXNET3_VFT_SIZE * sizeof(uint32_t))
- UPT1_TxStats saved_tx_stats[VMXNET3_MAX_TX_QUEUES];
- UPT1_RxStats saved_rx_stats[VMXNET3_MAX_RX_QUEUES];
-
+ UPT1_TxStats saved_tx_stats[VMXNET3_EXT_MAX_TX_QUEUES];
+ UPT1_RxStats saved_rx_stats[VMXNET3_EXT_MAX_RX_QUEUES];
UPT1_TxStats snapshot_tx_stats[VMXNET3_MAX_TX_QUEUES];
UPT1_RxStats snapshot_rx_stats[VMXNET3_MAX_RX_QUEUES];
};
+#define VMXNET3_REV_6 5 /* Vmxnet3 Rev. 6 */
#define VMXNET3_REV_5 4 /* Vmxnet3 Rev. 5 */
#define VMXNET3_REV_4 3 /* Vmxnet3 Rev. 4 */
#define VMXNET3_REV_3 2 /* Vmxnet3 Rev. 3 */
#define VMXNET3_REV_2 1 /* Vmxnet3 Rev. 2 */
#define VMXNET3_REV_1 0 /* Vmxnet3 Rev. 1 */
+#define VMXNET3_VERSION_GE_6(hw) ((hw)->version >= VMXNET3_REV_6 + 1)
#define VMXNET3_VERSION_GE_5(hw) ((hw)->version >= VMXNET3_REV_5 + 1)
#define VMXNET3_VERSION_GE_4(hw) ((hw)->version >= VMXNET3_REV_4 + 1)
#define VMXNET3_VERSION_GE_3(hw) ((hw)->version >= VMXNET3_REV_3 + 1)
diff --git a/drivers/net/vmxnet3/vmxnet3_rxtx.c b/drivers/net/vmxnet3/vmxnet3_rxtx.c
index e15b377d8c..a6665fbf70 100644
--- a/drivers/net/vmxnet3/vmxnet3_rxtx.c
+++ b/drivers/net/vmxnet3/vmxnet3_rxtx.c
@@ -1400,7 +1400,7 @@ vmxnet3_rss_configure(struct rte_eth_dev *dev)
/* loading hashKeySize */
dev_rss_conf->hashKeySize = VMXNET3_RSS_MAX_KEY_SIZE;
/* loading indTableSize: Must not exceed VMXNET3_RSS_MAX_IND_TABLE_SIZE (128)*/
- dev_rss_conf->indTableSize = (uint16_t)(hw->num_rx_queues * 4);
+ dev_rss_conf->indTableSize = (uint16_t)(MAX_RX_QUEUES * 4);
if (port_rss_conf->rss_key == NULL) {
/* Default hash key */
--
2.17.1
^ permalink raw reply [flat|nested] 38+ messages in thread
* [PATCH 6/8] vmxnet3: set reta size
2022-05-03 4:22 [PATCH 0/8] vmxnet3 version V5 and V6 Pankaj Gupta
` (4 preceding siblings ...)
2022-05-03 4:22 ` [PATCH 5/8] vmxnet3, version 6 Pankaj Gupta
@ 2022-05-03 4:22 ` Pankaj Gupta
2022-05-04 15:05 ` Andrew Rybchenko
2022-05-03 4:22 ` [PATCH 7/8] vmxnet3: Set packet for fragmented packet Pankaj Gupta
` (4 subsequent siblings)
10 siblings, 1 reply; 38+ messages in thread
From: Pankaj Gupta @ 2022-05-03 4:22 UTC (permalink / raw)
To: jbehrens, yongwang; +Cc: dev, pagupta
Currently the driver assumes that the size of the reta table is
four times the number of rx queues at multiple places. However,
it sets it to four times the maximum number of queues (4 * 32 = 128)
when it first initializes the device. Change the other uses to use
the stored value, not the assumed default.
Signed-off-by: Pankaj Gupta <pagupta@vmware.com>
---
drivers/net/vmxnet3/vmxnet3_ethdev.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
index f65b3d3113..9955f121f6 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -1483,7 +1483,12 @@ vmxnet3_dev_info_get(struct rte_eth_dev *dev,
dev_info->rx_queue_offload_capa = 0;
dev_info->tx_offload_capa = VMXNET3_TX_OFFLOAD_CAP;
dev_info->tx_queue_offload_capa = 0;
-
+ if (hw->rss_conf) {
+ dev_info->reta_size = hw->rss_conf->indTableSize;
+ } else {
+ /* RSS not configured */
+ dev_info->reta_size = 0;
+ }
return 0;
}
--
2.17.1
^ permalink raw reply [flat|nested] 38+ messages in thread
* [PATCH 7/8] vmxnet3: Set packet for fragmented packet
2022-05-03 4:22 [PATCH 0/8] vmxnet3 version V5 and V6 Pankaj Gupta
` (5 preceding siblings ...)
2022-05-03 4:22 ` [PATCH 6/8] vmxnet3: set reta size Pankaj Gupta
@ 2022-05-03 4:22 ` Pankaj Gupta
2022-05-04 15:07 ` Andrew Rybchenko
2022-05-03 4:22 ` [PATCH 8/8] vmxnet3: Fix merge error in initialization for rxDataRing feature Pankaj Gupta
` (3 subsequent siblings)
10 siblings, 1 reply; 38+ messages in thread
From: Pankaj Gupta @ 2022-05-03 4:22 UTC (permalink / raw)
To: jbehrens, yongwang; +Cc: dev, pagupta
The packet type is set even if it is a fragmented packet
Tested, using testpmd, for different hardware versions on
ESXi 7.0 Update 2.
Signed-off-by: Pankaj Gupta <pagupta@vmware.com>
---
drivers/net/vmxnet3/vmxnet3_rxtx.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/drivers/net/vmxnet3/vmxnet3_rxtx.c b/drivers/net/vmxnet3/vmxnet3_rxtx.c
index a6665fbf70..5e177400c0 100644
--- a/drivers/net/vmxnet3/vmxnet3_rxtx.c
+++ b/drivers/net/vmxnet3/vmxnet3_rxtx.c
@@ -759,6 +759,23 @@ vmxnet3_rx_offload(struct vmxnet3_hw *hw, const Vmxnet3_RxCompDesc *rcd,
/* Check packet type, checksum errors, etc. */
if (rcd->cnc) {
ol_flags |= RTE_MBUF_F_RX_L4_CKSUM_UNKNOWN;
+
+ if (rcd->v4) {
+ packet_type |= RTE_PTYPE_L3_IPV4_EXT_UNKNOWN;
+ if (rcd->tcp)
+ packet_type |= RTE_PTYPE_L4_TCP;
+ else if (rcd->udp)
+ packet_type |= RTE_PTYPE_L4_UDP;
+ } else if (rcd->v6) {
+ packet_type |= RTE_PTYPE_L3_IPV6_EXT_UNKNOWN;
+ if (rcd->tcp)
+ packet_type |= RTE_PTYPE_L4_TCP;
+ else if (rcd->udp)
+ packet_type |= RTE_PTYPE_L4_UDP;
+ } else {
+ packet_type |= RTE_PTYPE_UNKNOWN;
+ }
+
} else {
if (rcd->v4) {
packet_type |= RTE_PTYPE_L3_IPV4_EXT_UNKNOWN;
--
2.17.1
^ permalink raw reply [flat|nested] 38+ messages in thread
* [PATCH 8/8] vmxnet3: Fix merge error in initialization for rxDataRing feature
2022-05-03 4:22 [PATCH 0/8] vmxnet3 version V5 and V6 Pankaj Gupta
` (6 preceding siblings ...)
2022-05-03 4:22 ` [PATCH 7/8] vmxnet3: Set packet for fragmented packet Pankaj Gupta
@ 2022-05-03 4:22 ` Pankaj Gupta
2022-05-04 15:09 ` Andrew Rybchenko
2022-05-03 18:50 ` [PATCH 0/8] vmxnet3 version V5 and V6 Jochen Behrens
` (2 subsequent siblings)
10 siblings, 1 reply; 38+ messages in thread
From: Pankaj Gupta @ 2022-05-03 4:22 UTC (permalink / raw)
To: jbehrens, yongwang; +Cc: dev, pagupta
Fix merge error in initialization for rxDataRing feature.
Tested, using testpmd, for different hardware version on ESXi 7.0 Update 2.
Signed-off-by: Pankaj Gupta <pagupta@vmware.com>
---
drivers/net/vmxnet3/vmxnet3_ethdev.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
index 9955f121f6..6ced76ae2a 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -876,6 +876,11 @@ vmxnet3_setup_driver_shared(struct rte_eth_dev *dev)
rqd->conf.rxRingSize[1] = rxq->cmd_ring[1].size;
rqd->conf.compRingSize = rxq->comp_ring.size;
+ if (VMXNET3_VERSION_GE_3(hw)) {
+ rqd->conf.rxDataRingBasePA = rxq->data_ring.basePA;
+ rqd->conf.rxDataRingDescSize = rxq->data_desc_size;
+ }
+
if (hw->intr.lsc_only)
rqd->conf.intrIdx = 1;
else
--
2.17.1
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [PATCH 0/8] vmxnet3 version V5 and V6
2022-05-03 4:22 [PATCH 0/8] vmxnet3 version V5 and V6 Pankaj Gupta
` (7 preceding siblings ...)
2022-05-03 4:22 ` [PATCH 8/8] vmxnet3: Fix merge error in initialization for rxDataRing feature Pankaj Gupta
@ 2022-05-03 18:50 ` Jochen Behrens
2022-05-04 14:28 ` Andrew Rybchenko
2022-05-19 8:04 ` [PATCH v6 0/9] net/vmxnet3: support versions 5 and 6 Andrew Rybchenko
10 siblings, 0 replies; 38+ messages in thread
From: Jochen Behrens @ 2022-05-03 18:50 UTC (permalink / raw)
To: Pankaj Gupta, Yong Wang; +Cc: dev, Pankaj Gupta
[-- Attachment #1: Type: text/plain, Size: 999 bytes --]
Reviewed-by: Jochen Behrens jbehrens@vmware.com<mailto:jbehrens@vmware.com>
From: Pankaj Gupta <pagupta@vmware.com>
Date: Monday, May 2, 2022 at 9:23 PM
To: Jochen Behrens <jbehrens@vmware.com>, Yong Wang <yongwang@vmware.com>
Cc: dev@dpdk.org <dev@dpdk.org>, Pankaj Gupta <pagupta@vmware.com>
Subject: [PATCH 0/8] vmxnet3 version V5 and V6
Pankaj Gupta (8):
vmxnet3: Added V5 support
vmxnet3: implement reta query and reta update
vmxnet3: add rx queue usage count utility
vmxnet3: add get hw version api
vmxnet3, version 6
vmxnet3: set reta size
vmxnet3: Set packet for fragmented packet
vmxnet3: Fix merge error in initialization for rxDataRing feature
drivers/net/vmxnet3/base/vmxnet3_defs.h | 135 ++++++----
drivers/net/vmxnet3/vmxnet3_ethdev.c | 329 +++++++++++++++++++-----
drivers/net/vmxnet3/vmxnet3_ethdev.h | 15 +-
drivers/net/vmxnet3/vmxnet3_rxtx.c | 49 +++-
4 files changed, 416 insertions(+), 112 deletions(-)
--
2.17.1
[-- Attachment #2: Type: text/html, Size: 3180 bytes --]
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [PATCH 2/8] vmxnet3: implement reta query and reta update
2022-05-03 4:22 ` [PATCH 2/8] vmxnet3: implement reta query and reta update Pankaj Gupta
@ 2022-05-04 14:23 ` Andrew Rybchenko
0 siblings, 0 replies; 38+ messages in thread
From: Andrew Rybchenko @ 2022-05-04 14:23 UTC (permalink / raw)
To: Pankaj Gupta, jbehrens, yongwang; +Cc: dev
On 5/3/22 07:22, Pankaj Gupta wrote:
> Added reta query and reta update support for VMXNET3
>
> Tested, using testpmd, for different hardware version on ESXi 7.0 Update 2.
>
> Signed-off-by: Pankaj Gupta <pagupta@vmware.com>
> ---
> drivers/net/vmxnet3/vmxnet3_ethdev.c | 67 ++++++++++++++++++++++++++++
> 1 file changed, 67 insertions(+)
>
> diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
> index a7e1e5fef5..eb65499cf2 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 & (1ULL << shift))
Please, use RTE_BIT64(shift)
> + dev_rss_conf->indTable[i] = (uint8_t)reta_conf[idx].reta[shift];
Not a problem, but as I understand explicit type cast is not required.
> + }
> +
> + 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 & (1ULL << shift))
Use RTE_BIT64(shift)
> + reta_conf[idx].reta[shift] = dev_rss_conf->indTable[i];
> + }
> +
> + return 0;
> +}
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [PATCH 3/8] vmxnet3: add rx queue usage count utility
2022-05-03 4:22 ` [PATCH 3/8] vmxnet3: add rx queue usage count utility Pankaj Gupta
@ 2022-05-04 14:27 ` Andrew Rybchenko
2022-05-04 14:35 ` Morten Brørup
2022-05-04 17:58 ` Pankaj Gupta
0 siblings, 2 replies; 38+ messages in thread
From: Andrew Rybchenko @ 2022-05-04 14:27 UTC (permalink / raw)
To: Pankaj Gupta, jbehrens, yongwang; +Cc: dev
rx -> Rx
in summary in accordance with spelling in DPDK
On 5/3/22 07:22, Pankaj Gupta wrote:
> Count the number of entries in the rx queue for debugging.
rx -> Rx
As I understand debugging is not the only purpose of the API.
>
> Tested, using testpmd, for different hardware version on ESXi 7.0 Update 2
>
> Signed-off-by: Pankaj Gupta <pagupta@vmware.com>
> ---
> drivers/net/vmxnet3/vmxnet3_ethdev.c | 1 +
> drivers/net/vmxnet3/vmxnet3_ethdev.h | 3 +++
> drivers/net/vmxnet3/vmxnet3_rxtx.c | 30 ++++++++++++++++++++++++++++
> 3 files changed, 34 insertions(+)
>
> diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
> index eb65499cf2..a76796716b 100644
> --- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
> +++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
> @@ -294,6 +294,7 @@ eth_vmxnet3_dev_init(struct rte_eth_dev *eth_dev)
> eth_dev->rx_pkt_burst = &vmxnet3_recv_pkts;
> eth_dev->tx_pkt_burst = &vmxnet3_xmit_pkts;
> eth_dev->tx_pkt_prepare = vmxnet3_prep_pkts;
> + eth_dev->rx_queue_count = vmxnet3_dev_rx_queue_count,
Please, put it just after rx_pkt_burst to preserve the same order as in
structure.
> pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
>
> /* extra mbuf field is required to guess MSS */
[snip]
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [PATCH 0/8] vmxnet3 version V5 and V6
2022-05-03 4:22 [PATCH 0/8] vmxnet3 version V5 and V6 Pankaj Gupta
` (8 preceding siblings ...)
2022-05-03 18:50 ` [PATCH 0/8] vmxnet3 version V5 and V6 Jochen Behrens
@ 2022-05-04 14:28 ` Andrew Rybchenko
2022-05-19 8:04 ` [PATCH v6 0/9] net/vmxnet3: support versions 5 and 6 Andrew Rybchenko
10 siblings, 0 replies; 38+ messages in thread
From: Andrew Rybchenko @ 2022-05-04 14:28 UTC (permalink / raw)
To: Pankaj Gupta, jbehrens, yongwang; +Cc: dev
On 5/3/22 07:22, Pankaj Gupta wrote:
> Pankaj Gupta (8):
> vmxnet3: Added V5 support
> vmxnet3: implement reta query and reta update
> vmxnet3: add rx queue usage count utility
> vmxnet3: add get hw version api
> vmxnet3, version 6
> vmxnet3: set reta size
> vmxnet3: Set packet for fragmented packet
> vmxnet3: Fix merge error in initialization for rxDataRing feature
Please, fix prefix for all patches. It should be "net/vmxnet3: ".
Summary after prefix should start from small letter and be in
present tense, i.e. "Added" -> "add"
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [PATCH 4/8] vmxnet3: add get hw version api
2022-05-03 4:22 ` [PATCH 4/8] vmxnet3: add get hw version api Pankaj Gupta
@ 2022-05-04 14:35 ` Andrew Rybchenko
0 siblings, 0 replies; 38+ messages in thread
From: Andrew Rybchenko @ 2022-05-04 14:35 UTC (permalink / raw)
To: Pankaj Gupta, jbehrens, yongwang; +Cc: dev
hw -> HW
However, the API says that it is a firmware version get
Consier:
net/vmxnet3: report HW version on FW version get
On 5/3/22 07:22, Pankaj Gupta wrote:
> Implement fw_version_get API for vmxnet3
fw -> FW
"for vmxnet3" is a duplicate, since summary already says so.
>
> Tested, using testpmd, for different hardware version on
> ESXi 7.0 Update 2.
>
> Signed-off-by: Pankaj Gupta <pagupta@vmware.com>
> ---
> drivers/net/vmxnet3/vmxnet3_ethdev.c | 21 +++++++++++++++++++++
> 1 file changed, 21 insertions(+)
>
> diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
> index a76796716b..f77399f145 100644
> --- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
> +++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
> @@ -103,6 +103,10 @@ 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_hw_ver_get(struct rte_eth_dev *dev,
> + char *fw_version, size_t fw_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,
> @@ -147,6 +151,7 @@ static const struct eth_dev_ops vmxnet3_eth_dev_ops = {
> .rx_queue_intr_disable = vmxnet3_dev_rx_queue_intr_disable,
> .reta_update = vmxnet3_rss_reta_update,
> .reta_query = vmxnet3_rss_reta_query,
> + .fw_version_get = vmxnet3_hw_ver_get,
In general, addition order does not matter and it is
recommended to follow order in eth_dev_ops here (and
where functions are declared, and where functions are
defined).
> };
>
> struct vmxnet3_xstats_name_off {
> @@ -1764,3 +1769,19 @@ vmxnet3_rss_reta_query(struct rte_eth_dev *dev,
>
> return 0;
> }
> +
> +static int
> +vmxnet3_hw_ver_get(struct rte_eth_dev *dev,
> + char *fw_version, size_t fw_size)
> +{
> + int ret;
> + struct vmxnet3_hw *hw = dev->data->dev_private;
> +
> + ret = snprintf(fw_version, fw_size, "v%d", hw->version);
> +
> + ret += 1; /* add the size of '\0' */
> + if (fw_size < (uint32_t)ret)
> + return ret;
> + else
> + return 0;
> +}
^ permalink raw reply [flat|nested] 38+ messages in thread
* RE: [PATCH 3/8] vmxnet3: add rx queue usage count utility
2022-05-04 14:27 ` Andrew Rybchenko
@ 2022-05-04 14:35 ` Morten Brørup
2022-05-04 17:58 ` Pankaj Gupta
1 sibling, 0 replies; 38+ messages in thread
From: Morten Brørup @ 2022-05-04 14:35 UTC (permalink / raw)
To: Andrew Rybchenko, Pankaj Gupta, jbehrens, yongwang; +Cc: dev
> From: Andrew Rybchenko [mailto:andrew.rybchenko@oktetlabs.ru]
> Sent: Wednesday, 4 May 2022 16.28
>
> rx -> Rx
>
> in summary in accordance with spelling in DPDK
>
> On 5/3/22 07:22, Pankaj Gupta wrote:
> > Count the number of entries in the rx queue for debugging.
>
> rx -> Rx
>
> As I understand debugging is not the only purpose of the API.
Correct. E.g. our appliance uses it in the production data plane, not just for debugging. We only need the function to return an approximate number, though.
>
> >
> > Tested, using testpmd, for different hardware version on ESXi 7.0
> Update 2
> >
> > Signed-off-by: Pankaj Gupta <pagupta@vmware.com>
> > ---
> > drivers/net/vmxnet3/vmxnet3_ethdev.c | 1 +
> > drivers/net/vmxnet3/vmxnet3_ethdev.h | 3 +++
> > drivers/net/vmxnet3/vmxnet3_rxtx.c | 30
> ++++++++++++++++++++++++++++
> > 3 files changed, 34 insertions(+)
> >
> > diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c
> b/drivers/net/vmxnet3/vmxnet3_ethdev.c
> > index eb65499cf2..a76796716b 100644
> > --- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
> > +++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
> > @@ -294,6 +294,7 @@ eth_vmxnet3_dev_init(struct rte_eth_dev *eth_dev)
> > eth_dev->rx_pkt_burst = &vmxnet3_recv_pkts;
> > eth_dev->tx_pkt_burst = &vmxnet3_xmit_pkts;
> > eth_dev->tx_pkt_prepare = vmxnet3_prep_pkts;
> > + eth_dev->rx_queue_count = vmxnet3_dev_rx_queue_count,
>
> Please, put it just after rx_pkt_burst to preserve the same order as in
> structure.
>
> > pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
> >
> > /* extra mbuf field is required to guess MSS */
>
> [snip]
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [PATCH 5/8] vmxnet3, version 6
2022-05-03 4:22 ` [PATCH 5/8] vmxnet3, version 6 Pankaj Gupta
@ 2022-05-04 14:46 ` Andrew Rybchenko
0 siblings, 0 replies; 38+ messages in thread
From: Andrew Rybchenko @ 2022-05-04 14:46 UTC (permalink / raw)
To: Pankaj Gupta, jbehrens, yongwang; +Cc: dev
Summary should say what is done. Consider:
net/vmxnet3: support virtual HW version 6
On 5/3/22 07:22, Pankaj Gupta wrote:
> vmxnet3 version 6 supports some new features, including but
> not limited to:
> - Increased max MTU up to 9190
> - Increased max number of queues, both for RX and TX
RX -> Rx, TX -> Tx in accordnace with recommended spelling
> - Removes power-of-two limitations
> - Extended interrupt structures, required implementation for
> additional number of queues
Please, be consistent in tense used above, "increased" vs "removes".
> Tested, using testpmd, for different hardware version on
> ESXi 7.0 Update 2.
>
> Signed-off-by: Pankaj Gupta <pagupta@vmware.com>
> ---
> drivers/net/vmxnet3/base/vmxnet3_defs.h | 135 +++++++++-----
> drivers/net/vmxnet3/vmxnet3_ethdev.c | 223 +++++++++++++++++-------
> drivers/net/vmxnet3/vmxnet3_ethdev.h | 10 +-
> drivers/net/vmxnet3/vmxnet3_rxtx.c | 2 +-
> 4 files changed, 260 insertions(+), 110 deletions(-)
>
> diff --git a/drivers/net/vmxnet3/base/vmxnet3_defs.h b/drivers/net/vmxnet3/base/vmxnet3_defs.h
> index 8d62b3e116..ceac5d64db 100644
> --- a/drivers/net/vmxnet3/base/vmxnet3_defs.h
> +++ b/drivers/net/vmxnet3/base/vmxnet3_defs.h
> @@ -72,38 +72,42 @@
> #endif
>
> typedef enum {
> - VMXNET3_CMD_FIRST_SET = 0xCAFE0000,
> - VMXNET3_CMD_ACTIVATE_DEV = VMXNET3_CMD_FIRST_SET,
> - VMXNET3_CMD_QUIESCE_DEV,
> - VMXNET3_CMD_RESET_DEV,
> - VMXNET3_CMD_UPDATE_RX_MODE,
> - VMXNET3_CMD_UPDATE_MAC_FILTERS,
> - VMXNET3_CMD_UPDATE_VLAN_FILTERS,
> - VMXNET3_CMD_UPDATE_RSSIDT,
> - VMXNET3_CMD_UPDATE_IML,
> - VMXNET3_CMD_UPDATE_PMCFG,
> - VMXNET3_CMD_UPDATE_FEATURE,
> - VMXNET3_CMD_STOP_EMULATION,
> - VMXNET3_CMD_LOAD_PLUGIN,
> - VMXNET3_CMD_ACTIVATE_VF,
> - VMXNET3_CMD_RESERVED3,
> - VMXNET3_CMD_RESERVED4,
> - VMXNET3_CMD_REGISTER_MEMREGS,
> - VMXNET3_CMD_SET_RSS_FIELDS,
> -
> - VMXNET3_CMD_FIRST_GET = 0xF00D0000,
> - VMXNET3_CMD_GET_QUEUE_STATUS = VMXNET3_CMD_FIRST_GET,
> - VMXNET3_CMD_GET_STATS,
> - VMXNET3_CMD_GET_LINK,
> - VMXNET3_CMD_GET_PERM_MAC_LO,
> - VMXNET3_CMD_GET_PERM_MAC_HI,
> - VMXNET3_CMD_GET_DID_LO,
> - VMXNET3_CMD_GET_DID_HI,
> - VMXNET3_CMD_GET_DEV_EXTRA_INFO,
> - VMXNET3_CMD_GET_CONF_INTR,
> - VMXNET3_CMD_GET_ADAPTIVE_RING_INFO,
> - VMXNET3_CMD_GET_TXDATA_DESC_SIZE,
> - VMXNET3_CMD_RESERVED5,
> + VMXNET3_CMD_FIRST_SET = 0xCAFE0000,
> + VMXNET3_CMD_ACTIVATE_DEV = VMXNET3_CMD_FIRST_SET,
> + VMXNET3_CMD_QUIESCE_DEV,
> + VMXNET3_CMD_RESET_DEV,
> + VMXNET3_CMD_UPDATE_RX_MODE,
> + VMXNET3_CMD_UPDATE_MAC_FILTERS,
> + VMXNET3_CMD_UPDATE_VLAN_FILTERS,
> + VMXNET3_CMD_UPDATE_RSSIDT,
> + VMXNET3_CMD_UPDATE_IML,
> + VMXNET3_CMD_UPDATE_PMCFG,
> + VMXNET3_CMD_UPDATE_FEATURE,
> + VMXNET3_CMD_STOP_EMULATION,
> + VMXNET3_CMD_LOAD_PLUGIN,
> + VMXNET3_CMD_ACTIVATE_VF,
> + VMXNET3_CMD_RESERVED3,
> + VMXNET3_CMD_RESERVED4,
> + VMXNET3_CMD_REGISTER_MEMREGS,
> + VMXNET3_CMD_SET_RSS_FIELDS,
> +
> + VMXNET3_CMD_FIRST_GET = 0xF00D0000,
> + VMXNET3_CMD_GET_QUEUE_STATUS = VMXNET3_CMD_FIRST_GET,
> + VMXNET3_CMD_GET_STATS,
> + VMXNET3_CMD_GET_LINK,
> + VMXNET3_CMD_GET_PERM_MAC_LO,
> + VMXNET3_CMD_GET_PERM_MAC_HI,
> + VMXNET3_CMD_GET_DID_LO,
> + VMXNET3_CMD_GET_DID_HI,
> + VMXNET3_CMD_GET_DEV_EXTRA_INFO,
> + VMXNET3_CMD_GET_CONF_INTR,
> + VMXNET3_CMD_GET_ADAPTIVE_RING_INFO,
> + VMXNET3_CMD_GET_TXDATA_DESC_SIZE,
> + VMXNET3_CMD_RESERVED5,
> + VMXNET3_CMD_RESERVED6,
> + VMXNET3_CMD_RESERVED7,
> + VMXNET3_CMD_RESERVED8,
> + VMXNET3_CMD_GET_MAX_QUEUES_CONF,
It is hard to find what is really done above. If you wnat to fix an
alignment, please, do it in a separate prepatch without any real
changes.
> } Vmxnet3_Cmd;
>
> /* Adaptive Ring Info Flags */
> @@ -571,6 +575,24 @@ enum vmxnet3_intr_type {
> /* addition 1 for events */
> #define VMXNET3_MAX_INTRS 25
>
> +/* Version 6 and later will use below macros */
> +#define VMXNET3_EXT_MAX_TX_QUEUES 32
> +#define VMXNET3_EXT_MAX_RX_QUEUES 32
> +
> +/* Version-dependent MAX RX/TX queues macro */
> +#define MAX_RX_QUEUES \
> + (VMXNET3_VERSION_GE_6(hw) ? \
I think it is beter to pass 'hw' argument explicintly.
Otherwise it looks inconsistent and confusing.
> + VMXNET3_EXT_MAX_RX_QUEUES : \
> + VMXNET3_MAX_RX_QUEUES)
> +#define MAX_TX_QUEUES \
> + (VMXNET3_VERSION_GE_6(hw) ? \
same here
> + VMXNET3_EXT_MAX_TX_QUEUES : \
> + VMXNET3_MAX_TX_QUEUES)
> +
[snip]
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [PATCH 6/8] vmxnet3: set reta size
2022-05-03 4:22 ` [PATCH 6/8] vmxnet3: set reta size Pankaj Gupta
@ 2022-05-04 15:05 ` Andrew Rybchenko
0 siblings, 0 replies; 38+ messages in thread
From: Andrew Rybchenko @ 2022-05-04 15:05 UTC (permalink / raw)
To: Pankaj Gupta, jbehrens, yongwang; +Cc: dev
Consider:
net/vmxnet3: advertise RETA size in device info
On 5/3/22 07:22, Pankaj Gupta wrote:
> Currently the driver assumes that the size of the reta table is
reta -> RETA (see devtools/words-case.txt)
> four times the number of rx queues at multiple places. However,
rx -> Rx
> it sets it to four times the maximum number of queues (4 * 32 = 128)
> when it first initializes the device. Change the other uses to use
> the stored value, not the assumed default.
>
> Signed-off-by: Pankaj Gupta <pagupta@vmware.com>
> ---
> drivers/net/vmxnet3/vmxnet3_ethdev.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
> index f65b3d3113..9955f121f6 100644
> --- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
> +++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
> @@ -1483,7 +1483,12 @@ vmxnet3_dev_info_get(struct rte_eth_dev *dev,
> dev_info->rx_queue_offload_capa = 0;
> dev_info->tx_offload_capa = VMXNET3_TX_OFFLOAD_CAP;
> dev_info->tx_queue_offload_capa = 0;
> -
> + if (hw->rss_conf) {
Compare with NULL explicitly as DPDK coding style says.
> + dev_info->reta_size = hw->rss_conf->indTableSize;
> + } else {
> + /* RSS not configured */
> + dev_info->reta_size = 0;
> + }
> return 0;
> }
>
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [PATCH 7/8] vmxnet3: Set packet for fragmented packet
2022-05-03 4:22 ` [PATCH 7/8] vmxnet3: Set packet for fragmented packet Pankaj Gupta
@ 2022-05-04 15:07 ` Andrew Rybchenko
2022-05-04 20:40 ` Pankaj Gupta
0 siblings, 1 reply; 38+ messages in thread
From: Andrew Rybchenko @ 2022-05-04 15:07 UTC (permalink / raw)
To: Pankaj Gupta, jbehrens, yongwang; +Cc: dev
On 5/3/22 07:22, Pankaj Gupta wrote:
> The packet type is set even if it is a fragmented packet
I'm wondering if is really IPv4/IPv6 fragmented packets or just
scattered on Rx across many Rx buffers.
I'm asking since fragmented sounds weird with TCP, since TCP
spec forbids fragmentation.
>
> Tested, using testpmd, for different hardware versions on
> ESXi 7.0 Update 2.
>
> Signed-off-by: Pankaj Gupta <pagupta@vmware.com>
> ---
> drivers/net/vmxnet3/vmxnet3_rxtx.c | 17 +++++++++++++++++
> 1 file changed, 17 insertions(+)
>
> diff --git a/drivers/net/vmxnet3/vmxnet3_rxtx.c b/drivers/net/vmxnet3/vmxnet3_rxtx.c
> index a6665fbf70..5e177400c0 100644
> --- a/drivers/net/vmxnet3/vmxnet3_rxtx.c
> +++ b/drivers/net/vmxnet3/vmxnet3_rxtx.c
> @@ -759,6 +759,23 @@ vmxnet3_rx_offload(struct vmxnet3_hw *hw, const Vmxnet3_RxCompDesc *rcd,
> /* Check packet type, checksum errors, etc. */
> if (rcd->cnc) {
> ol_flags |= RTE_MBUF_F_RX_L4_CKSUM_UNKNOWN;
> +
> + if (rcd->v4) {
> + packet_type |= RTE_PTYPE_L3_IPV4_EXT_UNKNOWN;
> + if (rcd->tcp)
> + packet_type |= RTE_PTYPE_L4_TCP;
> + else if (rcd->udp)
> + packet_type |= RTE_PTYPE_L4_UDP;
> + } else if (rcd->v6) {
> + packet_type |= RTE_PTYPE_L3_IPV6_EXT_UNKNOWN;
> + if (rcd->tcp)
> + packet_type |= RTE_PTYPE_L4_TCP;
> + else if (rcd->udp)
> + packet_type |= RTE_PTYPE_L4_UDP;
> + } else {
> + packet_type |= RTE_PTYPE_UNKNOWN;
> + }
> +
> } else {
> if (rcd->v4) {
> packet_type |= RTE_PTYPE_L3_IPV4_EXT_UNKNOWN;
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [PATCH 8/8] vmxnet3: Fix merge error in initialization for rxDataRing feature
2022-05-03 4:22 ` [PATCH 8/8] vmxnet3: Fix merge error in initialization for rxDataRing feature Pankaj Gupta
@ 2022-05-04 15:09 ` Andrew Rybchenko
2022-05-04 20:37 ` Pankaj Gupta
0 siblings, 1 reply; 38+ messages in thread
From: Andrew Rybchenko @ 2022-05-04 15:09 UTC (permalink / raw)
To: Pankaj Gupta, jbehrens, yongwang; +Cc: dev
On 5/3/22 07:22, Pankaj Gupta wrote:
> Fix merge error in initialization for rxDataRing feature.
Is it a bug fix? If so, it requires corresponding "Fixes:" tag and Cc to
stable@dpdk.org in order to be backported to stable releases.
>
> Tested, using testpmd, for different hardware version on ESXi 7.0 Update 2.
>
> Signed-off-by: Pankaj Gupta <pagupta@vmware.com>
> ---
> drivers/net/vmxnet3/vmxnet3_ethdev.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
> index 9955f121f6..6ced76ae2a 100644
> --- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
> +++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
> @@ -876,6 +876,11 @@ vmxnet3_setup_driver_shared(struct rte_eth_dev *dev)
> rqd->conf.rxRingSize[1] = rxq->cmd_ring[1].size;
> rqd->conf.compRingSize = rxq->comp_ring.size;
>
> + if (VMXNET3_VERSION_GE_3(hw)) {
> + rqd->conf.rxDataRingBasePA = rxq->data_ring.basePA;
> + rqd->conf.rxDataRingDescSize = rxq->data_desc_size;
> + }
> +
> if (hw->intr.lsc_only)
> rqd->conf.intrIdx = 1;
> else
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [PATCH 3/8] vmxnet3: add rx queue usage count utility
2022-05-04 14:27 ` Andrew Rybchenko
2022-05-04 14:35 ` Morten Brørup
@ 2022-05-04 17:58 ` Pankaj Gupta
1 sibling, 0 replies; 38+ messages in thread
From: Pankaj Gupta @ 2022-05-04 17:58 UTC (permalink / raw)
To: Andrew Rybchenko, Jochen Behrens, Yong Wang; +Cc: dev
[-- Attachment #1: Type: text/plain, Size: 4749 bytes --]
Hi Andrew,
Please refer struct rte_eth_dev. Following assignment already preserve the order in struct rte_eth_dev
> diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
> index eb65499cf2..a76796716b 100644
> --- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
> +++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
> @@ -294,6 +294,7 @@ eth_vmxnet3_dev_init(struct rte_eth_dev *eth_dev)
> eth_dev->rx_pkt_burst = &vmxnet3_recv_pkts;
> eth_dev->tx_pkt_burst = &vmxnet3_xmit_pkts;
> eth_dev->tx_pkt_prepare = vmxnet3_prep_pkts;
> + eth_dev->rx_queue_count = vmxnet3_dev_rx_queue_count,
Please, put it just after rx_pkt_burst to preserve the same order as in
structure.
/**
* @internal
* The generic data structure associated with each Ethernet device.
*
* Pointers to burst-oriented packet receive and transmit functions are
* located at the beginning of the structure, along with the pointer to
* where all the data elements for the particular device are stored in shared
* memory. This split allows the function pointer and driver data to be per-
* process, while the actual configuration data for the device is shared.
*/
struct rte_eth_dev {
eth_rx_burst_t rx_pkt_burst; /**< Pointer to PMD receive function */
eth_tx_burst_t tx_pkt_burst; /**< Pointer to PMD transmit function */
/** Pointer to PMD transmit prepare function */
eth_tx_prep_t tx_pkt_prepare;
/** Get the number of used Rx descriptors */
eth_rx_queue_count_t rx_queue_count;
/** Check the status of a Rx descriptor */
eth_rx_descriptor_status_t rx_descriptor_status;
/** Check the status of a Tx descriptor */
eth_tx_descriptor_status_t tx_descriptor_status;
/**
* Device data that is shared between primary and secondary processes
*/
struct rte_eth_dev_data *data;
void *process_private; /**< Pointer to per-process device data */
const struct eth_dev_ops *dev_ops; /**< Functions exported by PMD */
struct rte_device *device; /**< Backing device */
struct rte_intr_handle *intr_handle; /**< Device interrupt handle */
/** User application callbacks for NIC interrupts */
struct rte_eth_dev_cb_list link_intr_cbs;
/**
* User-supplied functions called from rx_burst to post-process
* received packets before passing them to the user
*/
struct rte_eth_rxtx_callback *post_rx_burst_cbs[RTE_MAX_QUEUES_PER_PORT];
/**
* User-supplied functions called from tx_burst to pre-process
* received packets before passing them to the driver for transmission
*/
struct rte_eth_rxtx_callback *pre_tx_burst_cbs[RTE_MAX_QUEUES_PER_PORT];
enum rte_eth_dev_state state; /**< Flag indicating the port state */
void *security_ctx; /**< Context for security ops */
} __rte_cache_aligned;
Thanks,
Pankaj
From: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Date: Wednesday, May 4, 2022 at 7:27 AM
To: Pankaj Gupta <pagupta@vmware.com>, Jochen Behrens <jbehrens@vmware.com>, Yong Wang <yongwang@vmware.com>
Cc: dev@dpdk.org <dev@dpdk.org>
Subject: Re: [PATCH 3/8] vmxnet3: add rx queue usage count utility
⚠ External Email
rx -> Rx
in summary in accordance with spelling in DPDK
On 5/3/22 07:22, Pankaj Gupta wrote:
> Count the number of entries in the rx queue for debugging.
rx -> Rx
As I understand debugging is not the only purpose of the API.
>
> Tested, using testpmd, for different hardware version on ESXi 7.0 Update 2
>
> Signed-off-by: Pankaj Gupta <pagupta@vmware.com>
> ---
> drivers/net/vmxnet3/vmxnet3_ethdev.c | 1 +
> drivers/net/vmxnet3/vmxnet3_ethdev.h | 3 +++
> drivers/net/vmxnet3/vmxnet3_rxtx.c | 30 ++++++++++++++++++++++++++++
> 3 files changed, 34 insertions(+)
>
> diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
> index eb65499cf2..a76796716b 100644
> --- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
> +++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
> @@ -294,6 +294,7 @@ eth_vmxnet3_dev_init(struct rte_eth_dev *eth_dev)
> eth_dev->rx_pkt_burst = &vmxnet3_recv_pkts;
> eth_dev->tx_pkt_burst = &vmxnet3_xmit_pkts;
> eth_dev->tx_pkt_prepare = vmxnet3_prep_pkts;
> + eth_dev->rx_queue_count = vmxnet3_dev_rx_queue_count,
Please, put it just after rx_pkt_burst to preserve the same order as in
structure.
> pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
>
> /* extra mbuf field is required to guess MSS */
[snip]
________________________________
⚠ External Email: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender.
[-- Attachment #2: Type: text/html, Size: 14413 bytes --]
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [PATCH 8/8] vmxnet3: Fix merge error in initialization for rxDataRing feature
2022-05-04 15:09 ` Andrew Rybchenko
@ 2022-05-04 20:37 ` Pankaj Gupta
2022-05-05 8:37 ` Andrew Rybchenko
0 siblings, 1 reply; 38+ messages in thread
From: Pankaj Gupta @ 2022-05-04 20:37 UTC (permalink / raw)
To: Andrew Rybchenko, Jochen Behrens, Yong Wang; +Cc: dev
[-- Attachment #1: Type: text/plain, Size: 1999 bytes --]
Hi Andrew,
Changes done in this patch was accidentally removed in commit 046f1161956777e3afb13504acbe8df2ec3a383c.
This was noticed later and we are trying to address this here.
Thanks,
Pankaj
From: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Date: Wednesday, May 4, 2022 at 8:09 AM
To: Pankaj Gupta <pagupta@vmware.com>, Jochen Behrens <jbehrens@vmware.com>, Yong Wang <yongwang@vmware.com>
Cc: dev@dpdk.org <dev@dpdk.org>
Subject: Re: [PATCH 8/8] vmxnet3: Fix merge error in initialization for rxDataRing feature
⚠ External Email
On 5/3/22 07:22, Pankaj Gupta wrote:
> Fix merge error in initialization for rxDataRing feature.
Is it a bug fix? If so, it requires corresponding "Fixes:" tag and Cc to
stable@dpdk.org in order to be backported to stable releases.
>
> Tested, using testpmd, for different hardware version on ESXi 7.0 Update 2.
>
> Signed-off-by: Pankaj Gupta <pagupta@vmware.com>
> ---
> drivers/net/vmxnet3/vmxnet3_ethdev.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
> index 9955f121f6..6ced76ae2a 100644
> --- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
> +++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
> @@ -876,6 +876,11 @@ vmxnet3_setup_driver_shared(struct rte_eth_dev *dev)
> rqd->conf.rxRingSize[1] = rxq->cmd_ring[1].size;
> rqd->conf.compRingSize = rxq->comp_ring.size;
>
> + if (VMXNET3_VERSION_GE_3(hw)) {
> + rqd->conf.rxDataRingBasePA = rxq->data_ring.basePA;
> + rqd->conf.rxDataRingDescSize = rxq->data_desc_size;
> + }
> +
> if (hw->intr.lsc_only)
> rqd->conf.intrIdx = 1;
> else
________________________________
⚠ External Email: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender.
[-- Attachment #2: Type: text/html, Size: 6115 bytes --]
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [PATCH 7/8] vmxnet3: Set packet for fragmented packet
2022-05-04 15:07 ` Andrew Rybchenko
@ 2022-05-04 20:40 ` Pankaj Gupta
2022-05-05 8:45 ` Andrew Rybchenko
0 siblings, 1 reply; 38+ messages in thread
From: Pankaj Gupta @ 2022-05-04 20:40 UTC (permalink / raw)
To: Andrew Rybchenko, Jochen Behrens, Yong Wang; +Cc: dev
[-- Attachment #1: Type: text/plain, Size: 2749 bytes --]
Hi Andrew,
Packet type was not set for fragmented packets so we are trying to set it in all possible scenarios.
I believe TCP packets can be fragmented.
Thanks,
Pankaj
From: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Date: Wednesday, May 4, 2022 at 8:08 AM
To: Pankaj Gupta <pagupta@vmware.com>, Jochen Behrens <jbehrens@vmware.com>, Yong Wang <yongwang@vmware.com>
Cc: dev@dpdk.org <dev@dpdk.org>
Subject: Re: [PATCH 7/8] vmxnet3: Set packet for fragmented packet
⚠ External Email
On 5/3/22 07:22, Pankaj Gupta wrote:
> The packet type is set even if it is a fragmented packet
I'm wondering if is really IPv4/IPv6 fragmented packets or just
scattered on Rx across many Rx buffers.
I'm asking since fragmented sounds weird with TCP, since TCP
spec forbids fragmentation.
>
> Tested, using testpmd, for different hardware versions on
> ESXi 7.0 Update 2.
>
> Signed-off-by: Pankaj Gupta <pagupta@vmware.com>
> ---
> drivers/net/vmxnet3/vmxnet3_rxtx.c | 17 +++++++++++++++++
> 1 file changed, 17 insertions(+)
>
> diff --git a/drivers/net/vmxnet3/vmxnet3_rxtx.c b/drivers/net/vmxnet3/vmxnet3_rxtx.c
> index a6665fbf70..5e177400c0 100644
> --- a/drivers/net/vmxnet3/vmxnet3_rxtx.c
> +++ b/drivers/net/vmxnet3/vmxnet3_rxtx.c
> @@ -759,6 +759,23 @@ vmxnet3_rx_offload(struct vmxnet3_hw *hw, const Vmxnet3_RxCompDesc *rcd,
> /* Check packet type, checksum errors, etc. */
> if (rcd->cnc) {
> ol_flags |= RTE_MBUF_F_RX_L4_CKSUM_UNKNOWN;
> +
> + if (rcd->v4) {
> + packet_type |= RTE_PTYPE_L3_IPV4_EXT_UNKNOWN;
> + if (rcd->tcp)
> + packet_type |= RTE_PTYPE_L4_TCP;
> + else if (rcd->udp)
> + packet_type |= RTE_PTYPE_L4_UDP;
> + } else if (rcd->v6) {
> + packet_type |= RTE_PTYPE_L3_IPV6_EXT_UNKNOWN;
> + if (rcd->tcp)
> + packet_type |= RTE_PTYPE_L4_TCP;
> + else if (rcd->udp)
> + packet_type |= RTE_PTYPE_L4_UDP;
> + } else {
> + packet_type |= RTE_PTYPE_UNKNOWN;
> + }
> +
> } else {
> if (rcd->v4) {
> packet_type |= RTE_PTYPE_L3_IPV4_EXT_UNKNOWN;
________________________________
⚠ External Email: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender.
[-- Attachment #2: Type: text/html, Size: 8777 bytes --]
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [PATCH 8/8] vmxnet3: Fix merge error in initialization for rxDataRing feature
2022-05-04 20:37 ` Pankaj Gupta
@ 2022-05-05 8:37 ` Andrew Rybchenko
0 siblings, 0 replies; 38+ messages in thread
From: Andrew Rybchenko @ 2022-05-05 8:37 UTC (permalink / raw)
To: Pankaj Gupta, Jochen Behrens, Yong Wang; +Cc: dev
Hi Pakai,
On 5/4/22 23:37, Pankaj Gupta wrote:
> Hi Andrew,
>
> Changes done in this patch was accidentally removed in commit
> 046f1161956777e3afb13504acbe8df2ec3a383c.
>
> This was noticed later and we are trying to address this here.
If so, you should add:
Fixes: 046f11619567 ("net/vmxnet3: support MSI-X interrupt")
Cc: stable@dpdk.org
>
> Thanks,
>
> Pankaj
>
> *From: *Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
> *Date: *Wednesday, May 4, 2022 at 8:09 AM
> *To: *Pankaj Gupta <pagupta@vmware.com>, Jochen Behrens
> <jbehrens@vmware.com>, Yong Wang <yongwang@vmware.com>
> *Cc: *dev@dpdk.org <dev@dpdk.org>
> *Subject: *Re: [PATCH 8/8] vmxnet3: Fix merge error in initialization
> for rxDataRing feature
>
> ⚠External Email
>
> On 5/3/22 07:22, Pankaj Gupta wrote:
>> Fix merge error in initialization for rxDataRing feature.
>
> Is it a bug fix? If so, it requires corresponding "Fixes:" tag and Cc to
> stable@dpdk.org in order to be backported to stable releases.
>
>>
>> Tested, using testpmd, for different hardware version on ESXi 7.0 Update 2.
>>
>> Signed-off-by: Pankaj Gupta <pagupta@vmware.com>
>> ---
>> drivers/net/vmxnet3/vmxnet3_ethdev.c | 5 +++++
>> 1 file changed, 5 insertions(+)
>>
>> diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
>> index 9955f121f6..6ced76ae2a 100644
>> --- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
>> +++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
>> @@ -876,6 +876,11 @@ vmxnet3_setup_driver_shared(struct rte_eth_dev *dev)
>> rqd->conf.rxRingSize[1] = rxq->cmd_ring[1].size;
>> rqd->conf.compRingSize = rxq->comp_ring.size;
>>
>> + if (VMXNET3_VERSION_GE_3(hw)) {
>> + rqd->conf.rxDataRingBasePA = rxq->data_ring.basePA;
>> + rqd->conf.rxDataRingDescSize = rxq->data_desc_size;
>> + }
>> +
>> if (hw->intr.lsc_only)
>> rqd->conf.intrIdx = 1;
>> else
>
>
> ________________________________
>
> ⚠External Email: This email originated from outside of the organization.
> Do not click links or open attachments unless you recognize the sender.
>
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [PATCH 7/8] vmxnet3: Set packet for fragmented packet
2022-05-04 20:40 ` Pankaj Gupta
@ 2022-05-05 8:45 ` Andrew Rybchenko
0 siblings, 0 replies; 38+ messages in thread
From: Andrew Rybchenko @ 2022-05-05 8:45 UTC (permalink / raw)
To: Pankaj Gupta, Jochen Behrens, Yong Wang; +Cc: dev
[-- Attachment #1: Type: text/plain, Size: 3622 bytes --]
Hi Pankaj,
On 5/4/22 23:40, Pankaj Gupta wrote:
>
> Hi Andrew,
>
> Packet type was not set for fragmented packets so we are trying to set
> it in all possible scenarios.
>
> I believe TCP packets can be fragmented.
>
Theoretically it is possible, yes. OK, my main goal was to check that
we are really talking about L3 fragmentation, not scattering on Rx
and I've got the answer.
Thanks,
Andrew.
>
> Thanks,
>
> Pankaj
>
> *From: *Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
> *Date: *Wednesday, May 4, 2022 at 8:08 AM
> *To: *Pankaj Gupta <pagupta@vmware.com>, Jochen Behrens
> <jbehrens@vmware.com>, Yong Wang <yongwang@vmware.com>
> *Cc: *dev@dpdk.org <dev@dpdk.org>
> *Subject: *Re: [PATCH 7/8] vmxnet3: Set packet for fragmented packet
>
> ⚠External Email
>
> On 5/3/22 07:22, Pankaj Gupta wrote:
> > The packet type is set even if it is a fragmented packet
>
> I'm wondering if is really IPv4/IPv6 fragmented packets or just
> scattered on Rx across many Rx buffers.
> I'm asking since fragmented sounds weird with TCP, since TCP
> spec forbids fragmentation.
>
> >
> > Tested, using testpmd, for different hardware versions on
> > ESXi 7.0 Update 2.
> >
> > Signed-off-by: Pankaj Gupta <pagupta@vmware.com>
> > ---
> > drivers/net/vmxnet3/vmxnet3_rxtx.c | 17 +++++++++++++++++
> > 1 file changed, 17 insertions(+)
> >
> > diff --git a/drivers/net/vmxnet3/vmxnet3_rxtx.c
> b/drivers/net/vmxnet3/vmxnet3_rxtx.c
> > index a6665fbf70..5e177400c0 100644
> > --- a/drivers/net/vmxnet3/vmxnet3_rxtx.c
> > +++ b/drivers/net/vmxnet3/vmxnet3_rxtx.c
> > @@ -759,6 +759,23 @@ vmxnet3_rx_offload(struct vmxnet3_hw *hw, const
> Vmxnet3_RxCompDesc *rcd,
> > /* Check packet type, checksum errors, etc. */
> > if (rcd->cnc) {
> > ol_flags |= RTE_MBUF_F_RX_L4_CKSUM_UNKNOWN;
> > +
> > + if (rcd->v4) {
> > + packet_type |=
> RTE_PTYPE_L3_IPV4_EXT_UNKNOWN;
> > + if (rcd->tcp)
> > + packet_type |= RTE_PTYPE_L4_TCP;
> > + else if (rcd->udp)
> > + packet_type |= RTE_PTYPE_L4_UDP;
> > + } else if (rcd->v6) {
> > + packet_type |=
> RTE_PTYPE_L3_IPV6_EXT_UNKNOWN;
> > + if (rcd->tcp)
> > + packet_type |= RTE_PTYPE_L4_TCP;
> > + else if (rcd->udp)
> > + packet_type |= RTE_PTYPE_L4_UDP;
> > + } else {
> > + packet_type |= RTE_PTYPE_UNKNOWN;
> > + }
> > +
> > } else {
> > if (rcd->v4) {
> > packet_type |=
> RTE_PTYPE_L3_IPV4_EXT_UNKNOWN;
>
>
> ________________________________
>
> ⚠External Email: This email originated from outside of the
> organization. Do not click links or open attachments unless you
> recognize the sender.
>
[-- Attachment #2: Type: text/html, Size: 8911 bytes --]
^ permalink raw reply [flat|nested] 38+ messages in thread
* [PATCH v6 0/9] net/vmxnet3: support versions 5 and 6
2022-05-03 4:22 [PATCH 0/8] vmxnet3 version V5 and V6 Pankaj Gupta
` (9 preceding siblings ...)
2022-05-04 14:28 ` Andrew Rybchenko
@ 2022-05-19 8:04 ` Andrew Rybchenko
2022-05-19 8:04 ` [PATCH v6 1/9] net/vmxnet3: add version 5 support Andrew Rybchenko
` (9 more replies)
10 siblings, 10 replies; 38+ messages in thread
From: Andrew Rybchenko @ 2022-05-19 8:04 UTC (permalink / raw)
To: Pankaj Gupta, Jochen Behrens; +Cc: dev
v6 (Andrew Rybchenko):
Minor style changes in patches description
Split FW version get patch to have callbacks reorder seperately
Minor fix in FW version get patch to put callback definition,
assignment and implementation just after device info get
v5:
Use RTE_MIN instead of defining MIN in drivers/net/vmxnet3/vmxnet3_ethdev.c
User RETA instead of reta in commit message
Fix the issue thrown by checkpatches.sh in file drivers/net/vmxnet3/vmxnet3_ethdev.c
v4:
Changing the subject for [Patch 8/8] from "net/vmxnet3: fix merge error
in initialization for rxDataRing feature" to
"Fixes: 046f11619567 ("net/vmxnet3: support MSI-X interrupt")"
v3:
adding Reviewed-by info in all the patches
v2:
address review comments from Andrew Rybchenko andrew.rybchenko@oktetlabs.ru
Pankaj Gupta (9):
net/vmxnet3: add version 5 support
net/vmxnet3: implement RETA query and RETA update
net/vmxnet3: add Rx queue usage count utility
net/vmxnet3: fix ethdev callbacks init order
net/vmxnet3: report HW version on FW version get
net/vmxnet3: add version 6 support
net/vmxnet3: advertise RETA size in device info
net/vmxnet3: set packet type for fragmented packet
net/vmxnet3: fix merge error in Rx data ring initialization
drivers/net/vmxnet3/base/vmxnet3_defs.h | 73 ++++-
drivers/net/vmxnet3/vmxnet3_ethdev.c | 339 +++++++++++++++++++-----
drivers/net/vmxnet3/vmxnet3_ethdev.h | 15 +-
drivers/net/vmxnet3/vmxnet3_rxtx.c | 49 +++-
4 files changed, 388 insertions(+), 88 deletions(-)
--
2.30.2
^ permalink raw reply [flat|nested] 38+ messages in thread
* [PATCH v6 1/9] net/vmxnet3: add version 5 support
2022-05-19 8:04 ` [PATCH v6 0/9] net/vmxnet3: support versions 5 and 6 Andrew Rybchenko
@ 2022-05-19 8:04 ` Andrew Rybchenko
2022-05-19 8:04 ` [PATCH v6 2/9] net/vmxnet3: implement RETA query and RETA update Andrew Rybchenko
` (8 subsequent siblings)
9 siblings, 0 replies; 38+ messages in thread
From: Andrew Rybchenko @ 2022-05-19 8:04 UTC (permalink / raw)
To: Pankaj Gupta, Jochen Behrens; +Cc: dev
From: Pankaj Gupta <pagupta@vmware.com>
Add VMXNET3 v5 support.
Tested, using testpmd, for different hardware versions on ESXi 7.0
Update 2.
Signed-off-by: Pankaj Gupta <pagupta@vmware.com>
Reviewed-by: Jochen Behrens <jbehrens@vmware.com>
---
drivers/net/vmxnet3/vmxnet3_ethdev.c | 7 +++++--
drivers/net/vmxnet3/vmxnet3_ethdev.h | 2 ++
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
index d1ef1cad08..a7e1e5fef5 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -316,9 +316,12 @@ eth_vmxnet3_dev_init(struct rte_eth_dev *eth_dev)
/* Check h/w version compatibility with driver. */
ver = VMXNET3_READ_BAR1_REG(hw, VMXNET3_REG_VRRS);
- PMD_INIT_LOG(DEBUG, "Hardware version : %d", ver);
- if (ver & (1 << VMXNET3_REV_4)) {
+ if (ver & (1 << VMXNET3_REV_5)) {
+ VMXNET3_WRITE_BAR1_REG(hw, VMXNET3_REG_VRRS,
+ 1 << VMXNET3_REV_5);
+ hw->version = VMXNET3_REV_5 + 1;
+ } else if (ver & (1 << VMXNET3_REV_4)) {
VMXNET3_WRITE_BAR1_REG(hw, VMXNET3_REG_VRRS,
1 << VMXNET3_REV_4);
hw->version = VMXNET3_REV_4 + 1;
diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.h b/drivers/net/vmxnet3/vmxnet3_ethdev.h
index ef858ac951..7ec3b2e1f0 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.h
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.h
@@ -124,11 +124,13 @@ struct vmxnet3_hw {
UPT1_RxStats snapshot_rx_stats[VMXNET3_MAX_RX_QUEUES];
};
+#define VMXNET3_REV_5 4 /* Vmxnet3 Rev. 5 */
#define VMXNET3_REV_4 3 /* Vmxnet3 Rev. 4 */
#define VMXNET3_REV_3 2 /* Vmxnet3 Rev. 3 */
#define VMXNET3_REV_2 1 /* Vmxnet3 Rev. 2 */
#define VMXNET3_REV_1 0 /* Vmxnet3 Rev. 1 */
+#define VMXNET3_VERSION_GE_5(hw) ((hw)->version >= VMXNET3_REV_5 + 1)
#define VMXNET3_VERSION_GE_4(hw) ((hw)->version >= VMXNET3_REV_4 + 1)
#define VMXNET3_VERSION_GE_3(hw) ((hw)->version >= VMXNET3_REV_3 + 1)
#define VMXNET3_VERSION_GE_2(hw) ((hw)->version >= VMXNET3_REV_2 + 1)
--
2.30.2
^ permalink raw reply [flat|nested] 38+ messages in thread
* [PATCH v6 2/9] net/vmxnet3: implement RETA query and RETA update
2022-05-19 8:04 ` [PATCH v6 0/9] net/vmxnet3: support versions 5 and 6 Andrew Rybchenko
2022-05-19 8:04 ` [PATCH v6 1/9] net/vmxnet3: add version 5 support Andrew Rybchenko
@ 2022-05-19 8:04 ` Andrew Rybchenko
2022-05-19 8:04 ` [PATCH v6 3/9] net/vmxnet3: add Rx queue usage count utility Andrew Rybchenko
` (7 subsequent siblings)
9 siblings, 0 replies; 38+ messages in thread
From: Andrew Rybchenko @ 2022-05-19 8:04 UTC (permalink / raw)
To: Pankaj Gupta, Jochen Behrens; +Cc: dev
From: Pankaj Gupta <pagupta@vmware.com>
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 <pagupta@vmware.com>
Reviewed-by: Jochen Behrens <jbehrens@vmware.com>
---
drivers/net/vmxnet3/vmxnet3_ethdev.c | 67 ++++++++++++++++++++++++++++
1 file changed, 67 insertions(+)
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.30.2
^ permalink raw reply [flat|nested] 38+ messages in thread
* [PATCH v6 3/9] net/vmxnet3: add Rx queue usage count utility
2022-05-19 8:04 ` [PATCH v6 0/9] net/vmxnet3: support versions 5 and 6 Andrew Rybchenko
2022-05-19 8:04 ` [PATCH v6 1/9] net/vmxnet3: add version 5 support Andrew Rybchenko
2022-05-19 8:04 ` [PATCH v6 2/9] net/vmxnet3: implement RETA query and RETA update Andrew Rybchenko
@ 2022-05-19 8:04 ` Andrew Rybchenko
2022-05-19 8:04 ` [PATCH v6 4/9] net/vmxnet3: fix ethdev callbacks init order Andrew Rybchenko
` (6 subsequent siblings)
9 siblings, 0 replies; 38+ messages in thread
From: Andrew Rybchenko @ 2022-05-19 8:04 UTC (permalink / raw)
To: Pankaj Gupta, Jochen Behrens; +Cc: dev
From: Pankaj Gupta <pagupta@vmware.com>
Count the number of entries in the Rx queue for debugging.
Tested, using testpmd, for different hardware versions on ESXi 7.0
Update 2.
Signed-off-by: Pankaj Gupta <pagupta@vmware.com>
Reviewed-by: Jochen Behrens <jbehrens@vmware.com>
---
drivers/net/vmxnet3/vmxnet3_ethdev.c | 1 +
drivers/net/vmxnet3/vmxnet3_ethdev.h | 3 +++
drivers/net/vmxnet3/vmxnet3_rxtx.c | 30 ++++++++++++++++++++++++++++
3 files changed, 34 insertions(+)
diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
index d5f9903946..cd32c1b4ee 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -294,6 +294,7 @@ eth_vmxnet3_dev_init(struct rte_eth_dev *eth_dev)
eth_dev->rx_pkt_burst = &vmxnet3_recv_pkts;
eth_dev->tx_pkt_burst = &vmxnet3_xmit_pkts;
eth_dev->tx_pkt_prepare = vmxnet3_prep_pkts;
+ eth_dev->rx_queue_count = vmxnet3_dev_rx_queue_count;
pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
/* extra mbuf field is required to guess MSS */
diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.h b/drivers/net/vmxnet3/vmxnet3_ethdev.h
index 7ec3b2e1f0..ceaeb66392 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.h
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.h
@@ -193,6 +193,9 @@ int vmxnet3_dev_rx_queue_setup(struct rte_eth_dev *dev, uint16_t rx_queue_id,
uint16_t nb_rx_desc, unsigned int socket_id,
const struct rte_eth_rxconf *rx_conf,
struct rte_mempool *mb_pool);
+
+uint32_t vmxnet3_dev_rx_queue_count(void *rx_queue);
+
int vmxnet3_dev_tx_queue_setup(struct rte_eth_dev *dev, uint16_t tx_queue_id,
uint16_t nb_tx_desc, unsigned int socket_id,
const struct rte_eth_txconf *tx_conf);
diff --git a/drivers/net/vmxnet3/vmxnet3_rxtx.c b/drivers/net/vmxnet3/vmxnet3_rxtx.c
index d745064bc4..e15b377d8c 100644
--- a/drivers/net/vmxnet3/vmxnet3_rxtx.c
+++ b/drivers/net/vmxnet3/vmxnet3_rxtx.c
@@ -1019,6 +1019,36 @@ vmxnet3_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
return nb_rx;
}
+uint32_t
+vmxnet3_dev_rx_queue_count(void *rx_queue)
+{
+ const vmxnet3_rx_queue_t *rxq;
+ const Vmxnet3_RxCompDesc *rcd;
+ uint32_t idx, nb_rxd = 0;
+ uint8_t gen;
+
+ rxq = rx_queue;
+ if (unlikely(rxq->stopped)) {
+ PMD_RX_LOG(DEBUG, "Rx queue is stopped.");
+ return 0;
+ }
+
+ gen = rxq->comp_ring.gen;
+ idx = rxq->comp_ring.next2proc;
+ rcd = &rxq->comp_ring.base[idx].rcd;
+ while (rcd->gen == gen) {
+ if (rcd->eop)
+ ++nb_rxd;
+ if (++idx == rxq->comp_ring.size) {
+ idx = 0;
+ gen ^= 1;
+ }
+ rcd = &rxq->comp_ring.base[idx].rcd;
+ }
+
+ return nb_rxd;
+}
+
int
vmxnet3_dev_tx_queue_setup(struct rte_eth_dev *dev,
uint16_t queue_idx,
--
2.30.2
^ permalink raw reply [flat|nested] 38+ messages in thread
* [PATCH v6 4/9] net/vmxnet3: fix ethdev callbacks init order
2022-05-19 8:04 ` [PATCH v6 0/9] net/vmxnet3: support versions 5 and 6 Andrew Rybchenko
` (2 preceding siblings ...)
2022-05-19 8:04 ` [PATCH v6 3/9] net/vmxnet3: add Rx queue usage count utility Andrew Rybchenko
@ 2022-05-19 8:04 ` Andrew Rybchenko
2022-05-19 8:04 ` [PATCH v6 5/9] net/vmxnet3: report HW version on FW version get Andrew Rybchenko
` (5 subsequent siblings)
9 siblings, 0 replies; 38+ messages in thread
From: Andrew Rybchenko @ 2022-05-19 8:04 UTC (permalink / raw)
To: Pankaj Gupta, Jochen Behrens; +Cc: dev
From: Pankaj Gupta <pagupta@vmware.com>
Driver callbacks initialization should follow callbacks order in the
structure definition.
Do not reorder callbacks implementation to avoid extra noise in
the code.
Signed-off-by: Pankaj Gupta <pagupta@vmware.com>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
---
drivers/net/vmxnet3/vmxnet3_ethdev.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
index cd32c1b4ee..e84d304378 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -124,27 +124,27 @@ static const struct eth_dev_ops vmxnet3_eth_dev_ops = {
.dev_stop = vmxnet3_dev_stop,
.dev_close = vmxnet3_dev_close,
.dev_reset = vmxnet3_dev_reset,
+ .link_update = vmxnet3_dev_link_update,
.promiscuous_enable = vmxnet3_dev_promiscuous_enable,
.promiscuous_disable = vmxnet3_dev_promiscuous_disable,
.allmulticast_enable = vmxnet3_dev_allmulticast_enable,
.allmulticast_disable = vmxnet3_dev_allmulticast_disable,
- .link_update = vmxnet3_dev_link_update,
+ .mac_addr_set = vmxnet3_mac_addr_set,
+ .mtu_set = vmxnet3_dev_mtu_set,
.stats_get = vmxnet3_dev_stats_get,
- .xstats_get_names = vmxnet3_dev_xstats_get_names,
- .xstats_get = vmxnet3_dev_xstats_get,
.stats_reset = vmxnet3_dev_stats_reset,
- .mac_addr_set = vmxnet3_mac_addr_set,
+ .xstats_get = vmxnet3_dev_xstats_get,
+ .xstats_get_names = vmxnet3_dev_xstats_get_names,
.dev_infos_get = vmxnet3_dev_info_get,
.dev_supported_ptypes_get = vmxnet3_dev_supported_ptypes_get,
- .mtu_set = vmxnet3_dev_mtu_set,
.vlan_filter_set = vmxnet3_dev_vlan_filter_set,
.vlan_offload_set = vmxnet3_dev_vlan_offload_set,
.rx_queue_setup = vmxnet3_dev_rx_queue_setup,
.rx_queue_release = vmxnet3_dev_rx_queue_release,
- .tx_queue_setup = vmxnet3_dev_tx_queue_setup,
- .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,
+ .tx_queue_setup = vmxnet3_dev_tx_queue_setup,
+ .tx_queue_release = vmxnet3_dev_tx_queue_release,
.reta_update = vmxnet3_rss_reta_update,
.reta_query = vmxnet3_rss_reta_query,
};
--
2.30.2
^ permalink raw reply [flat|nested] 38+ messages in thread
* [PATCH v6 5/9] net/vmxnet3: report HW version on FW version get
2022-05-19 8:04 ` [PATCH v6 0/9] net/vmxnet3: support versions 5 and 6 Andrew Rybchenko
` (3 preceding siblings ...)
2022-05-19 8:04 ` [PATCH v6 4/9] net/vmxnet3: fix ethdev callbacks init order Andrew Rybchenko
@ 2022-05-19 8:04 ` Andrew Rybchenko
2022-05-19 8:04 ` [PATCH v6 6/9] net/vmxnet3: add version 6 support Andrew Rybchenko
` (4 subsequent siblings)
9 siblings, 0 replies; 38+ messages in thread
From: Andrew Rybchenko @ 2022-05-19 8:04 UTC (permalink / raw)
To: Pankaj Gupta, Jochen Behrens; +Cc: dev
From: Pankaj Gupta <pagupta@vmware.com>
Support rte_eth_dev_fw_version_get() API.
Tested, using testpmd, for different hardware versions on ESXi 7.0
Update 2.
Signed-off-by: Pankaj Gupta <pagupta@vmware.com>
Reviewed-by: Jochen Behrens <jbehrens@vmware.com>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
---
drivers/net/vmxnet3/vmxnet3_ethdev.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
index e84d304378..62844f3d39 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -85,6 +85,8 @@ static int vmxnet3_dev_xstats_get(struct rte_eth_dev *dev,
struct rte_eth_xstat *xstats, unsigned int n);
static int vmxnet3_dev_info_get(struct rte_eth_dev *dev,
struct rte_eth_dev_info *dev_info);
+static int vmxnet3_hw_ver_get(struct rte_eth_dev *dev,
+ char *fw_version, size_t fw_size);
static const uint32_t *
vmxnet3_dev_supported_ptypes_get(struct rte_eth_dev *dev);
static int vmxnet3_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu);
@@ -103,6 +105,7 @@ 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,
@@ -136,6 +139,7 @@ static const struct eth_dev_ops vmxnet3_eth_dev_ops = {
.xstats_get = vmxnet3_dev_xstats_get,
.xstats_get_names = vmxnet3_dev_xstats_get_names,
.dev_infos_get = vmxnet3_dev_info_get,
+ .fw_version_get = vmxnet3_hw_ver_get,
.dev_supported_ptypes_get = vmxnet3_dev_supported_ptypes_get,
.vlan_filter_set = vmxnet3_dev_vlan_filter_set,
.vlan_offload_set = vmxnet3_dev_vlan_offload_set,
@@ -1410,6 +1414,22 @@ vmxnet3_dev_info_get(struct rte_eth_dev *dev,
return 0;
}
+static int
+vmxnet3_hw_ver_get(struct rte_eth_dev *dev,
+ char *fw_version, size_t fw_size)
+{
+ int ret;
+ struct vmxnet3_hw *hw = dev->data->dev_private;
+
+ ret = snprintf(fw_version, fw_size, "v%d", hw->version);
+
+ ret += 1; /* add the size of '\0' */
+ if (fw_size < (uint32_t)ret)
+ return ret;
+ else
+ return 0;
+}
+
static const uint32_t *
vmxnet3_dev_supported_ptypes_get(struct rte_eth_dev *dev)
{
--
2.30.2
^ permalink raw reply [flat|nested] 38+ messages in thread
* [PATCH v6 6/9] net/vmxnet3: add version 6 support
2022-05-19 8:04 ` [PATCH v6 0/9] net/vmxnet3: support versions 5 and 6 Andrew Rybchenko
` (4 preceding siblings ...)
2022-05-19 8:04 ` [PATCH v6 5/9] net/vmxnet3: report HW version on FW version get Andrew Rybchenko
@ 2022-05-19 8:04 ` Andrew Rybchenko
2022-05-19 8:04 ` [PATCH v6 7/9] net/vmxnet3: advertise RETA size in device info Andrew Rybchenko
` (3 subsequent siblings)
9 siblings, 0 replies; 38+ messages in thread
From: Andrew Rybchenko @ 2022-05-19 8:04 UTC (permalink / raw)
To: Pankaj Gupta, Jochen Behrens; +Cc: dev
From: Pankaj Gupta <pagupta@vmware.com>
VMXNET3 version 6 supports some new features, including but not limited to:
- Increased max MTU up to 9190
- Increased max number of queues, both for Rx and Tx
- Removes power-of-two limitations
- Extended interrupt structures, required implementation for
additional number of queues
Tested, using testpmd, for different hardware versions on ESXi 7.0
Update 2.
Signed-off-by: Pankaj Gupta <pagupta@vmware.com>
Reviewed-by: Jochen Behrens <jbehrens@vmware.com>
---
drivers/net/vmxnet3/base/vmxnet3_defs.h | 73 ++++++--
drivers/net/vmxnet3/vmxnet3_ethdev.c | 220 +++++++++++++++++-------
drivers/net/vmxnet3/vmxnet3_ethdev.h | 10 +-
drivers/net/vmxnet3/vmxnet3_rxtx.c | 2 +-
4 files changed, 226 insertions(+), 79 deletions(-)
diff --git a/drivers/net/vmxnet3/base/vmxnet3_defs.h b/drivers/net/vmxnet3/base/vmxnet3_defs.h
index 8d62b3e116..bd6695e69d 100644
--- a/drivers/net/vmxnet3/base/vmxnet3_defs.h
+++ b/drivers/net/vmxnet3/base/vmxnet3_defs.h
@@ -103,7 +103,11 @@ typedef enum {
VMXNET3_CMD_GET_CONF_INTR,
VMXNET3_CMD_GET_ADAPTIVE_RING_INFO,
VMXNET3_CMD_GET_TXDATA_DESC_SIZE,
- VMXNET3_CMD_RESERVED5,
+ VMXNET3_CMD_RESERVED5,
+ VMXNET3_CMD_RESERVED6,
+ VMXNET3_CMD_RESERVED7,
+ VMXNET3_CMD_RESERVED8,
+ VMXNET3_CMD_GET_MAX_QUEUES_CONF,
} Vmxnet3_Cmd;
/* Adaptive Ring Info Flags */
@@ -571,6 +575,24 @@ enum vmxnet3_intr_type {
/* addition 1 for events */
#define VMXNET3_MAX_INTRS 25
+/* Version 6 and later will use below macros */
+#define VMXNET3_EXT_MAX_TX_QUEUES 32
+#define VMXNET3_EXT_MAX_RX_QUEUES 32
+
+/* Version-dependent MAX RX/TX queues macro */
+#define MAX_RX_QUEUES(hw) \
+ (VMXNET3_VERSION_GE_6((hw)) ? \
+ VMXNET3_EXT_MAX_RX_QUEUES : \
+ VMXNET3_MAX_RX_QUEUES)
+#define MAX_TX_QUEUES(hw) \
+ (VMXNET3_VERSION_GE_6((hw)) ? \
+ VMXNET3_EXT_MAX_TX_QUEUES : \
+ VMXNET3_MAX_TX_QUEUES)
+
+/* addition 1 for events */
+#define VMXNET3_EXT_MAX_INTRS 65
+#define VMXNET3_FIRST_SET_INTRS 64
+
/* value of intrCtrl */
#define VMXNET3_IC_DISABLE_ALL 0x1 /* bit 0 */
@@ -587,6 +609,21 @@ struct Vmxnet3_IntrConf {
#include "vmware_pack_end.h"
Vmxnet3_IntrConf;
+typedef
+#include "vmware_pack_begin.h"
+struct Vmxnet3_IntrConfExt {
+ uint8 autoMask;
+ uint8 numIntrs; /* # of interrupts */
+ uint8 eventIntrIdx;
+ uint8 reserved;
+ __le32 intrCtrl;
+ __le32 reserved1;
+ uint8 modLevels[VMXNET3_EXT_MAX_INTRS]; /* moderation level for each intr */
+ uint8 reserved2[3];
+}
+#include "vmware_pack_end.h"
+Vmxnet3_IntrConfExt;
+
/* one bit per VLAN ID, the size is in the units of uint32 */
#define VMXNET3_VFT_SIZE (4096 / (sizeof(uint32) * 8))
@@ -692,6 +729,15 @@ struct Vmxnet3_DSDevRead {
#include "vmware_pack_end.h"
Vmxnet3_DSDevRead;
+typedef
+#include "vmware_pack_begin.h"
+struct Vmxnet3_DSDevReadExt {
+ /* read-only region for device, read by dev in response to a SET cmd */
+ struct Vmxnet3_IntrConfExt intrConfExt;
+}
+#include "vmware_pack_end.h"
+Vmxnet3_DSDevReadExt;
+
typedef
#include "vmware_pack_begin.h"
struct Vmxnet3_TxQueueDesc {
@@ -778,18 +824,18 @@ Vmxnet3_CmdInfo;
typedef
#include "vmware_pack_begin.h"
struct Vmxnet3_DriverShared {
- __le32 magic;
- __le32 pad; /* make devRead start at 64-bit boundaries */
- Vmxnet3_DSDevRead devRead;
- __le32 ecr;
- __le32 reserved;
-
- union {
- __le32 reserved1[4];
- Vmxnet3_CmdInfo cmdInfo; /* only valid in the context of executing the
- * relevant command
- */
- } cu;
+ __le32 magic;
+ __le32 size; /* size of DriverShared */
+ Vmxnet3_DSDevRead devRead;
+ __le32 ecr;
+ __le32 reserved;
+
+ union {
+ __le32 reserved1[4];
+ /* only valid in the context of executing the relevant command */
+ Vmxnet3_CmdInfo cmdInfo;
+ } cu;
+ struct Vmxnet3_DSDevReadExt devReadExt;
}
#include "vmware_pack_end.h"
Vmxnet3_DriverShared;
@@ -821,6 +867,7 @@ do {\
((vfTable[vid >> 5] & (1 << (vid & 31))) != 0)
#define VMXNET3_MAX_MTU 9000
+#define VMXNET3_V6_MAX_MTU 9190
#define VMXNET3_MIN_MTU 60
#define VMXNET3_LINK_UP (10000 << 16 | 1) // 10 Gbps, up
diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
index 62844f3d39..52309811e5 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -221,24 +221,20 @@ vmxnet3_disable_intr(struct vmxnet3_hw *hw, unsigned int intr_idx)
}
/*
- * Enable all intrs used by the device
+ * Simple helper to get intrCtrl and eventIntrIdx based on config and hw version
*/
static void
-vmxnet3_enable_all_intrs(struct vmxnet3_hw *hw)
+vmxnet3_get_intr_ctrl_ev(struct vmxnet3_hw *hw,
+ uint8 **out_eventIntrIdx,
+ uint32 **out_intrCtrl)
{
- Vmxnet3_DSDevRead *devRead = &hw->shared->devRead;
-
- PMD_INIT_FUNC_TRACE();
- devRead->intrConf.intrCtrl &= rte_cpu_to_le_32(~VMXNET3_IC_DISABLE_ALL);
-
- if (hw->intr.lsc_only) {
- vmxnet3_enable_intr(hw, devRead->intrConf.eventIntrIdx);
+ if (VMXNET3_VERSION_GE_6(hw) && hw->queuesExtEnabled) {
+ *out_eventIntrIdx = &hw->shared->devReadExt.intrConfExt.eventIntrIdx;
+ *out_intrCtrl = &hw->shared->devReadExt.intrConfExt.intrCtrl;
} else {
- int i;
-
- for (i = 0; i < hw->intr.num_intrs; i++)
- vmxnet3_enable_intr(hw, i);
+ *out_eventIntrIdx = &hw->shared->devRead.intrConf.eventIntrIdx;
+ *out_intrCtrl = &hw->shared->devRead.intrConf.intrCtrl;
}
}
@@ -249,15 +245,42 @@ static void
vmxnet3_disable_all_intrs(struct vmxnet3_hw *hw)
{
int i;
+ uint8 *eventIntrIdx;
+ uint32 *intrCtrl;
PMD_INIT_FUNC_TRACE();
+ vmxnet3_get_intr_ctrl_ev(hw, &eventIntrIdx, &intrCtrl);
+
+ *intrCtrl |= rte_cpu_to_le_32(VMXNET3_IC_DISABLE_ALL);
- hw->shared->devRead.intrConf.intrCtrl |=
- rte_cpu_to_le_32(VMXNET3_IC_DISABLE_ALL);
- for (i = 0; i < hw->num_intrs; i++)
+ for (i = 0; i < hw->intr.num_intrs; i++)
vmxnet3_disable_intr(hw, i);
}
+/*
+ * Enable all intrs used by the device
+ */
+static void
+vmxnet3_enable_all_intrs(struct vmxnet3_hw *hw)
+{
+ uint8 *eventIntrIdx;
+ uint32 *intrCtrl;
+
+ PMD_INIT_FUNC_TRACE();
+ vmxnet3_get_intr_ctrl_ev(hw, &eventIntrIdx, &intrCtrl);
+
+ *intrCtrl &= rte_cpu_to_le_32(~VMXNET3_IC_DISABLE_ALL);
+
+ if (hw->intr.lsc_only) {
+ vmxnet3_enable_intr(hw, *eventIntrIdx);
+ } else {
+ int i;
+
+ for (i = 0; i < hw->intr.num_intrs; i++)
+ vmxnet3_enable_intr(hw, i);
+ }
+}
+
/*
* Gets tx data ring descriptor size.
*/
@@ -332,7 +355,11 @@ eth_vmxnet3_dev_init(struct rte_eth_dev *eth_dev)
/* Check h/w version compatibility with driver. */
ver = VMXNET3_READ_BAR1_REG(hw, VMXNET3_REG_VRRS);
- if (ver & (1 << VMXNET3_REV_5)) {
+ if (ver & (1 << VMXNET3_REV_6)) {
+ VMXNET3_WRITE_BAR1_REG(hw, VMXNET3_REG_VRRS,
+ 1 << VMXNET3_REV_6);
+ hw->version = VMXNET3_REV_6 + 1;
+ } else if (ver & (1 << VMXNET3_REV_5)) {
VMXNET3_WRITE_BAR1_REG(hw, VMXNET3_REG_VRRS,
1 << VMXNET3_REV_5);
hw->version = VMXNET3_REV_5 + 1;
@@ -507,15 +534,22 @@ vmxnet3_dev_configure(struct rte_eth_dev *dev)
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->nb_tx_queues > VMXNET3_MAX_TX_QUEUES ||
- dev->data->nb_rx_queues > VMXNET3_MAX_RX_QUEUES) {
- PMD_INIT_LOG(ERR, "ERROR: Number of queues not supported");
- return -EINVAL;
+ if (!VMXNET3_VERSION_GE_6(hw)) {
+ if (!rte_is_power_of_2(dev->data->nb_rx_queues)) {
+ PMD_INIT_LOG(ERR,
+ "ERROR: Number of rx queues not power of 2");
+ return -EINVAL;
+ }
}
- if (!rte_is_power_of_2(dev->data->nb_rx_queues)) {
- PMD_INIT_LOG(ERR, "ERROR: Number of rx queues not power of 2");
- return -EINVAL;
+ /* At this point, the number of queues requested has already
+ * been validated against dev_infos max queues by EAL
+ */
+ if (dev->data->nb_rx_queues > VMXNET3_MAX_RX_QUEUES ||
+ dev->data->nb_tx_queues > VMXNET3_MAX_TX_QUEUES) {
+ hw->queuesExtEnabled = 1;
+ } else {
+ hw->queuesExtEnabled = 0;
}
size = dev->data->nb_rx_queues * sizeof(struct Vmxnet3_TxQueueDesc) +
@@ -626,9 +660,9 @@ vmxnet3_configure_msix(struct rte_eth_dev *dev)
return -1;
intr_vector = dev->data->nb_rx_queues;
- if (intr_vector > VMXNET3_MAX_RX_QUEUES) {
+ if (intr_vector > MAX_RX_QUEUES(hw)) {
PMD_INIT_LOG(ERR, "At most %d intr queues supported",
- VMXNET3_MAX_RX_QUEUES);
+ MAX_RX_QUEUES(hw));
return -ENOTSUP;
}
@@ -776,6 +810,7 @@ vmxnet3_setup_driver_shared(struct rte_eth_dev *dev)
uint32_t mtu = dev->data->mtu;
Vmxnet3_DriverShared *shared = hw->shared;
Vmxnet3_DSDevRead *devRead = &shared->devRead;
+ struct Vmxnet3_DSDevReadExt *devReadExt = &shared->devReadExt;
uint64_t rx_offloads = dev->data->dev_conf.rxmode.offloads;
uint32_t i;
int ret;
@@ -852,13 +887,27 @@ vmxnet3_setup_driver_shared(struct rte_eth_dev *dev)
}
/* intr settings */
- devRead->intrConf.autoMask = hw->intr.mask_mode == VMXNET3_IMM_AUTO;
- devRead->intrConf.numIntrs = hw->intr.num_intrs;
- for (i = 0; i < hw->intr.num_intrs; i++)
- devRead->intrConf.modLevels[i] = hw->intr.mod_levels[i];
+ if (VMXNET3_VERSION_GE_6(hw) && hw->queuesExtEnabled) {
+ devReadExt->intrConfExt.autoMask = hw->intr.mask_mode ==
+ VMXNET3_IMM_AUTO;
+ devReadExt->intrConfExt.numIntrs = hw->intr.num_intrs;
+ for (i = 0; i < hw->intr.num_intrs; i++)
+ devReadExt->intrConfExt.modLevels[i] =
+ hw->intr.mod_levels[i];
+
+ devReadExt->intrConfExt.eventIntrIdx = hw->intr.event_intr_idx;
+ devReadExt->intrConfExt.intrCtrl |=
+ rte_cpu_to_le_32(VMXNET3_IC_DISABLE_ALL);
+ } else {
+ devRead->intrConf.autoMask = hw->intr.mask_mode ==
+ VMXNET3_IMM_AUTO;
+ devRead->intrConf.numIntrs = hw->intr.num_intrs;
+ for (i = 0; i < hw->intr.num_intrs; i++)
+ devRead->intrConf.modLevels[i] = hw->intr.mod_levels[i];
- devRead->intrConf.eventIntrIdx = hw->intr.event_intr_idx;
- devRead->intrConf.intrCtrl |= rte_cpu_to_le_32(VMXNET3_IC_DISABLE_ALL);
+ devRead->intrConf.eventIntrIdx = hw->intr.event_intr_idx;
+ devRead->intrConf.intrCtrl |= rte_cpu_to_le_32(VMXNET3_IC_DISABLE_ALL);
+ }
/* RxMode set to 0 of VMXNET3_RXM_xxx */
devRead->rxFilterConf.rxMode = 0;
@@ -936,18 +985,24 @@ vmxnet3_dev_start(struct rte_eth_dev *dev)
return -EINVAL;
}
- /* Setup memory region for rx buffers */
- ret = vmxnet3_dev_setup_memreg(dev);
- if (ret == 0) {
- VMXNET3_WRITE_BAR1_REG(hw, VMXNET3_REG_CMD,
- VMXNET3_CMD_REGISTER_MEMREGS);
- ret = VMXNET3_READ_BAR1_REG(hw, VMXNET3_REG_CMD);
- if (ret != 0)
- PMD_INIT_LOG(DEBUG,
- "Failed in setup memory region cmd\n");
- ret = 0;
+ /* Check memregs restrictions first */
+ if (dev->data->nb_rx_queues <= VMXNET3_MAX_RX_QUEUES &&
+ dev->data->nb_tx_queues <= VMXNET3_MAX_TX_QUEUES) {
+ ret = vmxnet3_dev_setup_memreg(dev);
+ if (ret == 0) {
+ VMXNET3_WRITE_BAR1_REG(hw, VMXNET3_REG_CMD,
+ VMXNET3_CMD_REGISTER_MEMREGS);
+ ret = VMXNET3_READ_BAR1_REG(hw, VMXNET3_REG_CMD);
+ if (ret != 0)
+ PMD_INIT_LOG(DEBUG,
+ "Failed in setup memory region cmd\n");
+ ret = 0;
+ } else {
+ PMD_INIT_LOG(DEBUG, "Failed to setup memory region\n");
+ }
} else {
- PMD_INIT_LOG(DEBUG, "Failed to setup memory region\n");
+ PMD_INIT_LOG(WARNING, "Memregs can't init (rx: %d, tx: %d)",
+ dev->data->nb_rx_queues, dev->data->nb_tx_queues);
}
if (VMXNET3_VERSION_GE_4(hw) &&
@@ -1202,8 +1257,6 @@ vmxnet3_hw_stats_save(struct vmxnet3_hw *hw)
VMXNET3_WRITE_BAR1_REG(hw, VMXNET3_REG_CMD, VMXNET3_CMD_GET_STATS);
- RTE_BUILD_BUG_ON(RTE_ETHDEV_QUEUE_STAT_CNTRS < VMXNET3_MAX_TX_QUEUES);
-
for (i = 0; i < hw->num_tx_queues; i++)
vmxnet3_hw_tx_stats_get(hw, i, &hw->saved_tx_stats[i]);
for (i = 0; i < hw->num_rx_queues; i++)
@@ -1305,7 +1358,6 @@ vmxnet3_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
VMXNET3_WRITE_BAR1_REG(hw, VMXNET3_REG_CMD, VMXNET3_CMD_GET_STATS);
- RTE_BUILD_BUG_ON(RTE_ETHDEV_QUEUE_STAT_CNTRS < VMXNET3_MAX_TX_QUEUES);
for (i = 0; i < hw->num_tx_queues; i++) {
vmxnet3_tx_stats_get(hw, i, &txStats);
@@ -1322,7 +1374,6 @@ vmxnet3_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
stats->oerrors += txStats.pktsTxError + txStats.pktsTxDiscard;
}
- RTE_BUILD_BUG_ON(RTE_ETHDEV_QUEUE_STAT_CNTRS < VMXNET3_MAX_RX_QUEUES);
for (i = 0; i < hw->num_rx_queues; i++) {
vmxnet3_rx_stats_get(hw, i, &rxStats);
@@ -1376,9 +1427,27 @@ vmxnet3_dev_info_get(struct rte_eth_dev *dev,
struct rte_eth_dev_info *dev_info)
{
struct vmxnet3_hw *hw = dev->data->dev_private;
+ int queues = 0;
+
+ if (VMXNET3_VERSION_GE_6(hw)) {
+ VMXNET3_WRITE_BAR1_REG(hw, VMXNET3_REG_CMD,
+ VMXNET3_CMD_GET_MAX_QUEUES_CONF);
+ queues = VMXNET3_READ_BAR1_REG(hw, VMXNET3_REG_CMD);
+
+ if (queues > 0) {
+ dev_info->max_rx_queues =
+ RTE_MIN(VMXNET3_EXT_MAX_RX_QUEUES, ((queues >> 8) & 0xff));
+ dev_info->max_tx_queues =
+ RTE_MIN(VMXNET3_EXT_MAX_TX_QUEUES, (queues & 0xff));
+ } else {
+ dev_info->max_rx_queues = VMXNET3_MAX_RX_QUEUES;
+ dev_info->max_tx_queues = VMXNET3_MAX_TX_QUEUES;
+ }
+ } else {
+ dev_info->max_rx_queues = VMXNET3_MAX_RX_QUEUES;
+ dev_info->max_tx_queues = VMXNET3_MAX_TX_QUEUES;
+ }
- dev_info->max_rx_queues = VMXNET3_MAX_RX_QUEUES;
- dev_info->max_tx_queues = VMXNET3_MAX_TX_QUEUES;
dev_info->min_rx_bufsize = 1518 + RTE_PKTMBUF_HEADROOM;
dev_info->max_rx_pktlen = 16384; /* includes CRC, cf MAXFRS register */
dev_info->min_mtu = VMXNET3_MIN_MTU;
@@ -1445,24 +1514,50 @@ vmxnet3_dev_supported_ptypes_get(struct rte_eth_dev *dev)
}
static int
-vmxnet3_dev_mtu_set(struct rte_eth_dev *dev, __rte_unused uint16_t mtu)
+vmxnet3_mac_addr_set(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr)
{
- if (dev->data->dev_started) {
- PMD_DRV_LOG(ERR, "Port %d must be stopped to configure MTU",
- dev->data->port_id);
- return -EBUSY;
- }
+ struct vmxnet3_hw *hw = dev->data->dev_private;
+ rte_ether_addr_copy(mac_addr, (struct rte_ether_addr *)(hw->perm_addr));
+ vmxnet3_write_mac(hw, mac_addr->addr_bytes);
return 0;
}
static int
-vmxnet3_mac_addr_set(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr)
+vmxnet3_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
{
struct vmxnet3_hw *hw = dev->data->dev_private;
+ uint32_t frame_size = mtu + RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN + 4;
+
+ if (mtu < VMXNET3_MIN_MTU)
+ return -EINVAL;
+
+ if (VMXNET3_VERSION_GE_6(hw)) {
+ if (mtu > VMXNET3_V6_MAX_MTU)
+ return -EINVAL;
+ } else {
+ if (mtu > VMXNET3_MAX_MTU) {
+ PMD_DRV_LOG(ERR, "MTU %d too large in device version v%d",
+ mtu, hw->version);
+ return -EINVAL;
+ }
+ }
+
+ dev->data->mtu = mtu;
+ /* update max frame size */
+ dev->data->dev_conf.rxmode.mtu = frame_size;
+
+ if (dev->data->dev_started == 0)
+ return 0;
+
+ /* changing mtu for vmxnet3 pmd does not require a restart
+ * as it does not need to repopulate the rx rings to support
+ * different mtu size. We stop and restart the device here
+ * just to pass the mtu info to the backend.
+ */
+ vmxnet3_dev_stop(dev);
+ vmxnet3_dev_start(dev);
- rte_ether_addr_copy(mac_addr, (struct rte_ether_addr *)(hw->perm_addr));
- vmxnet3_write_mac(hw, mac_addr->addr_bytes);
return 0;
}
@@ -1683,11 +1778,14 @@ vmxnet3_interrupt_handler(void *param)
{
struct rte_eth_dev *dev = param;
struct vmxnet3_hw *hw = dev->data->dev_private;
- Vmxnet3_DSDevRead *devRead = &hw->shared->devRead;
uint32_t events;
+ uint8 *eventIntrIdx;
+ uint32 *intrCtrl;
PMD_INIT_FUNC_TRACE();
- vmxnet3_disable_intr(hw, devRead->intrConf.eventIntrIdx);
+
+ vmxnet3_get_intr_ctrl_ev(hw, &eventIntrIdx, &intrCtrl);
+ vmxnet3_disable_intr(hw, *eventIntrIdx);
events = VMXNET3_READ_BAR1_REG(hw, VMXNET3_REG_ECR);
if (events == 0)
@@ -1696,7 +1794,7 @@ vmxnet3_interrupt_handler(void *param)
RTE_LOG(DEBUG, PMD, "Reading events: 0x%X", events);
vmxnet3_process_events(dev);
done:
- vmxnet3_enable_intr(hw, devRead->intrConf.eventIntrIdx);
+ vmxnet3_enable_intr(hw, *eventIntrIdx);
}
static int
diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.h b/drivers/net/vmxnet3/vmxnet3_ethdev.h
index ceaeb66392..5a303717b1 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.h
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.h
@@ -70,7 +70,7 @@ struct vmxnet3_intr {
enum vmxnet3_intr_type type; /* MSI-X, MSI, or INTx? */
uint8_t num_intrs; /* # of intr vectors */
uint8_t event_intr_idx; /* idx of the intr vector for event */
- uint8_t mod_levels[VMXNET3_MAX_MSIX_VECT]; /* moderation level */
+ uint8_t mod_levels[VMXNET3_EXT_MAX_INTRS]; /* moderation level */
bool lsc_only; /* no Rx queue interrupt */
};
@@ -108,6 +108,7 @@ struct vmxnet3_hw {
uint64_t queueDescPA;
uint16_t queue_desc_len;
uint16_t mtu;
+ bool queuesExtEnabled;
VMXNET3_RSSConf *rss_conf;
uint64_t rss_confPA;
@@ -117,19 +118,20 @@ struct vmxnet3_hw {
Vmxnet3_MemRegs *memRegs;
uint64_t memRegsPA;
#define VMXNET3_VFT_TABLE_SIZE (VMXNET3_VFT_SIZE * sizeof(uint32_t))
- UPT1_TxStats saved_tx_stats[VMXNET3_MAX_TX_QUEUES];
- UPT1_RxStats saved_rx_stats[VMXNET3_MAX_RX_QUEUES];
-
+ UPT1_TxStats saved_tx_stats[VMXNET3_EXT_MAX_TX_QUEUES];
+ UPT1_RxStats saved_rx_stats[VMXNET3_EXT_MAX_RX_QUEUES];
UPT1_TxStats snapshot_tx_stats[VMXNET3_MAX_TX_QUEUES];
UPT1_RxStats snapshot_rx_stats[VMXNET3_MAX_RX_QUEUES];
};
+#define VMXNET3_REV_6 5 /* Vmxnet3 Rev. 6 */
#define VMXNET3_REV_5 4 /* Vmxnet3 Rev. 5 */
#define VMXNET3_REV_4 3 /* Vmxnet3 Rev. 4 */
#define VMXNET3_REV_3 2 /* Vmxnet3 Rev. 3 */
#define VMXNET3_REV_2 1 /* Vmxnet3 Rev. 2 */
#define VMXNET3_REV_1 0 /* Vmxnet3 Rev. 1 */
+#define VMXNET3_VERSION_GE_6(hw) ((hw)->version >= VMXNET3_REV_6 + 1)
#define VMXNET3_VERSION_GE_5(hw) ((hw)->version >= VMXNET3_REV_5 + 1)
#define VMXNET3_VERSION_GE_4(hw) ((hw)->version >= VMXNET3_REV_4 + 1)
#define VMXNET3_VERSION_GE_3(hw) ((hw)->version >= VMXNET3_REV_3 + 1)
diff --git a/drivers/net/vmxnet3/vmxnet3_rxtx.c b/drivers/net/vmxnet3/vmxnet3_rxtx.c
index e15b377d8c..c94e3762e6 100644
--- a/drivers/net/vmxnet3/vmxnet3_rxtx.c
+++ b/drivers/net/vmxnet3/vmxnet3_rxtx.c
@@ -1400,7 +1400,7 @@ vmxnet3_rss_configure(struct rte_eth_dev *dev)
/* loading hashKeySize */
dev_rss_conf->hashKeySize = VMXNET3_RSS_MAX_KEY_SIZE;
/* loading indTableSize: Must not exceed VMXNET3_RSS_MAX_IND_TABLE_SIZE (128)*/
- dev_rss_conf->indTableSize = (uint16_t)(hw->num_rx_queues * 4);
+ dev_rss_conf->indTableSize = (uint16_t)((MAX_RX_QUEUES(hw)) * 4);
if (port_rss_conf->rss_key == NULL) {
/* Default hash key */
--
2.30.2
^ permalink raw reply [flat|nested] 38+ messages in thread
* [PATCH v6 7/9] net/vmxnet3: advertise RETA size in device info
2022-05-19 8:04 ` [PATCH v6 0/9] net/vmxnet3: support versions 5 and 6 Andrew Rybchenko
` (5 preceding siblings ...)
2022-05-19 8:04 ` [PATCH v6 6/9] net/vmxnet3: add version 6 support Andrew Rybchenko
@ 2022-05-19 8:04 ` Andrew Rybchenko
2022-05-19 8:04 ` [PATCH v6 8/9] net/vmxnet3: set packet type for fragmented packet Andrew Rybchenko
` (2 subsequent siblings)
9 siblings, 0 replies; 38+ messages in thread
From: Andrew Rybchenko @ 2022-05-19 8:04 UTC (permalink / raw)
To: Pankaj Gupta, Jochen Behrens; +Cc: dev
From: Pankaj Gupta <pagupta@vmware.com>
Currently the driver assumes that the size of the RETA table is
four times the number of Rx queues at multiple places. However,
it sets it to four times the maximum number of queues (4 * 32 = 128)
when it first initializes the device. Change the other uses to use
the stored value, not the assumed default.
Tested, using testpmd, for different hardware versions on ESXi 7.0
Update 2.
Signed-off-by: Pankaj Gupta <pagupta@vmware.com>
Reviewed-by: Jochen Behrens <jbehrens@vmware.com>
---
drivers/net/vmxnet3/vmxnet3_ethdev.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
index 52309811e5..c9e352b73a 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -1479,7 +1479,12 @@ vmxnet3_dev_info_get(struct rte_eth_dev *dev,
dev_info->rx_queue_offload_capa = 0;
dev_info->tx_offload_capa = VMXNET3_TX_OFFLOAD_CAP;
dev_info->tx_queue_offload_capa = 0;
-
+ if (hw->rss_conf == NULL) {
+ /* RSS not configured */
+ dev_info->reta_size = 0;
+ } else {
+ dev_info->reta_size = hw->rss_conf->indTableSize;
+ }
return 0;
}
--
2.30.2
^ permalink raw reply [flat|nested] 38+ messages in thread
* [PATCH v6 8/9] net/vmxnet3: set packet type for fragmented packet
2022-05-19 8:04 ` [PATCH v6 0/9] net/vmxnet3: support versions 5 and 6 Andrew Rybchenko
` (6 preceding siblings ...)
2022-05-19 8:04 ` [PATCH v6 7/9] net/vmxnet3: advertise RETA size in device info Andrew Rybchenko
@ 2022-05-19 8:04 ` Andrew Rybchenko
2022-05-19 8:04 ` [PATCH v6 9/9] net/vmxnet3: fix merge error in Rx data ring initialization Andrew Rybchenko
2022-05-19 8:07 ` [PATCH v6 0/9] net/vmxnet3: support versions 5 and 6 Andrew Rybchenko
9 siblings, 0 replies; 38+ messages in thread
From: Andrew Rybchenko @ 2022-05-19 8:04 UTC (permalink / raw)
To: Pankaj Gupta, Jochen Behrens; +Cc: dev
From: Pankaj Gupta <pagupta@vmware.com>
The packet type is set even if it is a fragmented packet.
Tested, using testpmd, for different hardware versions on ESXi 7.0
Update 2.
Signed-off-by: Pankaj Gupta <pagupta@vmware.com>
Reviewed-by: Jochen Behrens <jbehrens@vmware.com>
---
drivers/net/vmxnet3/vmxnet3_rxtx.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/drivers/net/vmxnet3/vmxnet3_rxtx.c b/drivers/net/vmxnet3/vmxnet3_rxtx.c
index c94e3762e6..a875ffec07 100644
--- a/drivers/net/vmxnet3/vmxnet3_rxtx.c
+++ b/drivers/net/vmxnet3/vmxnet3_rxtx.c
@@ -759,6 +759,23 @@ vmxnet3_rx_offload(struct vmxnet3_hw *hw, const Vmxnet3_RxCompDesc *rcd,
/* Check packet type, checksum errors, etc. */
if (rcd->cnc) {
ol_flags |= RTE_MBUF_F_RX_L4_CKSUM_UNKNOWN;
+
+ if (rcd->v4) {
+ packet_type |= RTE_PTYPE_L3_IPV4_EXT_UNKNOWN;
+ if (rcd->tcp)
+ packet_type |= RTE_PTYPE_L4_TCP;
+ else if (rcd->udp)
+ packet_type |= RTE_PTYPE_L4_UDP;
+ } else if (rcd->v6) {
+ packet_type |= RTE_PTYPE_L3_IPV6_EXT_UNKNOWN;
+ if (rcd->tcp)
+ packet_type |= RTE_PTYPE_L4_TCP;
+ else if (rcd->udp)
+ packet_type |= RTE_PTYPE_L4_UDP;
+ } else {
+ packet_type |= RTE_PTYPE_UNKNOWN;
+ }
+
} else {
if (rcd->v4) {
packet_type |= RTE_PTYPE_L3_IPV4_EXT_UNKNOWN;
--
2.30.2
^ permalink raw reply [flat|nested] 38+ messages in thread
* [PATCH v6 9/9] net/vmxnet3: fix merge error in Rx data ring initialization
2022-05-19 8:04 ` [PATCH v6 0/9] net/vmxnet3: support versions 5 and 6 Andrew Rybchenko
` (7 preceding siblings ...)
2022-05-19 8:04 ` [PATCH v6 8/9] net/vmxnet3: set packet type for fragmented packet Andrew Rybchenko
@ 2022-05-19 8:04 ` Andrew Rybchenko
2022-05-19 8:07 ` [PATCH v6 0/9] net/vmxnet3: support versions 5 and 6 Andrew Rybchenko
9 siblings, 0 replies; 38+ messages in thread
From: Andrew Rybchenko @ 2022-05-19 8:04 UTC (permalink / raw)
To: Pankaj Gupta, Jochen Behrens, Yong Wang; +Cc: dev, stable
From: Pankaj Gupta <pagupta@vmware.com>
Tested, using testpmd, for different hardware versions on ESXi 7.0
Update 2.
Fixes: 046f11619567 ("net/vmxnet3: support MSI-X interrupt")
Cc: stable@dpdk.org
Signed-off-by: Pankaj Gupta <pagupta@vmware.com>
Reviewed-by: Jochen Behrens <jbehrens@vmware.com>
---
drivers/net/vmxnet3/vmxnet3_ethdev.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
index c9e352b73a..2af67dc0a3 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -875,6 +875,11 @@ vmxnet3_setup_driver_shared(struct rte_eth_dev *dev)
rqd->conf.rxRingSize[1] = rxq->cmd_ring[1].size;
rqd->conf.compRingSize = rxq->comp_ring.size;
+ if (VMXNET3_VERSION_GE_3(hw)) {
+ rqd->conf.rxDataRingBasePA = rxq->data_ring.basePA;
+ rqd->conf.rxDataRingDescSize = rxq->data_desc_size;
+ }
+
if (hw->intr.lsc_only)
rqd->conf.intrIdx = 1;
else
--
2.30.2
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [PATCH v6 0/9] net/vmxnet3: support versions 5 and 6
2022-05-19 8:04 ` [PATCH v6 0/9] net/vmxnet3: support versions 5 and 6 Andrew Rybchenko
` (8 preceding siblings ...)
2022-05-19 8:04 ` [PATCH v6 9/9] net/vmxnet3: fix merge error in Rx data ring initialization Andrew Rybchenko
@ 2022-05-19 8:07 ` Andrew Rybchenko
2022-05-23 20:56 ` Pankaj Gupta
9 siblings, 1 reply; 38+ messages in thread
From: Andrew Rybchenko @ 2022-05-19 8:07 UTC (permalink / raw)
To: Pankaj Gupta, Jochen Behrens; +Cc: dev
Hi Pankaj,
I did final cleanup before applying the patch series, but
realized that release notes update is missing.
Please, pick up my changes and amend patches which support
new features with release notes update in the documentation.
Everything else LGTM now.
Thanks,
Andrew.
On 5/19/22 11:04, Andrew Rybchenko wrote:
> v6 (Andrew Rybchenko):
> Minor style changes in patches description
> Split FW version get patch to have callbacks reorder seperately
> Minor fix in FW version get patch to put callback definition,
> assignment and implementation just after device info get
>
> v5:
> Use RTE_MIN instead of defining MIN in drivers/net/vmxnet3/vmxnet3_ethdev.c
> User RETA instead of reta in commit message
> Fix the issue thrown by checkpatches.sh in file drivers/net/vmxnet3/vmxnet3_ethdev.c
>
> v4:
> Changing the subject for [Patch 8/8] from "net/vmxnet3: fix merge error
> in initialization for rxDataRing feature" to
> "Fixes: 046f11619567 ("net/vmxnet3: support MSI-X interrupt")"
>
> v3:
> adding Reviewed-by info in all the patches
>
> v2:
> address review comments from Andrew Rybchenko andrew.rybchenko@oktetlabs.ru
>
> Pankaj Gupta (9):
> net/vmxnet3: add version 5 support
> net/vmxnet3: implement RETA query and RETA update
> net/vmxnet3: add Rx queue usage count utility
> net/vmxnet3: fix ethdev callbacks init order
> net/vmxnet3: report HW version on FW version get
> net/vmxnet3: add version 6 support
> net/vmxnet3: advertise RETA size in device info
> net/vmxnet3: set packet type for fragmented packet
> net/vmxnet3: fix merge error in Rx data ring initialization
>
> drivers/net/vmxnet3/base/vmxnet3_defs.h | 73 ++++-
> drivers/net/vmxnet3/vmxnet3_ethdev.c | 339 +++++++++++++++++++-----
> drivers/net/vmxnet3/vmxnet3_ethdev.h | 15 +-
> drivers/net/vmxnet3/vmxnet3_rxtx.c | 49 +++-
> 4 files changed, 388 insertions(+), 88 deletions(-)
>
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [PATCH v6 0/9] net/vmxnet3: support versions 5 and 6
2022-05-19 8:07 ` [PATCH v6 0/9] net/vmxnet3: support versions 5 and 6 Andrew Rybchenko
@ 2022-05-23 20:56 ` Pankaj Gupta
2022-05-24 6:46 ` Andrew Rybchenko
0 siblings, 1 reply; 38+ messages in thread
From: Pankaj Gupta @ 2022-05-23 20:56 UTC (permalink / raw)
To: Andrew Rybchenko, Jochen Behrens; +Cc: dev
[-- Attachment #1: Type: text/plain, Size: 2810 bytes --]
Hi Andrew,
New features were introduced in following two patches so I will update release_22_07.rst for these two patches.
[PATCH v6 1/9] net/vmxnet3: add version 5 support
[PATCH v6 6/9] net/vmxnet3: add version 6 support
Let me know if I am missing anything.
Thanks,
Pankaj
From: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Date: Thursday, May 19, 2022 at 1:07 AM
To: Pankaj Gupta <pagupta@vmware.com>, Jochen Behrens <jbehrens@vmware.com>
Cc: dev@dpdk.org <dev@dpdk.org>
Subject: Re: [PATCH v6 0/9] net/vmxnet3: support versions 5 and 6
⚠ External Email
Hi Pankaj,
I did final cleanup before applying the patch series, but
realized that release notes update is missing.
Please, pick up my changes and amend patches which support
new features with release notes update in the documentation.
Everything else LGTM now.
Thanks,
Andrew.
On 5/19/22 11:04, Andrew Rybchenko wrote:
> v6 (Andrew Rybchenko):
> Minor style changes in patches description
> Split FW version get patch to have callbacks reorder seperately
> Minor fix in FW version get patch to put callback definition,
> assignment and implementation just after device info get
>
> v5:
> Use RTE_MIN instead of defining MIN in drivers/net/vmxnet3/vmxnet3_ethdev.c
> User RETA instead of reta in commit message
> Fix the issue thrown by checkpatches.sh in file drivers/net/vmxnet3/vmxnet3_ethdev.c
>
> v4:
> Changing the subject for [Patch 8/8] from "net/vmxnet3: fix merge error
> in initialization for rxDataRing feature" to
> "Fixes: 046f11619567 ("net/vmxnet3: support MSI-X interrupt")"
>
> v3:
> adding Reviewed-by info in all the patches
>
> v2:
> address review comments from Andrew Rybchenko andrew.rybchenko@oktetlabs.ru
>
> Pankaj Gupta (9):
> net/vmxnet3: add version 5 support
> net/vmxnet3: implement RETA query and RETA update
> net/vmxnet3: add Rx queue usage count utility
> net/vmxnet3: fix ethdev callbacks init order
> net/vmxnet3: report HW version on FW version get
> net/vmxnet3: add version 6 support
> net/vmxnet3: advertise RETA size in device info
> net/vmxnet3: set packet type for fragmented packet
> net/vmxnet3: fix merge error in Rx data ring initialization
>
> drivers/net/vmxnet3/base/vmxnet3_defs.h | 73 ++++-
> drivers/net/vmxnet3/vmxnet3_ethdev.c | 339 +++++++++++++++++++-----
> drivers/net/vmxnet3/vmxnet3_ethdev.h | 15 +-
> drivers/net/vmxnet3/vmxnet3_rxtx.c | 49 +++-
> 4 files changed, 388 insertions(+), 88 deletions(-)
>
________________________________
⚠ External Email: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender.
[-- Attachment #2: Type: text/html, Size: 7108 bytes --]
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [PATCH v6 0/9] net/vmxnet3: support versions 5 and 6
2022-05-23 20:56 ` Pankaj Gupta
@ 2022-05-24 6:46 ` Andrew Rybchenko
0 siblings, 0 replies; 38+ messages in thread
From: Andrew Rybchenko @ 2022-05-24 6:46 UTC (permalink / raw)
To: Pankaj Gupta, Jochen Behrens; +Cc: dev
Hi Pankai,
I'd consider a patch which adds RETA controls as well. IMHO it
is a major feature which could be interesting to end users.
Regards,
Andrew.
On 5/23/22 23:56, Pankaj Gupta wrote:
> Hi Andrew,
>
> New features were introduced in following two patches so I will update
> release_22_07.rst for these two patches.
>
> [PATCH v6 1/9] net/vmxnet3: add version 5 support
>
> [PATCH v6 6/9] net/vmxnet3: add version 6 support
>
> Let me know if I am missing anything.
>
> Thanks,
>
> Pankaj
>
> *From: *Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
> *Date: *Thursday, May 19, 2022 at 1:07 AM
> *To: *Pankaj Gupta <pagupta@vmware.com>, Jochen Behrens
> <jbehrens@vmware.com>
> *Cc: *dev@dpdk.org <dev@dpdk.org>
> *Subject: *Re: [PATCH v6 0/9] net/vmxnet3: support versions 5 and 6
>
> ⚠External Email
>
> Hi Pankaj,
>
> I did final cleanup before applying the patch series, but
> realized that release notes update is missing.
> Please, pick up my changes and amend patches which support
> new features with release notes update in the documentation.
>
> Everything else LGTM now.
>
> Thanks,
> Andrew.
>
> On 5/19/22 11:04, Andrew Rybchenko wrote:
>> v6 (Andrew Rybchenko):
>> Minor style changes in patches description
>> Split FW version get patch to have callbacks reorder seperately
>> Minor fix in FW version get patch to put callback definition,
>> assignment and implementation just after device info get
>>
>> v5:
>> Use RTE_MIN instead of defining MIN in drivers/net/vmxnet3/vmxnet3_ethdev.c
>> User RETA instead of reta in commit message
>> Fix the issue thrown by checkpatches.sh in file drivers/net/vmxnet3/vmxnet3_ethdev.c
>>
>> v4:
>> Changing the subject for [Patch 8/8] from "net/vmxnet3: fix merge error
>> in initialization for rxDataRing feature" to
>> "Fixes: 046f11619567 ("net/vmxnet3: support MSI-X interrupt")"
>>
>> v3:
>> adding Reviewed-by info in all the patches
>>
>> v2:
>> address review comments from Andrew Rybchenko andrew.rybchenko@oktetlabs.ru
>>
>> Pankaj Gupta (9):
>> net/vmxnet3: add version 5 support
>> net/vmxnet3: implement RETA query and RETA update
>> net/vmxnet3: add Rx queue usage count utility
>> net/vmxnet3: fix ethdev callbacks init order
>> net/vmxnet3: report HW version on FW version get
>> net/vmxnet3: add version 6 support
>> net/vmxnet3: advertise RETA size in device info
>> net/vmxnet3: set packet type for fragmented packet
>> net/vmxnet3: fix merge error in Rx data ring initialization
>>
>> drivers/net/vmxnet3/base/vmxnet3_defs.h | 73 ++++-
>> drivers/net/vmxnet3/vmxnet3_ethdev.c | 339 +++++++++++++++++++-----
>> drivers/net/vmxnet3/vmxnet3_ethdev.h | 15 +-
>> drivers/net/vmxnet3/vmxnet3_rxtx.c | 49 +++-
>> 4 files changed, 388 insertions(+), 88 deletions(-)
>>
>
>
> ________________________________
>
> ⚠External Email: This email originated from outside of the organization.
> Do not click links or open attachments unless you recognize the sender.
>
^ permalink raw reply [flat|nested] 38+ messages in thread
* [PATCH 3/8] vmxnet3: add rx queue usage count utility
2022-05-02 19:45 [PATCH 0/8] vmxnet3: V5 and V6 Pankaj Gupta
@ 2022-05-02 19:45 ` Pankaj Gupta
0 siblings, 0 replies; 38+ messages in thread
From: Pankaj Gupta @ 2022-05-02 19:45 UTC (permalink / raw)
To: jbehrens, yongwang; +Cc: dev, pagupta
Count the number of entries in the rx queue for debugging.
Tested, using testpmd, for different hardware version on ESXi 7.0 Update 2
Signed-off-by: Pankaj Gupta <pagupta@vmware.com>
---
drivers/net/vmxnet3/vmxnet3_ethdev.c | 1 +
drivers/net/vmxnet3/vmxnet3_ethdev.h | 3 +++
drivers/net/vmxnet3/vmxnet3_rxtx.c | 30 ++++++++++++++++++++++++++++
3 files changed, 34 insertions(+)
diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
index eb65499cf2..a76796716b 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -294,6 +294,7 @@ eth_vmxnet3_dev_init(struct rte_eth_dev *eth_dev)
eth_dev->rx_pkt_burst = &vmxnet3_recv_pkts;
eth_dev->tx_pkt_burst = &vmxnet3_xmit_pkts;
eth_dev->tx_pkt_prepare = vmxnet3_prep_pkts;
+ eth_dev->rx_queue_count = vmxnet3_dev_rx_queue_count,
pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
/* extra mbuf field is required to guess MSS */
diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.h b/drivers/net/vmxnet3/vmxnet3_ethdev.h
index 7ec3b2e1f0..ceaeb66392 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.h
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.h
@@ -193,6 +193,9 @@ int vmxnet3_dev_rx_queue_setup(struct rte_eth_dev *dev, uint16_t rx_queue_id,
uint16_t nb_rx_desc, unsigned int socket_id,
const struct rte_eth_rxconf *rx_conf,
struct rte_mempool *mb_pool);
+
+uint32_t vmxnet3_dev_rx_queue_count(void *rx_queue);
+
int vmxnet3_dev_tx_queue_setup(struct rte_eth_dev *dev, uint16_t tx_queue_id,
uint16_t nb_tx_desc, unsigned int socket_id,
const struct rte_eth_txconf *tx_conf);
diff --git a/drivers/net/vmxnet3/vmxnet3_rxtx.c b/drivers/net/vmxnet3/vmxnet3_rxtx.c
index d745064bc4..e15b377d8c 100644
--- a/drivers/net/vmxnet3/vmxnet3_rxtx.c
+++ b/drivers/net/vmxnet3/vmxnet3_rxtx.c
@@ -1019,6 +1019,36 @@ vmxnet3_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
return nb_rx;
}
+uint32_t
+vmxnet3_dev_rx_queue_count(void *rx_queue)
+{
+ const vmxnet3_rx_queue_t *rxq;
+ const Vmxnet3_RxCompDesc *rcd;
+ uint32_t idx, nb_rxd = 0;
+ uint8_t gen;
+
+ rxq = rx_queue;
+ if (unlikely(rxq->stopped)) {
+ PMD_RX_LOG(DEBUG, "Rx queue is stopped.");
+ return 0;
+ }
+
+ gen = rxq->comp_ring.gen;
+ idx = rxq->comp_ring.next2proc;
+ rcd = &rxq->comp_ring.base[idx].rcd;
+ while (rcd->gen == gen) {
+ if (rcd->eop)
+ ++nb_rxd;
+ if (++idx == rxq->comp_ring.size) {
+ idx = 0;
+ gen ^= 1;
+ }
+ rcd = &rxq->comp_ring.base[idx].rcd;
+ }
+
+ return nb_rxd;
+}
+
int
vmxnet3_dev_tx_queue_setup(struct rte_eth_dev *dev,
uint16_t queue_idx,
--
2.17.1
^ permalink raw reply [flat|nested] 38+ messages in thread
end of thread, other threads:[~2022-05-24 6:46 UTC | newest]
Thread overview: 38+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-03 4:22 [PATCH 0/8] vmxnet3 version V5 and V6 Pankaj Gupta
2022-05-03 4:22 ` [PATCH 1/8] vmxnet3: Added V5 support Pankaj Gupta
2022-05-03 4:22 ` [PATCH 2/8] vmxnet3: implement reta query and reta update Pankaj Gupta
2022-05-04 14:23 ` Andrew Rybchenko
2022-05-03 4:22 ` [PATCH 3/8] vmxnet3: add rx queue usage count utility Pankaj Gupta
2022-05-04 14:27 ` Andrew Rybchenko
2022-05-04 14:35 ` Morten Brørup
2022-05-04 17:58 ` Pankaj Gupta
2022-05-03 4:22 ` [PATCH 4/8] vmxnet3: add get hw version api Pankaj Gupta
2022-05-04 14:35 ` Andrew Rybchenko
2022-05-03 4:22 ` [PATCH 5/8] vmxnet3, version 6 Pankaj Gupta
2022-05-04 14:46 ` Andrew Rybchenko
2022-05-03 4:22 ` [PATCH 6/8] vmxnet3: set reta size Pankaj Gupta
2022-05-04 15:05 ` Andrew Rybchenko
2022-05-03 4:22 ` [PATCH 7/8] vmxnet3: Set packet for fragmented packet Pankaj Gupta
2022-05-04 15:07 ` Andrew Rybchenko
2022-05-04 20:40 ` Pankaj Gupta
2022-05-05 8:45 ` Andrew Rybchenko
2022-05-03 4:22 ` [PATCH 8/8] vmxnet3: Fix merge error in initialization for rxDataRing feature Pankaj Gupta
2022-05-04 15:09 ` Andrew Rybchenko
2022-05-04 20:37 ` Pankaj Gupta
2022-05-05 8:37 ` Andrew Rybchenko
2022-05-03 18:50 ` [PATCH 0/8] vmxnet3 version V5 and V6 Jochen Behrens
2022-05-04 14:28 ` Andrew Rybchenko
2022-05-19 8:04 ` [PATCH v6 0/9] net/vmxnet3: support versions 5 and 6 Andrew Rybchenko
2022-05-19 8:04 ` [PATCH v6 1/9] net/vmxnet3: add version 5 support Andrew Rybchenko
2022-05-19 8:04 ` [PATCH v6 2/9] net/vmxnet3: implement RETA query and RETA update Andrew Rybchenko
2022-05-19 8:04 ` [PATCH v6 3/9] net/vmxnet3: add Rx queue usage count utility Andrew Rybchenko
2022-05-19 8:04 ` [PATCH v6 4/9] net/vmxnet3: fix ethdev callbacks init order Andrew Rybchenko
2022-05-19 8:04 ` [PATCH v6 5/9] net/vmxnet3: report HW version on FW version get Andrew Rybchenko
2022-05-19 8:04 ` [PATCH v6 6/9] net/vmxnet3: add version 6 support Andrew Rybchenko
2022-05-19 8:04 ` [PATCH v6 7/9] net/vmxnet3: advertise RETA size in device info Andrew Rybchenko
2022-05-19 8:04 ` [PATCH v6 8/9] net/vmxnet3: set packet type for fragmented packet Andrew Rybchenko
2022-05-19 8:04 ` [PATCH v6 9/9] net/vmxnet3: fix merge error in Rx data ring initialization Andrew Rybchenko
2022-05-19 8:07 ` [PATCH v6 0/9] net/vmxnet3: support versions 5 and 6 Andrew Rybchenko
2022-05-23 20:56 ` Pankaj Gupta
2022-05-24 6:46 ` Andrew Rybchenko
-- strict thread matches above, loose matches on Subject: below --
2022-05-02 19:45 [PATCH 0/8] vmxnet3: V5 and V6 Pankaj Gupta
2022-05-02 19:45 ` [PATCH 3/8] vmxnet3: add rx queue usage count utility Pankaj Gupta
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).