net/intel: fixes and improvements to rx path selection
cover net/intel: fixes and improvements to rx path selection
This series contains a number of fixes and improvements to the logic concerned with selecting an rx path in the intel drivers. The first three patches are fixes that affect the iavf driver. The final three patches reformat the arrays in the i40e iavf and ice drivers that hold information for each Rx path that are used in the common selection process, in an attempt to improve readability.
Ciara Loftus (6):
net/intel: fix Rx vector capability detection net/iavf: fix Rx paths feature definitions net/iavf: fix Rx path selection for scalar flex bulk alloc net/iavf: reformat the Rx path infos array net/i40e: reformat the Rx path infos array net/ice: reformat the Rx path infos array
drivers/net/intel/common/rx.h | 5 +- drivers/net/intel/i40e/i40e_rxtx.c | 126 +++++++++---- drivers/net/intel/iavf/iavf.h | 1 + drivers/net/intel/iavf/iavf_rxtx.c | 285 +++++++++++++++++++++-------- drivers/net/intel/iavf/iavf_rxtx.h | 1 - drivers/net/intel/ice/ice_rxtx.c | 124 +++++++++---- 6 files changed, 401 insertions(+), 141 deletions(-)
Signature · 1 line
2.34.1
PATCH 1/6 net/intel: fix Rx vector capability detection
The common function for detecting whether an rxq could use a vector rx path would automatically disqualify rx queues that had the timestamp offload enabled. This was incorrect behaviour because the iavf driver which uses this common function supports timestamp offload on its vector paths. Fix this by removing the conditional check for timestamp offload.
--- drivers/net/intel/common/rx.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/net/intel/common/rx.h +2 -3
@@ -235,9 +235,8 @@ ci_rxq_vec_capable(uint16_t nb_desc, uint16_t rx_free_thresh, uint64_t offloads) (nb_desc % rx_free_thresh) != 0)return false; -/* no driver supports timestamping or buffer split on vector path */ -if ((offloads &RTE_ETH_RX_OFFLOAD_TIMESTAMP ) || - (offloads &RTE_ETH_RX_OFFLOAD_BUFFER_SPLIT )) +/* no driver supports buffer split on vector path */ +if (offloads &RTE_ETH_RX_OFFLOAD_BUFFER_SPLIT )return false;return true;
Signature · 1 line
2.34.1
Re: [PATCH 1/6] net/intel: fix Rx vector capability detection
Quoted 21 lines · Ciara Loftus
The common function for detecting whether an rxq could use a vector rx path would automatically disqualify rx queues that had the timestamp offload enabled. This was incorrect behaviour because the iavf driver which uses this common function supports timestamp offload on its vector paths. Fix this by removing the conditional check for timestamp offload.
Fixes 9eb60580d155 ("net/intel: extract common Rx vector criteria")Signed-off-by Ciara Loftus <[email protected]>--- drivers/net/intel/common/rx.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)drivers/net/intel/common/rx.h +0
-0@@ -235,9 +235,8 @@ ci_rxq_vec_capable(uint16_t nb_desc, uint16_t rx_free_thresh, uint64_t offloads) (nb_desc % rx_free_thresh) != 0)
drivers/net/intel/common/rx.h ci_rxq_vec_capable(uint16_t nb_desc, uint16_t rx_free_thresh, uint64_t offloads) · line 242
Quoted 10 lines
drivers/net/intel/common/rx.h +2
-3return false; -/* no driver supports timestamping or buffer split on vector path */ -if ((offloads &RTE_ETH_RX_OFFLOAD_TIMESTAMP ) || - (offloads &RTE_ETH_RX_OFFLOAD_BUFFER_SPLIT )) +/* no driver supports buffer split on vector path */ +if (offloads &RTE_ETH_RX_OFFLOAD_BUFFER_SPLIT )return false;return true;
Given that we check all offload flags later when doing final path selection, can we drop the flags check here completely? Just have this funciont check on the non-feature-related conditions, such as ring size etc.
/Bruce
RE: [PATCH 1/6] net/intel: fix Rx vector capability detection
Quoted 33 lines · Ciara Loftus
drivers/net/intel/common/rx.h ci_rxq_vec_capable(uint16_t nb_desc, uint16_t
Quoted 20 lines
The common function for detecting whether an rxq could use a vector rx path would automatically disqualify rx queues that had the timestamp offload enabled. This was incorrect behaviour because the iavf driver which uses this common function supports timestamp offload on its vector paths. Fix this by removing the conditional check for timestamp offload.
Fixes 9eb60580d155 ("net/intel: extract common Rx vector criteria")Signed-off-by Ciara Loftus <[email protected]>--- drivers/net/intel/common/rx.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)drivers/net/intel/common/rx.h +0
-0@@ -235,9 +235,8 @@ ci_rxq_vec_capable(uint16_t nb_desc, uint16_t
rx_free_thresh,uint64_toffloads)Quoted 10 lines
drivers/net/intel/common/rx.h +2
-3(nb_desc % rx_free_thresh) != 0)return false; -/* no driver supports timestamping or buffer split on vector path */ -if ((offloads &RTE_ETH_RX_OFFLOAD_TIMESTAMP ) || - (offloads &RTE_ETH_RX_OFFLOAD_BUFFER_SPLIT )) +/* no driver supports buffer split on vector path */ +if (offloads &RTE_ETH_RX_OFFLOAD_BUFFER_SPLIT )return false;
Quoted 6 lines
drivers/net/intel/common/rx.h ci_rxq_vec_capable(uint16_t nb_desc, uint16_t rx_free_thresh, uint64_t offloads) · line 242
Quoted 1 line
drivers/net/intel/common/rx.h +0
-0return true;Given that we check all offload flags later when doing final path selection, can we drop the flags check here completely? Just have this funciont check on the non-feature-related conditions, such as ring size etc.
Sure.
This function is used by ixgbe which doesn't use the common rx path select function yet. But I think this check is redundant for ixgbe because it's not supported on any of its paths so initialisation would fail earlier than here, during dev_configure.
Quoted 2 lines
/Bruce
PATCH 2/6 net/iavf: fix Rx paths feature definitions
In reply to Ciara LoftusTwo rx paths had incorrect feature and offload definitions which led to incorrect path selections. Fix these.
Remove timestamp offload from the list of offloads supported by paths that use the flexible rx descriptor. It is only available in the "offload" versions of those paths.
--- drivers/net/intel/iavf/iavf_rxtx.c | 5 +++-- drivers/net/intel/iavf/iavf_rxtx.h | 1 - 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/intel/iavf/iavf_rxtx.c +3 -2
@@ -3768,13 +3768,14 @@ static const struct ci_rx_path_info iavf_rx_path_infos[] = { {.scattered = true, .flex_desc = true, .bulk_alloc = true}}}, [IAVF_RX_AVX2_FLEX_RXD_OFFLOAD ] = { iavf_recv_pkts_vec_avx2_flex_rxd_offload,"Vector AVX2 Flex Offload" , - {IAVF_RX_VECTOR_OFFLOADS ,RTE_VECT_SIMD_256 , + {IAVF_RX_VECTOR_OFFLOAD_FLEX_OFFLOADS ,RTE_VECT_SIMD_256 , {.flex_desc = true, .bulk_alloc = true}}}, [IAVF_RX_AVX2_SCATTERED_FLEX_RXD_OFFLOAD ] = { iavf_recv_scattered_pkts_vec_avx2_flex_rxd_offload,"Vector Scattered AVX2 Flex Offload" , {IAVF_RX_VECTOR_OFFLOAD_FLEX_OFFLOADS |RTE_ETH_RX_OFFLOAD_SCATTER , -RTE_VECT_SIMD_256 , {.flex_desc = true, .bulk_alloc = true}}}, +RTE_VECT_SIMD_256 , + {.scattered = true, .flex_desc = true, .bulk_alloc = true}}}, #ifdef CC_AVX512_SUPPORT [IAVF_RX_AVX512 ] = {iavf_recv_pkts_vec_avx512,"Vector AVX512" , {IAVF_RX_VECTOR_OFFLOADS, RTE_VECT_SIMD_512, {.bulk_alloc = true}}},
drivers/net/intel/iavf/iavf_rxtx.h +0 -1
@@ -83,7 +83,6 @@/* vector paths that use the flex rx desc */ #define IAVF_RX_VECTOR_FLEX_OFFLOADS ( \ IAVF_RX_VECTOR_OFFLOADS | \ - RTE_ETH_RX_OFFLOAD_TIMESTAMP | \ RTE_ETH_RX_OFFLOAD_SECURITY)/* vector offload paths */ #define IAVF_RX_VECTOR_OFFLOAD_OFFLOADS ( \
Signature · 1 line
2.34.1
Re: [PATCH 2/6] net/iavf: fix Rx paths feature definitions
Quoted 7 lines · Ciara Loftus
Two rx paths had incorrect feature and offload definitions which led to incorrect path selections. Fix these.
Remove timestamp offload from the list of offloads supported by paths that use the flexible rx descriptor. It is only available in the "offload" versions of those paths.
Quoted 9 lines
Fixes 91e3205d72d8 ("net/iavf: use common Rx path selection infrastructure")Signed-off-by Ciara Loftus <[email protected]>--- drivers/net/intel/iavf/iavf_rxtx.c | 5 +++-- drivers/net/intel/iavf/iavf_rxtx.h | 1 - 2 files changed, 3 insertions(+), 3 deletions(-)
PATCH 3/6 net/iavf: fix Rx path selection for scalar flex bulk alloc
In reply to Ciara LoftusThe scalar bulk alloc rx burst function supports both legacy and flexible rx descriptors. The rx path selection infrastructure introduced in commit 91e3205d72d8 ("net/iavf: use common Rx path selection infrastructure") cannot define a path that supports both descriptor formats. To solve this problem, have two rx path definitions which both point to the same rx burst function but report different descriptor formats. This allows the rx path selection function to choose the correct path.
--- drivers/net/intel/iavf/iavf.h | 1 + drivers/net/intel/iavf/iavf_rxtx.c | 3 +++ 2 files changed, 4 insertions(+)
drivers/net/intel/iavf/iavf.h +1 -0
@@ -327,6 +327,7 @@ enum iavf_rx_func_type {IAVF_RX_FLEX_RXD ,IAVF_RX_SCATTERED_FLEX_RXD ,IAVF_RX_BULK_ALLOC , +IAVF_RX_BULK_ALLOC_FLEX_RXD ,IAVF_RX_SSE ,IAVF_RX_SSE_SCATTERED , IAVF_RX_SSE_FLEX_RXD,
drivers/net/intel/iavf/iavf_rxtx.c +3 -0
@@ -3734,6 +3734,9 @@ static const struct ci_rx_path_info iavf_rx_path_infos[] = { {.scattered = true, .flex_desc = true}}}, [IAVF_RX_BULK_ALLOC ] = {iavf_recv_pkts_bulk_alloc,"Scalar Bulk Alloc" , {IAVF_RX_SCALAR_OFFLOADS, RTE_VECT_SIMD_DISABLED, {.bulk_alloc = true}}}, + [IAVF_RX_BULK_ALLOC_FLEX_RXD ] = {iavf_recv_pkts_bulk_alloc,"Scalar Bulk Alloc Flex" , + {IAVF_RX_SCALAR_FLEX_OFFLOADS ,RTE_VECT_SIMD_DISABLED , + {.flex_desc = true, .bulk_alloc = true}}}, #ifdef RTE_ARCH_X86 [IAVF_RX_SSE ] = {iavf_recv_pkts_vec,"Vector SSE" , {IAVF_RX_VECTOR_OFFLOAD_OFFLOADS, RTE_VECT_SIMD_128, {.bulk_alloc = true}}},
Signature · 1 line
2.34.1
Re: [PATCH 3/6] net/iavf: fix Rx path selection for scalar flex bulk alloc
Quoted 9 lines · Ciara Loftus
The scalar bulk alloc rx burst function supports both legacy and flexible rx descriptors. The rx path selection infrastructure introduced in commit
91e3205d72d8("net/iavf: use common Rx path selection infrastructure") cannot define a path that supports both descriptor formats. To solve this problem, have two rx path definitions which both point to the same rx burst function but report different descriptor formats. This allows the rx path selection function to choose the correct path.
Quoted 4 lines
Fixes 91e3205d72d8 ("net/iavf: use common Rx path selection infrastructure")Signed-off-by Ciara Loftus <[email protected]>
I find it strange that both point to the one function but have different offload capabilities. However, I realise that the code path bifurcates again later in the function, so doing it this way is correct!
Quoted 34 lines
--- drivers/net/intel/iavf/iavf.h | 1 + drivers/net/intel/iavf/iavf_rxtx.c | 3 +++ 2 files changed, 4 insertions(+)drivers/net/intel/iavf/iavf.h +1
-0@@ -327,6 +327,7 @@ enum iavf_rx_func_type {IAVF_RX_FLEX_RXD ,IAVF_RX_SCATTERED_FLEX_RXD ,IAVF_RX_BULK_ALLOC , +IAVF_RX_BULK_ALLOC_FLEX_RXD ,IAVF_RX_SSE ,IAVF_RX_SSE_SCATTERED , IAVF_RX_SSE_FLEX_RXD,drivers/net/intel/iavf/iavf_rxtx.c +3
-0@@ -3734,6 +3734,9 @@ static const struct ci_rx_path_info iavf_rx_path_infos[] = { {.scattered = true, .flex_desc = true}}}, [IAVF_RX_BULK_ALLOC ] = {iavf_recv_pkts_bulk_alloc,"Scalar Bulk Alloc" , {IAVF_RX_SCALAR_OFFLOADS, RTE_VECT_SIMD_DISABLED, {.bulk_alloc = true}}}, + [IAVF_RX_BULK_ALLOC_FLEX_RXD ] = {iavf_recv_pkts_bulk_alloc,"Scalar Bulk Alloc Flex" , + {IAVF_RX_SCALAR_FLEX_OFFLOADS ,RTE_VECT_SIMD_DISABLED , + {.flex_desc = true, .bulk_alloc = true}}}, #ifdef RTE_ARCH_X86 [IAVF_RX_SSE ] = {iavf_recv_pkts_vec,"Vector SSE" , {IAVF_RX_VECTOR_OFFLOAD_OFFLOADS, RTE_VECT_SIMD_128, {.bulk_alloc = true}}},Signature · 1 line
2.34.1
PATCH 4/6 net/iavf: reformat the Rx path infos array
In reply to Ciara LoftusIn order to improve readability, reformat the rx path infos array.
--- drivers/net/intel/iavf/iavf_rxtx.c | 289 +++++++++++++++++++++-------- 1 file changed, 210 insertions(+), 79 deletions(-)
drivers/net/intel/iavf/iavf_rxtx.c +210 -79
@@ -3720,99 +3720,230 @@ iavf_xmit_pkts_no_poll(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts);static const struct ci_rx_path_info iavf_rx_path_infos[] = { - [IAVF_RX_DISABLED ] = {iavf_recv_pkts_no_poll,"Disabled" , - {IAVF_RX_NO_OFFLOADS ,RTE_VECT_SIMD_DISABLED , {.disabled = true}}}, - [IAVF_RX_DEFAULT ] = {iavf_recv_pkts,"Scalar" , - {IAVF_RX_SCALAR_OFFLOADS ,RTE_VECT_SIMD_DISABLED }}, - [IAVF_RX_SCATTERED ] = {iavf_recv_scattered_pkts,"Scalar Scattered" , - {IAVF_RX_SCALAR_OFFLOADS |RTE_ETH_RX_OFFLOAD_SCATTER ,RTE_VECT_SIMD_DISABLED , - {.scattered = true}}}, - [IAVF_RX_FLEX_RXD ] = {iavf_recv_pkts_flex_rxd,"Scalar Flex" , - {IAVF_RX_SCALAR_FLEX_OFFLOADS ,RTE_VECT_SIMD_DISABLED , {.flex_desc = true}}}, - [IAVF_RX_SCATTERED_FLEX_RXD ] = {iavf_recv_scattered_pkts_flex_rxd,"Scalar Scattered Flex" , - {IAVF_RX_SCALAR_FLEX_OFFLOADS |RTE_ETH_RX_OFFLOAD_SCATTER ,RTE_VECT_SIMD_DISABLED , - {.scattered = true, .flex_desc = true}}}, - [IAVF_RX_BULK_ALLOC ] = {iavf_recv_pkts_bulk_alloc,"Scalar Bulk Alloc" , - {IAVF_RX_SCALAR_OFFLOADS ,RTE_VECT_SIMD_DISABLED , {.bulk_alloc = true}}}, - [IAVF_RX_BULK_ALLOC_FLEX_RXD ] = {iavf_recv_pkts_bulk_alloc,"Scalar Bulk Alloc Flex" , - {IAVF_RX_SCALAR_FLEX_OFFLOADS ,RTE_VECT_SIMD_DISABLED , - {.flex_desc = true, .bulk_alloc = true}}}, + [IAVF_RX_DISABLED ] = { + .pkt_burst = iavf_recv_pkts_no_poll, + .info ="Disabled" , + .features = { + .rx_offloads =IAVF_RX_NO_OFFLOADS , + .simd_width =RTE_VECT_SIMD_DISABLED , + .extra.disabled = true}}, + [IAVF_RX_DEFAULT ] = { + .pkt_burst = iavf_recv_pkts, + .info ="Scalar" , + .features = { + .rx_offloads =IAVF_RX_SCALAR_OFFLOADS , + .simd_width =RTE_VECT_SIMD_DISABLED }}, + [IAVF_RX_SCATTERED ] = { + .pkt_burst = iavf_recv_scattered_pkts, + .info ="Scalar Scattered" , + .features = { + .rx_offloads =IAVF_RX_SCALAR_OFFLOADS |RTE_ETH_RX_OFFLOAD_SCATTER , + .simd_width =RTE_VECT_SIMD_DISABLED , + .extra.scattered = true}}, + [IAVF_RX_FLEX_RXD ] = { + .pkt_burst = iavf_recv_pkts_flex_rxd, + .info ="Scalar Flex" , + .features = { + .rx_offloads =IAVF_RX_SCALAR_FLEX_OFFLOADS , + .simd_width =RTE_VECT_SIMD_DISABLED , + .extra.flex_desc = true}}, + [IAVF_RX_SCATTERED_FLEX_RXD ] = { + .pkt_burst = iavf_recv_scattered_pkts_flex_rxd, + .info ="Scalar Scattered Flex" , + .features = { + .rx_offloads =IAVF_RX_SCALAR_FLEX_OFFLOADS |RTE_ETH_RX_OFFLOAD_SCATTER , + .simd_width =RTE_VECT_SIMD_DISABLED , + .extra.scattered = true, + .extra.flex_desc = true}}, + [IAVF_RX_BULK_ALLOC ] = { + .pkt_burst = iavf_recv_pkts_bulk_alloc, + .info ="Scalar Bulk Alloc" , + .features = { + .rx_offloads =IAVF_RX_SCALAR_OFFLOADS , + .simd_width =RTE_VECT_SIMD_DISABLED , + .extra.bulk_alloc = true}}, + [IAVF_RX_BULK_ALLOC_FLEX_RXD ] = { + .pkt_burst = iavf_recv_pkts_bulk_alloc, + .info ="Scalar Bulk Alloc Flex" , + .features = { + .rx_offloads =IAVF_RX_SCALAR_FLEX_OFFLOADS , + .simd_width =RTE_VECT_SIMD_DISABLED , + .extra.flex_desc = true, + .extra.bulk_alloc = true}}, #ifdef RTE_ARCH_X86 - [IAVF_RX_SSE] = {iavf_recv_pkts_vec, "Vector SSE", - {IAVF_RX_VECTOR_OFFLOAD_OFFLOADS ,RTE_VECT_SIMD_128 , {.bulk_alloc = true}}}, - [IAVF_RX_SSE_SCATTERED ] = {iavf_recv_scattered_pkts_vec,"Vector Scattered SSE" , - {IAVF_RX_VECTOR_OFFLOADS |RTE_ETH_RX_OFFLOAD_SCATTER ,RTE_VECT_SIMD_128 , - {.scattered = true, .bulk_alloc = true}}}, - [IAVF_RX_SSE_FLEX_RXD ] = {iavf_recv_pkts_vec_flex_rxd,"Vector Flex SSE" , - {IAVF_RX_VECTOR_OFFLOAD_FLEX_OFFLOADS ,RTE_VECT_SIMD_128 , - {.flex_desc = true, .bulk_alloc = true}}}, + [IAVF_RX_SSE] = { + .pkt_burst = iavf_recv_pkts_vec, + .info ="Vector SSE" , + .features = { + .rx_offloads =IAVF_RX_VECTOR_OFFLOAD_OFFLOADS , + .simd_width =RTE_VECT_SIMD_128 , + .extra.bulk_alloc = true}}, + [IAVF_RX_SSE_SCATTERED ] = { + .pkt_burst = iavf_recv_scattered_pkts_vec, + .info ="Vector Scattered SSE" , + .features = { + .rx_offloads =IAVF_RX_VECTOR_OFFLOADS |RTE_ETH_RX_OFFLOAD_SCATTER , + .simd_width =RTE_VECT_SIMD_128 , + .extra.scattered = true, + .extra.bulk_alloc = true}}, + [IAVF_RX_SSE_FLEX_RXD ] = { + .pkt_burst = iavf_recv_pkts_vec_flex_rxd, + .info ="Vector Flex SSE" , + .features = { + .rx_offloads =IAVF_RX_VECTOR_OFFLOAD_FLEX_OFFLOADS , + .simd_width =RTE_VECT_SIMD_128 , + .extra.flex_desc = true, + .extra.bulk_alloc = true}}, [IAVF_RX_SSE_SCATTERED_FLEX_RXD ] = { - iavf_recv_scattered_pkts_vec_flex_rxd,"Vector Scattered SSE Flex" , - {IAVF_RX_VECTOR_OFFLOAD_FLEX_OFFLOADS |RTE_ETH_RX_OFFLOAD_SCATTER , -RTE_VECT_SIMD_128 , - {.scattered = true, .flex_desc = true, .bulk_alloc = true}}}, - [IAVF_RX_AVX2 ] = {iavf_recv_pkts_vec_avx2,"Vector AVX2" , - {IAVF_RX_VECTOR_OFFLOADS ,RTE_VECT_SIMD_256 , {.bulk_alloc = true}}}, - [IAVF_RX_AVX2_SCATTERED ] = {iavf_recv_scattered_pkts_vec_avx2,"Vector Scattered AVX2" , - {IAVF_RX_VECTOR_OFFLOADS |RTE_ETH_RX_OFFLOAD_SCATTER ,RTE_VECT_SIMD_256 , - {.scattered = true, .bulk_alloc = true}}}, - [IAVF_RX_AVX2_OFFLOAD ] = {iavf_recv_pkts_vec_avx2_offload,"Vector AVX2 Offload" , - {IAVF_RX_VECTOR_OFFLOAD_OFFLOADS ,RTE_VECT_SIMD_256 , {.bulk_alloc = true}}}, + .pkt_burst = iavf_recv_scattered_pkts_vec_flex_rxd, + .info ="Vector Scattered SSE Flex" , + .features = { + .rx_offloads =IAVF_RX_VECTOR_OFFLOAD_FLEX_OFFLOADS | +RTE_ETH_RX_OFFLOAD_SCATTER , + .simd_width =RTE_VECT_SIMD_128 , + .extra.scattered = true, + .extra.flex_desc = true, + .extra.bulk_alloc = true}}, + [IAVF_RX_AVX2 ] = { + .pkt_burst = iavf_recv_pkts_vec_avx2, + .info ="Vector AVX2" , + .features = { + .rx_offloads =IAVF_RX_VECTOR_OFFLOADS , + .simd_width =RTE_VECT_SIMD_256 , + .extra.bulk_alloc = true}}, + [IAVF_RX_AVX2_SCATTERED ] = { + .pkt_burst = iavf_recv_scattered_pkts_vec_avx2, + .info ="Vector Scattered AVX2" , + .features = { + .rx_offloads =IAVF_RX_VECTOR_OFFLOADS |RTE_ETH_RX_OFFLOAD_SCATTER , + .simd_width =RTE_VECT_SIMD_256 , + .extra.scattered = true, + .extra.bulk_alloc = true}}, + [IAVF_RX_AVX2_OFFLOAD ] = { + .pkt_burst = iavf_recv_pkts_vec_avx2_offload, + .info ="Vector AVX2 Offload" , + .features = { + .rx_offloads =IAVF_RX_VECTOR_OFFLOAD_OFFLOADS , + .simd_width =RTE_VECT_SIMD_256 , + .extra.bulk_alloc = true}}, [IAVF_RX_AVX2_SCATTERED_OFFLOAD ] = { - iavf_recv_scattered_pkts_vec_avx2_offload,"Vector Scattered AVX2 offload" , - {IAVF_RX_VECTOR_OFFLOAD_OFFLOADS |RTE_ETH_RX_OFFLOAD_SCATTER ,RTE_VECT_SIMD_256 , - {.scattered = true, .bulk_alloc = true}}}, - [IAVF_RX_AVX2_FLEX_RXD ] = {iavf_recv_pkts_vec_avx2_flex_rxd,"Vector AVX2 Flex" , - {IAVF_RX_VECTOR_FLEX_OFFLOADS ,RTE_VECT_SIMD_256 , - {.flex_desc = true, .bulk_alloc = true}}}, + .pkt_burst = iavf_recv_scattered_pkts_vec_avx2_offload, + .info ="Vector Scattered AVX2 Offload" , + .features = { + .rx_offloads =IAVF_RX_VECTOR_OFFLOAD_OFFLOADS |RTE_ETH_RX_OFFLOAD_SCATTER , + .simd_width =RTE_VECT_SIMD_256 , + .extra.scattered = true, + .extra.bulk_alloc = true}}, + [IAVF_RX_AVX2_FLEX_RXD ] = { + .pkt_burst = iavf_recv_pkts_vec_avx2_flex_rxd, + .info ="Vector AVX2 Flex" , + .features = { + .rx_offloads =IAVF_RX_VECTOR_FLEX_OFFLOADS , + .simd_width =RTE_VECT_SIMD_256 , + .extra.flex_desc = true, + .extra.bulk_alloc = true}}, [IAVF_RX_AVX2_SCATTERED_FLEX_RXD ] = { - iavf_recv_scattered_pkts_vec_avx2_flex_rxd,"Vector Scattered AVX2 Flex" , - {IAVF_RX_VECTOR_FLEX_OFFLOADS |RTE_ETH_RX_OFFLOAD_SCATTER ,RTE_VECT_SIMD_256 , - {.scattered = true, .flex_desc = true, .bulk_alloc = true}}}, + .pkt_burst = iavf_recv_scattered_pkts_vec_avx2_flex_rxd, + .info ="Vector Scattered AVX2 Flex" , + .features = { + .rx_offloads =IAVF_RX_VECTOR_FLEX_OFFLOADS |RTE_ETH_RX_OFFLOAD_SCATTER , + .simd_width =RTE_VECT_SIMD_256 , + .extra.scattered = true, + .extra.flex_desc = true, + .extra.bulk_alloc = true}}, [IAVF_RX_AVX2_FLEX_RXD_OFFLOAD ] = { - iavf_recv_pkts_vec_avx2_flex_rxd_offload,"Vector AVX2 Flex Offload" , - {IAVF_RX_VECTOR_OFFLOAD_FLEX_OFFLOADS ,RTE_VECT_SIMD_256 , - {.flex_desc = true, .bulk_alloc = true}}}, + .pkt_burst = iavf_recv_pkts_vec_avx2_flex_rxd_offload, + .info ="Vector AVX2 Flex Offload" , + .features = { + .rx_offloads =IAVF_RX_VECTOR_OFFLOAD_FLEX_OFFLOADS , + .simd_width =RTE_VECT_SIMD_256 , + .extra.flex_desc = true, + .extra.bulk_alloc = true}}, [IAVF_RX_AVX2_SCATTERED_FLEX_RXD_OFFLOAD ] = { - iavf_recv_scattered_pkts_vec_avx2_flex_rxd_offload, -"Vector Scattered AVX2 Flex Offload" , - {IAVF_RX_VECTOR_OFFLOAD_FLEX_OFFLOADS |RTE_ETH_RX_OFFLOAD_SCATTER , -RTE_VECT_SIMD_256 , - {.scattered = true, .flex_desc = true, .bulk_alloc = true}}}, + .pkt_burst = iavf_recv_scattered_pkts_vec_avx2_flex_rxd_offload, + .info ="Vector Scattered AVX2 Flex Offload" , + .features = { + .rx_offloads =IAVF_RX_VECTOR_OFFLOAD_FLEX_OFFLOADS | +RTE_ETH_RX_OFFLOAD_SCATTER , + .simd_width =RTE_VECT_SIMD_256 , + .extra.scattered = true, + .extra.flex_desc = true, + .extra.bulk_alloc = true}}, #ifdef CC_AVX512_SUPPORT - [IAVF_RX_AVX512] = {iavf_recv_pkts_vec_avx512, "Vector AVX512", - {IAVF_RX_VECTOR_OFFLOADS ,RTE_VECT_SIMD_512 , {.bulk_alloc = true}}}, + [IAVF_RX_AVX512] = { + .pkt_burst = iavf_recv_pkts_vec_avx512, + .info ="Vector AVX512" , + .features = { + .rx_offloads =IAVF_RX_VECTOR_OFFLOADS , + .simd_width =RTE_VECT_SIMD_512 , + .extra.bulk_alloc = true}}, [IAVF_RX_AVX512_SCATTERED ] = { - iavf_recv_scattered_pkts_vec_avx512,"Vector Scattered AVX512" , - {IAVF_RX_VECTOR_OFFLOADS |RTE_ETH_RX_OFFLOAD_SCATTER ,RTE_VECT_SIMD_512 , - {.scattered = true, .bulk_alloc = true}}}, - [IAVF_RX_AVX512_OFFLOAD ] = {iavf_recv_pkts_vec_avx512_offload,"Vector AVX512 Offload" , - {IAVF_RX_VECTOR_OFFLOAD_OFFLOADS ,RTE_VECT_SIMD_512 , {.bulk_alloc = true}}}, + .pkt_burst = iavf_recv_scattered_pkts_vec_avx512, + .info ="Vector Scattered AVX512" , + .features = { + .rx_offloads =IAVF_RX_VECTOR_OFFLOADS |RTE_ETH_RX_OFFLOAD_SCATTER , + .simd_width =RTE_VECT_SIMD_512 , + .extra.scattered = true, + .extra.bulk_alloc = true}}, + [IAVF_RX_AVX512_OFFLOAD ] = { + .pkt_burst = iavf_recv_pkts_vec_avx512_offload, + .info ="Vector AVX512 Offload" , + .features = { + .rx_offloads =IAVF_RX_VECTOR_OFFLOAD_OFFLOADS , + .simd_width =RTE_VECT_SIMD_512 , + .extra.bulk_alloc = true}}, [IAVF_RX_AVX512_SCATTERED_OFFLOAD ] = { - iavf_recv_scattered_pkts_vec_avx512_offload,"Vector Scattered AVX512 offload" , - {IAVF_RX_VECTOR_OFFLOAD_OFFLOADS |RTE_ETH_RX_OFFLOAD_SCATTER ,RTE_VECT_SIMD_512 , - {.scattered = true, .bulk_alloc = true}}}, - [IAVF_RX_AVX512_FLEX_RXD ] = {iavf_recv_pkts_vec_avx512_flex_rxd,"Vector AVX512 Flex" , - {IAVF_RX_VECTOR_FLEX_OFFLOADS ,RTE_VECT_SIMD_512 , - {.flex_desc = true, .bulk_alloc = true}}}, + .pkt_burst = iavf_recv_scattered_pkts_vec_avx512_offload, + .info ="Vector Scattered AVX512 Offload" , + .features = { + .rx_offloads =IAVF_RX_VECTOR_OFFLOAD_OFFLOADS |RTE_ETH_RX_OFFLOAD_SCATTER , + .simd_width =RTE_VECT_SIMD_512 , + .extra.scattered = true, + .extra.bulk_alloc = true}}, + [IAVF_RX_AVX512_FLEX_RXD ] = { + .pkt_burst = iavf_recv_pkts_vec_avx512_flex_rxd, + .info ="Vector AVX512 Flex" , + .features = { + .rx_offloads =IAVF_RX_VECTOR_FLEX_OFFLOADS , + .simd_width =RTE_VECT_SIMD_512 , + .extra.flex_desc = true, + .extra.bulk_alloc = true}}, [IAVF_RX_AVX512_SCATTERED_FLEX_RXD ] = { - iavf_recv_scattered_pkts_vec_avx512_flex_rxd,"Vector Scattered AVX512 Flex" , - {IAVF_RX_VECTOR_FLEX_OFFLOADS |RTE_ETH_RX_OFFLOAD_SCATTER ,RTE_VECT_SIMD_512 , - {.scattered = true, .flex_desc = true, .bulk_alloc = true}}}, + .pkt_burst = iavf_recv_scattered_pkts_vec_avx512_flex_rxd, + .info ="Vector Scattered AVX512 Flex" , + .features = { + .rx_offloads =IAVF_RX_VECTOR_FLEX_OFFLOADS |RTE_ETH_RX_OFFLOAD_SCATTER , + .simd_width =RTE_VECT_SIMD_512 , + .extra.scattered = true, + .extra.flex_desc = true, + .extra.bulk_alloc = true}}, [IAVF_RX_AVX512_FLEX_RXD_OFFLOAD ] = { - iavf_recv_pkts_vec_avx512_flex_rxd_offload,"Vector AVX512 Flex Offload" , - {IAVF_RX_VECTOR_OFFLOAD_FLEX_OFFLOADS ,RTE_VECT_SIMD_512 , - {.flex_desc = true, .bulk_alloc = true}}}, + .pkt_burst = iavf_recv_pkts_vec_avx512_flex_rxd_offload, + .info ="Vector AVX512 Flex Offload" , + .features = { + .rx_offloads =IAVF_RX_VECTOR_OFFLOAD_FLEX_OFFLOADS , + .simd_width =RTE_VECT_SIMD_512 , + .extra.flex_desc = true, + .extra.bulk_alloc = true}}, [IAVF_RX_AVX512_SCATTERED_FLEX_RXD_OFFLOAD ] = { - iavf_recv_scattered_pkts_vec_avx512_flex_rxd_offload, -"Vector Scattered AVX512 Flex offload" , - {IAVF_RX_VECTOR_OFFLOAD_FLEX_OFFLOADS |RTE_ETH_RX_OFFLOAD_SCATTER , -RTE_VECT_SIMD_512 , - {.scattered = true, .flex_desc = true, .bulk_alloc = true}}}, + .pkt_burst = iavf_recv_scattered_pkts_vec_avx512_flex_rxd_offload, + .info ="Vector Scattered AVX512 Flex Offload" , + .features = { + .rx_offloads =IAVF_RX_VECTOR_OFFLOAD_FLEX_OFFLOADS | +RTE_ETH_RX_OFFLOAD_SCATTER , + .simd_width =RTE_VECT_SIMD_512 , + .extra.scattered = true, + .extra.flex_desc = true, + .extra.bulk_alloc = true}}, #endif #elif defined RTE_ARCH_ARM - [IAVF_RX_SSE] = {iavf_recv_pkts_vec, "Vector Neon", - {IAVF_RX_SCALAR_OFFLOADS ,RTE_VECT_SIMD_128 , {.bulk_alloc = true}}}, + [IAVF_RX_SSE] = { + .pkt_burst = iavf_recv_pkts_vec, + .info ="Vector Neon" , + .features = { + .rx_offloads =IAVF_RX_SCALAR_OFFLOADS , + .simd_width =RTE_VECT_SIMD_128 , + .extra.bulk_alloc = true}}, #endif };
Signature · 1 line
2.34.1
Re: [PATCH 4/6] net/iavf: reformat the Rx path infos array
Quoted 4 lines · Ciara Loftus
In order to improve readability, reformat the rx path infos array.
Signed-off-by Ciara Loftus <[email protected]>---
Thanks, I find this format much more readable.
Some comments inline below.
Quoted 23 lines
drivers/net/intel/iavf/iavf_rxtx.c | 289 +++++++++++++++++++++-------- 1 file changed, 210 insertions(+), 79 deletions(-)drivers/net/intel/iavf/iavf_rxtx.c +0
-12@@ -3720,99 +3720,230 @@ iavf_xmit_pkts_no_poll(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts);static const struct ci_rx_path_info iavf_rx_path_infos[] = { - [IAVF_RX_DISABLED ] = {iavf_recv_pkts_no_poll,"Disabled" , - {IAVF_RX_NO_OFFLOADS ,RTE_VECT_SIMD_DISABLED , {.disabled = true}}}, - [IAVF_RX_DEFAULT ] = {iavf_recv_pkts,"Scalar" , - {IAVF_RX_SCALAR_OFFLOADS ,RTE_VECT_SIMD_DISABLED }}, - [IAVF_RX_SCATTERED ] = {iavf_recv_scattered_pkts,"Scalar Scattered" , - {IAVF_RX_SCALAR_OFFLOADS |RTE_ETH_RX_OFFLOAD_SCATTER ,RTE_VECT_SIMD_DISABLED , - {.scattered = true}}}, - [IAVF_RX_FLEX_RXD ] = {iavf_recv_pkts_flex_rxd,"Scalar Flex" , - {IAVF_RX_SCALAR_FLEX_OFFLOADS ,RTE_VECT_SIMD_DISABLED , {.flex_desc = true}}}, - [IAVF_RX_SCATTERED_FLEX_RXD ] = {iavf_recv_scattered_pkts_flex_rxd,"Scalar Scattered Flex" , - {IAVF_RX_SCALAR_FLEX_OFFLOADS |RTE_ETH_RX_OFFLOAD_SCATTER ,RTE_VECT_SIMD_DISABLED , - {.scattered = true, .flex_desc = true}}},
drivers/net/intel/iavf/iavf_rxtx.c iavf_xmit_pkts_no_poll(void *tx_queue, struct rte_mbuf **tx_pkts, · line 3727
Quoted 10 lines
drivers/net/intel/iavf/iavf_rxtx.c +5
-5- [IAVF_RX_BULK_ALLOC] = {iavf_recv_pkts_bulk_alloc, "Scalar Bulk Alloc", - {IAVF_RX_SCALAR_OFFLOADS, RTE_VECT_SIMD_DISABLED, {.bulk_alloc = true}}}, - [IAVF_RX_BULK_ALLOC_FLEX_RXD] = {iavf_recv_pkts_bulk_alloc, "Scalar Bulk Alloc Flex", - {IAVF_RX_SCALAR_FLEX_OFFLOADS, RTE_VECT_SIMD_DISABLED, - {.flex_desc = true, .bulk_alloc = true}}}, + [IAVF_RX_DISABLED] = { + .pkt_burst = iavf_recv_pkts_no_poll, + .info = "Disabled", + .features = { + .rx_offloads = IAVF_RX_NO_OFFLOADS,
This is zero, so I would tend to omit it.
drivers/net/intel/iavf/iavf_rxtx.c iavf_xmit_pkts_no_poll(void *tx_queue, struct rte_mbuf **tx_pkts, · line 3728
Quoted 1 line
drivers/net/intel/iavf/iavf_rxtx.c +1
-0+ .simd_width = RTE_VECT_SIMD_DISABLED,
Can our logic selection all work, if we have the simd_width set as zero for these paths, also indicating SIMD is disabled? Again, it would allow us to omit the SIMD value altogether for non-vector paths.
drivers/net/intel/iavf/iavf_rxtx.c iavf_xmit_pkts_no_poll(void *tx_queue, struct rte_mbuf **tx_pkts, · line 3729
Quoted 1 line
drivers/net/intel/iavf/iavf_rxtx.c +1
-0+ .extra.disabled = true}},
Space before the closing braces? Maybe put them on new line?
Quoted 6 lines
drivers/net/intel/iavf/iavf_rxtx.c +6
-0+ [IAVF_RX_DEFAULT] = { + .pkt_burst = iavf_recv_pkts, + .info = "Scalar", + .features = { + .rx_offloads = IAVF_RX_SCALAR_OFFLOADS, + .simd_width = RTE_VECT_SIMD_DISABLED}},
<snip>
PATCH 5/6 net/i40e: reformat the Rx path infos array
In reply to Ciara LoftusIn order to improve readability, reformat the rx path infos array.
--- drivers/net/intel/i40e/i40e_rxtx.c | 126 ++++++++++++++++++++++------- 1 file changed, 95 insertions(+), 31 deletions(-)
drivers/net/intel/i40e/i40e_rxtx.c +95 -31
@@ -3290,42 +3290,106 @@ i40e_recycle_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id, }static const struct ci_rx_path_info i40e_rx_path_infos[] = { - [I40E_RX_DEFAULT ] = { i40e_recv_pkts,"Scalar" , - {I40E_RX_SCALAR_OFFLOADS ,RTE_VECT_SIMD_DISABLED }}, - [I40E_RX_SCATTERED ] = { i40e_recv_scattered_pkts,"Scalar Scattered" , - {I40E_RX_SCALAR_OFFLOADS ,RTE_VECT_SIMD_DISABLED , {.scattered = true}}}, - [I40E_RX_BULK_ALLOC ] = { i40e_recv_pkts_bulk_alloc,"Scalar Bulk Alloc" , - {I40E_RX_SCALAR_OFFLOADS ,RTE_VECT_SIMD_DISABLED , {.bulk_alloc = true}}}, + [I40E_RX_DEFAULT ] = { + .pkt_burst = i40e_recv_pkts, + .info ="Scalar" , + .features = { + .rx_offloads =I40E_RX_SCALAR_OFFLOADS , + .simd_width =RTE_VECT_SIMD_DISABLED }}, + [I40E_RX_SCATTERED ] = { + .pkt_burst = i40e_recv_scattered_pkts, + .info ="Scalar Scattered" , + .features = { + .rx_offloads =I40E_RX_SCALAR_OFFLOADS , + .simd_width =RTE_VECT_SIMD_DISABLED , + .extra.scattered = true}}, + [I40E_RX_BULK_ALLOC ] = { + .pkt_burst = i40e_recv_pkts_bulk_alloc, + .info ="Scalar Bulk Alloc" , + .features = { + .rx_offloads =I40E_RX_SCALAR_OFFLOADS , + .simd_width =RTE_VECT_SIMD_DISABLED , + .extra.bulk_alloc = true}}, #ifdef RTE_ARCH_X86 - [I40E_RX_SSE] = { i40e_recv_pkts_vec, "Vector SSE", - {I40E_RX_VECTOR_OFFLOADS ,RTE_VECT_SIMD_128 , {.bulk_alloc = true}}}, - [I40E_RX_SSE_SCATTERED ] = { i40e_recv_scattered_pkts_vec,"Vector SSE Scattered" , - {I40E_RX_VECTOR_OFFLOADS ,RTE_VECT_SIMD_128 , - {.scattered = true, .bulk_alloc = true}}}, - [I40E_RX_AVX2 ] = { i40e_recv_pkts_vec_avx2,"Vector AVX2" , - {I40E_RX_VECTOR_OFFLOADS ,RTE_VECT_SIMD_256 , {.bulk_alloc = true}}}, - [I40E_RX_AVX2_SCATTERED ] = { i40e_recv_scattered_pkts_vec_avx2,"Vector AVX2 Scattered" , - {I40E_RX_VECTOR_OFFLOADS ,RTE_VECT_SIMD_256 , - {.scattered = true, .bulk_alloc = true}}}, + [I40E_RX_SSE] = { + .pkt_burst = i40e_recv_pkts_vec, + .info ="Vector SSE" , + .features = { + .rx_offloads =I40E_RX_VECTOR_OFFLOADS , + .simd_width =RTE_VECT_SIMD_128 , + .extra.bulk_alloc = true}}, + [I40E_RX_SSE_SCATTERED ] = { + .pkt_burst = i40e_recv_scattered_pkts_vec, + .info ="Vector SSE Scattered" , + .features = { + .rx_offloads =I40E_RX_VECTOR_OFFLOADS , + .simd_width =RTE_VECT_SIMD_128 , + .extra.scattered = true, + .extra.bulk_alloc = true}}, + [I40E_RX_AVX2 ] = { + .pkt_burst = i40e_recv_pkts_vec_avx2, + .info ="Vector AVX2" , + .features = { + .rx_offloads =I40E_RX_VECTOR_OFFLOADS , + .simd_width =RTE_VECT_SIMD_256 , + .extra.bulk_alloc = true}}, + [I40E_RX_AVX2_SCATTERED ] = { + .pkt_burst = i40e_recv_scattered_pkts_vec_avx2, + .info ="Vector AVX2 Scattered" , + .features = { + .rx_offloads =I40E_RX_VECTOR_OFFLOADS , + .simd_width =RTE_VECT_SIMD_256 , + .extra.scattered = true, + .extra.bulk_alloc = true}}, #ifdef CC_AVX512_SUPPORT - [I40E_RX_AVX512] = { i40e_recv_pkts_vec_avx512, "Vector AVX512", - {I40E_RX_VECTOR_OFFLOADS ,RTE_VECT_SIMD_512 , {.bulk_alloc = true}}}, - [I40E_RX_AVX512_SCATTERED ] = { i40e_recv_scattered_pkts_vec_avx512, -"Vector AVX512 Scattered" , {I40E_RX_VECTOR_OFFLOADS ,RTE_VECT_SIMD_512 , - {.scattered = true, .bulk_alloc = true}}}, + [I40E_RX_AVX512] = { + .pkt_burst = i40e_recv_pkts_vec_avx512, + .info ="Vector AVX512" , + .features = { + .rx_offloads =I40E_RX_VECTOR_OFFLOADS , + .simd_width =RTE_VECT_SIMD_512 , + .extra.bulk_alloc = true}}, + [I40E_RX_AVX512_SCATTERED ] = { + .pkt_burst = i40e_recv_scattered_pkts_vec_avx512, + .info ="Vector AVX512 Scattered" , + .features = { + .rx_offloads =I40E_RX_VECTOR_OFFLOADS , + .simd_width =RTE_VECT_SIMD_512 , + .extra.scattered = true, + .extra.bulk_alloc = true}}, #endif #elif defined(RTE_ARCH_ARM64) - [I40E_RX_NEON ] = { i40e_recv_pkts_vec,"Vector Neon" , - {I40E_RX_SCALAR_OFFLOADS ,RTE_VECT_SIMD_128 , {.bulk_alloc = true}}}, - [I40E_RX_NEON_SCATTERED ] = { i40e_recv_scattered_pkts_vec,"Vector Neon Scattered" , - {I40E_RX_SCALAR_OFFLOADS ,RTE_VECT_SIMD_128 , - {.scattered = true, .bulk_alloc = true}}}, + [I40E_RX_NEON ] = { + .pkt_burst = i40e_recv_pkts_vec, + .info ="Vector Neon" , + .features = { + .rx_offloads =I40E_RX_SCALAR_OFFLOADS , + .simd_width =RTE_VECT_SIMD_128 , + .extra.bulk_alloc = true}}, + [I40E_RX_NEON_SCATTERED ] = { + .pkt_burst = i40e_recv_scattered_pkts_vec, + .info ="Vector Neon Scattered" , + .features = { + .rx_offloads =I40E_RX_SCALAR_OFFLOADS , + .simd_width =RTE_VECT_SIMD_128 , + .extra.scattered = true, + .extra.bulk_alloc = true}}, #elif defined(RTE_ARCH_PPC_64) - [I40E_RX_ALTIVEC ] = { i40e_recv_pkts_vec,"Vector AltiVec" , - {I40E_RX_SCALAR_OFFLOADS ,RTE_VECT_SIMD_128 , {.bulk_alloc = true}}}, - [I40E_RX_ALTIVEC_SCATTERED ] = { i40e_recv_scattered_pkts_vec,"Vector AltiVec Scattered" , - {I40E_RX_SCALAR_OFFLOADS ,RTE_VECT_SIMD_128 , - {.scattered = true, .bulk_alloc = true}}}, + [I40E_RX_ALTIVEC ] = { + .pkt_burst = i40e_recv_pkts_vec, + .info ="Vector AltiVec" , + .features = { + .rx_offloads =I40E_RX_SCALAR_OFFLOADS , + .simd_width =RTE_VECT_SIMD_128 , + .extra.bulk_alloc = true}}, + [I40E_RX_ALTIVEC_SCATTERED ] = { + .pkt_burst = i40e_recv_scattered_pkts_vec, + .info ="Vector AltiVec Scattered" , + .features = { + .rx_offloads =I40E_RX_SCALAR_OFFLOADS , + .simd_width =RTE_VECT_SIMD_128 , + .extra.scattered = true, + .extra.bulk_alloc = true}}, #endif };
Signature · 1 line
2.34.1
Re: [PATCH 5/6] net/i40e: reformat the Rx path infos array
Quoted 7 lines · Ciara Loftus
In order to improve readability, reformat the rx path infos array.
Signed-off-by Ciara Loftus <[email protected]>--- drivers/net/intel/i40e/i40e_rxtx.c | 126 ++++++++++++++++++++++------- 1 file changed, 95 insertions(+), 31 deletions(-)
Any comments from previous patch would also apply here too.
PATCH 6/6 net/ice: reformat the Rx path infos array
In reply to Ciara LoftusIn order to improve readability, reformat the rx path infos array.
--- drivers/net/intel/ice/ice_rxtx.c | 124 +++++++++++++++++++++++-------- 1 file changed, 93 insertions(+), 31 deletions(-)
drivers/net/intel/ice/ice_rxtx.c +93 -31
@@ -3667,41 +3667,103 @@ ice_xmit_pkts_simple(void *tx_queue, }static const struct ci_rx_path_info ice_rx_path_infos[] = { - [ICE_RX_DEFAULT ] = {ice_recv_pkts,"Scalar" , - {ICE_RX_SCALAR_OFFLOADS ,RTE_VECT_SIMD_DISABLED }}, - [ICE_RX_SCATTERED ] = {ice_recv_scattered_pkts,"Scalar Scattered" , - {ICE_RX_SCALAR_OFFLOADS ,RTE_VECT_SIMD_DISABLED , {.scattered = true}}}, - [ICE_RX_BULK_ALLOC ] = {ice_recv_pkts_bulk_alloc,"Scalar Bulk Alloc" , - {ICE_RX_SCALAR_OFFLOADS ,RTE_VECT_SIMD_DISABLED , {.bulk_alloc = true}}}, + [ICE_RX_DEFAULT ] = { + .pkt_burst = ice_recv_pkts, + .info ="Scalar" , + .features = { + .rx_offloads =ICE_RX_SCALAR_OFFLOADS , + .simd_width =RTE_VECT_SIMD_DISABLED }}, + [ICE_RX_SCATTERED ] = { + .pkt_burst = ice_recv_scattered_pkts, + .info ="Scalar Scattered" , + .features = { + .rx_offloads =ICE_RX_SCALAR_OFFLOADS , + .simd_width =RTE_VECT_SIMD_DISABLED , + .extra.scattered = true}}, + [ICE_RX_BULK_ALLOC ] = { + .pkt_burst = ice_recv_pkts_bulk_alloc, + .info ="Scalar Bulk Alloc" , + .features = { + .rx_offloads =ICE_RX_SCALAR_OFFLOADS , + .simd_width =RTE_VECT_SIMD_DISABLED , + .extra.bulk_alloc = true}}, #ifdef RTE_ARCH_X86 - [ICE_RX_SSE] = {ice_recv_pkts_vec, "Vector SSE", - {ICE_RX_VECTOR_OFFLOAD_OFFLOADS ,RTE_VECT_SIMD_128 , {.bulk_alloc = true}}}, - [ICE_RX_SSE_SCATTERED ] = {ice_recv_scattered_pkts_vec,"Vector SSE Scattered" , - {ICE_RX_VECTOR_OFFLOAD_OFFLOADS ,RTE_VECT_SIMD_128 , - {.scattered = true, .bulk_alloc = true}}}, - [ICE_RX_AVX2 ] = {ice_recv_pkts_vec_avx2,"Vector AVX2" , - {ICE_RX_VECTOR_OFFLOADS ,RTE_VECT_SIMD_256 , {.bulk_alloc = true}}}, - [ICE_RX_AVX2_SCATTERED ] = {ice_recv_scattered_pkts_vec_avx2,"Vector AVX2 Scattered" , - {ICE_RX_VECTOR_OFFLOADS ,RTE_VECT_SIMD_256 , - {.scattered = true, .bulk_alloc = true}}}, - [ICE_RX_AVX2_OFFLOAD ] = {ice_recv_pkts_vec_avx2_offload,"Offload Vector AVX2" , - {ICE_RX_VECTOR_OFFLOAD_OFFLOADS ,RTE_VECT_SIMD_256 , {.bulk_alloc = true}}}, + [ICE_RX_SSE] = { + .pkt_burst = ice_recv_pkts_vec, + .info ="Vector SSE" , + .features = { + .rx_offloads =ICE_RX_VECTOR_OFFLOAD_OFFLOADS , + .simd_width =RTE_VECT_SIMD_128 , + .extra.bulk_alloc = true}}, + [ICE_RX_SSE_SCATTERED ] = { + .pkt_burst = ice_recv_scattered_pkts_vec, + .info ="Vector SSE Scattered" , + .features = { + .rx_offloads =ICE_RX_VECTOR_OFFLOAD_OFFLOADS , + .simd_width =RTE_VECT_SIMD_128 , + .extra.scattered = true, + .extra.bulk_alloc = true}}, + [ICE_RX_AVX2 ] = { + .pkt_burst = ice_recv_pkts_vec_avx2, + .info ="Vector AVX2" , + .features = { + .rx_offloads =ICE_RX_VECTOR_OFFLOADS , + .simd_width =RTE_VECT_SIMD_256 , + .extra.bulk_alloc = true}}, + [ICE_RX_AVX2_SCATTERED ] = { + .pkt_burst = ice_recv_scattered_pkts_vec_avx2, + .info ="Vector AVX2 Scattered" , + .features = { + .rx_offloads =ICE_RX_VECTOR_OFFLOADS , + .simd_width =RTE_VECT_SIMD_256 , + .extra.scattered = true, + .extra.bulk_alloc = true}}, + [ICE_RX_AVX2_OFFLOAD ] = { + .pkt_burst = ice_recv_pkts_vec_avx2_offload, + .info ="Offload Vector AVX2" , + .features = { + .rx_offloads =ICE_RX_VECTOR_OFFLOAD_OFFLOADS , + .simd_width =RTE_VECT_SIMD_256 , + .extra.bulk_alloc = true}}, [ICE_RX_AVX2_SCATTERED_OFFLOAD ] = { - ice_recv_scattered_pkts_vec_avx2_offload,"Offload Vector AVX2 Scattered" , - {ICE_RX_VECTOR_OFFLOAD_OFFLOADS ,RTE_VECT_SIMD_256 , - {.scattered = true, .bulk_alloc = true}}}, + .pkt_burst = ice_recv_scattered_pkts_vec_avx2_offload, + .info ="Offload Vector AVX2 Scattered" , + .features = { + .rx_offloads =ICE_RX_VECTOR_OFFLOAD_OFFLOADS , + .simd_width =RTE_VECT_SIMD_256 , + .extra.scattered = true, + .extra.bulk_alloc = true}}, #ifdef CC_AVX512_SUPPORT - [ICE_RX_AVX512] = {ice_recv_pkts_vec_avx512, "Vector AVX512", - {ICE_RX_VECTOR_OFFLOADS ,RTE_VECT_SIMD_512 , {.bulk_alloc = true}}}, - [ICE_RX_AVX512_SCATTERED ] = {ice_recv_scattered_pkts_vec_avx512,"Vector AVX512 Scattered" , - {ICE_RX_VECTOR_OFFLOADS ,RTE_VECT_SIMD_512 , - {.scattered = true, .bulk_alloc = true}}}, - [ICE_RX_AVX512_OFFLOAD ] = {ice_recv_pkts_vec_avx512_offload,"Offload Vector AVX512" , - {ICE_RX_VECTOR_OFFLOAD_OFFLOADS ,RTE_VECT_SIMD_512 , {.bulk_alloc = true}}}, + [ICE_RX_AVX512] = { + .pkt_burst = ice_recv_pkts_vec_avx512, + .info ="Vector AVX512" , + .features = { + .rx_offloads =ICE_RX_VECTOR_OFFLOADS , + .simd_width =RTE_VECT_SIMD_512 , + .extra.bulk_alloc = true}}, + [ICE_RX_AVX512_SCATTERED ] = { + .pkt_burst = ice_recv_scattered_pkts_vec_avx512, + .info ="Vector AVX512 Scattered" , + .features = { + .rx_offloads =ICE_RX_VECTOR_OFFLOADS , + .simd_width =RTE_VECT_SIMD_512 , + .extra.scattered = true, + .extra.bulk_alloc = true}}, + [ICE_RX_AVX512_OFFLOAD ] = { + .pkt_burst = ice_recv_pkts_vec_avx512_offload, + .info ="Offload Vector AVX512" , + .features = { + .rx_offloads =ICE_RX_VECTOR_OFFLOAD_OFFLOADS , + .simd_width =RTE_VECT_SIMD_512 , + .extra.bulk_alloc = true}}, [ICE_RX_AVX512_SCATTERED_OFFLOAD ] = { - ice_recv_scattered_pkts_vec_avx512_offload,"Offload Vector AVX512 Scattered" , - {ICE_RX_VECTOR_OFFLOAD_OFFLOADS ,RTE_VECT_SIMD_512 , - {.scattered = true, .bulk_alloc = true}}}, + .pkt_burst = ice_recv_scattered_pkts_vec_avx512_offload, + .info ="Offload Vector AVX512 Scattered" , + .features = { + .rx_offloads =ICE_RX_VECTOR_OFFLOAD_OFFLOADS , + .simd_width =RTE_VECT_SIMD_512 , + .extra.scattered = true, + .extra.bulk_alloc = true}}, #endif #endif };
Signature · 1 line
2.34.1
Re: [PATCH 6/6] net/ice: reformat the Rx path infos array
Quoted 6 lines · Ciara Loftus
In order to improve readability, reformat the rx path infos array.
Signed-off-by Ciara Loftus <[email protected]>--- drivers/net/intel/ice/ice_rxtx.c | 124 +++++++++++++++++++++++-------- 1 file changed, 93 insertions(+), 31 deletions(-)
v2 cover net/intel: fixes and improvements to rx path selection
In reply to Ciara LoftusThis series contains a number of fixes and improvements to the logic concerned with selecting an rx path in the intel drivers.
Patch 1 fixes incorrect behaviour in the ci_rxq_vec_capable function which would disqualify rxqs that have the timestamp offload enabled from selecting vector paths. This was incorrect because iavf vector paths support timestamp offload.
Patch 2 removes a reduntant check from the ci_rxq_vec_capable function that disqualifies rxqs that have the buffer split offload enabled from selecting vector paths. This check is performed during the common rx path selection for three of the drivers and during dev_configure for the fourth, so the check in ci_rxq_vec_capable is unneeded. Although it is similar this patch was kept separate from patch 1 because it is only relevant after the three aformention drivers adopted the common rx path selection infrastructure, whereas patch 1 is a fix for an issue that existed prior to that.
Patches 3 and 4 make fixes to the iavf rx path definitions, ensuring the correct offloads and features are defined for all paths.
The final three patches reformat the arrays in the i40e iavf and ice drivers that hold information for each Rx path that are used in the common selection process, in an attempt to improve readability.
v2:
* Added a new patch (2) that removes the reduntant check for the buffer split offload in the common function.
* Removed the useless defines IAVF_RX_NO_OFFLOADS and ICE_RX_NO_OFFLOADS
* Use a newline for closing braces in the rx path infos arrays
* Let a simd width of zero represent scalar paths instead of 64 which lessens the number of fields that need to be initialised for scalar path definitions
Ciara Loftus (7):
net/intel: fix Rx vector capability detection net/intel: remove redundant Rx offload check net/iavf: fix Rx paths feature definitions net/iavf: fix Rx path selection for scalar flex bulk alloc net/iavf: reformat the Rx path infos array net/i40e: reformat the Rx path infos array net/ice: reformat the Rx path infos array
drivers/net/intel/common/rx.h | 7 +- drivers/net/intel/i40e/i40e_rxtx.c | 149 ++++++-- drivers/net/intel/i40e/i40e_rxtx_vec_common.h | 2 +- drivers/net/intel/iavf/iavf.h | 1 + drivers/net/intel/iavf/iavf_rxtx.c | 335 ++++++++++++++---- drivers/net/intel/iavf/iavf_rxtx.h | 2 - drivers/net/intel/ice/ice_rxtx.c | 147 ++++++-- drivers/net/intel/ice/ice_rxtx.h | 1 - drivers/net/intel/ice/ice_rxtx_vec_common.h | 2 +- .../net/intel/ixgbe/ixgbe_rxtx_vec_common.c | 2 +- 10 files changed, 498 insertions(+), 150 deletions(-)
Signature · 1 line
2.34.1
PATCH v2 1/7 net/intel: fix Rx vector capability detection
The common function for detecting whether an rxq could use a vector rx path would automatically disqualify rx queues that had the timestamp offload enabled. This was incorrect behaviour because the iavf driver which uses this common function supports timestamp offload on its vector paths. Fix this by removing the conditional check for timestamp offload.
--- drivers/net/intel/common/rx.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/net/intel/common/rx.h +2 -3
@@ -235,9 +235,8 @@ ci_rxq_vec_capable(uint16_t nb_desc, uint16_t rx_free_thresh, uint64_t offloads) (nb_desc % rx_free_thresh) != 0)return false; -/* no driver supports timestamping or buffer split on vector path */ -if ((offloads &RTE_ETH_RX_OFFLOAD_TIMESTAMP ) || - (offloads &RTE_ETH_RX_OFFLOAD_BUFFER_SPLIT )) +/* no driver supports buffer split on vector path */ +if (offloads &RTE_ETH_RX_OFFLOAD_BUFFER_SPLIT )return false;return true;
Signature · 1 line
2.34.1
PATCH v2 2/7 net/intel: remove redundant Rx offload check
In reply to Ciara LoftusFour Intel drivers use a common vector compatibility function to determine if certain characteristics about a given rxq are compatible with vector rx paths. The function checks if the buffer split offload is enabled and disqualifies the rxq if it is, because that offload is not available on any vector path. However, this check is redundant because three of the drivers that use that function now use the common rx path selection framework which performs essentially the same validation when ensuring the requested offloads are available on the rx path to be selected. The fourth driver does not support buffer split at all, so the rx queue will never have that offload enabled as initialisation would fail before getting to the path selection step. The redundant check is removed in this commit.
--- drivers/net/intel/common/rx.h | 6 +----- drivers/net/intel/i40e/i40e_rxtx_vec_common.h | 2 +- drivers/net/intel/iavf/iavf_rxtx.c | 2 +- drivers/net/intel/ice/ice_rxtx_vec_common.h | 2 +- drivers/net/intel/ixgbe/ixgbe_rxtx_vec_common.c | 2 +- 5 files changed, 5 insertions(+), 9 deletions(-)
drivers/net/intel/common/rx.h +1 -5
@@ -228,17 +228,13 @@ ci_rxq_mbuf_initializer(uint16_t port_id)* Individual drivers may have other further tests beyond this. */ static inline bool -ci_rxq_vec_capable (uint16_t nb_desc,uint16_t rx_free_thresh,uint64_t offloads) +ci_rxq_vec_capable (uint16_t nb_desc,uint16_t rx_free_thresh) {if (!rte_is_power_of_2 (nb_desc) || rx_free_thresh <CI_RX_MAX_BURST || (nb_desc % rx_free_thresh) !=0 )return false; -/* no driver supports buffer split on vector path */ -if (offloads &RTE_ETH_RX_OFFLOAD_BUFFER_SPLIT ) -return false; -return true; }
drivers/net/intel/i40e/i40e_rxtx_vec_common.h +1 -1
@@ -62,7 +62,7 @@ i40e_rx_vec_dev_conf_condition_check_default(struct rte_eth_dev *dev)struct ci_rx_queue *rxq = dev->data->rx_queues[i];if (!rxq)continue ; -if (!ci_rxq_vec_capable (rxq->nb_rx_desc, rxq->rx_free_thresh, rxq->offloads)) +if (!ci_rxq_vec_capable (rxq->nb_rx_desc, rxq->rx_free_thresh))return -1 ; }
drivers/net/intel/iavf/iavf_rxtx.c +1 -1
@@ -727,7 +727,7 @@ iavf_dev_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,#if definedRTE_ARCH_X86 || definedRTE_ARCH_ARM /* check vector conflict */ -if (ci_rxq_vec_capable (rxq->nb_rx_desc, rxq->rx_free_thresh, rxq->offloads) && +if (ci_rxq_vec_capable (rxq->nb_rx_desc, rxq->rx_free_thresh) &&iavf_rxq_vec_setup (rxq)) {PMD_DRV_LOG (ERR ,"Failed vector rx setup." );return -EINVAL ;
drivers/net/intel/ice/ice_rxtx_vec_common.h +1 -1
@@ -78,7 +78,7 @@ ice_rx_vec_queue_default(struct ci_rx_queue *rxq)if (!rxq)return -1 ; -if (!ci_rxq_vec_capable (rxq->nb_rx_desc, rxq->rx_free_thresh, rxq->offloads)) +if (!ci_rxq_vec_capable (rxq->nb_rx_desc, rxq->rx_free_thresh))return -1 ;if (rxq->proto_xtr !=PROTO_XTR_NONE )
drivers/net/intel/ixgbe/ixgbe_rxtx_vec_common.c +1 -1
@@ -131,7 +131,7 @@ ixgbe_rx_vec_dev_conf_condition_check(struct rte_eth_dev *dev)struct ci_rx_queue *rxq = dev->data->rx_queues[i];if (!rxq)continue ; -if (!ci_rxq_vec_capable (rxq->nb_rx_desc, rxq->rx_free_thresh, rxq->offloads)) +if (!ci_rxq_vec_capable (rxq->nb_rx_desc, rxq->rx_free_thresh))return -1 ; }return 0 ;
Signature · 1 line
2.34.1
PATCH v2 3/7 net/iavf: fix Rx paths feature definitions
In reply to Ciara LoftusTwo rx paths had incorrect feature and offload definitions which led to incorrect path selections. Fix these.
Remove timestamp offload from the list of offloads supported by paths that use the flexible rx descriptor. It is only available in the "offload" versions of those paths.
--- drivers/net/intel/iavf/iavf_rxtx.c | 5 +++-- drivers/net/intel/iavf/iavf_rxtx.h | 1 - 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/intel/iavf/iavf_rxtx.c +3 -2
@@ -3768,13 +3768,14 @@ static const struct ci_rx_path_info iavf_rx_path_infos[] = { {.scattered = true, .flex_desc = true, .bulk_alloc = true}}}, [IAVF_RX_AVX2_FLEX_RXD_OFFLOAD ] = { iavf_recv_pkts_vec_avx2_flex_rxd_offload,"Vector AVX2 Flex Offload" , - {IAVF_RX_VECTOR_OFFLOADS ,RTE_VECT_SIMD_256 , + {IAVF_RX_VECTOR_OFFLOAD_FLEX_OFFLOADS ,RTE_VECT_SIMD_256 , {.flex_desc = true, .bulk_alloc = true}}}, [IAVF_RX_AVX2_SCATTERED_FLEX_RXD_OFFLOAD ] = { iavf_recv_scattered_pkts_vec_avx2_flex_rxd_offload,"Vector Scattered AVX2 Flex Offload" , {IAVF_RX_VECTOR_OFFLOAD_FLEX_OFFLOADS |RTE_ETH_RX_OFFLOAD_SCATTER , -RTE_VECT_SIMD_256 , {.flex_desc = true, .bulk_alloc = true}}}, +RTE_VECT_SIMD_256 , + {.scattered = true, .flex_desc = true, .bulk_alloc = true}}}, #ifdef CC_AVX512_SUPPORT [IAVF_RX_AVX512 ] = {iavf_recv_pkts_vec_avx512,"Vector AVX512" , {IAVF_RX_VECTOR_OFFLOADS, RTE_VECT_SIMD_512, {.bulk_alloc = true}}},
drivers/net/intel/iavf/iavf_rxtx.h +0 -1
@@ -83,7 +83,6 @@/* vector paths that use the flex rx desc */ #define IAVF_RX_VECTOR_FLEX_OFFLOADS ( \ IAVF_RX_VECTOR_OFFLOADS | \ - RTE_ETH_RX_OFFLOAD_TIMESTAMP | \ RTE_ETH_RX_OFFLOAD_SECURITY)/* vector offload paths */ #define IAVF_RX_VECTOR_OFFLOAD_OFFLOADS ( \
Signature · 1 line
2.34.1
PATCH v2 4/7 net/iavf: fix Rx path selection for scalar flex bulk alloc
In reply to Ciara LoftusThe scalar bulk alloc rx burst function supports both legacy and flexible rx descriptors. The rx path selection infrastructure introduced in commit 91e3205d72d8 ("net/iavf: use common Rx path selection infrastructure") cannot define a path that supports both descriptor formats. To solve this problem, have two rx path definitions which both point to the same rx burst function but report different descriptor formats. This allows the rx path selection function to choose the correct path.
--- drivers/net/intel/iavf/iavf.h | 1 + drivers/net/intel/iavf/iavf_rxtx.c | 3 +++ 2 files changed, 4 insertions(+)
drivers/net/intel/iavf/iavf.h +1 -0
@@ -327,6 +327,7 @@ enum iavf_rx_func_type {IAVF_RX_FLEX_RXD ,IAVF_RX_SCATTERED_FLEX_RXD ,IAVF_RX_BULK_ALLOC , +IAVF_RX_BULK_ALLOC_FLEX_RXD ,IAVF_RX_SSE ,IAVF_RX_SSE_SCATTERED , IAVF_RX_SSE_FLEX_RXD,
drivers/net/intel/iavf/iavf_rxtx.c +3 -0
@@ -3734,6 +3734,9 @@ static const struct ci_rx_path_info iavf_rx_path_infos[] = { {.scattered = true, .flex_desc = true}}}, [IAVF_RX_BULK_ALLOC ] = {iavf_recv_pkts_bulk_alloc,"Scalar Bulk Alloc" , {IAVF_RX_SCALAR_OFFLOADS, RTE_VECT_SIMD_DISABLED, {.bulk_alloc = true}}}, + [IAVF_RX_BULK_ALLOC_FLEX_RXD ] = {iavf_recv_pkts_bulk_alloc,"Scalar Bulk Alloc Flex" , + {IAVF_RX_SCALAR_FLEX_OFFLOADS ,RTE_VECT_SIMD_DISABLED , + {.flex_desc = true, .bulk_alloc = true}}}, #ifdef RTE_ARCH_X86 [IAVF_RX_SSE ] = {iavf_recv_pkts_vec,"Vector SSE" , {IAVF_RX_VECTOR_OFFLOAD_OFFLOADS, RTE_VECT_SIMD_128, {.bulk_alloc = true}}},
Signature · 1 line
2.34.1
PATCH v2 5/7 net/iavf: reformat the Rx path infos array
In reply to Ciara LoftusIn order to improve readability, reformat the rx path infos array.
---
v2:
* Removed reduntant assignment to zero value (IAVF_RX_NO_OFFLOADS) and remove its definitions as it is not used any more.
* Newline for closing braces.
* Removed assignment of RTE_VECT_SIMD_DISABLED to simd_width, the selection logic can work when this is set to zero for the scalar path.
--- drivers/net/intel/iavf/iavf_rxtx.c | 337 ++++++++++++++++++++++------- drivers/net/intel/iavf/iavf_rxtx.h | 1 - 2 files changed, 258 insertions(+), 80 deletions(-)
drivers/net/intel/iavf/iavf_rxtx.c +258 -79
@@ -3720,99 +3720,278 @@ iavf_xmit_pkts_no_poll(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts);static const struct ci_rx_path_info iavf_rx_path_infos[] = { - [IAVF_RX_DISABLED ] = {iavf_recv_pkts_no_poll,"Disabled" , - {IAVF_RX_NO_OFFLOADS ,RTE_VECT_SIMD_DISABLED , {.disabled = true}}}, - [IAVF_RX_DEFAULT ] = {iavf_recv_pkts,"Scalar" , - {IAVF_RX_SCALAR_OFFLOADS ,RTE_VECT_SIMD_DISABLED }}, - [IAVF_RX_SCATTERED ] = {iavf_recv_scattered_pkts,"Scalar Scattered" , - {IAVF_RX_SCALAR_OFFLOADS |RTE_ETH_RX_OFFLOAD_SCATTER ,RTE_VECT_SIMD_DISABLED , - {.scattered = true}}}, - [IAVF_RX_FLEX_RXD ] = {iavf_recv_pkts_flex_rxd,"Scalar Flex" , - {IAVF_RX_SCALAR_FLEX_OFFLOADS ,RTE_VECT_SIMD_DISABLED , {.flex_desc = true}}}, - [IAVF_RX_SCATTERED_FLEX_RXD ] = {iavf_recv_scattered_pkts_flex_rxd,"Scalar Scattered Flex" , - {IAVF_RX_SCALAR_FLEX_OFFLOADS |RTE_ETH_RX_OFFLOAD_SCATTER ,RTE_VECT_SIMD_DISABLED , - {.scattered = true, .flex_desc = true}}}, - [IAVF_RX_BULK_ALLOC ] = {iavf_recv_pkts_bulk_alloc,"Scalar Bulk Alloc" , - {IAVF_RX_SCALAR_OFFLOADS ,RTE_VECT_SIMD_DISABLED , {.bulk_alloc = true}}}, - [IAVF_RX_BULK_ALLOC_FLEX_RXD ] = {iavf_recv_pkts_bulk_alloc,"Scalar Bulk Alloc Flex" , - {IAVF_RX_SCALAR_FLEX_OFFLOADS ,RTE_VECT_SIMD_DISABLED , - {.flex_desc = true, .bulk_alloc = true}}}, + [IAVF_RX_DISABLED ] = { + .pkt_burst = iavf_recv_pkts_no_poll, + .info ="Disabled" , + .features = { + .extra.disabled = true + } + }, + [IAVF_RX_DEFAULT ] = { + .pkt_burst = iavf_recv_pkts, + .info ="Scalar" , + .features = { + .rx_offloads =IAVF_RX_SCALAR_OFFLOADS + } + }, + [IAVF_RX_SCATTERED ] = { + .pkt_burst = iavf_recv_scattered_pkts, + .info ="Scalar Scattered" , + .features = { + .rx_offloads =IAVF_RX_SCALAR_OFFLOADS |RTE_ETH_RX_OFFLOAD_SCATTER , + .extra.scattered = true + } + }, + [IAVF_RX_FLEX_RXD ] = { + .pkt_burst = iavf_recv_pkts_flex_rxd, + .info ="Scalar Flex" , + .features = { + .rx_offloads =IAVF_RX_SCALAR_FLEX_OFFLOADS , + .extra.flex_desc = true + } + }, + [IAVF_RX_SCATTERED_FLEX_RXD ] = { + .pkt_burst = iavf_recv_scattered_pkts_flex_rxd, + .info ="Scalar Scattered Flex" , + .features = { + .rx_offloads =IAVF_RX_SCALAR_FLEX_OFFLOADS |RTE_ETH_RX_OFFLOAD_SCATTER , + .extra.scattered = true, + .extra.flex_desc = true + } + }, + [IAVF_RX_BULK_ALLOC ] = { + .pkt_burst = iavf_recv_pkts_bulk_alloc, + .info ="Scalar Bulk Alloc" , + .features = { + .rx_offloads =IAVF_RX_SCALAR_OFFLOADS , + .extra.bulk_alloc = true + } + }, + [IAVF_RX_BULK_ALLOC_FLEX_RXD ] = { + .pkt_burst = iavf_recv_pkts_bulk_alloc, + .info ="Scalar Bulk Alloc Flex" , + .features = { + .rx_offloads =IAVF_RX_SCALAR_FLEX_OFFLOADS , + .extra.flex_desc = true, + .extra.bulk_alloc = true + } + }, #ifdef RTE_ARCH_X86 - [IAVF_RX_SSE] = {iavf_recv_pkts_vec, "Vector SSE", - {IAVF_RX_VECTOR_OFFLOAD_OFFLOADS ,RTE_VECT_SIMD_128 , {.bulk_alloc = true}}}, - [IAVF_RX_SSE_SCATTERED ] = {iavf_recv_scattered_pkts_vec,"Vector Scattered SSE" , - {IAVF_RX_VECTOR_OFFLOADS |RTE_ETH_RX_OFFLOAD_SCATTER ,RTE_VECT_SIMD_128 , - {.scattered = true, .bulk_alloc = true}}}, - [IAVF_RX_SSE_FLEX_RXD ] = {iavf_recv_pkts_vec_flex_rxd,"Vector Flex SSE" , - {IAVF_RX_VECTOR_OFFLOAD_FLEX_OFFLOADS ,RTE_VECT_SIMD_128 , - {.flex_desc = true, .bulk_alloc = true}}}, + [IAVF_RX_SSE] = { + .pkt_burst = iavf_recv_pkts_vec, + .info ="Vector SSE" , + .features = { + .rx_offloads =IAVF_RX_VECTOR_OFFLOAD_OFFLOADS , + .simd_width =RTE_VECT_SIMD_128 , + .extra.bulk_alloc = true + } + }, + [IAVF_RX_SSE_SCATTERED ] = { + .pkt_burst = iavf_recv_scattered_pkts_vec, + .info ="Vector Scattered SSE" , + .features = { + .rx_offloads =IAVF_RX_VECTOR_OFFLOADS |RTE_ETH_RX_OFFLOAD_SCATTER , + .simd_width =RTE_VECT_SIMD_128 , + .extra.scattered = true, + .extra.bulk_alloc = true + } + }, + [IAVF_RX_SSE_FLEX_RXD ] = { + .pkt_burst = iavf_recv_pkts_vec_flex_rxd, + .info ="Vector Flex SSE" , + .features = { + .rx_offloads =IAVF_RX_VECTOR_OFFLOAD_FLEX_OFFLOADS , + .simd_width =RTE_VECT_SIMD_128 , + .extra.flex_desc = true, + .extra.bulk_alloc = true + } + }, [IAVF_RX_SSE_SCATTERED_FLEX_RXD ] = { - iavf_recv_scattered_pkts_vec_flex_rxd,"Vector Scattered SSE Flex" , - {IAVF_RX_VECTOR_OFFLOAD_FLEX_OFFLOADS |RTE_ETH_RX_OFFLOAD_SCATTER , -RTE_VECT_SIMD_128 , - {.scattered = true, .flex_desc = true, .bulk_alloc = true}}}, - [IAVF_RX_AVX2 ] = {iavf_recv_pkts_vec_avx2,"Vector AVX2" , - {IAVF_RX_VECTOR_OFFLOADS ,RTE_VECT_SIMD_256 , {.bulk_alloc = true}}}, - [IAVF_RX_AVX2_SCATTERED ] = {iavf_recv_scattered_pkts_vec_avx2,"Vector Scattered AVX2" , - {IAVF_RX_VECTOR_OFFLOADS |RTE_ETH_RX_OFFLOAD_SCATTER ,RTE_VECT_SIMD_256 , - {.scattered = true, .bulk_alloc = true}}}, - [IAVF_RX_AVX2_OFFLOAD ] = {iavf_recv_pkts_vec_avx2_offload,"Vector AVX2 Offload" , - {IAVF_RX_VECTOR_OFFLOAD_OFFLOADS ,RTE_VECT_SIMD_256 , {.bulk_alloc = true}}}, + .pkt_burst = iavf_recv_scattered_pkts_vec_flex_rxd, + .info ="Vector Scattered SSE Flex" , + .features = { + .rx_offloads =IAVF_RX_VECTOR_OFFLOAD_FLEX_OFFLOADS | +RTE_ETH_RX_OFFLOAD_SCATTER , + .simd_width =RTE_VECT_SIMD_128 , + .extra.scattered = true, + .extra.flex_desc = true, + .extra.bulk_alloc = true + } + }, + [IAVF_RX_AVX2 ] = { + .pkt_burst = iavf_recv_pkts_vec_avx2, + .info ="Vector AVX2" , + .features = { + .rx_offloads =IAVF_RX_VECTOR_OFFLOADS , + .simd_width =RTE_VECT_SIMD_256 , + .extra.bulk_alloc = true + } + }, + [IAVF_RX_AVX2_SCATTERED ] = { + .pkt_burst = iavf_recv_scattered_pkts_vec_avx2, + .info ="Vector Scattered AVX2" , + .features = { + .rx_offloads =IAVF_RX_VECTOR_OFFLOADS |RTE_ETH_RX_OFFLOAD_SCATTER , + .simd_width =RTE_VECT_SIMD_256 , + .extra.scattered = true, + .extra.bulk_alloc = true + } + }, + [IAVF_RX_AVX2_OFFLOAD ] = { + .pkt_burst = iavf_recv_pkts_vec_avx2_offload, + .info ="Vector AVX2 Offload" , + .features = { + .rx_offloads =IAVF_RX_VECTOR_OFFLOAD_OFFLOADS , + .simd_width =RTE_VECT_SIMD_256 , + .extra.bulk_alloc = true + } + }, [IAVF_RX_AVX2_SCATTERED_OFFLOAD ] = { - iavf_recv_scattered_pkts_vec_avx2_offload,"Vector Scattered AVX2 offload" , - {IAVF_RX_VECTOR_OFFLOAD_OFFLOADS |RTE_ETH_RX_OFFLOAD_SCATTER ,RTE_VECT_SIMD_256 , - {.scattered = true, .bulk_alloc = true}}}, - [IAVF_RX_AVX2_FLEX_RXD ] = {iavf_recv_pkts_vec_avx2_flex_rxd,"Vector AVX2 Flex" , - {IAVF_RX_VECTOR_FLEX_OFFLOADS ,RTE_VECT_SIMD_256 , - {.flex_desc = true, .bulk_alloc = true}}}, + .pkt_burst = iavf_recv_scattered_pkts_vec_avx2_offload, + .info ="Vector Scattered AVX2 Offload" , + .features = { + .rx_offloads =IAVF_RX_VECTOR_OFFLOAD_OFFLOADS |RTE_ETH_RX_OFFLOAD_SCATTER , + .simd_width =RTE_VECT_SIMD_256 , + .extra.scattered = true, + .extra.bulk_alloc = true + } + }, + [IAVF_RX_AVX2_FLEX_RXD ] = { + .pkt_burst = iavf_recv_pkts_vec_avx2_flex_rxd, + .info ="Vector AVX2 Flex" , + .features = { + .rx_offloads =IAVF_RX_VECTOR_FLEX_OFFLOADS , + .simd_width =RTE_VECT_SIMD_256 , + .extra.flex_desc = true, + .extra.bulk_alloc = true + } + }, [IAVF_RX_AVX2_SCATTERED_FLEX_RXD ] = { - iavf_recv_scattered_pkts_vec_avx2_flex_rxd,"Vector Scattered AVX2 Flex" , - {IAVF_RX_VECTOR_FLEX_OFFLOADS |RTE_ETH_RX_OFFLOAD_SCATTER ,RTE_VECT_SIMD_256 , - {.scattered = true, .flex_desc = true, .bulk_alloc = true}}}, + .pkt_burst = iavf_recv_scattered_pkts_vec_avx2_flex_rxd, + .info ="Vector Scattered AVX2 Flex" , + .features = { + .rx_offloads =IAVF_RX_VECTOR_FLEX_OFFLOADS |RTE_ETH_RX_OFFLOAD_SCATTER , + .simd_width =RTE_VECT_SIMD_256 , + .extra.scattered = true, + .extra.flex_desc = true, + .extra.bulk_alloc = true + } + }, [IAVF_RX_AVX2_FLEX_RXD_OFFLOAD ] = { - iavf_recv_pkts_vec_avx2_flex_rxd_offload,"Vector AVX2 Flex Offload" , - {IAVF_RX_VECTOR_OFFLOAD_FLEX_OFFLOADS ,RTE_VECT_SIMD_256 , - {.flex_desc = true, .bulk_alloc = true}}}, + .pkt_burst = iavf_recv_pkts_vec_avx2_flex_rxd_offload, + .info ="Vector AVX2 Flex Offload" , + .features = { + .rx_offloads =IAVF_RX_VECTOR_OFFLOAD_FLEX_OFFLOADS , + .simd_width =RTE_VECT_SIMD_256 , + .extra.flex_desc = true, + .extra.bulk_alloc = true + } + }, [IAVF_RX_AVX2_SCATTERED_FLEX_RXD_OFFLOAD ] = { - iavf_recv_scattered_pkts_vec_avx2_flex_rxd_offload, -"Vector Scattered AVX2 Flex Offload" , - {IAVF_RX_VECTOR_OFFLOAD_FLEX_OFFLOADS |RTE_ETH_RX_OFFLOAD_SCATTER , -RTE_VECT_SIMD_256 , - {.scattered = true, .flex_desc = true, .bulk_alloc = true}}}, + .pkt_burst = iavf_recv_scattered_pkts_vec_avx2_flex_rxd_offload, + .info ="Vector Scattered AVX2 Flex Offload" , + .features = { + .rx_offloads =IAVF_RX_VECTOR_OFFLOAD_FLEX_OFFLOADS | +RTE_ETH_RX_OFFLOAD_SCATTER , + .simd_width =RTE_VECT_SIMD_256 , + .extra.scattered = true, + .extra.flex_desc = true, + .extra.bulk_alloc = true + } + }, #ifdef CC_AVX512_SUPPORT - [IAVF_RX_AVX512] = {iavf_recv_pkts_vec_avx512, "Vector AVX512", - {IAVF_RX_VECTOR_OFFLOADS ,RTE_VECT_SIMD_512 , {.bulk_alloc = true}}}, + [IAVF_RX_AVX512] = { + .pkt_burst = iavf_recv_pkts_vec_avx512, + .info ="Vector AVX512" , + .features = { + .rx_offloads =IAVF_RX_VECTOR_OFFLOADS , + .simd_width =RTE_VECT_SIMD_512 , + .extra.bulk_alloc = true + } + }, [IAVF_RX_AVX512_SCATTERED ] = { - iavf_recv_scattered_pkts_vec_avx512,"Vector Scattered AVX512" , - {IAVF_RX_VECTOR_OFFLOADS |RTE_ETH_RX_OFFLOAD_SCATTER ,RTE_VECT_SIMD_512 , - {.scattered = true, .bulk_alloc = true}}}, - [IAVF_RX_AVX512_OFFLOAD ] = {iavf_recv_pkts_vec_avx512_offload,"Vector AVX512 Offload" , - {IAVF_RX_VECTOR_OFFLOAD_OFFLOADS ,RTE_VECT_SIMD_512 , {.bulk_alloc = true}}}, + .pkt_burst = iavf_recv_scattered_pkts_vec_avx512, + .info ="Vector Scattered AVX512" , + .features = { + .rx_offloads =IAVF_RX_VECTOR_OFFLOADS |RTE_ETH_RX_OFFLOAD_SCATTER , + .simd_width =RTE_VECT_SIMD_512 , + .extra.scattered = true, + .extra.bulk_alloc = true + } + }, + [IAVF_RX_AVX512_OFFLOAD ] = { + .pkt_burst = iavf_recv_pkts_vec_avx512_offload, + .info ="Vector AVX512 Offload" , + .features = { + .rx_offloads =IAVF_RX_VECTOR_OFFLOAD_OFFLOADS , + .simd_width =RTE_VECT_SIMD_512 , + .extra.bulk_alloc = true + } + }, [IAVF_RX_AVX512_SCATTERED_OFFLOAD ] = { - iavf_recv_scattered_pkts_vec_avx512_offload,"Vector Scattered AVX512 offload" , - {IAVF_RX_VECTOR_OFFLOAD_OFFLOADS |RTE_ETH_RX_OFFLOAD_SCATTER ,RTE_VECT_SIMD_512 , - {.scattered = true, .bulk_alloc = true}}}, - [IAVF_RX_AVX512_FLEX_RXD ] = {iavf_recv_pkts_vec_avx512_flex_rxd,"Vector AVX512 Flex" , - {IAVF_RX_VECTOR_FLEX_OFFLOADS ,RTE_VECT_SIMD_512 , - {.flex_desc = true, .bulk_alloc = true}}}, + .pkt_burst = iavf_recv_scattered_pkts_vec_avx512_offload, + .info ="Vector Scattered AVX512 Offload" , + .features = { + .rx_offloads =IAVF_RX_VECTOR_OFFLOAD_OFFLOADS |RTE_ETH_RX_OFFLOAD_SCATTER , + .simd_width =RTE_VECT_SIMD_512 , + .extra.scattered = true, + .extra.bulk_alloc = true + } + }, + [IAVF_RX_AVX512_FLEX_RXD ] = { + .pkt_burst = iavf_recv_pkts_vec_avx512_flex_rxd, + .info ="Vector AVX512 Flex" , + .features = { + .rx_offloads =IAVF_RX_VECTOR_FLEX_OFFLOADS , + .simd_width =RTE_VECT_SIMD_512 , + .extra.flex_desc = true, + .extra.bulk_alloc = true + } + }, [IAVF_RX_AVX512_SCATTERED_FLEX_RXD ] = { - iavf_recv_scattered_pkts_vec_avx512_flex_rxd,"Vector Scattered AVX512 Flex" , - {IAVF_RX_VECTOR_FLEX_OFFLOADS |RTE_ETH_RX_OFFLOAD_SCATTER ,RTE_VECT_SIMD_512 , - {.scattered = true, .flex_desc = true, .bulk_alloc = true}}}, + .pkt_burst = iavf_recv_scattered_pkts_vec_avx512_flex_rxd, + .info ="Vector Scattered AVX512 Flex" , + .features = { + .rx_offloads =IAVF_RX_VECTOR_FLEX_OFFLOADS |RTE_ETH_RX_OFFLOAD_SCATTER , + .simd_width =RTE_VECT_SIMD_512 , + .extra.scattered = true, + .extra.flex_desc = true, + .extra.bulk_alloc = true + } + }, [IAVF_RX_AVX512_FLEX_RXD_OFFLOAD ] = { - iavf_recv_pkts_vec_avx512_flex_rxd_offload,"Vector AVX512 Flex Offload" , - {IAVF_RX_VECTOR_OFFLOAD_FLEX_OFFLOADS ,RTE_VECT_SIMD_512 , - {.flex_desc = true, .bulk_alloc = true}}}, + .pkt_burst = iavf_recv_pkts_vec_avx512_flex_rxd_offload, + .info ="Vector AVX512 Flex Offload" , + .features = { + .rx_offloads =IAVF_RX_VECTOR_OFFLOAD_FLEX_OFFLOADS , + .simd_width =RTE_VECT_SIMD_512 , + .extra.flex_desc = true, + .extra.bulk_alloc = true + } + }, [IAVF_RX_AVX512_SCATTERED_FLEX_RXD_OFFLOAD ] = { - iavf_recv_scattered_pkts_vec_avx512_flex_rxd_offload, -"Vector Scattered AVX512 Flex offload" , - {IAVF_RX_VECTOR_OFFLOAD_FLEX_OFFLOADS |RTE_ETH_RX_OFFLOAD_SCATTER , -RTE_VECT_SIMD_512 , - {.scattered = true, .flex_desc = true, .bulk_alloc = true}}}, + .pkt_burst = iavf_recv_scattered_pkts_vec_avx512_flex_rxd_offload, + .info ="Vector Scattered AVX512 Flex Offload" , + .features = { + .rx_offloads =IAVF_RX_VECTOR_OFFLOAD_FLEX_OFFLOADS | +RTE_ETH_RX_OFFLOAD_SCATTER , + .simd_width =RTE_VECT_SIMD_512 , + .extra.scattered = true, + .extra.flex_desc = true, + .extra.bulk_alloc = true + } + }, #endif #elif defined RTE_ARCH_ARM - [IAVF_RX_SSE] = {iavf_recv_pkts_vec, "Vector Neon", - {IAVF_RX_SCALAR_OFFLOADS ,RTE_VECT_SIMD_128 , {.bulk_alloc = true}}}, + [IAVF_RX_SSE] = { + .pkt_burst = iavf_recv_pkts_vec, + .info ="Vector Neon" , + .features = { + .rx_offloads =IAVF_RX_SCALAR_OFFLOADS , + .simd_width =RTE_VECT_SIMD_128 , + .extra.bulk_alloc = true + } + }, #endif };
drivers/net/intel/iavf/iavf_rxtx.h +0 -1
@@ -55,7 +55,6 @@ RTE_ETH_TX_OFFLOAD_OUTER_UDP_CKSUM | \ RTE_ETH_TX_OFFLOAD_QINQ_INSERT) -#define IAVF_RX_NO_OFFLOADS 0/* basic scalar path */ #define IAVF_RX_SCALAR_OFFLOADS ( \ RTE_ETH_RX_OFFLOAD_VLAN_STRIP | \
Signature · 1 line
2.34.1
PATCH v2 6/7 net/i40e: reformat the Rx path infos array
In reply to Ciara LoftusIn order to improve readability, reformat the rx path infos array.
---
v2:
* Newline for closing braces.
* Removed assignment of RTE_VECT_SIMD_DISABLED to simd_width, the selection logic can work when this is set to zero for the scalar path.
--- drivers/net/intel/i40e/i40e_rxtx.c | 149 +++++++++++++++++++++++------ 1 file changed, 118 insertions(+), 31 deletions(-)
drivers/net/intel/i40e/i40e_rxtx.c +118 -31
@@ -3290,42 +3290,129 @@ i40e_recycle_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id, }static const struct ci_rx_path_info i40e_rx_path_infos[] = { - [I40E_RX_DEFAULT ] = { i40e_recv_pkts,"Scalar" , - {I40E_RX_SCALAR_OFFLOADS ,RTE_VECT_SIMD_DISABLED }}, - [I40E_RX_SCATTERED ] = { i40e_recv_scattered_pkts,"Scalar Scattered" , - {I40E_RX_SCALAR_OFFLOADS ,RTE_VECT_SIMD_DISABLED , {.scattered = true}}}, - [I40E_RX_BULK_ALLOC ] = { i40e_recv_pkts_bulk_alloc,"Scalar Bulk Alloc" , - {I40E_RX_SCALAR_OFFLOADS ,RTE_VECT_SIMD_DISABLED , {.bulk_alloc = true}}}, + [I40E_RX_DEFAULT ] = { + .pkt_burst = i40e_recv_pkts, + .info ="Scalar" , + .features = { + .rx_offloads =I40E_RX_SCALAR_OFFLOADS + } + }, + [I40E_RX_SCATTERED ] = { + .pkt_burst = i40e_recv_scattered_pkts, + .info ="Scalar Scattered" , + .features = { + .rx_offloads =I40E_RX_SCALAR_OFFLOADS , + .extra.scattered = true + } + }, + [I40E_RX_BULK_ALLOC ] = { + .pkt_burst = i40e_recv_pkts_bulk_alloc, + .info ="Scalar Bulk Alloc" , + .features = { + .rx_offloads =I40E_RX_SCALAR_OFFLOADS , + .extra.bulk_alloc = true + } + }, #ifdef RTE_ARCH_X86 - [I40E_RX_SSE] = { i40e_recv_pkts_vec, "Vector SSE", - {I40E_RX_VECTOR_OFFLOADS ,RTE_VECT_SIMD_128 , {.bulk_alloc = true}}}, - [I40E_RX_SSE_SCATTERED ] = { i40e_recv_scattered_pkts_vec,"Vector SSE Scattered" , - {I40E_RX_VECTOR_OFFLOADS ,RTE_VECT_SIMD_128 , - {.scattered = true, .bulk_alloc = true}}}, - [I40E_RX_AVX2 ] = { i40e_recv_pkts_vec_avx2,"Vector AVX2" , - {I40E_RX_VECTOR_OFFLOADS ,RTE_VECT_SIMD_256 , {.bulk_alloc = true}}}, - [I40E_RX_AVX2_SCATTERED ] = { i40e_recv_scattered_pkts_vec_avx2,"Vector AVX2 Scattered" , - {I40E_RX_VECTOR_OFFLOADS ,RTE_VECT_SIMD_256 , - {.scattered = true, .bulk_alloc = true}}}, + [I40E_RX_SSE] = { + .pkt_burst = i40e_recv_pkts_vec, + .info ="Vector SSE" , + .features = { + .rx_offloads =I40E_RX_VECTOR_OFFLOADS , + .simd_width =RTE_VECT_SIMD_128 , + .extra.bulk_alloc = true + } + }, + [I40E_RX_SSE_SCATTERED ] = { + .pkt_burst = i40e_recv_scattered_pkts_vec, + .info ="Vector SSE Scattered" , + .features = { + .rx_offloads =I40E_RX_VECTOR_OFFLOADS , + .simd_width =RTE_VECT_SIMD_128 , + .extra.scattered = true, + .extra.bulk_alloc = true + } + }, + [I40E_RX_AVX2 ] = { + .pkt_burst = i40e_recv_pkts_vec_avx2, + .info ="Vector AVX2" , + .features = { + .rx_offloads =I40E_RX_VECTOR_OFFLOADS , + .simd_width =RTE_VECT_SIMD_256 , + .extra.bulk_alloc = true + } + }, + [I40E_RX_AVX2_SCATTERED ] = { + .pkt_burst = i40e_recv_scattered_pkts_vec_avx2, + .info ="Vector AVX2 Scattered" , + .features = { + .rx_offloads =I40E_RX_VECTOR_OFFLOADS , + .simd_width =RTE_VECT_SIMD_256 , + .extra.scattered = true, + .extra.bulk_alloc = true + } + }, #ifdef CC_AVX512_SUPPORT - [I40E_RX_AVX512] = { i40e_recv_pkts_vec_avx512, "Vector AVX512", - {I40E_RX_VECTOR_OFFLOADS ,RTE_VECT_SIMD_512 , {.bulk_alloc = true}}}, - [I40E_RX_AVX512_SCATTERED ] = { i40e_recv_scattered_pkts_vec_avx512, -"Vector AVX512 Scattered" , {I40E_RX_VECTOR_OFFLOADS ,RTE_VECT_SIMD_512 , - {.scattered = true, .bulk_alloc = true}}}, + [I40E_RX_AVX512] = { + .pkt_burst = i40e_recv_pkts_vec_avx512, + .info ="Vector AVX512" , + .features = { + .rx_offloads =I40E_RX_VECTOR_OFFLOADS , + .simd_width =RTE_VECT_SIMD_512 , + .extra.bulk_alloc = true + } + }, + [I40E_RX_AVX512_SCATTERED ] = { + .pkt_burst = i40e_recv_scattered_pkts_vec_avx512, + .info ="Vector AVX512 Scattered" , + .features = { + .rx_offloads =I40E_RX_VECTOR_OFFLOADS , + .simd_width =RTE_VECT_SIMD_512 , + .extra.scattered = true, + .extra.bulk_alloc = true + } + }, #endif #elif defined(RTE_ARCH_ARM64) - [I40E_RX_NEON ] = { i40e_recv_pkts_vec,"Vector Neon" , - {I40E_RX_SCALAR_OFFLOADS ,RTE_VECT_SIMD_128 , {.bulk_alloc = true}}}, - [I40E_RX_NEON_SCATTERED ] = { i40e_recv_scattered_pkts_vec,"Vector Neon Scattered" , - {I40E_RX_SCALAR_OFFLOADS ,RTE_VECT_SIMD_128 , - {.scattered = true, .bulk_alloc = true}}}, + [I40E_RX_NEON ] = { + .pkt_burst = i40e_recv_pkts_vec, + .info ="Vector Neon" , + .features = { + .rx_offloads =I40E_RX_SCALAR_OFFLOADS , + .simd_width =RTE_VECT_SIMD_128 , + .extra.bulk_alloc = true + } + }, + [I40E_RX_NEON_SCATTERED ] = { + .pkt_burst = i40e_recv_scattered_pkts_vec, + .info ="Vector Neon Scattered" , + .features = { + .rx_offloads =I40E_RX_SCALAR_OFFLOADS , + .simd_width =RTE_VECT_SIMD_128 , + .extra.scattered = true, + .extra.bulk_alloc = true + } + }, #elif defined(RTE_ARCH_PPC_64) - [I40E_RX_ALTIVEC ] = { i40e_recv_pkts_vec,"Vector AltiVec" , - {I40E_RX_SCALAR_OFFLOADS ,RTE_VECT_SIMD_128 , {.bulk_alloc = true}}}, - [I40E_RX_ALTIVEC_SCATTERED ] = { i40e_recv_scattered_pkts_vec,"Vector AltiVec Scattered" , - {I40E_RX_SCALAR_OFFLOADS ,RTE_VECT_SIMD_128 , - {.scattered = true, .bulk_alloc = true}}}, + [I40E_RX_ALTIVEC ] = { + .pkt_burst = i40e_recv_pkts_vec, + .info ="Vector AltiVec" , + .features = { + .rx_offloads =I40E_RX_SCALAR_OFFLOADS , + .simd_width =RTE_VECT_SIMD_128 , + .extra.bulk_alloc = true + } + }, + [I40E_RX_ALTIVEC_SCATTERED ] = { + .pkt_burst = i40e_recv_scattered_pkts_vec, + .info ="Vector AltiVec Scattered" , + .features = { + .rx_offloads =I40E_RX_SCALAR_OFFLOADS , + .simd_width =RTE_VECT_SIMD_128 , + .extra.scattered = true, + .extra.bulk_alloc = true + } + }, #endif };
Signature · 1 line
2.34.1
PATCH v2 7/7 net/ice: reformat the Rx path infos array
In reply to Ciara LoftusIn order to improve readability, reformat the rx path infos array.
---
v2:
* Newline for closing braces.
* Removed assignment of RTE_VECT_SIMD_DISABLED to simd_width, the selection logic can work when this is set to zero for the scalar path.
* Removed unused define ICE_RX_NO_OFFLOADS
--- drivers/net/intel/ice/ice_rxtx.c | 147 ++++++++++++++++++++++++------- drivers/net/intel/ice/ice_rxtx.h | 1 - 2 files changed, 116 insertions(+), 32 deletions(-)
drivers/net/intel/ice/ice_rxtx.c +116 -31
@@ -3667,41 +3667,126 @@ ice_xmit_pkts_simple(void *tx_queue, }static const struct ci_rx_path_info ice_rx_path_infos[] = { - [ICE_RX_DEFAULT ] = {ice_recv_pkts,"Scalar" , - {ICE_RX_SCALAR_OFFLOADS ,RTE_VECT_SIMD_DISABLED }}, - [ICE_RX_SCATTERED ] = {ice_recv_scattered_pkts,"Scalar Scattered" , - {ICE_RX_SCALAR_OFFLOADS ,RTE_VECT_SIMD_DISABLED , {.scattered = true}}}, - [ICE_RX_BULK_ALLOC ] = {ice_recv_pkts_bulk_alloc,"Scalar Bulk Alloc" , - {ICE_RX_SCALAR_OFFLOADS ,RTE_VECT_SIMD_DISABLED , {.bulk_alloc = true}}}, + [ICE_RX_DEFAULT ] = { + .pkt_burst = ice_recv_pkts, + .info ="Scalar" , + .features = { + .rx_offloads =ICE_RX_SCALAR_OFFLOADS + } + }, + [ICE_RX_SCATTERED ] = { + .pkt_burst = ice_recv_scattered_pkts, + .info ="Scalar Scattered" , + .features = { + .rx_offloads =ICE_RX_SCALAR_OFFLOADS , + .extra.scattered = true + } + }, + [ICE_RX_BULK_ALLOC ] = { + .pkt_burst = ice_recv_pkts_bulk_alloc, + .info ="Scalar Bulk Alloc" , + .features = { + .rx_offloads =ICE_RX_SCALAR_OFFLOADS , + .extra.bulk_alloc = true + } + }, #ifdef RTE_ARCH_X86 - [ICE_RX_SSE] = {ice_recv_pkts_vec, "Vector SSE", - {ICE_RX_VECTOR_OFFLOAD_OFFLOADS ,RTE_VECT_SIMD_128 , {.bulk_alloc = true}}}, - [ICE_RX_SSE_SCATTERED ] = {ice_recv_scattered_pkts_vec,"Vector SSE Scattered" , - {ICE_RX_VECTOR_OFFLOAD_OFFLOADS ,RTE_VECT_SIMD_128 , - {.scattered = true, .bulk_alloc = true}}}, - [ICE_RX_AVX2 ] = {ice_recv_pkts_vec_avx2,"Vector AVX2" , - {ICE_RX_VECTOR_OFFLOADS ,RTE_VECT_SIMD_256 , {.bulk_alloc = true}}}, - [ICE_RX_AVX2_SCATTERED ] = {ice_recv_scattered_pkts_vec_avx2,"Vector AVX2 Scattered" , - {ICE_RX_VECTOR_OFFLOADS ,RTE_VECT_SIMD_256 , - {.scattered = true, .bulk_alloc = true}}}, - [ICE_RX_AVX2_OFFLOAD ] = {ice_recv_pkts_vec_avx2_offload,"Offload Vector AVX2" , - {ICE_RX_VECTOR_OFFLOAD_OFFLOADS ,RTE_VECT_SIMD_256 , {.bulk_alloc = true}}}, + [ICE_RX_SSE] = { + .pkt_burst = ice_recv_pkts_vec, + .info ="Vector SSE" , + .features = { + .rx_offloads =ICE_RX_VECTOR_OFFLOAD_OFFLOADS , + .simd_width =RTE_VECT_SIMD_128 , + .extra.bulk_alloc = true + } + }, + [ICE_RX_SSE_SCATTERED ] = { + .pkt_burst = ice_recv_scattered_pkts_vec, + .info ="Vector SSE Scattered" , + .features = { + .rx_offloads =ICE_RX_VECTOR_OFFLOAD_OFFLOADS , + .simd_width =RTE_VECT_SIMD_128 , + .extra.scattered = true, + .extra.bulk_alloc = true + } + }, + [ICE_RX_AVX2 ] = { + .pkt_burst = ice_recv_pkts_vec_avx2, + .info ="Vector AVX2" , + .features = { + .rx_offloads =ICE_RX_VECTOR_OFFLOADS , + .simd_width =RTE_VECT_SIMD_256 , + .extra.bulk_alloc = true + } + }, + [ICE_RX_AVX2_SCATTERED ] = { + .pkt_burst = ice_recv_scattered_pkts_vec_avx2, + .info ="Vector AVX2 Scattered" , + .features = { + .rx_offloads =ICE_RX_VECTOR_OFFLOADS , + .simd_width =RTE_VECT_SIMD_256 , + .extra.scattered = true, + .extra.bulk_alloc = true + } + }, + [ICE_RX_AVX2_OFFLOAD ] = { + .pkt_burst = ice_recv_pkts_vec_avx2_offload, + .info ="Offload Vector AVX2" , + .features = { + .rx_offloads =ICE_RX_VECTOR_OFFLOAD_OFFLOADS , + .simd_width =RTE_VECT_SIMD_256 , + .extra.bulk_alloc = true + } + }, [ICE_RX_AVX2_SCATTERED_OFFLOAD ] = { - ice_recv_scattered_pkts_vec_avx2_offload,"Offload Vector AVX2 Scattered" , - {ICE_RX_VECTOR_OFFLOAD_OFFLOADS ,RTE_VECT_SIMD_256 , - {.scattered = true, .bulk_alloc = true}}}, + .pkt_burst = ice_recv_scattered_pkts_vec_avx2_offload, + .info ="Offload Vector AVX2 Scattered" , + .features = { + .rx_offloads =ICE_RX_VECTOR_OFFLOAD_OFFLOADS , + .simd_width =RTE_VECT_SIMD_256 , + .extra.scattered = true, + .extra.bulk_alloc = true + } + }, #ifdef CC_AVX512_SUPPORT - [ICE_RX_AVX512] = {ice_recv_pkts_vec_avx512, "Vector AVX512", - {ICE_RX_VECTOR_OFFLOADS ,RTE_VECT_SIMD_512 , {.bulk_alloc = true}}}, - [ICE_RX_AVX512_SCATTERED ] = {ice_recv_scattered_pkts_vec_avx512,"Vector AVX512 Scattered" , - {ICE_RX_VECTOR_OFFLOADS ,RTE_VECT_SIMD_512 , - {.scattered = true, .bulk_alloc = true}}}, - [ICE_RX_AVX512_OFFLOAD ] = {ice_recv_pkts_vec_avx512_offload,"Offload Vector AVX512" , - {ICE_RX_VECTOR_OFFLOAD_OFFLOADS ,RTE_VECT_SIMD_512 , {.bulk_alloc = true}}}, + [ICE_RX_AVX512] = { + .pkt_burst = ice_recv_pkts_vec_avx512, + .info ="Vector AVX512" , + .features = { + .rx_offloads =ICE_RX_VECTOR_OFFLOADS , + .simd_width =RTE_VECT_SIMD_512 , + .extra.bulk_alloc = true + } + }, + [ICE_RX_AVX512_SCATTERED ] = { + .pkt_burst = ice_recv_scattered_pkts_vec_avx512, + .info ="Vector AVX512 Scattered" , + .features = { + .rx_offloads =ICE_RX_VECTOR_OFFLOADS , + .simd_width =RTE_VECT_SIMD_512 , + .extra.scattered = true, + .extra.bulk_alloc = true + } + }, + [ICE_RX_AVX512_OFFLOAD ] = { + .pkt_burst = ice_recv_pkts_vec_avx512_offload, + .info ="Offload Vector AVX512" , + .features = { + .rx_offloads =ICE_RX_VECTOR_OFFLOAD_OFFLOADS , + .simd_width =RTE_VECT_SIMD_512 , + .extra.bulk_alloc = true + } + }, [ICE_RX_AVX512_SCATTERED_OFFLOAD ] = { - ice_recv_scattered_pkts_vec_avx512_offload,"Offload Vector AVX512 Scattered" , - {ICE_RX_VECTOR_OFFLOAD_OFFLOADS ,RTE_VECT_SIMD_512 , - {.scattered = true, .bulk_alloc = true}}}, + .pkt_burst = ice_recv_scattered_pkts_vec_avx512_offload, + .info ="Offload Vector AVX512 Scattered" , + .features = { + .rx_offloads =ICE_RX_VECTOR_OFFLOAD_OFFLOADS , + .simd_width =RTE_VECT_SIMD_512 , + .extra.scattered = true, + .extra.bulk_alloc = true + } + }, #endif #endif };
drivers/net/intel/ice/ice_rxtx.h +0 -1
@@ -80,7 +80,6 @@#define ICE_TX_OFFLOAD_NOTSUP_MASK \ (RTE_MBUF_F_TX_OFFLOAD_MASK ^ ICE_TX_OFFLOAD_MASK) -#define ICE_RX_NO_OFFLOADS 0/* basic scalar path */ #define ICE_RX_SCALAR_OFFLOADS ( \ RTE_ETH_RX_OFFLOAD_VLAN_STRIP | \
Signature · 1 line
2.34.1
Bruce Richardson
AppliedQuoted 34 lines · Ciara Loftus
This series contains a number of fixes and improvements to the logic concerned with selecting an rx path in the intel drivers.
Patch 1 fixes incorrect behaviour in the
ci_rxq_vec_capablefunction which would disqualify rxqs that have the timestamp offload enabled from selecting vector paths. This was incorrect because iavf vector paths support timestamp offload.Patch 2 removes a reduntant check from the
ci_rxq_vec_capablefunction that disqualifies rxqs that have the buffer split offload enabled from selecting vector paths. This check is performed during the common rx path selection for three of the drivers and duringdev_configurefor the fourth, so the check inci_rxq_vec_capableis unneeded. Although it is similar this patch was kept separate from patch 1 because it is only relevant after the three aformention drivers adopted the common rx path selection infrastructure, whereas patch 1 is a fix for an issue that existed prior to that.Patches 3 and 4 make fixes to the iavf rx path definitions, ensuring the correct offloads and features are defined for all paths.
The final three patches reformat the arrays in the i40e iavf and ice drivers that hold information for each Rx path that are used in the common selection process, in an attempt to improve readability.
v2:
* Added a new patch (2) that removes the reduntant check for the buffer split offload in the common function.
* Removed the useless definesIAVF_RX_NO_OFFLOADSandICE_RX_NO_OFFLOADS
* Use a newline for closing braces in the rx path infos arrays
* Let a simd width of zero represent scalar paths instead of 64 which lessens the number of fields that need to be initialised for scalar path definitions
Quoted 9 lines
Ciara Loftus (7):
net/intel: fix Rx vector capability detection net/intel: remove redundant Rx offload check net/iavf: fix Rx paths feature definitions net/iavf: fix Rx path selection for scalar flex bulk alloc net/iavf: reformat the Rx path infos array net/i40e: reformat the Rx path infos array net/ice: reformat the Rx path infos array
Applied to dpdk-next-net-intel, but with patches 1 & 2 squashed into one. I don't think that we need two patches to remove the conditional, it's a basic enough change to do in one.
Thanks,
/Bruce