Skip to contentSkip to conversation

net/ena: minor fixes and docs update

PATCH In review Michal Krawczyk 2 participants 7 messages Jan 25, 2019 – Jan 27, 2019 Network drivers

lore
Share & tools
lore
#0 lore raw

cover net/ena: minor fixes and docs update

Hi,

we would like to push fixes for part of the bugs reported in Bug 193, together with docs update for ENAv2 about enabling WC support, release notes and fix for assigning rte_errno negative values, as requested by the community.

Michal Krawczyk (3):
net/ena: remove lcore constraint from max queue number net/ena: fix dev init for RTE_PROC_SECONDARY net/ena: fix setting rte_errno to negative value

Rafal Kozik (2):
doc: update release notes for ENA PMD
doc: add instructions for enabling WC in ENAv2 PMD

 doc/guides/nics/ena.rst                | 16 ++++++++++++++--
 doc/guides/rel_notes/release_19_02.rst | 19 +++++++++++++++++++
 drivers/net/ena/ena_ethdev.c           | 20 ++++++++++----------
 3 files changed, 43 insertions(+), 12 deletions(-)
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/5 net/ena: remove lcore constraint from max queue number

The number of queues was limited by number of lcores in the recent ENAv2 patch. However, some apps like symmetric_mp, are configuring multiple queues although there is only single lcore used.

To prevent failure in that case, the lcore number constraint was removed.

Fixes ea93d37eb49d ("net/ena: add HW queues depth setup")
---
 drivers/net/ena/ena_ethdev.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/ena/ena_ethdev.c +1 -2
index 3022dda..fde5fa7 100644
@@ -1687,8 +1687,7 @@ static int ena_calc_io_queue_num(struct ena_com_dev *ena_dev,
 	if (ena_dev->tx_mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_DEV)
 		io_tx_sq_num = get_feat_ctx->llq.max_llq_num;
 
-	io_queue_num = RTE_MIN(rte_lcore_count(), ENA_MAX_NUM_IO_QUEUES);
-	io_queue_num = RTE_MIN(io_queue_num, io_rx_num);
+	io_queue_num = RTE_MIN(ENA_MAX_NUM_IO_QUEUES, io_rx_num);
 	io_queue_num = RTE_MIN(io_queue_num, io_tx_sq_num);
 	io_queue_num = RTE_MIN(io_queue_num, io_tx_cq_num);
 
Signature · 1 line
2.7.4
#2 lore raw

PATCH 2/5 net/ena: fix dev init for RTE_PROC_SECONDARY

In reply to Michal Krawczyk

The check for proc type in eth_ena_dev_init() should appear before modyfing adapter structure.

Calling memset on ena_adapter from secondary process context, was erasing all structure information, and it was causing the crash of the main process.

Fixes 1173fca25af9 ("ena: add polling-mode driver")
---
 drivers/net/ena/ena_ethdev.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
drivers/net/ena/ena_ethdev.c +6 -5
index fde5fa7..747390b 100644
@@ -1715,19 +1715,20 @@ static int eth_ena_dev_init(struct rte_eth_dev *eth_dev)
 	static int adapters_found;
 	bool wd_state;
 
-	memset(adapter, 0, sizeof(struct ena_adapter));
-	ena_dev = &adapter->ena_dev;
-
 	eth_dev->dev_ops = &ena_dev_ops;
 	eth_dev->rx_pkt_burst = &eth_ena_recv_pkts;
 	eth_dev->tx_pkt_burst = &eth_ena_xmit_pkts;
 	eth_dev->tx_pkt_prepare = &eth_ena_prep_pkts;
-	adapter->rte_eth_dev_data = eth_dev->data;
-	adapter->rte_dev = eth_dev;
 
 	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
 		return 0;
 
+	memset(adapter, 0, sizeof(struct ena_adapter));
+	ena_dev = &adapter->ena_dev;
+
+	adapter->rte_eth_dev_data = eth_dev->data;
+	adapter->rte_dev = eth_dev;
+
 	pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
 	adapter->pdev = pci_dev;
 
Signature · 1 line
2.7.4
#3 lore raw

PATCH 3/5 net/ena: fix setting rte_errno to negative value

In reply to Michal Krawczyk

The rte_errno shouldn't have assigned negative error codes, so it has to be fixed.

Fixes b3fc5a1ae10d ("net/ena: add Tx preparation")
---
 drivers/net/ena/ena_ethdev.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/ena/ena_ethdev.c +3 -3
index 747390b..8bb05ca 100644
@@ -2178,14 +2178,14 @@ eth_ena_prep_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 		if ((ol_flags & ENA_TX_OFFLOAD_NOTSUP_MASK) != 0 ||
 				(ol_flags & PKT_TX_L4_MASK) ==
 				PKT_TX_SCTP_CKSUM) {
-			rte_errno = -ENOTSUP;
+			rte_errno = ENOTSUP;
 			return i;
 		}
 
 #ifdef RTE_LIBRTE_ETHDEV_DEBUG
 		ret = rte_validate_tx_offload(m);
 		if (ret != 0) {
-			rte_errno = ret;
+			rte_errno = -ret;
 			return i;
 		}
 #endif
@@ -2198,7 +2198,7 @@ eth_ena_prep_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 		ret = rte_net_intel_cksum_flags_prepare(m,
 			ol_flags & ~PKT_TX_TCP_SEG);
 		if (ret != 0) {
-			rte_errno = ret;
+			rte_errno = -ret;
 			return i;
 		}
 	}
Signature · 1 line
2.7.4
#4 lore raw

PATCH 4/5 doc: update release notes for ENA PMD

In reply to Michal Krawczyk

From: Rafal Kozik <[email protected]>

Add changes in ENA PMD to DPDK v19.02 release notes.

---
 doc/guides/rel_notes/release_19_02.rst | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
doc/guides/rel_notes/release_19_02.rst +19 -0
index 57c595b..15a92d5 100644
@@ -155,6 +155,25 @@ New Features
   the intel_pstate kernel driver is now supported, and automatically
   detected by the library.
 
+* **Release of the ENA PMD v2.0.0**
+
+  * Added Low Latency Queue v2 (LLQv2). This feature reduces the latency
+    of the packets by pushing the header directly through the PCI to the
+    device. This allows the NIC to start handle packet right after the doorbell
+    without waiting for DMA.
+  * Added independent configuration of HW Tx and Rx ring depths.
+  * Added support for up to 8k Rx descriptors per ring.
+  * Added additional doorbell check on Tx, to handle Tx more efficiently for big
+    bursts of packets.
+  * Added per queue statistics.
+  * Added extended statistics using xstats DPDK API.
+  * The reset routine was aligned with the DPDK API, so now it can be
+    handled as in other PMDs.
+  * Fixed out of order (OOO) completion.
+  * Fixed memory leaks due to port stops and starts in the middle of
+    traffic.
+  * Updated documentation and features list of the PMD.
+
 
 Removed Items
 -------------
Signature · 1 line
2.7.4
#5 lore raw

PATCH 5/5 doc: add instructions for enabling WC in ENAv2 PMD

In reply to Michal Krawczyk

From: Rafal Kozik <[email protected]>

ENAv2 hardware provides Low Latency Queue v2 (LLQv2). It needs kernel PCI driver to support write combining (WC). This patch add information how to use it with igb_uio and vfio-pci drivers.

---
 doc/guides/nics/ena.rst | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)
doc/guides/nics/ena.rst +14 -2
index 9f0a650..80da4b6 100644
@@ -183,10 +183,22 @@ Prerequisites
 #. Prepare the system as recommended by DPDK suite.  This includes environment
    variables, hugepages configuration, tool-chains and configuration.
 
-#. ENA PMD can operate with ``vfio-pci`` or ``igb_uio`` driver.
+#. ENA PMD can operate with ``vfio-pci``(*) or ``igb_uio`` driver.
+
+   (*) ENAv2 hardware supports Low Latency Queue v2 (LLQv2). This feature
+   reduces the latency of the packets by pushing the header directly through
+   the PCI to the device, before the DMA is even triggered. For proper work
+   kernel PCI driver must support write combining (WC). In mainline version of
+   ``igb_uio`` (in DPDK repo) it must be enabled by loding module with
+   ``wc_activate=1`` flag (example below). However, mainline's vfio-pci
+   driver in kernel doesn't have WC support yet (planed to be added).
+   If vfio-pci used user should be either turn off ENAv2 (to avoid performance
+   impact) or recompile vfio-pci driver with patch provided in
+   `amzn-github <https://github.com/amzn/amzn-drivers/tree/master/userspace/dpdk/enav2-vfio-patch>`_.
 
 #. Insert ``vfio-pci`` or ``igb_uio`` kernel module using the command
-   ``modprobe vfio-pci`` or ``modprobe igb_uio`` respectively.
+   ``modprobe vfio-pci`` or ``modprobe uio; insmod igb_uio.ko wc_activate=1``
+   respectively.
 
 #. For ``vfio-pci`` users only:
    Please make sure that ``IOMMU`` is enabled in your system,
Signature · 1 line
2.7.4
#6 lore raw
In reply to Michal Krawczyk

25/01/2019 09:10, Michal Krawczyk:

Quoted 12 lines

Hi,

we would like to push fixes for part of the bugs reported in Bug 193, together with docs update for ENAv2 about enabling WC support, release notes and fix for assigning rte_errno negative values, as requested by the community.

Michal Krawczyk (3):
net/ena: remove lcore constraint from max queue number net/ena: fix dev init for RTE_PROC_SECONDARY net/ena: fix setting rte_errno to negative value

Quoted 8 lines

Rafal Kozik (2):
doc: update release notes for ENA PMD
doc: add instructions for enabling WC in ENAv2 PMD

 doc/guides/nics/ena.rst                | 16 ++++++++++++++--
 doc/guides/rel_notes/release_19_02.rst | 19 +++++++++++++++++++
 drivers/net/ena/ena_ethdev.c           | 20 ++++++++++----------
 3 files changed, 43 insertions(+), 12 deletions(-)

This patchset is sent very late in the cycle.
After some thoughts (with Ferruh), I decide to merge it in 19.02. I hope there will be no more request for ENA in this release, and please avoid this situation in future.