Skip to contentSkip to conversation

ethdev new offloads API

PATCH Superseded Shahaf Shuler 10 participants 134 messages Sep 4, 2017 – May 8, 2018 Page 2 of 2

Subsystems (3)
lore
Share & tools
lore
#73 lore raw

Re: [PATCH v3 1/2] ethdev: introduce Rx queue offloads API

In reply to Andrew Rybchenko

Wednesday, September 13, 2017 11:13 AM, Andrew Rybchenko:

Quoted 4 lines · Shahaf Shuler

I think it would be useful to have the description in the documentation. It is really important topic on how per-port and per-queue offloads coexist and rules should be 100% clear for PMD maintainers and application developers.

OK.

Quoted 4 lines

Please, also highlight how per-port and per-queue capabilities should be advertised. I mean if per-queue capability should be reported as per-port as well. I'd say no to avoid duplication of per-queue capabilities in two places.

I will add documentation. Offloads can be reported in only one cap – either it is per-port or per-queue.

Quoted 2 lines

If so, could you explain why to enable it should be specified in both places.

It is set also in the queue setup to emphasize the queue also have this offload. Logically it can be avoided, however I thought it is good to have, to make it explicit to application and PMDs.

How should be treated configuration when the offload is

Quoted 1 line

enabled on port, but disabled on queue level.

In that case the queue setup should return with error. As the application tries do a mixed configuration for per-port offload.

Quoted 16 lines
Quoted 15 lines
doc/guides/nics/features.rst +0 -0

index 37ffbc68c..4e68144ef 100644

--- a/doc/guides/nics/features.rst

+++ b/doc/guides/nics/features.rst

doc/guides/nics/features.rst +0 -0
@@ -179,7 +179,7 @@ Jumbo frame
 
 
 

Supports Rx jumbo frames.

Quoted 5 lines
Quoted 1 line

-* **[uses] user config**: ``dev_conf.rxmode.jumbo_frame``,

May be it should be removed from documentation when it is removed from sources? I have no strong opinion, but it would be more clear to find it in the documentation with its status specified (obsolete)

I think it will complex the documentation. The old API is obsoleted. If PMD developer thinks on how to implement a new feature, and read this doc, it should implement according to the new API.

Quoted 30 lines

[snip]

Quoted 25 lines
doc/guides/nics/features.rst +9 -0
@@ -907,6 +934,18 @@ struct rte_eth_conf {
 
 #define DEV_RX_OFFLOAD_QINQ_STRIP  0x00000020
 
 #define DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM 0x00000040
 
 #define DEV_RX_OFFLOAD_MACSEC_STRIP     0x00000080
 
+#define DEV_RX_OFFLOAD_HEADER_SPLIT 0x00000100
 
+#define DEV_RX_OFFLOAD_VLAN_FILTER  0x00000200
 
+#define DEV_RX_OFFLOAD_VLAN_EXTEND  0x00000400
 
+#define DEV_RX_OFFLOAD_JUMBO_FRAME  0x00000800
 
+#define DEV_RX_OFFLOAD_CRC_STRIP    0x00001000
 
+#define DEV_RX_OFFLOAD_SCATTER              0x00002000
 
+#define DEV_RX_OFFLOAD_CHECKSUM (DEV_RX_OFFLOAD_IPV4_CKSUM | \
 
+                             DEV_RX_OFFLOAD_UDP_CKSUM | \
 
+                             DEV_RX_OFFLOAD_TCP_CKSUM)
Quoted 8 lines

doc/guides/nics/features.rst

Quoted 5 lines
doc/guides/nics/features.rst +3 -0
+#define DEV_RX_OFFLOAD_VLAN (DEV_RX_OFFLOAD_VLAN_STRIP | \
 
+                          DEV_RX_OFFLOAD_VLAN_FILTER | \
 
+                          DEV_RX_OFFLOAD_VLAN_EXTEND)

It is not directly related to the patch, but I'd like to highlight that Rx/Tx are asymmetric here since SCTP is missing for Rx, but present for Tx.

Right. This can be added on a different series.

[snip]

#74 lore raw

Re: [PATCH v3 1/2] ethdev: introduce Rx queue offloads API

In reply to Shahaf Shuler
Quoted 21 lines · Shahaf Shuler

Introduce a new API to configure Rx offloads.

In the new API, offloads are divided into per-port and per-queue offloads. The PMD reports capability for each of them. Offloads are enabled using the existing DEV_RX_OFFLOAD_* flags. To enable per-port offload, the offload should be set on both device configuration and queue configuration. To enable per-queue offload, the offloads can be set only on queue configuration.

Applications should set the ignore_offload_bitfield bit on rxmode structure in order to move to the new API.

The old Rx offloads API is kept for the meanwhile, in order to enable a smooth transition for PMDs and application to the new API.

---
  doc/guides/nics/features.rst  |  33 ++++----
  lib/librte_ether/rte_ethdev.c | 156 +++++++++++++++++++++++++++++++++----
  lib/librte_ether/rte_ethdev.h |  51 +++++++++++-
  3 files changed, 210 insertions(+), 30 deletions(-)

[snip]

Quoted 99 lines
lib/librte_ether/rte_ethdev.c +78 -0
index 0597641ee..b3c10701e 100644
@@ -687,12 +687,90 @@ rte_eth_speed_bitflag(uint32_t speed, int duplex)
  	}
  }
 
+/**
+ * A conversion function from rxmode bitfield API.
+ */
+static void
+rte_eth_convert_rx_offload_bitfield(const struct rte_eth_rxmode *rxmode,
+				    uint64_t *rx_offloads)
+{
+	uint64_t offloads = 0;
+
+	if (rxmode->header_split == 1)
+		offloads |= DEV_RX_OFFLOAD_HEADER_SPLIT;
+	if (rxmode->hw_ip_checksum == 1)
+		offloads |= DEV_RX_OFFLOAD_CHECKSUM;
+	if (rxmode->hw_vlan_filter == 1)
+		offloads |= DEV_RX_OFFLOAD_VLAN_FILTER;
+	if (rxmode->hw_vlan_strip == 1)
+		offloads |= DEV_RX_OFFLOAD_VLAN_STRIP;
+	if (rxmode->hw_vlan_extend == 1)
+		offloads |= DEV_RX_OFFLOAD_VLAN_EXTEND;
+	if (rxmode->jumbo_frame == 1)
+		offloads |= DEV_RX_OFFLOAD_JUMBO_FRAME;
+	if (rxmode->hw_strip_crc == 1)
+		offloads |= DEV_RX_OFFLOAD_CRC_STRIP;
+	if (rxmode->enable_scatter == 1)
+		offloads |= DEV_RX_OFFLOAD_SCATTER;
+	if (rxmode->enable_lro == 1)
+		offloads |= DEV_RX_OFFLOAD_TCP_LRO;
+
+	*rx_offloads = offloads;
+}
+
+/**
+ * A conversion function from rxmode offloads API.
+ */
+static void
+rte_eth_convert_rx_offloads(const uint64_t rx_offloads,
+			    struct rte_eth_rxmode *rxmode)
+{
+
+	if (rx_offloads & DEV_RX_OFFLOAD_HEADER_SPLIT)
+		rxmode->header_split = 1;
+	else
+		rxmode->header_split = 0;
+	if (rx_offloads & DEV_RX_OFFLOAD_CHECKSUM)
+		rxmode->hw_ip_checksum = 1;
+	else
+		rxmode->hw_ip_checksum = 0;
+	if (rx_offloads & DEV_RX_OFFLOAD_VLAN_FILTER)
+		rxmode->hw_vlan_filter = 1;
+	else
+		rxmode->hw_vlan_filter = 0;
+	if (rx_offloads & DEV_RX_OFFLOAD_VLAN_STRIP)
+		rxmode->hw_vlan_strip = 1;
+	else
+		rxmode->hw_vlan_strip = 0;
+	if (rx_offloads & DEV_RX_OFFLOAD_VLAN_EXTEND)
+		rxmode->hw_vlan_extend = 1;
+	else
+		rxmode->hw_vlan_extend = 0;
+	if (rx_offloads & DEV_RX_OFFLOAD_JUMBO_FRAME)
+		rxmode->jumbo_frame = 1;
+	else
+		rxmode->jumbo_frame = 0;
+	if (rx_offloads & DEV_RX_OFFLOAD_CRC_STRIP)
+		rxmode->hw_strip_crc = 1;
+	else
+		rxmode->hw_strip_crc = 0;
+	if (rx_offloads & DEV_RX_OFFLOAD_SCATTER)
+		rxmode->enable_scatter = 1;
+	else
+		rxmode->enable_scatter = 0;
+	if (rx_offloads & DEV_RX_OFFLOAD_TCP_LRO)
+		rxmode->enable_lro = 1;
+	else
+		rxmode->enable_lro = 0;
+}
+
  int
  rte_eth_dev_configure(uint8_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
  		      const struct rte_eth_conf *dev_conf)
  {
  	struct rte_eth_dev *dev;
  	struct rte_eth_dev_info dev_info;
+	struct rte_eth_conf local_conf = *dev_conf;
  	int diag;
 
  	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL);
@@ -722,8 +800,20 @@ rte_eth_dev_configure(uint8_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
  		return -EBUSY;
  	}
 

lib/librte_ether/rte_ethdev.c rte_eth_dev_configure(uint8_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q, · line 812

Quoted 10 lines
lib/librte_ether/rte_ethdev.c +10 -0
+	/*
+	 * Convert between the offloads API to enable PMDs to support
+	 * only one of them.
+	 */
+	if ((dev_conf->rxmode.ignore_offload_bitfield == 0)) {
+		rte_eth_convert_rx_offload_bitfield(
+				&dev_conf->rxmode, &local_conf.rxmode.offloads);
+	} else {
+		rte_eth_convert_rx_offloads(dev_conf->rxmode.offloads,
+					    &local_conf.rxmode);

Ignore flag is lost here and it will result in treating txq_flags as the primary information about offloads. It is important in the case of failsafe PMD.

Quoted 8 lines
lib/librte_ether/rte_ethdev.c +3 -1
+	}
+
  	/* Copy the dev_conf parameter into the dev structure */
-	memcpy(&dev->data->dev_conf, dev_conf, sizeof(dev->data->dev_conf));
+	memcpy(&dev->data->dev_conf, &local_conf, sizeof(dev->data->dev_conf));
 
  	/*
  	 * Check that the numbers of RX and TX queues are not greater

[snip]

#75 lore raw

Re: [PATCH v3 1/2] ethdev: introduce Rx queue offloads API

Quoted 23 lines · Andrew Rybchenko
Quoted 22 lines · Shahaf Shuler

Introduce a new API to configure Rx offloads.

In the new API, offloads are divided into per-port and per-queue offloads. The PMD reports capability for each of them. Offloads are enabled using the existing DEV_RX_OFFLOAD_* flags. To enable per-port offload, the offload should be set on both device configuration and queue configuration. To enable per-queue offload, the offloads can be set only on queue configuration.

Applications should set the ignore_offload_bitfield bit on rxmode structure in order to move to the new API.

The old Rx offloads API is kept for the meanwhile, in order to enable a smooth transition for PMDs and application to the new API.

---
  doc/guides/nics/features.rst  |  33 ++++---- lib/librte_ether/rte_ethdev.c | 156
+++++++++++++++++++++++++++++++++----
  lib/librte_ether/rte_ethdev.h |  51 +++++++++++-

  3 files changed, 210 insertions(+), 30 deletions(-) 

[snip]

Quoted 2 lines
Quoted 2 lines
lib/librte_ether/rte_ethdev.c +0 -0
index 0597641ee..b3c10701e 100644

[snip]

Quoted 9 lines
Quoted 9 lines
lib/librte_ether/rte_ethdev.c +0 -0
@@ -722,8 +800,20 @@ rte_eth_dev_configure(uint8_t port_id, uint16_t 
 nb_rx_q, uint16_t nb_tx_q,
           return -EBUSY;
       }

  +    /*
+     * Convert between the offloads API to enable PMDs to support +     * only one of them.
+     */
+    if ((dev_conf->rxmode.ignore_offload_bitfield == 0)) {

Quoted 8 lines
Quoted 5 lines

+        rte_eth_convert_rx_offload_bitfield(
+                &dev_conf->rxmode, &local_conf.rxmode.offloads); +    } else {
+ rte_eth_convert_rx_offloads(dev_conf->rxmode.offloads, +                        &local_conf.rxmode);

Ignore flag is lost here and it will result in treating txq_flags as the primary information about offloads. It is important in the case of failsafe PMD.

Sorry, I mean rxmode (not txq_flags).

[snip]

#76 lore raw

Re: [PATCH v3 1/2] ethdev: introduce Rx queue offloads API

Wednesday, September 13, 2017 12:13 PM, Andrew Rybchenko:

Quoted 13 lines

lib/librte_ether/rte_ethdev.c rte_eth_dev_configure(uint8_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q, · line 812

Quoted 12 lines
return -EBUSY;
     }

+ /*

lib/librte_ether/rte_ethdev.c +9 -0
+     * Convert between the offloads API to enable PMDs to support
+     * only one of them.
+     */
+    if ((dev_conf->rxmode.ignore_offload_bitfield == 0)) {
+        rte_eth_convert_rx_offload_bitfield(
+                &dev_conf->rxmode, &local_conf.rxmode.offloads);
+    } else {
+        rte_eth_convert_rx_offloads(dev_conf->rxmode.offloads,
+                        &local_conf.rxmode);
Quoted 4 lines

Ignore flag is lost here and it will result in treating txq_flags as the primary information about offloads. It is important in the case of failsafe PMD.

Sorry, I mean rxmode (not txq_flags).

Am not sure the ignore_offload_bitfield is lost on converstion. The convert function does not assign to it.

#77 lore raw

Re: [PATCH v3 1/2] ethdev: introduce Rx queue offloads API

Quoted 24 lines · Shahaf Shuler

Wednesday, September 13, 2017 12:13 PM, Andrew Rybchenko:

        >>return -EBUSY;
        >>      }
        >>  +    /*
        >>+     * Convert between the offloads API to enable PMDs to
        support
        >>+     * only one of them.
        >>+     */
        >>+    if ((dev_conf->rxmode.ignore_offload_bitfield == 0)) {
        >>+ rte_eth_convert_rx_offload_bitfield(
        >>+ &dev_conf->rxmode, &local_conf.rxmode.offloads);
        >>+    } else {
        >>+ rte_eth_convert_rx_offloads(dev_conf->rxmode.offloads,
        >>+ &local_conf.rxmode);


    >Ignore flag is lost here and it will result in treating txq_flags
    as the primary
    >information about offloads. It is important in the case of
    failsafe PMD.
Quoted 1 line
Quoted 4 lines
Quoted 1 line

Sorry, I mean rxmode (not txq_flags).

Am not sure the ignore_offload_bitfield is lost on converstion. The convert function does not assign to it.

That's true. My bad.

#78 lore raw

PATCH v3 2/2 ethdev: introduce Tx queue offloads API

In reply to Shahaf Shuler

Introduce a new API to configure Tx offloads.

In the new API, offloads are divided into per-port and per-queue offloads. The PMD reports capability for each of them. Offloads are enabled using the existing DEV_TX_OFFLOAD_* flags. To enable per-port offload, the offload should be set on both device configuration and queue configuration. To enable per-queue offload, the offloads can be set only on queue configuration.

In addition the Tx offloads will be disabled by default and be enabled per application needs. This will much simplify PMD management of the different offloads.

Applications should set the ETH_TXQ_FLAGS_IGNORE flag on txq_flags field in order to move to the new API.

The old Tx offloads API is kept for the meanwhile, in order to enable a smooth transition for PMDs and application to the new API.

---
 doc/guides/nics/features.rst  | 33 +++++++++++++++-----
 lib/librte_ether/rte_ethdev.c | 64 +++++++++++++++++++++++++++++++++++++-
 lib/librte_ether/rte_ethdev.h | 38 +++++++++++++++++++++-
 3 files changed, 125 insertions(+), 10 deletions(-)
doc/guides/nics/features.rst +25 -8
index 4e68144ef..1a8af473b 100644
@@ -131,7 +131,8 @@ Lock-free Tx queue
 If a PMD advertises DEV_TX_OFFLOAD_MT_LOCKFREE capable, multiple threads can
 invoke rte_eth_tx_burst() concurrently on the same Tx queue without SW lock.
 
-* **[provides] rte_eth_dev_info**: ``tx_offload_capa:DEV_TX_OFFLOAD_MT_LOCKFREE``.
+* **[uses]    rte_eth_txconf,rte_eth_txmode**: ``offloads:DEV_TX_OFFLOAD_MT_LOCKFREE``.
+* **[provides] rte_eth_dev_info**: ``tx_offload_capa,tx_queue_offload_capa:DEV_TX_OFFLOAD_MT_LOCKFREE``.
 * **[related]  API**: ``rte_eth_tx_burst()``.
 
 
@@ -220,11 +221,12 @@ TSO
 
 Supports TCP Segmentation Offloading.
 
+* **[uses]       rte_eth_txconf,rte_eth_txmode**: ``offloads:DEV_TX_OFFLOAD_TCP_TSO``.
 * **[uses]       rte_eth_desc_lim**: ``nb_seg_max``, ``nb_mtu_seg_max``.
 * **[uses]       mbuf**: ``mbuf.ol_flags:PKT_TX_TCP_SEG``.
 * **[uses]       mbuf**: ``mbuf.tso_segsz``, ``mbuf.l2_len``, ``mbuf.l3_len``, ``mbuf.l4_len``.
 * **[implements] datapath**: ``TSO functionality``.
-* **[provides]   rte_eth_dev_info**: ``tx_offload_capa:DEV_TX_OFFLOAD_TCP_TSO,DEV_TX_OFFLOAD_UDP_TSO``.
+* **[provides]   rte_eth_dev_info**: ``tx_offload_capa,tx_queue_offload_capa:DEV_TX_OFFLOAD_TCP_TSO,DEV_TX_OFFLOAD_UDP_TSO``.
 
 
 .. _nic_features_promiscuous_mode:
@@ -510,10 +512,11 @@ VLAN offload
 Supports VLAN offload to hardware.
 
 * **[uses]       rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_VLAN_STRIP,DEV_RX_OFFLOAD_VLAN_FILTER,DEV_RX_OFFLOAD_VLAN_EXTEND``.
+* **[uses]       rte_eth_txconf,rte_eth_txmode**: ``offloads:DEV_TX_OFFLOAD_VLAN_INSERT``.
 * **[implements] eth_dev_ops**: ``vlan_offload_set``.
 * **[provides]   mbuf**: ``mbuf.ol_flags:PKT_RX_VLAN_STRIPPED``, ``mbuf.vlan_tci``.
 * **[provides]   rte_eth_dev_info**: ``rx_offload_capa,rx_queue_offload_capa:DEV_RX_OFFLOAD_VLAN_STRIP``,
-  ``tx_offload_capa:DEV_TX_OFFLOAD_VLAN_INSERT``.
+  ``tx_offload_capa,tx_queue_offload_capa:DEV_TX_OFFLOAD_VLAN_INSERT``.
 * **[related]    API**: ``rte_eth_dev_set_vlan_offload()``,
   ``rte_eth_dev_get_vlan_offload()``.
 
@@ -526,11 +529,12 @@ QinQ offload
 Supports QinQ (queue in queue) offload.
 
 * **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_QINQ_STRIP``.
+* **[uses]     rte_eth_txconf,rte_eth_txmode**: ``offloads:DEV_TX_OFFLOAD_QINQ_INSERT``.
 * **[uses]     mbuf**: ``mbuf.ol_flags:PKT_TX_QINQ_PKT``.
 * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_QINQ_STRIPPED``, ``mbuf.vlan_tci``,
    ``mbuf.vlan_tci_outer``.
 * **[provides] rte_eth_dev_info**: ``rx_offload_capa,rx_queue_offload_capa:DEV_RX_OFFLOAD_QINQ_STRIP``,
-  ``tx_offload_capa:DEV_TX_OFFLOAD_QINQ_INSERT``.
+  ``tx_offload_capa,tx_queue_offload_capa:DEV_TX_OFFLOAD_QINQ_INSERT``.
 
 
 .. _nic_features_l3_checksum_offload:
@@ -541,13 +545,14 @@ L3 checksum offload
 Supports L3 checksum offload.
 
 * **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_IPV4_CKSUM``.
+* **[uses]     rte_eth_txconf,rte_eth_txmode**: ``offloads:DEV_TX_OFFLOAD_IPV4_CKSUM``.
 * **[uses]     mbuf**: ``mbuf.ol_flags:PKT_TX_IP_CKSUM``,
   ``mbuf.ol_flags:PKT_TX_IPV4`` | ``PKT_TX_IPV6``.
 * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_IP_CKSUM_UNKNOWN`` |
   ``PKT_RX_IP_CKSUM_BAD`` | ``PKT_RX_IP_CKSUM_GOOD`` |
   ``PKT_RX_IP_CKSUM_NONE``.
 * **[provides] rte_eth_dev_info**: ``rx_offload_capa,rx_queue_offload_capa:DEV_RX_OFFLOAD_IPV4_CKSUM``,
-  ``tx_offload_capa:DEV_TX_OFFLOAD_IPV4_CKSUM``.
+  ``tx_offload_capa,tx_queue_offload_capa:DEV_TX_OFFLOAD_IPV4_CKSUM``.
 
 
 .. _nic_features_l4_checksum_offload:
@@ -558,6 +563,7 @@ L4 checksum offload
 Supports L4 checksum offload.
 
 * **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_UDP_CKSUM,DEV_RX_OFFLOAD_TCP_CKSUM``.
+* **[uses]     rte_eth_txconf,rte_eth_txmode**: ``offloads:DEV_TX_OFFLOAD_UDP_CKSUM,DEV_TX_OFFLOAD_TCP_CKSUM,DEV_TX_OFFLOAD_SCTP_CKSUM``.
 * **[uses]     mbuf**: ``mbuf.ol_flags:PKT_TX_IPV4`` | ``PKT_TX_IPV6``,
   ``mbuf.ol_flags:PKT_TX_L4_NO_CKSUM`` | ``PKT_TX_TCP_CKSUM`` |
   ``PKT_TX_SCTP_CKSUM`` | ``PKT_TX_UDP_CKSUM``.
@@ -565,7 +571,7 @@ Supports L4 checksum offload.
   ``PKT_RX_L4_CKSUM_BAD`` | ``PKT_RX_L4_CKSUM_GOOD`` |
   ``PKT_RX_L4_CKSUM_NONE``.
 * **[provides] rte_eth_dev_info**: ``rx_offload_capa,rx_queue_offload_capa:DEV_RX_OFFLOAD_UDP_CKSUM,DEV_RX_OFFLOAD_TCP_CKSUM``,
-  ``tx_offload_capa:DEV_TX_OFFLOAD_UDP_CKSUM,DEV_TX_OFFLOAD_TCP_CKSUM,DEV_TX_OFFLOAD_SCTP_CKSUM``.
+  ``tx_offload_capa,tx_queue_offload_capa:DEV_TX_OFFLOAD_UDP_CKSUM,DEV_TX_OFFLOAD_TCP_CKSUM,DEV_TX_OFFLOAD_SCTP_CKSUM``.
 
 
 .. _nic_features_macsec_offload:
@@ -576,9 +582,10 @@ MACsec offload
 Supports MACsec.
 
 * **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_MACSEC_STRIP``.
+* **[uses]     rte_eth_txconf,rte_eth_txmode**: ``offloads:DEV_TX_OFFLOAD_MACSEC_INSERT``.
 * **[uses]     mbuf**: ``mbuf.ol_flags:PKT_TX_MACSEC``.
 * **[provides] rte_eth_dev_info**: ``rx_offload_capa,rx_queue_offload_capa:DEV_RX_OFFLOAD_MACSEC_STRIP``,
-  ``tx_offload_capa:DEV_TX_OFFLOAD_MACSEC_INSERT``.
+  ``tx_offload_capa,tx_queue_offload_capa:DEV_TX_OFFLOAD_MACSEC_INSERT``.
 
 
 .. _nic_features_inner_l3_checksum:
@@ -589,6 +596,7 @@ Inner L3 checksum
 Supports inner packet L3 checksum.
 
 * **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM``.
+* **[uses]     rte_eth_txconf,rte_eth_txmode**: ``offloads:DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM``.
 * **[uses]     mbuf**: ``mbuf.ol_flags:PKT_TX_IP_CKSUM``,
   ``mbuf.ol_flags:PKT_TX_IPV4`` | ``PKT_TX_IPV6``,
   ``mbuf.ol_flags:PKT_TX_OUTER_IP_CKSUM``,
@@ -596,7 +604,7 @@ Supports inner packet L3 checksum.
 * **[uses]     mbuf**: ``mbuf.outer_l2_len``, ``mbuf.outer_l3_len``.
 * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_EIP_CKSUM_BAD``.
 * **[provides] rte_eth_dev_info**: ``rx_offload_capa,rx_queue_offload_capa:DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM``,
-  ``tx_offload_capa:DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM``.
+  ``tx_offload_capa,tx_queue_offload_capa:DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM``.
 
 
 .. _nic_features_inner_l4_checksum:
@@ -620,6 +628,15 @@ Supports packet type parsing and returns a list of supported types.
 
 .. _nic_features_timesync:
 
+Mbuf fast free
+--------------
+
+Supports optimization for fast release of mbufs following successful Tx.
+Requires all mbufs to come from the same mempool and has refcnt = 1.
+
+* **[uses]       rte_eth_txconf,rte_eth_txmode**: ``offloads:DEV_TX_OFFLOAD_MBUF_FAST_FREE``.
+* **[provides]   rte_eth_dev_info**: ``tx_offload_capa,tx_queue_offload_capa:DEV_TX_OFFLOAD_MBUF_FAST_FREE``.
+
 Timesync
 --------
 
lib/librte_ether/rte_ethdev.c +63 -1

83 lines not on this page · raw message

lib/librte_ether/rte_ethdev.h +37 -1
index ba7a2b2dc..d4a00a760 100644
@@ -692,6 +692,12 @@ struct rte_eth_vmdq_rx_conf {
  */
 struct rte_eth_txmode {
 	enum rte_eth_tx_mq_mode mq_mode; /**< TX multi-queues mode. */
+	/**
+	 * Per-port Tx offloads to be set using DEV_TX_OFFLOAD_* flags.
+	 * Only offloads set on tx_offload_capa field on rte_eth_dev_info
+	 * structure are allowed to be set.
+	 */
+	uint64_t offloads;
 
 	/* For i40e specifically */
 	uint16_t pvid;
@@ -734,6 +740,15 @@ struct rte_eth_rxconf {
 		(ETH_TXQ_FLAGS_NOXSUMSCTP | ETH_TXQ_FLAGS_NOXSUMUDP | \
 		 ETH_TXQ_FLAGS_NOXSUMTCP)
 /**
+ * When set the txq_flags should be ignored,
+ * instead per-queue Tx offloads will be set on offloads field
+ * located on rte_eth_txq_conf struct.
+ * This flag is temporary till the rte_eth_txq_conf.txq_flags
+ * API will be deprecated.
+ */
+#define ETH_TXQ_FLAGS_IGNORE	0x8000
+
+/**
  * A structure used to configure a TX ring of an Ethernet port.
  */
 struct rte_eth_txconf {
@@ -744,6 +759,12 @@ struct rte_eth_txconf {
 
 	uint32_t txq_flags; /**< Set flags for the Tx queue */
 	uint8_t tx_deferred_start; /**< Do not start queue with rte_eth_dev_start(). */
+	/**
+	 * Per-queue Tx offloads to be set  using DEV_TX_OFFLOAD_* flags.
+	 * Only offloads set on tx_queue_offload_capa field on rte_eth_dev_info
+	 * structure are allowed to be set.
+	 */
+	uint64_t offloads;
 };
 
 /**
@@ -968,6 +989,13 @@ struct rte_eth_conf {
 /**< Multiple threads can invoke rte_eth_tx_burst() concurrently on the same
  * tx queue without SW lock.
  */
+#define DEV_TX_OFFLOAD_MULTI_SEGS	0x00008000
+/**< Device supports multi segment send. */
+#define DEV_TX_OFFLOAD_MBUF_FAST_FREE	0x00010000
+/**< Device supports optimization for fast release of mbufs.
+ *   When set application must guarantee that all mbufs comes from a single
+ *   mempool and has refcnt = 1.
+ */
 
 struct rte_pci_device;
 
@@ -990,9 +1018,12 @@ struct rte_eth_dev_info {
 	uint16_t max_vmdq_pools; /**< Maximum number of VMDq pools. */
 	uint64_t rx_offload_capa;
 	/**< Device per port RX offload capabilities. */
-	uint32_t tx_offload_capa; /**< Device TX offload capabilities. */
+	uint64_t tx_offload_capa;
+	/**< Device per port TX offload capabilities. */
 	uint64_t rx_queue_offload_capa;
 	/**< Device per queue RX offload capabilities. */
+	uint64_t tx_queue_offload_capa;
+	/**< Device per queue TX offload capabilities. */
 	uint16_t reta_size;
 	/**< Device redirection table size, the total number of entries. */
 	uint8_t hash_key_size; /**< Hash key size in bytes */
@@ -2023,6 +2054,11 @@ int rte_eth_rx_queue_setup(uint8_t port_id, uint16_t rx_queue_id,
  *   - The *txq_flags* member contains flags to pass to the TX queue setup
  *     function to configure the behavior of the TX queue. This should be set
  *     to 0 if no special configuration is required.
+ *     This API is obsolete and will be deprecated. Applications
+ *     should set it to ETH_TXQ_FLAGS_IGNORE and use
+ *     the offloads field below.
+ *   - The *offloads* member contains Tx offloads to be enabled.
+ *     Offloads which are not set cannot be used on the datapath.
  *
  *     Note that setting *tx_free_thresh* or *tx_rs_thresh* value to 0 forces
  *     the transmit function to use default values.
Signature · 1 line
2.12.0
#79 lore raw

Re: [PATCH v3 2/2] ethdev: introduce Tx queue offloads API

Quoted 8 lines · Shahaf Shuler

Introduce a new API to configure Tx offloads.

In the new API, offloads are divided into per-port and per-queue offloads. The PMD reports capability for each of them. Offloads are enabled using the existing DEV_TX_OFFLOAD_* flags. To enable per-port offload, the offload should be set on both device configuration and queue configuration. To enable per-queue offload, the offloads can be set only on queue configuration.

Note about documentation of the per-queue and per-port offloads coexistence is applicable here as well. It would be really helpful to have it in the documentation.

Quoted 21 lines

In addition the Tx offloads will be disabled by default and be enabled per application needs. This will much simplify PMD management of the different offloads.

Applications should set the ETH_TXQ_FLAGS_IGNORE flag on txq_flags field in order to move to the new API.

The old Tx offloads API is kept for the meanwhile, in order to enable a smooth transition for PMDs and application to the new API.

---
  doc/guides/nics/features.rst  | 33 +++++++++++++++-----
  lib/librte_ether/rte_ethdev.c | 64 +++++++++++++++++++++++++++++++++++++-
  lib/librte_ether/rte_ethdev.h | 38 +++++++++++++++++++++-
  3 files changed, 125 insertions(+), 10 deletions(-)
doc/guides/nics/features.rst +0 -0
index 4e68144ef..1a8af473b 100644

[snip]

doc/guides/nics/features.rst Supports packet type parsing and returns a list of supported types. · line 635

Quoted 9 lines
doc/guides/nics/features.rst +5 -0
@@ -620,6 +628,15 @@ Supports packet type parsing and returns a list of supported types.
 
  .. _nic_features_timesync:
 
+Mbuf fast free
+--------------
+
+Supports optimization for fast release of mbufs following successful Tx.
+Requires all mbufs to come from the same mempool and has refcnt = 1.

It is ambiguous here in the case of fast free configured on port level. Please, highlight that "from the same mempool" is per-queue.

Quoted 11 lines
doc/guides/nics/features.rst +4 -0
+
+* **[uses]       rte_eth_txconf,rte_eth_txmode**: ``offloads:DEV_TX_OFFLOAD_MBUF_FAST_FREE``.
+* **[provides]   rte_eth_dev_info**: ``tx_offload_capa,tx_queue_offload_capa:DEV_TX_OFFLOAD_MBUF_FAST_FREE``.
+
  Timesync
  --------
 
lib/librte_ether/rte_ethdev.c +0 -0
index b3c10701e..85b99588f 100644

[snip]

Quoted 10 lines
lib/librte_ether/rte_ethdev.c +1 -0
@@ -1193,6 +1242,7 @@ rte_eth_tx_queue_setup(uint8_t port_id, uint16_t tx_queue_id,
  {
  	struct rte_eth_dev *dev;
  	struct rte_eth_dev_info dev_info;
+	struct rte_eth_txconf local_conf;
  	void **txq;
 
  	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL);
@@ -1237,8 +1287,20 @@ rte_eth_tx_queue_setup(uint8_t port_id, uint16_t tx_queue_id,
  	if (tx_conf == NULL)

lib/librte_ether/rte_ethdev.c rte_eth_tx_queue_setup(uint8_t port_id, uint16_t tx_queue_id, · line 1297

Quoted 10 lines
lib/librte_ether/rte_ethdev.c +8 -0
  		tx_conf = &dev_info.default_txconf;
 
+	/*
+	 * Convert between the offloads API to enable PMDs to support
+	 * only one of them.
+	 */
+	local_conf = *tx_conf;
+	if (tx_conf->txq_flags & ETH_TXQ_FLAGS_IGNORE)
+		rte_eth_convert_txq_offloads(tx_conf->offloads,
+					     &local_conf.txq_flags);

Is it intended that ignore flag is lost here?
It mean that failsafe slaves will treat txq_flags as the primary source of offloads configuration and do conversion from txq_flags to offloads.
For example, it means that DEV_TX_OFFLOAD_QINQ_INSERT will be lost as well as many other offloads which are not covered by txq_flags.

Quoted 10 lines
lib/librte_ether/rte_ethdev.c +5 -1
+	else
+		rte_eth_convert_txq_flags(tx_conf->txq_flags,
+					  &local_conf.offloads);
+
  	return (*dev->dev_ops->tx_queue_setup)(dev, tx_queue_id, nb_tx_desc,
-					       socket_id, tx_conf);
+					       socket_id, &local_conf);
  }
 
  void

[snip]

#80 lore raw

Re: [PATCH v3 2/2] ethdev: introduce Tx queue offloads API

Wednesday, September 13, 2017 11:41 AM, Andrew Rybchenko:

Quoted 4 lines
Quoted 3 lines

+Mbuf fast free

+--------------

Quoted 8 lines

doc/guides/nics/features.rst Supports packet type parsing and returns a list of supported types.

Quoted 5 lines
doc/guides/nics/features.rst +3 -0
+
 
+Supports optimization for fast release of mbufs following successful Tx.
 
+Requires all mbufs to come from the same mempool and has refcnt = 1.

It is ambiguous here in the case of fast free configured on port level. Please, highlight that "from the same mempool" is per-queue.

OK.

Quoted 6 lines
Quoted 5 lines
lib/librte_ether/rte_ethdev.c +3 -0
+     local_conf = *tx_conf;
 
+     if (tx_conf->txq_flags & ETH_TXQ_FLAGS_IGNORE)
 
+             rte_eth_convert_txq_offloads(tx_conf->offloads,
Quoted 7 lines
Quoted 1 line

+ &local_conf.txq_flags);

Is it intended that ignore flag is lost here?
It mean that failsafe slaves will treat txq_flags as the primary source of offloads configuration and do conversion from txq_flags to offloads.
For example, it means that DEV_TX_OFFLOAD_QINQ_INSERT will be lost as well as many other offloads which are not covered by txq_flags.

Right, this is bug. Thanks.

#81 lore raw
In reply to Shahaf Shuler
Quoted 13 lines · Shahaf Shuler

Tx offloads configuration is per queue. Tx offloads are enabled by default, and can be disabled using ETH_TXQ_FLAGS_NO* flags.
This behaviour is not consistent with the Rx side where the Rx offloads configuration is per port. Rx offloads are disabled by default and enabled according to bit field in rte_eth_rxmode structure.

Moreover, considering more Tx and Rx offloads will be added over time, the cost of managing them all inside the PMD will be tremendous, as the PMD will need to check the matching for the entire offload set for each mbuf it handles.
In addition, on the current approach each Rx offload added breaks the ABI compatibility as it requires to add entries to existing bit-fields.

Quoted 6 lines

The series address above issues by defining a new offloads API. With the new API, Tx and Rx offloads configuration is per queue. The offloads are disabled by default. Each offload can be enabled or disabled using the existing DEV_TX_OFFLOADS_* or DEV_RX_OFFLOADS_* flags. Such API will enable to easily add or remove offloads, without breaking the ABI compatibility.

It should be updated since offloads are configured now per-port and per-queue.

Quoted 11 lines

The new API does not have an equivalent for the below Tx flags:

* ETH_TXQ_FLAGS_NOREFCOUNT
* ETH_TXQ_FLAGS_NOMULTMEMP

The reason is that those flags are not to manage offloads, rather some guarantee from application on the way it uses mbufs, therefore could not be present as part of DEV_TX_OFFLOADS_*.
Such flags are useful only for benchmarks, and therefore provide a non-realistic performance for DPDK customers using simple benchmarks for evaluation. Leveraging the work being done in this series to clean up those flags.

It should be updated since now you care about these flags as well.

Quoted 29 lines

In order to provide a smooth transition between the APIs the following actions were taken:
* The old offloads API is kept for the meanwhile.
* New capabilities were added for PMD to advertize it has moved to the new offloads API.
* Helper function which copy from old to new API were added to ethdev, enabling the PMD to support only one of the APIs.

Per discussion made on the RFC of this series [1], the integration plan which was decided is to do the transition in two phases:
* ethdev API will move on 17.11.
* Apps and examples will move on 18.02.

This to enable PMD maintainers sufficient time to adopt the new API.

[1]
http://dpdk.org/ml/archives/dev/2017-August/072643.html

on v3:
- Introduce the DEV_TX_OFFLOAD_MBUF_FAST_FREE to act as an equivalent for the no refcnt and single mempool flags.
- Fix features documentation.
- Fix commnet style.

on v2:
- Taking new approach of dividing offloads into per-queue and per-port one.
- Postpone the Tx/Rx public struct renaming to 18.02
- squash the helper functions into the Rx/Tx offloads intro patches.

Quoted 8 lines

Shahaf Shuler (2):
ethdev: introduce Rx queue offloads API
ethdev: introduce Tx queue offloads API

  doc/guides/nics/features.rst  |  66 +++++++----
  lib/librte_ether/rte_ethdev.c | 220 ++++++++++++++++++++++++++++++++++---
  lib/librte_ether/rte_ethdev.h |  89 ++++++++++++++-
  3 files changed, 335 insertions(+), 40 deletions(-)

Many thanks for your work on this patch series.

#82 lore raw

v4 cover ethdev new offloads API

In reply to Shahaf Shuler

Tx offloads configuration is per queue. Tx offloads are enabled by default, and can be disabled using ETH_TXQ_FLAGS_NO* flags.
This behaviour is not consistent with the Rx side where the Rx offloads configuration is per port. Rx offloads are disabled by default and enabled according to bit field in rte_eth_rxmode structure.

Moreover, considering more Tx and Rx offloads will be added over time, the cost of managing them all inside the PMD will be tremendous, as the PMD will need to check the matching for the entire offload set for each mbuf it handles.
In addition, on the current approach each Rx offload added breaks the ABI compatibility as it requires to add entries to existing bit-fields.

The series address above issues by defining a new offloads API. In the new API, offloads are divided into per-port and per-queue offloads, with a corresponding capability for each.
The offloads are disabled by default. Each offload can be enabled or disabled using the existing DEV_TX_OFFLOADS_* or DEV_RX_OFFLOADS_* flags. Such API will enable to easily add or remove offloads, without breaking the ABI compatibility.

In order to provide a smooth transition between the APIs the following actions were taken:
* The old offloads API is kept for the meanwhile.
* Helper function which copy from old to new API were added to ethdev, enabling the PMD to support only one of the APIs.

Per discussion made on the RFC of this series [1], the integration plan which was decided is to do the transition in two phases:
* ethdev API will move on 17.11.
* Apps and examples will move on 18.02.

This to enable PMD maintainers sufficient time to adopt the new API.

[1]
http://dpdk.org/ml/archives/dev/2017-August/072643.html

on v4:
- Added another patch for documentation.
- Fixed ETH_TXQ_FLAGS_IGNORE flag override.
- clarify the description of DEV_TX_OFFLOAD_MBUF_FAST_FREE offload.

on v3:
- Introduce the DEV_TX_OFFLOAD_MBUF_FAST_FREE to act as an equivalent for the no refcnt and single mempool flags.
- Fix features documentation.
- Fix comment style.

on v2:
- Taking new approach of dividing offloads into per-queue and per-port one.
- Postpone the Tx/Rx public struct renaming to 18.02
- squash the helper functions into the Rx/Tx offloads intro patches.

Shahaf Shuler (3):
ethdev: introduce Rx queue offloads API
ethdev: introduce Tx queue offloads API
doc: add details on ethdev offloads API

 doc/guides/nics/features.rst            |  66 +++++---
 doc/guides/prog_guide/poll_mode_drv.rst |  17 ++
 lib/librte_ether/rte_ethdev.c           | 223 +++++++++++++++++++++++++--
 lib/librte_ether/rte_ethdev.h           |  89 ++++++++++-
 4 files changed, 355 insertions(+), 40 deletions(-)
Signature · 1 line
2.12.0
#83 lore raw

PATCH v4 1/3 ethdev: introduce Rx queue offloads API

Introduce a new API to configure Rx offloads.

In the new API, offloads are divided into per-port and per-queue offloads. The PMD reports capability for each of them. Offloads are enabled using the existing DEV_RX_OFFLOAD_* flags. To enable per-port offload, the offload should be set on both device configuration and queue configuration. To enable per-queue offload, the offloads can be set only on queue configuration.

Applications should set the ignore_offload_bitfield bit on rxmode structure in order to move to the new API.

The old Rx offloads API is kept for the meanwhile, in order to enable a smooth transition for PMDs and application to the new API.

---
 doc/guides/nics/features.rst  |  33 ++++----
 lib/librte_ether/rte_ethdev.c | 156 +++++++++++++++++++++++++++++++++----
 lib/librte_ether/rte_ethdev.h |  51 +++++++++++-
 3 files changed, 210 insertions(+), 30 deletions(-)
doc/guides/nics/features.rst +18 -15
index 37ffbc68c..4e68144ef 100644
@@ -179,7 +179,7 @@ Jumbo frame
 
 Supports Rx jumbo frames.
 
-* **[uses]    user config**: ``dev_conf.rxmode.jumbo_frame``,
+* **[uses]    rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_JUMBO_FRAME``.
   ``dev_conf.rxmode.max_rx_pkt_len``.
 * **[related] rte_eth_dev_info**: ``max_rx_pktlen``.
 * **[related] API**: ``rte_eth_dev_set_mtu()``.
@@ -192,7 +192,7 @@ Scattered Rx
 
 Supports receiving segmented mbufs.
 
-* **[uses]       user config**: ``dev_conf.rxmode.enable_scatter``.
+* **[uses]       rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_SCATTER``.
 * **[implements] datapath**: ``Scattered Rx function``.
 * **[implements] rte_eth_dev_data**: ``scattered_rx``.
 * **[provides]   eth_dev_ops**: ``rxq_info_get:scattered_rx``.
@@ -206,11 +206,11 @@ LRO
 
 Supports Large Receive Offload.
 
-* **[uses]       user config**: ``dev_conf.rxmode.enable_lro``.
+* **[uses]       rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_TCP_LRO``.
 * **[implements] datapath**: ``LRO functionality``.
 * **[implements] rte_eth_dev_data**: ``lro``.
 * **[provides]   mbuf**: ``mbuf.ol_flags:PKT_RX_LRO``, ``mbuf.tso_segsz``.
-* **[provides]   rte_eth_dev_info**: ``rx_offload_capa:DEV_RX_OFFLOAD_TCP_LRO``.
+* **[provides]   rte_eth_dev_info**: ``rx_offload_capa,rx_queue_offload_capa:DEV_RX_OFFLOAD_TCP_LRO``.
 
 
 .. _nic_features_tso:
@@ -363,7 +363,7 @@ VLAN filter
 
 Supports filtering of a VLAN Tag identifier.
 
-* **[uses]       user config**: ``dev_conf.rxmode.hw_vlan_filter``.
+* **[uses]       rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_VLAN_FILTER``.
 * **[implements] eth_dev_ops**: ``vlan_filter_set``.
 * **[related]    API**: ``rte_eth_dev_vlan_filter()``.
 
@@ -499,7 +499,7 @@ CRC offload
 
 Supports CRC stripping by hardware.
 
-* **[uses] user config**: ``dev_conf.rxmode.hw_strip_crc``.
+* **[uses] rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_CRC_STRIP``.
 
 
 .. _nic_features_vlan_offload:
@@ -509,11 +509,10 @@ VLAN offload
 
 Supports VLAN offload to hardware.
 
-* **[uses]       user config**: ``dev_conf.rxmode.hw_vlan_strip``,
-  ``dev_conf.rxmode.hw_vlan_filter``, ``dev_conf.rxmode.hw_vlan_extend``.
+* **[uses]       rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_VLAN_STRIP,DEV_RX_OFFLOAD_VLAN_FILTER,DEV_RX_OFFLOAD_VLAN_EXTEND``.
 * **[implements] eth_dev_ops**: ``vlan_offload_set``.
 * **[provides]   mbuf**: ``mbuf.ol_flags:PKT_RX_VLAN_STRIPPED``, ``mbuf.vlan_tci``.
-* **[provides]   rte_eth_dev_info**: ``rx_offload_capa:DEV_RX_OFFLOAD_VLAN_STRIP``,
+* **[provides]   rte_eth_dev_info**: ``rx_offload_capa,rx_queue_offload_capa:DEV_RX_OFFLOAD_VLAN_STRIP``,
   ``tx_offload_capa:DEV_TX_OFFLOAD_VLAN_INSERT``.
 * **[related]    API**: ``rte_eth_dev_set_vlan_offload()``,
   ``rte_eth_dev_get_vlan_offload()``.
@@ -526,10 +525,11 @@ QinQ offload
 
 Supports QinQ (queue in queue) offload.
 
+* **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_QINQ_STRIP``.
 * **[uses]     mbuf**: ``mbuf.ol_flags:PKT_TX_QINQ_PKT``.
 * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_QINQ_STRIPPED``, ``mbuf.vlan_tci``,
    ``mbuf.vlan_tci_outer``.
-* **[provides] rte_eth_dev_info**: ``rx_offload_capa:DEV_RX_OFFLOAD_QINQ_STRIP``,
+* **[provides] rte_eth_dev_info**: ``rx_offload_capa,rx_queue_offload_capa:DEV_RX_OFFLOAD_QINQ_STRIP``,
   ``tx_offload_capa:DEV_TX_OFFLOAD_QINQ_INSERT``.
 
 
@@ -540,13 +540,13 @@ L3 checksum offload
 
 Supports L3 checksum offload.
 
-* **[uses]     user config**: ``dev_conf.rxmode.hw_ip_checksum``.
+* **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_IPV4_CKSUM``.
 * **[uses]     mbuf**: ``mbuf.ol_flags:PKT_TX_IP_CKSUM``,
   ``mbuf.ol_flags:PKT_TX_IPV4`` | ``PKT_TX_IPV6``.
 * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_IP_CKSUM_UNKNOWN`` |
   ``PKT_RX_IP_CKSUM_BAD`` | ``PKT_RX_IP_CKSUM_GOOD`` |
   ``PKT_RX_IP_CKSUM_NONE``.
-* **[provides] rte_eth_dev_info**: ``rx_offload_capa:DEV_RX_OFFLOAD_IPV4_CKSUM``,
+* **[provides] rte_eth_dev_info**: ``rx_offload_capa,rx_queue_offload_capa:DEV_RX_OFFLOAD_IPV4_CKSUM``,
   ``tx_offload_capa:DEV_TX_OFFLOAD_IPV4_CKSUM``.
 
 
@@ -557,13 +557,14 @@ L4 checksum offload
 
 Supports L4 checksum offload.
 
+* **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_UDP_CKSUM,DEV_RX_OFFLOAD_TCP_CKSUM``.
 * **[uses]     mbuf**: ``mbuf.ol_flags:PKT_TX_IPV4`` | ``PKT_TX_IPV6``,
   ``mbuf.ol_flags:PKT_TX_L4_NO_CKSUM`` | ``PKT_TX_TCP_CKSUM`` |
   ``PKT_TX_SCTP_CKSUM`` | ``PKT_TX_UDP_CKSUM``.
 * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_L4_CKSUM_UNKNOWN`` |
   ``PKT_RX_L4_CKSUM_BAD`` | ``PKT_RX_L4_CKSUM_GOOD`` |
   ``PKT_RX_L4_CKSUM_NONE``.
-* **[provides] rte_eth_dev_info**: ``rx_offload_capa:DEV_RX_OFFLOAD_UDP_CKSUM,DEV_RX_OFFLOAD_TCP_CKSUM``,
+* **[provides] rte_eth_dev_info**: ``rx_offload_capa,rx_queue_offload_capa:DEV_RX_OFFLOAD_UDP_CKSUM,DEV_RX_OFFLOAD_TCP_CKSUM``,
   ``tx_offload_capa:DEV_TX_OFFLOAD_UDP_CKSUM,DEV_TX_OFFLOAD_TCP_CKSUM,DEV_TX_OFFLOAD_SCTP_CKSUM``.
 
 
@@ -574,8 +575,9 @@ MACsec offload
 
 Supports MACsec.
 
+* **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_MACSEC_STRIP``.
 * **[uses]     mbuf**: ``mbuf.ol_flags:PKT_TX_MACSEC``.
-* **[provides] rte_eth_dev_info**: ``rx_offload_capa:DEV_RX_OFFLOAD_MACSEC_STRIP``,
+* **[provides] rte_eth_dev_info**: ``rx_offload_capa,rx_queue_offload_capa:DEV_RX_OFFLOAD_MACSEC_STRIP``,
   ``tx_offload_capa:DEV_TX_OFFLOAD_MACSEC_INSERT``.
 
 
@@ -586,13 +588,14 @@ Inner L3 checksum
 
 Supports inner packet L3 checksum.
 
+* **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM``.
 * **[uses]     mbuf**: ``mbuf.ol_flags:PKT_TX_IP_CKSUM``,
   ``mbuf.ol_flags:PKT_TX_IPV4`` | ``PKT_TX_IPV6``,
   ``mbuf.ol_flags:PKT_TX_OUTER_IP_CKSUM``,
   ``mbuf.ol_flags:PKT_TX_OUTER_IPV4`` | ``PKT_TX_OUTER_IPV6``.
 * **[uses]     mbuf**: ``mbuf.outer_l2_len``, ``mbuf.outer_l3_len``.
 * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_EIP_CKSUM_BAD``.
-* **[provides] rte_eth_dev_info**: ``rx_offload_capa:DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM``,
+* **[provides] rte_eth_dev_info**: ``rx_offload_capa,rx_queue_offload_capa:DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM``,
   ``tx_offload_capa:DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM``.
 
 
lib/librte_ether/rte_ethdev.c +143 -13

233 lines not on this page · raw message

lib/librte_ether/rte_ethdev.h +49 -2

95 lines not on this page · raw message

Signature · 1 line
2.12.0
#84 lore raw

PATCH v4 2/3 ethdev: introduce Tx queue offloads API

In reply to Shahaf Shuler

Introduce a new API to configure Tx offloads.

In the new API, offloads are divided into per-port and per-queue offloads. The PMD reports capability for each of them. Offloads are enabled using the existing DEV_TX_OFFLOAD_* flags. To enable per-port offload, the offload should be set on both device configuration and queue configuration. To enable per-queue offload, the offloads can be set only on queue configuration.

In addition the Tx offloads will be disabled by default and be enabled per application needs. This will much simplify PMD management of the different offloads.

Applications should set the ETH_TXQ_FLAGS_IGNORE flag on txq_flags field in order to move to the new API.

The old Tx offloads API is kept for the meanwhile, in order to enable a smooth transition for PMDs and application to the new API.

---
 doc/guides/nics/features.rst  | 33 ++++++++++++++-----
 lib/librte_ether/rte_ethdev.c | 67 +++++++++++++++++++++++++++++++++++++-
 lib/librte_ether/rte_ethdev.h | 38 ++++++++++++++++++++-
 3 files changed, 128 insertions(+), 10 deletions(-)
doc/guides/nics/features.rst +25 -8
index 4e68144ef..1a8af473b 100644
@@ -131,7 +131,8 @@ Lock-free Tx queue
 If a PMD advertises DEV_TX_OFFLOAD_MT_LOCKFREE capable, multiple threads can
 invoke rte_eth_tx_burst() concurrently on the same Tx queue without SW lock.
 
-* **[provides] rte_eth_dev_info**: ``tx_offload_capa:DEV_TX_OFFLOAD_MT_LOCKFREE``.
+* **[uses]    rte_eth_txconf,rte_eth_txmode**: ``offloads:DEV_TX_OFFLOAD_MT_LOCKFREE``.
+* **[provides] rte_eth_dev_info**: ``tx_offload_capa,tx_queue_offload_capa:DEV_TX_OFFLOAD_MT_LOCKFREE``.
 * **[related]  API**: ``rte_eth_tx_burst()``.
 
 
@@ -220,11 +221,12 @@ TSO
 
 Supports TCP Segmentation Offloading.
 
+* **[uses]       rte_eth_txconf,rte_eth_txmode**: ``offloads:DEV_TX_OFFLOAD_TCP_TSO``.
 * **[uses]       rte_eth_desc_lim**: ``nb_seg_max``, ``nb_mtu_seg_max``.
 * **[uses]       mbuf**: ``mbuf.ol_flags:PKT_TX_TCP_SEG``.
 * **[uses]       mbuf**: ``mbuf.tso_segsz``, ``mbuf.l2_len``, ``mbuf.l3_len``, ``mbuf.l4_len``.
 * **[implements] datapath**: ``TSO functionality``.
-* **[provides]   rte_eth_dev_info**: ``tx_offload_capa:DEV_TX_OFFLOAD_TCP_TSO,DEV_TX_OFFLOAD_UDP_TSO``.
+* **[provides]   rte_eth_dev_info**: ``tx_offload_capa,tx_queue_offload_capa:DEV_TX_OFFLOAD_TCP_TSO,DEV_TX_OFFLOAD_UDP_TSO``.
 
 
 .. _nic_features_promiscuous_mode:
@@ -510,10 +512,11 @@ VLAN offload
 Supports VLAN offload to hardware.
 
 * **[uses]       rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_VLAN_STRIP,DEV_RX_OFFLOAD_VLAN_FILTER,DEV_RX_OFFLOAD_VLAN_EXTEND``.
+* **[uses]       rte_eth_txconf,rte_eth_txmode**: ``offloads:DEV_TX_OFFLOAD_VLAN_INSERT``.
 * **[implements] eth_dev_ops**: ``vlan_offload_set``.
 * **[provides]   mbuf**: ``mbuf.ol_flags:PKT_RX_VLAN_STRIPPED``, ``mbuf.vlan_tci``.
 * **[provides]   rte_eth_dev_info**: ``rx_offload_capa,rx_queue_offload_capa:DEV_RX_OFFLOAD_VLAN_STRIP``,
-  ``tx_offload_capa:DEV_TX_OFFLOAD_VLAN_INSERT``.
+  ``tx_offload_capa,tx_queue_offload_capa:DEV_TX_OFFLOAD_VLAN_INSERT``.
 * **[related]    API**: ``rte_eth_dev_set_vlan_offload()``,
   ``rte_eth_dev_get_vlan_offload()``.
 
@@ -526,11 +529,12 @@ QinQ offload
 Supports QinQ (queue in queue) offload.
 
 * **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_QINQ_STRIP``.
+* **[uses]     rte_eth_txconf,rte_eth_txmode**: ``offloads:DEV_TX_OFFLOAD_QINQ_INSERT``.
 * **[uses]     mbuf**: ``mbuf.ol_flags:PKT_TX_QINQ_PKT``.
 * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_QINQ_STRIPPED``, ``mbuf.vlan_tci``,
    ``mbuf.vlan_tci_outer``.
 * **[provides] rte_eth_dev_info**: ``rx_offload_capa,rx_queue_offload_capa:DEV_RX_OFFLOAD_QINQ_STRIP``,
-  ``tx_offload_capa:DEV_TX_OFFLOAD_QINQ_INSERT``.
+  ``tx_offload_capa,tx_queue_offload_capa:DEV_TX_OFFLOAD_QINQ_INSERT``.
 
 
 .. _nic_features_l3_checksum_offload:
@@ -541,13 +545,14 @@ L3 checksum offload
 Supports L3 checksum offload.
 
 * **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_IPV4_CKSUM``.
+* **[uses]     rte_eth_txconf,rte_eth_txmode**: ``offloads:DEV_TX_OFFLOAD_IPV4_CKSUM``.
 * **[uses]     mbuf**: ``mbuf.ol_flags:PKT_TX_IP_CKSUM``,
   ``mbuf.ol_flags:PKT_TX_IPV4`` | ``PKT_TX_IPV6``.
 * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_IP_CKSUM_UNKNOWN`` |
   ``PKT_RX_IP_CKSUM_BAD`` | ``PKT_RX_IP_CKSUM_GOOD`` |
   ``PKT_RX_IP_CKSUM_NONE``.
 * **[provides] rte_eth_dev_info**: ``rx_offload_capa,rx_queue_offload_capa:DEV_RX_OFFLOAD_IPV4_CKSUM``,
-  ``tx_offload_capa:DEV_TX_OFFLOAD_IPV4_CKSUM``.
+  ``tx_offload_capa,tx_queue_offload_capa:DEV_TX_OFFLOAD_IPV4_CKSUM``.
 
 
 .. _nic_features_l4_checksum_offload:
@@ -558,6 +563,7 @@ L4 checksum offload
 Supports L4 checksum offload.
 
 * **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_UDP_CKSUM,DEV_RX_OFFLOAD_TCP_CKSUM``.
+* **[uses]     rte_eth_txconf,rte_eth_txmode**: ``offloads:DEV_TX_OFFLOAD_UDP_CKSUM,DEV_TX_OFFLOAD_TCP_CKSUM,DEV_TX_OFFLOAD_SCTP_CKSUM``.
 * **[uses]     mbuf**: ``mbuf.ol_flags:PKT_TX_IPV4`` | ``PKT_TX_IPV6``,
   ``mbuf.ol_flags:PKT_TX_L4_NO_CKSUM`` | ``PKT_TX_TCP_CKSUM`` |
   ``PKT_TX_SCTP_CKSUM`` | ``PKT_TX_UDP_CKSUM``.
@@ -565,7 +571,7 @@ Supports L4 checksum offload.
   ``PKT_RX_L4_CKSUM_BAD`` | ``PKT_RX_L4_CKSUM_GOOD`` |
   ``PKT_RX_L4_CKSUM_NONE``.
 * **[provides] rte_eth_dev_info**: ``rx_offload_capa,rx_queue_offload_capa:DEV_RX_OFFLOAD_UDP_CKSUM,DEV_RX_OFFLOAD_TCP_CKSUM``,
-  ``tx_offload_capa:DEV_TX_OFFLOAD_UDP_CKSUM,DEV_TX_OFFLOAD_TCP_CKSUM,DEV_TX_OFFLOAD_SCTP_CKSUM``.
+  ``tx_offload_capa,tx_queue_offload_capa:DEV_TX_OFFLOAD_UDP_CKSUM,DEV_TX_OFFLOAD_TCP_CKSUM,DEV_TX_OFFLOAD_SCTP_CKSUM``.
 
 
 .. _nic_features_macsec_offload:
@@ -576,9 +582,10 @@ MACsec offload
 Supports MACsec.
 
 * **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_MACSEC_STRIP``.
+* **[uses]     rte_eth_txconf,rte_eth_txmode**: ``offloads:DEV_TX_OFFLOAD_MACSEC_INSERT``.
 * **[uses]     mbuf**: ``mbuf.ol_flags:PKT_TX_MACSEC``.
 * **[provides] rte_eth_dev_info**: ``rx_offload_capa,rx_queue_offload_capa:DEV_RX_OFFLOAD_MACSEC_STRIP``,
-  ``tx_offload_capa:DEV_TX_OFFLOAD_MACSEC_INSERT``.
+  ``tx_offload_capa,tx_queue_offload_capa:DEV_TX_OFFLOAD_MACSEC_INSERT``.
 
 
 .. _nic_features_inner_l3_checksum:
@@ -589,6 +596,7 @@ Inner L3 checksum
 Supports inner packet L3 checksum.
 
 * **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM``.
+* **[uses]     rte_eth_txconf,rte_eth_txmode**: ``offloads:DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM``.
 * **[uses]     mbuf**: ``mbuf.ol_flags:PKT_TX_IP_CKSUM``,
   ``mbuf.ol_flags:PKT_TX_IPV4`` | ``PKT_TX_IPV6``,
   ``mbuf.ol_flags:PKT_TX_OUTER_IP_CKSUM``,
@@ -596,7 +604,7 @@ Supports inner packet L3 checksum.
 * **[uses]     mbuf**: ``mbuf.outer_l2_len``, ``mbuf.outer_l3_len``.
 * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_EIP_CKSUM_BAD``.
 * **[provides] rte_eth_dev_info**: ``rx_offload_capa,rx_queue_offload_capa:DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM``,
-  ``tx_offload_capa:DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM``.
+  ``tx_offload_capa,tx_queue_offload_capa:DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM``.
 
 
 .. _nic_features_inner_l4_checksum:
@@ -620,6 +628,15 @@ Supports packet type parsing and returns a list of supported types.
 
 .. _nic_features_timesync:
 
+Mbuf fast free
+--------------
+
+Supports optimization for fast release of mbufs following successful Tx.
+Requires all mbufs to come from the same mempool and has refcnt = 1.
+
+* **[uses]       rte_eth_txconf,rte_eth_txmode**: ``offloads:DEV_TX_OFFLOAD_MBUF_FAST_FREE``.
+* **[provides]   rte_eth_dev_info**: ``tx_offload_capa,tx_queue_offload_capa:DEV_TX_OFFLOAD_MBUF_FAST_FREE``.
+
 Timesync
 --------
 
lib/librte_ether/rte_ethdev.c +66 -1

86 lines not on this page · raw message

lib/librte_ether/rte_ethdev.h +37 -1
index 6a2af355a..0a75b1b1e 100644
@@ -692,6 +692,12 @@ struct rte_eth_vmdq_rx_conf {
  */
 struct rte_eth_txmode {
 	enum rte_eth_tx_mq_mode mq_mode; /**< TX multi-queues mode. */
+	/**
+	 * Per-port Tx offloads to be set using DEV_TX_OFFLOAD_* flags.
+	 * Only offloads set on tx_offload_capa field on rte_eth_dev_info
+	 * structure are allowed to be set.
+	 */
+	uint64_t offloads;
 
 	/* For i40e specifically */
 	uint16_t pvid;
@@ -734,6 +740,15 @@ struct rte_eth_rxconf {
 		(ETH_TXQ_FLAGS_NOXSUMSCTP | ETH_TXQ_FLAGS_NOXSUMUDP | \
 		 ETH_TXQ_FLAGS_NOXSUMTCP)
 /**
+ * When set the txq_flags should be ignored,
+ * instead per-queue Tx offloads will be set on offloads field
+ * located on rte_eth_txq_conf struct.
+ * This flag is temporary till the rte_eth_txq_conf.txq_flags
+ * API will be deprecated.
+ */
+#define ETH_TXQ_FLAGS_IGNORE	0x8000
+
+/**
  * A structure used to configure a TX ring of an Ethernet port.
  */
 struct rte_eth_txconf {
@@ -744,6 +759,12 @@ struct rte_eth_txconf {
 
 	uint32_t txq_flags; /**< Set flags for the Tx queue */
 	uint8_t tx_deferred_start; /**< Do not start queue with rte_eth_dev_start(). */
+	/**
+	 * Per-queue Tx offloads to be set  using DEV_TX_OFFLOAD_* flags.
+	 * Only offloads set on tx_queue_offload_capa field on rte_eth_dev_info
+	 * structure are allowed to be set.
+	 */
+	uint64_t offloads;
 };
 
 /**
@@ -968,6 +989,13 @@ struct rte_eth_conf {
 /**< Multiple threads can invoke rte_eth_tx_burst() concurrently on the same
  * tx queue without SW lock.
  */
+#define DEV_TX_OFFLOAD_MULTI_SEGS	0x00008000
+/**< Device supports multi segment send. */
+#define DEV_TX_OFFLOAD_MBUF_FAST_FREE	0x00010000
+/**< Device supports optimization for fast release of mbufs.
+ *   When set application must guarantee that per-queue all mbufs comes from
+ *   the same mempool and has refcnt = 1.
+ */
 
 struct rte_pci_device;
 
@@ -990,9 +1018,12 @@ struct rte_eth_dev_info {
 	uint16_t max_vmdq_pools; /**< Maximum number of VMDq pools. */
 	uint64_t rx_offload_capa;
 	/**< Device per port RX offload capabilities. */
-	uint32_t tx_offload_capa; /**< Device TX offload capabilities. */
+	uint64_t tx_offload_capa;
+	/**< Device per port TX offload capabilities. */
 	uint64_t rx_queue_offload_capa;
 	/**< Device per queue RX offload capabilities. */
+	uint64_t tx_queue_offload_capa;
+	/**< Device per queue TX offload capabilities. */
 	uint16_t reta_size;
 	/**< Device redirection table size, the total number of entries. */
 	uint8_t hash_key_size; /**< Hash key size in bytes */
@@ -2027,6 +2058,11 @@ int rte_eth_rx_queue_setup(uint8_t port_id, uint16_t rx_queue_id,
  *   - The *txq_flags* member contains flags to pass to the TX queue setup
  *     function to configure the behavior of the TX queue. This should be set
  *     to 0 if no special configuration is required.
+ *     This API is obsolete and will be deprecated. Applications
+ *     should set it to ETH_TXQ_FLAGS_IGNORE and use
+ *     the offloads field below.
+ *   - The *offloads* member contains Tx offloads to be enabled.
+ *     Offloads which are not set cannot be used on the datapath.
  *
  *     Note that setting *tx_free_thresh* or *tx_rs_thresh* value to 0 forces
  *     the transmit function to use default values.
Signature · 1 line
2.12.0
#85 lore raw

Re: [PATCH v4 2/3] ethdev: introduce Tx queue offloads API

Quoted 25 lines · Shahaf Shuler

Introduce a new API to configure Tx offloads.

In the new API, offloads are divided into per-port and per-queue offloads. The PMD reports capability for each of them. Offloads are enabled using the existing DEV_TX_OFFLOAD_* flags. To enable per-port offload, the offload should be set on both device configuration and queue configuration. To enable per-queue offload, the offloads can be set only on queue configuration.

In addition the Tx offloads will be disabled by default and be enabled per application needs. This will much simplify PMD management of the different offloads.

Applications should set the ETH_TXQ_FLAGS_IGNORE flag on txq_flags field in order to move to the new API.

The old Tx offloads API is kept for the meanwhile, in order to enable a smooth transition for PMDs and application to the new API.

---
  doc/guides/nics/features.rst  | 33 ++++++++++++++-----
  lib/librte_ether/rte_ethdev.c | 67 +++++++++++++++++++++++++++++++++++++-
  lib/librte_ether/rte_ethdev.h | 38 ++++++++++++++++++++-
  3 files changed, 128 insertions(+), 10 deletions(-)

<...>

Quoted 4 lines
lib/librte_ether/rte_ethdev.h +0 -0
index 6a2af355a..0a75b1b1e 100644

<...>

lib/librte_ether/rte_ethdev.h struct rte_eth_txconf { · line 765

Quoted 8 lines
lib/librte_ether/rte_ethdev.h +4 -0
@@ -744,6 +759,12 @@ struct rte_eth_txconf {
 
  	uint32_t txq_flags; /**< Set flags for the Tx queue */
  	uint8_t tx_deferred_start; /**< Do not start queue with rte_eth_dev_start(). */
+	/**
+	 * Per-queue Tx offloads to be set  using DEV_TX_OFFLOAD_* flags.
+	 * Only offloads set on tx_queue_offload_capa field on rte_eth_dev_info
+	 * structure are allowed to be set.

It contradicts to the statements that:
-  tx_queue_offload_capa is per-queue offloads only
-  to enable per-port offload, the offload should be set on both device configuration and queue configuration.
Similar is applicable to Rx offloads as well.

Quoted 5 lines
lib/librte_ether/rte_ethdev.h +2 -0
+	 */
+	uint64_t offloads;
  };
 
  /**

<...>

#86 lore raw

PATCH v4 3/3 doc: add details on ethdev offloads API

In reply to Shahaf Shuler

Add the programmers guide details on the new offloads API introduced by commits:

commit f649472cad9d ("ethdev: introduce Rx queue offloads API") commit ecb46b66cda5 ("ethdev: introduce Tx queue offloads API")

---
 doc/guides/prog_guide/poll_mode_drv.rst | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
doc/guides/prog_guide/poll_mode_drv.rst +17 -0
index 8922e39f4..03092ae98 100644
@@ -310,6 +310,23 @@ exported by each PMD. The list of flags and their precise meaning is
 described in the mbuf API documentation and in the in :ref:`Mbuf Library
 <Mbuf_Library>`, section "Meta Information".
 
+Per-Port and Per-Queue Offloads
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+On DPDK 17.11, a new offloads API was introduced.
+
+In the new API, offloads are divided into per-port and per-queue offloads.
+The different offloads capabilities can be queried by ``rte_eth_dev_info_get()``. Offloads which is supported can be either per-port or per-queue.
+
+Offloads are enabled using the existing ``DEV_TX_OFFLOAD_*`` or ``DEV_RX_OFFLOAD_*`` flags.
+Per-port offload configuration is set on ``rte_eth_dev_configure``. Per-queue offload configuration is set on ``rte_eth_rx_queue_setup`` and ``rte_eth_tx_queue_setup``.
+To enable per-port offload, the offload should be set on both device configuration and queue setup. In case of a mixed configuration the queue setup shell return with error.
+To enable per-queue offload, the offload can be set only on the queue setup.
+Offloads which are not enabled are disabled by default.
+
+For application to use this Tx offloads API it should set the ``ETH_TXQ_FLAGS_IGNORE`` flag on ``txq_flags`` field located in ``rte_eth_txconf`` struct. On such case it is not required to set other flags on ``txq_flags``.
+For application to use this Rx offloads API it should set the ``ignore_offload_bitfield`` bit in ``rte_eth_rxmode`` struct. On such case it is not required to set other bitfield offloads on ``rxmode`` struct.
+
 Poll Mode Driver API
 --------------------
 
Signature · 1 line
2.12.0
#87 lore raw

Re: [PATCH v4 3/3] doc: add details on ethdev offloads API

Quoted 15 lines · Shahaf Shuler

Add the programmers guide details on the new offloads API introduced by commits:

commit f649472cad9d ("ethdev: introduce Rx queue offloads API") commit ecb46b66cda5 ("ethdev: introduce Tx queue offloads API")

---
  doc/guides/prog_guide/poll_mode_drv.rst | 17 +++++++++++++++++
  1 file changed, 17 insertions(+)
doc/guides/prog_guide/poll_mode_drv.rst +0 -0
index 8922e39f4..03092ae98 100644

<...>

Quoted 1 line

+To enable per-port offload, the offload should be set on both device configuration and queue setup. In case of a mixed configuration the queue setup shell return with error.

Typo "shell"

Reviewed-by on v4 3/3
#88 lore raw

Re: [PATCH v4 3/3] doc: add details on ethdev offloads API

In reply to Shahaf Shuler
Quoted 21 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Shahaf Shuler
Sent: Sunday, September 17, 2017 7:55 AM
To: [email protected]; [email protected]; Ananyev, Konstantin <[email protected]>; [email protected]
Cc: [email protected]
Subject: [dpdk-dev] [PATCH v4 3/3] doc: add details on ethdev offloads API

Add the programmers guide details on the new offloads API introduced by commits:

commit f649472cad9d ("ethdev: introduce Rx queue offloads API") commit ecb46b66cda5 ("ethdev: introduce Tx queue offloads API")

...

doc/guides/prog_guide/poll_mode_drv.rst exported by each PMD. The list of flags and their precise meaning is · line 316

Quoted 4 lines
doc/guides/prog_guide/poll_mode_drv.rst +4 -0
+Per-Port and Per-Queue Offloads
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+On DPDK 17.11, a new offloads API was introduced.

It is best to omit this line.

There are a number of small grammatical errors in the rest of the text. Probably something like this would be better:

Per-Port and Per-Queue Offloads
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

In the DPDK offload API, offloads are divided into per-port and per-queue offloads. The different offloads capabilities can be queried using ``rte_eth_dev_info_get()``. Supported offloads can be either per-port or per-queue.

Offloads are enabled using the existing ``DEV_TX_OFFLOAD_*`` or ``DEV_RX_OFFLOAD_*`` flags. Per-port offload configuration is set using ``rte_eth_dev_configure``.
Per-queue offload configuration is set using ``rte_eth_rx_queue_setup`` and ``rte_eth_tx_queue_setup``. To enable per-port offload, the offload should be set on both device configuration and queue setup. In case of a mixed configuration the queue setup shall return with an error.
To enable per-queue offload, the offload can be set only on the queue setup.
Offloads which are not enabled are disabled by default.

For an application to use the Tx offloads API it should set the ``ETH_TXQ_FLAGS_IGNORE`` flag in the ``txq_flags`` field located in ``rte_eth_txconf`` struct. In such cases it is not required to set other flags in ``txq_flags``.
In such cases it is not required to set other bitfield offloads in the ``rxmode`` struct.
For an application to use the Rx offloads API it should set the ``ignore_offload_bitfield`` bit in the ``rte_eth_rxmode`` struct.

#89 lore raw
In reply to Shahaf Shuler
Quoted 21 lines · Shahaf Shuler

Tx offloads configuration is per queue. Tx offloads are enabled by default, and can be disabled using ETH_TXQ_FLAGS_NO* flags.
This behaviour is not consistent with the Rx side where the Rx offloads configuration is per port. Rx offloads are disabled by default and enabled according to bit field in rte_eth_rxmode structure.

Moreover, considering more Tx and Rx offloads will be added over time, the cost of managing them all inside the PMD will be tremendous, as the PMD will need to check the matching for the entire offload set for each mbuf it handles.
In addition, on the current approach each Rx offload added breaks the ABI compatibility as it requires to add entries to existing bit-fields.

The series address above issues by defining a new offloads API. In the new API, offloads are divided into per-port and per-queue offloads, with a corresponding capability for each.
The offloads are disabled by default. Each offload can be enabled or disabled using the existing DEV_TX_OFFLOADS_* or DEV_RX_OFFLOADS_* flags. Such API will enable to easily add or remove offloads, without breaking the ABI compatibility.

Quoted 5 lines

In order to provide a smooth transition between the APIs the following actions were taken:
* The old offloads API is kept for the meanwhile.
* Helper function which copy from old to new API were added to ethdev, enabling the PMD to support only one of the APIs.

As I understand there is an API to copy from a new to old API as well, allowing applications to use the new API and work fine with PMD which supports an old API only.

Quoted 31 lines

Per discussion made on the RFC of this series [1], the integration plan which was decided is to do the transition in two phases:
* ethdev API will move on 17.11.
* Apps and examples will move on 18.02.

This to enable PMD maintainers sufficient time to adopt the new API.

[1]
http://dpdk.org/ml/archives/dev/2017-August/072643.html

on v4:
- Added another patch for documentation.
- Fixed ETH_TXQ_FLAGS_IGNORE flag override.
- clarify the description of DEV_TX_OFFLOAD_MBUF_FAST_FREE offload.

on v3:
- Introduce the DEV_TX_OFFLOAD_MBUF_FAST_FREE to act as an equivalent for the no refcnt and single mempool flags.
- Fix features documentation.
- Fix comment style.

on v2:
- Taking new approach of dividing offloads into per-queue and per-port one.
- Postpone the Tx/Rx public struct renaming to 18.02
- squash the helper functions into the Rx/Tx offloads intro patches.

Shahaf Shuler (3):
ethdev: introduce Rx queue offloads API
ethdev: introduce Tx queue offloads API
doc: add details on ethdev offloads API

Quoted 5 lines
  doc/guides/nics/features.rst            |  66 +++++---
  doc/guides/prog_guide/poll_mode_drv.rst |  17 ++
  lib/librte_ether/rte_ethdev.c           | 223 +++++++++++++++++++++++++--
  lib/librte_ether/rte_ethdev.h           |  89 ++++++++++-
  4 files changed, 355 insertions(+), 40 deletions(-)
#90 lore raw

v5 cover ethdev new offloads API

In reply to Shahaf Shuler

Tx offloads configuration is per queue. Tx offloads are enabled by default, and can be disabled using ETH_TXQ_FLAGS_NO* flags.
This behaviour is not consistent with the Rx side where the Rx offloads configuration is per port. Rx offloads are disabled by default and enabled according to bit field in rte_eth_rxmode structure.

Moreover, considering more Tx and Rx offloads will be added over time, the cost of managing them all inside the PMD will be tremendous, as the PMD will need to check the matching for the entire offload set for each mbuf it handles.
In addition, on the current approach each Rx offload added breaks the ABI compatibility as it requires to add entries to existing bit-fields.

The series address above issues by defining a new offloads API. In the new API, offloads are divided into per-port and per-queue offloads, with a corresponding capability for each.
The offloads are disabled by default. Each offload can be enabled or disabled using the existing DEV_TX_OFFLOADS_* or DEV_RX_OFFLOADS_* flags. Such API will enable to easily add or remove offloads, without breaking the ABI compatibility.

In order to provide a smooth transition between the APIs the following actions were taken:
* The old offloads API is kept for the meanwhile.
* Helper function which copy from old to new API were added to ethdev, enabling the PMD to support only one of the APIs.
* Helper function which copy from new to old API were also added, to enable application to use the new API with PMD which still supports the old one.

Per discussion made on the RFC of this series [1], the integration plan which was decided is to do the transition in two phases:
* ethdev API will move on 17.11.
* Apps and examples will move on 18.02.

This to enable PMD maintainers sufficient time to adopt the new API.

[1]
http://dpdk.org/ml/archives/dev/2017-August/072643.html

on v5:
- fix documentation.
- fix comments on port offloads configuration.

on v4:
- Added another patch for documentation.
- Fixed ETH_TXQ_FLAGS_IGNORE flag override.
- clarify the description of DEV_TX_OFFLOAD_MBUF_FAST_FREE offload.

on v3:
- Introduce the DEV_TX_OFFLOAD_MBUF_FAST_FREE to act as an equivalent for the no refcnt and single mempool flags.
- Fix features documentation.
- Fix comment style.

on v2:
- Taking new approach of dividing offloads into per-queue and per-port one.
- Postpone the Tx/Rx public struct renaming to 18.02
- squash the helper functions into the Rx/Tx offloads intro patches.

Shahaf Shuler (3):
ethdev: introduce Rx queue offloads API
ethdev: introduce Tx queue offloads API
doc: add details on ethdev offloads API

 doc/guides/nics/features.rst            |  66 +++++---
 doc/guides/prog_guide/poll_mode_drv.rst |  20 +++
 lib/librte_ether/rte_ethdev.c           | 223 +++++++++++++++++++++++++--
 lib/librte_ether/rte_ethdev.h           |  89 ++++++++++-
 4 files changed, 358 insertions(+), 40 deletions(-)
Signature · 1 line
2.12.0
#91 lore raw

PATCH v5 1/3 ethdev: introduce Rx queue offloads API

Introduce a new API to configure Rx offloads.

In the new API, offloads are divided into per-port and per-queue offloads. The PMD reports capability for each of them. Offloads are enabled using the existing DEV_RX_OFFLOAD_* flags. To enable per-port offload, the offload should be set on both device configuration and queue configuration. To enable per-queue offload, the offloads can be set only on queue configuration.

Applications should set the ignore_offload_bitfield bit on rxmode structure in order to move to the new API.

The old Rx offloads API is kept for the meanwhile, in order to enable a smooth transition for PMDs and application to the new API.

---
 doc/guides/nics/features.rst  |  33 ++++----
 lib/librte_ether/rte_ethdev.c | 156 +++++++++++++++++++++++++++++++++----
 lib/librte_ether/rte_ethdev.h |  51 +++++++++++-
 3 files changed, 210 insertions(+), 30 deletions(-)
doc/guides/nics/features.rst +18 -15
index 37ffbc68c..4e68144ef 100644
@@ -179,7 +179,7 @@ Jumbo frame
 
 Supports Rx jumbo frames.
 
-* **[uses]    user config**: ``dev_conf.rxmode.jumbo_frame``,
+* **[uses]    rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_JUMBO_FRAME``.
   ``dev_conf.rxmode.max_rx_pkt_len``.
 * **[related] rte_eth_dev_info**: ``max_rx_pktlen``.
 * **[related] API**: ``rte_eth_dev_set_mtu()``.
@@ -192,7 +192,7 @@ Scattered Rx
 
 Supports receiving segmented mbufs.
 
-* **[uses]       user config**: ``dev_conf.rxmode.enable_scatter``.
+* **[uses]       rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_SCATTER``.
 * **[implements] datapath**: ``Scattered Rx function``.
 * **[implements] rte_eth_dev_data**: ``scattered_rx``.
 * **[provides]   eth_dev_ops**: ``rxq_info_get:scattered_rx``.
@@ -206,11 +206,11 @@ LRO
 
 Supports Large Receive Offload.
 
-* **[uses]       user config**: ``dev_conf.rxmode.enable_lro``.
+* **[uses]       rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_TCP_LRO``.
 * **[implements] datapath**: ``LRO functionality``.
 * **[implements] rte_eth_dev_data**: ``lro``.
 * **[provides]   mbuf**: ``mbuf.ol_flags:PKT_RX_LRO``, ``mbuf.tso_segsz``.
-* **[provides]   rte_eth_dev_info**: ``rx_offload_capa:DEV_RX_OFFLOAD_TCP_LRO``.
+* **[provides]   rte_eth_dev_info**: ``rx_offload_capa,rx_queue_offload_capa:DEV_RX_OFFLOAD_TCP_LRO``.
 
 
 .. _nic_features_tso:
@@ -363,7 +363,7 @@ VLAN filter
 
 Supports filtering of a VLAN Tag identifier.
 
-* **[uses]       user config**: ``dev_conf.rxmode.hw_vlan_filter``.
+* **[uses]       rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_VLAN_FILTER``.
 * **[implements] eth_dev_ops**: ``vlan_filter_set``.
 * **[related]    API**: ``rte_eth_dev_vlan_filter()``.
 
@@ -499,7 +499,7 @@ CRC offload
 
 Supports CRC stripping by hardware.
 
-* **[uses] user config**: ``dev_conf.rxmode.hw_strip_crc``.
+* **[uses] rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_CRC_STRIP``.
 
 
 .. _nic_features_vlan_offload:
@@ -509,11 +509,10 @@ VLAN offload
 
 Supports VLAN offload to hardware.
 
-* **[uses]       user config**: ``dev_conf.rxmode.hw_vlan_strip``,
-  ``dev_conf.rxmode.hw_vlan_filter``, ``dev_conf.rxmode.hw_vlan_extend``.
+* **[uses]       rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_VLAN_STRIP,DEV_RX_OFFLOAD_VLAN_FILTER,DEV_RX_OFFLOAD_VLAN_EXTEND``.
 * **[implements] eth_dev_ops**: ``vlan_offload_set``.
 * **[provides]   mbuf**: ``mbuf.ol_flags:PKT_RX_VLAN_STRIPPED``, ``mbuf.vlan_tci``.
-* **[provides]   rte_eth_dev_info**: ``rx_offload_capa:DEV_RX_OFFLOAD_VLAN_STRIP``,
+* **[provides]   rte_eth_dev_info**: ``rx_offload_capa,rx_queue_offload_capa:DEV_RX_OFFLOAD_VLAN_STRIP``,
   ``tx_offload_capa:DEV_TX_OFFLOAD_VLAN_INSERT``.
 * **[related]    API**: ``rte_eth_dev_set_vlan_offload()``,
   ``rte_eth_dev_get_vlan_offload()``.
@@ -526,10 +525,11 @@ QinQ offload
 
 Supports QinQ (queue in queue) offload.
 
+* **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_QINQ_STRIP``.
 * **[uses]     mbuf**: ``mbuf.ol_flags:PKT_TX_QINQ_PKT``.
 * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_QINQ_STRIPPED``, ``mbuf.vlan_tci``,
    ``mbuf.vlan_tci_outer``.
-* **[provides] rte_eth_dev_info**: ``rx_offload_capa:DEV_RX_OFFLOAD_QINQ_STRIP``,
+* **[provides] rte_eth_dev_info**: ``rx_offload_capa,rx_queue_offload_capa:DEV_RX_OFFLOAD_QINQ_STRIP``,
   ``tx_offload_capa:DEV_TX_OFFLOAD_QINQ_INSERT``.
 
 
@@ -540,13 +540,13 @@ L3 checksum offload
 
 Supports L3 checksum offload.
 
-* **[uses]     user config**: ``dev_conf.rxmode.hw_ip_checksum``.
+* **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_IPV4_CKSUM``.
 * **[uses]     mbuf**: ``mbuf.ol_flags:PKT_TX_IP_CKSUM``,
   ``mbuf.ol_flags:PKT_TX_IPV4`` | ``PKT_TX_IPV6``.
 * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_IP_CKSUM_UNKNOWN`` |
   ``PKT_RX_IP_CKSUM_BAD`` | ``PKT_RX_IP_CKSUM_GOOD`` |
   ``PKT_RX_IP_CKSUM_NONE``.
-* **[provides] rte_eth_dev_info**: ``rx_offload_capa:DEV_RX_OFFLOAD_IPV4_CKSUM``,
+* **[provides] rte_eth_dev_info**: ``rx_offload_capa,rx_queue_offload_capa:DEV_RX_OFFLOAD_IPV4_CKSUM``,
   ``tx_offload_capa:DEV_TX_OFFLOAD_IPV4_CKSUM``.
 
 
@@ -557,13 +557,14 @@ L4 checksum offload
 
 Supports L4 checksum offload.
 
+* **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_UDP_CKSUM,DEV_RX_OFFLOAD_TCP_CKSUM``.
 * **[uses]     mbuf**: ``mbuf.ol_flags:PKT_TX_IPV4`` | ``PKT_TX_IPV6``,
   ``mbuf.ol_flags:PKT_TX_L4_NO_CKSUM`` | ``PKT_TX_TCP_CKSUM`` |
   ``PKT_TX_SCTP_CKSUM`` | ``PKT_TX_UDP_CKSUM``.
 * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_L4_CKSUM_UNKNOWN`` |
   ``PKT_RX_L4_CKSUM_BAD`` | ``PKT_RX_L4_CKSUM_GOOD`` |
   ``PKT_RX_L4_CKSUM_NONE``.
-* **[provides] rte_eth_dev_info**: ``rx_offload_capa:DEV_RX_OFFLOAD_UDP_CKSUM,DEV_RX_OFFLOAD_TCP_CKSUM``,
+* **[provides] rte_eth_dev_info**: ``rx_offload_capa,rx_queue_offload_capa:DEV_RX_OFFLOAD_UDP_CKSUM,DEV_RX_OFFLOAD_TCP_CKSUM``,
   ``tx_offload_capa:DEV_TX_OFFLOAD_UDP_CKSUM,DEV_TX_OFFLOAD_TCP_CKSUM,DEV_TX_OFFLOAD_SCTP_CKSUM``.
 
 
@@ -574,8 +575,9 @@ MACsec offload
 
 Supports MACsec.
 
+* **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_MACSEC_STRIP``.
 * **[uses]     mbuf**: ``mbuf.ol_flags:PKT_TX_MACSEC``.
-* **[provides] rte_eth_dev_info**: ``rx_offload_capa:DEV_RX_OFFLOAD_MACSEC_STRIP``,
+* **[provides] rte_eth_dev_info**: ``rx_offload_capa,rx_queue_offload_capa:DEV_RX_OFFLOAD_MACSEC_STRIP``,
   ``tx_offload_capa:DEV_TX_OFFLOAD_MACSEC_INSERT``.
 
 
@@ -586,13 +588,14 @@ Inner L3 checksum
 
 Supports inner packet L3 checksum.
 
+* **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM``.
 * **[uses]     mbuf**: ``mbuf.ol_flags:PKT_TX_IP_CKSUM``,
   ``mbuf.ol_flags:PKT_TX_IPV4`` | ``PKT_TX_IPV6``,
   ``mbuf.ol_flags:PKT_TX_OUTER_IP_CKSUM``,
   ``mbuf.ol_flags:PKT_TX_OUTER_IPV4`` | ``PKT_TX_OUTER_IPV6``.
 * **[uses]     mbuf**: ``mbuf.outer_l2_len``, ``mbuf.outer_l3_len``.
 * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_EIP_CKSUM_BAD``.
-* **[provides] rte_eth_dev_info**: ``rx_offload_capa:DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM``,
+* **[provides] rte_eth_dev_info**: ``rx_offload_capa,rx_queue_offload_capa:DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM``,
   ``tx_offload_capa:DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM``.
 
 
lib/librte_ether/rte_ethdev.c +143 -13

233 lines not on this page · raw message

lib/librte_ether/rte_ethdev.h +49 -2

95 lines not on this page · raw message

Signature · 1 line
2.12.0
#92 lore raw

Re: [PATCH v5 1/3] ethdev: introduce Rx queue offloads API

Quoted 16 lines · Shahaf Shuler

Introduce a new API to configure Rx offloads.

In the new API, offloads are divided into per-port and per-queue offloads. The PMD reports capability for each of them. Offloads are enabled using the existing DEV_RX_OFFLOAD_* flags. To enable per-port offload, the offload should be set on both device configuration and queue configuration. To enable per-queue offload, the offloads can be set only on queue configuration.

Applications should set the ignore_offload_bitfield bit on rxmode structure in order to move to the new API.

The old Rx offloads API is kept for the meanwhile, in order to enable a smooth transition for PMDs and application to the new API.

<...>

lib/librte_ether/rte_ethdev.c rte_eth_rx_queue_setup(uint8_t port_id, uint16_t rx_queue_id, · line 1204

Quoted 13 lines
lib/librte_ether/rte_ethdev.c +9 -0
@@ -1102,8 +1193,18 @@ rte_eth_rx_queue_setup(uint8_t port_id, uint16_t rx_queue_id,
 	if (rx_conf == NULL)
 		rx_conf = &dev_info.default_rxconf;
 
+	local_conf = *rx_conf;
+	if (dev->data->dev_conf.rxmode.ignore_offload_bitfield == 0) {
+		/**
+		 * Reflect port offloads to queue offloads in order for
+		 * offloads to not be discarded.
+		 */
+		rte_eth_convert_rx_offload_bitfield(&dev->data->dev_conf.rxmode,
+						    &local_conf.offloads);
+	}

If an application switches to the new method, it will set "offloads" and if underlying PMD doesn't support the new method it will just do nothing with "offloads" variable but problem is application won't know PMD just ignored them, it may think per queue offloads set.

Does it make sense to notify application that PMD doesn't understand that new "offloads" flag?

Quoted 7 lines
lib/librte_ether/rte_ethdev.c +2 -1
+
 	ret = (*dev->dev_ops->rx_queue_setup)(dev, rx_queue_id, nb_rx_desc,
-					      socket_id, rx_conf, mp);
+					      socket_id, &local_conf, mp);
 	if (!ret) {
 		if (!dev->data->min_rx_buf_size ||
 		    dev->data->min_rx_buf_size > mbp_buf_size)

<...>

lib/librte_ether/rte_ethdev.h struct rte_eth_rxconf { · line 719

Quoted 10 lines

/**

lib/librte_ether/rte_ethdev.h +5 -0
@@ -691,6 +712,12 @@ struct rte_eth_rxconf {
 	uint16_t rx_free_thresh; /**< Drives the freeing of RX descriptors. */
 	uint8_t rx_drop_en; /**< Drop packets if no descriptors are available. */
 	uint8_t rx_deferred_start; /**< Do not start queue with rte_eth_dev_start(). */
+	/**
+	 * Per-queue Rx offloads to be set using DEV_RX_OFFLOAD_* flags.
+	 * Only offloads set on rx_queue_offload_capa or rx_offload_capa
+	 * fields on rte_eth_dev_info structure are allowed to be set.
+	 */

How application will use above "capa" flags to decide what to set? Since "rx_queue_offload_capa" is new field introduced with this patch no PMD implemented it yet, does it means no application will be able to use per queue offloads yet?

Quoted 3 lines
lib/librte_ether/rte_ethdev.h +1 -0
+	uint64_t offloads;
 };
 

<...>

#93 lore raw

Re: [PATCH v5 1/3] ethdev: introduce Rx queue offloads API

Hi Ferruh,

Tuesday, October 3, 2017 3:32 AM, Ferruh Yigit:

Quoted 41 lines · Shahaf Shuler
Quoted 16 lines

Introduce a new API to configure Rx offloads.

In the new API, offloads are divided into per-port and per-queue offloads. The PMD reports capability for each of them. Offloads are enabled using the existing DEV_RX_OFFLOAD_* flags. To enable per-port offload, the offload should be set on both device configuration and queue configuration. To enable per-queue offload, the offloads can be set only on queue configuration.

Applications should set the ignore_offload_bitfield bit on rxmode structure in order to move to the new API.

The old Rx offloads API is kept for the meanwhile, in order to enable a smooth transition for PMDs and application to the new API.

<...>

Review rte_eth_rx_queue_setup(uint8_t port_id,

Quoted 1 line
(quoted diff) +0 -0
@@ -1102,8 +1193,18 @@ rte_eth_rx_queue_setup(uint8_t port_id,

uint16_t rx_queue_id,

lib/librte_ether/rte_ethdev.c rte_eth_rx_queue_setup(uint8_t port_id, uint16_t rx_queue_id, · line 1204

Quoted 13 lines
lib/librte_ether/rte_ethdev.c +9 -0
 	if (rx_conf == NULL)
 		rx_conf = &dev_info.default_rxconf;
 
+	local_conf = *rx_conf;
+	if (dev->data->dev_conf.rxmode.ignore_offload_bitfield == 0) {
+		/**
+		 * Reflect port offloads to queue offloads in order for
+		 * offloads to not be discarded.
+		 */
+		rte_eth_convert_rx_offload_bitfield(&dev->data-
 dev_conf.rxmode,
+						    &local_conf.offloads);
+	}

If an application switches to the new method, it will set "offloads" and if underlying PMD doesn't support the new method it will just do nothing with "offloads" variable but problem is application won't know PMD just ignored them, it may think per queue offloads set.

Quoted 2 lines

Does it make sense to notify application that PMD doesn't understand that new "offloads" flag?

I don't think it is needed. In the new API the per-queue Rx offloads caps are reported using a new rx_queue_offload_capa field. Old PMD will not set it, therefore application which use the new API will see that the underlying PMD is supporting only per-port Rx offloads. This should be enough for it to understand that the per-queue offloads won't be set.

Quoted 18 lines

Review rte_eth_rx_queue_setup(uint8_t port_id, · line 1207

Quoted 3 lines
(quoted diff) +1 -0
+
 	ret = (*dev->dev_ops->rx_queue_setup)(dev, rx_queue_id,

nb_rx_desc,

Quoted 5 lines
lib/librte_ether/rte_ethdev.c +1 -1
-					      socket_id, rx_conf, mp);
+					      socket_id, &local_conf, mp);
 	if (!ret) {
 		if (!dev->data->min_rx_buf_size ||

dev->data->min_rx_buf_size > mbp_buf_size)

<...>

Review struct rte_eth_rxconf { · line 712

Quoted 3 lines

/**

(quoted diff) +0 -0
@@ -691,6 +712,12 @@ struct rte_eth_rxconf {
 	uint16_t rx_free_thresh; /**< Drives the freeing of RX descriptors.

*/

Review struct rte_eth_rxconf { · line 713

Quoted 1 line
(quoted diff) +0 -0
 	uint8_t rx_drop_en; /**< Drop packets if no descriptors are

available. */

Quoted 12 lines

lib/librte_ether/rte_ethdev.h struct rte_eth_rxconf { · line 719

Quoted 7 lines
(quoted diff) +0 -0
 	uint8_t rx_deferred_start; /**< Do not start queue with

rte_eth_dev_start(). */

lib/librte_ether/rte_ethdev.h +5 -0
+	/**
+	 * Per-queue Rx offloads to be set using DEV_RX_OFFLOAD_* flags.
+	 * Only offloads set on rx_queue_offload_capa or rx_offload_capa
+	 * fields on rte_eth_dev_info structure are allowed to be set.
+	 */

How application will use above "capa" flags to decide what to set? Since "rx_queue_offload_capa" is new field introduced with this patch no PMD implemented it yet, does it means no application will be able to use per queue offloads yet?

Yes.
Application which use the new offloads API should query the device info and look into the rx_offloads_capa and rx_queue_offloads_capa. According to those 2 caps it will decide how to set the offloads.
Per-queue Rx offloads is a new functionality introduced in this series. Of course old PMD will not support it, and this will be reflected on the rx_queue_offlaods_capa.

Quoted 6 lines
Quoted 4 lines
lib/librte_ether/rte_ethdev.h +1 -0
+	uint64_t offloads;
 };

<...>

#94 lore raw

Re: [PATCH v5 1/3] ethdev: introduce Rx queue offloads API

Quoted 44 lines · Shahaf Shuler

Hi Ferruh,

Tuesday, October 3, 2017 3:32 AM, Ferruh Yigit:

Quoted 41 lines · Shahaf Shuler
Quoted 16 lines

Introduce a new API to configure Rx offloads.

In the new API, offloads are divided into per-port and per-queue offloads. The PMD reports capability for each of them. Offloads are enabled using the existing DEV_RX_OFFLOAD_* flags. To enable per-port offload, the offload should be set on both device configuration and queue configuration. To enable per-queue offload, the offloads can be set only on queue configuration.

Applications should set the ignore_offload_bitfield bit on rxmode structure in order to move to the new API.

The old Rx offloads API is kept for the meanwhile, in order to enable a smooth transition for PMDs and application to the new API.

<...>

Review rte_eth_rx_queue_setup(uint8_t port_id,

Quoted 1 line
(quoted diff) +0 -0
@@ -1102,8 +1193,18 @@ rte_eth_rx_queue_setup(uint8_t port_id,

uint16_t rx_queue_id,

lib/librte_ether/rte_ethdev.c rte_eth_rx_queue_setup(uint8_t port_id, uint16_t rx_queue_id, · line 1204

Quoted 13 lines
lib/librte_ether/rte_ethdev.c +9 -0
 	if (rx_conf == NULL)
 		rx_conf = &dev_info.default_rxconf;
 
+	local_conf = *rx_conf;
+	if (dev->data->dev_conf.rxmode.ignore_offload_bitfield == 0) {
+		/**
+		 * Reflect port offloads to queue offloads in order for
+		 * offloads to not be discarded.
+		 */
+		rte_eth_convert_rx_offload_bitfield(&dev->data-
 dev_conf.rxmode,
+						    &local_conf.offloads);
+	}

If an application switches to the new method, it will set "offloads" and if underlying PMD doesn't support the new method it will just do nothing with "offloads" variable but problem is application won't know PMD just ignored them, it may think per queue offloads set.

Quoted 5 lines
Quoted 2 lines

Does it make sense to notify application that PMD doesn't understand that new "offloads" flag?

I don't think it is needed. In the new API the per-queue Rx offloads caps are reported using a new rx_queue_offload_capa field. Old PMD will not set it, therefore application which use the new API will see that the underlying PMD is supporting only per-port Rx offloads. This should be enough for it to understand that the per-queue offloads won't be set.

OK, makes sense, so application should check queue bases offload capabilities PMD returned and decide port based or queue based offloads to use.

Quoted 11 lines
Quoted 11 lines

Review rte_eth_rx_queue_setup(uint8_t port_id, · line 1207

Quoted 4 lines
(quoted diff) +1 -0
+
 	ret = (*dev->dev_ops->rx_queue_setup)(dev, rx_queue_id,

nb_rx_desc,

Quoted 5 lines
lib/librte_ether/rte_ethdev.c +1 -1
-					      socket_id, rx_conf, mp);
+					      socket_id, &local_conf, mp);
 	if (!ret) {
 		if (!dev->data->min_rx_buf_size ||

dev->data->min_rx_buf_size > mbp_buf_size)

<...>

#95 lore raw

PATCH v5 2/3 ethdev: introduce Tx queue offloads API

In reply to Shahaf Shuler

Introduce a new API to configure Tx offloads.

In the new API, offloads are divided into per-port and per-queue offloads. The PMD reports capability for each of them. Offloads are enabled using the existing DEV_TX_OFFLOAD_* flags. To enable per-port offload, the offload should be set on both device configuration and queue configuration. To enable per-queue offload, the offloads can be set only on queue configuration.

In addition the Tx offloads will be disabled by default and be enabled per application needs. This will much simplify PMD management of the different offloads.

Applications should set the ETH_TXQ_FLAGS_IGNORE flag on txq_flags field in order to move to the new API.

The old Tx offloads API is kept for the meanwhile, in order to enable a smooth transition for PMDs and application to the new API.

---
 doc/guides/nics/features.rst  | 33 ++++++++++++++-----
 lib/librte_ether/rte_ethdev.c | 67 +++++++++++++++++++++++++++++++++++++-
 lib/librte_ether/rte_ethdev.h | 38 ++++++++++++++++++++-
 3 files changed, 128 insertions(+), 10 deletions(-)
doc/guides/nics/features.rst +25 -8
index 4e68144ef..1a8af473b 100644
@@ -131,7 +131,8 @@ Lock-free Tx queue
 If a PMD advertises DEV_TX_OFFLOAD_MT_LOCKFREE capable, multiple threads can
 invoke rte_eth_tx_burst() concurrently on the same Tx queue without SW lock.
 
-* **[provides] rte_eth_dev_info**: ``tx_offload_capa:DEV_TX_OFFLOAD_MT_LOCKFREE``.
+* **[uses]    rte_eth_txconf,rte_eth_txmode**: ``offloads:DEV_TX_OFFLOAD_MT_LOCKFREE``.
+* **[provides] rte_eth_dev_info**: ``tx_offload_capa,tx_queue_offload_capa:DEV_TX_OFFLOAD_MT_LOCKFREE``.
 * **[related]  API**: ``rte_eth_tx_burst()``.
 
 
@@ -220,11 +221,12 @@ TSO
 
 Supports TCP Segmentation Offloading.
 
+* **[uses]       rte_eth_txconf,rte_eth_txmode**: ``offloads:DEV_TX_OFFLOAD_TCP_TSO``.
 * **[uses]       rte_eth_desc_lim**: ``nb_seg_max``, ``nb_mtu_seg_max``.
 * **[uses]       mbuf**: ``mbuf.ol_flags:PKT_TX_TCP_SEG``.
 * **[uses]       mbuf**: ``mbuf.tso_segsz``, ``mbuf.l2_len``, ``mbuf.l3_len``, ``mbuf.l4_len``.
 * **[implements] datapath**: ``TSO functionality``.
-* **[provides]   rte_eth_dev_info**: ``tx_offload_capa:DEV_TX_OFFLOAD_TCP_TSO,DEV_TX_OFFLOAD_UDP_TSO``.
+* **[provides]   rte_eth_dev_info**: ``tx_offload_capa,tx_queue_offload_capa:DEV_TX_OFFLOAD_TCP_TSO,DEV_TX_OFFLOAD_UDP_TSO``.
 
 
 .. _nic_features_promiscuous_mode:
@@ -510,10 +512,11 @@ VLAN offload
 Supports VLAN offload to hardware.
 
 * **[uses]       rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_VLAN_STRIP,DEV_RX_OFFLOAD_VLAN_FILTER,DEV_RX_OFFLOAD_VLAN_EXTEND``.
+* **[uses]       rte_eth_txconf,rte_eth_txmode**: ``offloads:DEV_TX_OFFLOAD_VLAN_INSERT``.
 * **[implements] eth_dev_ops**: ``vlan_offload_set``.
 * **[provides]   mbuf**: ``mbuf.ol_flags:PKT_RX_VLAN_STRIPPED``, ``mbuf.vlan_tci``.
 * **[provides]   rte_eth_dev_info**: ``rx_offload_capa,rx_queue_offload_capa:DEV_RX_OFFLOAD_VLAN_STRIP``,
-  ``tx_offload_capa:DEV_TX_OFFLOAD_VLAN_INSERT``.
+  ``tx_offload_capa,tx_queue_offload_capa:DEV_TX_OFFLOAD_VLAN_INSERT``.
 * **[related]    API**: ``rte_eth_dev_set_vlan_offload()``,
   ``rte_eth_dev_get_vlan_offload()``.
 
@@ -526,11 +529,12 @@ QinQ offload
 Supports QinQ (queue in queue) offload.
 
 * **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_QINQ_STRIP``.
+* **[uses]     rte_eth_txconf,rte_eth_txmode**: ``offloads:DEV_TX_OFFLOAD_QINQ_INSERT``.
 * **[uses]     mbuf**: ``mbuf.ol_flags:PKT_TX_QINQ_PKT``.
 * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_QINQ_STRIPPED``, ``mbuf.vlan_tci``,
    ``mbuf.vlan_tci_outer``.
 * **[provides] rte_eth_dev_info**: ``rx_offload_capa,rx_queue_offload_capa:DEV_RX_OFFLOAD_QINQ_STRIP``,
-  ``tx_offload_capa:DEV_TX_OFFLOAD_QINQ_INSERT``.
+  ``tx_offload_capa,tx_queue_offload_capa:DEV_TX_OFFLOAD_QINQ_INSERT``.
 
 
 .. _nic_features_l3_checksum_offload:
@@ -541,13 +545,14 @@ L3 checksum offload
 Supports L3 checksum offload.
 
 * **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_IPV4_CKSUM``.
+* **[uses]     rte_eth_txconf,rte_eth_txmode**: ``offloads:DEV_TX_OFFLOAD_IPV4_CKSUM``.
 * **[uses]     mbuf**: ``mbuf.ol_flags:PKT_TX_IP_CKSUM``,
   ``mbuf.ol_flags:PKT_TX_IPV4`` | ``PKT_TX_IPV6``.
 * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_IP_CKSUM_UNKNOWN`` |
   ``PKT_RX_IP_CKSUM_BAD`` | ``PKT_RX_IP_CKSUM_GOOD`` |
   ``PKT_RX_IP_CKSUM_NONE``.
 * **[provides] rte_eth_dev_info**: ``rx_offload_capa,rx_queue_offload_capa:DEV_RX_OFFLOAD_IPV4_CKSUM``,
-  ``tx_offload_capa:DEV_TX_OFFLOAD_IPV4_CKSUM``.
+  ``tx_offload_capa,tx_queue_offload_capa:DEV_TX_OFFLOAD_IPV4_CKSUM``.
 
 
 .. _nic_features_l4_checksum_offload:
@@ -558,6 +563,7 @@ L4 checksum offload
 Supports L4 checksum offload.
 
 * **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_UDP_CKSUM,DEV_RX_OFFLOAD_TCP_CKSUM``.
+* **[uses]     rte_eth_txconf,rte_eth_txmode**: ``offloads:DEV_TX_OFFLOAD_UDP_CKSUM,DEV_TX_OFFLOAD_TCP_CKSUM,DEV_TX_OFFLOAD_SCTP_CKSUM``.
 * **[uses]     mbuf**: ``mbuf.ol_flags:PKT_TX_IPV4`` | ``PKT_TX_IPV6``,
   ``mbuf.ol_flags:PKT_TX_L4_NO_CKSUM`` | ``PKT_TX_TCP_CKSUM`` |
   ``PKT_TX_SCTP_CKSUM`` | ``PKT_TX_UDP_CKSUM``.
@@ -565,7 +571,7 @@ Supports L4 checksum offload.
   ``PKT_RX_L4_CKSUM_BAD`` | ``PKT_RX_L4_CKSUM_GOOD`` |
   ``PKT_RX_L4_CKSUM_NONE``.
 * **[provides] rte_eth_dev_info**: ``rx_offload_capa,rx_queue_offload_capa:DEV_RX_OFFLOAD_UDP_CKSUM,DEV_RX_OFFLOAD_TCP_CKSUM``,
-  ``tx_offload_capa:DEV_TX_OFFLOAD_UDP_CKSUM,DEV_TX_OFFLOAD_TCP_CKSUM,DEV_TX_OFFLOAD_SCTP_CKSUM``.
+  ``tx_offload_capa,tx_queue_offload_capa:DEV_TX_OFFLOAD_UDP_CKSUM,DEV_TX_OFFLOAD_TCP_CKSUM,DEV_TX_OFFLOAD_SCTP_CKSUM``.
 
 
 .. _nic_features_macsec_offload:
@@ -576,9 +582,10 @@ MACsec offload
 Supports MACsec.
 
 * **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_MACSEC_STRIP``.
+* **[uses]     rte_eth_txconf,rte_eth_txmode**: ``offloads:DEV_TX_OFFLOAD_MACSEC_INSERT``.
 * **[uses]     mbuf**: ``mbuf.ol_flags:PKT_TX_MACSEC``.
 * **[provides] rte_eth_dev_info**: ``rx_offload_capa,rx_queue_offload_capa:DEV_RX_OFFLOAD_MACSEC_STRIP``,
-  ``tx_offload_capa:DEV_TX_OFFLOAD_MACSEC_INSERT``.
+  ``tx_offload_capa,tx_queue_offload_capa:DEV_TX_OFFLOAD_MACSEC_INSERT``.
 
 
 .. _nic_features_inner_l3_checksum:
@@ -589,6 +596,7 @@ Inner L3 checksum
 Supports inner packet L3 checksum.
 
 * **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM``.
+* **[uses]     rte_eth_txconf,rte_eth_txmode**: ``offloads:DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM``.
 * **[uses]     mbuf**: ``mbuf.ol_flags:PKT_TX_IP_CKSUM``,
   ``mbuf.ol_flags:PKT_TX_IPV4`` | ``PKT_TX_IPV6``,
   ``mbuf.ol_flags:PKT_TX_OUTER_IP_CKSUM``,
@@ -596,7 +604,7 @@ Supports inner packet L3 checksum.
 * **[uses]     mbuf**: ``mbuf.outer_l2_len``, ``mbuf.outer_l3_len``.
 * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_EIP_CKSUM_BAD``.
 * **[provides] rte_eth_dev_info**: ``rx_offload_capa,rx_queue_offload_capa:DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM``,
-  ``tx_offload_capa:DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM``.
+  ``tx_offload_capa,tx_queue_offload_capa:DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM``.
 
 
 .. _nic_features_inner_l4_checksum:
@@ -620,6 +628,15 @@ Supports packet type parsing and returns a list of supported types.
 
 .. _nic_features_timesync:
 
+Mbuf fast free
+--------------
+
+Supports optimization for fast release of mbufs following successful Tx.
+Requires all mbufs to come from the same mempool and has refcnt = 1.
+
+* **[uses]       rte_eth_txconf,rte_eth_txmode**: ``offloads:DEV_TX_OFFLOAD_MBUF_FAST_FREE``.
+* **[provides]   rte_eth_dev_info**: ``tx_offload_capa,tx_queue_offload_capa:DEV_TX_OFFLOAD_MBUF_FAST_FREE``.
+
 Timesync
 --------
 
lib/librte_ether/rte_ethdev.c +66 -1

86 lines not on this page · raw message

lib/librte_ether/rte_ethdev.h +37 -1
index e02d57881..78de045ed 100644
@@ -692,6 +692,12 @@ struct rte_eth_vmdq_rx_conf {
  */
 struct rte_eth_txmode {
 	enum rte_eth_tx_mq_mode mq_mode; /**< TX multi-queues mode. */
+	/**
+	 * Per-port Tx offloads to be set using DEV_TX_OFFLOAD_* flags.
+	 * Only offloads set on tx_offload_capa field on rte_eth_dev_info
+	 * structure are allowed to be set.
+	 */
+	uint64_t offloads;
 
 	/* For i40e specifically */
 	uint16_t pvid;
@@ -734,6 +740,15 @@ struct rte_eth_rxconf {
 		(ETH_TXQ_FLAGS_NOXSUMSCTP | ETH_TXQ_FLAGS_NOXSUMUDP | \
 		 ETH_TXQ_FLAGS_NOXSUMTCP)
 /**
+ * When set the txq_flags should be ignored,
+ * instead per-queue Tx offloads will be set on offloads field
+ * located on rte_eth_txq_conf struct.
+ * This flag is temporary till the rte_eth_txq_conf.txq_flags
+ * API will be deprecated.
+ */
+#define ETH_TXQ_FLAGS_IGNORE	0x8000
+
+/**
  * A structure used to configure a TX ring of an Ethernet port.
  */
 struct rte_eth_txconf {
@@ -744,6 +759,12 @@ struct rte_eth_txconf {
 
 	uint32_t txq_flags; /**< Set flags for the Tx queue */
 	uint8_t tx_deferred_start; /**< Do not start queue with rte_eth_dev_start(). */
+	/**
+	 * Per-queue Tx offloads to be set  using DEV_TX_OFFLOAD_* flags.
+	 * Only offloads set on tx_queue_offload_capa or tx_offload_capa
+	 * fields on rte_eth_dev_info structure are allowed to be set.
+	 */
+	uint64_t offloads;
 };
 
 /**
@@ -968,6 +989,13 @@ struct rte_eth_conf {
 /**< Multiple threads can invoke rte_eth_tx_burst() concurrently on the same
  * tx queue without SW lock.
  */
+#define DEV_TX_OFFLOAD_MULTI_SEGS	0x00008000
+/**< Device supports multi segment send. */
+#define DEV_TX_OFFLOAD_MBUF_FAST_FREE	0x00010000
+/**< Device supports optimization for fast release of mbufs.
+ *   When set application must guarantee that per-queue all mbufs comes from
+ *   the same mempool and has refcnt = 1.
+ */
 
 struct rte_pci_device;
 
@@ -990,9 +1018,12 @@ struct rte_eth_dev_info {
 	uint16_t max_vmdq_pools; /**< Maximum number of VMDq pools. */
 	uint64_t rx_offload_capa;
 	/**< Device per port RX offload capabilities. */
-	uint32_t tx_offload_capa; /**< Device TX offload capabilities. */
+	uint64_t tx_offload_capa;
+	/**< Device per port TX offload capabilities. */
 	uint64_t rx_queue_offload_capa;
 	/**< Device per queue RX offload capabilities. */
+	uint64_t tx_queue_offload_capa;
+	/**< Device per queue TX offload capabilities. */
 	uint16_t reta_size;
 	/**< Device redirection table size, the total number of entries. */
 	uint8_t hash_key_size; /**< Hash key size in bytes */
@@ -2027,6 +2058,11 @@ int rte_eth_rx_queue_setup(uint8_t port_id, uint16_t rx_queue_id,
  *   - The *txq_flags* member contains flags to pass to the TX queue setup
  *     function to configure the behavior of the TX queue. This should be set
  *     to 0 if no special configuration is required.
+ *     This API is obsolete and will be deprecated. Applications
+ *     should set it to ETH_TXQ_FLAGS_IGNORE and use
+ *     the offloads field below.
+ *   - The *offloads* member contains Tx offloads to be enabled.
+ *     Offloads which are not set cannot be used on the datapath.
  *
  *     Note that setting *tx_free_thresh* or *tx_rs_thresh* value to 0 forces
  *     the transmit function to use default values.
Signature · 1 line
2.12.0
#96 lore raw

Re: [PATCH v5 2/3] ethdev: introduce Tx queue offloads API

Quoted 20 lines · Shahaf Shuler

Introduce a new API to configure Tx offloads.

In the new API, offloads are divided into per-port and per-queue offloads. The PMD reports capability for each of them. Offloads are enabled using the existing DEV_TX_OFFLOAD_* flags. To enable per-port offload, the offload should be set on both device configuration and queue configuration. To enable per-queue offload, the offloads can be set only on queue configuration.

In addition the Tx offloads will be disabled by default and be enabled per application needs. This will much simplify PMD management of the different offloads.

Applications should set the ETH_TXQ_FLAGS_IGNORE flag on txq_flags field in order to move to the new API.

The old Tx offloads API is kept for the meanwhile, in order to enable a smooth transition for PMDs and application to the new API.

<...>

doc/guides/nics/features.rst Supports packet type parsing and returns a list of supported types. · line 632

Quoted 6 lines
doc/guides/nics/features.rst +2 -0
@@ -620,6 +628,15 @@ Supports packet type parsing and returns a list of supported types.
 
 .. _nic_features_timesync:
 
+Mbuf fast free
+--------------

I think this is not one of the current tracked features. Is this coming/planed with new patches?

I suggest removing from this patch, and if required add with another patch that both updates default.ini and this documented.

Quoted 14 lines
doc/guides/nics/features.rst +7 -0
+
+Supports optimization for fast release of mbufs following successful Tx.
+Requires all mbufs to come from the same mempool and has refcnt = 1.
+
+* **[uses]       rte_eth_txconf,rte_eth_txmode**: ``offloads:DEV_TX_OFFLOAD_MBUF_FAST_FREE``.
+* **[provides]   rte_eth_dev_info**: ``tx_offload_capa,tx_queue_offload_capa:DEV_TX_OFFLOAD_MBUF_FAST_FREE``.
+
 Timesync
 --------
 
lib/librte_ether/rte_ethdev.c +0 -0
index 9b73d2377..59756dd82 100644

<...>

#97 lore raw

Re: [PATCH v5 2/3] ethdev: introduce Tx queue offloads API

Tuesday, October 3, 2017 10:50 PM, Ferruh Yigit:

Quoted 5 lines

<...>

Review Supports packet type parsing and returns a list of

Quoted 1 line
(quoted diff) +0 -0
@@ -620,6 +628,15 @@ Supports packet type parsing and returns a list of

supported types.

Quoted 1 line
Quoted 7 lines
Quoted 4 lines

.. _nic_features_timesync:

+Mbuf fast free
+--------------

I think this is not one of the current tracked features. Is this coming/planed with new patches?

This is not a new feature, rather re-wording and merging of the flags:
ETH_TXQ_FLAGS_NOREFCOUNT
ETH_TXQ_FLAGS_NOMULTMEMP

Quoted 3 lines

I suggest removing from this patch, and if required add with another patch that both updates default.ini and this documented.

I agree it makes more sense to have this "feature" on a different patch.

Quoted 20 lines

doc/guides/nics/features.rst Supports packet type parsing and returns a list of supported types.

Quoted 6 lines
doc/guides/nics/features.rst +5 -0
+
+Supports optimization for fast release of mbufs following successful Tx.
+Requires all mbufs to come from the same mempool and has refcnt = 1.
+
+* **[uses]       rte_eth_txconf,rte_eth_txmode**:

``offloads:DEV_TX_OFFLOAD_MBUF_FAST_FREE``.

Quoted 1 line

+* **[provides] rte_eth_dev_info**:

``tx_offload_capa,tx_queue_offload_capa:DEV_TX_OFFLOAD_MBUF_FAST_ FREE``.

Quoted 8 lines
doc/guides/nics/features.rst +1 -0
+
 Timesync
 --------
(quoted diff) +0 -0

b/lib/librte_ether/rte_ethdev.c index 9b73d2377..59756dd82 100644

lib/librte_ether/rte_ethdev.c +0 -0

<...>

#98 lore raw

PATCH v5 3/3 doc: add details on ethdev offloads API

In reply to Shahaf Shuler

Add the programmers guide details on the new offloads API introduced by commits:

commit 3ef4f4a50d2c ("ethdev: introduce Rx queue offloads API") commit a23fa10f3ea0 ("ethdev: introduce Tx queue offloads API")

---
 doc/guides/prog_guide/poll_mode_drv.rst | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
doc/guides/prog_guide/poll_mode_drv.rst +20 -0
index 8922e39f4..423170997 100644
@@ -310,6 +310,26 @@ exported by each PMD. The list of flags and their precise meaning is
 described in the mbuf API documentation and in the in :ref:`Mbuf Library
 <Mbuf_Library>`, section "Meta Information".
 
+Per-Port and Per-Queue Offloads
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+In the DPDK offload API, offloads are divided into per-port and per-queue offloads.
+The different offloads capabilities can be queried using ``rte_eth_dev_info_get()``.
+Supported offloads can be either per-port or per-queue.
+
+Offloads are enabled using the existing ``DEV_TX_OFFLOAD_*`` or ``DEV_RX_OFFLOAD_*`` flags.
+Per-port offload configuration is set using ``rte_eth_dev_configure``.
+Per-queue offload configuration is set using ``rte_eth_rx_queue_setup`` and ``rte_eth_tx_queue_setup``.
+To enable per-port offload, the offload should be set on both device configuration and queue setup.
+In case of a mixed configuration the queue setup shall return with an error.
+To enable per-queue offload, the offload can be set only on the queue setup.
+Offloads which are not enabled are disabled by default.
+
+For an application to use the Tx offloads API it should set the ``ETH_TXQ_FLAGS_IGNORE`` flag in the ``txq_flags`` field located in ``rte_eth_txconf`` struct.
+In such cases it is not required to set other flags in ``txq_flags``.
+For an application to use the Rx offloads API it should set the ``ignore_offload_bitfield`` bit in the ``rte_eth_rxmode`` struct.
+In such cases it is not required to set other bitfield offloads in the ``rxmode`` struct.
+
 Poll Mode Driver API
 --------------------
 
Signature · 1 line
2.12.0
#99 lore raw

v6 cover ethdev new offloads API

In reply to Shahaf Shuler

Tx offloads configuration is per queue. Tx offloads are enabled by default, and can be disabled using ETH_TXQ_FLAGS_NO* flags.
This behaviour is not consistent with the Rx side where the Rx offloads configuration is per port. Rx offloads are disabled by default and enabled according to bit field in rte_eth_rxmode structure.

Moreover, considering more Tx and Rx offloads will be added over time, the cost of managing them all inside the PMD will be tremendous, as the PMD will need to check the matching for the entire offload set for each mbuf it handles.
In addition, on the current approach each Rx offload added breaks the ABI compatibility as it requires to add entries to existing bit-fields.

The series address above issues by defining a new offloads API. In the new API, offloads are divided into per-port and per-queue offloads, with a corresponding capability for each.
The offloads are disabled by default. Each offload can be enabled or disabled using the existing DEV_TX_OFFLOADS_* or DEV_RX_OFFLOADS_* flags. Such API will enable to easily add or remove offloads, without breaking the ABI compatibility.

In order to provide a smooth transition between the APIs the following actions were taken:
* The old offloads API is kept for the meanwhile.
* Helper function which copy from old to new API were added to ethdev, enabling the PMD to support only one of the APIs.
* Helper function which copy from new to old API were also added, to enable application to use the new API with PMD which still supports the old one.

Per discussion made on the RFC of this series [1], the integration plan which was decided is to do the transition in two phases:
* ethdev API will move on 17.11.
* Apps and examples will move on 18.02.

This to enable PMD maintainers sufficient time to adopt the new API.

[1]
http://dpdk.org/ml/archives/dev/2017-August/072643.html

on v6:
- Move mbuf fast free Tx offload to a seperate patch.

on v5:
- Fix documentation.
- Fix comments on port offloads configuration.

on v4:
- Added another patch for documentation.
- Fixed ETH_TXQ_FLAGS_IGNORE flag override.
- Clarify the description of DEV_TX_OFFLOAD_MBUF_FAST_FREE offload.

on v3:
- Introduce the DEV_TX_OFFLOAD_MBUF_FAST_FREE to act as an equivalent for the no refcnt and single mempool flags.
- Fix features documentation.
- Fix comment style.

on v2:
- Taking new approach of dividing offloads into per-queue and per-port one.
- Postpone the Tx/Rx public struct renaming to 18.02
- Squash the helper functions into the Rx/Tx offloads intro patches.

Shahaf Shuler (4):
ethdev: introduce Rx queue offloads API
ethdev: introduce Tx queue offloads API
ethdev: add mbuf fast free Tx offload
doc: add details on ethdev offloads API

 doc/guides/nics/features.rst            |  66 +++++---
 doc/guides/nics/features/default.ini    |   1 +
 doc/guides/prog_guide/poll_mode_drv.rst |  20 +++
 lib/librte_ether/rte_ethdev.c           | 223 +++++++++++++++++++++++++--
 lib/librte_ether/rte_ethdev.h           |  89 ++++++++++-
 5 files changed, 359 insertions(+), 40 deletions(-)
Signature · 1 line
2.12.0
#100 lore raw

PATCH v6 1/4 ethdev: introduce Rx queue offloads API

Introduce a new API to configure Rx offloads.

In the new API, offloads are divided into per-port and per-queue offloads. The PMD reports capability for each of them. Offloads are enabled using the existing DEV_RX_OFFLOAD_* flags. To enable per-port offload, the offload should be set on both device configuration and queue configuration. To enable per-queue offload, the offloads can be set only on queue configuration.

Applications should set the ignore_offload_bitfield bit on rxmode structure in order to move to the new API.

The old Rx offloads API is kept for the meanwhile, in order to enable a smooth transition for PMDs and application to the new API.

---
 doc/guides/nics/features.rst  |  33 ++++----
 lib/librte_ether/rte_ethdev.c | 156 +++++++++++++++++++++++++++++++++----
 lib/librte_ether/rte_ethdev.h |  51 +++++++++++-
 3 files changed, 210 insertions(+), 30 deletions(-)
doc/guides/nics/features.rst +18 -15
index 37ffbc68c..4e68144ef 100644
@@ -179,7 +179,7 @@ Jumbo frame
 
 Supports Rx jumbo frames.
 
-* **[uses]    user config**: ``dev_conf.rxmode.jumbo_frame``,
+* **[uses]    rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_JUMBO_FRAME``.
   ``dev_conf.rxmode.max_rx_pkt_len``.
 * **[related] rte_eth_dev_info**: ``max_rx_pktlen``.
 * **[related] API**: ``rte_eth_dev_set_mtu()``.
@@ -192,7 +192,7 @@ Scattered Rx
 
 Supports receiving segmented mbufs.
 
-* **[uses]       user config**: ``dev_conf.rxmode.enable_scatter``.
+* **[uses]       rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_SCATTER``.
 * **[implements] datapath**: ``Scattered Rx function``.
 * **[implements] rte_eth_dev_data**: ``scattered_rx``.
 * **[provides]   eth_dev_ops**: ``rxq_info_get:scattered_rx``.
@@ -206,11 +206,11 @@ LRO
 
 Supports Large Receive Offload.
 
-* **[uses]       user config**: ``dev_conf.rxmode.enable_lro``.
+* **[uses]       rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_TCP_LRO``.
 * **[implements] datapath**: ``LRO functionality``.
 * **[implements] rte_eth_dev_data**: ``lro``.
 * **[provides]   mbuf**: ``mbuf.ol_flags:PKT_RX_LRO``, ``mbuf.tso_segsz``.
-* **[provides]   rte_eth_dev_info**: ``rx_offload_capa:DEV_RX_OFFLOAD_TCP_LRO``.
+* **[provides]   rte_eth_dev_info**: ``rx_offload_capa,rx_queue_offload_capa:DEV_RX_OFFLOAD_TCP_LRO``.
 
 
 .. _nic_features_tso:
@@ -363,7 +363,7 @@ VLAN filter
 
 Supports filtering of a VLAN Tag identifier.
 
-* **[uses]       user config**: ``dev_conf.rxmode.hw_vlan_filter``.
+* **[uses]       rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_VLAN_FILTER``.
 * **[implements] eth_dev_ops**: ``vlan_filter_set``.
 * **[related]    API**: ``rte_eth_dev_vlan_filter()``.
 
@@ -499,7 +499,7 @@ CRC offload
 
 Supports CRC stripping by hardware.
 
-* **[uses] user config**: ``dev_conf.rxmode.hw_strip_crc``.
+* **[uses] rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_CRC_STRIP``.
 
 
 .. _nic_features_vlan_offload:
@@ -509,11 +509,10 @@ VLAN offload
 
 Supports VLAN offload to hardware.
 
-* **[uses]       user config**: ``dev_conf.rxmode.hw_vlan_strip``,
-  ``dev_conf.rxmode.hw_vlan_filter``, ``dev_conf.rxmode.hw_vlan_extend``.
+* **[uses]       rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_VLAN_STRIP,DEV_RX_OFFLOAD_VLAN_FILTER,DEV_RX_OFFLOAD_VLAN_EXTEND``.
 * **[implements] eth_dev_ops**: ``vlan_offload_set``.
 * **[provides]   mbuf**: ``mbuf.ol_flags:PKT_RX_VLAN_STRIPPED``, ``mbuf.vlan_tci``.
-* **[provides]   rte_eth_dev_info**: ``rx_offload_capa:DEV_RX_OFFLOAD_VLAN_STRIP``,
+* **[provides]   rte_eth_dev_info**: ``rx_offload_capa,rx_queue_offload_capa:DEV_RX_OFFLOAD_VLAN_STRIP``,
   ``tx_offload_capa:DEV_TX_OFFLOAD_VLAN_INSERT``.
 * **[related]    API**: ``rte_eth_dev_set_vlan_offload()``,
   ``rte_eth_dev_get_vlan_offload()``.
@@ -526,10 +525,11 @@ QinQ offload
 
 Supports QinQ (queue in queue) offload.
 
+* **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_QINQ_STRIP``.
 * **[uses]     mbuf**: ``mbuf.ol_flags:PKT_TX_QINQ_PKT``.
 * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_QINQ_STRIPPED``, ``mbuf.vlan_tci``,
    ``mbuf.vlan_tci_outer``.
-* **[provides] rte_eth_dev_info**: ``rx_offload_capa:DEV_RX_OFFLOAD_QINQ_STRIP``,
+* **[provides] rte_eth_dev_info**: ``rx_offload_capa,rx_queue_offload_capa:DEV_RX_OFFLOAD_QINQ_STRIP``,
   ``tx_offload_capa:DEV_TX_OFFLOAD_QINQ_INSERT``.
 
 
@@ -540,13 +540,13 @@ L3 checksum offload
 
 Supports L3 checksum offload.
 
-* **[uses]     user config**: ``dev_conf.rxmode.hw_ip_checksum``.
+* **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_IPV4_CKSUM``.
 * **[uses]     mbuf**: ``mbuf.ol_flags:PKT_TX_IP_CKSUM``,
   ``mbuf.ol_flags:PKT_TX_IPV4`` | ``PKT_TX_IPV6``.
 * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_IP_CKSUM_UNKNOWN`` |
   ``PKT_RX_IP_CKSUM_BAD`` | ``PKT_RX_IP_CKSUM_GOOD`` |
   ``PKT_RX_IP_CKSUM_NONE``.
-* **[provides] rte_eth_dev_info**: ``rx_offload_capa:DEV_RX_OFFLOAD_IPV4_CKSUM``,
+* **[provides] rte_eth_dev_info**: ``rx_offload_capa,rx_queue_offload_capa:DEV_RX_OFFLOAD_IPV4_CKSUM``,
   ``tx_offload_capa:DEV_TX_OFFLOAD_IPV4_CKSUM``.
 
 
@@ -557,13 +557,14 @@ L4 checksum offload
 
 Supports L4 checksum offload.
 
+* **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_UDP_CKSUM,DEV_RX_OFFLOAD_TCP_CKSUM``.
 * **[uses]     mbuf**: ``mbuf.ol_flags:PKT_TX_IPV4`` | ``PKT_TX_IPV6``,
   ``mbuf.ol_flags:PKT_TX_L4_NO_CKSUM`` | ``PKT_TX_TCP_CKSUM`` |
   ``PKT_TX_SCTP_CKSUM`` | ``PKT_TX_UDP_CKSUM``.
 * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_L4_CKSUM_UNKNOWN`` |
   ``PKT_RX_L4_CKSUM_BAD`` | ``PKT_RX_L4_CKSUM_GOOD`` |
   ``PKT_RX_L4_CKSUM_NONE``.
-* **[provides] rte_eth_dev_info**: ``rx_offload_capa:DEV_RX_OFFLOAD_UDP_CKSUM,DEV_RX_OFFLOAD_TCP_CKSUM``,
+* **[provides] rte_eth_dev_info**: ``rx_offload_capa,rx_queue_offload_capa:DEV_RX_OFFLOAD_UDP_CKSUM,DEV_RX_OFFLOAD_TCP_CKSUM``,
   ``tx_offload_capa:DEV_TX_OFFLOAD_UDP_CKSUM,DEV_TX_OFFLOAD_TCP_CKSUM,DEV_TX_OFFLOAD_SCTP_CKSUM``.
 
 
@@ -574,8 +575,9 @@ MACsec offload
 
 Supports MACsec.
 
+* **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_MACSEC_STRIP``.
 * **[uses]     mbuf**: ``mbuf.ol_flags:PKT_TX_MACSEC``.
-* **[provides] rte_eth_dev_info**: ``rx_offload_capa:DEV_RX_OFFLOAD_MACSEC_STRIP``,
+* **[provides] rte_eth_dev_info**: ``rx_offload_capa,rx_queue_offload_capa:DEV_RX_OFFLOAD_MACSEC_STRIP``,
   ``tx_offload_capa:DEV_TX_OFFLOAD_MACSEC_INSERT``.
 
 
@@ -586,13 +588,14 @@ Inner L3 checksum
 
 Supports inner packet L3 checksum.
 
+* **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM``.
 * **[uses]     mbuf**: ``mbuf.ol_flags:PKT_TX_IP_CKSUM``,
   ``mbuf.ol_flags:PKT_TX_IPV4`` | ``PKT_TX_IPV6``,
   ``mbuf.ol_flags:PKT_TX_OUTER_IP_CKSUM``,
   ``mbuf.ol_flags:PKT_TX_OUTER_IPV4`` | ``PKT_TX_OUTER_IPV6``.
 * **[uses]     mbuf**: ``mbuf.outer_l2_len``, ``mbuf.outer_l3_len``.
 * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_EIP_CKSUM_BAD``.
-* **[provides] rte_eth_dev_info**: ``rx_offload_capa:DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM``,
+* **[provides] rte_eth_dev_info**: ``rx_offload_capa,rx_queue_offload_capa:DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM``,
   ``tx_offload_capa:DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM``.
 
 
lib/librte_ether/rte_ethdev.c +143 -13

233 lines not on this page · raw message

lib/librte_ether/rte_ethdev.h +49 -2

95 lines not on this page · raw message

Signature · 1 line
2.12.0
#101 lore raw

PATCH v6 2/4 ethdev: introduce Tx queue offloads API

In reply to Shahaf Shuler

Introduce a new API to configure Tx offloads.

In the new API, offloads are divided into per-port and per-queue offloads. The PMD reports capability for each of them. Offloads are enabled using the existing DEV_TX_OFFLOAD_* flags. To enable per-port offload, the offload should be set on both device configuration and queue configuration. To enable per-queue offload, the offloads can be set only on queue configuration.

In addition the Tx offloads will be disabled by default and be enabled per application needs. This will much simplify PMD management of the different offloads.

Applications should set the ETH_TXQ_FLAGS_IGNORE flag on txq_flags field in order to move to the new API.

The old Tx offloads API is kept for the meanwhile, in order to enable a smooth transition for PMDs and application to the new API.

---
 doc/guides/nics/features.rst  | 24 ++++++++++-----
 lib/librte_ether/rte_ethdev.c | 62 +++++++++++++++++++++++++++++++++++++-
 lib/librte_ether/rte_ethdev.h | 33 +++++++++++++++++++-
 3 files changed, 109 insertions(+), 10 deletions(-)
doc/guides/nics/features.rst +16 -8
index 4e68144ef..17745dace 100644
@@ -131,7 +131,8 @@ Lock-free Tx queue
 If a PMD advertises DEV_TX_OFFLOAD_MT_LOCKFREE capable, multiple threads can
 invoke rte_eth_tx_burst() concurrently on the same Tx queue without SW lock.
 
-* **[provides] rte_eth_dev_info**: ``tx_offload_capa:DEV_TX_OFFLOAD_MT_LOCKFREE``.
+* **[uses]    rte_eth_txconf,rte_eth_txmode**: ``offloads:DEV_TX_OFFLOAD_MT_LOCKFREE``.
+* **[provides] rte_eth_dev_info**: ``tx_offload_capa,tx_queue_offload_capa:DEV_TX_OFFLOAD_MT_LOCKFREE``.
 * **[related]  API**: ``rte_eth_tx_burst()``.
 
 
@@ -220,11 +221,12 @@ TSO
 
 Supports TCP Segmentation Offloading.
 
+* **[uses]       rte_eth_txconf,rte_eth_txmode**: ``offloads:DEV_TX_OFFLOAD_TCP_TSO``.
 * **[uses]       rte_eth_desc_lim**: ``nb_seg_max``, ``nb_mtu_seg_max``.
 * **[uses]       mbuf**: ``mbuf.ol_flags:PKT_TX_TCP_SEG``.
 * **[uses]       mbuf**: ``mbuf.tso_segsz``, ``mbuf.l2_len``, ``mbuf.l3_len``, ``mbuf.l4_len``.
 * **[implements] datapath**: ``TSO functionality``.
-* **[provides]   rte_eth_dev_info**: ``tx_offload_capa:DEV_TX_OFFLOAD_TCP_TSO,DEV_TX_OFFLOAD_UDP_TSO``.
+* **[provides]   rte_eth_dev_info**: ``tx_offload_capa,tx_queue_offload_capa:DEV_TX_OFFLOAD_TCP_TSO,DEV_TX_OFFLOAD_UDP_TSO``.
 
 
 .. _nic_features_promiscuous_mode:
@@ -510,10 +512,11 @@ VLAN offload
 Supports VLAN offload to hardware.
 
 * **[uses]       rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_VLAN_STRIP,DEV_RX_OFFLOAD_VLAN_FILTER,DEV_RX_OFFLOAD_VLAN_EXTEND``.
+* **[uses]       rte_eth_txconf,rte_eth_txmode**: ``offloads:DEV_TX_OFFLOAD_VLAN_INSERT``.
 * **[implements] eth_dev_ops**: ``vlan_offload_set``.
 * **[provides]   mbuf**: ``mbuf.ol_flags:PKT_RX_VLAN_STRIPPED``, ``mbuf.vlan_tci``.
 * **[provides]   rte_eth_dev_info**: ``rx_offload_capa,rx_queue_offload_capa:DEV_RX_OFFLOAD_VLAN_STRIP``,
-  ``tx_offload_capa:DEV_TX_OFFLOAD_VLAN_INSERT``.
+  ``tx_offload_capa,tx_queue_offload_capa:DEV_TX_OFFLOAD_VLAN_INSERT``.
 * **[related]    API**: ``rte_eth_dev_set_vlan_offload()``,
   ``rte_eth_dev_get_vlan_offload()``.
 
@@ -526,11 +529,12 @@ QinQ offload
 Supports QinQ (queue in queue) offload.
 
 * **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_QINQ_STRIP``.
+* **[uses]     rte_eth_txconf,rte_eth_txmode**: ``offloads:DEV_TX_OFFLOAD_QINQ_INSERT``.
 * **[uses]     mbuf**: ``mbuf.ol_flags:PKT_TX_QINQ_PKT``.
 * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_QINQ_STRIPPED``, ``mbuf.vlan_tci``,
    ``mbuf.vlan_tci_outer``.
 * **[provides] rte_eth_dev_info**: ``rx_offload_capa,rx_queue_offload_capa:DEV_RX_OFFLOAD_QINQ_STRIP``,
-  ``tx_offload_capa:DEV_TX_OFFLOAD_QINQ_INSERT``.
+  ``tx_offload_capa,tx_queue_offload_capa:DEV_TX_OFFLOAD_QINQ_INSERT``.
 
 
 .. _nic_features_l3_checksum_offload:
@@ -541,13 +545,14 @@ L3 checksum offload
 Supports L3 checksum offload.
 
 * **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_IPV4_CKSUM``.
+* **[uses]     rte_eth_txconf,rte_eth_txmode**: ``offloads:DEV_TX_OFFLOAD_IPV4_CKSUM``.
 * **[uses]     mbuf**: ``mbuf.ol_flags:PKT_TX_IP_CKSUM``,
   ``mbuf.ol_flags:PKT_TX_IPV4`` | ``PKT_TX_IPV6``.
 * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_IP_CKSUM_UNKNOWN`` |
   ``PKT_RX_IP_CKSUM_BAD`` | ``PKT_RX_IP_CKSUM_GOOD`` |
   ``PKT_RX_IP_CKSUM_NONE``.
 * **[provides] rte_eth_dev_info**: ``rx_offload_capa,rx_queue_offload_capa:DEV_RX_OFFLOAD_IPV4_CKSUM``,
-  ``tx_offload_capa:DEV_TX_OFFLOAD_IPV4_CKSUM``.
+  ``tx_offload_capa,tx_queue_offload_capa:DEV_TX_OFFLOAD_IPV4_CKSUM``.
 
 
 .. _nic_features_l4_checksum_offload:
@@ -558,6 +563,7 @@ L4 checksum offload
 Supports L4 checksum offload.
 
 * **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_UDP_CKSUM,DEV_RX_OFFLOAD_TCP_CKSUM``.
+* **[uses]     rte_eth_txconf,rte_eth_txmode**: ``offloads:DEV_TX_OFFLOAD_UDP_CKSUM,DEV_TX_OFFLOAD_TCP_CKSUM,DEV_TX_OFFLOAD_SCTP_CKSUM``.
 * **[uses]     mbuf**: ``mbuf.ol_flags:PKT_TX_IPV4`` | ``PKT_TX_IPV6``,
   ``mbuf.ol_flags:PKT_TX_L4_NO_CKSUM`` | ``PKT_TX_TCP_CKSUM`` |
   ``PKT_TX_SCTP_CKSUM`` | ``PKT_TX_UDP_CKSUM``.
@@ -565,7 +571,7 @@ Supports L4 checksum offload.
   ``PKT_RX_L4_CKSUM_BAD`` | ``PKT_RX_L4_CKSUM_GOOD`` |
   ``PKT_RX_L4_CKSUM_NONE``.
 * **[provides] rte_eth_dev_info**: ``rx_offload_capa,rx_queue_offload_capa:DEV_RX_OFFLOAD_UDP_CKSUM,DEV_RX_OFFLOAD_TCP_CKSUM``,
-  ``tx_offload_capa:DEV_TX_OFFLOAD_UDP_CKSUM,DEV_TX_OFFLOAD_TCP_CKSUM,DEV_TX_OFFLOAD_SCTP_CKSUM``.
+  ``tx_offload_capa,tx_queue_offload_capa:DEV_TX_OFFLOAD_UDP_CKSUM,DEV_TX_OFFLOAD_TCP_CKSUM,DEV_TX_OFFLOAD_SCTP_CKSUM``.
 
 
 .. _nic_features_macsec_offload:
@@ -576,9 +582,10 @@ MACsec offload
 Supports MACsec.
 
 * **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_MACSEC_STRIP``.
+* **[uses]     rte_eth_txconf,rte_eth_txmode**: ``offloads:DEV_TX_OFFLOAD_MACSEC_INSERT``.
 * **[uses]     mbuf**: ``mbuf.ol_flags:PKT_TX_MACSEC``.
 * **[provides] rte_eth_dev_info**: ``rx_offload_capa,rx_queue_offload_capa:DEV_RX_OFFLOAD_MACSEC_STRIP``,
-  ``tx_offload_capa:DEV_TX_OFFLOAD_MACSEC_INSERT``.
+  ``tx_offload_capa,tx_queue_offload_capa:DEV_TX_OFFLOAD_MACSEC_INSERT``.
 
 
 .. _nic_features_inner_l3_checksum:
@@ -589,6 +596,7 @@ Inner L3 checksum
 Supports inner packet L3 checksum.
 
 * **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM``.
+* **[uses]     rte_eth_txconf,rte_eth_txmode**: ``offloads:DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM``.
 * **[uses]     mbuf**: ``mbuf.ol_flags:PKT_TX_IP_CKSUM``,
   ``mbuf.ol_flags:PKT_TX_IPV4`` | ``PKT_TX_IPV6``,
   ``mbuf.ol_flags:PKT_TX_OUTER_IP_CKSUM``,
@@ -596,7 +604,7 @@ Supports inner packet L3 checksum.
 * **[uses]     mbuf**: ``mbuf.outer_l2_len``, ``mbuf.outer_l3_len``.
 * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_EIP_CKSUM_BAD``.
 * **[provides] rte_eth_dev_info**: ``rx_offload_capa,rx_queue_offload_capa:DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM``,
-  ``tx_offload_capa:DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM``.
+  ``tx_offload_capa,tx_queue_offload_capa:DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM``.
 
 
 .. _nic_features_inner_l4_checksum:
lib/librte_ether/rte_ethdev.c +61 -1

81 lines not on this page · raw message

lib/librte_ether/rte_ethdev.h +32 -1
index e02d57881..da91f8740 100644
@@ -692,6 +692,12 @@ struct rte_eth_vmdq_rx_conf {
  */
 struct rte_eth_txmode {
 	enum rte_eth_tx_mq_mode mq_mode; /**< TX multi-queues mode. */
+	/**
+	 * Per-port Tx offloads to be set using DEV_TX_OFFLOAD_* flags.
+	 * Only offloads set on tx_offload_capa field on rte_eth_dev_info
+	 * structure are allowed to be set.
+	 */
+	uint64_t offloads;
 
 	/* For i40e specifically */
 	uint16_t pvid;
@@ -734,6 +740,15 @@ struct rte_eth_rxconf {
 		(ETH_TXQ_FLAGS_NOXSUMSCTP | ETH_TXQ_FLAGS_NOXSUMUDP | \
 		 ETH_TXQ_FLAGS_NOXSUMTCP)
 /**
+ * When set the txq_flags should be ignored,
+ * instead per-queue Tx offloads will be set on offloads field
+ * located on rte_eth_txq_conf struct.
+ * This flag is temporary till the rte_eth_txq_conf.txq_flags
+ * API will be deprecated.
+ */
+#define ETH_TXQ_FLAGS_IGNORE	0x8000
+
+/**
  * A structure used to configure a TX ring of an Ethernet port.
  */
 struct rte_eth_txconf {
@@ -744,6 +759,12 @@ struct rte_eth_txconf {
 
 	uint32_t txq_flags; /**< Set flags for the Tx queue */
 	uint8_t tx_deferred_start; /**< Do not start queue with rte_eth_dev_start(). */
+	/**
+	 * Per-queue Tx offloads to be set  using DEV_TX_OFFLOAD_* flags.
+	 * Only offloads set on tx_queue_offload_capa or tx_offload_capa
+	 * fields on rte_eth_dev_info structure are allowed to be set.
+	 */
+	uint64_t offloads;
 };
 
 /**
@@ -968,6 +989,8 @@ struct rte_eth_conf {
 /**< Multiple threads can invoke rte_eth_tx_burst() concurrently on the same
  * tx queue without SW lock.
  */
+#define DEV_TX_OFFLOAD_MULTI_SEGS	0x00008000
+/**< Device supports multi segment send. */
 
 struct rte_pci_device;
 
@@ -990,9 +1013,12 @@ struct rte_eth_dev_info {
 	uint16_t max_vmdq_pools; /**< Maximum number of VMDq pools. */
 	uint64_t rx_offload_capa;
 	/**< Device per port RX offload capabilities. */
-	uint32_t tx_offload_capa; /**< Device TX offload capabilities. */
+	uint64_t tx_offload_capa;
+	/**< Device per port TX offload capabilities. */
 	uint64_t rx_queue_offload_capa;
 	/**< Device per queue RX offload capabilities. */
+	uint64_t tx_queue_offload_capa;
+	/**< Device per queue TX offload capabilities. */
 	uint16_t reta_size;
 	/**< Device redirection table size, the total number of entries. */
 	uint8_t hash_key_size; /**< Hash key size in bytes */
@@ -2027,6 +2053,11 @@ int rte_eth_rx_queue_setup(uint8_t port_id, uint16_t rx_queue_id,
  *   - The *txq_flags* member contains flags to pass to the TX queue setup
  *     function to configure the behavior of the TX queue. This should be set
  *     to 0 if no special configuration is required.
+ *     This API is obsolete and will be deprecated. Applications
+ *     should set it to ETH_TXQ_FLAGS_IGNORE and use
+ *     the offloads field below.
+ *   - The *offloads* member contains Tx offloads to be enabled.
+ *     Offloads which are not set cannot be used on the datapath.
  *
  *     Note that setting *tx_free_thresh* or *tx_rs_thresh* value to 0 forces
  *     the transmit function to use default values.
Signature · 1 line
2.12.0
#102 lore raw

PATCH v6 3/4 ethdev: add mbuf fast free Tx offload

In reply to Shahaf Shuler

PMDs which expose this offload cap supports optimization for fast release of mbufs following successful Tx.
Such optimization requires that per queue, all mbufs come from the same mempool and has refcnt = 1.

---
 doc/guides/nics/features.rst         | 9 +++++++++
 doc/guides/nics/features/default.ini | 1 +
 lib/librte_ether/rte_ethdev.c        | 5 +++++
 lib/librte_ether/rte_ethdev.h        | 5 +++++
 4 files changed, 20 insertions(+)
doc/guides/nics/features.rst +9 -0
index 17745dace..6538470ac 100644
@@ -628,6 +628,15 @@ Supports packet type parsing and returns a list of supported types.
 
 .. _nic_features_timesync:
 
+Mbuf fast free
+--------------
+
+Supports optimization for fast release of mbufs following successful Tx.
+Requires that per queue, all mbufs come from the same mempool and has refcnt = 1.
+
+* **[uses]       rte_eth_txconf,rte_eth_txmode**: ``offloads:DEV_TX_OFFLOAD_MBUF_FAST_FREE``.
+* **[provides]   rte_eth_dev_info**: ``tx_offload_capa,tx_queue_offload_capa:DEV_TX_OFFLOAD_MBUF_FAST_FREE``.
+
 Timesync
 --------
 
doc/guides/nics/features/default.ini +1 -0
index 542430696..9a5990195 100644
@@ -75,3 +75,4 @@ x86-64               =
 Usage doc            =
 Design doc           =
 Perf doc             =
+Mbuf fast free       =
lib/librte_ether/rte_ethdev.c +5 -0
index 856a54a8e..59756dd82 100644
@@ -1232,6 +1232,9 @@ rte_eth_convert_txq_flags(const uint32_t txq_flags, uint64_t *tx_offloads)
 		offloads |= DEV_TX_OFFLOAD_UDP_CKSUM;
 	if (!(txq_flags & ETH_TXQ_FLAGS_NOXSUMTCP))
 		offloads |= DEV_TX_OFFLOAD_TCP_CKSUM;
+	if ((txq_flags & ETH_TXQ_FLAGS_NOREFCOUNT) &&
+	    (txq_flags & ETH_TXQ_FLAGS_NOMULTMEMP))
+		offloads |= DEV_TX_OFFLOAD_MBUF_FAST_FREE;
 
 	*tx_offloads = offloads;
 }
@@ -1254,6 +1257,8 @@ rte_eth_convert_txq_offloads(const uint64_t tx_offloads, uint32_t *txq_flags)
 		flags |= ETH_TXQ_FLAGS_NOXSUMUDP;
 	if (!(tx_offloads & DEV_TX_OFFLOAD_TCP_CKSUM))
 		flags |= ETH_TXQ_FLAGS_NOXSUMTCP;
+	if (tx_offloads & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
+		flags |= (ETH_TXQ_FLAGS_NOREFCOUNT | ETH_TXQ_FLAGS_NOMULTMEMP);
 
 	*txq_flags = flags;
 }
lib/librte_ether/rte_ethdev.h +5 -0
index da91f8740..78de045ed 100644
@@ -991,6 +991,11 @@ struct rte_eth_conf {
  */
 #define DEV_TX_OFFLOAD_MULTI_SEGS	0x00008000
 /**< Device supports multi segment send. */
+#define DEV_TX_OFFLOAD_MBUF_FAST_FREE	0x00010000
+/**< Device supports optimization for fast release of mbufs.
+ *   When set application must guarantee that per-queue all mbufs comes from
+ *   the same mempool and has refcnt = 1.
+ */
 
 struct rte_pci_device;
 
Signature · 1 line
2.12.0
#103 lore raw

PATCH v6 4/4 doc: add details on ethdev offloads API

In reply to Shahaf Shuler

Add the programmers guide details on the new offloads API introduced by commits:

commit 67a1a59b597f ("ethdev: introduce Rx queue offloads API") commit f883eb32e2d4 ("ethdev: introduce Tx queue offloads API")

---
 doc/guides/prog_guide/poll_mode_drv.rst | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
doc/guides/prog_guide/poll_mode_drv.rst +20 -0
index 8922e39f4..423170997 100644
@@ -310,6 +310,26 @@ exported by each PMD. The list of flags and their precise meaning is
 described in the mbuf API documentation and in the in :ref:`Mbuf Library
 <Mbuf_Library>`, section "Meta Information".
 
+Per-Port and Per-Queue Offloads
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+In the DPDK offload API, offloads are divided into per-port and per-queue offloads.
+The different offloads capabilities can be queried using ``rte_eth_dev_info_get()``.
+Supported offloads can be either per-port or per-queue.
+
+Offloads are enabled using the existing ``DEV_TX_OFFLOAD_*`` or ``DEV_RX_OFFLOAD_*`` flags.
+Per-port offload configuration is set using ``rte_eth_dev_configure``.
+Per-queue offload configuration is set using ``rte_eth_rx_queue_setup`` and ``rte_eth_tx_queue_setup``.
+To enable per-port offload, the offload should be set on both device configuration and queue setup.
+In case of a mixed configuration the queue setup shall return with an error.
+To enable per-queue offload, the offload can be set only on the queue setup.
+Offloads which are not enabled are disabled by default.
+
+For an application to use the Tx offloads API it should set the ``ETH_TXQ_FLAGS_IGNORE`` flag in the ``txq_flags`` field located in ``rte_eth_txconf`` struct.
+In such cases it is not required to set other flags in ``txq_flags``.
+For an application to use the Rx offloads API it should set the ``ignore_offload_bitfield`` bit in the ``rte_eth_rxmode`` struct.
+In such cases it is not required to set other bitfield offloads in the ``rxmode`` struct.
+
 Poll Mode Driver API
 --------------------
 
Signature · 1 line
2.12.0
Acked-by on v6 4/4
#104 lore raw

Re: [PATCH v6 4/4] doc: add details on ethdev offloads API

Quoted 11 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Shahaf Shuler
Sent: Wednesday, October 4, 2017 9:18 AM
To: Ananyev, Konstantin <[email protected]>; [email protected]; [email protected]; [email protected]; Yigit, Ferruh <[email protected]>
Cc: [email protected]
Subject: [dpdk-dev] [PATCH v6 4/4] doc: add details on ethdev offloads API

Quoted 8 lines

Add the programmers guide details on the new offloads API introduced by commits:

commit 67a1a59b597f ("ethdev: introduce Rx queue offloads API") commit f883eb32e2d4 ("ethdev: introduce Tx queue offloads API")

#105 lore raw

Re: [PATCH v6 4/4] doc: add details on ethdev offloads API

In reply to Shahaf Shuler

-----Original Message-----
From: dev <[email protected]> on behalf of Shahaf Shuler <[email protected]>
Date: Wednesday, October 4, 2017 at 1:18 AM
To: "[email protected]" <[email protected]>, "[email protected]" <[email protected]>, "[email protected]" <[email protected]>, "Jacob, Jerin" <[email protected]>, "[email protected]" <[email protected]>
Cc: "[email protected]" <[email protected]>
Subject: [dpdk-dev] [PATCH v6 4/4] doc: add details on ethdev offloads API

Quoted 49 lines

Add the programmers guide details on the new offloads API introduced by commits:

commit 67a1a59b597f ("ethdev: introduce Rx queue offloads API") commit f883eb32e2d4 ("ethdev: introduce Tx queue offloads API")

---
doc/guides/prog_guide/poll_mode_drv.rst | 20 ++++++++++++++++++++

1 file changed, 20 insertions(+)
doc/guides/prog_guide/poll_mode_drv.rst +0 -0
index 8922e39f4..423170997 100644
@@ -310,6 +310,26 @@ exported by each PMD. The list of flags and their

precise meaning is
described in the mbuf API documentation and in the in :ref:Mbuf Library <Mbuf_Library>, section "Meta Information".

doc/guides/prog_guide/poll_mode_drv.rst +4 -0
+Per-Port and Per-Queue Offloads
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+In the DPDK offload API, offloads are divided into per-port and

per-queue offloads.
+The different offloads capabilities can be queried using ``rte_eth_dev_info_get()``.

doc/guides/prog_guide/poll_mode_drv.rst +3 -0
+Supported offloads can be either per-port or per-queue.
+
+Offloads are enabled using the existing ``DEV_TX_OFFLOAD_*`` or

``DEV_RX_OFFLOAD_*`` flags.

doc/guides/prog_guide/poll_mode_drv.rst +2 -0
+Per-port offload configuration is set using ``rte_eth_dev_configure``.
+Per-queue offload configuration is set using ``rte_eth_rx_queue_setup``

and ``rte_eth_tx_queue_setup``.
+To enable per-port offload, the offload should be set on both device configuration and queue setup.
+In case of a mixed configuration the queue setup shall return with an error.
+To enable per-queue offload, the offload can be set only on the queue setup.

doc/guides/prog_guide/poll_mode_drv.rst +3 -0
+Offloads which are not enabled are disabled by default.
+
+For an application to use the Tx offloads API it should set the

``ETH_TXQ_FLAGS_IGNORE`` flag in the ``txq_flags`` field located in ``rte_eth_txconf`` struct.

doc/guides/prog_guide/poll_mode_drv.rst +2 -0
+In such cases it is not required to set other flags in ``txq_flags``.
+For an application to use the Rx offloads API it should set the
Quoted 10 lines

``ignore_offload_bitfield`` bit in the ``rte_eth_rxmode`` struct. +In such cases it is not required to set other bitfield offloads in the ``rxmode`` struct.
+
Poll Mode Driver API
--------------------

Signature · 1 line
2.12.0

Hi Shahaf,
Have a minor question here.
In the documentation it is stated that:
"To enable per-port offload, the offload should be set on both device configuration and queue setup.”
Our NIC supports only port-level offloads. So my understanding is that to enable per-port offload we just have to fill in rx_offload_capa/tx_offload_capa in dev_infos_get() routine. So I didn’t understand what is meant by ' both device configuration and queue setup’ here.
Pls let me know.
Thanks.

Quoted 1 line
#106 lore raw

Re: [PATCH v6 4/4] doc: add details on ethdev offloads API

Thursday, March 15, 2018 3:58 AM, Patil, Harish:

Quoted 14 lines
Quoted 2 lines

2.12.0

Hi Shahaf,
Have a minor question here.
In the documentation it is stated that:
"To enable per-port offload, the offload should be set on both device configuration and queue setup.”
Our NIC supports only port-level offloads. So my understanding is that to enable per-port offload we just have to fill in rx_offload_capa/tx_offload_capa in dev_infos_get() routine. So I didn’t understand what is meant by ' both device configuration and queue setup’ here.
Pls let me know.
Thanks.

It means on the [tx]rx_queue_setup the application should set the port offloads also in the queue offloads. This is the API for the application, and there is an ongoing discussion to remove this limitation, see [1].

You may add a routine to verify that (on the queue setup), or ignore completely the queue offloads configuration .

[1] http://dpdk.org/ml/archives/dev/2018-March/092684.html

Quoted 4 lines
Quoted 4 lines
#107 lore raw

PATCH 1/1 doc: update new ethdev offload API description

In reply to Shahaf Shuler

Don't mandate API to pass port offload configuration during queue setup, this is unnecessary for devices that support only port level offloads.

Fixes 81ac560dc1b4 ("doc: add details on ethdev offloads API")

---
Cc: Patil, Harish <[email protected]>

Btw, this expectation from API should be clear from source code and API documentation (doxygen comments in header file) instead of documentation. Am I missing something or we are doing something wrong here?

---
 doc/guides/prog_guide/poll_mode_drv.rst | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
doc/guides/prog_guide/poll_mode_drv.rst +1 -3
index e5d01874e..3247f309f 100644
@@ -303,9 +303,7 @@ Supported offloads can be either per-port or per-queue.
 Offloads are enabled using the existing ``DEV_TX_OFFLOAD_*`` or ``DEV_RX_OFFLOAD_*`` flags.
 Per-port offload configuration is set using ``rte_eth_dev_configure``.
 Per-queue offload configuration is set using ``rte_eth_rx_queue_setup`` and ``rte_eth_tx_queue_setup``.
-To enable per-port offload, the offload should be set on both device configuration and queue setup.
-In case of a mixed configuration the queue setup shall return with an error.
-To enable per-queue offload, the offload can be set only on the queue setup.
+Per-port offloads should be set on the port configuration. Queue offloads should be set on the queue configuration.
 Offloads which are not enabled are disabled by default.
 
 For an application to use the Tx offloads API it should set the ``ETH_TXQ_FLAGS_IGNORE`` flag in the ``txq_flags`` field located in ``rte_eth_txconf`` struct.
Signature · 1 line
2.13.6
Acked-by on v1 1/1
#108 lore raw

Re: [PATCH] doc: update new ethdev offload API description

-----Original Message-----
From: Ferruh Yigit <[email protected]>
Date: Friday, March 16, 2018 at 8:51 AM
To: John McNamara <[email protected]>, Marko Kovacevic <[email protected]>
Cc: "[email protected]" <[email protected]>, Ferruh Yigit <[email protected]>, Thomas Monjalon <[email protected]>, "[email protected]" <[email protected]>, <Patil>, Harish Patil <[email protected]>
Subject: [PATCH] doc: update new ethdev offload API description

Quoted 40 lines

Don't mandate API to pass port offload configuration during queue setup, this is unnecessary for devices that support only port level offloads.

Fixes 81ac560dc1b4 ("doc: add details on ethdev offloads API")

---
Cc: Patil, Harish <[email protected]>

Btw, this expectation from API should be clear from source code and API documentation (doxygen comments in header file) instead of documentation. Am I missing something or we are doing something wrong here?
---
doc/guides/prog_guide/poll_mode_drv.rst | 4 +---

1 file changed, 1 insertion(+), 3 deletions(-)
doc/guides/prog_guide/poll_mode_drv.rst +0 -0
index e5d01874e..3247f309f 100644
@@ -303,9 +303,7 @@ Supported offloads can be either per-port or

per-queue.
Offloads are enabled using the existing ``DEV_TX_OFFLOAD_*`` or ``DEV_RX_OFFLOAD_*`` flags.
Per-port offload configuration is set using ``rte_eth_dev_configure``. Per-queue offload configuration is set using ``rte_eth_rx_queue_setup`` and ``rte_eth_tx_queue_setup``.
-To enable per-port offload, the offload should be set on both device configuration and queue setup.
-In case of a mixed configuration the queue setup shall return with an error.
-To enable per-queue offload, the offload can be set only on the queue setup.
+Per-port offloads should be set on the port configuration. Queue offloads should be set on the queue configuration.
Offloads which are not enabled are disabled by default.

Quoted 6 lines

For an application to use the Tx offloads API it should set the ``ETH_TXQ_FLAGS_IGNORE`` flag in the ``txq_flags`` field located in ``rte_eth_txconf`` struct.

Signature · 1 line
2.13.6
Quoted 1 line
#109 lore raw

Re: [PATCH] doc: update new ethdev offload API description

In reply to Ferruh Yigit

Friday, March 16, 2018 5:52 PM, Ferruh Yigit:

Quoted 39 lines

Don't mandate API to pass port offload configuration during queue setup, this is unnecessary for devices that support only port level offloads.

Fixes 81ac560dc1b4 ("doc: add details on ethdev offloads API")

---
Cc: Patil, Harish <[email protected]>

Btw, this expectation from API should be clear from source code and API documentation (doxygen comments in header file) instead of documentation. Am I missing something or we are doing something wrong here?

---
 doc/guides/prog_guide/poll_mode_drv.rst | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
doc/guides/prog_guide/poll_mode_drv.rst +0 -0
index e5d01874e..3247f309f 100644
@@ -303,9 +303,7 @@ Supported offloads can be either per-port or per-

queue.
Offloads are enabled using the existing ``DEV_TX_OFFLOAD_*`` or
``DEV_RX_OFFLOAD_*`` flags.
Per-port offload configuration is set using ``rte_eth_dev_configure``. Per-queue offload configuration is set using ``rte_eth_rx_queue_setup``
and ``rte_eth_tx_queue_setup``.
-To enable per-port offload, the offload should be set on both device configuration and queue setup.

doc/guides/prog_guide/poll_mode_drv.rst +0 -2
-In case of a mixed configuration the queue setup shall return with an error.
-To enable per-queue offload, the offload can be set only on the queue

setup.
+Per-port offloads should be set on the port configuration. Queue offloads should be set on the queue configuration.
Offloads which are not enabled are disabled by default.

Quoted 3 lines

For an application to use the Tx offloads API it should set the
``ETH_TXQ_FLAGS_IGNORE`` flag in the ``txq_flags`` field located in ``rte_eth_txconf`` struct.

I am OK with such change.

However, while documentation is good, most of the customers learn on the API usage from the existing examples. Currently both examples and testpmd behave according to the old approach, see example from testpmd[1] before the rx_queue_setup.

I think a modification there is needed if we are going to change the API.

[1]

                       /* Apply Rx offloads configuration */                    
                       port->rx_conf.offloads = port->dev_conf.rxmode.offloads;
Quoted 2 lines

--
2.13.6

#110 lore raw

Re: [PATCH] doc: update new ethdev offload API description

In reply to Ferruh Yigit
Quoted 23 lines · Ferruh Yigit

Don't mandate API to pass port offload configuration during queue setup, this is unnecessary for devices that support only port level offloads.

Fixes 81ac560dc1b4 ("doc: add details on ethdev offloads API")

---
Cc: Patil, Harish <[email protected]>

Btw, this expectation from API should be clear from source code and API documentation (doxygen comments in header file) instead of documentation. Am I missing something or we are doing something wrong here?

---
  doc/guides/prog_guide/poll_mode_drv.rst | 4 +---
  1 file changed, 1 insertion(+), 3 deletions(-)
doc/guides/prog_guide/poll_mode_drv.rst +0 -0
index e5d01874e..3247f309f 100644

doc/guides/prog_guide/poll_mode_drv.rst Supported offloads can be either per-port or per-queue. · line 309

Quoted 10 lines
doc/guides/prog_guide/poll_mode_drv.rst +1 -3
@@ -303,9 +303,7 @@ Supported offloads can be either per-port or per-queue.
  Offloads are enabled using the existing ``DEV_TX_OFFLOAD_*`` or ``DEV_RX_OFFLOAD_*`` flags.
  Per-port offload configuration is set using ``rte_eth_dev_configure``.
  Per-queue offload configuration is set using ``rte_eth_rx_queue_setup`` and ``rte_eth_tx_queue_setup``.
-To enable per-port offload, the offload should be set on both device configuration and queue setup.
-In case of a mixed configuration the queue setup shall return with an error.
-To enable per-queue offload, the offload can be set only on the queue setup.
+Per-port offloads should be set on the port configuration. Queue offloads should be set on the queue configuration.
  Offloads which are not enabled are disabled by default.
 
  For an application to use the Tx offloads API it should set the ``ETH_TXQ_FLAGS_IGNORE`` flag in the ``txq_flags`` field located in ``rte_eth_txconf`` struct.

net/sfc has code which double-checks old behaviour. So, it is not just documentation update. We can provide patches if the behaviour change is accepted.

IMHO, it should be allowed to specify queue offloads on port level. It should simply enable these offloads on all queues. Also it will match dev_info [rt]x_offload_capa which include both port and queue offloads.

Yes, we lose possibility to enable on port level, but disable on queue level by suggested changes, but I think it is OK - if you don't need it for all queues, just control separately on queue level.

#111 lore raw

Re: [PATCH] doc: update new ethdev offload API description

Quoted 33 lines · Andrew Rybchenko
Quoted 32 lines · Ferruh Yigit

Don't mandate API to pass port offload configuration during queue setup, this is unnecessary for devices that support only port level offloads.

Fixes 81ac560dc1b4 ("doc: add details on ethdev offloads API")

---
Cc: Patil, Harish <[email protected]>

Btw, this expectation from API should be clear from source code and API documentation (doxygen comments in header file) instead of documentation. Am I missing something or we are doing something wrong here?

---
 doc/guides/prog_guide/poll_mode_drv.rst | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
doc/guides/prog_guide/poll_mode_drv.rst +1 -3
index e5d01874e..3247f309f 100644
@@ -303,9 +303,7 @@ Supported offloads can be either per-port or per-queue.
 Offloads are enabled using the existing ``DEV_TX_OFFLOAD_*`` or ``DEV_RX_OFFLOAD_*`` flags.
 Per-port offload configuration is set using ``rte_eth_dev_configure``.
 Per-queue offload configuration is set using ``rte_eth_rx_queue_setup`` and ``rte_eth_tx_queue_setup``.
-To enable per-port offload, the offload should be set on both device configuration and queue setup.
-In case of a mixed configuration the queue setup shall return with an error.
-To enable per-queue offload, the offload can be set only on the queue setup.
+Per-port offloads should be set on the port configuration. Queue offloads should be set on the queue configuration.
 Offloads which are not enabled are disabled by default.
 
Quoted 5 lines

doc/guides/prog_guide/poll_mode_drv.rst Supported offloads can be either per-port or per-queue. · line 309

Quoted 1 line
doc/guides/prog_guide/poll_mode_drv.rst +0 -0
 For an application to use the Tx offloads API it should set the ``ETH_TXQ_FLAGS_IGNORE`` flag in the ``txq_flags`` field located in ``rte_eth_txconf`` struct.

net/sfc has code which double-checks old behaviour. So, it is not just documentation update. We can provide patches if the behaviour change is accepted.

Not definitely just doc update, PMDs needs to be modified. This patch is just to agree on the behavior.

Quoted 9 lines

IMHO, it should be allowed to specify queue offloads on port level. It should simply enable these offloads on all queues. Also it will match dev_info [rt]x_offload_capa which include both port and queue offloads.

Yes, we lose possibility to enable on port level, but disable on queue level by suggested changes, but I think it is OK - if you don't need it for all queues, just control separately on queue level.

What I understand was queue offload can only enable more, but it seems it can both enable or disable.

My concern was, even PMD reports no [rt]x_offload_capa at all, API forces application to send at least port offloads during queue setup.

As long as application only allowed to send queue offloads within the boundaries of the "queue offload capabilities", I am OK.

This will work fine for devices that support queue level offloads to enable - disable queue specific offloads on top of port offloads. Will this make sense?

#112 lore raw

Re: [PATCH] doc: update new ethdev offload API description

Quoted 46 lines · Ferruh Yigit
Quoted 33 lines · Andrew Rybchenko
Quoted 32 lines · Ferruh Yigit

Don't mandate API to pass port offload configuration during queue setup, this is unnecessary for devices that support only port level offloads.

Fixes 81ac560dc1b4 ("doc: add details on ethdev offloads API")

---
Cc: Patil, Harish <[email protected]>

Btw, this expectation from API should be clear from source code and API documentation (doxygen comments in header file) instead of documentation. Am I missing something or we are doing something wrong here?

---
  doc/guides/prog_guide/poll_mode_drv.rst | 4 +---
  1 file changed, 1 insertion(+), 3 deletions(-)
doc/guides/prog_guide/poll_mode_drv.rst +1 -3
index e5d01874e..3247f309f 100644
@@ -303,9 +303,7 @@ Supported offloads can be either per-port or per-queue.
  Offloads are enabled using the existing ``DEV_TX_OFFLOAD_*`` or ``DEV_RX_OFFLOAD_*`` flags.
  Per-port offload configuration is set using ``rte_eth_dev_configure``.
  Per-queue offload configuration is set using ``rte_eth_rx_queue_setup`` and ``rte_eth_tx_queue_setup``.
-To enable per-port offload, the offload should be set on both device configuration and queue setup.
-In case of a mixed configuration the queue setup shall return with an error.
-To enable per-queue offload, the offload can be set only on the queue setup.
+Per-port offloads should be set on the port configuration. Queue offloads should be set on the queue configuration.
  Offloads which are not enabled are disabled by default.
 
Quoted 4 lines

doc/guides/prog_guide/poll_mode_drv.rst Supported offloads can be either per-port or per-queue. · line 309

Quoted 1 line
doc/guides/prog_guide/poll_mode_drv.rst +0 -0
  For an application to use the Tx offloads API it should set the ``ETH_TXQ_FLAGS_IGNORE`` flag in the ``txq_flags`` field located in ``rte_eth_txconf`` struct.

net/sfc has code which double-checks old behaviour. So, it is not just documentation update. We can provide patches if the behaviour change is accepted.

Not definitely just doc update, PMDs needs to be modified. This patch is just to agree on the behavior.

Quoted 5 lines

IMHO, it should be allowed to specify queue offloads on port level. It should simply enable these offloads on all queues. Also it will match dev_info [rt]x_offload_capa which include both port and queue offloads.

Quoted 8 lines
Quoted 3 lines

Yes, we lose possibility to enable on port level, but disable on queue level by suggested changes, but I think it is OK - if you don't need it for all queues, just control separately on queue level.

What I understand was queue offload can only enable more, but it seems it can both enable or disable.

My concern was, even PMD reports no [rt]x_offload_capa at all, API forces application to send at least port offloads during queue setup.

I guess you mean [rt]x_queue_offload_capa above.

Quoted 2 lines

As long as application only allowed to send queue offloads within the boundaries of the "queue offload capabilities", I am OK.

If so, queue offloads should not be included in [rt]x_offload_capa. But I'm afraid it is too restrictive for apps.

Quoted 2 lines

This will work fine for devices that support queue level offloads to enable - disable queue specific offloads on top of port offloads. Will this make sense?

IMHO, disable on queue level is not required for enabled on port level. If app always wants some offloads, just check [rt]x_offload_capa and enable on port level (regardless if it is actually per-port or per-queue). If app wants to some offload per queue, check [rt]x_queue_offload_capa, do not enable on port level and control on queue level.

#113 lore raw

Re: [PATCH] doc: update new ethdev offload API description

Wednesday, March 21, 2018 1:09 PM, Andrew Rybchenko

Quoted 77 lines · Ferruh Yigit
Quoted 4 lines · Andrew Rybchenko
Quoted 3 lines · Ferruh Yigit
Quoted 2 lines

Don't mandate API to pass port offload configuration during queue setup, this is unnecessary for devices that support only port level

offloads.

Quoted 16 lines
Quoted 16 lines
Quoted 16 lines
Fixes 81ac560dc1b4 ("doc: add details on ethdev offloads API")

---
Cc: Patil, Harish <[email protected]>

Btw, this expectation from API should be clear from source code and API documentation (doxygen comments in header file) instead of documentation. Am I missing something or we are doing something wrong here?

---
  doc/guides/prog_guide/poll_mode_drv.rst | 4 +---
  1 file changed, 1 insertion(+), 3 deletions(-)
Quoted 6 lines
Quoted 6 lines

doc/guides/prog_guide/poll_mode_drv.rst Supported offloads can be either per-port or per-

Quoted 6 lines
doc/guides/prog_guide/poll_mode_drv.rst +0 -0
index e5d01874e..3247f309f 100644
@@ -303,9 +303,7 @@ Supported offloads can be either per-port or per-

queue.

Quoted 1 line
Quoted 1 line

doc/guides/prog_guide/poll_mode_drv.rst Supported offloads can be either per-port or per- · line 303

Quoted 1 line
doc/guides/prog_guide/poll_mode_drv.rst +0 -0
  Offloads are enabled using the existing ``DEV_TX_OFFLOAD_*`` or

``DEV_RX_OFFLOAD_*`` flags.

Quoted 2 lines
Quoted 2 lines

doc/guides/prog_guide/poll_mode_drv.rst Supported offloads can be either per-port or per- · line 305

Quoted 2 lines
doc/guides/prog_guide/poll_mode_drv.rst +0 -0
  Per-port offload configuration is set using ``rte_eth_dev_configure``.
  Per-queue offload configuration is set using

``rte_eth_rx_queue_setup`` and ``rte_eth_tx_queue_setup``.

Quoted 1 line
Quoted 1 line

doc/guides/prog_guide/poll_mode_drv.rst Supported offloads can be either per-port or per- · line 306

Quoted 1 line
doc/guides/prog_guide/poll_mode_drv.rst +0 -1
-To enable per-port offload, the offload should be set on both device

configuration and queue setup.

Quoted 1 line
Quoted 1 line

doc/guides/prog_guide/poll_mode_drv.rst Supported offloads can be either per-port or per- · line 307

Quoted 1 line
doc/guides/prog_guide/poll_mode_drv.rst +0 -1
-In case of a mixed configuration the queue setup shall return with an

error.

Quoted 1 line
Quoted 1 line

doc/guides/prog_guide/poll_mode_drv.rst Supported offloads can be either per-port or per- · line 308

Quoted 1 line
doc/guides/prog_guide/poll_mode_drv.rst +0 -1
-To enable per-queue offload, the offload can be set only on the queue

setup.

Quoted 1 line
Quoted 1 line

doc/guides/prog_guide/poll_mode_drv.rst Supported offloads can be either per-port or per- · line 306

Quoted 1 line
doc/guides/prog_guide/poll_mode_drv.rst +1 -0
+Per-port offloads should be set on the port configuration. Queue

offloads should be set on the queue configuration.

Quoted 3 lines
Quoted 3 lines

doc/guides/prog_guide/poll_mode_drv.rst Supported offloads can be either per-port or per-queue.

Quoted 3 lines
doc/guides/prog_guide/poll_mode_drv.rst +0 -0
  Offloads which are not enabled are disabled by default.
 
  For an application to use the Tx offloads API it should set the

``ETH_TXQ_FLAGS_IGNORE`` flag in the ``txq_flags`` field located in ``rte_eth_txconf`` struct.

Quoted 11 lines
Quoted 3 lines

net/sfc has code which double-checks old behaviour. So, it is not just documentation update. We can provide patches if the behaviour change is accepted.

Not definitely just doc update, PMDs needs to be modified. This patch is just to agree on the behavior.

Quoted 5 lines

IMHO, it should be allowed to specify queue offloads on port level. It should simply enable these offloads on all queues. Also it will match dev_info [rt]x_offload_capa which include both port and queue offloads.

Quoted 8 lines
Quoted 3 lines

Yes, we lose possibility to enable on port level, but disable on queue level by suggested changes, but I think it is OK - if you don't need it for all queues, just control separately on queue level.

What I understand was queue offload can only enable more, but it seems it can both enable or disable.

My concern was, even PMD reports no [rt]x_offload_capa at all, API forces application to send at least port offloads during queue setup.

I guess you mean [rt]x_queue_offload_capa above.

Quoted 2 lines

As long as application only allowed to send queue offloads within the boundaries of the "queue offload capabilities", I am OK.

If so, queue offloads should not be included in [rt]x_offload_capa. But I'm afraid it is too restrictive for apps.

Quoted 2 lines

This will work fine for devices that support queue level offloads to enable - disable queue specific offloads on top of port offloads. Will this

Quoted 7 lines

make sense?

IMHO, disable on queue level is not required for enabled on port level. If app always wants some offloads, just check [rt]x_offload_capa and enable on port level (regardless if it is actually per-port or per-queue). If app wants to some offload per queue, check [rt]x_queue_offload_capa, do not enable on port level and control on queue level.

+1.

And I think Ferruh this is the suggestion by this patch, isn't it?

#114 lore raw

Re: [PATCH] doc: update new ethdev offload API description

Quoted 77 lines · Shahaf Shuler

Wednesday, March 21, 2018 1:09 PM, Andrew Rybchenko

Quoted 76 lines · Ferruh Yigit
Quoted 4 lines · Andrew Rybchenko
Quoted 3 lines · Ferruh Yigit
Quoted 2 lines

Don't mandate API to pass port offload configuration during queue setup, this is unnecessary for devices that support only port level

offloads.

Quoted 15 lines
Quoted 15 lines
Quoted 15 lines
Fixes 81ac560dc1b4 ("doc: add details on ethdev offloads API")

---
Cc: Patil, Harish <[email protected]>

Btw, this expectation from API should be clear from source code and API documentation (doxygen comments in header file) instead of documentation. Am I missing something or we are doing something wrong here?

---
   doc/guides/prog_guide/poll_mode_drv.rst | 4 +---
   1 file changed, 1 insertion(+), 3 deletions(-)
Quoted 6 lines
Quoted 6 lines

doc/guides/prog_guide/poll_mode_drv.rst Supported offloads can be either per-port or per-

Quoted 6 lines
doc/guides/prog_guide/poll_mode_drv.rst +0 -0
index e5d01874e..3247f309f 100644
@@ -303,9 +303,7 @@ Supported offloads can be either per-port or per-

queue.

Quoted 1 line
Quoted 1 line

doc/guides/prog_guide/poll_mode_drv.rst Supported offloads can be either per-port or per- · line 303

Quoted 1 line
doc/guides/prog_guide/poll_mode_drv.rst +0 -0
   Offloads are enabled using the existing ``DEV_TX_OFFLOAD_*`` or

``DEV_RX_OFFLOAD_*`` flags.

Quoted 2 lines
Quoted 2 lines

doc/guides/prog_guide/poll_mode_drv.rst Supported offloads can be either per-port or per- · line 305

Quoted 2 lines
doc/guides/prog_guide/poll_mode_drv.rst +0 -0
   Per-port offload configuration is set using ``rte_eth_dev_configure``.
   Per-queue offload configuration is set using

``rte_eth_rx_queue_setup`` and ``rte_eth_tx_queue_setup``.

Quoted 1 line
Quoted 1 line

doc/guides/prog_guide/poll_mode_drv.rst Supported offloads can be either per-port or per- · line 306

Quoted 1 line
doc/guides/prog_guide/poll_mode_drv.rst +0 -1
-To enable per-port offload, the offload should be set on both device

configuration and queue setup.

Quoted 1 line
Quoted 1 line

doc/guides/prog_guide/poll_mode_drv.rst Supported offloads can be either per-port or per- · line 307

Quoted 1 line
doc/guides/prog_guide/poll_mode_drv.rst +0 -1
-In case of a mixed configuration the queue setup shall return with an

error.

Quoted 1 line
Quoted 1 line

doc/guides/prog_guide/poll_mode_drv.rst Supported offloads can be either per-port or per- · line 308

Quoted 1 line
doc/guides/prog_guide/poll_mode_drv.rst +0 -1
-To enable per-queue offload, the offload can be set only on the queue

setup.

Quoted 1 line
Quoted 1 line

doc/guides/prog_guide/poll_mode_drv.rst Supported offloads can be either per-port or per- · line 306

Quoted 1 line
doc/guides/prog_guide/poll_mode_drv.rst +1 -0
+Per-port offloads should be set on the port configuration. Queue

offloads should be set on the queue configuration.

Quoted 3 lines
Quoted 3 lines

doc/guides/prog_guide/poll_mode_drv.rst Supported offloads can be either per-port or per-queue.

Quoted 3 lines
doc/guides/prog_guide/poll_mode_drv.rst +0 -0
   Offloads which are not enabled are disabled by default.
 
   For an application to use the Tx offloads API it should set the

``ETH_TXQ_FLAGS_IGNORE`` flag in the ``txq_flags`` field located in ``rte_eth_txconf`` struct.

Quoted 11 lines
Quoted 3 lines

net/sfc has code which double-checks old behaviour. So, it is not just documentation update. We can provide patches if the behaviour change is accepted.

Not definitely just doc update, PMDs needs to be modified. This patch is just to agree on the behavior.

Quoted 5 lines

IMHO, it should be allowed to specify queue offloads on port level. It should simply enable these offloads on all queues. Also it will match dev_info [rt]x_offload_capa which include both port and queue offloads.

Quoted 8 lines
Quoted 3 lines

Yes, we lose possibility to enable on port level, but disable on queue level by suggested changes, but I think it is OK - if you don't need it for all queues, just control separately on queue level.

What I understand was queue offload can only enable more, but it seems it can both enable or disable.

My concern was, even PMD reports no [rt]x_offload_capa at all, API forces application to send at least port offloads during queue setup.

I guess you mean [rt]x_queue_offload_capa above.

Quoted 2 lines

As long as application only allowed to send queue offloads within the boundaries of the "queue offload capabilities", I am OK.

If so, queue offloads should not be included in [rt]x_offload_capa. But I'm afraid it is too restrictive for apps.

Quoted 2 lines

This will work fine for devices that support queue level offloads to enable - disable queue specific offloads on top of port offloads. Will this

make sense?

Quoted 8 lines
Quoted 5 lines

IMHO, disable on queue level is not required for enabled on port level. If app always wants some offloads, just check [rt]x_offload_capa and enable on port level (regardless if it is actually per-port or per-queue). If app wants to some offload per queue, check [rt]x_queue_offload_capa, do not enable on port level and control on queue level.

+1.

And I think Ferruh this is the suggestion by this patch, isn't it?

Not exactly. We should add statement to allow to enable queue offloads on port level (to enable on all queues).

#115 lore raw

Re: [PATCH] doc: update new ethdev offload API description

Wednesday, March 21, 2018 1:20 PM, :Andrew Rybchenko

Quoted 2 lines

Not exactly. We should add statement to allow to enable queue offloads on port level (to enable on all queues).

Why it is needed ?

Queue offload is also a port offload, for the simple case it is enabled on each of the queues. PMDs should report rx[tx]_offload_capa = port_offloads | queue_offloads

So from the application side it enables a **port** offload which, by definition, will set the offload to each of the queues. it is not “enabling queue offload on the port”.

#116 lore raw

Re: [PATCH] doc: update new ethdev offload API description

Quoted 8 lines · Shahaf Shuler

Wednesday, March 21, 2018 1:20 PM, *:*Andrew Rybchenko

Quoted 2 lines

Not exactly. We should add statement to allow to enable queue offloads on port level (to enable on all queues).

Why it is needed ?

May be just a paranoia to avoid misreading/misunderstanding.

Quoted 8 lines

Queue offload is also a port offload, for the simple case it is enabled on each of the queues.

PMDs should report rx[tx]_offload_capa = port_offloads | queue_offloads

So from the application side it enables a **port** offload which, by definition, will set the offload to each of the queues.

it is not “enabling queue offload on the port”.

I think it would be really useful for understanding to highlight that what is enabled on port level is enabled on all queues regardless queue conf.

#117 lore raw

Re: [PATCH] doc: update new ethdev offload API description

Wednesday, March 21, 2018 1:37 PM, Andrew Rybchenko:

Quoted 18 lines · Shahaf Shuler
Quoted 8 lines

Wednesday, March 21, 2018 1:20 PM, *:*Andrew Rybchenko

Quoted 2 lines

Not exactly. We should add statement to allow to enable queue offloads on port level (to enable on all queues).

Why it is needed ?

May be just a paranoia to avoid misreading/misunderstanding.

Quoted 6 lines

Queue offload is also a port offload, for the simple case it is enabled on each of the queues.

PMDs should report rx[tx]_offload_capa = port_offloads | queue_offloads

Quoted 8 lines
Quoted 5 lines

So from the application side it enables a **port** offload which, by definition, will set the offload to each of the queues.

it is not “enabling queue offload on the port”.

I think it would be really useful for understanding to highlight that what is enabled on port level is enabled on all queues regardless queue conf.

So I think the extra wording should explain that queue offload is also a port offload, and not to mix between the queue and port offload configuration.

#118 lore raw

Re: [PATCH] doc: update new ethdev offload API description

Quoted 22 lines · Shahaf Shuler

Wednesday, March 21, 2018 1:37 PM, Andrew Rybchenko:

Quoted 21 lines · Shahaf Shuler
Quoted 8 lines

Wednesday, March 21, 2018 1:20 PM, *:*Andrew Rybchenko

Quoted 2 lines

Not exactly. We should add statement to allow to enable queue offloads on port level (to enable on all queues).

Why it is needed ?

May be just a paranoia to avoid misreading/misunderstanding.

Quoted 9 lines

Queue offload is also a port offload, for the simple case it is enabled on each of the queues.

PMDs should report rx[tx]_offload_capa = port_offloads | queue_offloads

So from the application side it enables a **port** offload which, by definition, will set the offload to each of the queues.

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

it is not “enabling queue offload on the port”.

I think it would be really useful for understanding to highlight that what is enabled on port level is enabled on all queues regardless queue conf.

So I think the extra wording should explain that queue offload is also a port offload, and not to mix between the queue and port offload configuration.

+1 for more details, the sentences was the outcome of the previous discussion but not clear enough. Perhaps some sample values can be also good. Shahaf do you want to give a try?

And is following correct based on latest :
1- Port capability is always covers queue capability P_cap = A, B, C, D
Q_cap = B, C, D

2- Requested port offloads should be subset of port capabilities, they will be applied to all queues:
P_req = A, B
Q1: A, B
Q2: A, B

3- Later, requested queue offloads should be subset of queue capabilities, they will be applied to specific queue:
Q_req = 1:B, C
Q1: A, B, C
Q2: A, B

Q_req = 2:D
Q1: A, B, C
Q2: A, D

Scenario 2:
1-
P_cap = A, B, C, D
Q_cap = ""

2-
P_req = A, B
Q1: A, B
Q2: A, B

3-
Q_req = ""
Q1: A, B
Q2: A, B

#119 lore raw

Re: [PATCH] doc: update new ethdev offload API description

Wednesday, March 21, 2018 2:52 PM, Ferruh Yigit:

Quoted 30 lines · Shahaf Shuler
Quoted 27 lines

Wednesday, March 21, 2018 1:37 PM, Andrew Rybchenko:

Quoted 26 lines · Shahaf Shuler
Quoted 8 lines

Wednesday, March 21, 2018 1:20 PM, *:*Andrew Rybchenko

Quoted 2 lines

Not exactly. We should add statement to allow to enable queue offloads on port level (to enable on all queues).

Why it is needed ?

May be just a paranoia to avoid misreading/misunderstanding.

Quoted 11 lines

Queue offload is also a port offload, for the simple case it is enabled on each of the queues.

PMDs should report rx[tx]_offload_capa = port_offloads | queue_offloads

So from the application side it enables a **port** offload which, by definition, will set the offload to each of the queues.

it is not “enabling queue offload on the port”.

I think it would be really useful for understanding to highlight that what is enabled on port level is enabled on all queues regardless queue

conf.

Quoted 1 line
Quoted 7 lines
Quoted 1 line

So I think the extra wording should explain that queue offload is also a port

offload, and not to mix between the queue and port offload configuration.

+1 for more details, the sentences was the outcome of the previous +discussion
but not clear enough. Perhaps some sample values can be also good. Shahaf do you want to give a try?

IMO what is missing is:
1. the syntax of this patch
2. explicitly write that queue offloads are always subset of the port offload
3. explicitly write that when port offload is enabled it applies to all queues (that one is already written AFAIR).

Quoted 36 lines

And is following correct based on latest :
1- Port capability is always covers queue capability P_cap = A, B, C, D Q_cap = B, C, D

2- Requested port offloads should be subset of port capabilities, they will be applied to all queues:
P_req = A, B
Q1: A, B
Q2: A, B

3- Later, requested queue offloads should be subset of queue capabilities, they will be applied to specific queue:
Q_req = 1:B, C
Q1: A, B, C
Q2: A, B

Q_req = 2:D
Q1: A, B, C
Q2: A, D

Scenario 2:
1-
P_cap = A, B, C, D
Q_cap = ""

2-
P_req = A, B
Q1: A, B
Q2: A, B

3-
Q_req = ""
Q1: A, B
Q2: A, B

#120 lore raw

Re: [PATCH] doc: update new ethdev offload API description

Quoted 50 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Shahaf Shuler
Sent: Wednesday, March 21, 2018 1:06 PM
To: Yigit, Ferruh <[email protected]>; Andrew Rybchenko <[email protected]>; Mcnamara, John <[email protected]>; Kovacevic, Marko <[email protected]>
Cc: [email protected]; Thomas Monjalon <[email protected]>; [email protected]; Harish <[email protected]>; Ivan Malov <[email protected]>
Subject: Re: [dpdk-dev] [PATCH] doc: update new ethdev offload API description

Wednesday, March 21, 2018 2:52 PM, Ferruh Yigit:

Quoted 30 lines · Shahaf Shuler
Quoted 27 lines

Wednesday, March 21, 2018 1:37 PM, Andrew Rybchenko:

Quoted 26 lines · Shahaf Shuler
Quoted 8 lines

Wednesday, March 21, 2018 1:20 PM, *:*Andrew Rybchenko

Quoted 2 lines

Not exactly. We should add statement to allow to enable queue offloads on port level (to enable on all queues).

Why it is needed ?

May be just a paranoia to avoid misreading/misunderstanding.

Quoted 11 lines

Queue offload is also a port offload, for the simple case it is enabled on each of the queues.

PMDs should report rx[tx]_offload_capa = port_offloads | queue_offloads

So from the application side it enables a **port** offload which, by definition, will set the offload to each of the queues.

it is not “enabling queue offload on the port”.

I think it would be really useful for understanding to highlight that what is enabled on port level is enabled on all queues regardless queue

conf.

Quoted 1 line
Quoted 7 lines
Quoted 1 line

So I think the extra wording should explain that queue offload is also a port

offload, and not to mix between the queue and port offload configuration.

+1 for more details, the sentences was the outcome of the previous +discussion
but not clear enough. Perhaps some sample values can be also good. Shahaf do you want to give a try?

Quoted 4 lines

IMO what is missing is:
1. the syntax of this patch
2. explicitly write that queue offloads are always subset of the port offload
3. explicitly write that when port offload is enabled it applies to all queues (that one is already written AFAIR).

For me examples below seems quite handy.
It clearly shows that queue_setup() can do both: enable and disable any per-queue offload. Konstantin

Quoted 37 lines
Quoted 37 lines

And is following correct based on latest :
1- Port capability is always covers queue capability P_cap = A, B, C, D Q_cap = B, C, D

2- Requested port offloads should be subset of port capabilities, they will be applied to all queues:
P_req = A, B
Q1: A, B
Q2: A, B

3- Later, requested queue offloads should be subset of queue capabilities, they will be applied to specific queue:
Q_req = 1:B, C
Q1: A, B, C
Q2: A, B

Q_req = 2:D
Q1: A, B, C
Q2: A, D

Scenario 2:
1-
P_cap = A, B, C, D
Q_cap = ""

2-
P_req = A, B
Q1: A, B
Q2: A, B

3-
Q_req = ""
Q1: A, B
Q2: A, B

#121 lore raw

Re: [PATCH] doc: update new ethdev offload API description

In reply to Andrew Rybchenko

Hi everyone,

Quoted 29 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Andrew Rybchenko
Sent: Wednesday, March 21, 2018 11:37 AM
To: Shahaf Shuler <[email protected]>; Yigit, Ferruh <[email protected]>; Mcnamara, John <[email protected]>; Kovacevic, Marko <[email protected]>
Cc: [email protected]; Thomas Monjalon <[email protected]>; [email protected]; Harish <[email protected]>; Ivan Malov <[email protected]>
Subject: Re: [dpdk-dev] [PATCH] doc: update new ethdev offload API description

Quoted 8 lines · Shahaf Shuler

Wednesday, March 21, 2018 1:20 PM, *:*Andrew Rybchenko

Quoted 2 lines

Not exactly. We should add statement to allow to enable queue offloads on port level (to enable on all queues).

Why it is needed ?

May be just a paranoia to avoid misreading/misunderstanding.

Quoted 8 lines

Queue offload is also a port offload, for the simple case it is enabled on each of the queues.

PMDs should report rx[tx]_offload_capa = port_offloads | queue_offloads

So from the application side it enables a **port** offload which, by definition, will set the offload to each of the queues.

Quoted 6 lines
Quoted 2 lines

it is not “enabling queue offload on the port”.

I think it would be really useful for understanding to highlight that what is enabled on port level is enabled on all queues regardless queue conf.

Why not to allow queue offloads to override port offload for given queue? Konstantin

#122 lore raw

Re: [PATCH] doc: update new ethdev offload API description

Wednesday, March 21, 2018 2:04 PM, Ananyev, Konstantin:

Quoted 39 lines

Hi everyone,

Quoted 2 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Andrew

Rybchenko

Quoted 34 lines

Sent: Wednesday, March 21, 2018 11:37 AM
To: Shahaf Shuler <[email protected]>; Yigit, Ferruh <[email protected]>; Mcnamara, John <[email protected]>; Kovacevic, Marko <[email protected]>
Cc: [email protected]; Thomas Monjalon <[email protected]>; [email protected]; Harish <[email protected]>; Ivan Malov <[email protected]>
Subject: Re: [dpdk-dev] [PATCH] doc: update new ethdev offload API description

Quoted 8 lines · Shahaf Shuler

Wednesday, March 21, 2018 1:20 PM, *:*Andrew Rybchenko

Quoted 2 lines

Not exactly. We should add statement to allow to enable queue offloads on port level (to enable on all queues).

Why it is needed ?

May be just a paranoia to avoid misreading/misunderstanding.

Quoted 11 lines

Queue offload is also a port offload, for the simple case it is enabled on each of the queues.

PMDs should report rx[tx]_offload_capa = port_offloads | queue_offloads

So from the application side it enables a **port** offload which, by definition, will set the offload to each of the queues.

it is not “enabling queue offload on the port”.

Quoted 6 lines
Quoted 3 lines

I think it would be really useful for understanding to highlight that what is enabled on port level is enabled on all queues regardless queue conf.

Why not to allow queue offloads to override port offload for given queue? Konstantin

What is the use case for that? Why would application want to enable offload on the port and then disable it on some of the queues? Why not just enable it on the needed queues as part of the queue level configuration?

Quoted 1 line
#123 lore raw

Re: [PATCH] doc: update new ethdev offload API description

In reply to Ananyev, Konstantin
Quoted 28 lines · Konstantin

Hi everyone,

Quoted 26 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Andrew Rybchenko
Sent: Wednesday, March 21, 2018 11:37 AM
To: Shahaf Shuler <[email protected]>; Yigit, Ferruh <[email protected]>; Mcnamara, John <[email protected]>; Kovacevic, Marko <[email protected]>
Cc: [email protected]; Thomas Monjalon <[email protected]>; [email protected]; Harish <[email protected]>; Ivan Malov <[email protected]>
Subject: Re: [dpdk-dev] [PATCH] doc: update new ethdev offload API description

Quoted 6 lines · Shahaf Shuler

Wednesday, March 21, 2018 1:20 PM, *:*Andrew Rybchenko

Quoted 2 lines

Not exactly. We should add statement to allow to enable queue offloads on port level (to enable on all queues).

Why it is needed ?

May be just a paranoia to avoid misreading/misunderstanding.

Quoted 8 lines

Queue offload is also a port offload, for the simple case it is enabled on each of the queues.

PMDs should report rx[tx]_offload_capa = port_offloads | queue_offloads

So from the application side it enables a **port** offload which, by definition, will set the offload to each of the queues.

Quoted 6 lines
Quoted 5 lines
Quoted 2 lines

it is not “enabling queue offload on the port”.

I think it would be really useful for understanding to highlight that what is enabled on port level is enabled on all queues regardless queue conf.

Why not to allow queue offloads to override port offload for given queue?

Basically it returns us to the initial point made by Ferruh:
If device has no queue offloads, but application still has to repeat port offloads in queue offloads.

#124 lore raw

Re: [PATCH] doc: update new ethdev offload API description

Quoted 42 lines

-----Original Message-----
From: Andrew Rybchenko [mailto:[email protected]]
Sent: Wednesday, March 21, 2018 12:34 PM
To: Ananyev, Konstantin <[email protected]>; Shahaf Shuler <[email protected]>; Yigit, Ferruh <[email protected]>; Mcnamara, John <[email protected]>; Kovacevic, Marko <[email protected]>
Cc: [email protected]; Thomas Monjalon <[email protected]>; [email protected]; Harish <[email protected]>; Ivan Malov <[email protected]>
Subject: Re: [dpdk-dev] [PATCH] doc: update new ethdev offload API description

Quoted 30 lines · Konstantin

Hi everyone,

Quoted 28 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Andrew Rybchenko
Sent: Wednesday, March 21, 2018 11:37 AM
To: Shahaf Shuler <[email protected]>; Yigit, Ferruh <[email protected]>; Mcnamara, John <[email protected]>; Kovacevic, Marko <[email protected]>
Cc: [email protected]; Thomas Monjalon <[email protected]>; [email protected]; Harish <[email protected]>; Ivan Malov <[email protected]>
Subject: Re: [dpdk-dev] [PATCH] doc: update new ethdev offload API description

Quoted 6 lines · Shahaf Shuler

Wednesday, March 21, 2018 1:20 PM, *:*Andrew Rybchenko

Quoted 2 lines

Not exactly. We should add statement to allow to enable queue offloads on port level (to enable on all queues).

Why it is needed ?

May be just a paranoia to avoid misreading/misunderstanding.

Quoted 10 lines

Queue offload is also a port offload, for the simple case it is enabled on each of the queues.

PMDs should report rx[tx]_offload_capa = port_offloads | queue_offloads

So from the application side it enables a **port** offload which, by definition, will set the offload to each of the queues.

it is not “enabling queue offload on the port”.

Quoted 8 lines
Quoted 4 lines
Quoted 3 lines

I think it would be really useful for understanding to highlight that what is enabled on port level is enabled on all queues regardless queue conf.

Why not to allow queue offloads to override port offload for given queue?

Basically it returns us to the initial point made by Ferruh:
If device has no queue offloads, but application still has to repeat port offloads in queue offloads.

If device doesn't have per queue offloads (only per port) then there should be nothing to enable/disable per queue, no?
Or you'd like to allow at queue_setup() to enable/disable port offloads too?

#125 lore raw

Re: [PATCH] doc: update new ethdev offload API description

In reply to Ferruh Yigit

21/03/2018 11:54, Ferruh Yigit:

Quoted 6 lines · Andrew Rybchenko
Quoted 5 lines

IMHO, it should be allowed to specify queue offloads on port level. It should simply enable these offloads on all queues. Also it will match dev_info [rt]x_offload_capa which include both port and queue offloads.

Quoted 6 lines
Quoted 3 lines

Yes, we lose possibility to enable on port level, but disable on queue level by suggested changes, but I think it is OK - if you don't need it for all queues, just control separately on queue level.

What I understand was queue offload can only enable more, but it seems it can both enable or disable.

Yes, queue offload should only enable more.
An offload enabled at port level, cannot be disabled at queue level. A port offload can be repeated in queue configuration.
If a port offload is not repeated in queue configuration, there should be no impact: it is still in the port configuration, thus applying to all queues.

About capabilities, the queue offloads must be a subset of port offloads. The queue capabilities show which offloads can be enabled per queue.

#126 lore raw

Re: [PATCH] doc: update new ethdev offload API description

Quoted 11 lines · Thomas Monjalon

21/03/2018 11:54, Ferruh Yigit:

Quoted 10 lines · Andrew Rybchenko
Quoted 8 lines

IMHO, it should be allowed to specify queue offloads on port level. It should simply enable these offloads on all queues. Also it will match dev_info [rt]x_offload_capa which include both port and queue offloads.

Yes, we lose possibility to enable on port level, but disable on queue level by suggested changes, but I think it is OK - if you don't need it for all queues, just control separately on queue level.

Quoted 5 lines
Quoted 2 lines

What I understand was queue offload can only enable more, but it seems it can both enable or disable.

Yes, queue offload should only enable more.
An offload enabled at port level, cannot be disabled at queue level.

Agree an offload enabled at port level can't be disabled at queue level, but why not have the ability to disable a queue level offload with another queue setup call.

Quoted 3 lines

A port offload can be repeated in queue configuration.
If a port offload is not repeated in queue configuration, there should be no impact: it is still in the port configuration, thus applying to all queues.

This was a requirement, this patch targets removing the requirement to repeat the port offload in queue config.

Quoted 5 lines

About capabilities, the queue offloads must be a subset of port offloads. The queue capabilities show which offloads can be enabled per queue.

#127 lore raw

Re: [PATCH] doc: update new ethdev offload API description

21/03/2018 15:28, Ferruh Yigit:

Quoted 12 lines · Thomas Monjalon
Quoted 11 lines

21/03/2018 11:54, Ferruh Yigit:

Quoted 10 lines · Andrew Rybchenko
Quoted 8 lines

IMHO, it should be allowed to specify queue offloads on port level. It should simply enable these offloads on all queues. Also it will match dev_info [rt]x_offload_capa which include both port and queue offloads.

Yes, we lose possibility to enable on port level, but disable on queue level by suggested changes, but I think it is OK - if you don't need it for all queues, just control separately on queue level.

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

What I understand was queue offload can only enable more, but it seems it can both enable or disable.

Yes, queue offload should only enable more.
An offload enabled at port level, cannot be disabled at queue level.

Agree an offload enabled at port level can't be disabled at queue level, but why not have the ability to disable a queue level offload with another queue setup call.

Yes it should be possible to disable a queue offload:
1/ enable offload in queue configuration
2/ later disable this offload in queue configuration

So, when I say "only enable more", I mean queue config should only enable more than port config. In other words, a port-level offload cannot be disabled at queue level.

Quoted 6 lines
Quoted 3 lines

A port offload can be repeated in queue configuration.
If a port offload is not repeated in queue configuration, there should be no impact: it is still in the port configuration, thus applying to all queues.

This was a requirement, this patch targets removing the requirement to repeat the port offload in queue config.

Understood, and I agree with this change if it is well explained in sphinx and doxygen.
It is important to say that queue configuration has no impact on offloads already enabled at port level.

Quoted 2 lines
Quoted 2 lines

About capabilities, the queue offloads must be a subset of port offloads. The queue capabilities show which offloads can be enabled per queue.

#128 lore raw

Re: [PATCH] doc: update new ethdev offload API description

Quoted 34 lines · Thomas Monjalon

21/03/2018 15:28, Ferruh Yigit:

Quoted 12 lines · Thomas Monjalon
Quoted 11 lines

21/03/2018 11:54, Ferruh Yigit:

Quoted 10 lines · Andrew Rybchenko
Quoted 8 lines

IMHO, it should be allowed to specify queue offloads on port level. It should simply enable these offloads on all queues. Also it will match dev_info [rt]x_offload_capa which include both port and queue offloads.

Yes, we lose possibility to enable on port level, but disable on queue level by suggested changes, but I think it is OK - if you don't need it for all queues, just control separately on queue level.

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

What I understand was queue offload can only enable more, but it seems it can both enable or disable.

Yes, queue offload should only enable more.
An offload enabled at port level, cannot be disabled at queue level.

Agree an offload enabled at port level can't be disabled at queue level, but why not have the ability to disable a queue level offload with another queue setup call.

Yes it should be possible to disable a queue offload:
1/ enable offload in queue configuration
2/ later disable this offload in queue configuration

So, when I say "only enable more", I mean queue config should only enable more than port config. In other words, a port-level offload cannot be disabled at queue level.

Quoted 4 lines
Quoted 3 lines

A port offload can be repeated in queue configuration.
If a port offload is not repeated in queue configuration, there should be no impact: it is still in the port configuration, thus applying to all queues.

Quoted 13 lines
Quoted 2 lines

This was a requirement, this patch targets removing the requirement to repeat the port offload in queue config.

Understood, and I agree with this change if it is well explained in sphinx and doxygen.
It is important to say that queue configuration has no impact on offloads already enabled at port level.

Quoted 2 lines
Quoted 2 lines

About capabilities, the queue offloads must be a subset of port offloads. The queue capabilities show which offloads can be enabled per queue.

Why not abandon port-level config entirely? Then you just have queue-level configs, with the restriction that on some NICs all queues must be configured the same way. It can be up to the NIC drivers - or possibly ethdev layer - to identify and report an error in such cases.

/Bruce

#129 lore raw

Re: [PATCH] doc: update new ethdev offload API description

Wednesday, March 21, 2018 5:27 PM, Bruce Richardson

Quoted 11 lines · Thomas Monjalon
Quoted 9 lines

21/03/2018 15:28, Ferruh Yigit:

Quoted 7 lines · Thomas Monjalon
Quoted 6 lines

21/03/2018 11:54, Ferruh Yigit:

Quoted 5 lines · Andrew Rybchenko
Quoted 4 lines

IMHO, it should be allowed to specify queue offloads on port level. It should simply enable these offloads on all queues. Also it will match dev_info [rt]x_offload_capa which include both port and queue offloads.

Quoted 4 lines

Why not abandon port-level config entirely? Then you just have queue-level configs, with the restriction that on some NICs all queues must be configured the same way. It can be up to the NIC drivers - or possibly ethdev layer - to identify and report an error in such cases.

I would love that. And this was part of the original proposal when we first modified the offloads API.

However Konstantin explained to me it will not work with Intel devices. There are cases were port configuration should be set on the PF w/o any queues created to enable offload on the VF.

Quoted 2 lines

/Bruce

#130 lore raw

Re: [PATCH] doc: update new ethdev offload API description

Quoted 12 lines · Shahaf Shuler

Wednesday, March 21, 2018 5:27 PM, Bruce Richardson

Quoted 11 lines · Thomas Monjalon
Quoted 9 lines

21/03/2018 15:28, Ferruh Yigit:

Quoted 7 lines · Thomas Monjalon
Quoted 6 lines

21/03/2018 11:54, Ferruh Yigit:

Quoted 5 lines · Andrew Rybchenko
Quoted 4 lines

IMHO, it should be allowed to specify queue offloads on port level. It should simply enable these offloads on all queues. Also it will match dev_info [rt]x_offload_capa which include both port and queue offloads.

Quoted 9 lines
Quoted 4 lines

Why not abandon port-level config entirely? Then you just have queue-level configs, with the restriction that on some NICs all queues must be configured the same way. It can be up to the NIC drivers - or possibly ethdev layer - to identify and report an error in such cases.

I would love that. And this was part of the original proposal when we first modified the offloads API.

However Konstantin explained to me it will not work with Intel devices. There are cases were port configuration should be set on the PF w/o any queues created to enable offload on the VF.

Apologies so, my bad for not having followed the whole discussion too closely. Never mind. I'll go back to pretending I have something meaningful to contribute on other threads instead. :-)

/Bruce

#131 lore raw

Re: [PATCH] doc: update new ethdev offload API description

In reply to Ferruh Yigit
Quoted 7 lines · Ferruh Yigit

Don't mandate API to pass port offload configuration during queue setup, this is unnecessary for devices that support only port level offloads.

Fixes 81ac560dc1b4 ("doc: add details on ethdev offloads API")

Superseded by [1] which has both doc update and implementation.

[1]
https://dpdk.org/dev/patchwork/patch/39457/

Acked-by on the v6 series
#132 lore raw
In reply to Shahaf Shuler
Quoted 86 lines

-----Original Message-----
From: Shahaf Shuler [mailto:[email protected]]
Sent: Wednesday, October 4, 2017 9:18 AM
To: Ananyev, Konstantin <[email protected]>; [email protected]; [email protected]; [email protected]; Yigit, Ferruh <[email protected]>
Cc: [email protected]
Subject: [PATCH v6 0/4] ethdev new offloads API

Tx offloads configuration is per queue. Tx offloads are enabled by default, and can be disabled using ETH_TXQ_FLAGS_NO* flags.
This behaviour is not consistent with the Rx side where the Rx offloads configuration is per port. Rx offloads are disabled by default and enabled according to bit field in rte_eth_rxmode structure.

Moreover, considering more Tx and Rx offloads will be added over time, the cost of managing them all inside the PMD will be tremendous, as the PMD will need to check the matching for the entire offload set for each mbuf it handles.
In addition, on the current approach each Rx offload added breaks the ABI compatibility as it requires to add entries to existing bit-fields.

The series address above issues by defining a new offloads API. In the new API, offloads are divided into per-port and per-queue offloads, with a corresponding capability for each.
The offloads are disabled by default. Each offload can be enabled or disabled using the existing DEV_TX_OFFLOADS_* or DEV_RX_OFFLOADS_* flags. Such API will enable to easily add or remove offloads, without breaking the ABI compatibility.

In order to provide a smooth transition between the APIs the following actions were taken:
* The old offloads API is kept for the meanwhile.
* Helper function which copy from old to new API were added to ethdev, enabling the PMD to support only one of the APIs.
* Helper function which copy from new to old API were also added, to enable application to use the new API with PMD which still supports the old one.

Per discussion made on the RFC of this series [1], the integration plan which was decided is to do the transition in two phases:
* ethdev API will move on 17.11.
* Apps and examples will move on 18.02.

This to enable PMD maintainers sufficient time to adopt the new API.

[1]
http://dpdk.org/ml/archives/dev/2017-August/072643.html

on v6:
- Move mbuf fast free Tx offload to a seperate patch.

on v5:
- Fix documentation.
- Fix comments on port offloads configuration.

on v4:
- Added another patch for documentation.
- Fixed ETH_TXQ_FLAGS_IGNORE flag override.
- Clarify the description of DEV_TX_OFFLOAD_MBUF_FAST_FREE offload.

on v3:
- Introduce the DEV_TX_OFFLOAD_MBUF_FAST_FREE to act as an equivalent for the no refcnt and single mempool flags.
- Fix features documentation.
- Fix comment style.

on v2:
- Taking new approach of dividing offloads into per-queue and per-port one.
- Postpone the Tx/Rx public struct renaming to 18.02
- Squash the helper functions into the Rx/Tx offloads intro patches.

Shahaf Shuler (4):
ethdev: introduce Rx queue offloads API
ethdev: introduce Tx queue offloads API
ethdev: add mbuf fast free Tx offload
doc: add details on ethdev offloads API

 doc/guides/nics/features.rst            |  66 +++++---
 doc/guides/nics/features/default.ini    |   1 +
 doc/guides/prog_guide/poll_mode_drv.rst |  20 +++
 lib/librte_ether/rte_ethdev.c           | 223 +++++++++++++++++++++++++--
 lib/librte_ether/rte_ethdev.h           |  89 ++++++++++-
 5 files changed, 359 insertions(+), 40 deletions(-)
Quoted 3 lines

--

Quoted 1 line

2.12.0

#133 lore raw
Quoted 86 lines · Konstantin
Quoted 86 lines

-----Original Message-----
From: Shahaf Shuler [mailto:[email protected]]
Sent: Wednesday, October 4, 2017 9:18 AM
To: Ananyev, Konstantin <[email protected]>; [email protected]; [email protected]; [email protected]; Yigit, Ferruh <[email protected]>
Cc: [email protected]
Subject: [PATCH v6 0/4] ethdev new offloads API

Tx offloads configuration is per queue. Tx offloads are enabled by default, and can be disabled using ETH_TXQ_FLAGS_NO* flags.
This behaviour is not consistent with the Rx side where the Rx offloads configuration is per port. Rx offloads are disabled by default and enabled according to bit field in rte_eth_rxmode structure.

Moreover, considering more Tx and Rx offloads will be added over time, the cost of managing them all inside the PMD will be tremendous, as the PMD will need to check the matching for the entire offload set for each mbuf it handles.
In addition, on the current approach each Rx offload added breaks the ABI compatibility as it requires to add entries to existing bit-fields.

The series address above issues by defining a new offloads API. In the new API, offloads are divided into per-port and per-queue offloads, with a corresponding capability for each.
The offloads are disabled by default. Each offload can be enabled or disabled using the existing DEV_TX_OFFLOADS_* or DEV_RX_OFFLOADS_* flags. Such API will enable to easily add or remove offloads, without breaking the ABI compatibility.

In order to provide a smooth transition between the APIs the following actions were taken:
* The old offloads API is kept for the meanwhile.
* Helper function which copy from old to new API were added to ethdev, enabling the PMD to support only one of the APIs.
* Helper function which copy from new to old API were also added, to enable application to use the new API with PMD which still supports the old one.

Per discussion made on the RFC of this series [1], the integration plan which was decided is to do the transition in two phases:
* ethdev API will move on 17.11.
* Apps and examples will move on 18.02.

This to enable PMD maintainers sufficient time to adopt the new API.

[1]
http://dpdk.org/ml/archives/dev/2017-August/072643.html

on v6:
- Move mbuf fast free Tx offload to a seperate patch.

on v5:
- Fix documentation.
- Fix comments on port offloads configuration.

on v4:
- Added another patch for documentation.
- Fixed ETH_TXQ_FLAGS_IGNORE flag override.
- Clarify the description of DEV_TX_OFFLOAD_MBUF_FAST_FREE offload.

on v3:
- Introduce the DEV_TX_OFFLOAD_MBUF_FAST_FREE to act as an equivalent for the no refcnt and single mempool flags.
- Fix features documentation.
- Fix comment style.

on v2:
- Taking new approach of dividing offloads into per-queue and per-port one.
- Postpone the Tx/Rx public struct renaming to 18.02
- Squash the helper functions into the Rx/Tx offloads intro patches.

Shahaf Shuler (4):
ethdev: introduce Rx queue offloads API
ethdev: introduce Tx queue offloads API
ethdev: add mbuf fast free Tx offload
doc: add details on ethdev offloads API

 doc/guides/nics/features.rst            |  66 +++++---
 doc/guides/nics/features/default.ini    |   1 +
 doc/guides/prog_guide/poll_mode_drv.rst |  20 +++
 lib/librte_ether/rte_ethdev.c           | 223 +++++++++++++++++++++++++--
 lib/librte_ether/rte_ethdev.h           |  89 ++++++++++-
 5 files changed, 359 insertions(+), 40 deletions(-)
Quoted 3 lines
Quoted 1 line

Series applied to dpdk-next-net/master, thanks.