DPDK patches and discussions
 help / color / mirror / Atom feed
From: Shahaf Shuler <shahafs@mellanox.com>
To: thomas@monjalon.net
Cc: dev@dpdk.org
Subject: [dpdk-dev] [PATCH 3/4] ethdev: introduce Tx queue offloads API
Date: Mon,  4 Sep 2017 10:12:17 +0300	[thread overview]
Message-ID: <a6ebb680e5d42039664fce918919555de66ed5c5.1504508375.git.shahafs@mellanox.com> (raw)
In-Reply-To: <cover.1504508374.git.shahafs@mellanox.com>

Introduce a new API to configure Tx offloads.

The new API will re-use existing DEV_TX_OFFLOAD_* flags
to enable the different offloads. This will ease the process
of adding a new Tx offloads, as no ABI breakage is involved.
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.

The new API does not have an equivalent for the below, benchmark
specific, flags:

	- ETH_TXQ_FLAGS_NOREFCOUNT
	- ETH_TXQ_FLAGS_NOMULTMEMP

The Tx queue offload API can be used only with devices which advertize
the RTE_ETH_DEV_TXQ_OFFLOAD capability.

PMDs which move to the new API however support Tx offloads only per
port should return from the queue setup, in case of a mixed configuration,
with error (-ENOTSUP).

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.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 doc/guides/nics/features.rst  |  8 ++++++++
 lib/librte_ether/rte_ethdev.h | 24 ++++++++++++++++++++++++
 2 files changed, 32 insertions(+)

diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
index f2c8497c2..bb25a1cee 100644
--- a/doc/guides/nics/features.rst
+++ b/doc/guides/nics/features.rst
@@ -131,6 +131,7 @@ 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.
 
+* **[uses]    rte_eth_txq_conf**: ``offloads:DEV_TX_OFFLOAD_MT_LOCKFREE``.
 * **[provides] rte_eth_dev_info**: ``tx_offload_capa:DEV_TX_OFFLOAD_MT_LOCKFREE``.
 * **[related]  API**: ``rte_eth_tx_burst()``.
 
@@ -220,6 +221,7 @@ TSO
 
 Supports TCP Segmentation Offloading.
 
+* **[uses]       rte_eth_txq_conf**: ``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``.
@@ -510,6 +512,7 @@ VLAN offload
 Supports VLAN offload to hardware.
 
 * **[uses]       rte_eth_rxq_conf**: ``offloads:DEV_RX_OFFLOAD_VLAN_STRIP,DEV_RX_OFFLOAD_VLAN_FILTER,DEV_RX_OFFLOAD_VLAN_EXTEND``.
+* **[uses]       rte_eth_txq_conf**: ``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:DEV_RX_OFFLOAD_VLAN_STRIP``,
@@ -526,6 +529,7 @@ QinQ offload
 Supports QinQ (queue in queue) offload.
 
 * **[uses]     rte_eth_rxq_conf**: ``offloads:DEV_RX_OFFLOAD_QINQ_STRIP``.
+* **[uses]     rte_eth_txq_conf**: ``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``.
@@ -541,6 +545,7 @@ L3 checksum offload
 Supports L3 checksum offload.
 
 * **[uses]     rte_eth_rxq_conf**: ``offloads:DEV_RX_OFFLOAD_IPV4_CKSUM``.
+* **[uses]     rte_eth_txq_conf**: ``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`` |
@@ -558,6 +563,7 @@ L4 checksum offload
 Supports L4 checksum offload.
 
 * **[uses]     rte_eth_rxq_conf**: ``offloads:DEV_RX_OFFLOAD_UDP_CKSUM,DEV_RX_OFFLOAD_TCP_CKSUM``.
+* **[uses]     rte_eth_txq_conf**: ``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``.
@@ -576,6 +582,7 @@ MACsec offload
 Supports MACsec.
 
 * **[uses]     rte_eth_rxq_conf**: ``offloads:DEV_RX_OFFLOAD_MACSEC_STRIP``.
+* **[uses]     rte_eth_txq_conf**: ``offloads:DEV_TX_OFFLOAD_MACSEC_INSERT``.
 * **[uses]     mbuf**: ``mbuf.ol_flags:PKT_TX_MACSEC``.
 * **[provides] rte_eth_dev_info**: ``rx_offload_capa:DEV_RX_OFFLOAD_MACSEC_STRIP``,
   ``tx_offload_capa:DEV_TX_OFFLOAD_MACSEC_INSERT``.
@@ -589,6 +596,7 @@ Inner L3 checksum
 Supports inner packet L3 checksum.
 
 * **[uses]     rte_eth_rxq_conf**: ``offloads:DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM``.
+* **[uses]     rte_eth_txq_conf**: ``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``,
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 90934418d..1293b9922 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -719,6 +719,14 @@ struct rte_eth_rxq_conf {
 #define ETH_TXQ_FLAGS_NOXSUMS \
 		(ETH_TXQ_FLAGS_NOXSUMSCTP | ETH_TXQ_FLAGS_NOXSUMUDP | \
 		 ETH_TXQ_FLAGS_NOXSUMTCP)
+#define ETH_TXQ_FLAGS_IGNORE	0x8000
+	/**
+	 * When set the txq_flags should be ignored,
+	 * instead the 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.
+	 */
 /**
  * A structure used to configure a TX ring of an Ethernet port.
  */
@@ -730,6 +738,12 @@ struct rte_eth_txq_conf {
 
 	uint32_t txq_flags; /**< Set flags for the Tx queue */
 	uint8_t tx_deferred_start; /**< Do not start queue with rte_eth_dev_start(). */
+	uint64_t offloads;
+	/**
+	 * Enable Tx offloads using DEV_TX_OFFLOAD_* flags.
+	 * Supported only for devices which advertize the
+	 * RTE_ETH_DEV_TXQ_OFFLOAD capability.
+	 */
 };
 
 /**
@@ -954,6 +968,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
+/**< multi segment send is supported. */
 
 struct rte_pci_device;
 
@@ -1750,6 +1766,8 @@ struct rte_eth_dev_data {
 #define RTE_ETH_DEV_INTR_RMV     0x0008
 /** Device supports the rte_eth_rxq_conf offloads API */
 #define RTE_ETH_DEV_RXQ_OFFLOAD 0x0010
+/** Device supports the rte_eth_txq_conf offloads API */
+#define RTE_ETH_DEV_TXQ_OFFLOAD 0x0020
 
 /**
  * @internal
@@ -2011,12 +2029,18 @@ 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 obsoleted 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.
  * @return
  *   - 0: Success, the transmit queue is correctly set up.
  *   - -ENOMEM: Unable to allocate the transmit ring descriptors.
+ *   - -ENOTSUP: Device not support the queue configuration.
  */
 int rte_eth_tx_queue_setup(uint8_t port_id, uint16_t tx_queue_id,
 		uint16_t nb_tx_desc, unsigned int socket_id,
-- 
2.12.0

  parent reply	other threads:[~2017-09-04  7:12 UTC|newest]

Thread overview: 134+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-04  7:12 [dpdk-dev] [PATCH 0/4] ethdev new " Shahaf Shuler
2017-09-04  7:12 ` [dpdk-dev] [PATCH 1/4] ethdev: rename Rx and Tx configuration structs Shahaf Shuler
2017-09-04 12:06   ` Ananyev, Konstantin
2017-09-04 12:45     ` Shahaf Shuler
2017-09-04  7:12 ` [dpdk-dev] [PATCH 2/4] ethdev: introduce Rx queue offloads API Shahaf Shuler
2017-09-04  7:12 ` Shahaf Shuler [this message]
2017-09-04  7:12 ` [dpdk-dev] [PATCH 4/4] ethdev: add helpers to move to the new " Shahaf Shuler
2017-09-04 12:13   ` Ananyev, Konstantin
2017-09-04 13:25   ` Ananyev, Konstantin
2017-09-04 13:53     ` Thomas Monjalon
2017-09-04 14:18       ` Ananyev, Konstantin
2017-09-05  7:48         ` Thomas Monjalon
2017-09-05  8:09           ` Ananyev, Konstantin
2017-09-05 10:51             ` Shahaf Shuler
2017-09-05 13:50               ` Thomas Monjalon
2017-09-05 15:31               ` Ananyev, Konstantin
2017-09-06  6:01                 ` Shahaf Shuler
2017-09-06  9:33                   ` Ananyev, Konstantin
2017-09-13  9:27                     ` Thomas Monjalon
2017-09-13 11:16                       ` Shahaf Shuler
2017-09-13 12:41                         ` Thomas Monjalon
2017-09-13 12:56                           ` Ananyev, Konstantin
2017-09-13 13:20                             ` Thomas Monjalon
2017-09-13 21:42                               ` Ananyev, Konstantin
2017-09-14  8:02                                 ` Thomas Monjalon
2017-09-18 10:31                                   ` Bruce Richardson
2017-09-18 10:57                                     ` Ananyev, Konstantin
2017-09-18 11:04                                       ` Bruce Richardson
2017-09-18 11:27                                         ` Thomas Monjalon
2017-09-18 11:04                                       ` Bruce Richardson
2017-09-18 11:11                                         ` Ananyev, Konstantin
2017-09-18 11:32                                           ` Thomas Monjalon
2017-09-18 11:37                                             ` Bruce Richardson
2017-09-18 14:27                                               ` Shahaf Shuler
2017-09-18 14:42                                                 ` Thomas Monjalon
2017-09-18 14:44                                                 ` Bruce Richardson
2017-09-18 18:18                                                   ` Shahaf Shuler
2017-09-18 21:08                                                     ` Thomas Monjalon
2017-09-19  7:33                                                       ` Shahaf Shuler
2017-09-19  7:56                                                         ` Thomas Monjalon
2017-09-13 12:56                           ` Shahaf Shuler
2017-09-04 14:02     ` Shahaf Shuler
2017-09-04 15:55       ` Ananyev, Konstantin
2017-09-10 12:07 ` [dpdk-dev] [PATCH v2 0/2] ethdev " Shahaf Shuler
2017-09-10 12:07   ` [dpdk-dev] [PATCH v2 1/2] ethdev: introduce Rx queue " Shahaf Shuler
2017-09-10 12:07   ` [dpdk-dev] [PATCH v2 2/2] ethdev: introduce Tx " Shahaf Shuler
2017-09-10 17:48     ` Stephen Hemminger
2017-09-11  5:52       ` Shahaf Shuler
2017-09-11  6:21         ` Jerin Jacob
2017-09-11  7:56           ` Shahaf Shuler
2017-09-11  8:06             ` Jerin Jacob
2017-09-11  8:46               ` Shahaf Shuler
2017-09-11  9:05                 ` Jerin Jacob
2017-09-11 11:02                   ` Ananyev, Konstantin
2017-09-12  4:01                     ` Jerin Jacob
2017-09-12  5:25                       ` Shahaf Shuler
2017-09-12  5:51                         ` Jerin Jacob
2017-09-12  6:35                           ` Shahaf Shuler
2017-09-12  6:46                             ` Andrew Rybchenko
2017-09-12  7:17                             ` Jerin Jacob
2017-09-12  8:03                               ` Shahaf Shuler
2017-09-12 10:27                                 ` Andrew Rybchenko
2017-09-12 14:26                                   ` Ananyev, Konstantin
2017-09-12 14:36                                     ` Jerin Jacob
2017-09-12 14:43                                       ` Andrew Rybchenko
2017-09-12  6:43                           ` Andrew Rybchenko
2017-09-12  6:59                             ` Shahaf Shuler
2017-09-11  8:03     ` Andrew Rybchenko
2017-09-11 12:27       ` Shahaf Shuler
2017-09-11 13:10         ` Andrew Rybchenko
2017-09-13  6:37   ` [dpdk-dev] [PATCH v3 0/2] ethdev new " Shahaf Shuler
2017-09-13  6:37     ` [dpdk-dev] [PATCH v3 1/2] ethdev: introduce Rx queue " Shahaf Shuler
2017-09-13  8:13       ` Andrew Rybchenko
2017-09-13 12:49         ` Shahaf Shuler
2017-09-13  8:49       ` Andrew Rybchenko
2017-09-13  9:13         ` Andrew Rybchenko
2017-09-13 12:33           ` Shahaf Shuler
2017-09-13 12:34             ` Andrew Rybchenko
2017-09-13  6:37     ` [dpdk-dev] [PATCH v3 2/2] ethdev: introduce Tx " Shahaf Shuler
2017-09-13  8:40       ` Andrew Rybchenko
2017-09-13 12:51         ` Shahaf Shuler
2017-09-13  9:10     ` [dpdk-dev] [PATCH v3 0/2] ethdev new " Andrew Rybchenko
2017-09-17  6:54     ` [dpdk-dev] [PATCH v4 0/3] " Shahaf Shuler
2017-09-17  6:54       ` [dpdk-dev] [PATCH v4 1/3] ethdev: introduce Rx queue " Shahaf Shuler
2017-09-17  6:54       ` [dpdk-dev] [PATCH v4 2/3] ethdev: introduce Tx " Shahaf Shuler
2017-09-18  7:50         ` Andrew Rybchenko
2017-09-17  6:54       ` [dpdk-dev] [PATCH v4 3/3] doc: add details on ethdev " Shahaf Shuler
2017-09-18  7:51         ` Andrew Rybchenko
2017-09-18 13:40         ` Mcnamara, John
2017-09-18  7:51       ` [dpdk-dev] [PATCH v4 0/3] ethdev new " Andrew Rybchenko
2017-09-28 18:54       ` [dpdk-dev] [PATCH v5 " Shahaf Shuler
2017-09-28 18:54         ` [dpdk-dev] [PATCH v5 1/3] ethdev: introduce Rx queue " Shahaf Shuler
2017-10-03  0:32           ` Ferruh Yigit
2017-10-03  6:25             ` Shahaf Shuler
2017-10-03 19:46               ` Ferruh Yigit
2017-09-28 18:54         ` [dpdk-dev] [PATCH v5 2/3] ethdev: introduce Tx " Shahaf Shuler
2017-10-03 19:50           ` Ferruh Yigit
2017-10-04  8:06             ` Shahaf Shuler
2017-09-28 18:54         ` [dpdk-dev] [PATCH v5 3/3] doc: add details on ethdev " Shahaf Shuler
2017-10-04  8:17         ` [dpdk-dev] [PATCH v6 0/4] ethdev new " Shahaf Shuler
2017-10-04  8:17           ` [dpdk-dev] [PATCH v6 1/4] ethdev: introduce Rx queue " Shahaf Shuler
2017-10-04  8:17           ` [dpdk-dev] [PATCH v6 2/4] ethdev: introduce Tx " Shahaf Shuler
2017-10-04  8:18           ` [dpdk-dev] [PATCH v6 3/4] ethdev: add mbuf fast free Tx offload Shahaf Shuler
2017-10-04  8:18           ` [dpdk-dev] [PATCH v6 4/4] doc: add details on ethdev offloads API Shahaf Shuler
2017-10-04 13:46             ` Mcnamara, John
2018-03-15  1:58             ` Patil, Harish
2018-03-15  6:05               ` Shahaf Shuler
2018-03-16 15:51             ` [dpdk-dev] [PATCH] doc: update new ethdev offload API description Ferruh Yigit
2018-03-17  0:16               ` Patil, Harish
2018-03-18  5:52               ` Shahaf Shuler
2018-03-21  9:47               ` Andrew Rybchenko
2018-03-21 10:54                 ` Ferruh Yigit
2018-03-21 11:08                   ` Andrew Rybchenko
2018-03-21 11:10                     ` Shahaf Shuler
2018-03-21 11:19                       ` Andrew Rybchenko
2018-03-21 11:23                         ` Shahaf Shuler
2018-03-21 11:37                           ` Andrew Rybchenko
2018-03-21 11:40                             ` Shahaf Shuler
2018-03-21 12:52                               ` Ferruh Yigit
2018-03-21 13:06                                 ` Shahaf Shuler
2018-03-21 13:11                                   ` Ananyev, Konstantin
2018-03-21 12:03                             ` Ananyev, Konstantin
2018-03-21 12:29                               ` Shahaf Shuler
2018-03-21 12:34                               ` Andrew Rybchenko
2018-03-21 12:37                                 ` Ananyev, Konstantin
2018-03-21 14:08                   ` Thomas Monjalon
2018-03-21 14:28                     ` Ferruh Yigit
2018-03-21 14:40                       ` Thomas Monjalon
2018-03-21 15:26                         ` Bruce Richardson
2018-03-21 15:29                           ` Shahaf Shuler
2018-03-21 15:44                             ` Bruce Richardson
2018-05-08 12:33               ` Ferruh Yigit
2017-10-04 16:12           ` [dpdk-dev] [PATCH v6 0/4] ethdev new offloads API Ananyev, Konstantin
2017-10-05  0:55             ` Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a6ebb680e5d42039664fce918919555de66ed5c5.1504508375.git.shahafs@mellanox.com \
    --to=shahafs@mellanox.com \
    --cc=dev@dpdk.org \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).