net/ixgbe: improvements to ixgbe driver
Subsystems (2)
cover net/ixgbe: improvements to ixgbe driver
This patch set does below ixgbe driver code improvements.
1)Removed usage of CONFIG_RTE_IXGBE_INC_VECTOR and used architectures specific flags instead.
2)Removed weak symbols from the stub functions for ppc architecture.
3)Removed duplicate function declarations.
4)Added ixgbe arm vector file for messon build.
5)Added missing stubs for ppc architecture.
Reshma Pattan (5):
net/ixgbe: remove ixgbe vector config flag net/ixgbe: remove weak symbols in ixgbe rxtx net/ixgbe: remove duplicate function declaration net/ixgbe: add missing stubs for ppc net/ixgbe: add arm vector support in meson
config/common_base | 1 - doc/guides/nics/ixgbe.rst | 1 - drivers/net/ixgbe/Makefile | 6 ++--- drivers/net/ixgbe/ixgbe_rxtx.c | 49 ++++++++++++++++++++-------------- drivers/net/ixgbe/ixgbe_rxtx.h | 7 ++--- drivers/net/ixgbe/meson.build | 3 ++- 6 files changed, 36 insertions(+), 31 deletions(-)
Signature · 1 line
2.21.0
PATCH 1/5 net/ixgbe: remove ixgbe vector config flag
CONFIG_RTE_IXGBE_INC_VECTOR is enabled by default, so remove it and use architecture specific flags.
--- config/common_base | 1 - doc/guides/nics/ixgbe.rst | 1 - drivers/net/ixgbe/Makefile | 6 +++--- drivers/net/ixgbe/ixgbe_rxtx.c | 17 ++++++++--------- drivers/net/ixgbe/ixgbe_rxtx.h | 9 ++++----- drivers/net/ixgbe/meson.build | 1 - 6 files changed, 15 insertions(+), 20 deletions(-)
config/common_base +0 -1
@@ -295,7 +295,6 @@ CONFIG_RTE_LIBRTE_IXGBE_DEBUG_RX=n CONFIG_RTE_LIBRTE_IXGBE_DEBUG_TX=n CONFIG_RTE_LIBRTE_IXGBE_DEBUG_TX_FREE=n CONFIG_RTE_LIBRTE_IXGBE_PF_DISABLE_STRIP_CRC=n -CONFIG_RTE_IXGBE_INC_VECTOR=y CONFIG_RTE_LIBRTE_IXGBE_BYPASS=n #
doc/guides/nics/ixgbe.rst +0 -1
@@ -15,7 +15,6 @@ There is no change to PMD API. The RX/TX handler are the only two entries for vP They are transparently registered at runtime RX/TX execution if all condition checks pass. 1. To date, only an SSE version of IX GBE vPMD is available. - To ensure that vPMD is in the binary code, ensure that the option CONFIG_RTE_IXGBE_INC_VECTOR=y is in the configure file. Some constraints apply as pre-conditions for specific optimizations on bulk packet transfers. The following sections explain RX and TX constraints in the vPMD.
drivers/net/ixgbe/Makefile +3 -3
@@ -89,9 +89,9 @@ SRCS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += ixgbe_fdir.c SRCS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += ixgbe_pf.c SRCS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += ixgbe_flow.c ifeq ($(CONFIG_RTE_ARCH_ARM64),y) -SRCS-$(CONFIG_RTE_IXGBE_INC_VECTOR) += ixgbe_rxtx_vec_neon.c -else -SRCS-$(CONFIG_RTE_IXGBE_INC_VECTOR) += ixgbe_rxtx_vec_sse.c +SRCS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += ixgbe_rxtx_vec_neon.c +else ifeq ($(CONFIG_RTE_ARCH_X86),y) +SRCS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += ixgbe_rxtx_vec_sse.c endif ifeq ($(CONFIG_RTE_LIBRTE_IXGBE_BYPASS),y) SRCS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += ixgbe_bypass.c
drivers/net/ixgbe/ixgbe_rxtx.c +8 -9
@@ -87,7 +87,7 @@#define rte_ixgbe_prefetch (p) do {} while (0)#endif -#ifdef RTE_IXGBE_INC_VECTOR +#if defined(RTE_ARCH_X86 ) || defined(RTE_ARCH_ARM64 )uint16_t ixgbe_xmit_fixed_burst_vec (void *tx_queue,struct rte_mbuf **tx_pkts,uint16_t nb_pkts);#endif
@@ -344,7 +344,7 @@ ixgbe_xmit_pkts_simple(void *tx_queue, struct rte_mbuf **tx_pkts,return nb_tx; } -#ifdef RTE_IXGBE_INC_VECTOR +#if defined(RTE_ARCH_X86 ) || defined(RTE_ARCH_ARM64 )static uint16_t ixgbe_xmit_pkts_vec (void *tx_queue,struct rte_mbuf **tx_pkts,uint16_t nb_pkts)
@@ -2392,7 +2392,7 @@ ixgbe_set_tx_function(struct rte_eth_dev *dev, struct ixgbe_tx_queue *txq) (txq->tx_rs_thresh >= RTE_PMD_IXGBE_TX_MAX_BURST)) {PMD_INIT_LOG (DEBUG ,"Using simple tx code path" ); dev->tx_pkt_prepare =NULL ; -#ifdef RTE_IXGBE_INC_VECTOR +#if defined(RTE_ARCH_X86 ) || defined(RTE_ARCH_ARM64 )if (txq->tx_rs_thresh <=RTE_IXGBE_TX_MAX_FREE_BUF_SZ && (rte_eal_process_type () !=RTE_PROC_PRIMARY ||ixgbe_txq_vec_setup (txq) ==0 )) {
@@ -2687,7 +2687,7 @@ ixgbe_rx_queue_release_mbufs(struct ixgbe_rx_queue *rxq) {unsigned i; -#ifdef RTE_IXGBE_INC_VECTOR +#if defined(RTE_ARCH_X86 ) || defined(RTE_ARCH_ARM64 )/* SSE Vector driver has a different way of releasing mbufs. */ if (rxq->rx_using_sse) {ixgbe_rx_queue_release_mbufs_vec (rxq);
@@ -2825,7 +2825,7 @@ ixgbe_reset_rx_queue(struct ixgbe_adapter *adapter, struct ixgbe_rx_queue *rxq) rxq->pkt_first_seg =NULL ; rxq->pkt_last_seg =NULL ; -#ifdef RTE_IXGBE_INC_VECTOR +#if defined(RTE_ARCH_X86 ) || defined(RTE_ARCH_ARM64 ) rxq->rxrearm_start =0 ; rxq->rxrearm_nb =0 ;#endif
@@ -3139,7 +3139,7 @@ ixgbe_dev_rx_descriptor_status(void *rx_queue, uint16_t offset)if (unlikely (offset >= rxq->nb_rx_desc))return -EINVAL ; -#ifdef RTE_IXGBE_INC_VECTOR +#if defined(RTE_ARCH_X86 ) || defined(RTE_ARCH_ARM64 )if (rxq->rx_using_sse) nb_hold = rxq->rxrearm_nb;else
@@ -4638,8 +4638,7 @@ ixgbe_set_rx_function(struct rte_eth_dev *dev)if (ixgbe_rx_vec_dev_conf_condition_check (dev) || !adapter->rx_bulk_alloc_allowed) {PMD_INIT_LOG (DEBUG ,"Port[%d] doesn't meet Vector Rx " -"preconditions or RTE_IXGBE_INC_VECTOR is " -"not enabled" , +"preconditions" , dev->data->port_id); adapter->rx_vec_allowed = false;
@@ -5809,7 +5808,7 @@ ixgbe_config_rss_filter(struct rte_eth_dev *dev,return 0 ; } -/* Stubs needed for linkage when CONFIG_RTE_IXGBE_INC_VECTOR is set to 'n' */ +/* Stubs needed for linkage for ppc arch */ __rte_weak int ixgbe_rx_vec_dev_conf_condition_check(struct rte_eth_dev __rte_unused *dev) {
drivers/net/ixgbe/ixgbe_rxtx.h +4 -5
@@ -33,7 +33,7 @@#define RTE_IXGBE_DESCS_PER_LOOP 4 -#ifdef RTE_IXGBE_INC_VECTOR +#if defined(RTE_ARCH_X86 ) || defined(RTE_ARCH_ARM64 )#define RTE_IXGBE_RXQ_REARM_THRESH 32#define RTE_IXGBE_MAX_RX_BURST RTE_IXGBE_RXQ_REARM_THRESH#endif
@@ -115,7 +115,7 @@ struct ixgbe_rx_queue {uint8_t using_ipsec;/**< indicates that IPsec RX feature is in use */ #endif -#ifdef RTE_IXGBE_INC_VECTOR +#if defined(RTE_ARCH_X86 ) || defined(RTE_ARCH_ARM64 )uint16_t rxrearm_nb;/**< number of remaining to be re-armed */ uint16_t rxrearm_start;/**< the idx we start the re-arming from */ #endif
@@ -288,12 +288,11 @@ void ixgbe_rx_queue_release_mbufs_vec(struct ixgbe_rx_queue *rxq);extern const uint32_t ptype_table[IXGBE_PACKET_TYPE_MAX ];extern const uint32_t ptype_table_tn[IXGBE_PACKET_TYPE_TN_MAX ]; -#ifdef RTE_IXGBE_INC_VECTOR - +#if defined(RTE_ARCH_X86 ) || defined(RTE_ARCH_ARM64 )uint16_t ixgbe_xmit_fixed_burst_vec (void *tx_queue,struct rte_mbuf **tx_pkts,uint16_t nb_pkts);int ixgbe_txq_vec_setup (struct ixgbe_tx_queue *txq); -#endif /* RTE_IXGBE_INC_VECTOR */ +#endif uint64_t ixgbe_get_tx_port_offloads (struct rte_eth_dev *dev);uint64_t ixgbe_get_rx_queue_offloads (struct rte_eth_dev *dev);
drivers/net/ixgbe/meson.build +0 -1
@@ -25,7 +25,6 @@ sources = files( deps += ['hash', 'security'] if arch_subdir == 'x86' - dpdk_conf.set('RTE_IXGBE_INC_VECTOR', 1) sources += files('ixgbe_rxtx_vec_sse.c') endif
Signature · 1 line
2.21.0
PATCH 2/5 net/ixgbe: remove weak symbols in ixgbe rxtx
In reply to Reshma Pattanremove weak symbols from ixgbe_rxtx.c file as
it is done in i40e driver in commit "02ad704708"
(net/i40e: eliminate weak symbols in data path)
--- drivers/net/ixgbe/ixgbe_rxtx.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
drivers/net/ixgbe/ixgbe_rxtx.c +7 -5
@@ -5808,14 +5808,15 @@ ixgbe_config_rss_filter(struct rte_eth_dev *dev,return 0 ; } -/* Stubs needed for linkage for ppc arch */ -__rte_weak int +/* Stubs needed for linkage when CONFIG_RTE_ARCH_PPC_64 is set */ +#if defined(RTE_ARCH_PPC_64 ) +int ixgbe_rx_vec_dev_conf_condition_check(struct rte_eth_dev __rte_unused *dev) {return -1 ; } -__rte_weak uint16_t +uint16_t ixgbe_recv_pkts_vec( void __rte_unused *rx_queue, struct rte_mbuf __rte_unused **rx_pkts,
@@ -5824,7 +5825,7 @@ ixgbe_recv_pkts_vec(return 0 ; } -__rte_weak uint16_t +uint16_t ixgbe_recv_scattered_pkts_vec( void __rte_unused *rx_queue, struct rte_mbuf __rte_unused **rx_pkts,
@@ -5833,8 +5834,9 @@ ixgbe_recv_scattered_pkts_vec(return 0 ; } -__rte_weak int +int ixgbe_rxq_vec_setup(struct ixgbe_rx_queue __rte_unused *rxq) {return -1 ; } +#endif
Signature · 1 line
2.21.0
PATCH 3/5 net/ixgbe: remove duplicate function declaration
In reply to Reshma Pattanremove duplicate declarations of ixgbe_xmit_fixed_burst_vec from ixgbe_rxtx.c
--- drivers/net/ixgbe/ixgbe_rxtx.c | 5 ----- 1 file changed, 5 deletions(-)
drivers/net/ixgbe/ixgbe_rxtx.c +0 -5
@@ -87,11 +87,6 @@#define rte_ixgbe_prefetch (p) do {} while (0)#endif -#if defined(RTE_ARCH_X86 ) || defined(RTE_ARCH_ARM64 ) -uint16_t ixgbe_xmit_fixed_burst_vec (void *tx_queue,struct rte_mbuf **tx_pkts, -uint16_t nb_pkts); -#endif -/********************************************************************* * * TX functions
Signature · 1 line
2.21.0
PATCH 4/5 net/ixgbe: add missing stubs for ppc
In reply to Reshma Pattanadd stubs for ixgbe_xmit_fixed_burst_vec,ixgbe_rx_queue_release_mbufs_vec andixgbe_txq_vec_setup
--- drivers/net/ixgbe/ixgbe_rxtx.c | 25 +++++++++++++++++++------ drivers/net/ixgbe/ixgbe_rxtx.h | 2 -- 2 files changed, 19 insertions(+), 8 deletions(-)
drivers/net/ixgbe/ixgbe_rxtx.c +19 -6
@@ -339,7 +339,6 @@ ixgbe_xmit_pkts_simple(void *tx_queue, struct rte_mbuf **tx_pkts,return nb_tx; } -#if defined(RTE_ARCH_X86 ) || defined(RTE_ARCH_ARM64 )static uint16_t ixgbe_xmit_pkts_vec (void *tx_queue,struct rte_mbuf **tx_pkts,uint16_t nb_pkts)
@@ -361,7 +360,6 @@ ixgbe_xmit_pkts_vec(void *tx_queue, struct rte_mbuf **tx_pkts,return nb_tx; } -#endif static inline void ixgbe_set_xmit_ctx(struct ixgbe_tx_queue *txq,
@@ -2387,14 +2385,12 @@ ixgbe_set_tx_function(struct rte_eth_dev *dev, struct ixgbe_tx_queue *txq) (txq->tx_rs_thresh >= RTE_PMD_IXGBE_TX_MAX_BURST)) {PMD_INIT_LOG (DEBUG ,"Using simple tx code path" ); dev->tx_pkt_prepare =NULL ; -#if defined(RTE_ARCH_X86 ) || defined(RTE_ARCH_ARM64 )if (txq->tx_rs_thresh <=RTE_IXGBE_TX_MAX_FREE_BUF_SZ && (rte_eal_process_type () !=RTE_PROC_PRIMARY ||ixgbe_txq_vec_setup (txq) ==0 )) {PMD_INIT_LOG (DEBUG ,"Vector tx enabled." ); dev->tx_pkt_burst = ixgbe_xmit_pkts_vec; }else -#endif dev->tx_pkt_burst = ixgbe_xmit_pkts_simple; } else {PMD_INIT_LOG (DEBUG ,"Using full-featured tx code path" );
@@ -2682,13 +2678,11 @@ ixgbe_rx_queue_release_mbufs(struct ixgbe_rx_queue *rxq) {unsigned i; -#if defined(RTE_ARCH_X86 ) || defined(RTE_ARCH_ARM64 )/* SSE Vector driver has a different way of releasing mbufs. */ if (rxq->rx_using_sse) {ixgbe_rx_queue_release_mbufs_vec (rxq);return ; } -#endif if (rxq->sw_ring !=NULL ) {for (i =0 ; i < rxq->nb_rx_desc; i++) {
@@ -5834,4 +5828,23 @@ ixgbe_rxq_vec_setup(struct ixgbe_rx_queue __rte_unused *rxq) {return -1 ; } + +uint16_t +ixgbe_xmit_fixed_burst_vec (void *tx_queue,struct rte_mbuf **tx_pkts, +uint16_t nb_pkts) +{ +return 0 ; +} + +int +ixgbe_txq_vec_setup (struct ixgbe_tx_queue *txq) +{ +return -1 ; +} + +void +ixgbe_rx_queue_release_mbufs_vec (struct ixgbe_rx_queue *rxq) +{ +return ; +}#endif
drivers/net/ixgbe/ixgbe_rxtx.h +0 -2
@@ -288,11 +288,9 @@ void ixgbe_rx_queue_release_mbufs_vec(struct ixgbe_rx_queue *rxq);extern const uint32_t ptype_table[IXGBE_PACKET_TYPE_MAX ];extern const uint32_t ptype_table_tn[IXGBE_PACKET_TYPE_TN_MAX ]; -#if defined(RTE_ARCH_X86 ) || defined(RTE_ARCH_ARM64 )uint16_t ixgbe_xmit_fixed_burst_vec (void *tx_queue,struct rte_mbuf **tx_pkts,uint16_t nb_pkts);int ixgbe_txq_vec_setup (struct ixgbe_tx_queue *txq); -#endif uint64_t ixgbe_get_tx_port_offloads (struct rte_eth_dev *dev);uint64_t ixgbe_get_rx_queue_offloads (struct rte_eth_dev *dev);
Signature · 1 line
2.21.0
Re: [dpdk-dev] [PATCH 4/5] net/ixgbe: add missing stubs for ppc
Quoted 7 lines · Reshma Pattan
add stubs for
ixgbe_xmit_fixed_burst_vec,ixgbe_rx_queue_release_mbufs_vecandixgbe_txq_vec_setupCC Vlad Zolotarov <[email protected]>Signed-off-by Reshma Pattan <[email protected]>
<...>
Quoted 14 lines
drivers/net/ixgbe/ixgbe_rxtx.c +10
-0@@ -5834,4 +5828,23 @@ ixgbe_rxq_vec_setup(struct ixgbe_rx_queue __rte_unused *rxq) {return -1 ; } + +uint16_t +ixgbe_xmit_fixed_burst_vec (void *tx_queue,struct rte_mbuf **tx_pkts, +uint16_t nb_pkts) +{ +return 0 ; +} + +int +ixgbe_txq_vec_setup (struct ixgbe_tx_queue *txq)
drivers/net/ixgbe/ixgbe_rxtx.c ixgbe_rxq_vec_setup(struct ixgbe_rx_queue __rte_unused *rxq) · line 5850
Quoted 10 lines
drivers/net/ixgbe/ixgbe_rxtx.c +9
-0+{ +return -1 ; +} + +void +ixgbe_rx_queue_release_mbufs_vec (struct ixgbe_rx_queue *rxq) +{ +return ; +}#endif
getting unused variable warnings for PPC [1], because of missing '__rte_unused' attribute on arguments. I will add them while merging, please verify the commits on next-net
[1]: error: unused parameter ‘tx_queue’
PATCH 5/5 net/ixgbe: add arm vector support in meson
In reply to Reshma PattanAdd missing arm vector build support to meson.build.
--- drivers/net/ixgbe/meson.build | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/ixgbe/meson.build +2 -0
@@ -26,6 +26,8 @@ deps += ['hash', 'security'] if arch_subdir == 'x86' sources += files('ixgbe_rxtx_vec_sse.c') +elif arch_subdir == 'arm' + sources += files('ixgbe_rxtx_vec_neon.c') endif includes += include_directories('base')
Signature · 1 line
2.21.0
Quoted 23 lines · Reshma Pattan
This patch set does below ixgbe driver code improvements.
1)Removed usage of
CONFIG_RTE_IXGBE_INC_VECTORand used architectures specific flags instead.2)Removed weak symbols from the stub functions for ppc architecture.
3)Removed duplicate function declarations.
4)Added ixgbe arm vector file for messon build.
5)Added missing stubs for ppc architecture.
Signed-off-by Reshma Pattan <[email protected]>Reshma Pattan (5):
net/ixgbe: remove ixgbe vector config flag
net/ixgbe: remove weak symbols in ixgbe rxtx
net/ixgbe: remove duplicate function declaration
net/ixgbe: add missing stubs for ppc
net/ixgbe: add arm vector support in meson
Quoted 11 lines
config/common_base | 1 - doc/guides/nics/ixgbe.rst | 1 - drivers/net/ixgbe/Makefile | 6 ++--- drivers/net/ixgbe/ixgbe_rxtx.c | 49 ++++++++++++++++++++-------------- drivers/net/ixgbe/ixgbe_rxtx.h | 7 ++--- drivers/net/ixgbe/meson.build | 3 ++- 6 files changed, 36 insertions(+), 31 deletions(-)Signature · 1 line
2.21.0
Applied to dpdk-next-net-intel, Thanks.