ethdev: Reject conflicting TX offloads configuration
PATCH 1/1 ethdev: Reject conflicting TX offloads configuration
When an ethdev port is configured for fast mbuf release, the driver can use a TX burst function relying on the fast mbuf release preconditions. Thus, also configuring this port or a queue on the port for transmitting segmented packets is prohibited.
Checks for these conflicting configurations have been added to the ethdev library, so the drivers don't have to implement them.
Also, the descriptions of the RX and TX offloads have been improved, to reflect that they are not only for device capability reporting, but also for device and queue configuration purposes.
--- lib/ethdev/rte_ethdev.c | 38 ++++++++++++++++++++++++++++++++++++++ lib/ethdev/rte_ethdev.h | 20 ++++++++++---------- 2 files changed, 48 insertions(+), 10 deletions(-)
lib/ethdev/rte_ethdev.c +38 -0
@@ -1531,6 +1531,18 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q, goto rollback; } +/* MBUF_FAST_FREE preconditions conflict with MULTI_SEGS support. */ +if ((dev_conf->txmode.offloads &RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE ) && + (dev_conf->txmode.offloads &RTE_ETH_TX_OFFLOAD_MULTI_SEGS )) { +RTE_ETHDEV_LOG_LINE (ERR , +"Ethdev port_id=%d Tx offload %s conflicts with Tx offload %s" , + port_id, +rte_eth_dev_tx_offload_name (RTE_ETH_TX_OFFLOAD_MULTI_SEGS ), +rte_eth_dev_tx_offload_name (RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE )); + ret = -EINVAL ; + goto rollback; + } + dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf =rte_eth_rss_hf_refine (dev_conf->rx_adv_conf.rss_conf.rss_hf);
@@ -2709,6 +2721,32 @@ rte_eth_tx_queue_setup(uint16_t port_id, uint16_t tx_queue_id,return -EINVAL ; } +/* +* If the driver uses a Tx function with MBUF_FAST_FREE preconditions, +* per-queue MULTI_SEGS support is not possible. +*/ +if ((dev->data->dev_conf.txmode.offloads &RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE ) && + (local_conf.offloads &RTE_ETH_TX_OFFLOAD_MULTI_SEGS )) { +RTE_ETHDEV_LOG_LINE (ERR , +"Ethdev port_id=%d tx_queue_id=%d, Tx offload %s conflicts with per-port Tx offload %s" , + port_id, tx_queue_id, +rte_eth_dev_tx_offload_name (RTE_ETH_TX_OFFLOAD_MULTI_SEGS ), +rte_eth_dev_tx_offload_name (RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE )); +return -EINVAL ; + } +/* +* If the driver uses a Tx function with MULTI_SEGS support, +* runtime support for per-queue MBUF_FAST_FREE optimization depends on the driver. +*/ +if ((dev->data->dev_conf.txmode.offloads &RTE_ETH_TX_OFFLOAD_MULTI_SEGS ) && + (local_conf.offloads &RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE )) +RTE_ETHDEV_LOG_LINE (DEBUG , +"Ethdev port_id=%d tx_queue_id=%d, Tx offload %s potential conflict with per-port Tx offload %s, " +"runtime support depends on the driver" , + port_id, tx_queue_id, +rte_eth_dev_tx_offload_name (RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE ), +rte_eth_dev_tx_offload_name (RTE_ETH_TX_OFFLOAD_MULTI_SEGS )); +rte_ethdev_trace_txq_setup (port_id, tx_queue_id, nb_tx_desc, tx_conf);return eth_err (port_id, dev->dev_ops->tx_queue_setup (dev, tx_queue_id, nb_tx_desc, socket_id, &local_conf));
lib/ethdev/rte_ethdev.h +10 -10
@@ -1550,7 +1550,7 @@ struct rte_eth_conf { };/** -* Rx offload capabilities of a device. +* Rx offload capabilities/configuration of a device or queue. */ #define RTE_ETH_RX_OFFLOAD_VLAN_STRIP RTE_BIT64(0)#define RTE_ETH_RX_OFFLOAD_IPV4_CKSUM RTE_BIT64(1)
@@ -1585,12 +1585,12 @@ struct rte_eth_conf { RTE_ETH_RX_OFFLOAD_QINQ_STRIP)/* -* If new Rx offload capabilities are defined, they also must be +* If new Rx offloads are defined, they also must be * mentioned in rte_rx_offload_names in rte_ethdev.c file. */ /** -* Tx offload capabilities of a device. +* Tx offload capabilities/configuration of a device or queue. */ #define RTE_ETH_TX_OFFLOAD_VLAN_INSERT RTE_BIT64(0)#define RTE_ETH_TX_OFFLOAD_IPV4_CKSUM RTE_BIT64(1)
@@ -1611,10 +1611,10 @@ struct rte_eth_conf {* Tx queue without SW lock. */ #define RTE_ETH_TX_OFFLOAD_MT_LOCKFREE RTE_BIT64(14) -/** Device supports multi segment send. */ +/** Multi segment send. */ #define RTE_ETH_TX_OFFLOAD_MULTI_SEGS RTE_BIT64(15)/** -* Device supports optimization for fast release of mbufs. +* Optimization for fast release of mbufs. * When set application must guarantee that per-queue all mbufs come from the same mempool, * are direct, have refcnt=1, next=NULL and nb_segs=1, as done by rte_pktmbuf_prefree_seg(). *
@@ -1623,27 +1623,27 @@ struct rte_eth_conf {#define RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE RTE_BIT64(16)#define RTE_ETH_TX_OFFLOAD_SECURITY RTE_BIT64(17)/** -* Device supports generic UDP tunneled packet TSO. +* Generic UDP tunneled packet TSO. * Application must set RTE_MBUF_F_TX_TUNNEL_UDP and other mbuf fields required * for tunnel TSO. */ #define RTE_ETH_TX_OFFLOAD_UDP_TNL_TSO RTE_BIT64(18)/** -* Device supports generic IP tunneled packet TSO. +* Generic IP tunneled packet TSO. * Application must set RTE_MBUF_F_TX_TUNNEL_IP and other mbuf fields required * for tunnel TSO. */ #define RTE_ETH_TX_OFFLOAD_IP_TNL_TSO RTE_BIT64(19) -/** Device supports outer UDP checksum */ +/** Outer UDP checksum. Used for tunneling packet. */ #define RTE_ETH_TX_OFFLOAD_OUTER_UDP_CKSUM RTE_BIT64(20)/** -* Device sends on time read from RTE_MBUF_DYNFIELD_TIMESTAMP_NAME +* Send on time read from RTE_MBUF_DYNFIELD_TIMESTAMP_NAME * if RTE_MBUF_DYNFLAG_TX_TIMESTAMP_NAME is set in ol_flags. * The mbuf field and flag are registered when the offload is configured. */ #define RTE_ETH_TX_OFFLOAD_SEND_ON_TIMESTAMP RTE_BIT64(21)/* -* If new Tx offload capabilities are defined, they also must be +* If new Tx offloads are defined, they also must be * mentioned in rte_tx_offload_names in rte_ethdev.c file. */
Signature · 1 line
2.43.0
Quoted 7 lines · Morten Brørup
When an ethdev port is configured for fast mbuf release, the driver can use a TX burst function relying on the fast mbuf release preconditions. Thus, also configuring this port or a queue on the port for transmitting segmented packets is prohibited.
Checks for these conflicting configurations have been added to the ethdev library, so the drivers don't have to implement them.
Quoted 6 lines
Also, the descriptions of the RX and TX offloads have been improved, to reflect that they are not only for device capability reporting, but also for device and queue configuration purposes.
Signed-off-by Morten Brørup <[email protected]>---
Maybe split into two patches, so the offload descriptions are separate from the conflict checks.
Andrew Rybchenko
Acked-byQuoted 12 lines · Bruce Richardson
Quoted 11 lines · Morten Brørup
When an ethdev port is configured for fast mbuf release, the driver can use a TX burst function relying on the fast mbuf release preconditions. Thus, also configuring this port or a queue on the port for transmitting segmented packets is prohibited.
Checks for these conflicting configurations have been added to the ethdev library, so the drivers don't have to implement them.Also, the descriptions of the RX and TX offloads have been improved, to reflect that they are not only for device capability reporting, but also for device and queue configuration purposes.
Quoted 5 lines
Quoted 2 lines
Signed-off-by Morten Brørup <[email protected]>---
Maybe split into two patches, so the offload descriptions are separate from the conflict checks.
+1
Quoted 1 line
Acked-by Bruce Richardson <[email protected]>
Hi Morten,
Quoted 22 lines · Morten Brørup
When an ethdev port is configured for fast mbuf release, the driver can use a TX burst function relying on the fast mbuf release preconditions. Thus, also configuring this port or a queue on the port for transmitting segmented packets is prohibited.
Checks for these conflicting configurations have been added to the ethdev library, so the drivers don't have to implement them.Also, the descriptions of the RX and TX offloads have been improved, to reflect that they are not only for device capability reporting, but also for device and queue configuration purposes.
Signed-off-by Morten Brørup <[email protected]>---
lib/ethdev/rte_ethdev.c| 38 ++++++++++++++++++++++++++++++++++++++lib/ethdev/rte_ethdev.h| 20 ++++++++++----------2 files changed, 48 insertions(+), 10 deletions(-)lib/ethdev/rte_ethdev.c +0
-0
lib/ethdev/rte_ethdev.c rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q, · line 1538
Quoted 8 lines
lib/ethdev/rte_ethdev.c +5
-0@@ -1531,6 +1531,18 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q, goto rollback; } +/* MBUF_FAST_FREE preconditions conflict with MULTI_SEGS support. */ +if ((dev_conf->txmode.offloads &RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE ) && + (dev_conf->txmode.offloads &RTE_ETH_TX_OFFLOAD_MULTI_SEGS )) { + RTE_ETHDEV_LOG_LINE(ERR, + "Ethdev port_id=%d Tx offload %s conflicts with Tx offload %s",
Is it required to spell 'Ethdev ' at start of the line? It was my impression that 'ethdev' would be printed anyway by [1] (the '# t' part). Am I wrong?
[1] https://github.com/DPDK/dpdk/blob/b222395561638f89562e4ef42e1eabf2d6db43dd/lib/log/rte_log.h#L334
Thank you.
Quoted 121 lines
lib/ethdev/rte_ethdev.c +33
-0+ port_id, +rte_eth_dev_tx_offload_name (RTE_ETH_TX_OFFLOAD_MULTI_SEGS ), + rte_eth_dev_tx_offload_name(RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE)); + ret = -EINVAL ; + goto rollback; + } + dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf =rte_eth_rss_hf_refine (dev_conf->rx_adv_conf.rss_conf.rss_hf);@@ -2709,6 +2721,32 @@ rte_eth_tx_queue_setup(uint16_t port_id, uint16_t tx_queue_id,return -EINVAL ; } +/* +* If the driver uses a Tx function with MBUF_FAST_FREE preconditions, +* per-queue MULTI_SEGS support is not possible. +*/ +if ((dev->data->dev_conf.txmode.offloads &RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE ) && + (local_conf.offloads &RTE_ETH_TX_OFFLOAD_MULTI_SEGS )) { +RTE_ETHDEV_LOG_LINE (ERR , +"Ethdev port_id=%d tx_queue_id=%d, Tx offload %s conflicts with per-port Tx offload %s" , + port_id, tx_queue_id, +rte_eth_dev_tx_offload_name (RTE_ETH_TX_OFFLOAD_MULTI_SEGS ), +rte_eth_dev_tx_offload_name (RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE )); +return -EINVAL ; + } +/* +* If the driver uses a Tx function with MULTI_SEGS support, +* runtime support for per-queue MBUF_FAST_FREE optimization depends on the driver. +*/ +if ((dev->data->dev_conf.txmode.offloads &RTE_ETH_TX_OFFLOAD_MULTI_SEGS ) && + (local_conf.offloads &RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE )) +RTE_ETHDEV_LOG_LINE (DEBUG , +"Ethdev port_id=%d tx_queue_id=%d, Tx offload %s potential conflict with per-port Tx offload %s, " +"runtime support depends on the driver" , + port_id, tx_queue_id, +rte_eth_dev_tx_offload_name (RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE ), +rte_eth_dev_tx_offload_name (RTE_ETH_TX_OFFLOAD_MULTI_SEGS )); +rte_ethdev_trace_txq_setup (port_id, tx_queue_id, nb_tx_desc, tx_conf);return eth_err (port_id, dev->dev_ops->tx_queue_setup (dev, tx_queue_id, nb_tx_desc, socket_id, &local_conf));lib/ethdev/rte_ethdev.h +10
-10@@ -1550,7 +1550,7 @@ struct rte_eth_conf { };/** -* Rx offload capabilities of a device. +* Rx offload capabilities/configuration of a device or queue. */ #define RTE_ETH_RX_OFFLOAD_VLAN_STRIP RTE_BIT64(0)#define RTE_ETH_RX_OFFLOAD_IPV4_CKSUM RTE_BIT64(1)@@ -1585,12 +1585,12 @@ struct rte_eth_conf { RTE_ETH_RX_OFFLOAD_QINQ_STRIP)/* -* If new Rx offload capabilities are defined, they also must be +* If new Rx offloads are defined, they also must be * mentioned in rte_rx_offload_names in rte_ethdev.c file. */ /** -* Tx offload capabilities of a device. +* Tx offload capabilities/configuration of a device or queue. */ #define RTE_ETH_TX_OFFLOAD_VLAN_INSERT RTE_BIT64(0)#define RTE_ETH_TX_OFFLOAD_IPV4_CKSUM RTE_BIT64(1)@@ -1611,10 +1611,10 @@ struct rte_eth_conf {* Tx queue without SW lock. */ #define RTE_ETH_TX_OFFLOAD_MT_LOCKFREE RTE_BIT64(14) -/** Device supports multi segment send. */ +/** Multi segment send. */ #define RTE_ETH_TX_OFFLOAD_MULTI_SEGS RTE_BIT64(15)/** -* Device supports optimization for fast release of mbufs. +* Optimization for fast release of mbufs. * When set application must guarantee that per-queue all mbufs come from the same mempool, * are direct, have refcnt=1, next=NULL and nb_segs=1, as done by rte_pktmbuf_prefree_seg(). * @@ -1623,27 +1623,27 @@ struct rte_eth_conf {#define RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE RTE_BIT64(16)#define RTE_ETH_TX_OFFLOAD_SECURITY RTE_BIT64(17)/** -* Device supports generic UDP tunneled packet TSO. +* Generic UDP tunneled packet TSO. * Application must set RTE_MBUF_F_TX_TUNNEL_UDP and other mbuf fields required * for tunnel TSO. */ #define RTE_ETH_TX_OFFLOAD_UDP_TNL_TSO RTE_BIT64(18)/** -* Device supports generic IP tunneled packet TSO. +* Generic IP tunneled packet TSO. * Application must set RTE_MBUF_F_TX_TUNNEL_IP and other mbuf fields required * for tunnel TSO. */ #define RTE_ETH_TX_OFFLOAD_IP_TNL_TSO RTE_BIT64(19) -/** Device supports outer UDP checksum */ +/** Outer UDP checksum. Used for tunneling packet. */ #define RTE_ETH_TX_OFFLOAD_OUTER_UDP_CKSUM RTE_BIT64(20)/** -* Device sends on time read from RTE_MBUF_DYNFIELD_TIMESTAMP_NAME +* Send on time read from RTE_MBUF_DYNFIELD_TIMESTAMP_NAME * if RTE_MBUF_DYNFLAG_TX_TIMESTAMP_NAME is set in ol_flags. * The mbuf field and flag are registered when the offload is configured. */ #define RTE_ETH_TX_OFFLOAD_SEND_ON_TIMESTAMP RTE_BIT64(21)/* -* If new Tx offload capabilities are defined, they also must be +* If new Tx offloads are defined, they also must be * mentioned in rte_tx_offload_names in rte_ethdev.c file. */ Signature · 1 line
2.43.0
Quoted 11 lines
From: Ivan Malov [mailto:[email protected]]
Sent: Thursday, 31 July 2025 11.28Hi Morten,
Review
Quoted 2 lines · Morten Brørup
(quoted diff) +2
-0+ RTE_ETHDEV_LOG_LINE(ERR, + "Ethdev port_id=%d Tx offload %s conflicts with Tx offload%s",
Quoted 6 lines
Is it required to spell 'Ethdev ' at start of the line? It was my impression that 'ethdev' would be printed anyway by [1] (the '# t' part). Am I wrong?
[1]
https://github.com/DPDK/dpdk/blob/b222395561638f89562e4ef42e1eabf2d6db43dd/lib
/log/rte_log.h#L334
You are right, but all the other RTE_ETHDEV_LOG_LINE() in rte_eth_dev_configure() do it, so I did it too.
Quoted 138 lines
When an ethdev port is configured for fast mbuf release, the driver can use a TX burst function relying on the fast mbuf release preconditions. Thus, also configuring this port or a queue on the port for transmitting segmented packets is prohibited.
Checks for these conflicting configurations have been added to the ethdev library, so the drivers don't have to implement them.Also, the descriptions of the RX and TX offloads have been improved, to reflect that they are not only for device capability reporting, but also for device and queue configuration purposes.
Signed-off-by Morten Brørup <[email protected]>--- lib/ethdev/rte_ethdev.c | 38 ++++++++++++++++++++++++++++++++++++++ lib/ethdev/rte_ethdev.h | 20 ++++++++++---------- 2 files changed, 48 insertions(+), 10 deletions(-)lib/ethdev/rte_ethdev.c +38
-0@@ -1531,6 +1531,18 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q, goto rollback; } +/* MBUF_FAST_FREE preconditions conflict with MULTI_SEGS support. */ +if ((dev_conf->txmode.offloads &RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE ) && + (dev_conf->txmode.offloads &RTE_ETH_TX_OFFLOAD_MULTI_SEGS )) { +RTE_ETHDEV_LOG_LINE (ERR , +"Ethdev port_id=%d Tx offload %s conflicts with Tx offload %s" , + port_id, +rte_eth_dev_tx_offload_name (RTE_ETH_TX_OFFLOAD_MULTI_SEGS ), +rte_eth_dev_tx_offload_name (RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE )); + ret = -EINVAL ; + goto rollback; + } + dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf =rte_eth_rss_hf_refine (dev_conf->rx_adv_conf.rss_conf.rss_hf);@@ -2709,6 +2721,32 @@ rte_eth_tx_queue_setup(uint16_t port_id, uint16_t tx_queue_id,return -EINVAL ; } +/* +* If the driver uses a Tx function with MBUF_FAST_FREE preconditions, +* per-queue MULTI_SEGS support is not possible. +*/ +if ((dev->data->dev_conf.txmode.offloads &RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE ) && + (local_conf.offloads &RTE_ETH_TX_OFFLOAD_MULTI_SEGS )) { +RTE_ETHDEV_LOG_LINE (ERR , +"Ethdev port_id=%d tx_queue_id=%d, Tx offload %s conflicts with per-port Tx offload %s" , + port_id, tx_queue_id, +rte_eth_dev_tx_offload_name (RTE_ETH_TX_OFFLOAD_MULTI_SEGS ), +rte_eth_dev_tx_offload_name (RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE )); +return -EINVAL ; + } +/* +* If the driver uses a Tx function with MULTI_SEGS support, +* runtime support for per-queue MBUF_FAST_FREE optimization depends on the driver. +*/ +if ((dev->data->dev_conf.txmode.offloads &RTE_ETH_TX_OFFLOAD_MULTI_SEGS ) && + (local_conf.offloads &RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE )) +RTE_ETHDEV_LOG_LINE (DEBUG , +"Ethdev port_id=%d tx_queue_id=%d, Tx offload %s potential conflict with per-port Tx offload %s, " +"runtime support depends on the driver" , + port_id, tx_queue_id, +rte_eth_dev_tx_offload_name (RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE ), +rte_eth_dev_tx_offload_name (RTE_ETH_TX_OFFLOAD_MULTI_SEGS )); +rte_ethdev_trace_txq_setup (port_id, tx_queue_id, nb_tx_desc, tx_conf);return eth_err (port_id, dev->dev_ops->tx_queue_setup (dev, tx_queue_id, nb_tx_desc, socket_id, &local_conf));lib/ethdev/rte_ethdev.h +8
-9@@ -1550,7 +1550,7 @@ struct rte_eth_conf { };/** -* Rx offload capabilities of a device. +* Rx offload capabilities/configuration of a device or queue. */ #define RTE_ETH_RX_OFFLOAD_VLAN_STRIP RTE_BIT64(0)#define RTE_ETH_RX_OFFLOAD_IPV4_CKSUM RTE_BIT64(1)@@ -1585,12 +1585,12 @@ struct rte_eth_conf { RTE_ETH_RX_OFFLOAD_QINQ_STRIP)/* -* If new Rx offload capabilities are defined, they also must be +* If new Rx offloads are defined, they also must be * mentioned in rte_rx_offload_names in rte_ethdev.c file. */ /** -* Tx offload capabilities of a device. +* Tx offload capabilities/configuration of a device or queue. */ #define RTE_ETH_TX_OFFLOAD_VLAN_INSERT RTE_BIT64(0)#define RTE_ETH_TX_OFFLOAD_IPV4_CKSUM RTE_BIT64(1)@@ -1611,10 +1611,10 @@ struct rte_eth_conf {* Tx queue without SW lock. */ #define RTE_ETH_TX_OFFLOAD_MT_LOCKFREE RTE_BIT64(14) -/** Device supports multi segment send. */ +/** Multi segment send. */ #define RTE_ETH_TX_OFFLOAD_MULTI_SEGS RTE_BIT64(15)/** -* Device supports optimization for fast release of mbufs. +* Optimization for fast release of mbufs. * When set application must guarantee that per-queue all mbufs come from the same mempool, * are direct, have refcnt=1, next=NULL and nb_segs=1, as done by rte_pktmbuf_prefree_seg(). * @@ -1623,27 +1623,27 @@ struct rte_eth_conf {#define RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE RTE_BIT64(16)#define RTE_ETH_TX_OFFLOAD_SECURITY RTE_BIT64(17)/** -* Device supports generic UDP tunneled packet TSO. +* Generic UDP tunneled packet TSO. * Application must set RTE_MBUF_F_TX_TUNNEL_UDP and other mbuf fields required * for tunnel TSO. */ #define RTE_ETH_TX_OFFLOAD_UDP_TNL_TSO RTE_BIT64(18)/** -* Device supports generic IP tunneled packet TSO. +* Generic IP tunneled packet TSO. * Application must set RTE_MBUF_F_TX_TUNNEL_IP and other mbuf fields required * for tunnel TSO. */ #define RTE_ETH_TX_OFFLOAD_IP_TNL_TSO RTE_BIT64(19) -/** Device supports outer UDP checksum */ +/** Outer UDP checksum. Used for tunneling packet. */ #define RTE_ETH_TX_OFFLOAD_OUTER_UDP_CKSUM RTE_BIT64(20)/** -* Device sends on time read from RTE_MBUF_DYNFIELD_TIMESTAMP_NAME
lib/ethdev/rte_ethdev.h struct rte_eth_conf { · line 1648
Quoted 10 lines
lib/ethdev/rte_ethdev.h +2
-1+* Send on time read from RTE_MBUF_DYNFIELD_TIMESTAMP_NAME * if RTE_MBUF_DYNFLAG_TX_TIMESTAMP_NAME is set in ol_flags. * The mbuf field and flag are registered when the offload is configured. */ #define RTE_ETH_TX_OFFLOAD_SEND_ON_TIMESTAMP RTE_BIT64(21)/* -* If new Tx offload capabilities are defined, they also must be +* If new Tx offloads are defined, they also must be * mentioned in rte_tx_offload_names in rte_ethdev.c file. */
Quoted 3 lines
lib/ethdev/rte_ethdev.h +0
-1--2.43.0
PATCH v2 1/3 testpmd: Do not enable mbuf fast release TX offload by default
In reply to Morten BrørupEnabling some offload by default may conflict with a manually configured offload.
Specifically, the mbuf fast release TX offload, which conflicts with multi segment packet TX offload, was enabled by default.
Therefore, mbuf fast release TX offload (the only TX offload which was enabled by default) is not enabled by default anymore.
--- app/test-pmd/testpmd.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-)
app/test-pmd/testpmd.c +1 -10
@@ -490,9 +490,7 @@ lcoreid_t latencystats_lcore_id = -1;*/ struct rte_eth_rxmode rx_mode; -struct rte_eth_txmode tx_mode = { - .offloads =RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE , -}; +struct rte_eth_txmode tx_mode;volatile int test_done =1 ;/* stop packet forwarding when set to 1. */
@@ -1592,10 +1590,6 @@ init_config_port_offloads(portid_t pid, uint32_t socket_id)if (ret !=0 )rte_exit (EXIT_FAILURE ,"rte_eth_dev_info_get() failed\n" ); -if (!(port->dev_info.tx_offload_capa &RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE )) - port->dev_conf.txmode.offloads &= - ~RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE ; -/* Apply Rx offloads configuration */ for (i =0 ; i < port->dev_info.max_rx_queues; i++) port->rxq[i].conf.offloads = port->dev_conf.rxmode.offloads;
@@ -2857,9 +2851,6 @@ update_bonding_port_dev_conf(portid_t bond_pid)return ; } -if (port->dev_info.tx_offload_capa &RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE ) - port->dev_conf.txmode.offloads |= -RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE ;/* Apply Tx offloads configuration */ for (i =0 ; i < port->dev_info.max_tx_queues; i++) port->txq[i].conf.offloads = port->dev_conf.txmode.offloads;
Signature · 1 line
2.43.0
PATCH v2 2/3 ethdev: Improve descriptions of RX and TX offloads
The descriptions of the RX and TX offloads have been improved, to reflect that they are not only for device capability reporting, but also for device and queue configuration purposes.
--- lib/ethdev/rte_ethdev.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
lib/ethdev/rte_ethdev.h +10 -10
@@ -1550,7 +1550,7 @@ struct rte_eth_conf { };/** -* Rx offload capabilities of a device. +* Rx offload capabilities/configuration of a device or queue. */ #define RTE_ETH_RX_OFFLOAD_VLAN_STRIP RTE_BIT64(0)#define RTE_ETH_RX_OFFLOAD_IPV4_CKSUM RTE_BIT64(1)
@@ -1585,12 +1585,12 @@ struct rte_eth_conf { RTE_ETH_RX_OFFLOAD_QINQ_STRIP)/* -* If new Rx offload capabilities are defined, they also must be +* If new Rx offloads are defined, they also must be * mentioned in rte_rx_offload_names in rte_ethdev.c file. */ /** -* Tx offload capabilities of a device. +* Tx offload capabilities/configuration of a device or queue. */ #define RTE_ETH_TX_OFFLOAD_VLAN_INSERT RTE_BIT64(0)#define RTE_ETH_TX_OFFLOAD_IPV4_CKSUM RTE_BIT64(1)
@@ -1611,10 +1611,10 @@ struct rte_eth_conf {* Tx queue without SW lock. */ #define RTE_ETH_TX_OFFLOAD_MT_LOCKFREE RTE_BIT64(14) -/** Device supports multi segment send. */ +/** Multi segment send. */ #define RTE_ETH_TX_OFFLOAD_MULTI_SEGS RTE_BIT64(15)/** -* Device supports optimization for fast release of mbufs. +* Optimization for fast release of mbufs. * When set application must guarantee that per-queue all mbufs come from the same mempool, * are direct, have refcnt=1, next=NULL and nb_segs=1, as done by rte_pktmbuf_prefree_seg(). *
@@ -1623,27 +1623,27 @@ struct rte_eth_conf {#define RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE RTE_BIT64(16)#define RTE_ETH_TX_OFFLOAD_SECURITY RTE_BIT64(17)/** -* Device supports generic UDP tunneled packet TSO. +* Generic UDP tunneled packet TSO. * Application must set RTE_MBUF_F_TX_TUNNEL_UDP and other mbuf fields required * for tunnel TSO. */ #define RTE_ETH_TX_OFFLOAD_UDP_TNL_TSO RTE_BIT64(18)/** -* Device supports generic IP tunneled packet TSO. +* Generic IP tunneled packet TSO. * Application must set RTE_MBUF_F_TX_TUNNEL_IP and other mbuf fields required * for tunnel TSO. */ #define RTE_ETH_TX_OFFLOAD_IP_TNL_TSO RTE_BIT64(19) -/** Device supports outer UDP checksum */ +/** Outer UDP checksum. Used for tunneling packet. */ #define RTE_ETH_TX_OFFLOAD_OUTER_UDP_CKSUM RTE_BIT64(20)/** -* Device sends on time read from RTE_MBUF_DYNFIELD_TIMESTAMP_NAME +* Send on time read from RTE_MBUF_DYNFIELD_TIMESTAMP_NAME * if RTE_MBUF_DYNFLAG_TX_TIMESTAMP_NAME is set in ol_flags. * The mbuf field and flag are registered when the offload is configured. */ #define RTE_ETH_TX_OFFLOAD_SEND_ON_TIMESTAMP RTE_BIT64(21)/* -* If new Tx offload capabilities are defined, they also must be +* If new Tx offloads are defined, they also must be * mentioned in rte_tx_offload_names in rte_ethdev.c file. */
Signature · 1 line
2.43.0
PATCH v2 3/3 ethdev: Reject conflicting TX offloads configuration
In reply to Morten BrørupWhen an ethdev port is configured for fast mbuf release, the driver can use a TX burst function relying on the fast mbuf release preconditions. Thus, also configuring this port or a queue on the port for transmitting segmented packets is prohibited.
Checks for these conflicting configurations have been added to the ethdev library, so the drivers don't have to implement them.
--- lib/ethdev/rte_ethdev.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+)
lib/ethdev/rte_ethdev.c +38 -0
@@ -1531,6 +1531,18 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q, goto rollback; } +/* MBUF_FAST_FREE preconditions conflict with MULTI_SEGS support. */ +if ((dev_conf->txmode.offloads &RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE ) && + (dev_conf->txmode.offloads &RTE_ETH_TX_OFFLOAD_MULTI_SEGS )) { +RTE_ETHDEV_LOG_LINE (ERR , +"Ethdev port_id=%d Tx offload %s conflicts with Tx offload %s" , + port_id, +rte_eth_dev_tx_offload_name (RTE_ETH_TX_OFFLOAD_MULTI_SEGS ), +rte_eth_dev_tx_offload_name (RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE )); + ret = -EINVAL ; + goto rollback; + } + dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf =rte_eth_rss_hf_refine (dev_conf->rx_adv_conf.rss_conf.rss_hf);
@@ -2709,6 +2721,32 @@ rte_eth_tx_queue_setup(uint16_t port_id, uint16_t tx_queue_id,return -EINVAL ; } +/* +* If the driver uses a Tx function with MBUF_FAST_FREE preconditions, +* per-queue MULTI_SEGS support is not possible. +*/ +if ((dev->data->dev_conf.txmode.offloads &RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE ) && + (local_conf.offloads &RTE_ETH_TX_OFFLOAD_MULTI_SEGS )) { +RTE_ETHDEV_LOG_LINE (ERR , +"Ethdev port_id=%d tx_queue_id=%d, Tx offload %s conflicts with per-port Tx offload %s" , + port_id, tx_queue_id, +rte_eth_dev_tx_offload_name (RTE_ETH_TX_OFFLOAD_MULTI_SEGS ), +rte_eth_dev_tx_offload_name (RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE )); +return -EINVAL ; + } +/* +* If the driver uses a Tx function with MULTI_SEGS support, +* runtime support for per-queue MBUF_FAST_FREE optimization depends on the driver. +*/ +if ((dev->data->dev_conf.txmode.offloads &RTE_ETH_TX_OFFLOAD_MULTI_SEGS ) && + (local_conf.offloads &RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE )) +RTE_ETHDEV_LOG_LINE (DEBUG , +"Ethdev port_id=%d tx_queue_id=%d, Tx offload %s potential conflict with per-port Tx offload %s, " +"runtime support depends on the driver" , + port_id, tx_queue_id, +rte_eth_dev_tx_offload_name (RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE ), +rte_eth_dev_tx_offload_name (RTE_ETH_TX_OFFLOAD_MULTI_SEGS )); +rte_ethdev_trace_txq_setup (port_id, tx_queue_id, nb_tx_desc, tx_conf);return eth_err (port_id, dev->dev_ops->tx_queue_setup (dev, tx_queue_id, nb_tx_desc, socket_id, &local_conf));
Signature · 1 line
2.43.0
Recheck-request: loongarch-unit-testing
lib/ethdev/rte_ethdev.c rte_eth_tx_queue_setup(uint16_t port_id, uint16_t tx_queue_id, · line 2745
Quoted 3 lines · On Thu, 31 Jul 2025 09:07:31 +0000 Morten Brørup <[email protected]>…
lib/ethdev/rte_ethdev.c +3
-0+ RTE_ETHDEV_LOG_LINE(DEBUG, + "Ethdev port_id=%d tx_queue_id=%d, Tx offload %s potential conflict with per-port Tx offload %s, " + "runtime support depends on the driver",
Shorten the message, and get it on one line.
When a message is so long it won't fit on one line, it is too verbose.
Hi,
Quoted 9 lines · Stephen Hemminger
lib/ethdev/rte_ethdev.c rte_eth_tx_queue_setup(uint16_t port_id, uint16_t tx_queue_id, · line 2745
Quoted 3 lines · On Thu, 31 Jul 2025 09:07:31 +0000 Morten Brørup <[email protected]>…
lib/ethdev/rte_ethdev.c +3
-0+ RTE_ETHDEV_LOG_LINE(DEBUG, + "Ethdev port_id=%d tx_queue_id=%d, Tx offload %s potential conflict with per-port Tx offload %s, " + "runtime support depends on the driver",Shorten the message, and get it on one line.
When a message is so long it won't fit on one line, it is too verbose.
I am not an expert in naming, but on the premise that 'ethdev' is already printed by 'RTE_ETHDEV_LOG_LINE', perhaps consider this variant:
"id=%d txq=%d offload clash %s vs dev %s: PMD to decide"
Thank you.
Quoted 1 line
Quoted 18 lines
From: Ivan Malov [mailto:[email protected]]
Sent: Saturday, 2 August 2025 23.34Hi,
Quoted 5 lines · Stephen Hemminger
Review
Quoted 2 lines · On Thu, 31 Jul 2025 09:07:31 +0000 Morten Brørup <[email protected]>…
(quoted diff) +2
-0+ RTE_ETHDEV_LOG_LINE(DEBUG, + "Ethdev port_id=%d tx_queue_id=%d, Tx offload %spotential conflict with per-port Tx offload %s, "
Quoted 4 lines
lib/ethdev/rte_ethdev.c rte_eth_tx_queue_setup(uint16_t port_id, uint16_t tx_queue_id, · line 2745
Quoted 1 line
lib/ethdev/rte_ethdev.c +1
-0+ "runtime support depends on the driver",Shorten the message, and get it on one line.
When a message is so long it won't fit on one line, it is too verbose.
Quoted 7 lines
I am not an expert in naming, but on the premise that 'ethdev' is already
printed by 'RTE_ETHDEV_LOG_LINE', perhaps consider this variant:"id=%d txq=%d offload clash %s vs dev %s: PMD to decide"
Thank you.
Ivan's suggestion is good, but this file has plenty of long (and even multi-line) log messages, e.g. [1]:
if ((local_conf.offloads & dev_info.tx_queue_offload_capa) !=
local_conf.offloads) {
RTE_ETHDEV_LOG_LINE(ERR,
"Ethdev port_id=%d tx_queue_id=%d, new added offloads 0x%"PRIx64" must be "
"within per-queue offload capabilities 0x%"PRIx64" in %s()",
port_id, tx_queue_id, local_conf.offloads,
dev_info.tx_queue_offload_capa,
__func__);
return -EINVAL;
}[1]: https://elixir.bootlin.com/dpdk/v25.07/source/lib/ethdev/rte_ethdev.c#L2703
Which do you prefer:
a) Follow the local coding style for log messages, or
b) Follow our general coding style, and log as Ivan suggested?
Quoted 39 lines · On Sun, 3 Aug 2025 12:51:59 +0200 Morten Brørup <[email protected]>…
Quoted 18 lines
From: Ivan Malov [mailto:[email protected]]
Sent: Saturday, 2 August 2025 23.34Hi,
Quoted 5 lines · Stephen Hemminger
Review
Quoted 2 lines · On Thu, 31 Jul 2025 09:07:31 +0000 Morten Brørup <[email protected]>…
(quoted diff) +2
-0+ RTE_ETHDEV_LOG_LINE(DEBUG, + "Ethdev port_id=%d tx_queue_id=%d, Tx offload %spotential conflict with per-port Tx offload %s, "
Quoted 4 lines
lib/ethdev/rte_ethdev.c rte_eth_tx_queue_setup(uint16_t port_id, uint16_t tx_queue_id, · line 2745
Quoted 1 line
lib/ethdev/rte_ethdev.c +1
-0+ "runtime support depends on the driver",Shorten the message, and get it on one line.
When a message is so long it won't fit on one line, it is too verbose.Quoted 7 lines
I am not an expert in naming, but on the premise that 'ethdev' is already
printed by 'RTE_ETHDEV_LOG_LINE', perhaps consider this variant:"id=%d txq=%d offload clash %s vs dev %s: PMD to decide"
Thank you.
Ivan's suggestion is good, but this file has plenty of long (and even multi-line) log messages, e.g. [1]:
if ((local_conf.offloads & dev_info.tx_queue_offload_capa) != local_conf.offloads) { RTE_ETHDEV_LOG_LINE(ERR, "Ethdev port_id=%d tx_queue_id=%d, new added offloads 0x%"PRIx64" must be " "within per-queue offload capabilities 0x%"PRIx64" in %s()", port_id, tx_queue_id, local_conf.offloads, dev_info.tx_queue_offload_capa, __func__); return -EINVAL; }
Quoted 7 lines
[1]: https://elixir.bootlin.com/dpdk/v25.07/source/lib/ethdev/rte_ethdev.c#L2703
Which do you prefer:
a) Follow the local coding style for log messages, or
b) Follow our general coding style, and log as Ivan suggested?
I have distaste from long error messages after seeing what VMS and Windows NT did. The purpose of error message is to say "something is wrong" not to describe to the user in detail how to fix it.
Keep longer description for documentation or comments.
The real problem is missing description in documentation and longer messages don't help.
PATCH v3 1/3 testpmd: Do not enable mbuf fast release TX offload by default
In reply to Morten BrørupEnabling some offload by default may conflict with a manually configured offload.
Specifically, the mbuf fast release TX offload, which conflicts with multi segment packet TX offload, was enabled by default.
Therefore, mbuf fast release TX offload (the only TX offload which was enabled by default) is not enabled by default anymore.
--- app/test-pmd/testpmd.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-)
app/test-pmd/testpmd.c +1 -10
@@ -490,9 +490,7 @@ lcoreid_t latencystats_lcore_id = -1;*/ struct rte_eth_rxmode rx_mode; -struct rte_eth_txmode tx_mode = { - .offloads =RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE , -}; +struct rte_eth_txmode tx_mode;volatile int test_done =1 ;/* stop packet forwarding when set to 1. */
@@ -1592,10 +1590,6 @@ init_config_port_offloads(portid_t pid, uint32_t socket_id)if (ret !=0 )rte_exit (EXIT_FAILURE ,"rte_eth_dev_info_get() failed\n" ); -if (!(port->dev_info.tx_offload_capa &RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE )) - port->dev_conf.txmode.offloads &= - ~RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE ; -/* Apply Rx offloads configuration */ for (i =0 ; i < port->dev_info.max_rx_queues; i++) port->rxq[i].conf.offloads = port->dev_conf.rxmode.offloads;
@@ -2857,9 +2851,6 @@ update_bonding_port_dev_conf(portid_t bond_pid)return ; } -if (port->dev_info.tx_offload_capa &RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE ) - port->dev_conf.txmode.offloads |= -RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE ;/* Apply Tx offloads configuration */ for (i =0 ; i < port->dev_info.max_tx_queues; i++) port->txq[i].conf.offloads = port->dev_conf.txmode.offloads;
Signature · 1 line
2.43.0
PATCH v3 2/3 ethdev: Improve descriptions of RX and TX offloads
The descriptions of the RX and TX offloads have been improved, to reflect that they are not only for device capability reporting, but also for device and queue configuration purposes.
---
v3:
* Add notes about conflicts between fast mbuf release and multi segment send. (Stephen Hemminger)
--- lib/ethdev/rte_ethdev.h | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-)
lib/ethdev/rte_ethdev.h +24 -10
@@ -1550,7 +1550,7 @@ struct rte_eth_conf { };/** -* Rx offload capabilities of a device. +* Rx offload capabilities/configuration of a device or queue. */ #define RTE_ETH_RX_OFFLOAD_VLAN_STRIP RTE_BIT64(0)#define RTE_ETH_RX_OFFLOAD_IPV4_CKSUM RTE_BIT64(1)
@@ -1585,12 +1585,12 @@ struct rte_eth_conf { RTE_ETH_RX_OFFLOAD_QINQ_STRIP)/* -* If new Rx offload capabilities are defined, they also must be +* If new Rx offloads are defined, they also must be * mentioned in rte_rx_offload_names in rte_ethdev.c file. */ /** -* Tx offload capabilities of a device. +* Tx offload capabilities/configuration of a device or queue. */ #define RTE_ETH_TX_OFFLOAD_VLAN_INSERT RTE_BIT64(0)#define RTE_ETH_TX_OFFLOAD_IPV4_CKSUM RTE_BIT64(1)
@@ -1611,39 +1611,53 @@ struct rte_eth_conf {* Tx queue without SW lock. */ #define RTE_ETH_TX_OFFLOAD_MT_LOCKFREE RTE_BIT64(14) -/** Device supports multi segment send. */ +/** +* Multi segment send. +* +* Note: If a port is configured for fast release of mbufs, the driver is expected to use an +* optimized Tx burst function relying on the preconditions for fast release of mbufs, which +* prohibits segmented packets, and thus multi segment send is unavailable. +* Note: If configuring a port for multi segment send, support for configuring a Tx queue for +* fast release of mbufs depends on the driver. +*/ #define RTE_ETH_TX_OFFLOAD_MULTI_SEGS RTE_BIT64(15)/** -* Device supports optimization for fast release of mbufs. +* Optimization for fast release of mbufs. * When set application must guarantee that per-queue all mbufs come from the same mempool, * are direct, have refcnt=1, next=NULL and nb_segs=1, as done by rte_pktmbuf_prefree_seg(). * +* Note: If configuring a port for fast release of mbufs, the driver is expected to use an +* optimized Tx burst function relying on the preconditions for fast release of mbufs, which +* prohibits segmented packets, and thus multi segment send becomes unavailable. +* Note: If a port is configured for multi segment send, support for configuring a Tx queue +* for fast release of mbufs depends on the driver. +* * @see rte_mbuf_raw_free_bulk() */ #define RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE RTE_BIT64(16)#define RTE_ETH_TX_OFFLOAD_SECURITY RTE_BIT64(17)/** -* Device supports generic UDP tunneled packet TSO. +* Generic UDP tunneled packet TSO. * Application must set RTE_MBUF_F_TX_TUNNEL_UDP and other mbuf fields required * for tunnel TSO. */ #define RTE_ETH_TX_OFFLOAD_UDP_TNL_TSO RTE_BIT64(18)/** -* Device supports generic IP tunneled packet TSO. +* Generic IP tunneled packet TSO. * Application must set RTE_MBUF_F_TX_TUNNEL_IP and other mbuf fields required * for tunnel TSO. */ #define RTE_ETH_TX_OFFLOAD_IP_TNL_TSO RTE_BIT64(19) -/** Device supports outer UDP checksum */ +/** Outer UDP checksum. Used for tunneling packet. */ #define RTE_ETH_TX_OFFLOAD_OUTER_UDP_CKSUM RTE_BIT64(20)/** -* Device sends on time read from RTE_MBUF_DYNFIELD_TIMESTAMP_NAME +* Send on time read from RTE_MBUF_DYNFIELD_TIMESTAMP_NAME * if RTE_MBUF_DYNFLAG_TX_TIMESTAMP_NAME is set in ol_flags. * The mbuf field and flag are registered when the offload is configured. */ #define RTE_ETH_TX_OFFLOAD_SEND_ON_TIMESTAMP RTE_BIT64(21)/* -* If new Tx offload capabilities are defined, they also must be +* If new Tx offloads are defined, they also must be * mentioned in rte_tx_offload_names in rte_ethdev.c file. */
Signature · 1 line
2.43.0
Re: [PATCH v3 2/3] ethdev: Improve descriptions of RX and TX offloads
Quoted 48 lines · On Sun, 3 Aug 2025 19:42:17 +0000 Morten Brørup <[email protected]>…
The descriptions of the RX and TX offloads have been improved, to reflect that they are not only for device capability reporting, but also for device and queue configuration purposes.
Signed-off-by Morten Brørup <[email protected]>Acked-by Bruce Richardson <[email protected]>Acked-by Andrew Rybchenko <[email protected]>---
v3:
* Add notes about conflicts between fast mbuf release and multi segment send. (Stephen Hemminger)--- lib/ethdev/rte_ethdev.h | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-)lib/ethdev/rte_ethdev.h +3
-3@@ -1550,7 +1550,7 @@ struct rte_eth_conf { };/** -* Rx offload capabilities of a device. +* Rx offload capabilities/configuration of a device or queue. */ #define RTE_ETH_RX_OFFLOAD_VLAN_STRIP RTE_BIT64(0)#define RTE_ETH_RX_OFFLOAD_IPV4_CKSUM RTE_BIT64(1)@@ -1585,12 +1585,12 @@ struct rte_eth_conf { RTE_ETH_RX_OFFLOAD_QINQ_STRIP)/* -* If new Rx offload capabilities are defined, they also must be +* If new Rx offloads are defined, they also must be * mentioned in rte_rx_offload_names in rte_ethdev.c file. */ /** -* Tx offload capabilities of a device. +* Tx offload capabilities/configuration of a device or queue. */ #define RTE_ETH_TX_OFFLOAD_VLAN_INSERT RTE_BIT64(0)#define RTE_ETH_TX_OFFLOAD_IPV4_CKSUM RTE_BIT64(1)@@ -1611,39 +1611,53 @@ struct rte_eth_conf {* Tx queue without SW lock. */ #define RTE_ETH_TX_OFFLOAD_MT_LOCKFREE RTE_BIT64(14)
lib/ethdev/rte_ethdev.h struct rte_eth_conf { · line 1622
Quoted 10 lines
lib/ethdev/rte_ethdev.h +9
-1-/** Device supports multi segment send. */ +/** +* Multi segment send. +* +* Note: If a port is configured for fast release of mbufs, the driver is expected to use an +* optimized Tx burst function relying on the preconditions for fast release of mbufs, which +* prohibits segmented packets, and thus multi segment send is unavailable. +* Note: If configuring a port for multi segment send, support for configuring a Tx queue for +* fast release of mbufs depends on the driver. +*/
Wording is still a bit awkward. But many of the offload comments are a problem.
All the comments for offloads probably need rewording to be consistent. Editors always like when all items in a list use same tense and subject/object wording.
I am lazy, sounds like a good job for AI to do.
Chatgpt says:
Here’s a clearer and more concise version:
Note: When a port is configured for fast mbuf release, the driver must use an optimized Tx burst function. This requires fast mbuf release preconditions, which prevent segmented packets and disable multi-segment send.
Note: When enabling multi-segment send, Tx queue configuration for fast mbuf release depends on the driver support.
Should also be careful to use RFC style keywords (see RFC 2119) related to MUST, SHOULD, MAY. For example, driver should use optimized release function.
PATCH v3 3/3 ethdev: Reject conflicting TX offloads configuration
In reply to Morten BrørupWhen an ethdev port is configured for fast mbuf release, the driver can use a TX burst function relying on the fast mbuf release preconditions. Thus, also configuring this port or a queue on the port for transmitting segmented packets is prohibited.
Checks for these conflicting configurations have been added to the ethdev library, so the drivers don't have to implement them.
---
v3:
* Shorten the added log messages. (Stephen Hemminger, Ivan Malov)
--- lib/ethdev/rte_ethdev.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+)
lib/ethdev/rte_ethdev.c +37 -0
@@ -1531,6 +1531,18 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q, goto rollback; } +/* MBUF_FAST_FREE preconditions conflict with MULTI_SEGS support. */ +if ((dev_conf->txmode.offloads &RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE ) && + (dev_conf->txmode.offloads &RTE_ETH_TX_OFFLOAD_MULTI_SEGS )) { +RTE_ETHDEV_LOG_LINE (ERR , +"id=%d offload clash, %s vs %s" , + port_id, +rte_eth_dev_tx_offload_name (RTE_ETH_TX_OFFLOAD_MULTI_SEGS ), +rte_eth_dev_tx_offload_name (RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE )); + ret = -EINVAL ; + goto rollback; + } + dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf =rte_eth_rss_hf_refine (dev_conf->rx_adv_conf.rss_conf.rss_hf);
@@ -2709,6 +2721,31 @@ rte_eth_tx_queue_setup(uint16_t port_id, uint16_t tx_queue_id,return -EINVAL ; } +/* +* If the driver uses a Tx function with MBUF_FAST_FREE preconditions, +* per-queue MULTI_SEGS support is not possible. +*/ +if ((dev->data->dev_conf.txmode.offloads &RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE ) && + (local_conf.offloads &RTE_ETH_TX_OFFLOAD_MULTI_SEGS )) { +RTE_ETHDEV_LOG_LINE (ERR , +"id=%d txq=%d offload clash, per-queue %s vs per-port %s" , + port_id, tx_queue_id, +rte_eth_dev_tx_offload_name (RTE_ETH_TX_OFFLOAD_MULTI_SEGS ), +rte_eth_dev_tx_offload_name (RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE )); +return -EINVAL ; + } +/* +* If the driver uses a Tx function with MULTI_SEGS support, +* runtime support for per-queue MBUF_FAST_FREE optimization depends on the driver. +*/ +if ((dev->data->dev_conf.txmode.offloads &RTE_ETH_TX_OFFLOAD_MULTI_SEGS ) && + (local_conf.offloads &RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE )) +RTE_ETHDEV_LOG_LINE (DEBUG , +"id=%d txq=%d potential offload clash, per-queue %s vs per-port %s: PMD to decide" , + port_id, tx_queue_id, +rte_eth_dev_tx_offload_name (RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE ), +rte_eth_dev_tx_offload_name (RTE_ETH_TX_OFFLOAD_MULTI_SEGS )); +rte_ethdev_trace_txq_setup (port_id, tx_queue_id, nb_tx_desc, tx_conf);return eth_err (port_id, dev->dev_ops->tx_queue_setup (dev, tx_queue_id, nb_tx_desc, socket_id, &local_conf));
Signature · 1 line
2.43.0
Quoted 6 lines · Morten Brørup
When an ethdev port is configured for fast mbuf release, the driver can use a TX burst function relying on the fast mbuf release preconditions. Thus, also configuring this port or a queue on the port for transmitting segmented packets is prohibited.
Checks for these conflicting configurations have been added to the ethdev library, so the drivers don't have to implement them.
I think the new comment part of ombuf-fast-free and multi-seg in '[PATCH v3 2/3] ethdev: Improve descriptions of RX and TX offloads' could drop or within this commit.
Quoted 17 lines
Signed-off-by Morten Brørup <[email protected]>Acked-by Bruce Richardson <[email protected]>Acked-by Andrew Rybchenko <[email protected]>---
v3:
* Shorten the added log messages. (Stephen Hemminger, Ivan Malov)--- lib/ethdev/rte_ethdev.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+)lib/ethdev/rte_ethdev.c +0
-0
lib/ethdev/rte_ethdev.c rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q, · line 1538
Quoted 8 lines
lib/ethdev/rte_ethdev.c +5
-0@@ -1531,6 +1531,18 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q, goto rollback; } +/* MBUF_FAST_FREE preconditions conflict with MULTI_SEGS support. */ +if ((dev_conf->txmode.offloads &RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE ) && + (dev_conf->txmode.offloads &RTE_ETH_TX_OFFLOAD_MULTI_SEGS )) { + RTE_ETHDEV_LOG_LINE(ERR, + "id=%d offload clash, %s vs %s",
Suggest keep the same trace fmt. e.g.: Ethdev port_id=%u The same below
Quoted 28 lines
lib/ethdev/rte_ethdev.c +21
-0+ port_id, +rte_eth_dev_tx_offload_name (RTE_ETH_TX_OFFLOAD_MULTI_SEGS ), + rte_eth_dev_tx_offload_name(RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE)); + ret = -EINVAL ; + goto rollback; + } + dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf =rte_eth_rss_hf_refine (dev_conf->rx_adv_conf.rss_conf.rss_hf);@@ -2709,6 +2721,31 @@ rte_eth_tx_queue_setup(uint16_t port_id, uint16_t tx_queue_id,return -EINVAL ; } +/* +* If the driver uses a Tx function with MBUF_FAST_FREE preconditions, +* per-queue MULTI_SEGS support is not possible. +*/ +if ((dev->data->dev_conf.txmode.offloads &RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE ) && + (local_conf.offloads &RTE_ETH_TX_OFFLOAD_MULTI_SEGS )) { +RTE_ETHDEV_LOG_LINE (ERR , +"id=%d txq=%d offload clash, per-queue %s vs per-port %s" , + port_id, tx_queue_id, +rte_eth_dev_tx_offload_name (RTE_ETH_TX_OFFLOAD_MULTI_SEGS ), +rte_eth_dev_tx_offload_name (RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE )); +return -EINVAL ; + } +/*
lib/ethdev/rte_ethdev.c rte_eth_tx_queue_setup(uint16_t port_id, uint16_t tx_queue_id, · line 2747
Quoted 10 lines
lib/ethdev/rte_ethdev.c +10
-0+* If the driver uses a Tx function with MULTI_SEGS support, +* runtime support for per-queue MBUF_FAST_FREE optimization depends on the driver. +*/ +if ((dev->data->dev_conf.txmode.offloads &RTE_ETH_TX_OFFLOAD_MULTI_SEGS ) && + (local_conf.offloads &RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE )) +RTE_ETHDEV_LOG_LINE (DEBUG , +"id=%d txq=%d potential offload clash, per-queue %s vs per-port %s: PMD to decide" , + port_id, tx_queue_id, +rte_eth_dev_tx_offload_name (RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE ), +rte_eth_dev_tx_offload_name (RTE_ETH_TX_OFFLOAD_MULTI_SEGS ));
1\ The global port configuration will take effect on all queues.
If it don't support both MBUF_FAST_FREE and MULTI_SEG, why don't ban it here?
2\ Debug level is easy to ignore, how about warning?
Quoted 4 lines
lib/ethdev/rte_ethdev.c +1
-0+rte_ethdev_trace_txq_setup (port_id, tx_queue_id, nb_tx_desc, tx_conf);return eth_err (port_id, dev->dev_ops->tx_queue_setup (dev, tx_queue_id, nb_tx_desc, socket_id, &local_conf));
Quoted 11 lines
From: fengchengwen [mailto:[email protected]]
Sent: Tuesday, 5 August 2025 04.10Quoted 6 lines · Morten Brørup
When an ethdev port is configured for fast mbuf release, the driver can use a TX burst function relying on the fast mbuf release preconditions. Thus, also configuring this port or a queue on the port for transmitting segmented packets is prohibited.
Checks for these conflicting configurations have been added to the ethdev library, so the drivers don't have to implement them.
Quoted 3 lines
I think the new comment part of ombuf-fast-free and multi-seg in '[PATCH v3 2/3] ethdev: Improve descriptions of RX and TX offloads'
could drop or within this commit.
Although the comments are new, I think the behavior described by the new comments is not really new, it was just undocumented. So, patch 2/3 properly documents it, and patch 3/3 enforces it in the ethdev layer, so drivers don't have to.
Quoted 22 lines
lib/ethdev/rte_ethdev.c rte_eth_dev_configure(uint16_t port_id, uint16_t
Quoted 18 lines
Signed-off-by Morten Brørup <[email protected]>Acked-by Bruce Richardson <[email protected]>Acked-by Andrew Rybchenko <[email protected]>---
v3:
* Shorten the added log messages. (Stephen Hemminger, Ivan Malov)--- lib/ethdev/rte_ethdev.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+)lib/ethdev/rte_ethdev.c +0
-0@@ -1531,6 +1531,18 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t
nb_rx_q,uint16_tnb_tx_q,Quoted 3 lines
lib/ethdev/rte_ethdev.c +0
-0goto rollback; }
Quoted 8 lines
lib/ethdev/rte_ethdev.c rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q, · line 1538
Quoted 5 lines
lib/ethdev/rte_ethdev.c +5
-0+/* MBUF_FAST_FREE preconditions conflict with MULTI_SEGS support. */ +if ((dev_conf->txmode.offloads &RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE ) && + (dev_conf->txmode.offloads &RTE_ETH_TX_OFFLOAD_MULTI_SEGS )) { + RTE_ETHDEV_LOG_LINE(ERR, + "id=%d offload clash, %s vs %s",Suggest keep the same trace fmt. e.g.: Ethdev port_id=%u The same below
Initial versions of the series did that, but other reviewers requested a shorter log format.
Quoted 48 lines
lib/ethdev/rte_ethdev.c rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q, · line 1545
Quoted 3 lines
lib/ethdev/rte_ethdev.c +2
-0+ port_id, +
rte_eth_dev_tx_offload_name(RTE_ETH_TX_OFFLOAD_MULTI_SEGS),lib/ethdev/rte_ethdev.c rte_eth_dev_configure(uint16_t port_id, uint16_t · line 1541
Quoted 1 line
lib/ethdev/rte_ethdev.c +1
-0+rte_eth_dev_tx_offload_name(RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE));lib/ethdev/rte_ethdev.c rte_eth_tx_queue_setup(uint16_t port_id, uint16_t
Quoted 8 lines
lib/ethdev/rte_ethdev.c +4
-0+ ret = -EINVAL ; + goto rollback; + } + dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf =rte_eth_rss_hf_refine (dev_conf->rx_adv_conf.rss_conf.rss_hf);@@ -2709,6 +2721,31 @@ rte_eth_tx_queue_setup(uint16_t port_id, uint16_t
tx_queue_id,lib/ethdev/rte_ethdev.c rte_eth_tx_queue_setup(uint16_t port_id, uint16_t tx_queue_id,
Quoted 8 lines
lib/ethdev/rte_ethdev.c +5
-0return -EINVAL ; } +/* +* If the driver uses a Tx function with MBUF_FAST_FREE preconditions, +* per-queue MULTI_SEGS support is not possible. +*/ + if ((dev->data->dev_conf.txmode.offloads &
RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE) &&lib/ethdev/rte_ethdev.c rte_eth_tx_queue_setup(uint16_t port_id, uint16_t tx_queue_id, · line 2748
Quoted 5 lines
lib/ethdev/rte_ethdev.c +5
-0+ (local_conf.offloads & RTE_ETH_TX_OFFLOAD_MULTI_SEGS)) { + RTE_ETHDEV_LOG_LINE(ERR, + "id=%d txq=%d offload clash, per-queue %s vs per-port %s", + port_id, tx_queue_id, +
rte_eth_dev_tx_offload_name(RTE_ETH_TX_OFFLOAD_MULTI_SEGS),lib/ethdev/rte_ethdev.c rte_eth_tx_queue_setup(uint16_t port_id, uint16_t · line 2734
Quoted 1 line
lib/ethdev/rte_ethdev.c +1
-0+rte_eth_dev_tx_offload_name(RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE));lib/ethdev/rte_ethdev.c rte_eth_tx_queue_setup(uint16_t port_id, uint16_t tx_queue_id,
Quoted 5 lines
lib/ethdev/rte_ethdev.c +5
-0+return -EINVAL ; + } +/* +* If the driver uses a Tx function with MULTI_SEGS support, +* runtime support for per-queue MBUF_FAST_FREE optimization depends on the driver.
lib/ethdev/rte_ethdev.c rte_eth_tx_queue_setup(uint16_t port_id, uint16_t · line 2741
Quoted 2 lines
lib/ethdev/rte_ethdev.c +2
-0+*/ + if ((dev->data->dev_conf.txmode.offloads &
RTE_ETH_TX_OFFLOAD_MULTI_SEGS) &&lib/ethdev/rte_ethdev.c rte_eth_tx_queue_setup(uint16_t port_id, uint16_t tx_queue_id,
Quoted 3 lines
lib/ethdev/rte_ethdev.c +3
-0+ (local_conf.offloads & RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE)) + RTE_ETHDEV_LOG_LINE(DEBUG, + "id=%d txq=%d potential offload clash, per-queue %s vsper-port %s: PMD to decide",
lib/ethdev/rte_ethdev.c rte_eth_tx_queue_setup(uint16_t port_id, uint16_t · line 2746
Quoted 2 lines
lib/ethdev/rte_ethdev.c +2
-0+ port_id, tx_queue_id, +
rte_eth_dev_tx_offload_name(RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE),
Quoted 6 lines
lib/ethdev/rte_ethdev.c rte_eth_tx_queue_setup(uint16_t port_id, uint16_t · line 2747
Quoted 1 line
lib/ethdev/rte_ethdev.c +1
-0+rte_eth_dev_tx_offload_name(RTE_ETH_TX_OFFLOAD_MULTI_SEGS));1\ The global port configuration will take effect on all queues.
If it don't support bothMBUF_FAST_FREEandMULTI_SEG, why don't ban it
here?
There is a slight difference...
If a port is configured for MBUF_FAST_FREE, it may install a TX function (port-wide, i.e. on all queues) relying on the mbuf-fast-free requirements, which prohibit segmented packets. So combining per-port MBUF_FAST_FREE with per-port or per-queue MULTI_SEGS is impossible. However, if a port is configured for MULTI_SEGS, it may install a TX function (port-wide) with support for per-queue MBUF_FAST_FREE, by checking the queue structure at runtime.
Quoted 1 line
2\ Debug level is easy to ignore, how about warning?
If a driver's installed MULTI_SEGS TX function supports runtime checking the queue for MBUF_FAST_FREE, then there should be no warning/notice level log message, as it is considered "normal" behavior. However, if a driver doesn't support it, the driver must return -EINVAL for such a queue configuration request. And if the driver doesn't log any message with that, then this debug level log message could help the user debug the issue.
I was in doubt if I should add this debug check or not, but I decided that it might be useful for debugging driver issues related to such a configuration.
Quoted 5 lines
Quoted 5 lines
lib/ethdev/rte_ethdev.c +1
-0+rte_ethdev_trace_txq_setup (port_id, tx_queue_id, nb_tx_desc, tx_conf);return eth_err (port_id, dev->dev_ops->tx_queue_setup (dev, tx_queue_id, nb_tx_desc, socket_id, &local_conf));
Re: [PATCH v3 1/3] testpmd: Do not enable mbuf fast release TX offload by default
In reply to Morten BrørupQuoted 6 lines · Morten Brørup
Enabling some offload by default may conflict with a manually configured offload.
Specifically, the mbuf fast release TX offload, which conflicts with multi segment packet TX offload, was enabled by default.
Therefore, mbuf fast release TX offload (the only TX offload which was enabled by default) is not enabled by default anymore.
This may impact default performance, many vendor performance report has testpmd iofwd or macfwd case.
RE: [PATCH v3 1/3] testpmd: Do not enable mbuf fast release TX offload by default
Quoted 8 lines
From: fengchengwen [mailto:[email protected]]
Sent: Tuesday, 5 August 2025 02.59Quoted 1 line · Morten Brørup
Enabling some offload by default may conflict with a manually
configured
Quoted 2 lines
offload.
Specifically, the mbuf fast release TX offload, which conflicts with
Quoted 7 lines
multi
Quoted 3 lines
segment packet TX offload, was enabled by default. Therefore, mbuf fast release TX offload (the only TX offload which was enabled by default) is not enabled by default anymore.
This may impact default performance, many vendor performance report has testpmd iofwd or macfwd case.
Yes.
IMO, any optimizations, mbuf-fast-free or mbuf-recycle, must be explicitly enabled, and documented in the performance reports when used. Otherwise the performance reports give a false impression of higher performance, which is only available under certain circumstances. I have complained about this before.
Which is also why mbuf-recycle must be explicitly enabled.
With this patch, the same finally applies to mbuf-fast-free too.
I could add a Fixes tag, but I think it is better to categorize this patch as an improvement rather than a bug fix.
RE: [PATCH v3 1/3] testpmd: Do not enable mbuf fast release TX offload by default
Hi,
Quoted 13 lines · Morten Brørup
Quoted 13 lines
From: fengchengwen [mailto:[email protected]]
Sent: Tuesday, 5 August 2025 02.59Quoted 1 line · Morten Brørup
Enabling some offload by default may conflict with a manually
configured
Quoted 2 lines
offload.
Specifically, the mbuf fast release TX offload, which conflicts withmulti
Quoted 3 lines
segment packet TX offload, was enabled by default. Therefore, mbuf fast release TX offload (the only TX offload which was enabled by default) is not enabled by default anymore.
Quoted 6 lines
Quoted 2 lines
This may impact default performance, many vendor performance report has testpmd iofwd or macfwd case.
Yes.
IMO, any optimizations, mbuf-fast-free or mbuf-recycle, must be explicitly enabled, and documented in the performance reports when used.
Good point.
Thank you.
Quoted 7 lines
Otherwise the performance reports give a false impression of higher performance, which is only available under certain circumstances. I have complained about this before.
Which is also why mbuf-recycle must be explicitly enabled.
With this patch, the same finally applies to mbuf-fast-free too.
I could add a Fixes tag, but I think it is better to categorize this patch as an improvement rather than a bug fix.
Re: [PATCH v3 1/3] testpmd: Do not enable mbuf fast release TX offload by default
In reply to Morten BrørupQuoted 16 lines · On Tue, 5 Aug 2025 07:48:41 +0200 Morten Brørup <[email protected]>…
Quoted 8 lines
From: fengchengwen [mailto:[email protected]]
Sent: Tuesday, 5 August 2025 02.59Quoted 1 line · Morten Brørup
Enabling some offload by default may conflict with a manually
configured
Quoted 2 lines
offload.
Specifically, the mbuf fast release TX offload, which conflicts withQuoted 7 lines
multi
Quoted 3 lines
segment packet TX offload, was enabled by default. Therefore, mbuf fast release TX offload (the only TX offload which was enabled by default) is not enabled by default anymore.
This may impact default performance, many vendor performance report has testpmd iofwd or macfwd case.
Quoted 9 lines
Yes.
IMO, any optimizations, mbuf-fast-free or mbuf-recycle, must be explicitly enabled, and documented in the performance reports when used. Otherwise the performance reports give a false impression of higher performance, which is only available under certain circumstances. I have complained about this before.
Which is also why mbuf-recycle must be explicitly enabled.
With this patch, the same finally applies to mbuf-fast-free too.
I could add a Fixes tag, but I think it is better to categorize this patch as an improvement rather than a bug fix.
Agree that optimizations like this need to be opt-in.
Maybe ethdev should automatically downgrade rather than reject bad configurations.
The DPDK already has too many "benchmark special" tweaks.
RE: [PATCH v3 1/3] testpmd: Do not enable mbuf fast release TX offload by default
In reply to Morten BrørupHi folks,
Some of you commented on this patch.
Please formally tag with ACKED-BY or REVIEWED-BY, so it can be merged.
Patch 3/3 in the series has been merged, and is causing the "test_txoffload_port_multi_segs" test to fail. I expect this patch 1/3 to fix (or partially fix) that.
Med venlig hilsen / Kind regards,
-Morten Brørup
Quoted 55 lines
From: Morten Brørup [mailto:[email protected]]
Sent: Sunday, 3 August 2025 21.42Enabling some offload by default may conflict with a manually configured offload.
Specifically, the mbuf fast release TX offload, which conflicts with multi segment packet TX offload, was enabled by default.
Therefore, mbuf fast release TX offload (the only TX offload which was enabled by default) is not enabled by default anymore.Signed-off-by Morten Brørup <[email protected]>--- app/test-pmd/testpmd.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-)app/test-pmd/testpmd.c +1
-7@@ -490,9 +490,7 @@ lcoreid_t latencystats_lcore_id = -1;*/ struct rte_eth_rxmode rx_mode; -struct rte_eth_txmode tx_mode = { - .offloads =RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE , -}; +struct rte_eth_txmode tx_mode;volatile int test_done =1 ;/* stop packet forwarding when set to 1. */ @@ -1592,10 +1590,6 @@ init_config_port_offloads(portid_t pid, uint32_t socket_id)if (ret !=0 )rte_exit (EXIT_FAILURE ,"rte_eth_dev_info_get() failed\n" ); -if (!(port->dev_info.tx_offload_capa & RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE)) - port->dev_conf.txmode.offloads &= - ~RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE ; -/* Apply Rx offloads configuration */ app/test-pmd/testpmd.c +0
-4for (i =0 ; i < port->dev_info.max_rx_queues; i++) port->rxq[i].conf.offloads = port->dev_conf.rxmode.offloads;@@ -2857,9 +2851,6 @@ update_bonding_port_dev_conf(portid_t bond_pid)return ; } -if (port->dev_info.tx_offload_capa &RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE ) - port->dev_conf.txmode.offloads |= -RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE ;/* Apply Tx offloads configuration */ for (i =0 ; i < port->dev_info.max_tx_queues; i++) port->txq[i].conf.offloads = port->dev_conf.txmode.offloads; --2.43.0
Re: [PATCH v3 1/3] testpmd: Do not enable mbuf fast release TX offload by default
In reply to Morten BrørupQuoted 8 lines · Morten Brørup
Enabling some offload by default may conflict with a manually configured offload.
Specifically, the mbuf fast release TX offload, which conflicts with multi segment packet TX offload, was enabled by default.
Therefore, mbuf fast release TX offload (the only TX offload which was enabled by default) is not enabled by default anymore.Signed-off-by Morten Brørup <[email protected]>
Quoted 43 lines
---
app/test-pmd/testpmd.c| 11 +----------1 file changed, 1 insertion(+), 10 deletions(-)app/test-pmd/testpmd.c +1
-3@@ -490,9 +490,7 @@ lcoreid_t latencystats_lcore_id = -1;*/ struct rte_eth_rxmode rx_mode; -struct rte_eth_txmode tx_mode = { - .offloads =RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE , -}; +struct rte_eth_txmode tx_mode;volatile int
test_done= 1; /* stop packet forwarding when set to 1. */app/test-pmd/testpmd.c +0
-7@@ -1592,10 +1590,6 @@ init_config_port_offloads(portid_t pid, uint32_t socket_id)if (ret !=0 )rte_exit (EXIT_FAILURE ,"rte_eth_dev_info_get() failed\n" ); -if (!(port->dev_info.tx_offload_capa &RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE )) - port->dev_conf.txmode.offloads &= - ~RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE ; -/* Apply Rx offloads configuration */ for (i =0 ; i < port->dev_info.max_rx_queues; i++) port->rxq[i].conf.offloads = port->dev_conf.rxmode.offloads;@@ -2857,9 +2851,6 @@ update_bonding_port_dev_conf(portid_t bond_pid)return ; } -if (port->dev_info.tx_offload_capa &RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE ) - port->dev_conf.txmode.offloads |= -RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE ;/* Apply Tx offloads configuration */ for (i =0 ; i < port->dev_info.max_tx_queues; i++) port->txq[i].conf.offloads = port->dev_conf.txmode.offloads;Signature · 1 line
2.43.0
Andrew Rybchenko
Acked-byRe: [PATCH v3 1/3] testpmd: Do not enable mbuf fast release TX offload by default
Quoted 9 lines · Ivan Malov
Quoted 7 lines · Morten Brørup
Enabling some offload by default may conflict with a manually configured offload.
Specifically, the mbuf fast release TX offload, which conflicts with multi segment packet TX offload, was enabled by default.
Therefore, mbuf fast release TX offload (the only TX offload which was enabled by default) is not enabled by default anymore.
Quoted 3 lines
Quoted 1 line
Signed-off-by Morten Brørup <[email protected]>Acked-by Ivan Malov <[email protected]>
RE: [PATCH v3 1/3] testpmd: Do not enable mbuf fast release TX offload by default
In reply to Morten BrørupQuoted 40 lines
Enabling some offload by default may conflict with a manually configured offload.
Specifically, the mbuf fast release TX offload, which conflicts with multi segment packet TX offload, was enabled by default.
Therefore, mbuf fast release TX offload (the only TX offload which was enabled by default) is not enabled by default anymore.Signed-off-by Morten Brørup <[email protected]>--- app/test-pmd/testpmd.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-)app/test-pmd/testpmd.c +1
-7@@ -490,9 +490,7 @@ lcoreid_t latencystats_lcore_id = -1;*/ struct rte_eth_rxmode rx_mode; -struct rte_eth_txmode tx_mode = { - .offloads =RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE , -}; +struct rte_eth_txmode tx_mode;volatile int test_done =1 ;/* stop packet forwarding when set to 1. */ @@ -1592,10 +1590,6 @@ init_config_port_offloads(portid_t pid, uint32_t socket_id)if (ret !=0 )rte_exit (EXIT_FAILURE ,"rte_eth_dev_info_get() failed\n" ); -if (!(port->dev_info.tx_offload_capa &RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE )) - port->dev_conf.txmode.offloads &= - ~RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE ; -/* Apply Rx offloads configuration */ for (i =0 ; i < port->dev_info.max_rx_queues; i++) port->rxq[i].conf.offloads = port->dev_conf.rxmode.offloads;
app/test-pmd/testpmd.c update_bonding_port_dev_conf(portid_t bond_pid)
Quoted 10 lines
app/test-pmd/testpmd.c +0
-4@@ -2857,9 +2851,6 @@ update_bonding_port_dev_conf(portid_t bond_pid)return ; } -if (port->dev_info.tx_offload_capa &RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE ) - port->dev_conf.txmode.offloads |= -RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE ;/* Apply Tx offloads configuration */ for (i =0 ; i < port->dev_info.max_tx_queues; i++) port->txq[i].conf.offloads = port->dev_conf.txmode.offloads; --
Quoted 2 lines
2.43.0
Re: [PATCH v3 1/3] testpmd: Do not enable mbuf fast release TX offload by default
In reply to Morten BrørupQuoted 8 lines · Morten Brørup
Enabling some offload by default may conflict with a manually configured offload.
Specifically, the mbuf fast release TX offload, which conflicts with multi segment packet TX offload, was enabled by default.
Therefore, mbuf fast release TX offload (the only TX offload which was enabled by default) is not enabled by default anymore.Signed-off-by Morten Brørup <[email protected]>