net/bnxt: vector PMD improvements
cover net/bnxt: vector PMD improvements
Fixes and optimizations to improve bnxt vector mode performance and functionality.
Lance Richardson (12):
net/bnxt: fix burst mode get for Arm
net/bnxt: fix rxq/txq get information
net/bnxt: use appropriate type for Rx mbuf ring net/bnxt: require async cq for vector mode net/bnxt: improve support for small ring sizes net/bnxt: use smaller cq when agg ring not needed net/bnxt: increase max burst size for vector mode net/bnxt: use table-based packet type translation net/bnxt: table-based handling for ol flags net/bnxt: optimize vector mode mbuf allocation net/bnxt: handle multiple packets per loop in vector PMD net/bnxt: transmit vector mode improvements
drivers/net/bnxt/bnxt.h | 19 +- drivers/net/bnxt/bnxt_ethdev.c | 85 ++-- drivers/net/bnxt/bnxt_reps.c | 21 +- drivers/net/bnxt/bnxt_ring.c | 4 +- drivers/net/bnxt/bnxt_rxq.c | 21 +- drivers/net/bnxt/bnxt_rxq.h | 1 + drivers/net/bnxt/bnxt_rxr.c | 362 ++++++++------ drivers/net/bnxt/bnxt_rxr.h | 16 +- drivers/net/bnxt/bnxt_rxtx_vec_common.h | 52 +- drivers/net/bnxt/bnxt_rxtx_vec_neon.c | 524 +++++++++++---------- drivers/net/bnxt/bnxt_rxtx_vec_sse.c | 600 ++++++++++++------------ drivers/net/bnxt/bnxt_txq.c | 7 +- 12 files changed, 964 insertions(+), 748 deletions(-)
Signature · 1 line
2.25.1
PATCH 1/12 net/bnxt: fix burst mode get for Arm
Transmit and receive burst mode get operations incorrectly return "Vector SSE" on ARM64 platforms, change to return "Vector Neon" instead.
--- drivers/net/bnxt/bnxt_ethdev.c | 60 +++++++++++++++++++++------------- 1 file changed, 38 insertions(+), 22 deletions(-)
drivers/net/bnxt/bnxt_ethdev.c +38 -22
@@ -2615,46 +2615,62 @@ bnxt_txq_info_get_op(struct rte_eth_dev *dev, uint16_t queue_id, qinfo->conf.tx_deferred_start = txq->tx_deferred_start; } +static const struct { +eth_rx_burst_t pkt_burst; +const char *info; +} bnxt_rx_burst_info[] = { + {bnxt_recv_pkts,"Scalar" }, +#if defined(RTE_ARCH_X86) + {bnxt_recv_pkts_vec,"Vector SSE" }, +#elif defined(RTE_ARCH_ARM64) + {bnxt_recv_pkts_vec,"Vector Neon" }, +#endif +}; +static int bnxt_rx_burst_mode_get(struct rte_eth_dev *dev, __rte_unused uint16_t queue_id,struct rte_eth_burst_mode *mode) {eth_rx_burst_t pkt_burst = dev->rx_pkt_burst; +size_t i; -if (pkt_burst == bnxt_recv_pkts) { -snprintf (mode->info,sizeof (mode->info),"%s" , -"Scalar" ); -return 0 ; - } -#if defined(RTE_ARCH_X86 ) || defined(RTE_ARCH_ARM64 ) -if (pkt_burst == bnxt_recv_pkts_vec) { -snprintf (mode->info,sizeof (mode->info),"%s" , -"Vector SSE" ); -return 0 ; +for (i =0 ; i <RTE_DIM (bnxt_rx_burst_info); i++) { +if (pkt_burst == bnxt_rx_burst_info[i].pkt_burst) { +snprintf (mode->info,sizeof (mode->info),"%s" , + bnxt_rx_burst_info[i].info); +return 0 ; + } } -#endif return -EINVAL ; } +static const struct { +eth_tx_burst_t pkt_burst; +const char *info; +} bnxt_tx_burst_info[] = { + {bnxt_xmit_pkts,"Scalar" }, +#if defined(RTE_ARCH_X86) + {bnxt_xmit_pkts_vec,"Vector SSE" }, +#elif defined(RTE_ARCH_ARM64) + {bnxt_xmit_pkts_vec,"Vector Neon" }, +#endif +}; +static int bnxt_tx_burst_mode_get(struct rte_eth_dev *dev, __rte_unused uint16_t queue_id,struct rte_eth_burst_mode *mode) {eth_tx_burst_t pkt_burst = dev->tx_pkt_burst; +size_t i; -if (pkt_burst == bnxt_xmit_pkts) { -snprintf (mode->info,sizeof (mode->info),"%s" , -"Scalar" ); -return 0 ; - } -#if defined(RTE_ARCH_X86 ) || defined(RTE_ARCH_ARM64 ) -if (pkt_burst == bnxt_xmit_pkts_vec) { -snprintf (mode->info,sizeof (mode->info),"%s" , -"Vector SSE" ); -return 0 ; +for (i =0 ; i <RTE_DIM (bnxt_tx_burst_info); i++) { +if (pkt_burst == bnxt_tx_burst_info[i].pkt_burst) { +snprintf (mode->info,sizeof (mode->info),"%s" , + bnxt_tx_burst_info[i].info); +return 0 ; + } } -#endif return -EINVAL ; }
Signature · 1 line
2.25.1
PATCH 2/12 net/bnxt: fix rxq/txq get information
In reply to Lance RichardsonReturn correct values for Rx/Tx offloads and for rx_drop_en.
--- drivers/net/bnxt/bnxt_ethdev.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/bnxt/bnxt_ethdev.c +3 -1
@@ -2588,8 +2588,9 @@ bnxt_rxq_info_get_op(struct rte_eth_dev *dev, uint16_t queue_id, qinfo->nb_desc = rxq->nb_rx_desc; qinfo->conf.rx_free_thresh = rxq->rx_free_thresh; - qinfo->conf.rx_drop_en =0 ; + qinfo->conf.rx_drop_en =1 ; qinfo->conf.rx_deferred_start = rxq->rx_deferred_start; + qinfo->conf.offloads = dev->data->dev_conf.rxmode.offloads; } static void
@@ -2613,6 +2614,7 @@ bnxt_txq_info_get_op(struct rte_eth_dev *dev, uint16_t queue_id, qinfo->conf.tx_free_thresh = txq->tx_free_thresh; qinfo->conf.tx_rs_thresh =0 ; qinfo->conf.tx_deferred_start = txq->tx_deferred_start; + qinfo->conf.offloads = dev->data->dev_conf.txmode.offloads; } static const struct {
Signature · 1 line
2.25.1
Re: [dpdk-dev] [PATCH 02/12] net/bnxt: fix rxq/txq get information
Quoted 15 lines · Lance Richardson
Return correct values for Rx/Tx offloads and for
rx_drop_en.Fixes 2fc201884be8 ("net/bnxt: support rxq/txq get information")Reviewed-by Ajit Kumar Khaparde <[email protected]>Signed-off-by Lance Richardson <[email protected]>--- drivers/net/bnxt/bnxt_ethdev.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/net/bnxt/bnxt_ethdev.c +0
-0
drivers/net/bnxt/bnxt_ethdev.c bnxt_rxq_info_get_op(struct rte_eth_dev *dev, uint16_t queue_id, · line 2591
Quoted 5 lines
drivers/net/bnxt/bnxt_ethdev.c +1
-1@@ -2588,8 +2588,9 @@ bnxt_rxq_info_get_op(struct rte_eth_dev *dev, uint16_t queue_id, qinfo->nb_desc = rxq->nb_rx_desc; qinfo->conf.rx_free_thresh = rxq->rx_free_thresh; - qinfo->conf.rx_drop_en =0 ; + qinfo->conf.rx_drop_en =1 ;
Why 0 is wrong but 1 is correct?
Technically 'rx_drop_en' is a user configuration, which is set via 'rte_eth_rx_queue_setup()' API.
bnxt seems not honoring this config option at all.
Based on HW capability, I think two things can be done,
1) Configure the HW based on config request, and return configured value in 'bnxt_rxq_info_get_op()'. see 'ixgbe'.
2) If HW is not configurable, check the value in 'rte_eth_rx_queue_setup()'
a) return error if unsupported value requested. see 'sfc'.
b) log a warning and overwrite the requested config with whatever supported. And for both a & b, return current config in the 'bnxt_rxq_info_get_op()'
drivers/net/bnxt/bnxt_ethdev.c bnxt_rxq_info_get_op(struct rte_eth_dev *dev, uint16_t queue_id, · line 2593
Quoted 2 lines
drivers/net/bnxt/bnxt_ethdev.c +1
-0qinfo->conf.rx_deferred_start = rxq->rx_deferred_start; + qinfo->conf.offloads = dev->data->dev_conf.rxmode.offloads;
This is for queue specific offloads, you are returning port offloads. As far as I can see bnxt doesn't have any queue specific offload, so this can be dropped.
Re: [dpdk-dev] [PATCH 02/12] net/bnxt: fix rxq/txq get information
Quoted 11 lines · Ferruh Yigit
drivers/net/bnxt/bnxt_ethdev.c bnxt_rxq_info_get_op(struct rte_eth_dev *dev, uint16_t queue_id, · line 2591
Quoted 3 lines
drivers/net/bnxt/bnxt_ethdev.c +1
-1- qinfo->conf.rx_drop_en =0 ; + qinfo->conf.rx_drop_en =1 ;Why 0 is wrong but 1 is correct?
Technically '
rx_drop_en' is a user configuration, which is set via 'rte_eth_rx_queue_setup()' API.bnxt seems not honoring this config option at all.
Quoted 12 lines
Based on HW capability, I think two things can be done,
1) Configure the HW based on config request, and return configured value in 'bnxt_rxq_info_get_op()'. see 'ixgbe'.2) If HW is not configurable, check the value in '
rte_eth_rx_queue_setup()'
a) return error if unsupported value requested. see 'sfc'.
b) log a warning and overwrite the requested config with whatever supported. And for both a & b, return current config in the 'bnxt_rxq_info_get_op()'Quoted 2 lines
qinfo->conf.rx_deferred_start = rxq->rx_deferred_start;+
qinfo->conf.offloads=dev->data->dev_conf.rxmode.offloads;
Hi Ferruh,
Apologies, this somehow didn't make it to my inbox.
I believe case (2) applies here, rx_drop_en is not currently configurable in hw, so this change was intended to accurately report the effective value. I'm not sure whether (2a) or (2b) would be better, but (2b) seems less likely to cause issues for existing applications.
Quoted 4 lines
This is for queue specific offloads, you are returning port offloads. As far as I can see bnxt doesn't have any queue specific offload, so this can be dropped.
It wasn't clear to me whether this was intended to report the difference between the offload configuration for the queue and the offload configuration for the port
or the effective offload configuration for the queue. I noticed that several other
PMDs (e.g. mlx5, netvsc, sfc) report the offload configuration for the port in rx/tx_queue_info_get(). The sfc PMD reports the offload configuration for the port combined with queue-specific offloads, based on those examples this seemed to be correct. I guess you're saying those are also incorrect?
Thanks,
Lance
Re: [dpdk-dev] [PATCH 02/12] net/bnxt: fix rxq/txq get information
Quoted 24 lines · Lance Richardson
Quoted 11 lines · Ferruh Yigit
drivers/net/bnxt/bnxt_ethdev.c bnxt_rxq_info_get_op(struct rte_eth_dev *dev, uint16_t queue_id, · line 2591
Quoted 3 lines
drivers/net/bnxt/bnxt_ethdev.c +1
-1- qinfo->conf.rx_drop_en =0 ; + qinfo->conf.rx_drop_en =1 ;Why 0 is wrong but 1 is correct?
Technically '
rx_drop_en' is a user configuration, which is set via 'rte_eth_rx_queue_setup()' API.bnxt seems not honoring this config option at all.
Quoted 12 lines
Based on HW capability, I think two things can be done,
1) Configure the HW based on config request, and return configured value in 'bnxt_rxq_info_get_op()'. see 'ixgbe'.2) If HW is not configurable, check the value in '
rte_eth_rx_queue_setup()'
a) return error if unsupported value requested. see 'sfc'.
b) log a warning and overwrite the requested config with whatever supported. And for both a & b, return current config in the 'bnxt_rxq_info_get_op()'Quoted 2 lines
qinfo->conf.rx_deferred_start = rxq->rx_deferred_start;+
qinfo->conf.offloads=dev->data->dev_conf.rxmode.offloads;
Quoted 9 lines
Hi Ferruh,
Apologies, this somehow didn't make it to my inbox.
I believe case (2) applies here,
rx_drop_enis not currently configurable in hw, so this change was intended to accurately report the effective value. I'm not sure whether (2a) or (2b) would be better, but (2b) seems less likely to cause issues for existing applications.
I guess (2a) may cause more issues with existing applications, applications previously running without problem may now start failing if PMD starts returning error.
In (2b) execution will be same, and if PMD already doesn't support NOT dropping, functionality will be same, only configuration will reflect what is actually happening instead of what user thinks happening.
Quoted 6 lines
Quoted 5 lines
This is for queue specific offloads, you are returning port offloads. As far as I can see bnxt doesn't have any queue specific offload, so this can be dropped.
Quoted 10 lines
It wasn't clear to me whether this was intended to report the difference between the offload configuration for the queue and the offload configuration for the port
or the effective offload configuration for the queue. I noticed that several other
PMDs (e.g. mlx5, netvsc, sfc) report the offload configuration for the port in rx/tx_queue_info_get(). The sfc PMD reports the offload configuration for the port combined with queue-specific offloads, based on those examples this seemed to be correct. I guess you're saying those are also incorrect?
May bad, they look OK, "the effective offload configuration for the queue" makes more sense here. I guess I confused same fields should hold the queue specific offloads when used for 'rte_eth_rx_queue_setup()'
PATCH 3/12 net/bnxt: use appropriate type for Rx mbuf ring
In reply to Lance RichardsonChange the type of the software receive mbuf ring from an array of structures containing an mbuf pointer to an array of pointers to struct rte_mbuf for consistency with how this ring is currently used by the vector mode receive function.
--- drivers/net/bnxt/bnxt_ethdev.c | 6 ++-- drivers/net/bnxt/bnxt_reps.c | 21 +++++++------- drivers/net/bnxt/bnxt_ring.c | 4 +-- drivers/net/bnxt/bnxt_rxq.c | 14 ++++----- drivers/net/bnxt/bnxt_rxr.c | 41 ++++++++++++++------------- drivers/net/bnxt/bnxt_rxr.h | 8 ++---- drivers/net/bnxt/bnxt_rxtx_vec_neon.c | 10 +++---- drivers/net/bnxt/bnxt_rxtx_vec_sse.c | 10 +++---- 8 files changed, 55 insertions(+), 59 deletions(-)
drivers/net/bnxt/bnxt_ethdev.c +3 -3
@@ -2843,7 +2843,7 @@ bnxt_rx_descriptor_status_op(void *rx_queue, uint16_t offset)struct bnxt_rx_queue *rxq = (struct bnxt_rx_queue *)rx_queue;struct bnxt_rx_ring_info *rxr;struct bnxt_cp_ring_info *cpr; -struct bnxt_sw_rx_bd *rx_buf; +struct rte_mbuf *rx_buf;struct rx_pkt_cmpl *rxcmp;uint32_t cons, cp_cons;int rc;
@@ -2872,8 +2872,8 @@ bnxt_rx_descriptor_status_op(void *rx_queue, uint16_t offset)if (CMPL_VALID (rxcmp, !cpr->valid))return RTE_ETH_RX_DESC_DONE ; } - rx_buf = &rxr->rx_buf_ring[cons]; -if (rx_buf->mbuf ==NULL ) + rx_buf = rxr->rx_buf_ring[cons]; +if (rx_buf ==NULL )return RTE_ETH_RX_DESC_UNAVAIL ;
drivers/net/bnxt/bnxt_reps.c +10 -11
@@ -35,7 +35,7 @@ static const struct eth_dev_ops bnxt_vf_rep_dev_ops = {uint16_t bnxt_vfr_recv (uint16_t port_id,uint16_t queue_id,struct rte_mbuf *mbuf) { -struct bnxt_sw_rx_bd *prod_rx_buf; +struct rte_mbuf **prod_rx_buf;struct bnxt_rx_ring_info *rep_rxr;struct bnxt_rx_queue *rep_rxq;struct rte_eth_dev *vfr_eth_dev;
@@ -54,10 +54,9 @@ bnxt_vfr_recv(uint16_t port_id, uint16_t queue_id, struct rte_mbuf *mbuf) mask = rep_rxr->rx_ring_struct->ring_mask;/* Put this mbuf on the RxQ of the Representor */ - prod_rx_buf = - &rep_rxr->rx_buf_ring[rep_rxr->rx_prod++ & mask]; -if (!prod_rx_buf->mbuf) { - prod_rx_buf->mbuf = mbuf; + prod_rx_buf = &rep_rxr->rx_buf_ring[rep_rxr->rx_prod++ & mask]; +if (!*prod_rx_buf) { + *prod_rx_buf = mbuf; vfr_bp->rx_bytes[que] += mbuf->pkt_len; vfr_bp->rx_pkts[que]++; }else {
@@ -75,7 +74,7 @@ bnxt_vf_rep_rx_burst(void *rx_queue, uint16_t nb_pkts) {struct bnxt_rx_queue *rxq = rx_queue; -struct bnxt_sw_rx_bd *cons_rx_buf; +struct rte_mbuf **cons_rx_buf;struct bnxt_rx_ring_info *rxr;uint16_t nb_rx_pkts =0 ;uint16_t mask, i;
@@ -87,11 +86,11 @@ bnxt_vf_rep_rx_burst(void *rx_queue, mask = rxr->rx_ring_struct->ring_mask;for (i =0 ; i < nb_pkts; i++) { cons_rx_buf = &rxr->rx_buf_ring[rxr->rx_cons & mask]; -if (!cons_rx_buf->mbuf) +if (*cons_rx_buf ==NULL )return nb_rx_pkts; - rx_pkts[nb_rx_pkts] = cons_rx_buf->mbuf; + rx_pkts[nb_rx_pkts] = *cons_rx_buf; rx_pkts[nb_rx_pkts]->port = rxq->port_id; - cons_rx_buf->mbuf =NULL ; + *cons_rx_buf =NULL ; nb_rx_pkts++; rxr->rx_cons++; }
@@ -559,7 +558,7 @@ int bnxt_vf_rep_rx_queue_setup_op(struct rte_eth_dev *eth_dev,struct bnxt *parent_bp = rep_bp->parent_dev->data->dev_private;struct bnxt_rx_queue *parent_rxq;struct bnxt_rx_queue *rxq; -struct bnxt_sw_rx_bd *buf_ring; +struct rte_mbuf **buf_ring;int rc =0 ;if (queue_idx >=BNXT_MAX_VF_REP_RINGS ) {
@@ -611,7 +610,7 @@ int bnxt_vf_rep_rx_queue_setup_op(struct rte_eth_dev *eth_dev, goto out; buf_ring =rte_zmalloc_socket ("bnxt_rx_vfr_buf_ring" , -sizeof (struct bnxt_sw_rx_bd ) * +sizeof (struct rte_mbuf *) * rxq->rx_ring->rx_ring_struct->ring_size,RTE_CACHE_LINE_SIZE , socket_id);if (!buf_ring) {
drivers/net/bnxt/bnxt_ring.c +2 -2
@@ -251,7 +251,7 @@ int bnxt_alloc_rings(struct bnxt *bp, uint16_t qidx, rx_ring->vmem = (void **)((char *)mz->addr + rx_vmem_start); rx_ring_info->rx_buf_ring = - (struct bnxt_sw_rx_bd *)rx_ring->vmem; + (struct rte_mbuf **)rx_ring->vmem; } rx_ring = rx_ring_info->ag_ring_struct;
@@ -269,7 +269,7 @@ int bnxt_alloc_rings(struct bnxt *bp, uint16_t qidx, rx_ring->vmem = (void **)((char *)mz->addr + ag_vmem_start); rx_ring_info->ag_buf_ring = - (struct bnxt_sw_rx_bd *)rx_ring->vmem; + (struct rte_mbuf **)rx_ring->vmem; } rx_ring_info->ag_bitmap =
drivers/net/bnxt/bnxt_rxq.c +7 -7
@@ -197,7 +197,7 @@ int bnxt_mq_rx_configure(struct bnxt *bp)void bnxt_rx_queue_release_mbufs (struct bnxt_rx_queue *rxq) { -struct bnxt_sw_rx_bd *sw_ring; +struct rte_mbuf **sw_ring;struct bnxt_tpa_info *tpa_info;uint16_t i;
@@ -210,9 +210,9 @@ void bnxt_rx_queue_release_mbufs(struct bnxt_rx_queue *rxq)if (sw_ring) {for (i =0 ; i < rxq->rx_ring->rx_ring_struct->ring_size; i++) { -if (sw_ring[i].mbuf) { -rte_pktmbuf_free_seg (sw_ring[i].mbuf); - sw_ring[i].mbuf =NULL ; +if (sw_ring[i]) { +rte_pktmbuf_free_seg (sw_ring[i]); + sw_ring[i] =NULL ; } } }
@@ -221,9 +221,9 @@ void bnxt_rx_queue_release_mbufs(struct bnxt_rx_queue *rxq)if (sw_ring) {for (i =0 ; i < rxq->rx_ring->ag_ring_struct->ring_size; i++) { -if (sw_ring[i].mbuf) { -rte_pktmbuf_free_seg (sw_ring[i].mbuf); - sw_ring[i].mbuf =NULL ; +if (sw_ring[i]) { +rte_pktmbuf_free_seg (sw_ring[i]); + sw_ring[i] =NULL ; } } }
drivers/net/bnxt/bnxt_rxr.c +21 -20
136 lines not on this page · raw message
drivers/net/bnxt/bnxt_rxr.h +2 -6
@@ -181,10 +181,6 @@ struct bnxt_tpa_info {struct rx_tpa_v2_abuf_cmpl agg_arr[TPA_MAX_NUM_SEGS ]; }; -struct bnxt_sw_rx_bd { -struct rte_mbuf *mbuf;/* data associated with RX descriptor */ -}; -struct bnxt_rx_ring_info {uint16_t rx_prod;uint16_t ag_prod;
@@ -194,8 +190,8 @@ struct bnxt_rx_ring_info {struct rx_prod_pkt_bd *rx_desc_ring;struct rx_prod_pkt_bd *ag_desc_ring; -struct bnxt_sw_rx_bd *rx_buf_ring;/* sw ring */ -struct bnxt_sw_rx_bd *ag_buf_ring;/* sw ring */ +struct rte_mbuf **rx_buf_ring;/* sw ring */ +struct rte_mbuf **ag_buf_ring;/* sw ring */ rte_iova_t rx_desc_mapping;rte_iova_t ag_desc_mapping;
drivers/net/bnxt/bnxt_rxtx_vec_neon.c +5 -5
@@ -29,7 +29,7 @@ static inline void bnxt_rxq_rearm(struct bnxt_rx_queue *rxq, struct bnxt_rx_ring_info *rxr) { struct rx_prod_pkt_bd *rxbds = &rxr->rx_desc_ring[rxq->rxrearm_start]; -struct bnxt_sw_rx_bd *rx_bufs = &rxr->rx_buf_ring[rxq->rxrearm_start]; +struct rte_mbuf **rx_bufs = &rxr->rx_buf_ring[rxq->rxrearm_start];struct rte_mbuf *mb0, *mb1;int i;
@@ -51,8 +51,8 @@ bnxt_rxq_rearm(struct bnxt_rx_queue *rxq, struct bnxt_rx_ring_info *rxr)uint64x2_t buf_addr0, buf_addr1;uint64x2_t rxbd0, rxbd1; - mb0 = rx_bufs[0 ].mbuf; - mb1 = rx_bufs[1 ].mbuf; + mb0 = rx_bufs[0 ]; + mb1 = rx_bufs[1 ];/* Load address fields from both mbufs */ buf_addr0 =vld1q_u64 ((uint64_t *)&mb0->buf_addr);
@@ -260,9 +260,9 @@ bnxt_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, raw_cons = tmp_raw_cons; cons = rxcmp->opaque; - mbuf = rxr->rx_buf_ring[cons].mbuf; + mbuf = rxr->rx_buf_ring[cons];rte_prefetch0 (mbuf); - rxr->rx_buf_ring[cons].mbuf =NULL ; + rxr->rx_buf_ring[cons] =NULL ;/* Set constant fields from mbuf initializer. */ vst1q_u64 ((uint64_t *)&mbuf->rearm_data, mbuf_init);
drivers/net/bnxt/bnxt_rxtx_vec_sse.c +5 -5
@@ -33,7 +33,7 @@ static inline void bnxt_rxq_rearm(struct bnxt_rx_queue *rxq, struct bnxt_rx_ring_info *rxr) { struct rx_prod_pkt_bd *rxbds = &rxr->rx_desc_ring[rxq->rxrearm_start]; -struct bnxt_sw_rx_bd *rx_bufs = &rxr->rx_buf_ring[rxq->rxrearm_start]; +struct rte_mbuf **rx_bufs = &rxr->rx_buf_ring[rxq->rxrearm_start];struct rte_mbuf *mb0, *mb1;int i;
@@ -55,8 +55,8 @@ bnxt_rxq_rearm(struct bnxt_rx_queue *rxq, struct bnxt_rx_ring_info *rxr)__m128i buf_addr0, buf_addr1;__m128i rxbd0, rxbd1; - mb0 = rx_bufs[0 ].mbuf; - mb1 = rx_bufs[1 ].mbuf; + mb0 = rx_bufs[0 ]; + mb1 = rx_bufs[1 ];/* Load address fields from both mbufs */ buf_addr0 =_mm_loadu_si128 ((__m128i *)&mb0->buf_addr);
@@ -265,9 +265,9 @@ bnxt_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, raw_cons = tmp_raw_cons; cons = rxcmp->opaque; - mbuf = rxr->rx_buf_ring[cons].mbuf; + mbuf = rxr->rx_buf_ring[cons];rte_prefetch0 (mbuf); - rxr->rx_buf_ring[cons].mbuf =NULL ; + rxr->rx_buf_ring[cons] =NULL ;/* Set constant fields from mbuf initializer. */ _mm_store_si128((__m128i *)&mbuf->rearm_data,
Signature · 1 line
2.25.1
PATCH 4/12 net/bnxt: require async cq for vector mode
In reply to Lance RichardsonDisable support for vector mode when async completions can be placed in a receive completion ring and change the default for all platforms to use a dedicated async completion ring.
Simplify completion handling in vector mode receive paths now that it no longer needs to handle async completions.
--- drivers/net/bnxt/bnxt.h | 19 ++-- drivers/net/bnxt/bnxt_ethdev.c | 2 +- drivers/net/bnxt/bnxt_rxtx_vec_neon.c | 121 +++++++++++--------------- drivers/net/bnxt/bnxt_rxtx_vec_sse.c | 116 +++++++++++------------- 4 files changed, 111 insertions(+), 147 deletions(-)
drivers/net/bnxt/bnxt.h +9 -10
@@ -119,20 +119,19 @@ (BNXT_CHIP_THOR (bp) ?TPA_MAX_SEGS_TH : \TPA_MAX_SEGS ) -#ifdef RTE_ARCH_ARM64 -#define BNXT_NUM_ASYNC_CPR (bp) (BNXT_STINGRAY(bp) ? 0 : 1) +/* +* Define the number of async completion rings to be used. Set to zero for +* configurations in which the maximum number of packet completion rings +* for packet completions is desired or when async completion handling +* cannot be interrupt-driven. + */ +#ifdef RTE_EXEC_ENV_FREEBSD +/* In FreeBSD OS, nic_uio driver does not support interrupts */ +#define BNXT_NUM_ASYNC_CPR (bp) 0#else #define BNXT_NUM_ASYNC_CPR (bp) 1#endif -/* In FreeBSD OS, nic_uio driver does not support interrupts */ -#ifdef RTE_EXEC_ENV_FREEBSD -#ifdef BNXT_NUM_ASYNC_CPR -#undef BNXT_NUM_ASYNC_CPR -#endif -#define BNXT_NUM_ASYNC_CPR (bp) 0 -#endif -#define BNXT_MISC_VEC_ID RTE_INTR_VEC_ZERO_OFFSET#define BNXT_RX_VEC_START RTE_INTR_VEC_RXTX_OFFSET
drivers/net/bnxt/bnxt_ethdev.c +1 -1
@@ -1114,7 +1114,7 @@ bnxt_receive_function(struct rte_eth_dev *eth_dev) DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM | DEV_RX_OFFLOAD_RSS_HASH | DEV_RX_OFFLOAD_VLAN_FILTER)) && - !BNXT_TRUFLOW_EN(bp)) { + !BNXT_TRUFLOW_EN(bp) && BNXT_NUM_ASYNC_CPR(bp)) {PMD_DRV_LOG (INFO ,"Using vector mode receive for port %d\n" , eth_dev->data->port_id); bp->flags |=BNXT_FLAG_RX_VECTOR_PKT_MODE ;
drivers/net/bnxt/bnxt_rxtx_vec_neon.c +52 -69
155 lines not on this page · raw message
drivers/net/bnxt/bnxt_rxtx_vec_sse.c +49 -67
145 lines not on this page · raw message
Signature · 1 line
2.25.1
Re: [dpdk-dev] [PATCH 04/12] net/bnxt: require async cq for vector mode
Quoted 6 lines · Lance Richardson
Disable support for vector mode when async completions can be placed in a receive completion ring and change the default for all platforms to use a dedicated async completion ring.
Simplify completion handling in vector mode receive paths now that it no longer needs to handle async completions.
I guess 'cq' is "completion queue"(?), based on above description I understand vector mode no more handles async completions and to enable vector mode there should be at lest one async completion ring. If correct, would it be OK if I update the title as:
net/bnxt: require async completion ring for vector mode
Quoted 3 lines
Reviewed-by Ajit Kumar Khaparde <[email protected]>Signed-off-by Lance Richardson <[email protected]>
<...>
Re: [dpdk-dev] [PATCH 04/12] net/bnxt: require async cq for vector mode
Quoted 6 lines · Ferruh Yigit
Quoted 4 lines · Lance Richardson
Disable support for vector mode when async completions can be placed in a receive completion ring and change the default for all platforms to use a dedicated async completion ring.
Quoted 8 lines
Quoted 2 lines
Simplify completion handling in vector mode receive paths now that it no longer needs to handle async completions.
I guess 'cq' is "completion queue"(?), based on above description I understand vector mode no more handles async completions and to enable vector mode there should be at lest one async completion ring. If correct, would it be OK if I update the title as:
net/bnxt: require async completion ring for vector mode
That's correct. Your suggestion will make things clearer, sounds good to me.
Thanks,
Lance
Quoted 7 lines
Quoted 4 lines
Reviewed-by Ajit Kumar Khaparde <[email protected]>Signed-off-by Lance Richardson <[email protected]><...>
PATCH 5/12 net/bnxt: improve support for small ring sizes
In reply to Lance RichardsonImprove support for small ring sizes:
- Ensure that transmit free threshold is no more than 1/4 ring size.
- Ensure that receive free threshold is no more than 1/4 ring size.
- Validate requested ring sizes against minimum supported size.
- Use rxq receive free threshold instead of fixed maximum burst size to trigger bulk receive buffer allocation.
--- drivers/net/bnxt/bnxt_rxq.c | 6 +++-- drivers/net/bnxt/bnxt_rxtx_vec_common.h | 10 +++++---- drivers/net/bnxt/bnxt_rxtx_vec_neon.c | 29 +++++++++++++------------ drivers/net/bnxt/bnxt_rxtx_vec_sse.c | 29 +++++++++++++------------ drivers/net/bnxt/bnxt_txq.c | 7 ++++-- 5 files changed, 45 insertions(+), 36 deletions(-)
drivers/net/bnxt/bnxt_rxq.c +4 -2
@@ -14,6 +14,7 @@#include "bnxt_rxq.h" #include "bnxt_rxr.h" #include "bnxt_vnic.h" +#include "bnxt_rxtx_vec_common.h" #include "hsi_struct_def_dpdk.h" /*
@@ -305,7 +306,7 @@ int bnxt_rx_queue_setup_op(struct rte_eth_dev *eth_dev,return -EINVAL ; } -if (!nb_desc || nb_desc >MAX_RX_DESC_CNT ) { +if (nb_desc <BNXT_MIN_RING_DESC || nb_desc >MAX_RX_DESC_CNT ) {PMD_DRV_LOG (ERR ,"nb_desc %d is invalid\n" , nb_desc); rc = -EINVAL ; goto out;
@@ -326,7 +327,8 @@ int bnxt_rx_queue_setup_op(struct rte_eth_dev *eth_dev, rxq->bp = bp; rxq->mb_pool = mp; rxq->nb_rx_desc = nb_desc; - rxq->rx_free_thresh = rx_conf->rx_free_thresh; + rxq->rx_free_thresh = +RTE_MIN (rte_align32pow2 (nb_desc) /4 ,RTE_BNXT_MAX_RX_BURST );PMD_DRV_LOG (DEBUG ,"RX Buf MTU %d\n" , eth_dev->data->mtu);
drivers/net/bnxt/bnxt_rxtx_vec_common.h +6 -4
@@ -5,11 +5,13 @@#ifndef _BNXT_RXTX_VEC_COMMON_H_#define _BNXT_RXTX_VEC_COMMON_H_ +#include "hsi_struct_def_dpdk.h" +#include "bnxt_rxq.h" +#include "bnxt_rxr.h" -#define RTE_BNXT_MAX_RX_BURST 32 -#define RTE_BNXT_MAX_TX_BURST 32 -#define RTE_BNXT_RXQ_REARM_THRESH 32 -#define RTE_BNXT_DESCS_PER_LOOP 4 +#define RTE_BNXT_MAX_RX_BURST 32U +#define RTE_BNXT_MAX_TX_BURST 32U +#define RTE_BNXT_DESCS_PER_LOOP 4U#define TX_BD_FLAGS_CMPL ((1 << TX_BD_LONG_FLAGS_BD_CNT_SFT) | \ TX_BD_SHORT_FLAGS_COAL_NOW | \
drivers/net/bnxt/bnxt_rxtx_vec_neon.c +15 -14
@@ -13,9 +13,6 @@#include "bnxt.h" #include "bnxt_cpr.h" #include "bnxt_ring.h" -#include "bnxt_rxr.h" -#include "bnxt_rxq.h" -#include "hsi_struct_def_dpdk.h" #include "bnxt_rxtx_vec_common.h" #include "bnxt_txq.h"
@@ -31,23 +28,27 @@ bnxt_rxq_rearm(struct bnxt_rx_queue *rxq, struct bnxt_rx_ring_info *rxr)struct rx_prod_pkt_bd *rxbds = &rxr->rx_desc_ring[rxq->rxrearm_start];struct rte_mbuf **rx_bufs = &rxr->rx_buf_ring[rxq->rxrearm_start];struct rte_mbuf *mb0, *mb1; -int i; +int nb, i;const uint64x2_t hdr_room = {0 ,RTE_PKTMBUF_HEADROOM };const uint64x2_t addrmask = {0 ,UINT64_MAX }; -/* Pull RTE_BNXT_RXQ_REARM_THRESH more mbufs into the software ring */ -if (rte_mempool_get_bulk (rxq->mb_pool, - (void *)rx_bufs, -RTE_BNXT_RXQ_REARM_THRESH ) <0 ) { - rte_eth_devices[rxq->port_id].data->rx_mbuf_alloc_failed += -RTE_BNXT_RXQ_REARM_THRESH ; +/* +* Number of mbufs to allocate must be a multiple of two. The +* allocation must not go past the end of the ring. +*/ + nb =RTE_MIN (rxq->rxrearm_nb & ~0x1 , + rxq->nb_rx_desc - rxq->rxrearm_start); + +/* Allocate new mbufs into the software ring */ +if (rte_mempool_get_bulk (rxq->mb_pool, (void *)rx_bufs, nb) <0 ) { + rte_eth_devices[rxq->port_id].data->rx_mbuf_alloc_failed += nb;return ; }/* Initialize the mbufs in vector, process 2 mbufs in one loop */ -for (i =0 ; i <RTE_BNXT_RXQ_REARM_THRESH ; i +=2 , rx_bufs +=2 ) { +for (i =0 ; i < nb; i +=2 , rx_bufs +=2 ) {uint64x2_t buf_addr0, buf_addr1;uint64x2_t rxbd0, rxbd1;
@@ -83,12 +84,12 @@ bnxt_rxq_rearm(struct bnxt_rx_queue *rxq, struct bnxt_rx_ring_info *rxr)vst1q_u64 ((uint64_t *)(rxbds++), rxbd1); } - rxq->rxrearm_start +=RTE_BNXT_RXQ_REARM_THRESH ; + rxq->rxrearm_start += nb;bnxt_db_write (&rxr->rx_db, rxq->rxrearm_start -1 );if (rxq->rxrearm_start >= rxq->nb_rx_desc) rxq->rxrearm_start =0 ; - rxq->rxrearm_nb -=RTE_BNXT_RXQ_REARM_THRESH ; + rxq->rxrearm_nb -= nb; } static uint32_t
@@ -220,7 +221,7 @@ bnxt_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts,if (unlikely (!rxq->rx_started))return 0 ; -if (rxq->rxrearm_nb >=RTE_BNXT_RXQ_REARM_THRESH ) +if (rxq->rxrearm_nb >= rxq->rx_free_thresh)bnxt_rxq_rearm (rxq, rxr);/* Return no more than RTE_BNXT_MAX_RX_BURST per call. */
drivers/net/bnxt/bnxt_rxtx_vec_sse.c +15 -14
@@ -17,9 +17,6 @@#include "bnxt.h" #include "bnxt_cpr.h" #include "bnxt_ring.h" -#include "bnxt_rxr.h" -#include "bnxt_rxq.h" -#include "hsi_struct_def_dpdk.h" #include "bnxt_rxtx_vec_common.h" #include "bnxt_txq.h"
@@ -35,23 +32,27 @@ bnxt_rxq_rearm(struct bnxt_rx_queue *rxq, struct bnxt_rx_ring_info *rxr)struct rx_prod_pkt_bd *rxbds = &rxr->rx_desc_ring[rxq->rxrearm_start];struct rte_mbuf **rx_bufs = &rxr->rx_buf_ring[rxq->rxrearm_start];struct rte_mbuf *mb0, *mb1; -int i; +int nb, i;const __m128i hdr_room =_mm_set_epi64x (RTE_PKTMBUF_HEADROOM ,0 );const __m128i addrmask =_mm_set_epi64x (UINT64_MAX ,0 ); -/* Pull RTE_BNXT_RXQ_REARM_THRESH more mbufs into the software ring */ -if (rte_mempool_get_bulk (rxq->mb_pool, - (void *)rx_bufs, -RTE_BNXT_RXQ_REARM_THRESH ) <0 ) { - rte_eth_devices[rxq->port_id].data->rx_mbuf_alloc_failed += -RTE_BNXT_RXQ_REARM_THRESH ; +/* +* Number of mbufs to allocate must be a multiple of two. The +* allocation must not go past the end of the ring. +*/ + nb =RTE_MIN (rxq->rxrearm_nb & ~0x1 , + rxq->nb_rx_desc - rxq->rxrearm_start); + +/* Allocate new mbufs into the software ring */ +if (rte_mempool_get_bulk (rxq->mb_pool, (void *)rx_bufs, nb) <0 ) { + rte_eth_devices[rxq->port_id].data->rx_mbuf_alloc_failed += nb;return ; }/* Initialize the mbufs in vector, process 2 mbufs in one loop */ -for (i =0 ; i <RTE_BNXT_RXQ_REARM_THRESH ; i +=2 , rx_bufs +=2 ) { +for (i =0 ; i < nb; i +=2 , rx_bufs +=2 ) {__m128i buf_addr0, buf_addr1;__m128i rxbd0, rxbd1;
@@ -87,12 +88,12 @@ bnxt_rxq_rearm(struct bnxt_rx_queue *rxq, struct bnxt_rx_ring_info *rxr)_mm_store_si128 ((__m128i *)(rxbds++), rxbd1); } - rxq->rxrearm_start +=RTE_BNXT_RXQ_REARM_THRESH ; + rxq->rxrearm_start += nb;bnxt_db_write (&rxr->rx_db, rxq->rxrearm_start -1 );if (rxq->rxrearm_start >= rxq->nb_rx_desc) rxq->rxrearm_start =0 ; - rxq->rxrearm_nb -=RTE_BNXT_RXQ_REARM_THRESH ; + rxq->rxrearm_nb -= nb; } static uint32_t
@@ -223,7 +224,7 @@ bnxt_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts,if (unlikely (!rxq->rx_started))return 0 ; -if (rxq->rxrearm_nb >=RTE_BNXT_RXQ_REARM_THRESH ) +if (rxq->rxrearm_nb >= rxq->rx_free_thresh)bnxt_rxq_rearm (rxq, rxr);/* Return no more than RTE_BNXT_MAX_RX_BURST per call. */
drivers/net/bnxt/bnxt_txq.c +5 -2
@@ -11,6 +11,7 @@#include "bnxt_ring.h" #include "bnxt_txq.h" #include "bnxt_txr.h" +#include "bnxt_rxtx_vec_common.h" /* * TX Queues
@@ -97,7 +98,7 @@ int bnxt_tx_queue_setup_op(struct rte_eth_dev *eth_dev,return -EINVAL ; } -if (!nb_desc || nb_desc >MAX_TX_DESC_CNT ) { +if (nb_desc <BNXT_MIN_RING_DESC || nb_desc >MAX_TX_DESC_CNT ) {PMD_DRV_LOG (ERR ,"nb_desc %d is invalid" , nb_desc); rc = -EINVAL ; goto out;
@@ -129,7 +130,9 @@ int bnxt_tx_queue_setup_op(struct rte_eth_dev *eth_dev, } txq->bp = bp; txq->nb_tx_desc = nb_desc; - txq->tx_free_thresh = tx_conf->tx_free_thresh; + txq->tx_free_thresh = +RTE_MIN (rte_align32pow2 (nb_desc) /4 ,RTE_BNXT_MAX_TX_BURST ); + txq->tx_deferred_start = tx_conf->tx_deferred_start; rc =bnxt_init_tx_ring_struct (txq, socket_id);
Signature · 1 line
2.25.1
Re: [dpdk-dev] [PATCH 05/12] net/bnxt: improve support for small ring sizes
Quoted 22 lines · Lance Richardson
Improve support for small ring sizes:
- Ensure that transmit free threshold is no more than 1/4 ring size.
- Ensure that receive free threshold is no more than 1/4 ring size.
- Validate requested ring sizes against minimum supported size.
- Use rxq receive free threshold instead of fixed maximum burst size to trigger bulk receive buffer allocation.Reviewed-by Ajit Kumar Khaparde <[email protected]>Signed-off-by Lance Richardson <[email protected]>--- drivers/net/bnxt/bnxt_rxq.c | 6 +++-- drivers/net/bnxt/bnxt_rxtx_vec_common.h | 10 +++++---- drivers/net/bnxt/bnxt_rxtx_vec_neon.c | 29 +++++++++++++------------ drivers/net/bnxt/bnxt_rxtx_vec_sse.c | 29 +++++++++++++------------ drivers/net/bnxt/bnxt_txq.c | 7 ++++-- 5 files changed, 45 insertions(+), 36 deletions(-)drivers/net/bnxt/bnxt_rxq.c +0
-0
drivers/net/bnxt/bnxt_rxq.c line 19
Quoted 6 lines
drivers/net/bnxt/bnxt_rxq.c +1
-0@@ -14,6 +14,7 @@#include "bnxt_rxq.h" #include "bnxt_rxr.h" #include "bnxt_vnic.h" +#include "bnxt_rxtx_vec_common.h" #include "hsi_struct_def_dpdk.h"
Hi Lance, Ajit, Somnath,
Raslan reported a build error for PPC architecture, this happens because static inline functions in 'bnxt_rxtx_vec_common.h' are using 'rxq->rxrearm_nb' & 'rxq->rxrearm_start' which are not defined for PPC.
As far as I can see the 'bnxt_rxtx_vec_common.h' is included because of some macros.
A quick fix can be to wrap all static inline functions with !PPC checks but from the name of the header file, it looks like it shouldn't be included by scalar datapath .c files at first place.
Instead it can be possible to extract those macros into another header and both these .c file and 'bnxt_rxtx_vec_common.h' can include it. Or 'bnxt_txq.h' & 'bnxt_txr.h' can be used to hold those macros, and those headers were already included by 'bnxt_rxtx_vec_common.h' and .c files.
Anyway can you please provide the fix as incremental patches on top of latest head, so I can squash them into original patches.
If the patches can't be done as incremental fixes or if they will delay, I will need to drop the patchset from next-net, to not block any possible pull from main repo.
Re: [dpdk-dev] [PATCH 05/12] net/bnxt: improve support for small ring sizes
On Mon, Sep 14, 2020 at 6:03 PM Ferruh Yigit <[email protected]> wrote:
<snip>
Quoted 20 lines
Hi Lance, Ajit, Somnath,
Raslan reported a build error for PPC architecture, this happens because static inline functions in '
bnxt_rxtx_vec_common.h' are using 'rxq->rxrearm_nb' & 'rxq->rxrearm_start' which are not defined for PPC.As far as I can see the '
bnxt_rxtx_vec_common.h' is included because of some macros.
A quick fix can be to wrap all static inline functions with !PPC checks but from the name of the header file, it looks like it shouldn't be included by scalar datapath .c files at first place.Instead it can be possible to extract those macros into another header and both these .c file and '
bnxt_rxtx_vec_common.h' can include it. Or 'bnxt_txq.h' & 'bnxt_txr.h' can be used to hold those macros, and those headers were already included by 'bnxt_rxtx_vec_common.h' and .c files.
Quoted 6 lines
Anyway can you please provide the fix as incremental patches on top of latest head, so I can squash them into original patches.
If the patches can't be done as incremental fixes or if they will delay, I will need to drop the patchset from next-net, to not block any possible pull from main repo.
Hi Feruh,
I just sent a fix for this based on the head of next-net, compile-tested on x86_64, arm64, and powerpc. Please let me know if you run into any further snags.
Thanks,
Lance
PATCH 6/12 net/bnxt: use smaller cq when agg ring not needed
In reply to Lance RichardsonDon't allocate extra completion queue entries for aggregation ring when aggregation ring will not be used.
--- drivers/net/bnxt/bnxt_ethdev.c | 11 +++++------ drivers/net/bnxt/bnxt_rxr.c | 21 +++++++++++++++++++-- 2 files changed, 24 insertions(+), 8 deletions(-)
drivers/net/bnxt/bnxt_ethdev.c +5 -6
@@ -1295,6 +1295,8 @@ static void bnxt_dev_stop_op(struct rte_eth_dev *eth_dev)struct rte_intr_handle *intr_handle = &pci_dev->intr_handle; eth_dev->data->dev_started =0 ; + eth_dev->data->scattered_rx =0 ; +/* Prevent crashes when queues are still in use */ eth_dev->rx_pkt_burst = &bnxt_dummy_recv_pkts; eth_dev->tx_pkt_burst = &bnxt_dummy_xmit_pkts;
@@ -2695,14 +2697,12 @@ int bnxt_mtu_set_op(struct rte_eth_dev *eth_dev, uint16_t new_mtu) new_pkt_size = new_mtu +RTE_ETHER_HDR_LEN +RTE_ETHER_CRC_LEN +VLAN_TAG_SIZE *BNXT_NUM_VLANS ; -#if defined(RTE_ARCH_X86 ) || defined(RTE_ARCH_ARM64 )/* -* If vector-mode tx/rx is active, disallow any MTU change that would -* require scattered receive support. +* Disallow any MTU change that would require scattered receive support +* if it is not already enabled. */ if (eth_dev->data->dev_started && - (eth_dev->rx_pkt_burst == bnxt_recv_pkts_vec || - eth_dev->tx_pkt_burst == bnxt_xmit_pkts_vec) && + !eth_dev->data->scattered_rx && (new_pkt_size > eth_dev->data->min_rx_buf_size -RTE_PKTMBUF_HEADROOM )) { PMD_DRV_LOG(ERR,
@@ -2710,7 +2710,6 @@ int bnxt_mtu_set_op(struct rte_eth_dev *eth_dev, uint16_t new_mtu)PMD_DRV_LOG (ERR ,"Stop port before changing MTU.\n" );return -EINVAL ; } -#endif if (new_mtu >RTE_ETHER_MTU ) { bp->flags |=BNXT_FLAG_JUMBO ;
drivers/net/bnxt/bnxt_rxr.c +19 -2
@@ -938,9 +938,12 @@ void bnxt_free_rx_rings(struct bnxt *bp)int bnxt_init_rx_ring_struct (struct bnxt_rx_queue *rxq,unsigned int socket_id) { +struct rte_eth_dev *eth_dev = rxq->bp->eth_dev; +struct rte_eth_rxmode *rxmode;struct bnxt_cp_ring_info *cpr;struct bnxt_rx_ring_info *rxr;struct bnxt_ring *ring; +bool use_agg_ring; rxq->rx_buf_size =BNXT_MAX_PKT_LEN +sizeof (struct rte_mbuf );
@@ -978,8 +981,22 @@ int bnxt_init_rx_ring_struct(struct bnxt_rx_queue *rxq, unsigned int socket_id)if (ring ==NULL )return -ENOMEM ; cpr->cp_ring_struct = ring; - ring->ring_size =rte_align32pow2 (rxr->rx_ring_struct->ring_size * - (2 +AGG_RING_SIZE_FACTOR )); + + rxmode = ð_dev->data->dev_conf.rxmode; + use_agg_ring = (rxmode->offloads &DEV_RX_OFFLOAD_SCATTER ) || + (rxmode->offloads &DEV_RX_OFFLOAD_TCP_LRO ) || + (rxmode->max_rx_pkt_len > + (uint32_t )(rte_pktmbuf_data_room_size (rxq->mb_pool) - +RTE_PKTMBUF_HEADROOM )); + +/* Allocate two completion slots per entry in desc ring. */ + ring->ring_size = rxr->rx_ring_struct->ring_size *2 ; + +/* Allocate additional slots if aggregation ring is in use. */ +if (use_agg_ring) + ring->ring_size *=AGG_RING_SIZE_FACTOR ; + + ring->ring_size =rte_align32pow2 (ring->ring_size); ring->ring_mask = ring->ring_size -1 ; ring->bd = (void *)cpr->cp_desc_ring; ring->bd_dma = cpr->cp_desc_mapping;
Signature · 1 line
2.25.1
PATCH 7/12 net/bnxt: increase max burst size for vector mode
In reply to Lance RichardsonIncrease the maximum supported burst size for the bnxt vector mode PMD from 32 to 64.
--- drivers/net/bnxt/bnxt_rxtx_vec_common.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/bnxt/bnxt_rxtx_vec_common.h +2 -2
@@ -9,8 +9,8 @@#include "bnxt_rxq.h" #include "bnxt_rxr.h" -#define RTE_BNXT_MAX_RX_BURST 32U -#define RTE_BNXT_MAX_TX_BURST 32U +#define RTE_BNXT_MAX_RX_BURST 64U +#define RTE_BNXT_MAX_TX_BURST 64U#define RTE_BNXT_DESCS_PER_LOOP 4U#define TX_BD_FLAGS_CMPL ((1 << TX_BD_LONG_FLAGS_BD_CNT_SFT) | \
Signature · 1 line
2.25.1
Re: [dpdk-dev] [PATCH 07/12] net/bnxt: increase max burst size for vector mode
Quoted 2 lines · Lance Richardson
Increase the maximum supported burst size for the bnxt vector mode PMD from 32 to 64.
What is the motivation here? Like does it improve the performance? If so in which conditions etc.. It would be nice to describe the why & impact.
Quoted 24 lines
Reviewed-by Kalesh Anakkur Purayil <[email protected]>Reviewed-by Ajit Kumar Khaparde <[email protected]>Signed-off-by Lance Richardson <[email protected]>--- drivers/net/bnxt/bnxt_rxtx_vec_common.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/net/bnxt/bnxt_rxtx_vec_common.h +2
-2@@ -9,8 +9,8 @@#include "bnxt_rxq.h" #include "bnxt_rxr.h" -#define RTE_BNXT_MAX_RX_BURST 32U -#define RTE_BNXT_MAX_TX_BURST 32U +#define RTE_BNXT_MAX_RX_BURST 64U +#define RTE_BNXT_MAX_TX_BURST 64U#define RTE_BNXT_DESCS_PER_LOOP 4U#define TX_BD_FLAGS_CMPL ((1 << TX_BD_LONG_FLAGS_BD_CNT_SFT) | \
Re: [dpdk-dev] [PATCH 07/12] net/bnxt: increase max burst size for vector mode
Quoted 8 lines · Ferruh Yigit
Quoted 2 lines · Lance Richardson
Increase the maximum supported burst size for the bnxt vector mode PMD from 32 to 64.
What is the motivation here? Like does it improve the performance? If so in which conditions etc.. It would be nice to describe the why & impact.
How about this:
net/bnxt: increase max burst size for vector mode
Increase the maximum supported burst size for the bnxt vector mode PMD from 32 to 64. With larger burst sizes, per-burst overhead is amortized over more packets, improving overall performance. For small packets this has been measured to provide a 4-10% increase in single-core throughput with testpmd iofwd.
Thanks,
Lance
Re: [dpdk-dev] [PATCH 07/12] net/bnxt: increase max burst size for vector mode
Quoted 12 lines · Lance Richardson
Quoted 8 lines · Ferruh Yigit
Quoted 2 lines · Lance Richardson
Increase the maximum supported burst size for the bnxt vector mode PMD from 32 to 64.
What is the motivation here? Like does it improve the performance? If so in which conditions etc.. It would be nice to describe the why & impact.
How about this:
Quoted 9 lines
net/bnxt: increase max burst size for vector mode
Increase the maximum supported burst size for the bnxt vector mode PMD from 32 to 64. With larger burst sizes, per-burst overhead is amortized over more packets, improving overall performance. For small packets this has been measured to provide a 4-10% increase in single-core throughput with testpmd iofwd.
Will update while merging, thanks.
PATCH 8/12 net/bnxt: use table-based packet type translation
In reply to Lance RichardsonUse table-based method for translating receive packet descriptor flags into rte_mbuf packet type values.
--- drivers/net/bnxt/bnxt_rxr.c | 127 ++++++++++++++++---------- drivers/net/bnxt/bnxt_rxr.h | 2 + drivers/net/bnxt/bnxt_rxtx_vec_neon.c | 88 ++++++------------ drivers/net/bnxt/bnxt_rxtx_vec_sse.c | 81 +++++----------- 4 files changed, 134 insertions(+), 164 deletions(-)
drivers/net/bnxt/bnxt_rxr.c +78 -49
@@ -322,62 +322,88 @@ static inline struct rte_mbuf *bnxt_tpa_end(return mbuf; } -static uint32_t -bnxt_parse_pkt_type (struct rx_pkt_cmpl *rxcmp,struct rx_pkt_cmpl_hi *rxcmp1) +uint32_t bnxt_ptype_table[BNXT_PTYPE_TBL_DIM] __rte_cache_aligned; + +static void __rte_cold +bnxt_init_ptype_table (void ) { -uint32_t l3, pkt_type =0 ; -uint32_t t_ipcs =0 , ip6 =0 , vlan =0 ; -uint32_t flags_type; - - vlan = !!(rxcmp1->flags2 & -rte_cpu_to_le_32 (RX_PKT_CMPL_FLAGS2_META_FORMAT_VLAN )); - pkt_type |= vlan ?RTE_PTYPE_L2_ETHER_VLAN :RTE_PTYPE_L2_ETHER ; - - t_ipcs = !!(rxcmp1->flags2 & -rte_cpu_to_le_32 (RX_PKT_CMPL_FLAGS2_T_IP_CS_CALC )); - ip6 = !!(rxcmp1->flags2 & -rte_cpu_to_le_32 (RX_PKT_CMPL_FLAGS2_IP_TYPE )); - - flags_type = rxcmp->flags_type & -rte_cpu_to_le_32 (RX_PKT_CMPL_FLAGS_ITYPE_MASK ); - -if (!t_ipcs && !ip6) - l3 =RTE_PTYPE_L3_IPV4_EXT_UNKNOWN ; -else if (!t_ipcs && ip6) - l3 =RTE_PTYPE_L3_IPV6_EXT_UNKNOWN ; -else if (t_ipcs && !ip6) - l3 =RTE_PTYPE_INNER_L3_IPV4_EXT_UNKNOWN ; -else - l3 =RTE_PTYPE_INNER_L3_IPV6_EXT_UNKNOWN ; +uint32_t *pt = bnxt_ptype_table; +static bool initialized; +int ip6, tun, type; +uint32_t l3; +int i; -switch (flags_type) { -case RTE_LE32 (RX_PKT_CMPL_FLAGS_ITYPE_ICMP ): -if (!t_ipcs) - pkt_type |= l3 |RTE_PTYPE_L4_ICMP ; -else - pkt_type |= l3 |RTE_PTYPE_INNER_L4_ICMP ; -break ; +if (initialized) +return ; -case RTE_LE32 (RX_PKT_CMPL_FLAGS_ITYPE_TCP ): -if (!t_ipcs) - pkt_type |= l3 |RTE_PTYPE_L4_TCP ; +for (i =0 ; i <BNXT_PTYPE_TBL_DIM ; i++) { +if (i & (RX_PKT_CMPL_FLAGS2_META_FORMAT_VLAN >>2 )) + pt[i] =RTE_PTYPE_L2_ETHER_VLAN ;else - pkt_type |= l3 |RTE_PTYPE_INNER_L4_TCP ; -break ; - -case RTE_LE32 (RX_PKT_CMPL_FLAGS_ITYPE_UDP ): -if (!t_ipcs) - pkt_type |= l3 |RTE_PTYPE_L4_UDP ; + pt[i] =RTE_PTYPE_L2_ETHER ; + + ip6 = i & (RX_PKT_CMPL_FLAGS2_IP_TYPE >>7 ); + tun = i & (RX_PKT_CMPL_FLAGS2_T_IP_CS_CALC >>2 ); + type = (i &0x38 ) <<9 ; + +if (!tun && !ip6) + l3 =RTE_PTYPE_L3_IPV4_EXT_UNKNOWN ; +else if (!tun && ip6) + l3 =RTE_PTYPE_L3_IPV6_EXT_UNKNOWN ; +else if (tun && !ip6) + l3 =RTE_PTYPE_INNER_L3_IPV4_EXT_UNKNOWN ;else - pkt_type |= l3 |RTE_PTYPE_INNER_L4_UDP ; -break ; - -case RTE_LE32 (RX_PKT_CMPL_FLAGS_ITYPE_IP ): - pkt_type |= l3; -break ; + l3 =RTE_PTYPE_INNER_L3_IPV6_EXT_UNKNOWN ; + +switch (type) { +case RX_PKT_CMPL_FLAGS_ITYPE_ICMP : +if (tun) + pt[i] |= l3 |RTE_PTYPE_INNER_L4_ICMP ; +else + pt[i] |= l3 |RTE_PTYPE_L4_ICMP ; +break ; +case RX_PKT_CMPL_FLAGS_ITYPE_TCP : +if (tun) + pt[i] |= l3 |RTE_PTYPE_INNER_L4_TCP ; +else + pt[i] |= l3 |RTE_PTYPE_L4_TCP ; +break ; +case RX_PKT_CMPL_FLAGS_ITYPE_UDP : +if (tun) + pt[i] |= l3 |RTE_PTYPE_INNER_L4_UDP ; +else + pt[i] |= l3 |RTE_PTYPE_L4_UDP ; +break ; +case RX_PKT_CMPL_FLAGS_ITYPE_IP : + pt[i] |= l3; +break ; + } } + initialized = true; +} + +static uint32_t +bnxt_parse_pkt_type (struct rx_pkt_cmpl *rxcmp,struct rx_pkt_cmpl_hi *rxcmp1) +{ +uint32_t flags_type, flags2; +uint8_t index; -return pkt_type; + flags_type =rte_le_to_cpu_16 (rxcmp->flags_type); + flags2 =rte_le_to_cpu_32 (rxcmp1->flags2); + +/* +* Index format: +* bit 0: RX_PKT_CMPL_FLAGS2_T_IP_CS_CALC +* bit 1: RX_CMPL_FLAGS2_IP_TYPE +* bit 2: RX_PKT_CMPL_FLAGS2_META_FORMAT_VLAN +* bits 3-6: RX_PKT_CMPL_FLAGS_ITYPE +*/ + index = ((flags_type &RX_PKT_CMPL_FLAGS_ITYPE_MASK ) >>9 ) | + ((flags2 & (RX_PKT_CMPL_FLAGS2_META_FORMAT_VLAN | +RX_PKT_CMPL_FLAGS2_T_IP_CS_CALC )) >>2 ) | + ((flags2 &RX_PKT_CMPL_FLAGS2_IP_TYPE ) >>7 ); + +return bnxt_ptype_table[index]; }#ifdef RTE_LIBRTE_IEEE1588
@@ -1046,6 +1072,9 @@ int bnxt_init_one_rx_ring(struct bnxt_rx_queue *rxq)unsigned int i;uint16_t size; +/* Initialize packet type table. */ +bnxt_init_ptype_table (); + size =rte_pktmbuf_data_room_size (rxq->mb_pool) -RTE_PKTMBUF_HEADROOM ; size =RTE_MIN (BNXT_MAX_PKT_LEN , size);
drivers/net/bnxt/bnxt_rxr.h +2 -0
@@ -238,4 +238,6 @@ void bnxt_set_mark_in_mbuf(struct bnxt *bp,#define BNXT_CFA_META_EEM_TCAM_SHIFT 31#define BNXT_CFA_META_EM_TEST (x) ((x) >> BNXT_CFA_META_EEM_TCAM_SHIFT) +#define BNXT_PTYPE_TBL_DIM 128 +extern uint32_t bnxt_ptype_table[BNXT_PTYPE_TBL_DIM ];#endif
drivers/net/bnxt/bnxt_rxtx_vec_neon.c +29 -59
124 lines not on this page · raw message
drivers/net/bnxt/bnxt_rxtx_vec_sse.c +25 -56
116 lines not on this page · raw message
Signature · 1 line
2.25.1
PATCH 9/12 net/bnxt: table-based handling for ol flags
In reply to Lance RichardsonUse table to translate receive descriptor status flags to rte_mbuf ol_flags values.
--- drivers/net/bnxt/bnxt_rxr.c | 166 ++++++++++++++++---------- drivers/net/bnxt/bnxt_rxr.h | 6 + drivers/net/bnxt/bnxt_rxtx_vec_neon.c | 99 ++++++--------- drivers/net/bnxt/bnxt_rxtx_vec_sse.c | 96 ++++++--------- 4 files changed, 181 insertions(+), 186 deletions(-)
drivers/net/bnxt/bnxt_rxr.c +102 -64
@@ -406,6 +406,95 @@ bnxt_parse_pkt_type(struct rx_pkt_cmpl *rxcmp, struct rx_pkt_cmpl_hi *rxcmp1)return bnxt_ptype_table[index]; } +uint32_t +bnxt_ol_flags_table[BNXT_OL_FLAGS_TBL_DIM] __rte_cache_aligned; + +uint32_t +bnxt_ol_flags_err_table[BNXT_OL_FLAGS_ERR_TBL_DIM] __rte_cache_aligned; + +static void __rte_cold +bnxt_init_ol_flags_tables (void ) +{ +static bool initialized; +uint32_t *pt; +int i; + +if (initialized) +return ; + +/* Initialize ol_flags table. */ + pt = bnxt_ol_flags_table; +for (i =0 ; i <BNXT_OL_FLAGS_TBL_DIM ; i++) { + pt[i] =0 ; +if (i &RX_PKT_CMPL_FLAGS2_META_FORMAT_VLAN ) + pt[i] |=PKT_RX_VLAN |PKT_RX_VLAN_STRIPPED ; + +if (i &RX_PKT_CMPL_FLAGS2_IP_CS_CALC ) + pt[i] |=PKT_RX_IP_CKSUM_GOOD ; + +if (i &RX_PKT_CMPL_FLAGS2_L4_CS_CALC ) + pt[i] |=PKT_RX_L4_CKSUM_GOOD ; + +if (i &RX_PKT_CMPL_FLAGS2_T_L4_CS_CALC ) + pt[i] |=PKT_RX_OUTER_L4_CKSUM_GOOD ; + } + +/* Initialize checksum error table. */ + pt = bnxt_ol_flags_err_table; +for (i =0 ; i <BNXT_OL_FLAGS_ERR_TBL_DIM ; i++) { + pt[i] =0 ; +if (i & (RX_PKT_CMPL_ERRORS_IP_CS_ERROR >>4 )) + pt[i] |=PKT_RX_IP_CKSUM_BAD ; + +if (i & (RX_PKT_CMPL_ERRORS_L4_CS_ERROR >>4 )) + pt[i] |=PKT_RX_L4_CKSUM_BAD ; + +if (i & (RX_PKT_CMPL_ERRORS_T_IP_CS_ERROR >>4 )) + pt[i] |=PKT_RX_EIP_CKSUM_BAD ; + +if (i & (RX_PKT_CMPL_ERRORS_T_L4_CS_ERROR >>4 )) + pt[i] |=PKT_RX_OUTER_L4_CKSUM_BAD ; + } + + initialized = true; +} + +static void +bnxt_set_ol_flags (struct rx_pkt_cmpl *rxcmp,struct rx_pkt_cmpl_hi *rxcmp1, +struct rte_mbuf *mbuf) +{ +uint16_t flags_type, errors, flags; +uint64_t ol_flags; + + flags_type =rte_le_to_cpu_16 (rxcmp->flags_type); + + flags =rte_le_to_cpu_32 (rxcmp1->flags2) & + (RX_PKT_CMPL_FLAGS2_IP_CS_CALC | +RX_PKT_CMPL_FLAGS2_L4_CS_CALC | +RX_PKT_CMPL_FLAGS2_T_IP_CS_CALC | +RX_PKT_CMPL_FLAGS2_T_L4_CS_CALC | +RX_PKT_CMPL_FLAGS2_META_FORMAT_VLAN ); + + errors =rte_le_to_cpu_16 (rxcmp1->errors_v2) & + (RX_PKT_CMPL_ERRORS_IP_CS_ERROR | +RX_PKT_CMPL_ERRORS_L4_CS_ERROR | +RX_PKT_CMPL_ERRORS_T_IP_CS_ERROR | +RX_PKT_CMPL_ERRORS_T_L4_CS_ERROR ); + errors = (errors >>4 ) & flags; + + ol_flags = bnxt_ol_flags_table[flags & ~errors]; + +if (errors) + ol_flags |= bnxt_ol_flags_err_table[errors]; + +if (flags_type &RX_PKT_CMPL_FLAGS_RSS_VALID ) { + mbuf->hash.rss =rte_le_to_cpu_32 (rxcmp->rss_hash); + ol_flags |=PKT_RX_RSS_HASH ; + } + + mbuf->ol_flags = ol_flags; +} +#ifdef RTE_LIBRTE_IEEE1588 static void bnxt_get_rx_ts_thor (struct bnxt *bp,uint32_t rx_ts_cmpl)
@@ -583,8 +672,7 @@ static int bnxt_rx_pkt(struct rte_mbuf **rx_pkt,int rc =0 ;uint8_t agg_buf =0 ;uint16_t cmp_type; -uint32_t flags2_f =0 , vfr_flag =0 , mark_id =0 ; -uint16_t flags_type; +uint32_t vfr_flag =0 , mark_id =0 ;struct bnxt *bp = rxq->bp; rxcmp = (struct rx_pkt_cmpl *)
@@ -653,13 +741,17 @@ static int bnxt_rx_pkt(struct rte_mbuf **rx_pkt, mbuf->pkt_len = rxcmp->len; mbuf->data_len = mbuf->pkt_len; mbuf->port = rxq->port_id; - mbuf->ol_flags =0 ; - flags_type =rte_le_to_cpu_16 (rxcmp->flags_type); -if (flags_type &RX_PKT_CMPL_FLAGS_RSS_VALID ) { - mbuf->hash.rss = rxcmp->rss_hash; - mbuf->ol_flags |=PKT_RX_RSS_HASH ; +bnxt_set_ol_flags (rxcmp, rxcmp1, mbuf); + +#ifdef RTE_LIBRTE_IEEE1588 +if (unlikely ((rte_le_to_cpu_16 (rxcmp->flags_type) & +RX_PKT_CMPL_FLAGS_MASK ) == +RX_PKT_CMPL_FLAGS_ITYPE_PTP_W_TIMESTAMP )) { + mbuf->ol_flags |=PKT_RX_IEEE1588_PTP |PKT_RX_IEEE1588_TMST ; +bnxt_get_rx_ts_thor (rxq->bp, rxcmp1->reorder); } +#endif if (BNXT_TRUFLOW_EN (bp)) mark_id = bnxt_ulp_set_mark_in_mbuf(rxq->bp, rxcmp1, mbuf,
@@ -667,66 +759,9 @@ static int bnxt_rx_pkt(struct rte_mbuf **rx_pkt,else bnxt_set_mark_in_mbuf (rxq->bp, rxcmp1, mbuf); -#ifdef RTE_LIBRTE_IEEE1588 -if (unlikely ((flags_type &RX_PKT_CMPL_FLAGS_MASK ) == -RX_PKT_CMPL_FLAGS_ITYPE_PTP_W_TIMESTAMP )) { - mbuf->ol_flags |=PKT_RX_IEEE1588_PTP |PKT_RX_IEEE1588_TMST ; -bnxt_get_rx_ts_thor (rxq->bp, rxcmp1->reorder); - } -#endif if (agg_buf)bnxt_rx_pages (rxq, mbuf, &tmp_raw_cons, agg_buf,NULL ); -if (rxcmp1->flags2 &RX_PKT_CMPL_FLAGS2_META_FORMAT_VLAN ) { - mbuf->vlan_tci = rxcmp1->metadata & - (RX_PKT_CMPL_METADATA_VID_MASK | -RX_PKT_CMPL_METADATA_DE | -RX_PKT_CMPL_METADATA_PRI_MASK ); - mbuf->ol_flags |=PKT_RX_VLAN |PKT_RX_VLAN_STRIPPED ; - } - - flags2_f =flags2_0xf (rxcmp1); -/* IP Checksum */ -if (likely (IS_IP_NONTUNNEL_PKT (flags2_f))) { -if (unlikely (RX_CMP_IP_CS_ERROR (rxcmp1))) - mbuf->ol_flags |=PKT_RX_IP_CKSUM_BAD ; -else if (unlikely (RX_CMP_IP_CS_UNKNOWN (rxcmp1))) - mbuf->ol_flags |=PKT_RX_IP_CKSUM_UNKNOWN ; -else - mbuf->ol_flags |=PKT_RX_IP_CKSUM_GOOD ; - }else if (IS_IP_TUNNEL_PKT (flags2_f)) { -if (unlikely (RX_CMP_IP_OUTER_CS_ERROR (rxcmp1) || -RX_CMP_IP_CS_ERROR (rxcmp1))) - mbuf->ol_flags |=PKT_RX_IP_CKSUM_BAD ; -else if (unlikely (RX_CMP_IP_CS_UNKNOWN (rxcmp1))) - mbuf->ol_flags |=PKT_RX_IP_CKSUM_UNKNOWN ; -else - mbuf->ol_flags |=PKT_RX_IP_CKSUM_GOOD ; - } - -/* L4 Checksum */ -if (likely (IS_L4_NONTUNNEL_PKT (flags2_f))) { -if (unlikely (RX_CMP_L4_INNER_CS_ERR2 (rxcmp1))) - mbuf->ol_flags |=PKT_RX_L4_CKSUM_BAD ; -else - mbuf->ol_flags |=PKT_RX_L4_CKSUM_GOOD ; - }else if (IS_L4_TUNNEL_PKT (flags2_f)) { -if (unlikely (RX_CMP_L4_INNER_CS_ERR2 (rxcmp1))) - mbuf->ol_flags |=PKT_RX_L4_CKSUM_BAD ; -else - mbuf->ol_flags |=PKT_RX_L4_CKSUM_GOOD ; -if (unlikely (RX_CMP_L4_OUTER_CS_ERR2 (rxcmp1))) { - mbuf->ol_flags |=PKT_RX_OUTER_L4_CKSUM_BAD ; - }else if (unlikely (IS_L4_TUNNEL_PKT_ONLY_INNER_L4_CS - (flags2_f))) { - mbuf->ol_flags |=PKT_RX_OUTER_L4_CKSUM_UNKNOWN ; - }else { - mbuf->ol_flags |=PKT_RX_OUTER_L4_CKSUM_GOOD ; - } - }else if (unlikely (RX_CMP_L4_CS_UNKNOWN (rxcmp1))) { - mbuf->ol_flags |=PKT_RX_L4_CKSUM_UNKNOWN ; - } - mbuf->packet_type =bnxt_parse_pkt_type (rxcmp, rxcmp1);#ifdef BNXT_DEBUG
@@ -1075,6 +1110,9 @@ int bnxt_init_one_rx_ring(struct bnxt_rx_queue *rxq)/* Initialize packet type table. */ bnxt_init_ptype_table (); +/* Initialize offload flags parsing table. */ +bnxt_init_ol_flags_tables (); + size =rte_pktmbuf_data_room_size (rxq->mb_pool) -RTE_PKTMBUF_HEADROOM ; size =RTE_MIN (BNXT_MAX_PKT_LEN , size);
drivers/net/bnxt/bnxt_rxr.h +6 -0
@@ -240,4 +240,10 @@ void bnxt_set_mark_in_mbuf(struct bnxt *bp,#define BNXT_PTYPE_TBL_DIM 128extern uint32_t bnxt_ptype_table[BNXT_PTYPE_TBL_DIM ]; + +#define BNXT_OL_FLAGS_TBL_DIM 32 +extern uint32_t bnxt_ol_flags_table[BNXT_OL_FLAGS_TBL_DIM ]; + +#define BNXT_OL_FLAGS_ERR_TBL_DIM 16 +extern uint32_t bnxt_ol_flags_err_table[BNXT_OL_FLAGS_ERR_TBL_DIM ];#endif
drivers/net/bnxt/bnxt_rxtx_vec_neon.c +38 -61
131 lines not on this page · raw message
drivers/net/bnxt/bnxt_rxtx_vec_sse.c +35 -61
127 lines not on this page · raw message
Signature · 1 line
2.25.1
Quoted 3 lines · Lance Richardson
Fixes and optimizations to improve bnxt vector mode performance and functionality.
Patchset applied to dpdk-next-net-brcm. Thanks
Quoted 33 lines
Lance Richardson (12):
net/bnxt: fix burst mode get for Arm
net/bnxt: fix rxq/txq get information
net/bnxt: use appropriate type for Rx mbuf ring net/bnxt: require async cq for vector mode net/bnxt: improve support for small ring sizes net/bnxt: use smaller cq when agg ring not needed net/bnxt: increase max burst size for vector mode net/bnxt: use table-based packet type translation net/bnxt: table-based handling for ol flags net/bnxt: optimize vector mode mbuf allocation net/bnxt: handle multiple packets per loop in vector PMD net/bnxt: transmit vector mode improvementsdrivers/net/bnxt/bnxt.h | 19 +- drivers/net/bnxt/bnxt_ethdev.c | 85 ++-- drivers/net/bnxt/bnxt_reps.c | 21 +- drivers/net/bnxt/bnxt_ring.c | 4 +- drivers/net/bnxt/bnxt_rxq.c | 21 +- drivers/net/bnxt/bnxt_rxq.h | 1 + drivers/net/bnxt/bnxt_rxr.c | 362 ++++++++------ drivers/net/bnxt/bnxt_rxr.h | 16 +- drivers/net/bnxt/bnxt_rxtx_vec_common.h | 52 +- drivers/net/bnxt/bnxt_rxtx_vec_neon.c | 524 +++++++++++---------- drivers/net/bnxt/bnxt_rxtx_vec_sse.c | 600 ++++++++++++------------ drivers/net/bnxt/bnxt_txq.c | 7 +- 12 files changed, 964 insertions(+), 748 deletions(-)--
2.25.1
Quoted 8 lines · Ajit Khaparde
Quoted 3 lines · Lance Richardson
Fixes and optimizations to improve bnxt vector mode performance and functionality.
Patchset applied to dpdk-next-net-brcm. Thanks
Pulled except 2/12, since it is individual fix, it can be sent separately later.