Skip to contentSkip to conversation

AF_XDP tx halt fix, IRQ pinning and unaligned chunks

PATCH Applied Ciara Loftus 8 participants 27 messages Sep 30, 2019 – Oct 24, 2019 Network drivers

lore
Share & tools
lore
#0 lore raw

v2 cover AF_XDP tx halt fix, IRQ pinning and unaligned chunks

This series contains 3 patches for the AF_XDP PMD.

Previous: http://mails.dpdk.org/archives/dev/2019-September/143910.html

Patch 1: fix Tx halt when no recv packets (Xiaolong Ye)

Patch 2: support pinning of IRQs
v1 -> v2:
* Change enum format to match coding style
* Change some variables to const
* Re-order arguments in functions
* Do not duplicate driver string in generate_search_idx
* Check if driver handler function ptr is !NULL before using
* Check return value of fwrite
* Use rte_memcpy

Patch 3: enable support for unaligned umem chunks
v1 -> v2:
* Take mbuf alloc out of reserve_fill_queue
* Free correct mbuf on reserve fail for tx

The performance of the new zero copy implementation was measured to be within 5% of the previous zero copy implementation, generally with an improvement observed for single-core (with need wakeup) and multiple-PMD test cases.

Ciara Loftus (2):
net/af_xdp: support pinning of IRQs net/af_xdp: enable support for unaligned umem chunks

Xiaolong Ye (1):
net/af_xdp: fix Tx halt when no recv packets

 doc/guides/nics/af_xdp.rst             |  17 +-
 doc/guides/rel_notes/release_19_11.rst |  11 +
 drivers/net/af_xdp/rte_eth_af_xdp.c    | 780 ++++++++++++++++++++++---
 3 files changed, 714 insertions(+), 94 deletions(-)
Signature · 1 line
2.17.1
#1 lore raw

PATCH v2 1/3 net/af_xdp: fix Tx halt when no recv packets

From: Xiaolong Ye <[email protected]>

The kernel only consumes Tx packets if we have some Rx traffic on specified queue or we have called send(). So we need to issue a send() even when the allocation fails so that kernel will start to consume packets again.

Commit 45bba02c95b0 ("net/af_xdp: support need wakeup feature") breaks above rule by adding some condition to send, this patch fixes it while still keeps the need_wakeup feature for Tx.

Fixes 45bba02c95b0 ("net/af_xdp: support need wakeup feature")
---
 drivers/net/af_xdp/rte_eth_af_xdp.c | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)
drivers/net/af_xdp/rte_eth_af_xdp.c +14 -14
index 41ed5b2af..e496e9aaa 100644
@@ -286,19 +286,16 @@ kick_tx(struct pkt_tx_queue *txq)
 {
 	struct xsk_umem_info *umem = txq->pair->umem;
 
-#if defined(XDP_USE_NEED_WAKEUP)
-	if (xsk_ring_prod__needs_wakeup(&txq->tx))
-#endif
-		while (send(xsk_socket__fd(txq->pair->xsk), NULL,
-			    0, MSG_DONTWAIT) < 0) {
-			/* some thing unexpected */
-			if (errno != EBUSY && errno != EAGAIN && errno != EINTR)
-				break;
-
-			/* pull from completion queue to leave more space */
-			if (errno == EAGAIN)
-				pull_umem_cq(umem, ETH_AF_XDP_TX_BATCH_SIZE);
-		}
+	while (send(xsk_socket__fd(txq->pair->xsk), NULL,
+		    0, MSG_DONTWAIT) < 0) {
+		/* some thing unexpected */
+		if (errno != EBUSY && errno != EAGAIN && errno != EINTR)
+			break;
+
+		/* pull from completion queue to leave more space */
+		if (errno == EAGAIN)
+			pull_umem_cq(umem, ETH_AF_XDP_TX_BATCH_SIZE);
+	}
 	pull_umem_cq(umem, ETH_AF_XDP_TX_BATCH_SIZE);
 }
 
@@ -367,7 +364,10 @@ eth_af_xdp_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 
 	xsk_ring_prod__submit(&txq->tx, nb_pkts);
 
-	kick_tx(txq);
+#if defined(XDP_USE_NEED_WAKEUP)
+	if (xsk_ring_prod__needs_wakeup(&txq->tx))
+#endif
+		kick_tx(txq);
 
 	txq->stats.tx_pkts += nb_pkts;
 	txq->stats.tx_bytes += tx_bytes;
Signature · 1 line
2.17.1
#2 lore raw

Re: [dpdk-dev] [PATCH v2 1/3] net/af_xdp: fix Tx halt when no recv packets

Hi,

As this is indeed a kernel driver issue, and Magnus is working on the workaound/fix in i40e kernel driver, as long as the workaound/fix can be merged in v5.4, this patch can be dropped.

Thanks,
Xiaolong

Quoted 68 lines · Ciara Loftus

From: Xiaolong Ye <[email protected]>

The kernel only consumes Tx packets if we have some Rx traffic on specified queue or we have called send(). So we need to issue a send() even when the allocation fails so that kernel will start to consume packets again.

Commit 45bba02c95b0 ("net/af_xdp: support need wakeup feature") breaks above rule by adding some condition to send, this patch fixes it while still keeps the need_wakeup feature for Tx.

Fixes 45bba02c95b0 ("net/af_xdp: support need wakeup feature")

---
drivers/net/af_xdp/rte_eth_af_xdp.c | 28 ++++++++++++++--------------

1 file changed, 14 insertions(+), 14 deletions(-)
drivers/net/af_xdp/rte_eth_af_xdp.c +14 -14
index 41ed5b2af..e496e9aaa 100644
@@ -286,19 +286,16 @@ kick_tx(struct pkt_tx_queue *txq)
 {
 	struct xsk_umem_info *umem = txq->pair->umem;
 
-#if defined(XDP_USE_NEED_WAKEUP)
-	if (xsk_ring_prod__needs_wakeup(&txq->tx))
-#endif
-		while (send(xsk_socket__fd(txq->pair->xsk), NULL,
-			    0, MSG_DONTWAIT) < 0) {
-			/* some thing unexpected */
-			if (errno != EBUSY && errno != EAGAIN && errno != EINTR)
-				break;
-
-			/* pull from completion queue to leave more space */
-			if (errno == EAGAIN)
-				pull_umem_cq(umem, ETH_AF_XDP_TX_BATCH_SIZE);
-		}
+	while (send(xsk_socket__fd(txq->pair->xsk), NULL,
+		    0, MSG_DONTWAIT) < 0) {
+		/* some thing unexpected */
+		if (errno != EBUSY && errno != EAGAIN && errno != EINTR)
+			break;
+
+		/* pull from completion queue to leave more space */
+		if (errno == EAGAIN)
+			pull_umem_cq(umem, ETH_AF_XDP_TX_BATCH_SIZE);
+	}
 	pull_umem_cq(umem, ETH_AF_XDP_TX_BATCH_SIZE);
 }
 
@@ -367,7 +364,10 @@ eth_af_xdp_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 
 	xsk_ring_prod__submit(&txq->tx, nb_pkts);
 
-	kick_tx(txq);
+#if defined(XDP_USE_NEED_WAKEUP)
+	if (xsk_ring_prod__needs_wakeup(&txq->tx))
+#endif
+		kick_tx(txq);
 
 	txq->stats.tx_pkts += nb_pkts;
 	txq->stats.tx_bytes += tx_bytes;
Signature · 1 line
2.17.1
#3 lore raw

PATCH v2 2/3 net/af_xdp: support pinning of IRQs

In reply to Ciara Loftus

Network devices using the AF_XDP PMD will trigger interrupts on reception of packets. The new PMD argument 'queue_irq' allows the user to specify a core on which to pin interrupts for a given queue. Multiple queue_irq arguments can be specified. For example:

--vdev=net_af_xdp1,iface=eth0,queue_count=2,

           queue_irq=0:2,queue_irq=1:5

..will pin queue 0 interrupts to core 2 and queue 1 interrupts to core 5.

The queue argument refers to the ethdev queue as opposed to the netdev queue. These values are the same unless a value greater than 0 is specified in a start_queue argument.

The drivers supported for this feature are those with support for AF_XDP zero copy in the kernel, namely ixgbe, i40e and mlx5_core.

---
 doc/guides/nics/af_xdp.rst             |  15 +
 doc/guides/rel_notes/release_19_11.rst |   7 +
 drivers/net/af_xdp/rte_eth_af_xdp.c    | 366 ++++++++++++++++++++++++-
 3 files changed, 383 insertions(+), 5 deletions(-)
doc/guides/nics/af_xdp.rst +15 -0
index ec46f08f0..a255ba4e7 100644
@@ -36,6 +36,11 @@ The following options can be provided to set up an af_xdp port in DPDK.
 *   ``start_queue`` - starting netdev queue id (optional, default 0);
 *   ``queue_count`` - total netdev queue number (optional, default 1);
 *   ``pmd_zero_copy`` - enable zero copy or not (optional, default 0);
+*   ``queue_irq`` - pin queue irqs to specified core <queue:core> (optional,
+    default no pinning). The queue argument refers to the ethdev queue as
+    opposed to the netdev queue. These values are the same unless a value
+    greater than 0 is specified for start_queue. ixgbe, i40e and mlx5 drivers
+    supported;
 
 Prerequisites
 -------------
@@ -57,3 +62,13 @@ The following example will set up an af_xdp interface in DPDK:
 .. code-block:: console
 
     --vdev net_af_xdp,iface=ens786f1
+
+Pin queue IRQs
+--------------
+The following example will pin queue 0 interrupts to core 2 and queue 1
+interrupts to core 5.
+
+.. code-block:: console
+
+      --vdev=net_af_xdp1,iface=eth0,queue_count=2,
+               queue_irq=0:2,queue_irq=1:5
doc/guides/rel_notes/release_19_11.rst +7 -0
index 27cfbd9e3..06bf57c42 100644
@@ -56,6 +56,13 @@ New Features
      Also, make sure to start the actual text at the margin.
      =========================================================
 
+* **Updated the AF_XDP PMD.**
+
+  Updated the AF_XDP PMD. The new features include:
+
+  * Support for pinning netdev queue IRQs to cores specified by the user.
+    Available for ixgbe, i40e and mlx5 drivers.
+
 
 Removed Items
 -------------
drivers/net/af_xdp/rte_eth_af_xdp.c +361 -5

474 lines not on this page · raw message

Signature · 1 line
2.17.1
#4 lore raw

Re: [dpdk-dev] [PATCH v2 2/3] net/af_xdp: support pinning of IRQs

drivers/net/af_xdp/rte_eth_af_xdp.c static const struct rte_eth_link pmd_link = { · line 160

Quoted 7 lines · On Mon, 30 Sep 2019 16:42:04 +0000 Ciara Loftus <[email protected]> wrote:
drivers/net/af_xdp/rte_eth_af_xdp.c +7 -0
+/* drivers supported for the queue_irq option */
+enum supported_drivers {
+	I40E_DRIVER,
+	IXGBE_DRIVER,
+	MLX5_DRIVER,
+	NUM_DRIVERS
+};

Anything device specific like this raises a red flag to me.

This regex etc, seems like a huge hack. Is there a better way using irqbalance and smp_affinity in kernel drivers?

NACK

#5 lore raw

Re: [dpdk-dev] [PATCH v2 2/3] net/af_xdp: support pinning of IRQs

Quoted 23 lines

-----Original Message-----
From: Stephen Hemminger <[email protected]>
Sent: Monday 30 September 2019 18:12
To: Loftus, Ciara <[email protected]>
Cc: [email protected]; Ye, Xiaolong <[email protected]>; Laatz, Kevin <[email protected]>; Richardson, Bruce <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v2 2/3] net/af_xdp: support pinning of IRQs

drivers/net/af_xdp/rte_eth_af_xdp.c static const struct rte_eth_link pmd_link = { · line 160

Quoted 7 lines · On Mon, 30 Sep 2019 16:42:04 +0000 Ciara Loftus <[email protected]> wrote:
drivers/net/af_xdp/rte_eth_af_xdp.c +7 -0
+/* drivers supported for the queue_irq option */
+enum supported_drivers {
+	I40E_DRIVER,
+	IXGBE_DRIVER,
+	MLX5_DRIVER,
+	NUM_DRIVERS
+};

Anything device specific like this raises a red flag to me.

Quoted 4 lines

This regex etc, seems like a huge hack. Is there a better way using irqbalance and smp_affinity in kernel drivers?

NACK

Hi Stephen,

Thanks for looking at the patch. I understand your concern however unfortunately I haven't been able to identify a way to achieve the desired outcome by using your suggestions of irqbalance and smp_affinity. Did you have something specific in mind or are aware of any generic way of retrieving interrupt numbers for NICs regardless of vendor or range?

I think this feature is really important for the usability of this PMD. Without it, to configure the IRQs the user has to open up /proc/interrupts, trawl through it and identify the correct IRQ number for their given NIC and qid (the format for which is unlikely to be known off-hand), and manually pin them by writing the appropriate values in the appropriate format to the appropriate file - prone to error if not automated IMO. If the user fails to set the affinity it's probably fine for a single pmd, however with multiple pmds all irqs will by default land on core 0 and lead to terrible performance.

It should be possible to rework the code to remove the regexes and use a direct string compare. Would that make the solution more palatable?

Let me know what you think.

Thanks,
Ciara

#6 lore raw

Re: [dpdk-dev] [PATCH v2 2/3] net/af_xdp: support pinning of IRQs

Quoted 41 lines · Ciara
Quoted 16 lines

-----Original Message----- From: Stephen Hemminger <[email protected]> Sent: Monday 30 September 2019 18:12 To:
Loftus, Ciara <[email protected]> Cc: [email protected]; Ye, Xiaolong <[email protected]>; Laatz, Kevin <[email protected]>; Richardson, Bruce <[email protected]> Subject: Re: [dpdk-dev] [PATCH v2 2/3] net/af_xdp: support pinning of IRQs

Quoted 3 lines · On Mon, 30 Sep 2019 16:42:04 +0000 Ciara Loftus <[email protected]> wrote:

+/* drivers supported for the queue_irq option */ +enum
supported_drivers { + I40E_DRIVER, + IXGBE_DRIVER, +
MLX5_DRIVER, + NUM_DRIVERS +};

Quoted 6 lines

Anything device specific like this raises a red flag to me.

This regex etc, seems like a huge hack. Is there a better way using irqbalance and smp_affinity in kernel drivers?

NACK

Hi Stephen,

Thanks for looking at the patch. I understand your concern however unfortunately I haven't been able to identify a way to achieve the desired outcome by using your suggestions of irqbalance and smp_affinity. Did you have something specific in mind or are aware of any generic way of retrieving interrupt numbers for NICs regardless of vendor or range?

I think this feature is really important for the usability of this PMD. Without it, to configure the IRQs the user has to open up /proc/interrupts, trawl through it and identify the correct IRQ number for their given NIC and qid (the format for which is unlikely to be known off-hand), and manually pin them by writing the appropriate values in the appropriate format to the appropriate file - prone to error if not automated IMO. If the user fails to set the affinity it's probably fine for a single pmd, however with multiple pmds all irqs will by default land on core 0 and lead to terrible performance.

Quoted 3 lines

It should be possible to rework the code to remove the regexes and use a direct string compare. Would that make the solution more palatable?

Hi Ciara, Stephen,

is there any way forward on this patch?

From my experience with using AF_XDP the pinning of interrupts is both necessary for performance and sadly rather awkward to implement in practice. If we can't find a better way to do this, I think merging this patch is the best thing to do. It may be a bit messy, but the overall user experience should be far improved over not having it.

Regards,
/Bruce

#7 lore raw

Re: [dpdk-dev] [PATCH v2 2/3] net/af_xdp: support pinning of IRQs

Quoted 48 lines · Bruce Richardson
Quoted 41 lines · Ciara
Quoted 16 lines

-----Original Message----- From: Stephen Hemminger <[email protected]> Sent: Monday 30 September 2019 18:12 To:
Loftus, Ciara <[email protected]> Cc: [email protected]; Ye, Xiaolong <[email protected]>; Laatz, Kevin <[email protected]>; Richardson, Bruce <[email protected]> Subject: Re: [dpdk-dev] [PATCH v2 2/3] net/af_xdp: support pinning of IRQs

Quoted 3 lines · On Mon, 30 Sep 2019 16:42:04 +0000 Ciara Loftus <[email protected]> wrote:

+/* drivers supported for the queue_irq option */ +enum
supported_drivers { + I40E_DRIVER, + IXGBE_DRIVER, +
MLX5_DRIVER, + NUM_DRIVERS +};

Quoted 6 lines

Anything device specific like this raises a red flag to me.

This regex etc, seems like a huge hack. Is there a better way using irqbalance and smp_affinity in kernel drivers?

NACK

Hi Stephen,

Thanks for looking at the patch. I understand your concern however unfortunately I haven't been able to identify a way to achieve the desired outcome by using your suggestions of irqbalance and smp_affinity. Did you have something specific in mind or are aware of any generic way of retrieving interrupt numbers for NICs regardless of vendor or range?

I think this feature is really important for the usability of this PMD. Without it, to configure the IRQs the user has to open up /proc/interrupts, trawl through it and identify the correct IRQ number for their given NIC and qid (the format for which is unlikely to be known off-hand), and manually pin them by writing the appropriate values in the appropriate format to the appropriate file - prone to error if not automated IMO. If the user fails to set the affinity it's probably fine for a single pmd, however with multiple pmds all irqs will by default land on core 0 and lead to terrible performance.

Quoted 3 lines

It should be possible to rework the code to remove the regexes and use a direct string compare. Would that make the solution more palatable?

Hi Ciara, Stephen,

Quoted 8 lines

is there any way forward on this patch?

From my experience with using AF_XDP the pinning of interrupts is both necessary for performance and sadly rather awkward to implement in practice. If we can't find a better way to do this, I think merging this patch is the best thing to do. It may be a bit messy, but the overall user experience should be far improved over not having it.

Can we have this external to the PMD, like a helper script that run after you start the DPDK app?

#8 lore raw

Re: [dpdk-dev] [PATCH v2 2/3] net/af_xdp: support pinning of IRQs

Quoted 58 lines · Ferruh Yigit
Quoted 48 lines · Bruce Richardson
Quoted 41 lines · Ciara
Quoted 16 lines

-----Original Message----- From: Stephen Hemminger <[email protected]> Sent: Monday 30 September 2019 18:12 To:
Loftus, Ciara <[email protected]> Cc: [email protected]; Ye, Xiaolong <[email protected]>; Laatz, Kevin <[email protected]>; Richardson, Bruce <[email protected]> Subject: Re: [dpdk-dev] [PATCH v2 2/3] net/af_xdp: support pinning of IRQs

Quoted 3 lines · On Mon, 30 Sep 2019 16:42:04 +0000 Ciara Loftus <[email protected]> wrote:

+/* drivers supported for the queue_irq option */ +enum
supported_drivers { + I40E_DRIVER, + IXGBE_DRIVER, +
MLX5_DRIVER, + NUM_DRIVERS +};

Quoted 6 lines

Anything device specific like this raises a red flag to me.

This regex etc, seems like a huge hack. Is there a better way using irqbalance and smp_affinity in kernel drivers?

NACK

Hi Stephen,

Thanks for looking at the patch. I understand your concern however unfortunately I haven't been able to identify a way to achieve the desired outcome by using your suggestions of irqbalance and smp_affinity. Did you have something specific in mind or are aware of any generic way of retrieving interrupt numbers for NICs regardless of vendor or range?

I think this feature is really important for the usability of this PMD. Without it, to configure the IRQs the user has to open up /proc/interrupts, trawl through it and identify the correct IRQ number for their given NIC and qid (the format for which is unlikely to be known off-hand), and manually pin them by writing the appropriate values in the appropriate format to the appropriate file - prone to error if not automated IMO. If the user fails to set the affinity it's probably fine for a single pmd, however with multiple pmds all irqs will by default land on core 0 and lead to terrible performance.

Quoted 3 lines

It should be possible to rework the code to remove the regexes and use a direct string compare. Would that make the solution more palatable?

Hi Ciara, Stephen,

Quoted 8 lines

is there any way forward on this patch?

From my experience with using AF_XDP the pinning of interrupts is both necessary for performance and sadly rather awkward to implement in practice. If we can't find a better way to do this, I think merging this patch is the best thing to do. It may be a bit messy, but the overall user experience should be far improved over not having it.

Quoted 2 lines

Can we have this external to the PMD, like a helper script that run after you start the DPDK app?

It could be, but the main objection here seems to be with the method used to find the interrupts, which would not change based on a script version, not to mention the fact that the usability would be far less in that case. For ease of use, this needs to be part of the driver, and the current implementation is the best we can do right now, and nobody has suggested a concrete alternative to it.

/Bruce

#9 lore raw

Re: [dpdk-dev] [PATCH v2 2/3] net/af_xdp: support pinning of IRQs

Quoted 62 lines · Bruce Richardson
Quoted 58 lines · Ferruh Yigit
Quoted 48 lines · Bruce Richardson
Quoted 41 lines · Ciara
Quoted 16 lines

-----Original Message----- From: Stephen Hemminger <[email protected]> Sent: Monday 30 September 2019 18:12 To:
Loftus, Ciara <[email protected]> Cc: [email protected]; Ye, Xiaolong <[email protected]>; Laatz, Kevin <[email protected]>; Richardson, Bruce <[email protected]> Subject: Re: [dpdk-dev] [PATCH v2 2/3] net/af_xdp: support pinning of IRQs

Quoted 3 lines · On Mon, 30 Sep 2019 16:42:04 +0000 Ciara Loftus <[email protected]> wrote:

+/* drivers supported for the queue_irq option */ +enum
supported_drivers { + I40E_DRIVER, + IXGBE_DRIVER, +
MLX5_DRIVER, + NUM_DRIVERS +};

Quoted 6 lines

Anything device specific like this raises a red flag to me.

This regex etc, seems like a huge hack. Is there a better way using irqbalance and smp_affinity in kernel drivers?

NACK

Hi Stephen,

Thanks for looking at the patch. I understand your concern however unfortunately I haven't been able to identify a way to achieve the desired outcome by using your suggestions of irqbalance and smp_affinity. Did you have something specific in mind or are aware of any generic way of retrieving interrupt numbers for NICs regardless of vendor or range?

I think this feature is really important for the usability of this PMD. Without it, to configure the IRQs the user has to open up /proc/interrupts, trawl through it and identify the correct IRQ number for their given NIC and qid (the format for which is unlikely to be known off-hand), and manually pin them by writing the appropriate values in the appropriate format to the appropriate file - prone to error if not automated IMO. If the user fails to set the affinity it's probably fine for a single pmd, however with multiple pmds all irqs will by default land on core 0 and lead to terrible performance.

Quoted 3 lines

It should be possible to rework the code to remove the regexes and use a direct string compare. Would that make the solution more palatable?

Hi Ciara, Stephen,

Quoted 8 lines

is there any way forward on this patch?

From my experience with using AF_XDP the pinning of interrupts is both necessary for performance and sadly rather awkward to implement in practice. If we can't find a better way to do this, I think merging this patch is the best thing to do. It may be a bit messy, but the overall user experience should be far improved over not having it.

Quoted 2 lines

Can we have this external to the PMD, like a helper script that run after you start the DPDK app?

Quoted 7 lines

It could be, but the main objection here seems to be with the method used to find the interrupts, which would not change based on a script version, not to mention the fact that the usability would be far less in that case. For ease of use, this needs to be part of the driver, and the current implementation is the best we can do right now, and nobody has suggested a concrete alternative to it.

The method used to find interrupts can be same but it being embedded into a specific PMD with the list of supported driver hardcoded versus putting this information into a script differs I think.

I tend to agree that this looks hack for the PMD.

And not sure if the usability will be far less, instead of providing parameters to the PMD, you will provide to the script. And script becomes something more generic.

#10 lore raw

Re: [dpdk-dev] [PATCH v2 2/3] net/af_xdp: support pinning of IRQs

Quoted 71 lines · Ferruh Yigit
Quoted 62 lines · Bruce Richardson
Quoted 58 lines · Ferruh Yigit
Quoted 48 lines · Bruce Richardson
Quoted 41 lines · Ciara
Quoted 16 lines

-----Original Message----- From: Stephen Hemminger <[email protected]> Sent: Monday 30 September 2019 18:12 To:
Loftus, Ciara <[email protected]> Cc: [email protected]; Ye, Xiaolong <[email protected]>; Laatz, Kevin <[email protected]>; Richardson, Bruce <[email protected]> Subject: Re: [dpdk-dev] [PATCH v2 2/3] net/af_xdp: support pinning of IRQs

Quoted 3 lines · On Mon, 30 Sep 2019 16:42:04 +0000 Ciara Loftus <[email protected]> wrote:

+/* drivers supported for the queue_irq option */ +enum
supported_drivers { + I40E_DRIVER, + IXGBE_DRIVER, +
MLX5_DRIVER, + NUM_DRIVERS +};

Quoted 6 lines

Anything device specific like this raises a red flag to me.

This regex etc, seems like a huge hack. Is there a better way using irqbalance and smp_affinity in kernel drivers?

NACK

Hi Stephen,

Thanks for looking at the patch. I understand your concern however unfortunately I haven't been able to identify a way to achieve the desired outcome by using your suggestions of irqbalance and smp_affinity. Did you have something specific in mind or are aware of any generic way of retrieving interrupt numbers for NICs regardless of vendor or range?

I think this feature is really important for the usability of this PMD. Without it, to configure the IRQs the user has to open up /proc/interrupts, trawl through it and identify the correct IRQ number for their given NIC and qid (the format for which is unlikely to be known off-hand), and manually pin them by writing the appropriate values in the appropriate format to the appropriate file - prone to error if not automated IMO. If the user fails to set the affinity it's probably fine for a single pmd, however with multiple pmds all irqs will by default land on core 0 and lead to terrible performance.

Quoted 3 lines

It should be possible to rework the code to remove the regexes and use a direct string compare. Would that make the solution more palatable?

Hi Ciara, Stephen,

Quoted 8 lines

is there any way forward on this patch?

From my experience with using AF_XDP the pinning of interrupts is both necessary for performance and sadly rather awkward to implement in practice. If we can't find a better way to do this, I think merging this patch is the best thing to do. It may be a bit messy, but the overall user experience should be far improved over not having it.

Quoted 2 lines

Can we have this external to the PMD, like a helper script that run after you start the DPDK app?

Quoted 7 lines

It could be, but the main objection here seems to be with the method used to find the interrupts, which would not change based on a script version, not to mention the fact that the usability would be far less in that case. For ease of use, this needs to be part of the driver, and the current implementation is the best we can do right now, and nobody has suggested a concrete alternative to it.

Quoted 6 lines

The method used to find interrupts can be same but it being embedded into a specific PMD with the list of supported driver hardcoded versus putting this information into a script differs I think.

I tend to agree that this looks hack for the PMD.

We are happy to work to make it less of a hack. However, no better methods are forthcoming.

Quoted 3 lines

And not sure if the usability will be far less, instead of providing parameters to the PMD, you will provide to the script. And script becomes something more generic.

Unlikely to be generic. It will still be very much tied to AF_XDP PMD, I think. A script would be workable option except for the fact that the script has to be run each time *after* the application starts up. This is very different to e.g. dev_bind, where it only needs to be done once, and can be done ahead of application startup. Using a script in this case means that the user needs to either start their app in the background or use a separate terminal session to run the script once app startup has occurred. This also makes the integration into a CI automation system that bit more complex too, I believe.

Beyond this, this patch solves an immediate, visible, user problem illustrated with measurable performance data above, while the issues with it are concerning possible future maintenance issues which may never arise.

/Bruce

#11 lore raw

Re: [dpdk-dev] [PATCH v2 2/3] net/af_xdp: support pinning of IRQs

In reply to Loftus, Ciara
Quoted 35 lines · Ciara
Quoted 23 lines

-----Original Message-----
From: Stephen Hemminger <[email protected]>
Sent: Monday 30 September 2019 18:12
To: Loftus, Ciara <[email protected]>
Cc: [email protected]; Ye, Xiaolong <[email protected]>; Laatz, Kevin <[email protected]>; Richardson, Bruce <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v2 2/3] net/af_xdp: support pinning of IRQs

drivers/net/af_xdp/rte_eth_af_xdp.c static const struct rte_eth_link pmd_link = { · line 160

Quoted 7 lines · On Mon, 30 Sep 2019 16:42:04 +0000 Ciara Loftus <[email protected]> wrote:
drivers/net/af_xdp/rte_eth_af_xdp.c +7 -0
+/* drivers supported for the queue_irq option */
+enum supported_drivers {
+	I40E_DRIVER,
+	IXGBE_DRIVER,
+	MLX5_DRIVER,
+	NUM_DRIVERS
+};

Anything device specific like this raises a red flag to me.

Quoted 4 lines

This regex etc, seems like a huge hack. Is there a better way using irqbalance and smp_affinity in kernel drivers?

NACK

Hi Stephen,

Thanks for looking at the patch. I understand your concern however unfortunately I haven't been able to identify a way to achieve the desired outcome by using your suggestions of irqbalance and smp_affinity. Did you have something specific in mind or are aware of any generic way of retrieving interrupt numbers for NICs regardless of vendor or range?

I think this feature is really important for the usability of this PMD. Without it, to configure the IRQs the user has to open up /proc/interrupts, trawl through it and identify the correct IRQ number for their given NIC and qid (the format for which is unlikely to be known off-hand), and manually pin them by writing the appropriate values in the appropriate format to the appropriate file - prone to error if not automated IMO. If the user fails to set the affinity it's probably fine for a single pmd, however with multiple pmds all irqs will by default land on core 0 and lead to terrible performance.

Quoted 7 lines

It should be possible to rework the code to remove the regexes and use a direct string compare. Would that make the solution more palatable?

Let me know what you think.

Thanks,
Ciara

Assuming there is no easier way to co-relate an ethernet device with an interrupt, to make the strcmp's go away. My preference is for DPDK to take care of it's rqmts - even in a less-that-ideal way, in preference to asking a user to figure it out.

Ray K

#12 lore raw

Re: [dpdk-dev] [PATCH v2 2/3] net/af_xdp: support pinning of IRQs

In reply to Loftus, Ciara
Quoted 26 lines
Quoted 13 lines

drivers/net/af_xdp/rte_eth_af_xdp.c static const struct rte_eth_link pmd_link = { · line 160

Quoted 7 lines · On Mon, 30 Sep 2019 16:42:04 +0000 Ciara Loftus <[email protected]> wrote:
drivers/net/af_xdp/rte_eth_af_xdp.c +7 -0
+/* drivers supported for the queue_irq option */
+enum supported_drivers {
+	I40E_DRIVER,
+	IXGBE_DRIVER,
+	MLX5_DRIVER,
+	NUM_DRIVERS
+};

Anything device specific like this raises a red flag to me.

Quoted 4 lines

This regex etc, seems like a huge hack. Is there a better way using irqbalance and smp_affinity in kernel drivers?

NACK

Hi Stephen,

Thanks for looking at the patch. I understand your concern however unfortunately I haven't been able to identify a way to achieve the desired outcome by using your suggestions of irqbalance and smp_affinity. Did you have something specific in mind or are aware of any generic way of retrieving interrupt numbers for NICs regardless of vendor or range?

Quoted 9 lines

I think this feature is really important for the usability of this PMD. Without it, to configure the IRQs the user has to open up /proc/interrupts, trawl through it and identify the correct IRQ number for their given NIC and qid (the format for which is unlikely to be known off-hand), and manually pin them by writing the appropriate values in the appropriate format to the appropriate file - prone to error if not automated IMO.
If the user fails to set the affinity it's probably fine for a single pmd, however with multiple pmds all irqs will by default land on core 0 and lead to terrible performance.

Hi,

Following this up with some performance data which shows the impact of no pinning.

The test case is N instances of testpmd macswap where N= the number of interfaces.

ifaces  no pinning  pinning
1       9059100     9171612
2       9261635     18376552
3       9332804     27696702

For the no-pinning case, all IRQs are landing on the default core 0, which results in very poor scaling versus the pinned case where scaling is linear.

Thanks,
Ciara

Quoted 8 lines

It should be possible to rework the code to remove the regexes and use a direct string compare. Would that make the solution more palatable?

Let me know what you think.

Thanks,
Ciara

#13 lore raw

Re: [dpdk-dev] [PATCH v2 2/3] net/af_xdp: support pinning of IRQs

Hi Ciara,

snipped

Quoted 8 lines
ifaces  no pinning  pinning
1       9059100     9171612
2       9261635     18376552
3       9332804     27696702

For the no-pinning case, all IRQs are landing on the default core 0, which results in very poor scaling versus the pinned case where scaling is linear.

Thanks for the information, but a question here Is the reason for landing all IRQ on core '0' is because the Kernel CMD line 'isol or no interupts' is done for all expect core 0?

If the cores are not isolated and no interrupts are redirected; normally cat /proc/interrupts shows IRQ mask to cores. Depending upon FDIR (intel X522 and X710) this could be core 0 or 'n-1'?

Quoted 12 lines

Thanks,
Ciara

Quoted 8 lines

It should be possible to rework the code to remove the regexes and use a direct string compare. Would that make the solution more palatable?

Let me know what you think.

Thanks,
Ciara

#14 lore raw

Re: [dpdk-dev] [PATCH v2 2/3] net/af_xdp: support pinning of IRQs

Quoted 9 lines · Vipin

Hi Ciara,

snipped

Quoted 6 lines
ifaces  no pinning  pinning
1       9059100     9171612
2       9261635     18376552
3       9332804     27696702
Quoted 7 lines
Quoted 2 lines

For the no-pinning case, all IRQs are landing on the default core 0, which results in very poor scaling versus the pinned case where scaling is linear.

Thanks for the information, but a question here Is the reason for landing all IRQ on core '0' is because the Kernel CMD line 'isol or no interupts' is done for all expect core 0?

If the cores are not isolated and no interrupts are redirected; normally cat /proc/interrupts shows IRQ mask to cores. Depending upon FDIR (intel X522 and X710) this could be core 0 or 'n-1'?

Yes, the interrupt pinning default is somewhat dependent on the exact setup, but the fact remains that in just about any setup the interrupts for an AF_XDP queue are unlikely to end up on the exactly the one core that the user wants them on. This is what makes this patch so necessary, both from a usability and performance point of view.

In the absense of alternatives, I really think this patch should be merged, since with more than one point the difference between having correctly or incorrectly pinned interrupts is huge. I'd also point out that in my testing the interrupts need to be pinned each and every time an app is run - it's not a set once and forget thing. This ability to have the driver pin the interrupts for the user would be a big timesaver for developers too, who may be constantly re-running apps when testing.

Regards,
/Bruce

#15 lore raw

Re: [dpdk-dev] [PATCH v2 2/3] net/af_xdp: support pinning of IRQs

Hi Bruce,

snipped

Quoted 19 lines
Quoted 3 lines
Quoted 3 lines

For the no-pinning case, all IRQs are landing on the default core 0, which results in very poor scaling versus the pinned case where scaling is

linear.

Quoted 6 lines

Thanks for the information, but a question here Is the reason for landing all IRQ on core '0' is because the Kernel CMD line 'isol or no interupts' is done for all expect core 0?

If the cores are not isolated and no interrupts are redirected; normally `cat

/proc/interrupts` shows IRQ mask to cores. Depending upon FDIR (intel X522 and X710) this could be core 0 or 'n-1'?

Quoted 1 line

Yes, the interrupt pinning default is somewhat dependent on the exact setup, but the fact remains that in just about any setup the interrupts for an AF_XDP queue are unlikely to end up on the exactly the one core that the user wants them on. This is what makes this patch so necessary, both from a usability and performance point of view.

Quoted 5 lines

In the absense of alternatives, I really think this patch should be merged, since with more than one point the difference between having correctly or incorrectly pinned interrupts is huge. I'd also point out that in my testing the interrupts need to be pinned each and every time an app is run - it's not a set once and forget thing.

Yes, I agree with you as in my testing with XDP and FDIR we had to do this in each test run.

This ability to have the driver pin the interrupts for the

Quoted 2 lines

user would be a big timesaver for developers too, who may be constantly re- running apps when testing.

Here my understanding, user can not or should not pass DPDK cores for interrupt pinning. So should we ask the driver to fetch rte_eal_configuration and ensure the same?

Quoted 3 lines

Regards,
/Bruce

#16 lore raw

Re: [dpdk-dev] [PATCH v2 2/3] net/af_xdp: support pinning of IRQs

Quoted 27 lines · Vipin

Hi Bruce,

snipped

Quoted 19 lines
Quoted 3 lines
Quoted 3 lines

For the no-pinning case, all IRQs are landing on the default core 0, which results in very poor scaling versus the pinned case where scaling is

linear.

Quoted 6 lines

Thanks for the information, but a question here Is the reason for landing all IRQ on core '0' is because the Kernel CMD line 'isol or no interupts' is done for all expect core 0?

If the cores are not isolated and no interrupts are redirected; normally `cat

/proc/interrupts` shows IRQ mask to cores. Depending upon FDIR (intel X522 and X710) this could be core 0 or 'n-1'?

Quoted 1 line

Yes, the interrupt pinning default is somewhat dependent on the exact setup, but the fact remains that in just about any setup the interrupts for an AF_XDP queue are unlikely to end up on the exactly the one core that the user wants them on. This is what makes this patch so necessary, both from a usability and performance point of view.

Quoted 5 lines

In the absense of alternatives, I really think this patch should be merged, since with more than one point the difference between having correctly or incorrectly pinned interrupts is huge. I'd also point out that in my testing the interrupts need to be pinned each and every time an app is run - it's not a set once and forget thing.

Quoted 7 lines

Yes, I agree with you as in my testing with XDP and FDIR we had to do this in each test run.

This ability to have the driver pin the interrupts for the

Quoted 2 lines

user would be a big timesaver for developers too, who may be constantly re- running apps when testing.

Here my understanding, user can not or should not pass DPDK cores for interrupt pinning. So should we ask the driver to fetch rte_eal_configuration and ensure the same?

Actually I disagree. I think the user should pass the cores for interrupt pinning, because unlike other PMDs it is perfectly valid to have the interrupts pinned to dedicated cores separate from those used by DPDK.

Or taking another example, suppose the app takes 8 cores in the coremask, but only one of those cores is to be used for I/O, what cores should the driver pin the interrupts to? It probably should be the same core used for I/O, but the driver can't know which cores will be for that, or alternatively the user might want to use AF_XDP split across two cores, in which case any core on the system might be the intended one for interrupts.

Regards,
/Bruce

#17 lore raw

Re: [dpdk-dev] [PATCH v2 2/3] net/af_xdp: support pinning of IRQs

Hi Bruce,

snipped

Quoted 9 lines
Quoted 4 lines

This ability to have the driver pin the interrupts for the

Quoted 2 lines

user would be a big timesaver for developers too, who may be constantly re- running apps when testing.

Here my understanding, user can not or should not pass DPDK cores for

interrupt pinning. So should we ask the driver to fetch rte_eal_configuration and ensure the same?

Quoted 1 line

Actually I disagree. I think the user should pass the cores for interrupt pinning,

I agree to this.

Quoted 2 lines

because unlike other PMDs it is perfectly valid to have the interrupts pinned to dedicated cores separate from those used by DPDK.

My point is the same, but not on DPDK DP or service cores.

Quoted 4 lines

Or taking another example, suppose the app takes 8 cores in the coremask, but only one of those cores is to be used for I/O, what cores should the driver pin the interrupts to?

It can be cores on machine (guest or host) which is not used by DPDK.

It probably should be the same core used for I/O, but the

Quoted 3 lines

driver can't know which cores will be for that, or alternatively the user might want to use AF_XDP split across two cores, in which case any core on the system might be the intended one for interrupts.

I agree to the patch, only difference in dev->probe function, should not there be validation to ensure the IRQ core is not DPDK core or Service core as the Interface is owned by kernel and for non matched eBPF skb buff is used by kernel.

#18 lore raw

Re: [dpdk-dev] [PATCH v2 2/3] net/af_xdp: support pinning of IRQs

Quoted 22 lines · Vipin

Hi Bruce,

snipped

Quoted 9 lines
Quoted 4 lines

This ability to have the driver pin the interrupts for the

Quoted 2 lines

user would be a big timesaver for developers too, who may be constantly re- running apps when testing.

Here my understanding, user can not or should not pass DPDK cores for

interrupt pinning. So should we ask the driver to fetch rte_eal_configuration and ensure the same?

Quoted 1 line

Actually I disagree. I think the user should pass the cores for interrupt pinning,

I agree to this.

Quoted 2 lines

because unlike other PMDs it is perfectly valid to have the interrupts pinned to dedicated cores separate from those used by DPDK.

My point is the same, but not on DPDK DP or service cores.

Quoted 4 lines

Or taking another example, suppose the app takes 8 cores in the coremask, but only one of those cores is to be used for I/O, what cores should the driver pin the interrupts to?

Quoted 8 lines

It can be cores on machine (guest or host) which is not used by DPDK.

It probably should be the same core used for I/O, but the

Quoted 3 lines

driver can't know which cores will be for that, or alternatively the user might want to use AF_XDP split across two cores, in which case any core on the system might be the intended one for interrupts.

I agree to the patch, only difference in dev->probe function, should not there be validation to ensure the IRQ core is not DPDK core or Service core as the Interface is owned by kernel and for non matched eBPF skb buff is used by kernel.

No. Since the 5.4 kernel, it's a usable configuration to run both the kernel and userspace portions of AF_XDP on the same core. In order to get best performance with a fixed number of cores, this setup - with interrupts pinned to the polling RX core - is now recommended. [For absolute best perf using any number of cores, a separate interrupt core may still work best, though]

/Bruce

#19 lore raw

Re: [dpdk-dev] [PATCH v2 2/3] net/af_xdp: support pinning of IRQs

Ok thanks

Quoted 53 lines

-----Original Message-----
From: Bruce Richardson <[email protected]>
Sent: Monday, October 21, 2019 7:26 PM
To: Varghese, Vipin <[email protected]>
Cc: Loftus, Ciara <[email protected]>; 'Stephen Hemminger' <[email protected]>; '[email protected]' <[email protected]>; Ye, Xiaolong <[email protected]>; Laatz, Kevin <[email protected]>; Yigit, Ferruh <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v2 2/3] net/af_xdp: support pinning of IRQs

Quoted 24 lines · Vipin

Hi Bruce,

snipped

Quoted 11 lines
Quoted 5 lines

This ability to have the driver pin the interrupts for the

Quoted 2 lines

user would be a big timesaver for developers too, who may be constantly re- running apps when testing.

Here my understanding, user can not or should not pass DPDK cores for

interrupt pinning. So should we ask the driver to fetch rte_eal_configuration and ensure the same?

Quoted 1 line

Actually I disagree. I think the user should pass the cores for interrupt pinning,

I agree to this.

Quoted 2 lines

because unlike other PMDs it is perfectly valid to have the interrupts pinned to dedicated cores separate from those used by DPDK.

My point is the same, but not on DPDK DP or service cores.

Quoted 4 lines

Or taking another example, suppose the app takes 8 cores in the coremask, but only one of those cores is to be used for I/O, what cores should the driver pin the interrupts to?

Quoted 7 lines

It can be cores on machine (guest or host) which is not used by DPDK.

It probably should be the same core used for I/O, but the

Quoted 3 lines

driver can't know which cores will be for that, or alternatively the user might want to use AF_XDP split across two cores, in which case any core on the system might be the intended one for interrupts.

I agree to the patch, only difference in dev->probe function, should not there

be validation to ensure the IRQ core is not DPDK core or Service core as the Interface is owned by kernel and for non matched eBPF skb buff is used by kernel.

Quoted 1 line

No. Since the 5.4 kernel, it's a usable configuration to run both the kernel and userspace portions of AF_XDP on the same core. In order to get best performance with a fixed number of cores, this setup - with interrupts pinned to the polling RX core - is now recommended. [For absolute best perf using any number of cores, a separate interrupt core may still work best, though]

/Bruce

Reviewed-by on v2 2/3
#20 lore raw

Re: [dpdk-dev] [PATCH v2 2/3] net/af_xdp: support pinning of IRQs

In reply to Ciara Loftus
Quoted 19 lines · Ciara Loftus

Network devices using the AF_XDP PMD will trigger interrupts on reception of packets. The new PMD argument 'queue_irq' allows the user to specify a core on which to pin interrupts for a given queue. Multiple queue_irq arguments can be specified. For example:

--vdev=net_af_xdp1,iface=eth0,queue_count=2,

          queue_irq=0:2,queue_irq=1:5

..will pin queue 0 interrupts to core 2 and queue 1 interrupts to core 5.

The queue argument refers to the ethdev queue as opposed to the netdev queue. These values are the same unless a value greater than 0 is specified in a start_queue argument.

The drivers supported for this feature are those with support for AF_XDP zero copy in the kernel, namely ixgbe, i40e and mlx5_core.

Quoted 8 lines

---

doc/guides/nics/af_xdp.rst             |  15 +
doc/guides/rel_notes/release_19_11.rst |   7 +
drivers/net/af_xdp/rte_eth_af_xdp.c    | 366 ++++++++++++++++++++++++-
3 files changed, 383 insertions(+), 5 deletions(-)
#21 lore raw

PATCH v2 3/3 net/af_xdp: enable support for unaligned umem chunks

In reply to Ciara Loftus

This patch enables the unaligned chunks feature for AF_XDP which allows chunks to be placed at arbitrary places in the umem, as opposed to them being required to be aligned to 2k. This allows for DPDK application mempools to be mapped directly into the umem and in turn enable zero copy transfer between umem and the PMD.

This patch replaces the zero copy via external mbuf mechanism introduced in commit e9ff8bb71943 ("net/af_xdp: enable zero copy by external mbuf"). The pmd_zero copy vdev argument is also removed as now the PMD will auto-detect presence of the unaligned chunks feature and enable it if so and otherwise fall back to copy mode if not detected.

---
 doc/guides/nics/af_xdp.rst             |   2 +-
 doc/guides/rel_notes/release_19_11.rst |   4 +
 drivers/net/af_xdp/rte_eth_af_xdp.c    | 402 ++++++++++++++++++++-----
 3 files changed, 325 insertions(+), 83 deletions(-)
doc/guides/nics/af_xdp.rst +1 -1
index a255ba4e7..40a35a822 100644
@@ -35,7 +35,6 @@ The following options can be provided to set up an af_xdp port in DPDK.
 *   ``iface`` - name of the Kernel interface to attach to (required);
 *   ``start_queue`` - starting netdev queue id (optional, default 0);
 *   ``queue_count`` - total netdev queue number (optional, default 1);
-*   ``pmd_zero_copy`` - enable zero copy or not (optional, default 0);
 *   ``queue_irq`` - pin queue irqs to specified core <queue:core> (optional,
     default no pinning). The queue argument refers to the ethdev queue as
     opposed to the netdev queue. These values are the same unless a value
@@ -53,6 +52,7 @@ This is a Linux-specific PMD, thus the following prerequisites apply:
    <kernel src tree>/tools/lib/bpf;
 *  A Kernel bound interface to attach to;
 *  For need_wakeup feature, it requires kernel version later than v5.3-rc1;
+*  For PMD zero copy, it requires kernel version later than v5.4-rc1;
 
 Set up an af_xdp interface
 -----------------------------
doc/guides/rel_notes/release_19_11.rst +4 -0
index 06bf57c42..22369107c 100644
@@ -62,6 +62,8 @@ New Features
 
   * Support for pinning netdev queue IRQs to cores specified by the user.
     Available for ixgbe, i40e and mlx5 drivers.
+  * Enabled zero copy between application mempools and UMEM by enabling the
+    XDP_UMEM_UNALIGNED_CHUNKS UMEM flag.
 
 
 Removed Items
@@ -85,6 +87,8 @@ Removed Items
      "port config <port_id> rx_offload crc_strip|scatter|ipv4_cksum|udp_cksum|tcp_cksum|
      timestamp|vlan_strip|vlan_filter|vlan_extend on|off"
 
+   * Removed AF_XDP pmd_zero copy vdev argument. Support is now auto-detected.
+
 
 API Changes
 -----------
drivers/net/af_xdp/rte_eth_af_xdp.c +320 -82

666 lines not on this page · raw message

Signature · 1 line
2.17.1
Reviewed-by on v2 3/3
#22 lore raw

Re: [dpdk-dev] [PATCH v2 3/3] net/af_xdp: enable support for unaligned umem chunks

Quoted 12 lines · Ciara Loftus

This patch enables the unaligned chunks feature for AF_XDP which allows chunks to be placed at arbitrary places in the umem, as opposed to them being required to be aligned to 2k. This allows for DPDK application mempools to be mapped directly into the umem and in turn enable zero copy transfer between umem and the PMD.

This patch replaces the zero copy via external mbuf mechanism introduced in commit e9ff8bb71943 ("net/af_xdp: enable zero copy by external mbuf"). The pmd_zero copy vdev argument is also removed as now the PMD will auto-detect presence of the unaligned chunks feature and enable it if so and otherwise fall back to copy mode if not detected.

Quoted 8 lines

---

doc/guides/nics/af_xdp.rst             |   2 +-
doc/guides/rel_notes/release_19_11.rst |   4 +
drivers/net/af_xdp/rte_eth_af_xdp.c    | 402 ++++++++++++++++++++-----
3 files changed, 325 insertions(+), 83 deletions(-)
Applied
#23 lore raw

Re: [dpdk-dev] [PATCH v2 3/3] net/af_xdp: enable support for unaligned umem chunks

Quoted 22 lines · Ye Xiaolong
Quoted 12 lines · Ciara Loftus

This patch enables the unaligned chunks feature for AF_XDP which allows chunks to be placed at arbitrary places in the umem, as opposed to them being required to be aligned to 2k. This allows for DPDK application mempools to be mapped directly into the umem and in turn enable zero copy transfer between umem and the PMD.

This patch replaces the zero copy via external mbuf mechanism introduced in commit e9ff8bb71943 ("net/af_xdp: enable zero copy by external mbuf"). The pmd_zero copy vdev argument is also removed as now the PMD will auto-detect presence of the unaligned chunks feature and enable it if so and otherwise fall back to copy mode if not detected.

Quoted 8 lines

---

doc/guides/nics/af_xdp.rst             |   2 +-
doc/guides/rel_notes/release_19_11.rst |   4 +
drivers/net/af_xdp/rte_eth_af_xdp.c    | 402 ++++++++++++++++++++-----
3 files changed, 325 insertions(+), 83 deletions(-)
Quoted 2 lines

We tend to not split patches but since this patch doesn't depend on others, I will get this while the discussion is going on with the other one.

Applied to dpdk-next-net/master, thanks.

#24 lore raw

Re: [dpdk-dev] [PATCH v2 3/3] net/af_xdp: enable support for unaligned umem chunks

In reply to Ciara Loftus
Quoted 14 lines · Ciara Loftus
doc/guides/rel_notes/release_19_11.rst +2 -0
index 06bf57c42..22369107c 100644
@@ -62,6 +62,8 @@ New Features
 
   * Support for pinning netdev queue IRQs to cores specified by the user.
     Available for ixgbe, i40e and mlx5 drivers.
+  * Enabled zero copy between application mempools and UMEM by enabling the
+    XDP_UMEM_UNALIGNED_CHUNKS UMEM flag.
 
 
 Removed Items

doc/guides/rel_notes/release_19_11.rst Removed Items · line 92

Quoted 6 lines
doc/guides/rel_notes/release_19_11.rst +2 -0
@@ -85,6 +87,8 @@ Removed Items
      "port config <port_id> rx_offload crc_strip|scatter|ipv4_cksum|udp_cksum|tcp_cksum|
      timestamp|vlan_strip|vlan_filter|vlan_extend on|off"
 
+   * Removed AF_XDP pmd_zero copy vdev argument. Support is now auto-detected.
+
 

Caught by Maxime, this part is indented and interpreted as a comment when generating the doc.

Ferruh, how do you want to deal with this?
I can merge http://patchwork.dpdk.org/patch/60798/ in master for testpmd.

Or you merge it and fix the AF_XDP issue in next-net.

Thanks.

Signature · 1 line
David Marchand
#25 lore raw

Re: [dpdk-dev] [PATCH v2 3/3] net/af_xdp: enable support for unaligned umem chunks

Quoted 26 lines · David Marchand
Quoted 14 lines · Ciara Loftus
doc/guides/rel_notes/release_19_11.rst +2 -0
index 06bf57c42..22369107c 100644
@@ -62,6 +62,8 @@ New Features
 
   * Support for pinning netdev queue IRQs to cores specified by the user.
     Available for ixgbe, i40e and mlx5 drivers.
+  * Enabled zero copy between application mempools and UMEM by enabling the
+    XDP_UMEM_UNALIGNED_CHUNKS UMEM flag.
 
 
 Removed Items

doc/guides/rel_notes/release_19_11.rst Removed Items · line 92

Quoted 6 lines
doc/guides/rel_notes/release_19_11.rst +2 -0
@@ -85,6 +87,8 @@ Removed Items
      "port config <port_id> rx_offload crc_strip|scatter|ipv4_cksum|udp_cksum|tcp_cksum|
      timestamp|vlan_strip|vlan_filter|vlan_extend on|off"
 
+   * Removed AF_XDP pmd_zero copy vdev argument. Support is now auto-detected.
+
 

Caught by Maxime, this part is indented and interpreted as a comment when generating the doc.

Quoted 3 lines

Ferruh, how do you want to deal with this?
I can merge http://patchwork.dpdk.org/patch/60798/ in master for testpmd.

Synced with Thomas.
The first fix is going through master.
Thomas will fix when pulling next-net.

Signature · 1 line
David Marchand
#26 lore raw

Re: [dpdk-dev] [PATCH v2 3/3] net/af_xdp: enable support for unaligned umem chunks

Quoted 28 lines · David Marchand
Quoted 26 lines · David Marchand
Quoted 14 lines · Ciara Loftus
doc/guides/rel_notes/release_19_11.rst +2 -0
index 06bf57c42..22369107c 100644
@@ -62,6 +62,8 @@ New Features
 
   * Support for pinning netdev queue IRQs to cores specified by the user.
     Available for ixgbe, i40e and mlx5 drivers.
+  * Enabled zero copy between application mempools and UMEM by enabling the
+    XDP_UMEM_UNALIGNED_CHUNKS UMEM flag.
 
 
 Removed Items

doc/guides/rel_notes/release_19_11.rst Removed Items · line 92

Quoted 6 lines
doc/guides/rel_notes/release_19_11.rst +2 -0
@@ -85,6 +87,8 @@ Removed Items
      "port config <port_id> rx_offload crc_strip|scatter|ipv4_cksum|udp_cksum|tcp_cksum|
      timestamp|vlan_strip|vlan_filter|vlan_extend on|off"
 
+   * Removed AF_XDP pmd_zero copy vdev argument. Support is now auto-detected.
+
 

Caught by Maxime, this part is indented and interpreted as a comment when generating the doc.

Quoted 8 lines
Quoted 3 lines

Ferruh, how do you want to deal with this?
I can merge http://patchwork.dpdk.org/patch/60798/ in master for testpmd.

Synced with Thomas.
The first fix is going through master.
Thomas will fix when pulling next-net.

Thanks!