From: Shahaf Shuler Date: Wed, 4 Oct 2017 08:18:00 +0000 (+0300) Subject: ethdev: add mbuf fast free Tx offload X-Git-Tag: spdx-start~1802 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=d6f90afd307053277b2ed130f65f890be742fe4e;p=dpdk.git ethdev: add mbuf fast free Tx offload 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. Signed-off-by: Shahaf Shuler Reviewed-by: Andrew Rybchenko Acked-by: Konstantin Ananyev --- diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst index 17745dace0..6538470ac7 100644 --- a/doc/guides/nics/features.rst +++ b/doc/guides/nics/features.rst @@ -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 -------- diff --git a/doc/guides/nics/features/default.ini b/doc/guides/nics/features/default.ini index 5424306964..9a59901955 100644 --- a/doc/guides/nics/features/default.ini +++ b/doc/guides/nics/features/default.ini @@ -75,3 +75,4 @@ x86-64 = Usage doc = Design doc = Perf doc = +Mbuf fast free = diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index 856a54a8ef..59756dd822 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -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; } diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h index da91f87405..78de045ed9 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -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;