Skip to contentSkip to conversation

various vmxnet3 fixes and enhancement

PATCH Superseded Yong Wang 4 participants 22 messages Aug 13, 2016 – Sep 19, 2016

Subsystems (2)
lore
Share & tools
lore
author
#2 lore raw

PATCH 2/4 net/vmxnet3: coding style changes

In reply to Yong Wang
---
 drivers/net/vmxnet3/vmxnet3_ethdev.c | 69 ++++++++++++++++++------------------
 drivers/net/vmxnet3/vmxnet3_ethdev.h | 32 ++++++++---------
 drivers/net/vmxnet3/vmxnet3_ring.h   | 22 ++++++------
 drivers/net/vmxnet3/vmxnet3_rxtx.c   | 59 ++++++++++++++++--------------
 4 files changed, 93 insertions(+), 89 deletions(-)
drivers/net/vmxnet3/vmxnet3_ethdev.c +34 -35
index f5035bb..a2cb2dd 100644
@@ -81,11 +81,11 @@ static void vmxnet3_dev_promiscuous_disable(struct rte_eth_dev *dev);
 static void vmxnet3_dev_allmulticast_enable(struct rte_eth_dev *dev);
 static void vmxnet3_dev_allmulticast_disable(struct rte_eth_dev *dev);
 static int vmxnet3_dev_link_update(struct rte_eth_dev *dev,
-				int wait_to_complete);
+				   int wait_to_complete);
 static void vmxnet3_dev_stats_get(struct rte_eth_dev *dev,
-				struct rte_eth_stats *stats);
+				  struct rte_eth_stats *stats);
 static void vmxnet3_dev_info_get(struct rte_eth_dev *dev,
-				struct rte_eth_dev_info *dev_info);
+				 struct rte_eth_dev_info *dev_info);
 static const uint32_t *
 vmxnet3_dev_supported_ptypes_get(struct rte_eth_dev *dev);
 static int vmxnet3_dev_vlan_filter_set(struct rte_eth_dev *dev,
@@ -118,7 +118,7 @@ static const struct eth_dev_ops vmxnet3_eth_dev_ops = {
 	.allmulticast_disable = vmxnet3_dev_allmulticast_disable,
 	.link_update          = vmxnet3_dev_link_update,
 	.stats_get            = vmxnet3_dev_stats_get,
-	.mac_addr_set	      = vmxnet3_mac_addr_set,
+	.mac_addr_set         = vmxnet3_mac_addr_set,
 	.dev_infos_get        = vmxnet3_dev_info_get,
 	.dev_supported_ptypes_get = vmxnet3_dev_supported_ptypes_get,
 	.vlan_filter_set      = vmxnet3_dev_vlan_filter_set,
@@ -131,20 +131,19 @@ static const struct eth_dev_ops vmxnet3_eth_dev_ops = {
 
 static const struct rte_memzone *
 gpa_zone_reserve(struct rte_eth_dev *dev, uint32_t size,
-		const char *post_string, int socket_id, uint16_t align)
+		 const char *post_string, int socket_id, uint16_t align)
 {
 	char z_name[RTE_MEMZONE_NAMESIZE];
 	const struct rte_memzone *mz;
 
 	snprintf(z_name, sizeof(z_name), "%s_%d_%s",
-					dev->driver->pci_drv.name, dev->data->port_id, post_string);
+		 dev->driver->pci_drv.name, dev->data->port_id, post_string);
 
 	mz = rte_memzone_lookup(z_name);
 	if (mz)
 		return mz;
 
-	return rte_memzone_reserve_aligned(z_name, size,
-			socket_id, 0, align);
+	return rte_memzone_reserve_aligned(z_name, size, socket_id, 0, align);
 }
 
 /**
@@ -194,7 +193,7 @@ vmxnet3_dev_atomic_write_link_status(struct rte_eth_dev *dev,
 	struct rte_eth_link *src = link;
 
 	if (rte_atomic64_cmpset((uint64_t *)dst, *(uint64_t *)dst,
-					*(uint64_t *)src) == 0)
+				*(uint64_t *)src) == 0)
 		return -1;
 
 	return 0;
@@ -212,7 +211,7 @@ vmxnet3_disable_intr(struct vmxnet3_hw *hw)
 
 	hw->shared->devRead.intrConf.intrCtrl |= VMXNET3_IC_DISABLE_ALL;
 	for (i = 0; i < VMXNET3_MAX_INTRS; i++)
-			VMXNET3_WRITE_BAR0_REG(hw, VMXNET3_REG_IMR + i * 8, 1);
+		VMXNET3_WRITE_BAR0_REG(hw, VMXNET3_REG_IMR + i * 8, 1);
 }
 
 /*
@@ -274,8 +273,8 @@ eth_vmxnet3_dev_init(struct rte_eth_dev *eth_dev)
 	/* Getting MAC Address */
 	mac_lo = VMXNET3_READ_BAR1_REG(hw, VMXNET3_REG_MACL);
 	mac_hi = VMXNET3_READ_BAR1_REG(hw, VMXNET3_REG_MACH);
-	memcpy(hw->perm_addr  , &mac_lo, 4);
-	memcpy(hw->perm_addr+4, &mac_hi, 2);
+	memcpy(hw->perm_addr, &mac_lo, 4);
+	memcpy(hw->perm_addr + 4, &mac_hi, 2);
 
 	/* Allocate memory for storing MAC addresses */
 	eth_dev->data->mac_addrs = rte_zmalloc("vmxnet3", ETHER_ADDR_LEN *
@@ -343,7 +342,7 @@ static struct eth_driver rte_vmxnet3_pmd = {
  * Register itself as the [Poll Mode] Driver of Virtual PCI VMXNET3 devices.
  */
 static int
-rte_vmxnet3_pmd_init(const char *name __rte_unused, const char *param __rte_unused)
+rte_vmxnet3_pmd_init(__rte_unused const char *name, __rte_unused const char *param)
 {
 	PMD_INIT_FUNC_TRACE();
 
@@ -415,7 +414,6 @@ vmxnet3_dev_configure(struct rte_eth_dev *dev)
 	hw->queue_desc_len = (uint16_t)size;
 
 	if (dev->data->dev_conf.rxmode.mq_mode == ETH_MQ_RX_RSS) {
-
 		/* Allocate memory structure for UPT1_RSSConf and configure */
 		mz = gpa_zone_reserve(dev, sizeof(struct VMXNET3_RSSConf), "rss_conf",
 				      rte_socket_id(), RTE_CACHE_LINE_SIZE);
@@ -466,8 +464,7 @@ vmxnet3_setup_driver_shared(struct rte_eth_dev *dev)
 
 	/* Setting up Guest OS information */
 	devRead->misc.driverInfo.gos.gosBits   = sizeof(void *) == 4 ?
-		VMXNET3_GOS_BITS_32 :
-		VMXNET3_GOS_BITS_64;
+		VMXNET3_GOS_BITS_32 : VMXNET3_GOS_BITS_64;
 	devRead->misc.driverInfo.gos.gosType   = VMXNET3_GOS_TYPE_LINUX;
 	devRead->misc.driverInfo.vmxnet3RevSpt = 1;
 	devRead->misc.driverInfo.uptVerSpt     = 1;
@@ -542,7 +539,7 @@ vmxnet3_setup_driver_shared(struct rte_eth_dev *dev)
 	}
 
 	vmxnet3_dev_vlan_offload_set(dev,
-			     ETH_VLAN_STRIP_MASK | ETH_VLAN_FILTER_MASK);
+				     ETH_VLAN_STRIP_MASK | ETH_VLAN_FILTER_MASK);
 
 	vmxnet3_write_mac(hw, hw->perm_addr);
 
@@ -671,16 +668,15 @@ vmxnet3_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
 		struct UPT1_TxStats *txStats = &hw->tqd_start[i].stats;
 
 		stats->q_opackets[i] = txStats->ucastPktsTxOK +
-			txStats->mcastPktsTxOK +
-			txStats->bcastPktsTxOK;
+					txStats->mcastPktsTxOK +
+					txStats->bcastPktsTxOK;
 		stats->q_obytes[i] = txStats->ucastBytesTxOK +
-			txStats->mcastBytesTxOK +
-			txStats->bcastBytesTxOK;
+					txStats->mcastBytesTxOK +
+					txStats->bcastBytesTxOK;
 
 		stats->opackets += stats->q_opackets[i];
 		stats->obytes += stats->q_obytes[i];
-		stats->oerrors += txStats->pktsTxError +
-			txStats->pktsTxDiscard;
+		stats->oerrors += txStats->pktsTxError + txStats->pktsTxDiscard;
 	}
 
 	RTE_BUILD_BUG_ON(RTE_ETHDEV_QUEUE_STAT_CNTRS < VMXNET3_MAX_RX_QUEUES);
@@ -688,12 +684,12 @@ vmxnet3_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
 		struct UPT1_RxStats *rxStats = &hw->rqd_start[i].stats;
 
 		stats->q_ipackets[i] = rxStats->ucastPktsRxOK +
-			rxStats->mcastPktsRxOK +
-			rxStats->bcastPktsRxOK;
+					rxStats->mcastPktsRxOK +
+					rxStats->bcastPktsRxOK;
 
 		stats->q_ibytes[i] = rxStats->ucastBytesRxOK +
-			rxStats->mcastBytesRxOK +
-			rxStats->bcastBytesRxOK;
+					rxStats->mcastBytesRxOK +
+					rxStats->bcastBytesRxOK;
 
 		stats->ipackets += stats->q_ipackets[i];
 		stats->ibytes += stats->q_ibytes[i];
@@ -705,7 +701,7 @@ vmxnet3_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
 }
 
 static void
-vmxnet3_dev_info_get(__attribute__((unused))struct rte_eth_dev *dev,
+vmxnet3_dev_info_get(__rte_unused struct rte_eth_dev *dev,
 		     struct rte_eth_dev_info *dev_info)
 {
 	dev_info->max_rx_queues = VMXNET3_MAX_RX_QUEUES;
@@ -765,14 +761,16 @@ vmxnet3_mac_addr_set(struct rte_eth_dev *dev, struct ether_addr *mac_addr)
 
 /* return 0 means link status changed, -1 means not changed */
 static int
-vmxnet3_dev_link_update(struct rte_eth_dev *dev, __attribute__((unused)) int wait_to_complete)
+vmxnet3_dev_link_update(struct rte_eth_dev *dev,
+			__rte_unused int wait_to_complete)
 {
 	struct vmxnet3_hw *hw = dev->data->dev_private;
 	struct rte_eth_link old, link;
 	uint32_t ret;
 
+	/* Link status doesn't change for stopped dev */
 	if (dev->data->dev_started == 0)
-		return -1; /* Link status doesn't change for stopped dev */
+		return -1;
 
 	memset(&link, 0, sizeof(link));
 	vmxnet3_dev_atomic_read_link_status(dev, &old);
@@ -794,8 +792,8 @@ vmxnet3_dev_link_update(struct rte_eth_dev *dev, __attribute__((unused)) int wai
 
 /* Updating rxmode through Vmxnet3_DriverShared structure in adapter */
 static void
-vmxnet3_dev_set_rxmode(struct vmxnet3_hw *hw, uint32_t feature, int set) {
-
+vmxnet3_dev_set_rxmode(struct vmxnet3_hw *hw, uint32_t feature, int set)
+{
 	struct Vmxnet3_RxFilterConf *rxConf = &hw->shared->devRead.rxFilterConf;
 
 	if (set)
@@ -928,11 +926,13 @@ vmxnet3_process_events(struct vmxnet3_hw *hw)
 	/* Check if link state has changed */
 	if (events & VMXNET3_ECR_LINK)
 		PMD_INIT_LOG(ERR,
-			     "Process events in %s(): VMXNET3_ECR_LINK event", __func__);
+			     "Process events in %s(): VMXNET3_ECR_LINK event",
+			     __func__);
 
 	/* Check if there is an error on xmit/recv queues */
 	if (events & (VMXNET3_ECR_TQERR | VMXNET3_ECR_RQERR)) {
-		VMXNET3_WRITE_BAR1_REG(hw, VMXNET3_REG_CMD, VMXNET3_CMD_GET_QUEUE_STATUS);
+		VMXNET3_WRITE_BAR1_REG(hw, VMXNET3_REG_CMD,
+				       VMXNET3_CMD_GET_QUEUE_STATUS);
 
 		if (hw->tqd_start->status.stopped)
 			PMD_INIT_LOG(ERR, "tq error 0x%x",
@@ -951,7 +951,6 @@ vmxnet3_process_events(struct vmxnet3_hw *hw)
 
 	if (events & VMXNET3_ECR_DEBUG)
 		PMD_INIT_LOG(ERR, "Debug event generated by device.");
-
 }
 #endif
 
drivers/net/vmxnet3/vmxnet3_ethdev.h +15 -17
index 1be833a..7d3b11e 100644
@@ -62,8 +62,7 @@
 	ETH_RSS_NONFRAG_IPV6_TCP)
 
 /* RSS configuration structure - shared with device through GPA */
-typedef
-struct VMXNET3_RSSConf {
+typedef struct VMXNET3_RSSConf {
 	uint16_t   hashType;
 	uint16_t   hashFunc;
 	uint16_t   hashKeySize;
@@ -76,15 +75,13 @@ struct VMXNET3_RSSConf {
 	uint8_t    indTable[VMXNET3_RSS_MAX_IND_TABLE_SIZE];
 } VMXNET3_RSSConf;
 
-typedef
-struct vmxnet3_mf_table {
+typedef struct vmxnet3_mf_table {
 	void          *mfTableBase; /* Multicast addresses list */
 	uint64_t      mfTablePA;    /* Physical address of the list */
 	uint16_t      num_addrs;    /* number of multicast addrs */
 } vmxnet3_mf_table_t;
 
 struct vmxnet3_hw {
-
 	uint8_t *hw_addr0;	/* BAR0: PT-Passthrough Regs    */
 	uint8_t *hw_addr1;	/* BAR1: VD-Virtual Device Regs */
 	/* BAR2: MSI-X Regs */
@@ -111,10 +108,10 @@ struct vmxnet3_hw {
 	uint64_t              queueDescPA;
 	uint16_t              queue_desc_len;
 
-	VMXNET3_RSSConf		 *rss_conf;
-	uint64_t			 rss_confPA;
-	vmxnet3_mf_table_t   *mf_table;
-	uint32_t	      shadow_vfta[VMXNET3_VFT_SIZE];
+	VMXNET3_RSSConf       *rss_conf;
+	uint64_t              rss_confPA;
+	vmxnet3_mf_table_t    *mf_table;
+	uint32_t              shadow_vfta[VMXNET3_VFT_SIZE];
 #define VMXNET3_VFT_TABLE_SIZE     (VMXNET3_VFT_SIZE * sizeof(uint32_t))
 };
 
@@ -125,7 +122,8 @@ struct vmxnet3_hw {
 
 #define VMXNET3_PCI_REG(reg) (*((volatile uint32_t *)(reg)))
 
-static inline uint32_t vmxnet3_read_addr(volatile void *addr)
+static inline uint32_t
+vmxnet3_read_addr(volatile void *addr)
 {
 	return VMXNET3_PCI_REG(addr);
 }
@@ -158,20 +156,20 @@ void vmxnet3_dev_rx_queue_release(void *rxq);
 void vmxnet3_dev_tx_queue_release(void *txq);
 
 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);
+				uint16_t nb_rx_desc, unsigned int socket_id,
+				const struct rte_eth_rxconf *rx_conf,
+				struct rte_mempool *mb_pool);
 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);
+				uint16_t nb_tx_desc, unsigned int socket_id,
+				const struct rte_eth_txconf *tx_conf);
 
 int vmxnet3_dev_rxtx_init(struct rte_eth_dev *dev);
 
 int vmxnet3_rss_configure(struct rte_eth_dev *dev);
 
 uint16_t vmxnet3_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
-		uint16_t nb_pkts);
+			   uint16_t nb_pkts);
 uint16_t vmxnet3_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
-		uint16_t nb_pkts);
+			   uint16_t nb_pkts);
 
 #endif /* _VMXNET3_ETHDEV_H_ */
drivers/net/vmxnet3/vmxnet3_ring.h +11 -11
index 69ff2de..b50d2b0 100644
@@ -96,12 +96,12 @@ vmxnet3_cmd_ring_desc_empty(struct vmxnet3_cmd_ring *ring)
 }
 
 typedef struct vmxnet3_comp_ring {
-	uint32_t	       size;
-	uint32_t	       next2proc;
-	uint8_t		       gen;
-	uint8_t		       intr_idx;
+	uint32_t               size;
+	uint32_t               next2proc;
+	uint8_t                gen;
+	uint8_t                intr_idx;
 	Vmxnet3_GenericDesc    *base;
-	uint64_t	       basePA;
+	uint64_t               basePA;
 } vmxnet3_comp_ring_t;
 
 struct vmxnet3_data_ring {
@@ -121,13 +121,13 @@ vmxnet3_comp_ring_adv_next2proc(struct vmxnet3_comp_ring *ring)
 }
 
 struct vmxnet3_txq_stats {
-	uint64_t	drop_total; /* # of pkts dropped by the driver,
+	uint64_t        drop_total; /* # of pkts dropped by the driver,
 				     * the counters below track droppings due to
 				     * different reasons
 				     */
-	uint64_t	drop_too_many_segs;
-	uint64_t	drop_tso;
-	uint64_t	tx_ring_full;
+	uint64_t        drop_too_many_segs;
+	uint64_t        drop_tso;
+	uint64_t        tx_ring_full;
 };
 
 typedef struct vmxnet3_tx_queue {
@@ -158,8 +158,8 @@ typedef struct vmxnet3_rx_queue {
 	uint32_t                    qid1;
 	uint32_t                    qid2;
 	Vmxnet3_RxQueueDesc         *shared;
-	struct rte_mbuf		    *start_seg;
-	struct rte_mbuf		    *last_seg;
+	struct rte_mbuf             *start_seg;
+	struct rte_mbuf             *last_seg;
 	struct vmxnet3_rxq_stats    stats;
 	bool                        stopped;
 	uint16_t                    queue_id;      /**< Device RX queue index. */
drivers/net/vmxnet3/vmxnet3_rxtx.c +33 -26

177 lines not on this page · raw message

Signature · 1 line
1.9.1
author
#3 lore raw

PATCH 3/4 net/vmxnet3: reallocate shared memzone on re-config

In reply to Yong Wang

When adding a DPDK port to a bridge using ovs-vswitchd with DPDK, the vmxnet3 device fails to activate due to mismatched magic number. Doing this will incur the following operations: start the port, stop the port, reconfigure and re-start the port. The reconfig could request different number of tx/rx queues but the driver bypasses allocating the queuedesc memzone of proper size (which depends on the queue size) if there is an existing one. This results in a memzone with wrong size and potential invalid memory access. To fix this, this change will free the memzone if found and reserve a new one.

---
 drivers/net/vmxnet3/vmxnet3_ethdev.c | 27 ++++++++++++++++++++-------
 1 file changed, 20 insertions(+), 7 deletions(-)
drivers/net/vmxnet3/vmxnet3_ethdev.c +20 -7
index a2cb2dd..6b1e720 100644
@@ -131,7 +131,8 @@ static const struct eth_dev_ops vmxnet3_eth_dev_ops = {
 
 static const struct rte_memzone *
 gpa_zone_reserve(struct rte_eth_dev *dev, uint32_t size,
-		 const char *post_string, int socket_id, uint16_t align)
+		 const char *post_string, int socket_id,
+		 uint16_t align, bool reuse)
 {
 	char z_name[RTE_MEMZONE_NAMESIZE];
 	const struct rte_memzone *mz;
@@ -140,6 +141,13 @@ gpa_zone_reserve(struct rte_eth_dev *dev, uint32_t size,
 		 dev->driver->pci_drv.name, dev->data->port_id, post_string);
 
 	mz = rte_memzone_lookup(z_name);
+	if (!reuse) {
+		if (mz)
+			rte_memzone_free(mz);
+		return rte_memzone_reserve_aligned(z_name, size, socket_id,
+						   0, align);
+	}
+
 	if (mz)
 		return mz;
 
@@ -384,7 +392,7 @@ vmxnet3_dev_configure(struct rte_eth_dev *dev)
 	 * on current socket
 	 */
 	mz = gpa_zone_reserve(dev, sizeof(struct Vmxnet3_DriverShared),
-			      "shared", rte_socket_id(), 8);
+			      "shared", rte_socket_id(), 8, 1);
 
 	if (mz == NULL) {
 		PMD_INIT_LOG(ERR, "ERROR: Creating shared zone");
@@ -397,10 +405,14 @@ vmxnet3_dev_configure(struct rte_eth_dev *dev)
 
 	/*
 	 * Allocate a memzone for Vmxnet3_RxQueueDesc - Vmxnet3_TxQueueDesc
-	 * on current socket
+	 * on current socket.
+	 *
+	 * We cannot reuse this memzone from previous allocation as its size
+	 * depends on the number of tx and rx queues, which could be different
+	 * from one config to another.
 	 */
-	mz = gpa_zone_reserve(dev, size, "queuedesc",
-			      rte_socket_id(), VMXNET3_QUEUE_DESC_ALIGN);
+	mz = gpa_zone_reserve(dev, size, "queuedesc", rte_socket_id(),
+			      VMXNET3_QUEUE_DESC_ALIGN, 0);
 	if (mz == NULL) {
 		PMD_INIT_LOG(ERR, "ERROR: Creating queue descriptors zone");
 		return -ENOMEM;
@@ -415,8 +427,9 @@ vmxnet3_dev_configure(struct rte_eth_dev *dev)
 
 	if (dev->data->dev_conf.rxmode.mq_mode == ETH_MQ_RX_RSS) {
 		/* Allocate memory structure for UPT1_RSSConf and configure */
-		mz = gpa_zone_reserve(dev, sizeof(struct VMXNET3_RSSConf), "rss_conf",
-				      rte_socket_id(), RTE_CACHE_LINE_SIZE);
+		mz = gpa_zone_reserve(dev, sizeof(struct VMXNET3_RSSConf),
+				      "rss_conf", rte_socket_id(),
+				      RTE_CACHE_LINE_SIZE, 1);
 		if (mz == NULL) {
 			PMD_INIT_LOG(ERR,
 				     "ERROR: Creating rss_conf structure zone");
Signature · 1 line
1.9.1
author
#4 lore raw

PATCH 4/4 net/vmxnet3: enable lro

In reply to Yong Wang

The current implementation of jumbo frame rx can be used for LRO directly without changes. This change enables device LRO if requested.

Note that since jumbo frame uses both ring0 and ring1, it cannot be enabled in UPT (VMDirectPath) mode.

---
 drivers/net/vmxnet3/vmxnet3_ethdev.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/net/vmxnet3/vmxnet3_ethdev.c +7 -1
index 6b1e720..0d7732d 100644
@@ -540,6 +540,11 @@ vmxnet3_setup_driver_shared(struct rte_eth_dev *dev)
 	if (dev->data->dev_conf.rxmode.hw_ip_checksum)
 		devRead->misc.uptFeatures |= VMXNET3_F_RXCSUM;
 
+	if (dev->data->dev_conf.rxmode.enable_lro) {
+		devRead->misc.uptFeatures |= VMXNET3_F_LRO;
+		devRead->misc.maxNumRxSG = 0;
+	}
+
 	if (port_conf.rxmode.mq_mode == ETH_MQ_RX_RSS) {
 		ret = vmxnet3_rss_configure(dev);
 		if (ret != VMXNET3_SUCCESS)
@@ -741,7 +746,8 @@ vmxnet3_dev_info_get(__rte_unused struct rte_eth_dev *dev,
 	dev_info->rx_offload_capa =
 		DEV_RX_OFFLOAD_VLAN_STRIP |
 		DEV_RX_OFFLOAD_UDP_CKSUM |
-		DEV_RX_OFFLOAD_TCP_CKSUM;
+		DEV_RX_OFFLOAD_TCP_CKSUM |
+		DEV_RX_OFFLOAD_TCP_LRO;
 
 	dev_info->tx_offload_capa =
 		DEV_TX_OFFLOAD_VLAN_INSERT |
Signature · 1 line
1.9.1

Yong Wang

author
#0 lore raw

cover various vmxnet3 fixes and enhancement

This patchset includes a few bug fixes and some enhancement.

(1) a bug fix with dev_configure memzone size;
(2) enhanced error checks during device start. In particular, the driver will now report error if the rx queue number is not a power of two, instead of waiting for the activation to fail. Instead of returning -1 (which is interpreted as -EPERM) on device activation failure, -EINVAL is returned to avoid confusion.
(3) enables LRO if requested.

Yong Wang (4):
net/vmxnet3: improve error checks and return values net/vmxnet3: coding style changes net/vmxnet3: reallocate shared memzone on re-config net/vmxnet3: enable lro

 drivers/net/vmxnet3/vmxnet3_ethdev.c | 125 +++++++++++++++++++++--------------
 drivers/net/vmxnet3/vmxnet3_ethdev.h |  32 +++++----
 drivers/net/vmxnet3/vmxnet3_ring.h   |  22 +++---
 drivers/net/vmxnet3/vmxnet3_rxtx.c   |  59 +++++++++--------
 4 files changed, 134 insertions(+), 104 deletions(-)
Signature · 1 line
1.9.1
author
#1 lore raw

PATCH 1/4 net/vmxnet3: improve error checks and return values

---
 drivers/net/vmxnet3/vmxnet3_ethdev.c | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)
drivers/net/vmxnet3/vmxnet3_ethdev.c +15 -8
index 5874215..f5035bb 100644
@@ -360,9 +360,16 @@ vmxnet3_dev_configure(struct rte_eth_dev *dev)
 
 	PMD_INIT_FUNC_TRACE();
 
-	if (dev->data->nb_rx_queues > UINT8_MAX ||
-	    dev->data->nb_tx_queues > UINT8_MAX)
+	if (dev->data->nb_rx_queues > VMXNET3_MAX_TX_QUEUES ||
+	    dev->data->nb_tx_queues > VMXNET3_MAX_RX_QUEUES) {
+		PMD_INIT_LOG(ERR, "ERROR: Number of queues not supported");
 		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;
+	}
 
 	size = dev->data->nb_rx_queues * sizeof(struct Vmxnet3_TxQueueDesc) +
 		dev->data->nb_tx_queues * sizeof(struct Vmxnet3_RxQueueDesc);
@@ -550,7 +557,7 @@ vmxnet3_setup_driver_shared(struct rte_eth_dev *dev)
 static int
 vmxnet3_dev_start(struct rte_eth_dev *dev)
 {
-	int status, ret;
+	int ret;
 	struct vmxnet3_hw *hw = dev->data->dev_private;
 
 	PMD_INIT_FUNC_TRACE();
@@ -567,11 +574,11 @@ vmxnet3_dev_start(struct rte_eth_dev *dev)
 
 	/* Activate device by register write */
 	VMXNET3_WRITE_BAR1_REG(hw, VMXNET3_REG_CMD, VMXNET3_CMD_ACTIVATE_DEV);
-	status = VMXNET3_READ_BAR1_REG(hw, VMXNET3_REG_CMD);
+	ret = VMXNET3_READ_BAR1_REG(hw, VMXNET3_REG_CMD);
 
-	if (status != 0) {
+	if (ret != 0) {
 		PMD_INIT_LOG(ERR, "Device activation: UNSUCCESSFUL");
-		return -1;
+		return -EINVAL;
 	}
 
 	/* Disable interrupts */
@@ -583,7 +590,7 @@ vmxnet3_dev_start(struct rte_eth_dev *dev)
 	 */
 	ret = vmxnet3_dev_rxtx_init(dev);
 	if (ret != VMXNET3_SUCCESS) {
-		PMD_INIT_LOG(ERR, "Device receive init: UNSUCCESSFUL");
+		PMD_INIT_LOG(ERR, "Device queue init: UNSUCCESSFUL");
 		return ret;
 	}
 
@@ -598,7 +605,7 @@ vmxnet3_dev_start(struct rte_eth_dev *dev)
 	PMD_INIT_LOG(DEBUG, "Reading events: 0x%X", events);
 	vmxnet3_process_events(hw);
 #endif
-	return status;
+	return VMXNET3_SUCCESS;
 }
 
 /*
Signature · 1 line
1.9.1
#5 lore raw

Re: [PATCH 4/4] net/vmxnet3: enable lro

In reply to Yong Wang

2016-08-12 17:58, Yong Wang:

drivers/net/vmxnet3/vmxnet3_ethdev.c vmxnet3_dev_info_get(__rte_unused struct rte_eth_dev *dev, · line 750

Quoted 1 line
drivers/net/vmxnet3/vmxnet3_ethdev.c +1 -0
+		DEV_RX_OFFLOAD_TCP_LRO;

You should update doc/guides/nics/features/vmxnet3.ini accordingly. Thanks

author
#6 lore raw

v2 cover various vmxnet3 fixes and enhancement

In reply to Yong Wang

v2:
* updated vmxnet3 feature doc.
* updated vmxnet3 guide to remove stale information.

v1: This patchset includes a few bug fixes and some enhancement.

* Fixed a bug with dev_configure memzone size;
* Enhanced error checks during device start.
* the driver will now report error if the rx queue number is not a power of two, instead of waiting for the activation to fail.
* Instead of returning -1 (which is interpreted as -EPERM) on device activation failure, -EINVAL is returned now.
* Enabled LRO if requested.

Yong Wang (6):
net/vmxnet3: improve error checks and return values net/vmxnet3: coding style changes net/vmxnet3: reallocate shared memzone on re-config net/vmxnet3: update feature doc net/vmxnet3: update nic doc
net/vmxnet3: enable lro

 doc/guides/nics/features/vmxnet3.ini |  22 ++++++
 doc/guides/nics/vmxnet3.rst          |  12 +---
 drivers/net/vmxnet3/vmxnet3_ethdev.c | 125 +++++++++++++++++++++--------------
 drivers/net/vmxnet3/vmxnet3_ethdev.h |  32 +++++----
 drivers/net/vmxnet3/vmxnet3_ring.h   |  22 +++---
 drivers/net/vmxnet3/vmxnet3_rxtx.c   |  59 +++++++++--------
 6 files changed, 158 insertions(+), 114 deletions(-)
Signature · 1 line
1.9.1
author
#16 lore raw

PATCH v2 2/6 net/vmxnet3: coding style changes

---
 drivers/net/vmxnet3/vmxnet3_ethdev.c | 69 ++++++++++++++++++------------------
 drivers/net/vmxnet3/vmxnet3_ethdev.h | 32 ++++++++---------
 drivers/net/vmxnet3/vmxnet3_ring.h   | 22 ++++++------
 drivers/net/vmxnet3/vmxnet3_rxtx.c   | 59 ++++++++++++++++--------------
 4 files changed, 93 insertions(+), 89 deletions(-)
drivers/net/vmxnet3/vmxnet3_ethdev.c +34 -35
index f5035bb..a2cb2dd 100644
@@ -81,11 +81,11 @@ static void vmxnet3_dev_promiscuous_disable(struct rte_eth_dev *dev);
 static void vmxnet3_dev_allmulticast_enable(struct rte_eth_dev *dev);
 static void vmxnet3_dev_allmulticast_disable(struct rte_eth_dev *dev);
 static int vmxnet3_dev_link_update(struct rte_eth_dev *dev,
-				int wait_to_complete);
+				   int wait_to_complete);
 static void vmxnet3_dev_stats_get(struct rte_eth_dev *dev,
-				struct rte_eth_stats *stats);
+				  struct rte_eth_stats *stats);
 static void vmxnet3_dev_info_get(struct rte_eth_dev *dev,
-				struct rte_eth_dev_info *dev_info);
+				 struct rte_eth_dev_info *dev_info);
 static const uint32_t *
 vmxnet3_dev_supported_ptypes_get(struct rte_eth_dev *dev);
 static int vmxnet3_dev_vlan_filter_set(struct rte_eth_dev *dev,
@@ -118,7 +118,7 @@ static const struct eth_dev_ops vmxnet3_eth_dev_ops = {
 	.allmulticast_disable = vmxnet3_dev_allmulticast_disable,
 	.link_update          = vmxnet3_dev_link_update,
 	.stats_get            = vmxnet3_dev_stats_get,
-	.mac_addr_set	      = vmxnet3_mac_addr_set,
+	.mac_addr_set         = vmxnet3_mac_addr_set,
 	.dev_infos_get        = vmxnet3_dev_info_get,
 	.dev_supported_ptypes_get = vmxnet3_dev_supported_ptypes_get,
 	.vlan_filter_set      = vmxnet3_dev_vlan_filter_set,
@@ -131,20 +131,19 @@ static const struct eth_dev_ops vmxnet3_eth_dev_ops = {
 
 static const struct rte_memzone *
 gpa_zone_reserve(struct rte_eth_dev *dev, uint32_t size,
-		const char *post_string, int socket_id, uint16_t align)
+		 const char *post_string, int socket_id, uint16_t align)
 {
 	char z_name[RTE_MEMZONE_NAMESIZE];
 	const struct rte_memzone *mz;
 
 	snprintf(z_name, sizeof(z_name), "%s_%d_%s",
-					dev->driver->pci_drv.name, dev->data->port_id, post_string);
+		 dev->driver->pci_drv.name, dev->data->port_id, post_string);
 
 	mz = rte_memzone_lookup(z_name);
 	if (mz)
 		return mz;
 
-	return rte_memzone_reserve_aligned(z_name, size,
-			socket_id, 0, align);
+	return rte_memzone_reserve_aligned(z_name, size, socket_id, 0, align);
 }
 
 /**
@@ -194,7 +193,7 @@ vmxnet3_dev_atomic_write_link_status(struct rte_eth_dev *dev,
 	struct rte_eth_link *src = link;
 
 	if (rte_atomic64_cmpset((uint64_t *)dst, *(uint64_t *)dst,
-					*(uint64_t *)src) == 0)
+				*(uint64_t *)src) == 0)
 		return -1;
 
 	return 0;
@@ -212,7 +211,7 @@ vmxnet3_disable_intr(struct vmxnet3_hw *hw)
 
 	hw->shared->devRead.intrConf.intrCtrl |= VMXNET3_IC_DISABLE_ALL;
 	for (i = 0; i < VMXNET3_MAX_INTRS; i++)
-			VMXNET3_WRITE_BAR0_REG(hw, VMXNET3_REG_IMR + i * 8, 1);
+		VMXNET3_WRITE_BAR0_REG(hw, VMXNET3_REG_IMR + i * 8, 1);
 }
 
 /*
@@ -274,8 +273,8 @@ eth_vmxnet3_dev_init(struct rte_eth_dev *eth_dev)
 	/* Getting MAC Address */
 	mac_lo = VMXNET3_READ_BAR1_REG(hw, VMXNET3_REG_MACL);
 	mac_hi = VMXNET3_READ_BAR1_REG(hw, VMXNET3_REG_MACH);
-	memcpy(hw->perm_addr  , &mac_lo, 4);
-	memcpy(hw->perm_addr+4, &mac_hi, 2);
+	memcpy(hw->perm_addr, &mac_lo, 4);
+	memcpy(hw->perm_addr + 4, &mac_hi, 2);
 
 	/* Allocate memory for storing MAC addresses */
 	eth_dev->data->mac_addrs = rte_zmalloc("vmxnet3", ETHER_ADDR_LEN *
@@ -343,7 +342,7 @@ static struct eth_driver rte_vmxnet3_pmd = {
  * Register itself as the [Poll Mode] Driver of Virtual PCI VMXNET3 devices.
  */
 static int
-rte_vmxnet3_pmd_init(const char *name __rte_unused, const char *param __rte_unused)
+rte_vmxnet3_pmd_init(__rte_unused const char *name, __rte_unused const char *param)
 {
 	PMD_INIT_FUNC_TRACE();
 
@@ -415,7 +414,6 @@ vmxnet3_dev_configure(struct rte_eth_dev *dev)
 	hw->queue_desc_len = (uint16_t)size;
 
 	if (dev->data->dev_conf.rxmode.mq_mode == ETH_MQ_RX_RSS) {
-
 		/* Allocate memory structure for UPT1_RSSConf and configure */
 		mz = gpa_zone_reserve(dev, sizeof(struct VMXNET3_RSSConf), "rss_conf",
 				      rte_socket_id(), RTE_CACHE_LINE_SIZE);
@@ -466,8 +464,7 @@ vmxnet3_setup_driver_shared(struct rte_eth_dev *dev)
 
 	/* Setting up Guest OS information */
 	devRead->misc.driverInfo.gos.gosBits   = sizeof(void *) == 4 ?
-		VMXNET3_GOS_BITS_32 :
-		VMXNET3_GOS_BITS_64;
+		VMXNET3_GOS_BITS_32 : VMXNET3_GOS_BITS_64;
 	devRead->misc.driverInfo.gos.gosType   = VMXNET3_GOS_TYPE_LINUX;
 	devRead->misc.driverInfo.vmxnet3RevSpt = 1;
 	devRead->misc.driverInfo.uptVerSpt     = 1;
@@ -542,7 +539,7 @@ vmxnet3_setup_driver_shared(struct rte_eth_dev *dev)
 	}
 
 	vmxnet3_dev_vlan_offload_set(dev,
-			     ETH_VLAN_STRIP_MASK | ETH_VLAN_FILTER_MASK);
+				     ETH_VLAN_STRIP_MASK | ETH_VLAN_FILTER_MASK);
 
 	vmxnet3_write_mac(hw, hw->perm_addr);
 
@@ -671,16 +668,15 @@ vmxnet3_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
 		struct UPT1_TxStats *txStats = &hw->tqd_start[i].stats;
 
 		stats->q_opackets[i] = txStats->ucastPktsTxOK +
-			txStats->mcastPktsTxOK +
-			txStats->bcastPktsTxOK;
+					txStats->mcastPktsTxOK +
+					txStats->bcastPktsTxOK;
 		stats->q_obytes[i] = txStats->ucastBytesTxOK +
-			txStats->mcastBytesTxOK +
-			txStats->bcastBytesTxOK;
+					txStats->mcastBytesTxOK +
+					txStats->bcastBytesTxOK;
 
 		stats->opackets += stats->q_opackets[i];
 		stats->obytes += stats->q_obytes[i];
-		stats->oerrors += txStats->pktsTxError +
-			txStats->pktsTxDiscard;
+		stats->oerrors += txStats->pktsTxError + txStats->pktsTxDiscard;
 	}
 
 	RTE_BUILD_BUG_ON(RTE_ETHDEV_QUEUE_STAT_CNTRS < VMXNET3_MAX_RX_QUEUES);
@@ -688,12 +684,12 @@ vmxnet3_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
 		struct UPT1_RxStats *rxStats = &hw->rqd_start[i].stats;
 
 		stats->q_ipackets[i] = rxStats->ucastPktsRxOK +
-			rxStats->mcastPktsRxOK +
-			rxStats->bcastPktsRxOK;
+					rxStats->mcastPktsRxOK +
+					rxStats->bcastPktsRxOK;
 
 		stats->q_ibytes[i] = rxStats->ucastBytesRxOK +
-			rxStats->mcastBytesRxOK +
-			rxStats->bcastBytesRxOK;
+					rxStats->mcastBytesRxOK +
+					rxStats->bcastBytesRxOK;
 
 		stats->ipackets += stats->q_ipackets[i];
 		stats->ibytes += stats->q_ibytes[i];
@@ -705,7 +701,7 @@ vmxnet3_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
 }
 
 static void
-vmxnet3_dev_info_get(__attribute__((unused))struct rte_eth_dev *dev,
+vmxnet3_dev_info_get(__rte_unused struct rte_eth_dev *dev,
 		     struct rte_eth_dev_info *dev_info)
 {
 	dev_info->max_rx_queues = VMXNET3_MAX_RX_QUEUES;
@@ -765,14 +761,16 @@ vmxnet3_mac_addr_set(struct rte_eth_dev *dev, struct ether_addr *mac_addr)
 
 /* return 0 means link status changed, -1 means not changed */
 static int
-vmxnet3_dev_link_update(struct rte_eth_dev *dev, __attribute__((unused)) int wait_to_complete)
+vmxnet3_dev_link_update(struct rte_eth_dev *dev,
+			__rte_unused int wait_to_complete)
 {
 	struct vmxnet3_hw *hw = dev->data->dev_private;
 	struct rte_eth_link old, link;
 	uint32_t ret;
 
+	/* Link status doesn't change for stopped dev */
 	if (dev->data->dev_started == 0)
-		return -1; /* Link status doesn't change for stopped dev */
+		return -1;
 
 	memset(&link, 0, sizeof(link));
 	vmxnet3_dev_atomic_read_link_status(dev, &old);
@@ -794,8 +792,8 @@ vmxnet3_dev_link_update(struct rte_eth_dev *dev, __attribute__((unused)) int wai
 
 /* Updating rxmode through Vmxnet3_DriverShared structure in adapter */
 static void
-vmxnet3_dev_set_rxmode(struct vmxnet3_hw *hw, uint32_t feature, int set) {
-
+vmxnet3_dev_set_rxmode(struct vmxnet3_hw *hw, uint32_t feature, int set)
+{
 	struct Vmxnet3_RxFilterConf *rxConf = &hw->shared->devRead.rxFilterConf;
 
 	if (set)
@@ -928,11 +926,13 @@ vmxnet3_process_events(struct vmxnet3_hw *hw)
 	/* Check if link state has changed */
 	if (events & VMXNET3_ECR_LINK)
 		PMD_INIT_LOG(ERR,
-			     "Process events in %s(): VMXNET3_ECR_LINK event", __func__);
+			     "Process events in %s(): VMXNET3_ECR_LINK event",
+			     __func__);
 
 	/* Check if there is an error on xmit/recv queues */
 	if (events & (VMXNET3_ECR_TQERR | VMXNET3_ECR_RQERR)) {
-		VMXNET3_WRITE_BAR1_REG(hw, VMXNET3_REG_CMD, VMXNET3_CMD_GET_QUEUE_STATUS);
+		VMXNET3_WRITE_BAR1_REG(hw, VMXNET3_REG_CMD,
+				       VMXNET3_CMD_GET_QUEUE_STATUS);
 
 		if (hw->tqd_start->status.stopped)
 			PMD_INIT_LOG(ERR, "tq error 0x%x",
@@ -951,7 +951,6 @@ vmxnet3_process_events(struct vmxnet3_hw *hw)
 
 	if (events & VMXNET3_ECR_DEBUG)
 		PMD_INIT_LOG(ERR, "Debug event generated by device.");
-
 }
 #endif
 
drivers/net/vmxnet3/vmxnet3_ethdev.h +15 -17
index 1be833a..7d3b11e 100644
@@ -62,8 +62,7 @@
 	ETH_RSS_NONFRAG_IPV6_TCP)
 
 /* RSS configuration structure - shared with device through GPA */
-typedef
-struct VMXNET3_RSSConf {
+typedef struct VMXNET3_RSSConf {
 	uint16_t   hashType;
 	uint16_t   hashFunc;
 	uint16_t   hashKeySize;
@@ -76,15 +75,13 @@ struct VMXNET3_RSSConf {
 	uint8_t    indTable[VMXNET3_RSS_MAX_IND_TABLE_SIZE];
 } VMXNET3_RSSConf;
 
-typedef
-struct vmxnet3_mf_table {
+typedef struct vmxnet3_mf_table {
 	void          *mfTableBase; /* Multicast addresses list */
 	uint64_t      mfTablePA;    /* Physical address of the list */
 	uint16_t      num_addrs;    /* number of multicast addrs */
 } vmxnet3_mf_table_t;
 
 struct vmxnet3_hw {
-
 	uint8_t *hw_addr0;	/* BAR0: PT-Passthrough Regs    */
 	uint8_t *hw_addr1;	/* BAR1: VD-Virtual Device Regs */
 	/* BAR2: MSI-X Regs */
@@ -111,10 +108,10 @@ struct vmxnet3_hw {
 	uint64_t              queueDescPA;
 	uint16_t              queue_desc_len;
 
-	VMXNET3_RSSConf		 *rss_conf;
-	uint64_t			 rss_confPA;
-	vmxnet3_mf_table_t   *mf_table;
-	uint32_t	      shadow_vfta[VMXNET3_VFT_SIZE];
+	VMXNET3_RSSConf       *rss_conf;
+	uint64_t              rss_confPA;
+	vmxnet3_mf_table_t    *mf_table;
+	uint32_t              shadow_vfta[VMXNET3_VFT_SIZE];
 #define VMXNET3_VFT_TABLE_SIZE     (VMXNET3_VFT_SIZE * sizeof(uint32_t))
 };
 
@@ -125,7 +122,8 @@ struct vmxnet3_hw {
 
 #define VMXNET3_PCI_REG(reg) (*((volatile uint32_t *)(reg)))
 
-static inline uint32_t vmxnet3_read_addr(volatile void *addr)
+static inline uint32_t
+vmxnet3_read_addr(volatile void *addr)
 {
 	return VMXNET3_PCI_REG(addr);
 }
@@ -158,20 +156,20 @@ void vmxnet3_dev_rx_queue_release(void *rxq);
 void vmxnet3_dev_tx_queue_release(void *txq);
 
 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);
+				uint16_t nb_rx_desc, unsigned int socket_id,
+				const struct rte_eth_rxconf *rx_conf,
+				struct rte_mempool *mb_pool);
 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);
+				uint16_t nb_tx_desc, unsigned int socket_id,
+				const struct rte_eth_txconf *tx_conf);
 
 int vmxnet3_dev_rxtx_init(struct rte_eth_dev *dev);
 
 int vmxnet3_rss_configure(struct rte_eth_dev *dev);
 
 uint16_t vmxnet3_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
-		uint16_t nb_pkts);
+			   uint16_t nb_pkts);
 uint16_t vmxnet3_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
-		uint16_t nb_pkts);
+			   uint16_t nb_pkts);
 
 #endif /* _VMXNET3_ETHDEV_H_ */
drivers/net/vmxnet3/vmxnet3_ring.h +11 -11
index 69ff2de..b50d2b0 100644
@@ -96,12 +96,12 @@ vmxnet3_cmd_ring_desc_empty(struct vmxnet3_cmd_ring *ring)
 }
 
 typedef struct vmxnet3_comp_ring {
-	uint32_t	       size;
-	uint32_t	       next2proc;
-	uint8_t		       gen;
-	uint8_t		       intr_idx;
+	uint32_t               size;
+	uint32_t               next2proc;
+	uint8_t                gen;
+	uint8_t                intr_idx;
 	Vmxnet3_GenericDesc    *base;
-	uint64_t	       basePA;
+	uint64_t               basePA;
 } vmxnet3_comp_ring_t;
 
 struct vmxnet3_data_ring {
@@ -121,13 +121,13 @@ vmxnet3_comp_ring_adv_next2proc(struct vmxnet3_comp_ring *ring)
 }
 
 struct vmxnet3_txq_stats {
-	uint64_t	drop_total; /* # of pkts dropped by the driver,
+	uint64_t        drop_total; /* # of pkts dropped by the driver,
 				     * the counters below track droppings due to
 				     * different reasons
 				     */
-	uint64_t	drop_too_many_segs;
-	uint64_t	drop_tso;
-	uint64_t	tx_ring_full;
+	uint64_t        drop_too_many_segs;
+	uint64_t        drop_tso;
+	uint64_t        tx_ring_full;
 };
 
 typedef struct vmxnet3_tx_queue {
@@ -158,8 +158,8 @@ typedef struct vmxnet3_rx_queue {
 	uint32_t                    qid1;
 	uint32_t                    qid2;
 	Vmxnet3_RxQueueDesc         *shared;
-	struct rte_mbuf		    *start_seg;
-	struct rte_mbuf		    *last_seg;
+	struct rte_mbuf             *start_seg;
+	struct rte_mbuf             *last_seg;
 	struct vmxnet3_rxq_stats    stats;
 	bool                        stopped;
 	uint16_t                    queue_id;      /**< Device RX queue index. */
drivers/net/vmxnet3/vmxnet3_rxtx.c +33 -26

177 lines not on this page · raw message

Signature · 1 line
1.9.1
author
#7 lore raw

PATCH v2 1/6 net/vmxnet3: improve error checks and return values

In reply to Yong Wang
---
 drivers/net/vmxnet3/vmxnet3_ethdev.c | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)
drivers/net/vmxnet3/vmxnet3_ethdev.c +15 -8
index 5874215..f5035bb 100644
@@ -360,9 +360,16 @@ vmxnet3_dev_configure(struct rte_eth_dev *dev)
 
 	PMD_INIT_FUNC_TRACE();
 
-	if (dev->data->nb_rx_queues > UINT8_MAX ||
-	    dev->data->nb_tx_queues > UINT8_MAX)
+	if (dev->data->nb_rx_queues > VMXNET3_MAX_TX_QUEUES ||
+	    dev->data->nb_tx_queues > VMXNET3_MAX_RX_QUEUES) {
+		PMD_INIT_LOG(ERR, "ERROR: Number of queues not supported");
 		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;
+	}
 
 	size = dev->data->nb_rx_queues * sizeof(struct Vmxnet3_TxQueueDesc) +
 		dev->data->nb_tx_queues * sizeof(struct Vmxnet3_RxQueueDesc);
@@ -550,7 +557,7 @@ vmxnet3_setup_driver_shared(struct rte_eth_dev *dev)
 static int
 vmxnet3_dev_start(struct rte_eth_dev *dev)
 {
-	int status, ret;
+	int ret;
 	struct vmxnet3_hw *hw = dev->data->dev_private;
 
 	PMD_INIT_FUNC_TRACE();
@@ -567,11 +574,11 @@ vmxnet3_dev_start(struct rte_eth_dev *dev)
 
 	/* Activate device by register write */
 	VMXNET3_WRITE_BAR1_REG(hw, VMXNET3_REG_CMD, VMXNET3_CMD_ACTIVATE_DEV);
-	status = VMXNET3_READ_BAR1_REG(hw, VMXNET3_REG_CMD);
+	ret = VMXNET3_READ_BAR1_REG(hw, VMXNET3_REG_CMD);
 
-	if (status != 0) {
+	if (ret != 0) {
 		PMD_INIT_LOG(ERR, "Device activation: UNSUCCESSFUL");
-		return -1;
+		return -EINVAL;
 	}
 
 	/* Disable interrupts */
@@ -583,7 +590,7 @@ vmxnet3_dev_start(struct rte_eth_dev *dev)
 	 */
 	ret = vmxnet3_dev_rxtx_init(dev);
 	if (ret != VMXNET3_SUCCESS) {
-		PMD_INIT_LOG(ERR, "Device receive init: UNSUCCESSFUL");
+		PMD_INIT_LOG(ERR, "Device queue init: UNSUCCESSFUL");
 		return ret;
 	}
 
@@ -598,7 +605,7 @@ vmxnet3_dev_start(struct rte_eth_dev *dev)
 	PMD_INIT_LOG(DEBUG, "Reading events: 0x%X", events);
 	vmxnet3_process_events(hw);
 #endif
-	return status;
+	return VMXNET3_SUCCESS;
 }
 
 /*
Signature · 1 line
1.9.1
author
#17 lore raw

PATCH v2 3/6 net/vmxnet3: reallocate shared memzone on re-config

In reply to Yong Wang

When adding a DPDK port to a bridge using ovs-vswitchd with DPDK, the vmxnet3 device fails to activate due to mismatched magic number. Doing this will incur the following operations: start the port, stop the port, reconfigure and re-start the port. The reconfig could request different number of tx/rx queues but the driver bypasses allocating the queuedesc memzone of proper size (which depends on the queue size) if there is an existing one. This results in a memzone with wrong size and potential invalid memory access. To fix this, this change will free the memzone if found and reserve a new one.

---
 drivers/net/vmxnet3/vmxnet3_ethdev.c | 27 ++++++++++++++++++++-------
 1 file changed, 20 insertions(+), 7 deletions(-)
drivers/net/vmxnet3/vmxnet3_ethdev.c +20 -7
index a2cb2dd..6b1e720 100644
@@ -131,7 +131,8 @@ static const struct eth_dev_ops vmxnet3_eth_dev_ops = {
 
 static const struct rte_memzone *
 gpa_zone_reserve(struct rte_eth_dev *dev, uint32_t size,
-		 const char *post_string, int socket_id, uint16_t align)
+		 const char *post_string, int socket_id,
+		 uint16_t align, bool reuse)
 {
 	char z_name[RTE_MEMZONE_NAMESIZE];
 	const struct rte_memzone *mz;
@@ -140,6 +141,13 @@ gpa_zone_reserve(struct rte_eth_dev *dev, uint32_t size,
 		 dev->driver->pci_drv.name, dev->data->port_id, post_string);
 
 	mz = rte_memzone_lookup(z_name);
+	if (!reuse) {
+		if (mz)
+			rte_memzone_free(mz);
+		return rte_memzone_reserve_aligned(z_name, size, socket_id,
+						   0, align);
+	}
+
 	if (mz)
 		return mz;
 
@@ -384,7 +392,7 @@ vmxnet3_dev_configure(struct rte_eth_dev *dev)
 	 * on current socket
 	 */
 	mz = gpa_zone_reserve(dev, sizeof(struct Vmxnet3_DriverShared),
-			      "shared", rte_socket_id(), 8);
+			      "shared", rte_socket_id(), 8, 1);
 
 	if (mz == NULL) {
 		PMD_INIT_LOG(ERR, "ERROR: Creating shared zone");
@@ -397,10 +405,14 @@ vmxnet3_dev_configure(struct rte_eth_dev *dev)
 
 	/*
 	 * Allocate a memzone for Vmxnet3_RxQueueDesc - Vmxnet3_TxQueueDesc
-	 * on current socket
+	 * on current socket.
+	 *
+	 * We cannot reuse this memzone from previous allocation as its size
+	 * depends on the number of tx and rx queues, which could be different
+	 * from one config to another.
 	 */
-	mz = gpa_zone_reserve(dev, size, "queuedesc",
-			      rte_socket_id(), VMXNET3_QUEUE_DESC_ALIGN);
+	mz = gpa_zone_reserve(dev, size, "queuedesc", rte_socket_id(),
+			      VMXNET3_QUEUE_DESC_ALIGN, 0);
 	if (mz == NULL) {
 		PMD_INIT_LOG(ERR, "ERROR: Creating queue descriptors zone");
 		return -ENOMEM;
@@ -415,8 +427,9 @@ vmxnet3_dev_configure(struct rte_eth_dev *dev)
 
 	if (dev->data->dev_conf.rxmode.mq_mode == ETH_MQ_RX_RSS) {
 		/* Allocate memory structure for UPT1_RSSConf and configure */
-		mz = gpa_zone_reserve(dev, sizeof(struct VMXNET3_RSSConf), "rss_conf",
-				      rte_socket_id(), RTE_CACHE_LINE_SIZE);
+		mz = gpa_zone_reserve(dev, sizeof(struct VMXNET3_RSSConf),
+				      "rss_conf", rte_socket_id(),
+				      RTE_CACHE_LINE_SIZE, 1);
 		if (mz == NULL) {
 			PMD_INIT_LOG(ERR,
 				     "ERROR: Creating rss_conf structure zone");
Signature · 1 line
1.9.1
author
#20 lore raw

PATCH v2 6/6 net/vmxnet3: enable lro

In reply to Yong Wang

The current implementation of jumbo frame rx can be used for LRO directly without changes. This change enables device LRO if requested.

Note that since jumbo frame uses both ring0 and ring1, it cannot be enabled in UPT (VMDirectPath) mode.

---
 doc/guides/nics/features/vmxnet3.ini | 1 +
 drivers/net/vmxnet3/vmxnet3_ethdev.c | 8 +++++++-
 2 files changed, 8 insertions(+), 1 deletion(-)
doc/guides/nics/features/vmxnet3.ini +1 -0
index c5c75ad..ef95932 100644
@@ -9,6 +9,7 @@ Link status event    = Y
 Queue start/stop     = Y
 MTU update           = Y
 Jumbo frame          = Y
+LRO                  = Y
 TSO                  = Y
 Promiscuous mode     = Y
 Allmulticast mode    = Y
drivers/net/vmxnet3/vmxnet3_ethdev.c +7 -1
index 6b1e720..0d7732d 100644
@@ -540,6 +540,11 @@ vmxnet3_setup_driver_shared(struct rte_eth_dev *dev)
 	if (dev->data->dev_conf.rxmode.hw_ip_checksum)
 		devRead->misc.uptFeatures |= VMXNET3_F_RXCSUM;
 
+	if (dev->data->dev_conf.rxmode.enable_lro) {
+		devRead->misc.uptFeatures |= VMXNET3_F_LRO;
+		devRead->misc.maxNumRxSG = 0;
+	}
+
 	if (port_conf.rxmode.mq_mode == ETH_MQ_RX_RSS) {
 		ret = vmxnet3_rss_configure(dev);
 		if (ret != VMXNET3_SUCCESS)
@@ -741,7 +746,8 @@ vmxnet3_dev_info_get(__rte_unused struct rte_eth_dev *dev,
 	dev_info->rx_offload_capa =
 		DEV_RX_OFFLOAD_VLAN_STRIP |
 		DEV_RX_OFFLOAD_UDP_CKSUM |
-		DEV_RX_OFFLOAD_TCP_CKSUM;
+		DEV_RX_OFFLOAD_TCP_CKSUM |
+		DEV_RX_OFFLOAD_TCP_LRO;
 
 	dev_info->tx_offload_capa =
 		DEV_TX_OFFLOAD_VLAN_INSERT |
Signature · 1 line
1.9.1
author
#18 lore raw

PATCH v2 4/6 net/vmxnet3: update feature doc

In reply to Yong Wang
---
 doc/guides/nics/features/vmxnet3.ini | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
doc/guides/nics/features/vmxnet3.ini +21 -0
index 20a4c32..c5c75ad 100644
@@ -4,3 +4,24 @@
 ; Refer to default.ini for the full list of available PMD features.
 ;
 [Features]
+Link status          = Y
+Link status event    = Y
+Queue start/stop     = Y
+MTU update           = Y
+Jumbo frame          = Y
+TSO                  = Y
+Promiscuous mode     = Y
+Allmulticast mode    = Y
+Unicast MAC filter   = Y
+RSS hash             = Y
+VLAN filter          = Y
+VLAN offload         = Y
+L4 checksum offload  = Y
+Packet type parsing  = Y
+Basic stats          = Y
+Stats per queue      = Y
+Linux UIO            = Y
+Linux VFIO           = Y
+x86-32               = Y
+x86-64               = Y
+Usage doc            = Y
Signature · 1 line
1.9.1
author
#19 lore raw

PATCH v2 5/6 net/vmxnet3: update nic doc

In reply to Yong Wang
---
 doc/guides/nics/vmxnet3.rst | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)
doc/guides/nics/vmxnet3.rst +2 -10
index e919088..bf84594 100644
@@ -32,17 +32,11 @@ Poll Mode Driver for Paravirtual VMXNET3 NIC
 ============================================
 
 The VMXNET3 adapter is the next generation of a paravirtualized NIC, introduced by VMware* ESXi.
-It is designed for performance and is not related to VMXNET or VMXENET2.
-It offers all the features available in VMXNET2, and adds several new features such as,
+It is designed for performance, offers all the features available in VMXNET2, and adds several new features such as,
 multi-queue support (also known as Receive Side Scaling, RSS),
 IPv6 offloads, and MSI/MSI-X interrupt delivery.
-Because operating system vendors do not provide built-in drivers for this card,
-VMware Tools must be installed to have a driver for the VMXNET3 network adapter available.
 One can use the same device in a DPDK application with VMXNET3 PMD introduced in DPDK API.
 
-Currently, the driver provides basic support for using the device in a DPDK application running on a guest OS.
-Optimization is needed on the backend, that is, the VMware* ESXi vmkernel switch, to achieve optimal performance end-to-end.
-
 In this chapter, two setups with the use of the VMXNET3 PMD are demonstrated:
 
 #.  Vmxnet3 with a native NIC connected to a vSwitch
@@ -59,8 +53,6 @@ For performance details, refer to the following link from VMware:
 `http://www.vmware.com/pdf/vsp_4_vmxnet3_perf.pdf <http://www.vmware.com/pdf/vsp_4_vmxnet3_perf.pdf>`_
 
 As a PMD, the VMXNET3 driver provides the packet reception and transmission callbacks, vmxnet3_recv_pkts and vmxnet3_xmit_pkts.
-It does not support scattered packet reception as part of vmxnet3_recv_pkts and vmxnet3_xmit_pkts.
-Also, it does not support scattered packet reception as part of the device operations supported.
 
 The VMXNET3 PMD handles all the packet buffer memory allocation and resides in guest address space
 and it is solely responsible to free that memory when not needed.
@@ -79,7 +71,7 @@ This keeps performance up on the RX side, even though the device provides a noti
 
 In the transmit routine, the DPDK application fills packet buffer pointers in the descriptors of the command ring
 and notifies the hypervisor.
-In response the hypervisor takes packets and passes them to the vSwitch. It writes into the completion descriptors ring.
+In response the hypervisor takes packets and passes them to the vSwitch, It writes into the completion descriptors ring.
 The rings are read by the PMD in the next transmit routine call and the buffers and descriptors are freed from memory.
 
 Features and Limitations of VMXNET3 PMD
Signature · 1 line
1.9.1
Acked-by on the v2 series
#21 lore raw
In reply to Yong Wang
Quoted 23 lines · On Tue, 23 Aug 2016 17:05:34 -0700 Yong Wang <[email protected]> wrote:

v2:
* updated vmxnet3 feature doc.
* updated vmxnet3 guide to remove stale information.

v1: This patchset includes a few bug fixes and some enhancement.

* Fixed a bug with dev_configure memzone size;
* Enhanced error checks during device start.
* the driver will now report error if the rx queue number is not a power of two, instead of waiting for the activation to fail.
* Instead of returning -1 (which is interpreted as -EPERM) on device activation failure, -EINVAL is returned now.
* Enabled LRO if requested.

Yong Wang (6):
net/vmxnet3: improve error checks and return values net/vmxnet3: coding style changes net/vmxnet3: reallocate shared memzone on re-config net/vmxnet3: update feature doc net/vmxnet3: update nic doc
net/vmxnet3: enable lro

Quoted 8 lines
 doc/guides/nics/features/vmxnet3.ini |  22 ++++++
 doc/guides/nics/vmxnet3.rst          |  12 +---
 drivers/net/vmxnet3/vmxnet3_ethdev.c | 125 +++++++++++++++++++++--------------
 drivers/net/vmxnet3/vmxnet3_ethdev.h |  32 +++++----
 drivers/net/vmxnet3/vmxnet3_ring.h   |  22 +++---
 drivers/net/vmxnet3/vmxnet3_rxtx.c   |  59 +++++++++--------
 6 files changed, 158 insertions(+), 114 deletions(-)

These all look good to me.

author
#8 lore raw

v3 cover various vmxnet3 fixes and enhancement

In reply to Yong Wang

v3:
* fixed transposed # of tx/rx queue comparison

v2:
* updated vmxnet3 feature doc.
* updated vmxnet3 guide to remove stale information.

v1: This patchset includes a few bug fixes and some enhancement.

* Fixed a bug with dev_configure memzone size;
* Enhanced error checks during device start.
* the driver will now report error if the rx queue number is not a power of two, instead of waiting for the activation to fail.
* Instead of returning -1 (which is interpreted as -EPERM) on device activation failure, -EINVAL is returned now.
* Enabled LRO if requested.

Yong Wang (6):
net/vmxnet3: improve error checks and return values net/vmxnet3: coding style changes net/vmxnet3: reallocate shared memzone on re-config net/vmxnet3: update feature doc net/vmxnet3: update nic doc
net/vmxnet3: enable lro

 doc/guides/nics/features/vmxnet3.ini |  22 ++++++
 doc/guides/nics/vmxnet3.rst          |  12 +---
 drivers/net/vmxnet3/vmxnet3_ethdev.c | 125 +++++++++++++++++++++--------------
 drivers/net/vmxnet3/vmxnet3_ethdev.h |  32 +++++----
 drivers/net/vmxnet3/vmxnet3_ring.h   |  22 +++---
 drivers/net/vmxnet3/vmxnet3_rxtx.c   |  59 +++++++++--------
 6 files changed, 158 insertions(+), 114 deletions(-)
Signature · 1 line
1.9.1
author
#10 lore raw

PATCH v3 2/6 net/vmxnet3: coding style changes

---
 drivers/net/vmxnet3/vmxnet3_ethdev.c | 69 ++++++++++++++++++------------------
 drivers/net/vmxnet3/vmxnet3_ethdev.h | 32 ++++++++---------
 drivers/net/vmxnet3/vmxnet3_ring.h   | 22 ++++++------
 drivers/net/vmxnet3/vmxnet3_rxtx.c   | 59 ++++++++++++++++--------------
 4 files changed, 93 insertions(+), 89 deletions(-)
drivers/net/vmxnet3/vmxnet3_ethdev.c +34 -35
index 3f944c6..d402b83 100644
@@ -81,11 +81,11 @@ static void vmxnet3_dev_promiscuous_disable(struct rte_eth_dev *dev);
 static void vmxnet3_dev_allmulticast_enable(struct rte_eth_dev *dev);
 static void vmxnet3_dev_allmulticast_disable(struct rte_eth_dev *dev);
 static int vmxnet3_dev_link_update(struct rte_eth_dev *dev,
-				int wait_to_complete);
+				   int wait_to_complete);
 static void vmxnet3_dev_stats_get(struct rte_eth_dev *dev,
-				struct rte_eth_stats *stats);
+				  struct rte_eth_stats *stats);
 static void vmxnet3_dev_info_get(struct rte_eth_dev *dev,
-				struct rte_eth_dev_info *dev_info);
+				 struct rte_eth_dev_info *dev_info);
 static const uint32_t *
 vmxnet3_dev_supported_ptypes_get(struct rte_eth_dev *dev);
 static int vmxnet3_dev_vlan_filter_set(struct rte_eth_dev *dev,
@@ -118,7 +118,7 @@ static const struct eth_dev_ops vmxnet3_eth_dev_ops = {
 	.allmulticast_disable = vmxnet3_dev_allmulticast_disable,
 	.link_update          = vmxnet3_dev_link_update,
 	.stats_get            = vmxnet3_dev_stats_get,
-	.mac_addr_set	      = vmxnet3_mac_addr_set,
+	.mac_addr_set         = vmxnet3_mac_addr_set,
 	.dev_infos_get        = vmxnet3_dev_info_get,
 	.dev_supported_ptypes_get = vmxnet3_dev_supported_ptypes_get,
 	.vlan_filter_set      = vmxnet3_dev_vlan_filter_set,
@@ -131,20 +131,19 @@ static const struct eth_dev_ops vmxnet3_eth_dev_ops = {
 
 static const struct rte_memzone *
 gpa_zone_reserve(struct rte_eth_dev *dev, uint32_t size,
-		const char *post_string, int socket_id, uint16_t align)
+		 const char *post_string, int socket_id, uint16_t align)
 {
 	char z_name[RTE_MEMZONE_NAMESIZE];
 	const struct rte_memzone *mz;
 
 	snprintf(z_name, sizeof(z_name), "%s_%d_%s",
-					dev->driver->pci_drv.name, dev->data->port_id, post_string);
+		 dev->driver->pci_drv.name, dev->data->port_id, post_string);
 
 	mz = rte_memzone_lookup(z_name);
 	if (mz)
 		return mz;
 
-	return rte_memzone_reserve_aligned(z_name, size,
-			socket_id, 0, align);
+	return rte_memzone_reserve_aligned(z_name, size, socket_id, 0, align);
 }
 
 /**
@@ -194,7 +193,7 @@ vmxnet3_dev_atomic_write_link_status(struct rte_eth_dev *dev,
 	struct rte_eth_link *src = link;
 
 	if (rte_atomic64_cmpset((uint64_t *)dst, *(uint64_t *)dst,
-					*(uint64_t *)src) == 0)
+				*(uint64_t *)src) == 0)
 		return -1;
 
 	return 0;
@@ -212,7 +211,7 @@ vmxnet3_disable_intr(struct vmxnet3_hw *hw)
 
 	hw->shared->devRead.intrConf.intrCtrl |= VMXNET3_IC_DISABLE_ALL;
 	for (i = 0; i < VMXNET3_MAX_INTRS; i++)
-			VMXNET3_WRITE_BAR0_REG(hw, VMXNET3_REG_IMR + i * 8, 1);
+		VMXNET3_WRITE_BAR0_REG(hw, VMXNET3_REG_IMR + i * 8, 1);
 }
 
 /*
@@ -274,8 +273,8 @@ eth_vmxnet3_dev_init(struct rte_eth_dev *eth_dev)
 	/* Getting MAC Address */
 	mac_lo = VMXNET3_READ_BAR1_REG(hw, VMXNET3_REG_MACL);
 	mac_hi = VMXNET3_READ_BAR1_REG(hw, VMXNET3_REG_MACH);
-	memcpy(hw->perm_addr  , &mac_lo, 4);
-	memcpy(hw->perm_addr+4, &mac_hi, 2);
+	memcpy(hw->perm_addr, &mac_lo, 4);
+	memcpy(hw->perm_addr + 4, &mac_hi, 2);
 
 	/* Allocate memory for storing MAC addresses */
 	eth_dev->data->mac_addrs = rte_zmalloc("vmxnet3", ETHER_ADDR_LEN *
@@ -343,7 +342,7 @@ static struct eth_driver rte_vmxnet3_pmd = {
  * Register itself as the [Poll Mode] Driver of Virtual PCI VMXNET3 devices.
  */
 static int
-rte_vmxnet3_pmd_init(const char *name __rte_unused, const char *param __rte_unused)
+rte_vmxnet3_pmd_init(__rte_unused const char *name, __rte_unused const char *param)
 {
 	PMD_INIT_FUNC_TRACE();
 
@@ -415,7 +414,6 @@ vmxnet3_dev_configure(struct rte_eth_dev *dev)
 	hw->queue_desc_len = (uint16_t)size;
 
 	if (dev->data->dev_conf.rxmode.mq_mode == ETH_MQ_RX_RSS) {
-
 		/* Allocate memory structure for UPT1_RSSConf and configure */
 		mz = gpa_zone_reserve(dev, sizeof(struct VMXNET3_RSSConf), "rss_conf",
 				      rte_socket_id(), RTE_CACHE_LINE_SIZE);
@@ -466,8 +464,7 @@ vmxnet3_setup_driver_shared(struct rte_eth_dev *dev)
 
 	/* Setting up Guest OS information */
 	devRead->misc.driverInfo.gos.gosBits   = sizeof(void *) == 4 ?
-		VMXNET3_GOS_BITS_32 :
-		VMXNET3_GOS_BITS_64;
+		VMXNET3_GOS_BITS_32 : VMXNET3_GOS_BITS_64;
 	devRead->misc.driverInfo.gos.gosType   = VMXNET3_GOS_TYPE_LINUX;
 	devRead->misc.driverInfo.vmxnet3RevSpt = 1;
 	devRead->misc.driverInfo.uptVerSpt     = 1;
@@ -542,7 +539,7 @@ vmxnet3_setup_driver_shared(struct rte_eth_dev *dev)
 	}
 
 	vmxnet3_dev_vlan_offload_set(dev,
-			     ETH_VLAN_STRIP_MASK | ETH_VLAN_FILTER_MASK);
+				     ETH_VLAN_STRIP_MASK | ETH_VLAN_FILTER_MASK);
 
 	vmxnet3_write_mac(hw, hw->perm_addr);
 
@@ -671,16 +668,15 @@ vmxnet3_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
 		struct UPT1_TxStats *txStats = &hw->tqd_start[i].stats;
 
 		stats->q_opackets[i] = txStats->ucastPktsTxOK +
-			txStats->mcastPktsTxOK +
-			txStats->bcastPktsTxOK;
+					txStats->mcastPktsTxOK +
+					txStats->bcastPktsTxOK;
 		stats->q_obytes[i] = txStats->ucastBytesTxOK +
-			txStats->mcastBytesTxOK +
-			txStats->bcastBytesTxOK;
+					txStats->mcastBytesTxOK +
+					txStats->bcastBytesTxOK;
 
 		stats->opackets += stats->q_opackets[i];
 		stats->obytes += stats->q_obytes[i];
-		stats->oerrors += txStats->pktsTxError +
-			txStats->pktsTxDiscard;
+		stats->oerrors += txStats->pktsTxError + txStats->pktsTxDiscard;
 	}
 
 	RTE_BUILD_BUG_ON(RTE_ETHDEV_QUEUE_STAT_CNTRS < VMXNET3_MAX_RX_QUEUES);
@@ -688,12 +684,12 @@ vmxnet3_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
 		struct UPT1_RxStats *rxStats = &hw->rqd_start[i].stats;
 
 		stats->q_ipackets[i] = rxStats->ucastPktsRxOK +
-			rxStats->mcastPktsRxOK +
-			rxStats->bcastPktsRxOK;
+					rxStats->mcastPktsRxOK +
+					rxStats->bcastPktsRxOK;
 
 		stats->q_ibytes[i] = rxStats->ucastBytesRxOK +
-			rxStats->mcastBytesRxOK +
-			rxStats->bcastBytesRxOK;
+					rxStats->mcastBytesRxOK +
+					rxStats->bcastBytesRxOK;
 
 		stats->ipackets += stats->q_ipackets[i];
 		stats->ibytes += stats->q_ibytes[i];
@@ -705,7 +701,7 @@ vmxnet3_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
 }
 
 static void
-vmxnet3_dev_info_get(__attribute__((unused))struct rte_eth_dev *dev,
+vmxnet3_dev_info_get(__rte_unused struct rte_eth_dev *dev,
 		     struct rte_eth_dev_info *dev_info)
 {
 	dev_info->max_rx_queues = VMXNET3_MAX_RX_QUEUES;
@@ -765,14 +761,16 @@ vmxnet3_mac_addr_set(struct rte_eth_dev *dev, struct ether_addr *mac_addr)
 
 /* return 0 means link status changed, -1 means not changed */
 static int
-vmxnet3_dev_link_update(struct rte_eth_dev *dev, __attribute__((unused)) int wait_to_complete)
+vmxnet3_dev_link_update(struct rte_eth_dev *dev,
+			__rte_unused int wait_to_complete)
 {
 	struct vmxnet3_hw *hw = dev->data->dev_private;
 	struct rte_eth_link old, link;
 	uint32_t ret;
 
+	/* Link status doesn't change for stopped dev */
 	if (dev->data->dev_started == 0)
-		return -1; /* Link status doesn't change for stopped dev */
+		return -1;
 
 	memset(&link, 0, sizeof(link));
 	vmxnet3_dev_atomic_read_link_status(dev, &old);
@@ -794,8 +792,8 @@ vmxnet3_dev_link_update(struct rte_eth_dev *dev, __attribute__((unused)) int wai
 
 /* Updating rxmode through Vmxnet3_DriverShared structure in adapter */
 static void
-vmxnet3_dev_set_rxmode(struct vmxnet3_hw *hw, uint32_t feature, int set) {
-
+vmxnet3_dev_set_rxmode(struct vmxnet3_hw *hw, uint32_t feature, int set)
+{
 	struct Vmxnet3_RxFilterConf *rxConf = &hw->shared->devRead.rxFilterConf;
 
 	if (set)
@@ -928,11 +926,13 @@ vmxnet3_process_events(struct vmxnet3_hw *hw)
 	/* Check if link state has changed */
 	if (events & VMXNET3_ECR_LINK)
 		PMD_INIT_LOG(ERR,
-			     "Process events in %s(): VMXNET3_ECR_LINK event", __func__);
+			     "Process events in %s(): VMXNET3_ECR_LINK event",
+			     __func__);
 
 	/* Check if there is an error on xmit/recv queues */
 	if (events & (VMXNET3_ECR_TQERR | VMXNET3_ECR_RQERR)) {
-		VMXNET3_WRITE_BAR1_REG(hw, VMXNET3_REG_CMD, VMXNET3_CMD_GET_QUEUE_STATUS);
+		VMXNET3_WRITE_BAR1_REG(hw, VMXNET3_REG_CMD,
+				       VMXNET3_CMD_GET_QUEUE_STATUS);
 
 		if (hw->tqd_start->status.stopped)
 			PMD_INIT_LOG(ERR, "tq error 0x%x",
@@ -951,7 +951,6 @@ vmxnet3_process_events(struct vmxnet3_hw *hw)
 
 	if (events & VMXNET3_ECR_DEBUG)
 		PMD_INIT_LOG(ERR, "Debug event generated by device.");
-
 }
 #endif
 
drivers/net/vmxnet3/vmxnet3_ethdev.h +15 -17
index 1be833a..7d3b11e 100644
@@ -62,8 +62,7 @@
 	ETH_RSS_NONFRAG_IPV6_TCP)
 
 /* RSS configuration structure - shared with device through GPA */
-typedef
-struct VMXNET3_RSSConf {
+typedef struct VMXNET3_RSSConf {
 	uint16_t   hashType;
 	uint16_t   hashFunc;
 	uint16_t   hashKeySize;
@@ -76,15 +75,13 @@ struct VMXNET3_RSSConf {
 	uint8_t    indTable[VMXNET3_RSS_MAX_IND_TABLE_SIZE];
 } VMXNET3_RSSConf;
 
-typedef
-struct vmxnet3_mf_table {
+typedef struct vmxnet3_mf_table {
 	void          *mfTableBase; /* Multicast addresses list */
 	uint64_t      mfTablePA;    /* Physical address of the list */
 	uint16_t      num_addrs;    /* number of multicast addrs */
 } vmxnet3_mf_table_t;
 
 struct vmxnet3_hw {
-
 	uint8_t *hw_addr0;	/* BAR0: PT-Passthrough Regs    */
 	uint8_t *hw_addr1;	/* BAR1: VD-Virtual Device Regs */
 	/* BAR2: MSI-X Regs */
@@ -111,10 +108,10 @@ struct vmxnet3_hw {
 	uint64_t              queueDescPA;
 	uint16_t              queue_desc_len;
 
-	VMXNET3_RSSConf		 *rss_conf;
-	uint64_t			 rss_confPA;
-	vmxnet3_mf_table_t   *mf_table;
-	uint32_t	      shadow_vfta[VMXNET3_VFT_SIZE];
+	VMXNET3_RSSConf       *rss_conf;
+	uint64_t              rss_confPA;
+	vmxnet3_mf_table_t    *mf_table;
+	uint32_t              shadow_vfta[VMXNET3_VFT_SIZE];
 #define VMXNET3_VFT_TABLE_SIZE     (VMXNET3_VFT_SIZE * sizeof(uint32_t))
 };
 
@@ -125,7 +122,8 @@ struct vmxnet3_hw {
 
 #define VMXNET3_PCI_REG(reg) (*((volatile uint32_t *)(reg)))
 
-static inline uint32_t vmxnet3_read_addr(volatile void *addr)
+static inline uint32_t
+vmxnet3_read_addr(volatile void *addr)
 {
 	return VMXNET3_PCI_REG(addr);
 }
@@ -158,20 +156,20 @@ void vmxnet3_dev_rx_queue_release(void *rxq);
 void vmxnet3_dev_tx_queue_release(void *txq);
 
 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);
+				uint16_t nb_rx_desc, unsigned int socket_id,
+				const struct rte_eth_rxconf *rx_conf,
+				struct rte_mempool *mb_pool);
 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);
+				uint16_t nb_tx_desc, unsigned int socket_id,
+				const struct rte_eth_txconf *tx_conf);
 
 int vmxnet3_dev_rxtx_init(struct rte_eth_dev *dev);
 
 int vmxnet3_rss_configure(struct rte_eth_dev *dev);
 
 uint16_t vmxnet3_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
-		uint16_t nb_pkts);
+			   uint16_t nb_pkts);
 uint16_t vmxnet3_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
-		uint16_t nb_pkts);
+			   uint16_t nb_pkts);
 
 #endif /* _VMXNET3_ETHDEV_H_ */
drivers/net/vmxnet3/vmxnet3_ring.h +11 -11
index 69ff2de..b50d2b0 100644
@@ -96,12 +96,12 @@ vmxnet3_cmd_ring_desc_empty(struct vmxnet3_cmd_ring *ring)
 }
 
 typedef struct vmxnet3_comp_ring {
-	uint32_t	       size;
-	uint32_t	       next2proc;
-	uint8_t		       gen;
-	uint8_t		       intr_idx;
+	uint32_t               size;
+	uint32_t               next2proc;
+	uint8_t                gen;
+	uint8_t                intr_idx;
 	Vmxnet3_GenericDesc    *base;
-	uint64_t	       basePA;
+	uint64_t               basePA;
 } vmxnet3_comp_ring_t;
 
 struct vmxnet3_data_ring {
@@ -121,13 +121,13 @@ vmxnet3_comp_ring_adv_next2proc(struct vmxnet3_comp_ring *ring)
 }
 
 struct vmxnet3_txq_stats {
-	uint64_t	drop_total; /* # of pkts dropped by the driver,
+	uint64_t        drop_total; /* # of pkts dropped by the driver,
 				     * the counters below track droppings due to
 				     * different reasons
 				     */
-	uint64_t	drop_too_many_segs;
-	uint64_t	drop_tso;
-	uint64_t	tx_ring_full;
+	uint64_t        drop_too_many_segs;
+	uint64_t        drop_tso;
+	uint64_t        tx_ring_full;
 };
 
 typedef struct vmxnet3_tx_queue {
@@ -158,8 +158,8 @@ typedef struct vmxnet3_rx_queue {
 	uint32_t                    qid1;
 	uint32_t                    qid2;
 	Vmxnet3_RxQueueDesc         *shared;
-	struct rte_mbuf		    *start_seg;
-	struct rte_mbuf		    *last_seg;
+	struct rte_mbuf             *start_seg;
+	struct rte_mbuf             *last_seg;
 	struct vmxnet3_rxq_stats    stats;
 	bool                        stopped;
 	uint16_t                    queue_id;      /**< Device RX queue index. */
drivers/net/vmxnet3/vmxnet3_rxtx.c +33 -26

177 lines not on this page · raw message

Signature · 1 line
1.9.1
author
#13 lore raw

PATCH v3 5/6 net/vmxnet3: update nic doc

In reply to Yong Wang
---
 doc/guides/nics/vmxnet3.rst | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)
doc/guides/nics/vmxnet3.rst +2 -10
index e919088..bf84594 100644
@@ -32,17 +32,11 @@ Poll Mode Driver for Paravirtual VMXNET3 NIC
 ============================================
 
 The VMXNET3 adapter is the next generation of a paravirtualized NIC, introduced by VMware* ESXi.
-It is designed for performance and is not related to VMXNET or VMXENET2.
-It offers all the features available in VMXNET2, and adds several new features such as,
+It is designed for performance, offers all the features available in VMXNET2, and adds several new features such as,
 multi-queue support (also known as Receive Side Scaling, RSS),
 IPv6 offloads, and MSI/MSI-X interrupt delivery.
-Because operating system vendors do not provide built-in drivers for this card,
-VMware Tools must be installed to have a driver for the VMXNET3 network adapter available.
 One can use the same device in a DPDK application with VMXNET3 PMD introduced in DPDK API.
 
-Currently, the driver provides basic support for using the device in a DPDK application running on a guest OS.
-Optimization is needed on the backend, that is, the VMware* ESXi vmkernel switch, to achieve optimal performance end-to-end.
-
 In this chapter, two setups with the use of the VMXNET3 PMD are demonstrated:
 
 #.  Vmxnet3 with a native NIC connected to a vSwitch
@@ -59,8 +53,6 @@ For performance details, refer to the following link from VMware:
 `http://www.vmware.com/pdf/vsp_4_vmxnet3_perf.pdf <http://www.vmware.com/pdf/vsp_4_vmxnet3_perf.pdf>`_
 
 As a PMD, the VMXNET3 driver provides the packet reception and transmission callbacks, vmxnet3_recv_pkts and vmxnet3_xmit_pkts.
-It does not support scattered packet reception as part of vmxnet3_recv_pkts and vmxnet3_xmit_pkts.
-Also, it does not support scattered packet reception as part of the device operations supported.
 
 The VMXNET3 PMD handles all the packet buffer memory allocation and resides in guest address space
 and it is solely responsible to free that memory when not needed.
@@ -79,7 +71,7 @@ This keeps performance up on the RX side, even though the device provides a noti
 
 In the transmit routine, the DPDK application fills packet buffer pointers in the descriptors of the command ring
 and notifies the hypervisor.
-In response the hypervisor takes packets and passes them to the vSwitch. It writes into the completion descriptors ring.
+In response the hypervisor takes packets and passes them to the vSwitch, It writes into the completion descriptors ring.
 The rings are read by the PMD in the next transmit routine call and the buffers and descriptors are freed from memory.
 
 Features and Limitations of VMXNET3 PMD
Signature · 1 line
1.9.1
author
#14 lore raw

PATCH v3 6/6 net/vmxnet3: enable lro

In reply to Yong Wang

The current implementation of jumbo frame rx can be used for LRO directly without changes. This change enables device LRO if requested.

Note that since jumbo frame uses both ring0 and ring1, it cannot be enabled in UPT (VMDirectPath) mode.

---
 doc/guides/nics/features/vmxnet3.ini | 1 +
 drivers/net/vmxnet3/vmxnet3_ethdev.c | 8 +++++++-
 2 files changed, 8 insertions(+), 1 deletion(-)
doc/guides/nics/features/vmxnet3.ini +1 -0
index c5c75ad..ef95932 100644
@@ -9,6 +9,7 @@ Link status event    = Y
 Queue start/stop     = Y
 MTU update           = Y
 Jumbo frame          = Y
+LRO                  = Y
 TSO                  = Y
 Promiscuous mode     = Y
 Allmulticast mode    = Y
drivers/net/vmxnet3/vmxnet3_ethdev.c +7 -1
index cdbcb78..a41106d 100644
@@ -540,6 +540,11 @@ vmxnet3_setup_driver_shared(struct rte_eth_dev *dev)
 	if (dev->data->dev_conf.rxmode.hw_ip_checksum)
 		devRead->misc.uptFeatures |= VMXNET3_F_RXCSUM;
 
+	if (dev->data->dev_conf.rxmode.enable_lro) {
+		devRead->misc.uptFeatures |= VMXNET3_F_LRO;
+		devRead->misc.maxNumRxSG = 0;
+	}
+
 	if (port_conf.rxmode.mq_mode == ETH_MQ_RX_RSS) {
 		ret = vmxnet3_rss_configure(dev);
 		if (ret != VMXNET3_SUCCESS)
@@ -741,7 +746,8 @@ vmxnet3_dev_info_get(__rte_unused struct rte_eth_dev *dev,
 	dev_info->rx_offload_capa =
 		DEV_RX_OFFLOAD_VLAN_STRIP |
 		DEV_RX_OFFLOAD_UDP_CKSUM |
-		DEV_RX_OFFLOAD_TCP_CKSUM;
+		DEV_RX_OFFLOAD_TCP_CKSUM |
+		DEV_RX_OFFLOAD_TCP_LRO;
 
 	dev_info->tx_offload_capa =
 		DEV_TX_OFFLOAD_VLAN_INSERT |
Signature · 1 line
1.9.1
author
#9 lore raw

PATCH v3 1/6 net/vmxnet3: improve error checks and return values

In reply to Yong Wang
---
 drivers/net/vmxnet3/vmxnet3_ethdev.c | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)
drivers/net/vmxnet3/vmxnet3_ethdev.c +15 -8
index 5874215..3f944c6 100644
@@ -360,9 +360,16 @@ vmxnet3_dev_configure(struct rte_eth_dev *dev)
 
 	PMD_INIT_FUNC_TRACE();
 
-	if (dev->data->nb_rx_queues > UINT8_MAX ||
-	    dev->data->nb_tx_queues > UINT8_MAX)
+	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 (!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;
+	}
 
 	size = dev->data->nb_rx_queues * sizeof(struct Vmxnet3_TxQueueDesc) +
 		dev->data->nb_tx_queues * sizeof(struct Vmxnet3_RxQueueDesc);
@@ -550,7 +557,7 @@ vmxnet3_setup_driver_shared(struct rte_eth_dev *dev)
 static int
 vmxnet3_dev_start(struct rte_eth_dev *dev)
 {
-	int status, ret;
+	int ret;
 	struct vmxnet3_hw *hw = dev->data->dev_private;
 
 	PMD_INIT_FUNC_TRACE();
@@ -567,11 +574,11 @@ vmxnet3_dev_start(struct rte_eth_dev *dev)
 
 	/* Activate device by register write */
 	VMXNET3_WRITE_BAR1_REG(hw, VMXNET3_REG_CMD, VMXNET3_CMD_ACTIVATE_DEV);
-	status = VMXNET3_READ_BAR1_REG(hw, VMXNET3_REG_CMD);
+	ret = VMXNET3_READ_BAR1_REG(hw, VMXNET3_REG_CMD);
 
-	if (status != 0) {
+	if (ret != 0) {
 		PMD_INIT_LOG(ERR, "Device activation: UNSUCCESSFUL");
-		return -1;
+		return -EINVAL;
 	}
 
 	/* Disable interrupts */
@@ -583,7 +590,7 @@ vmxnet3_dev_start(struct rte_eth_dev *dev)
 	 */
 	ret = vmxnet3_dev_rxtx_init(dev);
 	if (ret != VMXNET3_SUCCESS) {
-		PMD_INIT_LOG(ERR, "Device receive init: UNSUCCESSFUL");
+		PMD_INIT_LOG(ERR, "Device queue init: UNSUCCESSFUL");
 		return ret;
 	}
 
@@ -598,7 +605,7 @@ vmxnet3_dev_start(struct rte_eth_dev *dev)
 	PMD_INIT_LOG(DEBUG, "Reading events: 0x%X", events);
 	vmxnet3_process_events(hw);
 #endif
-	return status;
+	return VMXNET3_SUCCESS;
 }
 
 /*
Signature · 1 line
1.9.1
author
#11 lore raw

PATCH v3 3/6 net/vmxnet3: reallocate shared memzone on re-config

In reply to Yong Wang

When adding a DPDK port to a bridge using ovs-vswitchd with DPDK, the vmxnet3 device fails to activate due to mismatched magic number. Doing this will incur the following operations: start the port, stop the port, reconfigure and re-start the port. The reconfig could request different number of tx/rx queues but the driver bypasses allocating the queuedesc memzone of proper size (which depends on the queue size) if there is an existing one. This results in a memzone with wrong size and potential invalid memory access. To fix this, this change will free the memzone if found and reserve a new one.

---
 drivers/net/vmxnet3/vmxnet3_ethdev.c | 27 ++++++++++++++++++++-------
 1 file changed, 20 insertions(+), 7 deletions(-)
drivers/net/vmxnet3/vmxnet3_ethdev.c +20 -7
index d402b83..cdbcb78 100644
@@ -131,7 +131,8 @@ static const struct eth_dev_ops vmxnet3_eth_dev_ops = {
 
 static const struct rte_memzone *
 gpa_zone_reserve(struct rte_eth_dev *dev, uint32_t size,
-		 const char *post_string, int socket_id, uint16_t align)
+		 const char *post_string, int socket_id,
+		 uint16_t align, bool reuse)
 {
 	char z_name[RTE_MEMZONE_NAMESIZE];
 	const struct rte_memzone *mz;
@@ -140,6 +141,13 @@ gpa_zone_reserve(struct rte_eth_dev *dev, uint32_t size,
 		 dev->driver->pci_drv.name, dev->data->port_id, post_string);
 
 	mz = rte_memzone_lookup(z_name);
+	if (!reuse) {
+		if (mz)
+			rte_memzone_free(mz);
+		return rte_memzone_reserve_aligned(z_name, size, socket_id,
+						   0, align);
+	}
+
 	if (mz)
 		return mz;
 
@@ -384,7 +392,7 @@ vmxnet3_dev_configure(struct rte_eth_dev *dev)
 	 * on current socket
 	 */
 	mz = gpa_zone_reserve(dev, sizeof(struct Vmxnet3_DriverShared),
-			      "shared", rte_socket_id(), 8);
+			      "shared", rte_socket_id(), 8, 1);
 
 	if (mz == NULL) {
 		PMD_INIT_LOG(ERR, "ERROR: Creating shared zone");
@@ -397,10 +405,14 @@ vmxnet3_dev_configure(struct rte_eth_dev *dev)
 
 	/*
 	 * Allocate a memzone for Vmxnet3_RxQueueDesc - Vmxnet3_TxQueueDesc
-	 * on current socket
+	 * on current socket.
+	 *
+	 * We cannot reuse this memzone from previous allocation as its size
+	 * depends on the number of tx and rx queues, which could be different
+	 * from one config to another.
 	 */
-	mz = gpa_zone_reserve(dev, size, "queuedesc",
-			      rte_socket_id(), VMXNET3_QUEUE_DESC_ALIGN);
+	mz = gpa_zone_reserve(dev, size, "queuedesc", rte_socket_id(),
+			      VMXNET3_QUEUE_DESC_ALIGN, 0);
 	if (mz == NULL) {
 		PMD_INIT_LOG(ERR, "ERROR: Creating queue descriptors zone");
 		return -ENOMEM;
@@ -415,8 +427,9 @@ vmxnet3_dev_configure(struct rte_eth_dev *dev)
 
 	if (dev->data->dev_conf.rxmode.mq_mode == ETH_MQ_RX_RSS) {
 		/* Allocate memory structure for UPT1_RSSConf and configure */
-		mz = gpa_zone_reserve(dev, sizeof(struct VMXNET3_RSSConf), "rss_conf",
-				      rte_socket_id(), RTE_CACHE_LINE_SIZE);
+		mz = gpa_zone_reserve(dev, sizeof(struct VMXNET3_RSSConf),
+				      "rss_conf", rte_socket_id(),
+				      RTE_CACHE_LINE_SIZE, 1);
 		if (mz == NULL) {
 			PMD_INIT_LOG(ERR,
 				     "ERROR: Creating rss_conf structure zone");
Signature · 1 line
1.9.1
author
#12 lore raw

PATCH v3 4/6 net/vmxnet3: update feature doc

In reply to Yong Wang
---
 doc/guides/nics/features/vmxnet3.ini | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
doc/guides/nics/features/vmxnet3.ini +21 -0
index 20a4c32..c5c75ad 100644
@@ -4,3 +4,24 @@
 ; Refer to default.ini for the full list of available PMD features.
 ;
 [Features]
+Link status          = Y
+Link status event    = Y
+Queue start/stop     = Y
+MTU update           = Y
+Jumbo frame          = Y
+TSO                  = Y
+Promiscuous mode     = Y
+Allmulticast mode    = Y
+Unicast MAC filter   = Y
+RSS hash             = Y
+VLAN filter          = Y
+VLAN offload         = Y
+L4 checksum offload  = Y
+Packet type parsing  = Y
+Basic stats          = Y
+Stats per queue      = Y
+Linux UIO            = Y
+Linux VFIO           = Y
+x86-32               = Y
+x86-64               = Y
+Usage doc            = Y
Signature · 1 line
1.9.1
#15 lore raw
In reply to Yong Wang
Quoted 18 lines · Yong Wang

v3:
* fixed transposed # of tx/rx queue comparison

v2:
* updated vmxnet3 feature doc.
* updated vmxnet3 guide to remove stale information.

v1: This patchset includes a few bug fixes and some enhancement.

* Fixed a bug with dev_configure memzone size;
* Enhanced error checks during device start.
* the driver will now report error if the rx queue number is not a power of two, instead of waiting for the activation to fail.
* Instead of returning -1 (which is interpreted as -EPERM) on device activation failure, -EINVAL is returned now.
* Enabled LRO if requested.

Quoted 8 lines

Yong Wang (6):
net/vmxnet3: improve error checks and return values net/vmxnet3: coding style changes net/vmxnet3: reallocate shared memzone on re-config net/vmxnet3: update feature doc net/vmxnet3: update nic doc
net/vmxnet3: enable lro

Applied to dpdk-next-net/rel_16_11

/Bruce