net/bnxt: vector mode enhancements
Subsystems (2)
v2 cover net/bnxt: vector mode enhancements
- Switch to non-vector receive function when "mark" action is requested.
- Add support for rx_burst_mode_get()/tx_burst_mode_get() to return currently active receive/transmit mode.
- Add vector mode support for ARM64.
Lance Richardson (3):
net/bnxt: disable vector receive for mark action net/bnxt: support Rx/Tx burst mode info net/bnxt: add ARM64 vector support
doc/guides/nics/features/bnxt.ini | 1 + drivers/net/bnxt/Makefile | 3 + drivers/net/bnxt/bnxt_ethdev.c | 52 ++- drivers/net/bnxt/bnxt_flow.c | 20 +- drivers/net/bnxt/bnxt_ring.c | 4 +- drivers/net/bnxt/bnxt_rxq.h | 2 +- drivers/net/bnxt/bnxt_rxr.c | 18 + drivers/net/bnxt/bnxt_rxr.h | 2 +- drivers/net/bnxt/bnxt_rxtx_vec_common.h | 57 +++ drivers/net/bnxt/bnxt_rxtx_vec_neon.c | 469 ++++++++++++++++++++++++ drivers/net/bnxt/bnxt_rxtx_vec_sse.c | 46 +-- drivers/net/bnxt/bnxt_txr.h | 2 +- drivers/net/bnxt/meson.build | 2 + 13 files changed, 614 insertions(+), 64 deletions(-) create mode 100644 drivers/net/bnxt/bnxt_rxtx_vec_common.h create mode 100644 drivers/net/bnxt/bnxt_rxtx_vec_neon.c
Signature · 1 line
2.25.1
PATCH v2 1/3 net/bnxt: disable vector receive for mark action
The bnxt vector mode receive handler does not support the rte_flow 'mark' action. Since we cannot know in advance whether this action will be required, add support for dynamically switching from vector to non-vector receive when the first flow create request with a mark action is processed.
---
v2: no change
drivers/net/bnxt/bnxt_flow.c | 20 ++++++++------------ drivers/net/bnxt/bnxt_rxr.c | 18 ++++++++++++++++++ 2 files changed, 26 insertions(+), 12 deletions(-)
drivers/net/bnxt/bnxt_flow.c +8 -12
@@ -18,6 +18,7 @@#include "bnxt_hwrm.h" #include "bnxt_ring.h" #include "bnxt_rxq.h" +#include "bnxt_rxr.h" #include "bnxt_vnic.h" #include "hsi_struct_def_dpdk.h"
@@ -1403,18 +1404,6 @@ bnxt_validate_and_parse_flow(struct rte_eth_dev *dev,bnxt_update_filter_flags_en (filter, filter1, use_ntuple);break ;case RTE_FLOW_ACTION_TYPE_MARK : -if (bp->flags &BNXT_FLAG_RX_VECTOR_PKT_MODE ) { -PMD_DRV_LOG (DEBUG , -"Disable vector processing for mark\n" ); -rte_flow_error_set (error, -ENOTSUP , -RTE_FLOW_ERROR_TYPE_ACTION , - act, -"Disable vector processing for mark" ); - rc = -rte_errno; - goto ret; - } -if (bp->mark_table ==NULL ) { rte_flow_error_set(error, ENOMEM,
@@ -1425,6 +1414,13 @@ bnxt_validate_and_parse_flow(struct rte_eth_dev *dev, goto ret; } +if (bp->flags &BNXT_FLAG_RX_VECTOR_PKT_MODE ) { +PMD_DRV_LOG (DEBUG , +"Disabling vector processing for mark\n" ); + bp->eth_dev->rx_pkt_burst = bnxt_recv_pkts; + bp->flags &= ~BNXT_FLAG_RX_VECTOR_PKT_MODE ; + } + filter->valid_flags |=BNXT_FLOW_MARK_FLAG ; filter->mark = ((const struct rte_flow_action_mark *) act->conf)->id;
drivers/net/bnxt/bnxt_rxr.c +18 -0
@@ -747,6 +747,24 @@ uint16_t bnxt_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, !rte_spinlock_trylock(&rxq->lock)))return 0 ; +#if defined(RTE_ARCH_X86 ) +/* +* Replenish buffers if needed when a transition has been made from +* vector- to non-vector- receive processing. +*/ +while (unlikely (rxq->rxrearm_nb)) { +if (!bnxt_alloc_rx_data (rxq, rxr, rxq->rxrearm_start)) { + rxr->rx_prod = rxq->rxrearm_start; +bnxt_db_write (&rxr->rx_db, rxr->rx_prod); + rxq->rxrearm_start++; + rxq->rxrearm_nb--; + }else { +/* Retry allocation on next call. */ +break ; + } + } +#endif +/* Handle RX burst request */ while (1 ) { cons =RING_CMP (cpr->cp_ring_struct, raw_cons);
Signature · 1 line
2.25.1
PATCH v2 2/3 net/bnxt: support Rx/Tx burst mode info
In reply to Lance RichardsonRetrieve burst mode options according to the selected Rx/Tx burst function name.
---
v2: no change
doc/guides/nics/features/bnxt.ini | 1 + drivers/net/bnxt/bnxt_ethdev.c | 46 +++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+)
doc/guides/nics/features/bnxt.ini +1 -0
@@ -9,6 +9,7 @@ Link status = Y Link status event = Y Rx interrupt = Y Queue start/stop = Y +Burst mode info = Y MTU update = Y Jumbo frame = Y Scattered Rx = Y
drivers/net/bnxt/bnxt_ethdev.c +46 -0
58 lines not on this page · raw message
Signature · 1 line
2.25.1
PATCH v2 3/3 net/bnxt: add ARM64 vector support
In reply to Lance RichardsonAdd bnxt vector PMD support using NEON SIMD instructions.
---
v2:
- Use rte_vect.h instead of including arm_neon.h directly in bnxt_rxtx_vec_neon.c.
drivers/net/bnxt/Makefile | 3 + drivers/net/bnxt/bnxt_ethdev.c | 10 +- drivers/net/bnxt/bnxt_ring.c | 4 +- drivers/net/bnxt/bnxt_rxq.h | 2 +- drivers/net/bnxt/bnxt_rxr.c | 2 +- drivers/net/bnxt/bnxt_rxr.h | 2 +- drivers/net/bnxt/bnxt_rxtx_vec_common.h | 57 +++ drivers/net/bnxt/bnxt_rxtx_vec_neon.c | 469 ++++++++++++++++++++++++ drivers/net/bnxt/bnxt_rxtx_vec_sse.c | 46 +-- drivers/net/bnxt/bnxt_txr.h | 2 +- drivers/net/bnxt/meson.build | 2 + 11 files changed, 544 insertions(+), 55 deletions(-) create mode 100644 drivers/net/bnxt/bnxt_rxtx_vec_common.h create mode 100644 drivers/net/bnxt/bnxt_rxtx_vec_neon.c
drivers/net/bnxt/Makefile +3 -0
@@ -42,6 +42,9 @@ SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += rte_pmd_bnxt.c ifeq ($(CONFIG_RTE_ARCH_X86), y) SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += bnxt_rxtx_vec_sse.c endif +ifeq ($(CONFIG_RTE_ARCH_ARM64), y) +SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += bnxt_rxtx_vec_neon.c +endif ifeq ($(CONFIG_RTE_LIBRTE_BNXT_PMD), y) CFLAGS += -I$(SRCDIR) -I$(SRCDIR)/tf_core -I$(SRCDIR)/tf_ulp
drivers/net/bnxt/bnxt_ethdev.c +5 -5
@@ -1075,7 +1075,7 @@ bnxt_receive_function(struct rte_eth_dev *eth_dev) {struct bnxt *bp = eth_dev->data->dev_private; -#ifdef RTE_ARCH_X86 +#if defined(RTE_ARCH_X86 ) || defined(RTE_ARCH_ARM64 )#ifndef RTE_LIBRTE_IEEE1588 /* * Vector mode receive can be enabled only if scatter rx is not
@@ -1115,7 +1115,7 @@ bnxt_receive_function(struct rte_eth_dev *eth_dev)static eth_tx_burst_t bnxt_transmit_function(__rte_unused struct rte_eth_dev *eth_dev) { -#ifdef RTE_ARCH_X86 +#if defined(RTE_ARCH_X86 ) || defined(RTE_ARCH_ARM64 )#ifndef RTE_LIBRTE_IEEE1588 /* * Vector mode transmit can be enabled only if not using scatter rx
@@ -2593,7 +2593,7 @@ bnxt_rx_burst_mode_get(struct rte_eth_dev *dev, __rte_unused uint16_t queue_id, "Scalar");return 0 ; } -#ifdef RTE_ARCH_X86 +#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" );
@@ -2615,7 +2615,7 @@ bnxt_tx_burst_mode_get(struct rte_eth_dev *dev, __rte_unused uint16_t queue_id, "Scalar");return 0 ; } -#ifdef RTE_ARCH_X86 +#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" );
@@ -2644,7 +2644,7 @@ 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 ; -#ifdef RTE_ARCH_X86 +#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.
drivers/net/bnxt/bnxt_ring.c +2 -2
@@ -608,7 +608,7 @@ int bnxt_alloc_hwrm_rx_ring(struct bnxt *bp, int queue_index)bnxt_db_write (&rxr->ag_db, rxr->ag_prod); } rxq->index = queue_index; -#ifdef RTE_ARCH_X86 +#if defined(RTE_ARCH_X86 ) || defined(RTE_ARCH_ARM64 )bnxt_rxq_vec_setup (rxq);#endif
@@ -713,7 +713,7 @@ int bnxt_alloc_hwrm_rings(struct bnxt *bp)bnxt_db_write (&rxr->rx_db, rxr->rx_prod);bnxt_db_write (&rxr->ag_db, rxr->ag_prod); rxq->index = i; -#ifdef RTE_ARCH_X86 +#if defined(RTE_ARCH_X86 ) || defined(RTE_ARCH_ARM64 )bnxt_rxq_vec_setup (rxq);#endif }
drivers/net/bnxt/bnxt_rxq.h +1 -1
@@ -22,7 +22,7 @@ struct bnxt_rx_queue {uint16_t nb_rx_hold;/* num held free RX desc */ uint16_t rx_free_thresh;/* max free RX desc to hold */ uint16_t queue_id;/* RX queue index */ -#ifdef RTE_ARCH_X86 +#if defined(RTE_ARCH_X86 ) || defined(RTE_ARCH_ARM64 )uint16_t rxrearm_nb;/* number of descs to reinit. */ uint16_t rxrearm_start;/* next desc index to reinit. */ #endif
drivers/net/bnxt/bnxt_rxr.c +1 -1
@@ -747,7 +747,7 @@ uint16_t bnxt_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, !rte_spinlock_trylock(&rxq->lock)))return 0 ; -#if defined(RTE_ARCH_X86 ) +#if defined(RTE_ARCH_X86 ) || defined(RTE_ARCH_ARM64 )/* * Replenish buffers if needed when a transition has been made from * vector- to non-vector- receive processing.
drivers/net/bnxt/bnxt_rxr.h +1 -1
@@ -220,7 +220,7 @@ int bnxt_init_one_rx_ring(struct bnxt_rx_queue *rxq);int bnxt_rx_queue_start (struct rte_eth_dev *dev,uint16_t rx_queue_id);int bnxt_rx_queue_stop (struct rte_eth_dev *dev,uint16_t rx_queue_id); -#ifdef RTE_ARCH_X86 +#if defined(RTE_ARCH_X86 ) || defined(RTE_ARCH_ARM64 )uint16_t bnxt_recv_pkts_vec (void *rx_queue,struct rte_mbuf **rx_pkts,uint16_t nb_pkts);int bnxt_rxq_vec_setup (struct bnxt_rx_queue *rxq);
drivers/net/bnxt/bnxt_rxtx_vec_common.h new file +57 -0
57 lines not on this page · raw message
drivers/net/bnxt/bnxt_rxtx_vec_neon.c new file +469 -0
469 lines not on this page · raw message
drivers/net/bnxt/bnxt_rxtx_vec_sse.c +2 -44
68 lines not on this page · raw message
drivers/net/bnxt/bnxt_txr.h +1 -1
@@ -59,7 +59,7 @@ uint16_t bnxt_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts);uint16_t bnxt_dummy_xmit_pkts (void *tx_queue,struct rte_mbuf **tx_pkts,uint16_t nb_pkts); -#ifdef RTE_ARCH_X86 +#if defined(RTE_ARCH_X86 ) || defined(RTE_ARCH_ARM64 )uint16_t bnxt_xmit_pkts_vec (void *tx_queue,struct rte_mbuf **tx_pkts,uint16_t nb_pkts);#endif
drivers/net/bnxt/meson.build +2 -0
@@ -47,4 +47,6 @@ sources = files('bnxt_cpr.c', if arch_subdir == 'x86' sources += files('bnxt_rxtx_vec_sse.c') +elif arch_subdir == 'arm' and host_machine.cpu_family().startswith('aarch64') + sources += files('bnxt_rxtx_vec_neon.c') endif
Signature · 1 line
2.25.1
Re: [dpdk-dev] [PATCH 3/3] net/bnxt: add ARM64 vector support
Quoted 33 lines
-----Original Message-----
From: Lance Richardson <[email protected]>
Sent: Thursday, June 18, 2020 10:36 PM
To: [email protected]; Ajit Khaparde ([email protected]) <[email protected]>; Ruifeng Wang <[email protected]>
Subject: [PATCH 3/3] net/bnxt: add ARM64 vector supportAdd bnxt vector PMD support using NEON SIMD instructions.
Signed-off-by Lance Richardson <[email protected]>Reviewed-by Ajit Kumar Khaparde <[email protected]>---
v2:
- Userte_vect.hinstead of includingarm_neon.hdirectly inbnxt_rxtx_vec_neon.c.drivers/net/bnxt/Makefile | 3 + drivers/net/bnxt/bnxt_ethdev.c | 10 +- drivers/net/bnxt/bnxt_ring.c | 4 +- drivers/net/bnxt/bnxt_rxq.h | 2 +- drivers/net/bnxt/bnxt_rxr.c | 2 +- drivers/net/bnxt/bnxt_rxr.h | 2 +- drivers/net/bnxt/bnxt_rxtx_vec_common.h | 57 +++ drivers/net/bnxt/bnxt_rxtx_vec_neon.c | 469 ++++++++++++++++++++++++ drivers/net/bnxt/bnxt_rxtx_vec_sse.c | 46 +-- drivers/net/bnxt/bnxt_txr.h | 2 +- drivers/net/bnxt/meson.build | 2 + 11 files changed, 544 insertions(+), 55 deletions(-) create mode 100644 drivers/net/bnxt/bnxt_rxtx_vec_common.h create mode 100644 drivers/net/bnxt/bnxt_rxtx_vec_neon.c
<snip>
Quoted 6 lines · Lance Richardson
- Switch to non-vector receive function when "mark" action is requested.
- Add support for rx_burst_mode_get()/tx_burst_mode_get() to return currently active receive/transmit mode.
- Add vector mode support for ARM64.
Patches applied to dpdk-next-net-brcm. Thanks
Quoted 27 lines
Lance Richardson (3):
net/bnxt: disable vector receive for mark action net/bnxt: support Rx/Tx burst mode info net/bnxt: add ARM64 vector supportdoc/guides/nics/features/bnxt.ini | 1 + drivers/net/bnxt/Makefile | 3 + drivers/net/bnxt/bnxt_ethdev.c | 52 ++- drivers/net/bnxt/bnxt_flow.c | 20 +- drivers/net/bnxt/bnxt_ring.c | 4 +- drivers/net/bnxt/bnxt_rxq.h | 2 +- drivers/net/bnxt/bnxt_rxr.c | 18 + drivers/net/bnxt/bnxt_rxr.h | 2 +- drivers/net/bnxt/bnxt_rxtx_vec_common.h | 57 +++ drivers/net/bnxt/bnxt_rxtx_vec_neon.c | 469 ++++++++++++++++++++++++ drivers/net/bnxt/bnxt_rxtx_vec_sse.c | 46 +-- drivers/net/bnxt/bnxt_txr.h | 2 +- drivers/net/bnxt/meson.build | 2 + 13 files changed, 614 insertions(+), 64 deletions(-) create mode 100644 drivers/net/bnxt/bnxt_rxtx_vec_common.h create mode 100644 drivers/net/bnxt/bnxt_rxtx_vec_neon.c--
2.25.1
v3 cover net/bnxt: vector mode enhancements
In reply to Lance Richardson- Switch to non-vector receive function when "mark" action is requested.
- Add support for rx_burst_mode_get()/tx_burst_mode_get() to return currently active receive/transmit mode.
- Add vector mode support for ARM64.
v2->v3:
- update bnxt doc
- update 20.08 release notes
Ajit Khaparde (1):
doc: update release notes
Lance Richardson (3):
net/bnxt: disable vector receive for mark action net/bnxt: support Rx/Tx burst mode info net/bnxt: add ARM64 vector support
doc/guides/nics/bnxt.rst | 6 +- doc/guides/nics/features/bnxt.ini | 1 + doc/guides/rel_notes/release_20_08.rst | 2 + drivers/net/bnxt/Makefile | 3 + drivers/net/bnxt/bnxt_ethdev.c | 52 ++- drivers/net/bnxt/bnxt_flow.c | 20 +- drivers/net/bnxt/bnxt_ring.c | 4 +- drivers/net/bnxt/bnxt_rxq.h | 2 +- drivers/net/bnxt/bnxt_rxr.c | 18 + drivers/net/bnxt/bnxt_rxr.h | 2 +- drivers/net/bnxt/bnxt_rxtx_vec_common.h | 57 +++ drivers/net/bnxt/bnxt_rxtx_vec_neon.c | 469 ++++++++++++++++++++++++ drivers/net/bnxt/bnxt_rxtx_vec_sse.c | 46 +-- drivers/net/bnxt/bnxt_txr.h | 2 +- drivers/net/bnxt/meson.build | 2 + 15 files changed, 619 insertions(+), 67 deletions(-) create mode 100644 drivers/net/bnxt/bnxt_rxtx_vec_common.h create mode 100644 drivers/net/bnxt/bnxt_rxtx_vec_neon.c
Signature · 1 line
2.21.1 (Apple Git-122.3)
PATCH v3 1/4 net/bnxt: disable vector receive for mark action
From: Lance Richardson <[email protected]>
The bnxt vector mode receive handler does not support the rte_flow 'mark' action. Since we cannot know in advance whether this action will be required, add support for dynamically switching from vector to non-vector receive when the first flow create request with a mark action is processed.
--- drivers/net/bnxt/bnxt_flow.c | 20 ++++++++------------ drivers/net/bnxt/bnxt_rxr.c | 18 ++++++++++++++++++ 2 files changed, 26 insertions(+), 12 deletions(-)
drivers/net/bnxt/bnxt_flow.c +8 -12
@@ -18,6 +18,7 @@#include "bnxt_hwrm.h" #include "bnxt_ring.h" #include "bnxt_rxq.h" +#include "bnxt_rxr.h" #include "bnxt_vnic.h" #include "hsi_struct_def_dpdk.h"
@@ -1403,18 +1404,6 @@ bnxt_validate_and_parse_flow(struct rte_eth_dev *dev,bnxt_update_filter_flags_en (filter, filter1, use_ntuple);break ;case RTE_FLOW_ACTION_TYPE_MARK : -if (bp->flags &BNXT_FLAG_RX_VECTOR_PKT_MODE ) { -PMD_DRV_LOG (DEBUG , -"Disable vector processing for mark\n" ); -rte_flow_error_set (error, -ENOTSUP , -RTE_FLOW_ERROR_TYPE_ACTION , - act, -"Disable vector processing for mark" ); - rc = -rte_errno; - goto ret; - } -if (bp->mark_table ==NULL ) { rte_flow_error_set(error, ENOMEM,
@@ -1425,6 +1414,13 @@ bnxt_validate_and_parse_flow(struct rte_eth_dev *dev, goto ret; } +if (bp->flags &BNXT_FLAG_RX_VECTOR_PKT_MODE ) { +PMD_DRV_LOG (DEBUG , +"Disabling vector processing for mark\n" ); + bp->eth_dev->rx_pkt_burst = bnxt_recv_pkts; + bp->flags &= ~BNXT_FLAG_RX_VECTOR_PKT_MODE ; + } + filter->valid_flags |=BNXT_FLOW_MARK_FLAG ; filter->mark = ((const struct rte_flow_action_mark *) act->conf)->id;
drivers/net/bnxt/bnxt_rxr.c +18 -0
@@ -782,6 +782,24 @@ uint16_t bnxt_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, !rte_spinlock_trylock(&rxq->lock)))return 0 ; +#if defined(RTE_ARCH_X86 ) +/* +* Replenish buffers if needed when a transition has been made from +* vector- to non-vector- receive processing. +*/ +while (unlikely (rxq->rxrearm_nb)) { +if (!bnxt_alloc_rx_data (rxq, rxr, rxq->rxrearm_start)) { + rxr->rx_prod = rxq->rxrearm_start; +bnxt_db_write (&rxr->rx_db, rxr->rx_prod); + rxq->rxrearm_start++; + rxq->rxrearm_nb--; + }else { +/* Retry allocation on next call. */ +break ; + } + } +#endif +/* Handle RX burst request */ while (1 ) { cons =RING_CMP (cpr->cp_ring_struct, raw_cons);
Signature · 1 line
2.21.1 (Apple Git-122.3)
PATCH v3 2/4 net/bnxt: support Rx/Tx burst mode info
In reply to Ajit KhapardeFrom: Lance Richardson <[email protected]>
Retrieve burst mode options according to the selected Rx/Tx burst function name.
--- doc/guides/nics/features/bnxt.ini | 1 + drivers/net/bnxt/bnxt_ethdev.c | 46 +++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+)
doc/guides/nics/features/bnxt.ini +1 -0
@@ -9,6 +9,7 @@ Link status = Y Link status event = Y Rx interrupt = Y Queue start/stop = Y +Burst mode info = Y MTU update = Y Jumbo frame = Y Scattered Rx = Y
drivers/net/bnxt/bnxt_ethdev.c +46 -0
58 lines not on this page · raw message
Signature · 1 line
2.21.1 (Apple Git-122.3)
PATCH v3 3/4 net/bnxt: add ARM64 vector support
In reply to Ajit KhapardeFrom: Lance Richardson <[email protected]>
Add bnxt vector PMD support using NEON SIMD instructions.
--- doc/guides/nics/bnxt.rst | 6 +- drivers/net/bnxt/Makefile | 3 + drivers/net/bnxt/bnxt_ethdev.c | 10 +- drivers/net/bnxt/bnxt_ring.c | 4 +- drivers/net/bnxt/bnxt_rxq.h | 2 +- drivers/net/bnxt/bnxt_rxr.c | 2 +- drivers/net/bnxt/bnxt_rxr.h | 2 +- drivers/net/bnxt/bnxt_rxtx_vec_common.h | 57 +++ drivers/net/bnxt/bnxt_rxtx_vec_neon.c | 469 ++++++++++++++++++++++++ drivers/net/bnxt/bnxt_rxtx_vec_sse.c | 46 +-- drivers/net/bnxt/bnxt_txr.h | 2 +- drivers/net/bnxt/meson.build | 2 + 12 files changed, 547 insertions(+), 58 deletions(-) create mode 100644 drivers/net/bnxt/bnxt_rxtx_vec_common.h create mode 100644 drivers/net/bnxt/bnxt_rxtx_vec_neon.c
doc/guides/nics/bnxt.rst +3 -3
@@ -774,9 +774,9 @@ Vector processing provides significantly improved performance over scalar processing (see Vector Processor, here). The BNXT PMD supports the vector processing using SSE (Streaming SIMD -Extensions) instructions on x86 platforms. The BNXT vPMD (vector mode PMD) is -currently limited to Intel/AMD CPU architecture. Support for ARM is *not* -currently implemented. +Extensions) instructions on x86 platforms. It also supports NEON intrinsics for +vector processing on ARM CPUs. The BNXT vPMD (vector mode PMD) is available for +Intel/AMD and ARM CPU architectures. This improved performance comes from several optimizations:
drivers/net/bnxt/Makefile +3 -0
@@ -44,6 +44,9 @@ SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += rte_pmd_bnxt.c ifeq ($(CONFIG_RTE_ARCH_X86), y) SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += bnxt_rxtx_vec_sse.c endif +ifeq ($(CONFIG_RTE_ARCH_ARM64), y) +SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += bnxt_rxtx_vec_neon.c +endif ifeq ($(CONFIG_RTE_LIBRTE_BNXT_PMD), y) CFLAGS += -I$(SRCDIR) -I$(SRCDIR)/tf_ulp -I$(SRCDIR)/tf_core -I$(SRCDIR)/hcapi
drivers/net/bnxt/bnxt_ethdev.c +5 -5
@@ -1077,7 +1077,7 @@ bnxt_receive_function(struct rte_eth_dev *eth_dev) {struct bnxt *bp = eth_dev->data->dev_private; -#ifdef RTE_ARCH_X86 +#if defined(RTE_ARCH_X86 ) || defined(RTE_ARCH_ARM64 )#ifndef RTE_LIBRTE_IEEE1588 /* * Vector mode receive can be enabled only if scatter rx is not
@@ -1117,7 +1117,7 @@ bnxt_receive_function(struct rte_eth_dev *eth_dev)static eth_tx_burst_t bnxt_transmit_function(__rte_unused struct rte_eth_dev *eth_dev) { -#ifdef RTE_ARCH_X86 +#if defined(RTE_ARCH_X86 ) || defined(RTE_ARCH_ARM64 )#ifndef RTE_LIBRTE_IEEE1588 struct bnxt *bp = eth_dev->data->dev_private;
@@ -2680,7 +2680,7 @@ bnxt_rx_burst_mode_get(struct rte_eth_dev *dev, __rte_unused uint16_t queue_id, "Scalar");return 0 ; } -#ifdef RTE_ARCH_X86 +#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" );
@@ -2702,7 +2702,7 @@ bnxt_tx_burst_mode_get(struct rte_eth_dev *dev, __rte_unused uint16_t queue_id, "Scalar");return 0 ; } -#ifdef RTE_ARCH_X86 +#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" );
@@ -2731,7 +2731,7 @@ 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 ; -#ifdef RTE_ARCH_X86 +#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.
drivers/net/bnxt/bnxt_ring.c +2 -2
@@ -608,7 +608,7 @@ int bnxt_alloc_hwrm_rx_ring(struct bnxt *bp, int queue_index)bnxt_db_write (&rxr->ag_db, rxr->ag_prod); } rxq->index = queue_index; -#ifdef RTE_ARCH_X86 +#if defined(RTE_ARCH_X86 ) || defined(RTE_ARCH_ARM64 )bnxt_rxq_vec_setup (rxq);#endif
@@ -713,7 +713,7 @@ int bnxt_alloc_hwrm_rings(struct bnxt *bp)bnxt_db_write (&rxr->rx_db, rxr->rx_prod);bnxt_db_write (&rxr->ag_db, rxr->ag_prod); rxq->index = i; -#ifdef RTE_ARCH_X86 +#if defined(RTE_ARCH_X86 ) || defined(RTE_ARCH_ARM64 )bnxt_rxq_vec_setup (rxq);#endif }
drivers/net/bnxt/bnxt_rxq.h +1 -1
@@ -22,7 +22,7 @@ struct bnxt_rx_queue {uint16_t nb_rx_hold;/* num held free RX desc */ uint16_t rx_free_thresh;/* max free RX desc to hold */ uint16_t queue_id;/* RX queue index */ -#ifdef RTE_ARCH_X86 +#if defined(RTE_ARCH_X86 ) || defined(RTE_ARCH_ARM64 )uint16_t rxrearm_nb;/* number of descs to reinit. */ uint16_t rxrearm_start;/* next desc index to reinit. */ #endif
drivers/net/bnxt/bnxt_rxr.c +1 -1
@@ -782,7 +782,7 @@ uint16_t bnxt_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, !rte_spinlock_trylock(&rxq->lock)))return 0 ; -#if defined(RTE_ARCH_X86 ) +#if defined(RTE_ARCH_X86 ) || defined(RTE_ARCH_ARM64 )/* * Replenish buffers if needed when a transition has been made from * vector- to non-vector- receive processing.
drivers/net/bnxt/bnxt_rxr.h +1 -1
@@ -221,7 +221,7 @@ int bnxt_init_one_rx_ring(struct bnxt_rx_queue *rxq);int bnxt_rx_queue_start (struct rte_eth_dev *dev,uint16_t rx_queue_id);int bnxt_rx_queue_stop (struct rte_eth_dev *dev,uint16_t rx_queue_id); -#ifdef RTE_ARCH_X86 +#if defined(RTE_ARCH_X86 ) || defined(RTE_ARCH_ARM64 )uint16_t bnxt_recv_pkts_vec (void *rx_queue,struct rte_mbuf **rx_pkts,uint16_t nb_pkts);int bnxt_rxq_vec_setup (struct bnxt_rx_queue *rxq);
drivers/net/bnxt/bnxt_rxtx_vec_common.h new file +57 -0
57 lines not on this page · raw message
drivers/net/bnxt/bnxt_rxtx_vec_neon.c new file +469 -0
469 lines not on this page · raw message
drivers/net/bnxt/bnxt_rxtx_vec_sse.c +2 -44
68 lines not on this page · raw message
drivers/net/bnxt/bnxt_txr.h +1 -1
@@ -59,7 +59,7 @@ uint16_t bnxt_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts);uint16_t bnxt_dummy_xmit_pkts (void *tx_queue,struct rte_mbuf **tx_pkts,uint16_t nb_pkts); -#ifdef RTE_ARCH_X86 +#if defined(RTE_ARCH_X86 ) || defined(RTE_ARCH_ARM64 )uint16_t bnxt_xmit_pkts_vec (void *tx_queue,struct rte_mbuf **tx_pkts,uint16_t nb_pkts);#endif
drivers/net/bnxt/meson.build +2 -0
@@ -68,4 +68,6 @@ sources = files('bnxt_cpr.c', if arch_subdir == 'x86' sources += files('bnxt_rxtx_vec_sse.c') +elif arch_subdir == 'arm' and host_machine.cpu_family().startswith('aarch64') + sources += files('bnxt_rxtx_vec_neon.c') endif
Signature · 1 line
2.21.1 (Apple Git-122.3)
PATCH v3 4/4 doc: update release notes
In reply to Ajit KhapardeUpdate release notes indicating vector mode support for ARM CPUs in Broadcom bnxt PMD.
--- doc/guides/rel_notes/release_20_08.rst | 2 ++ 1 file changed, 2 insertions(+)
doc/guides/rel_notes/release_20_08.rst +2 -0
@@ -100,6 +100,8 @@ New Features * Added support for new resource manager API. * Added support for VXLAN encap/decap. * Added support for rte_flow_query for COUNT action. + * Added support for rx_burst_mode_get and tx_burst_mode_get + * Added vector mode support for ARM CPUs * **Added support for BPF_ABS/BPF_IND load instructions.**
Signature · 1 line
2.21.1 (Apple Git-122.3)
v4 cover net/bnxt: vector mode enhancements
In reply to Lance Richardsonv2->v3:
- update bnxt doc
- update 20.08 release notes
v3->v4:
- rebase against latest code base
Ajit Khaparde (1):
doc: update release notes
Lance Richardson (3):
net/bnxt: disable vector receive for mark action net/bnxt: support Rx/Tx burst mode info net/bnxt: add ARM64 vector support
doc/guides/nics/bnxt.rst | 6 +- doc/guides/nics/features/bnxt.ini | 1 + doc/guides/rel_notes/release_20_08.rst | 2 + drivers/net/bnxt/Makefile | 3 + drivers/net/bnxt/bnxt_ethdev.c | 52 ++- drivers/net/bnxt/bnxt_flow.c | 20 +- drivers/net/bnxt/bnxt_ring.c | 4 +- drivers/net/bnxt/bnxt_rxq.h | 2 +- drivers/net/bnxt/bnxt_rxr.c | 18 + drivers/net/bnxt/bnxt_rxr.h | 2 +- drivers/net/bnxt/bnxt_rxtx_vec_common.h | 57 +++ drivers/net/bnxt/bnxt_rxtx_vec_neon.c | 469 ++++++++++++++++++++++++ drivers/net/bnxt/bnxt_rxtx_vec_sse.c | 46 +-- drivers/net/bnxt/bnxt_txr.h | 2 +- drivers/net/bnxt/meson.build | 2 + 15 files changed, 619 insertions(+), 67 deletions(-) create mode 100644 drivers/net/bnxt/bnxt_rxtx_vec_common.h create mode 100644 drivers/net/bnxt/bnxt_rxtx_vec_neon.c
Signature · 1 line
2.21.1 (Apple Git-122.3)
PATCH v4 1/4 net/bnxt: disable vector receive for mark action
From: Lance Richardson <[email protected]>
The bnxt vector mode receive handler does not support the rte_flow 'mark' action. Since we cannot know in advance whether this action will be required, add support for dynamically switching from vector to non-vector receive when the first flow create request with a mark action is processed.
--- drivers/net/bnxt/bnxt_flow.c | 20 ++++++++------------ drivers/net/bnxt/bnxt_rxr.c | 18 ++++++++++++++++++ 2 files changed, 26 insertions(+), 12 deletions(-)
drivers/net/bnxt/bnxt_flow.c +8 -12
@@ -18,6 +18,7 @@#include "bnxt_hwrm.h" #include "bnxt_ring.h" #include "bnxt_rxq.h" +#include "bnxt_rxr.h" #include "bnxt_vnic.h" #include "hsi_struct_def_dpdk.h"
@@ -1403,18 +1404,6 @@ bnxt_validate_and_parse_flow(struct rte_eth_dev *dev,bnxt_update_filter_flags_en (filter, filter1, use_ntuple);break ;case RTE_FLOW_ACTION_TYPE_MARK : -if (bp->flags &BNXT_FLAG_RX_VECTOR_PKT_MODE ) { -PMD_DRV_LOG (DEBUG , -"Disable vector processing for mark\n" ); -rte_flow_error_set (error, -ENOTSUP , -RTE_FLOW_ERROR_TYPE_ACTION , - act, -"Disable vector processing for mark" ); - rc = -rte_errno; - goto ret; - } -if (bp->mark_table ==NULL ) { rte_flow_error_set(error, ENOMEM,
@@ -1425,6 +1414,13 @@ bnxt_validate_and_parse_flow(struct rte_eth_dev *dev, goto ret; } +if (bp->flags &BNXT_FLAG_RX_VECTOR_PKT_MODE ) { +PMD_DRV_LOG (DEBUG , +"Disabling vector processing for mark\n" ); + bp->eth_dev->rx_pkt_burst = bnxt_recv_pkts; + bp->flags &= ~BNXT_FLAG_RX_VECTOR_PKT_MODE ; + } + filter->valid_flags |=BNXT_FLOW_MARK_FLAG ; filter->mark = ((const struct rte_flow_action_mark *) act->conf)->id;
drivers/net/bnxt/bnxt_rxr.c +18 -0
@@ -782,6 +782,24 @@ uint16_t bnxt_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, !rte_spinlock_trylock(&rxq->lock)))return 0 ; +#if defined(RTE_ARCH_X86 ) +/* +* Replenish buffers if needed when a transition has been made from +* vector- to non-vector- receive processing. +*/ +while (unlikely (rxq->rxrearm_nb)) { +if (!bnxt_alloc_rx_data (rxq, rxr, rxq->rxrearm_start)) { + rxr->rx_prod = rxq->rxrearm_start; +bnxt_db_write (&rxr->rx_db, rxr->rx_prod); + rxq->rxrearm_start++; + rxq->rxrearm_nb--; + }else { +/* Retry allocation on next call. */ +break ; + } + } +#endif +/* Handle RX burst request */ while (1 ) { cons =RING_CMP (cpr->cp_ring_struct, raw_cons);
Signature · 1 line
2.21.1 (Apple Git-122.3)
PATCH v4 2/4 net/bnxt: support Rx/Tx burst mode info
In reply to Ajit KhapardeFrom: Lance Richardson <[email protected]>
Retrieve burst mode options according to the selected Rx/Tx burst function name.
--- doc/guides/nics/features/bnxt.ini | 1 + drivers/net/bnxt/bnxt_ethdev.c | 46 +++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+)
doc/guides/nics/features/bnxt.ini +1 -0
@@ -9,6 +9,7 @@ Link status = Y Link status event = Y Rx interrupt = Y Queue start/stop = Y +Burst mode info = Y MTU update = Y Jumbo frame = Y Scattered Rx = Y
drivers/net/bnxt/bnxt_ethdev.c +46 -0
58 lines not on this page · raw message
Signature · 1 line
2.21.1 (Apple Git-122.3)
PATCH v4 3/4 net/bnxt: add ARM64 vector support
In reply to Ajit KhapardeFrom: Lance Richardson <[email protected]>
Add bnxt vector PMD support using NEON SIMD instructions.
--- doc/guides/nics/bnxt.rst | 6 +- drivers/net/bnxt/Makefile | 3 + drivers/net/bnxt/bnxt_ethdev.c | 10 +- drivers/net/bnxt/bnxt_ring.c | 4 +- drivers/net/bnxt/bnxt_rxq.h | 2 +- drivers/net/bnxt/bnxt_rxr.c | 2 +- drivers/net/bnxt/bnxt_rxr.h | 2 +- drivers/net/bnxt/bnxt_rxtx_vec_common.h | 57 +++ drivers/net/bnxt/bnxt_rxtx_vec_neon.c | 469 ++++++++++++++++++++++++ drivers/net/bnxt/bnxt_rxtx_vec_sse.c | 46 +-- drivers/net/bnxt/bnxt_txr.h | 2 +- drivers/net/bnxt/meson.build | 2 + 12 files changed, 547 insertions(+), 58 deletions(-) create mode 100644 drivers/net/bnxt/bnxt_rxtx_vec_common.h create mode 100644 drivers/net/bnxt/bnxt_rxtx_vec_neon.c
doc/guides/nics/bnxt.rst +3 -3
@@ -774,9 +774,9 @@ Vector processing provides significantly improved performance over scalar processing (see Vector Processor, here). The BNXT PMD supports the vector processing using SSE (Streaming SIMD -Extensions) instructions on x86 platforms. The BNXT vPMD (vector mode PMD) is -currently limited to Intel/AMD CPU architecture. Support for ARM is *not* -currently implemented. +Extensions) instructions on x86 platforms. It also supports NEON intrinsics for +vector processing on ARM CPUs. The BNXT vPMD (vector mode PMD) is available for +Intel/AMD and ARM CPU architectures. This improved performance comes from several optimizations:
drivers/net/bnxt/Makefile +3 -0
@@ -44,6 +44,9 @@ SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += rte_pmd_bnxt.c ifeq ($(CONFIG_RTE_ARCH_X86), y) SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += bnxt_rxtx_vec_sse.c endif +ifeq ($(CONFIG_RTE_ARCH_ARM64), y) +SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += bnxt_rxtx_vec_neon.c +endif ifeq ($(CONFIG_RTE_LIBRTE_BNXT_PMD), y) CFLAGS += -I$(SRCDIR) -I$(SRCDIR)/tf_ulp -I$(SRCDIR)/tf_core -I$(SRCDIR)/hcapi
drivers/net/bnxt/bnxt_ethdev.c +5 -5
@@ -1076,7 +1076,7 @@ bnxt_receive_function(struct rte_eth_dev *eth_dev) {struct bnxt *bp = eth_dev->data->dev_private; -#ifdef RTE_ARCH_X86 +#if defined(RTE_ARCH_X86 ) || defined(RTE_ARCH_ARM64 )#ifndef RTE_LIBRTE_IEEE1588 /* * Vector mode receive can be enabled only if scatter rx is not
@@ -1116,7 +1116,7 @@ bnxt_receive_function(struct rte_eth_dev *eth_dev)static eth_tx_burst_t bnxt_transmit_function(__rte_unused struct rte_eth_dev *eth_dev) { -#ifdef RTE_ARCH_X86 +#if defined(RTE_ARCH_X86 ) || defined(RTE_ARCH_ARM64 )#ifndef RTE_LIBRTE_IEEE1588 struct bnxt *bp = eth_dev->data->dev_private;
@@ -2679,7 +2679,7 @@ bnxt_rx_burst_mode_get(struct rte_eth_dev *dev, __rte_unused uint16_t queue_id, "Scalar");return 0 ; } -#ifdef RTE_ARCH_X86 +#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" );
@@ -2701,7 +2701,7 @@ bnxt_tx_burst_mode_get(struct rte_eth_dev *dev, __rte_unused uint16_t queue_id, "Scalar");return 0 ; } -#ifdef RTE_ARCH_X86 +#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" );
@@ -2730,7 +2730,7 @@ 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 ; -#ifdef RTE_ARCH_X86 +#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.
drivers/net/bnxt/bnxt_ring.c +2 -2
@@ -608,7 +608,7 @@ int bnxt_alloc_hwrm_rx_ring(struct bnxt *bp, int queue_index)bnxt_db_write (&rxr->ag_db, rxr->ag_prod); } rxq->index = queue_index; -#ifdef RTE_ARCH_X86 +#if defined(RTE_ARCH_X86 ) || defined(RTE_ARCH_ARM64 )bnxt_rxq_vec_setup (rxq);#endif
@@ -713,7 +713,7 @@ int bnxt_alloc_hwrm_rings(struct bnxt *bp)bnxt_db_write (&rxr->rx_db, rxr->rx_prod);bnxt_db_write (&rxr->ag_db, rxr->ag_prod); rxq->index = i; -#ifdef RTE_ARCH_X86 +#if defined(RTE_ARCH_X86 ) || defined(RTE_ARCH_ARM64 )bnxt_rxq_vec_setup (rxq);#endif }
drivers/net/bnxt/bnxt_rxq.h +1 -1
@@ -22,7 +22,7 @@ struct bnxt_rx_queue {uint16_t nb_rx_hold;/* num held free RX desc */ uint16_t rx_free_thresh;/* max free RX desc to hold */ uint16_t queue_id;/* RX queue index */ -#ifdef RTE_ARCH_X86 +#if defined(RTE_ARCH_X86 ) || defined(RTE_ARCH_ARM64 )uint16_t rxrearm_nb;/* number of descs to reinit. */ uint16_t rxrearm_start;/* next desc index to reinit. */ #endif
drivers/net/bnxt/bnxt_rxr.c +1 -1
@@ -782,7 +782,7 @@ uint16_t bnxt_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, !rte_spinlock_trylock(&rxq->lock)))return 0 ; -#if defined(RTE_ARCH_X86 ) +#if defined(RTE_ARCH_X86 ) || defined(RTE_ARCH_ARM64 )/* * Replenish buffers if needed when a transition has been made from * vector- to non-vector- receive processing.
drivers/net/bnxt/bnxt_rxr.h +1 -1
@@ -221,7 +221,7 @@ int bnxt_init_one_rx_ring(struct bnxt_rx_queue *rxq);int bnxt_rx_queue_start (struct rte_eth_dev *dev,uint16_t rx_queue_id);int bnxt_rx_queue_stop (struct rte_eth_dev *dev,uint16_t rx_queue_id); -#ifdef RTE_ARCH_X86 +#if defined(RTE_ARCH_X86 ) || defined(RTE_ARCH_ARM64 )uint16_t bnxt_recv_pkts_vec (void *rx_queue,struct rte_mbuf **rx_pkts,uint16_t nb_pkts);int bnxt_rxq_vec_setup (struct bnxt_rx_queue *rxq);
drivers/net/bnxt/bnxt_rxtx_vec_common.h new file +57 -0
57 lines not on this page · raw message
drivers/net/bnxt/bnxt_rxtx_vec_neon.c new file +469 -0
469 lines not on this page · raw message
drivers/net/bnxt/bnxt_rxtx_vec_sse.c +2 -44
68 lines not on this page · raw message
drivers/net/bnxt/bnxt_txr.h +1 -1
@@ -59,7 +59,7 @@ uint16_t bnxt_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts);uint16_t bnxt_dummy_xmit_pkts (void *tx_queue,struct rte_mbuf **tx_pkts,uint16_t nb_pkts); -#ifdef RTE_ARCH_X86 +#if defined(RTE_ARCH_X86 ) || defined(RTE_ARCH_ARM64 )uint16_t bnxt_xmit_pkts_vec (void *tx_queue,struct rte_mbuf **tx_pkts,uint16_t nb_pkts);#endif
drivers/net/bnxt/meson.build +2 -0
@@ -68,4 +68,6 @@ sources = files('bnxt_cpr.c', if arch_subdir == 'x86' sources += files('bnxt_rxtx_vec_sse.c') +elif arch_subdir == 'arm' and host_machine.cpu_family().startswith('aarch64') + sources += files('bnxt_rxtx_vec_neon.c') endif
Signature · 1 line
2.21.1 (Apple Git-122.3)
PATCH v4 4/4 doc: update release notes
In reply to Ajit KhapardeUpdate release notes indicating vector mode support for ARM CPUs in Broadcom bnxt PMD.
--- doc/guides/rel_notes/release_20_08.rst | 2 ++ 1 file changed, 2 insertions(+)
doc/guides/rel_notes/release_20_08.rst +2 -0
@@ -101,6 +101,8 @@ New Features * Added support for new resource manager API. * Added support for VXLAN encap/decap. * Added support for rte_flow_query for COUNT action. + * Added support for rx_burst_mode_get and tx_burst_mode_get + * Added vector mode support for ARM CPUs * **Added support for BPF_ABS/BPF_IND load instructions.**
Signature · 1 line
2.21.1 (Apple Git-122.3)
Re: [dpdk-dev] [PATCH v4 4/4] doc: update release notes
Quoted 13 lines · Ajit Khaparde
Update release notes indicating vector mode support for ARM CPUs in Broadcom bnxt PMD.
Signed-off-by Ajit Khaparde <[email protected]>--- doc/guides/rel_notes/release_20_08.rst | 2 ++ 1 file changed, 2 insertions(+)doc/guides/rel_notes/release_20_08.rst +0
-0
doc/guides/rel_notes/release_20_08.rst New Features · line 108
Quoted 8 lines
doc/guides/rel_notes/release_20_08.rst +2
-0@@ -101,6 +101,8 @@ New Features * Added support for new resource manager API. * Added support for VXLAN encap/decap. * Added support for rte_flow_query for COUNT action. + * Added support for rx_burst_mode_get and tx_burst_mode_get + * Added vector mode support for ARM CPUs * **Added support for BPF_ABS/BPF_IND load instructions.**
Hi Ajit,
Can you please distribute these updates to the patches that adds the feature in this set, instead of having document as a separate patch?
Thanks,
ferruh
Re: [dpdk-dev] [PATCH v4 4/4] doc: update release notes
Quoted 27 lines · Ferruh Yigit
Review
Quoted 9 lines · Ajit Khaparde
Update release notes indicating vector mode support for ARM CPUs in Broadcom bnxt PMD.
Signed-off-by Ajit Khaparde <[email protected]>--- doc/guides/rel_notes/release_20_08.rst | 2 ++ 1 file changed, 2 insertions(+)(quoted diff) +0
-0
b/doc/guides/rel_notes/release_20_08.rstdoc/guides/rel_notes/release_20_08.rst New Features · line 108
Quoted 12 lines
index
17b35e066..1f6055441100644doc/guides/rel_notes/release_20_08.rst +2
-0@@ -101,6 +101,8 @@ New Features * Added support for new resource manager API. * Added support for VXLAN encap/decap. * Added support for rte_flow_query for COUNT action. + * Added support for rx_burst_mode_get and tx_burst_mode_get + * Added vector mode support for ARM CPUs * **Added support for BPF_ABS/BPF_IND load instructions.**Hi Ajit,
Quoted 4 lines
Can you please distribute these updates to the patches that adds the feature in
this set, instead of having document as a separate patch?
Sure Ferruh can do.
v5 on the way.
Quoted 5 lines
Thanks,
ferruh
v5 cover net/bnxt: vector mode enhancements
v2->v3:
- update bnxt doc
- update 20.08 release notes
v3->v4:
- rebase against latest code base
v4->v5:
- distribute release notes updates to the patches that adds the feature
Lance Richardson (3):
net/bnxt: disable vector receive for mark action net/bnxt: support Rx/Tx burst mode info net/bnxt: add ARM64 vector support
doc/guides/nics/bnxt.rst | 6 +- doc/guides/nics/features/bnxt.ini | 1 + doc/guides/rel_notes/release_20_08.rst | 2 + drivers/net/bnxt/Makefile | 3 + drivers/net/bnxt/bnxt_ethdev.c | 52 ++- drivers/net/bnxt/bnxt_flow.c | 20 +- drivers/net/bnxt/bnxt_ring.c | 4 +- drivers/net/bnxt/bnxt_rxq.h | 2 +- drivers/net/bnxt/bnxt_rxr.c | 18 + drivers/net/bnxt/bnxt_rxr.h | 2 +- drivers/net/bnxt/bnxt_rxtx_vec_common.h | 57 +++ drivers/net/bnxt/bnxt_rxtx_vec_neon.c | 469 ++++++++++++++++++++++++ drivers/net/bnxt/bnxt_rxtx_vec_sse.c | 46 +-- drivers/net/bnxt/bnxt_txr.h | 2 +- drivers/net/bnxt/meson.build | 2 + 15 files changed, 619 insertions(+), 67 deletions(-) create mode 100644 drivers/net/bnxt/bnxt_rxtx_vec_common.h create mode 100644 drivers/net/bnxt/bnxt_rxtx_vec_neon.c
Signature · 1 line
2.21.1 (Apple Git-122.3)
PATCH v5 1/3 net/bnxt: disable vector receive for mark action
From: Lance Richardson <[email protected]>
The bnxt vector mode receive handler does not support the rte_flow 'mark' action. Since we cannot know in advance whether this action will be required, add support for dynamically switching from vector to non-vector receive when the first flow create request with a mark action is processed.
--- drivers/net/bnxt/bnxt_flow.c | 20 ++++++++------------ drivers/net/bnxt/bnxt_rxr.c | 18 ++++++++++++++++++ 2 files changed, 26 insertions(+), 12 deletions(-)
drivers/net/bnxt/bnxt_flow.c +8 -12
@@ -18,6 +18,7 @@#include "bnxt_hwrm.h" #include "bnxt_ring.h" #include "bnxt_rxq.h" +#include "bnxt_rxr.h" #include "bnxt_vnic.h" #include "hsi_struct_def_dpdk.h"
@@ -1403,18 +1404,6 @@ bnxt_validate_and_parse_flow(struct rte_eth_dev *dev,bnxt_update_filter_flags_en (filter, filter1, use_ntuple);break ;case RTE_FLOW_ACTION_TYPE_MARK : -if (bp->flags &BNXT_FLAG_RX_VECTOR_PKT_MODE ) { -PMD_DRV_LOG (DEBUG , -"Disable vector processing for mark\n" ); -rte_flow_error_set (error, -ENOTSUP , -RTE_FLOW_ERROR_TYPE_ACTION , - act, -"Disable vector processing for mark" ); - rc = -rte_errno; - goto ret; - } -if (bp->mark_table ==NULL ) { rte_flow_error_set(error, ENOMEM,
@@ -1425,6 +1414,13 @@ bnxt_validate_and_parse_flow(struct rte_eth_dev *dev, goto ret; } +if (bp->flags &BNXT_FLAG_RX_VECTOR_PKT_MODE ) { +PMD_DRV_LOG (DEBUG , +"Disabling vector processing for mark\n" ); + bp->eth_dev->rx_pkt_burst = bnxt_recv_pkts; + bp->flags &= ~BNXT_FLAG_RX_VECTOR_PKT_MODE ; + } + filter->valid_flags |=BNXT_FLOW_MARK_FLAG ; filter->mark = ((const struct rte_flow_action_mark *) act->conf)->id;
drivers/net/bnxt/bnxt_rxr.c +18 -0
@@ -782,6 +782,24 @@ uint16_t bnxt_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, !rte_spinlock_trylock(&rxq->lock)))return 0 ; +#if defined(RTE_ARCH_X86 ) +/* +* Replenish buffers if needed when a transition has been made from +* vector- to non-vector- receive processing. +*/ +while (unlikely (rxq->rxrearm_nb)) { +if (!bnxt_alloc_rx_data (rxq, rxr, rxq->rxrearm_start)) { + rxr->rx_prod = rxq->rxrearm_start; +bnxt_db_write (&rxr->rx_db, rxr->rx_prod); + rxq->rxrearm_start++; + rxq->rxrearm_nb--; + }else { +/* Retry allocation on next call. */ +break ; + } + } +#endif +/* Handle RX burst request */ while (1 ) { cons =RING_CMP (cpr->cp_ring_struct, raw_cons);
Signature · 1 line
2.21.1 (Apple Git-122.3)
PATCH v5 2/3 net/bnxt: support Rx/Tx burst mode info
In reply to Ajit KhapardeFrom: Lance Richardson <[email protected]>
Retrieve burst mode options according to the selected Rx/Tx burst function name.
Update 20.08 release notes with this information.
--- doc/guides/nics/features/bnxt.ini | 1 + doc/guides/rel_notes/release_20_08.rst | 1 + drivers/net/bnxt/bnxt_ethdev.c | 46 ++++++++++++++++++++++++++ 3 files changed, 48 insertions(+)
doc/guides/nics/features/bnxt.ini +1 -0
@@ -9,6 +9,7 @@ Link status = Y Link status event = Y Rx interrupt = Y Queue start/stop = Y +Burst mode info = Y MTU update = Y Jumbo frame = Y Scattered Rx = Y
doc/guides/rel_notes/release_20_08.rst +1 -0
@@ -101,6 +101,7 @@ New Features * Added support for new resource manager API. * Added support for VXLAN encap/decap. * Added support for rte_flow_query for COUNT action. + * Added support for rx_burst_mode_get and tx_burst_mode_get. * **Added support for BPF_ABS/BPF_IND load instructions.**
drivers/net/bnxt/bnxt_ethdev.c +46 -0
58 lines not on this page · raw message
Signature · 1 line
2.21.1 (Apple Git-122.3)
PATCH v5 3/3 net/bnxt: add ARM64 vector support
In reply to Ajit KhapardeFrom: Lance Richardson <[email protected]>
Add bnxt vector PMD support using NEON SIMD instructions. Also update the 20.08 release notes with this information.
--- doc/guides/nics/bnxt.rst | 6 +- doc/guides/rel_notes/release_20_08.rst | 1 + drivers/net/bnxt/Makefile | 3 + drivers/net/bnxt/bnxt_ethdev.c | 10 +- drivers/net/bnxt/bnxt_ring.c | 4 +- drivers/net/bnxt/bnxt_rxq.h | 2 +- drivers/net/bnxt/bnxt_rxr.c | 2 +- drivers/net/bnxt/bnxt_rxr.h | 2 +- drivers/net/bnxt/bnxt_rxtx_vec_common.h | 57 +++ drivers/net/bnxt/bnxt_rxtx_vec_neon.c | 469 ++++++++++++++++++++++++ drivers/net/bnxt/bnxt_rxtx_vec_sse.c | 46 +-- drivers/net/bnxt/bnxt_txr.h | 2 +- drivers/net/bnxt/meson.build | 2 + 13 files changed, 548 insertions(+), 58 deletions(-) create mode 100644 drivers/net/bnxt/bnxt_rxtx_vec_common.h create mode 100644 drivers/net/bnxt/bnxt_rxtx_vec_neon.c
doc/guides/nics/bnxt.rst +3 -3
@@ -774,9 +774,9 @@ Vector processing provides significantly improved performance over scalar processing (see Vector Processor, here). The BNXT PMD supports the vector processing using SSE (Streaming SIMD -Extensions) instructions on x86 platforms. The BNXT vPMD (vector mode PMD) is -currently limited to Intel/AMD CPU architecture. Support for ARM is *not* -currently implemented. +Extensions) instructions on x86 platforms. It also supports NEON intrinsics for +vector processing on ARM CPUs. The BNXT vPMD (vector mode PMD) is available for +Intel/AMD and ARM CPU architectures. This improved performance comes from several optimizations:
doc/guides/rel_notes/release_20_08.rst +1 -0
@@ -102,6 +102,7 @@ New Features * Added support for VXLAN encap/decap. * Added support for rte_flow_query for COUNT action. * Added support for rx_burst_mode_get and tx_burst_mode_get. + * Added vector mode support for ARM CPUs. * **Added support for BPF_ABS/BPF_IND load instructions.**
drivers/net/bnxt/Makefile +3 -0
@@ -44,6 +44,9 @@ SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += rte_pmd_bnxt.c ifeq ($(CONFIG_RTE_ARCH_X86), y) SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += bnxt_rxtx_vec_sse.c endif +ifeq ($(CONFIG_RTE_ARCH_ARM64), y) +SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += bnxt_rxtx_vec_neon.c +endif ifeq ($(CONFIG_RTE_LIBRTE_BNXT_PMD), y) CFLAGS += -I$(SRCDIR) -I$(SRCDIR)/tf_ulp -I$(SRCDIR)/tf_core -I$(SRCDIR)/hcapi
drivers/net/bnxt/bnxt_ethdev.c +5 -5
@@ -1076,7 +1076,7 @@ bnxt_receive_function(struct rte_eth_dev *eth_dev) {struct bnxt *bp = eth_dev->data->dev_private; -#ifdef RTE_ARCH_X86 +#if defined(RTE_ARCH_X86 ) || defined(RTE_ARCH_ARM64 )#ifndef RTE_LIBRTE_IEEE1588 /* * Vector mode receive can be enabled only if scatter rx is not
@@ -1116,7 +1116,7 @@ bnxt_receive_function(struct rte_eth_dev *eth_dev)static eth_tx_burst_t bnxt_transmit_function(__rte_unused struct rte_eth_dev *eth_dev) { -#ifdef RTE_ARCH_X86 +#if defined(RTE_ARCH_X86 ) || defined(RTE_ARCH_ARM64 )#ifndef RTE_LIBRTE_IEEE1588 struct bnxt *bp = eth_dev->data->dev_private;
@@ -2679,7 +2679,7 @@ bnxt_rx_burst_mode_get(struct rte_eth_dev *dev, __rte_unused uint16_t queue_id, "Scalar");return 0 ; } -#ifdef RTE_ARCH_X86 +#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" );
@@ -2701,7 +2701,7 @@ bnxt_tx_burst_mode_get(struct rte_eth_dev *dev, __rte_unused uint16_t queue_id, "Scalar");return 0 ; } -#ifdef RTE_ARCH_X86 +#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" );
@@ -2730,7 +2730,7 @@ 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 ; -#ifdef RTE_ARCH_X86 +#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.
drivers/net/bnxt/bnxt_ring.c +2 -2
@@ -608,7 +608,7 @@ int bnxt_alloc_hwrm_rx_ring(struct bnxt *bp, int queue_index)bnxt_db_write (&rxr->ag_db, rxr->ag_prod); } rxq->index = queue_index; -#ifdef RTE_ARCH_X86 +#if defined(RTE_ARCH_X86 ) || defined(RTE_ARCH_ARM64 )bnxt_rxq_vec_setup (rxq);#endif
@@ -713,7 +713,7 @@ int bnxt_alloc_hwrm_rings(struct bnxt *bp)bnxt_db_write (&rxr->rx_db, rxr->rx_prod);bnxt_db_write (&rxr->ag_db, rxr->ag_prod); rxq->index = i; -#ifdef RTE_ARCH_X86 +#if defined(RTE_ARCH_X86 ) || defined(RTE_ARCH_ARM64 )bnxt_rxq_vec_setup (rxq);#endif }
drivers/net/bnxt/bnxt_rxq.h +1 -1
@@ -22,7 +22,7 @@ struct bnxt_rx_queue {uint16_t nb_rx_hold;/* num held free RX desc */ uint16_t rx_free_thresh;/* max free RX desc to hold */ uint16_t queue_id;/* RX queue index */ -#ifdef RTE_ARCH_X86 +#if defined(RTE_ARCH_X86 ) || defined(RTE_ARCH_ARM64 )uint16_t rxrearm_nb;/* number of descs to reinit. */ uint16_t rxrearm_start;/* next desc index to reinit. */ #endif
drivers/net/bnxt/bnxt_rxr.c +1 -1
@@ -782,7 +782,7 @@ uint16_t bnxt_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, !rte_spinlock_trylock(&rxq->lock)))return 0 ; -#if defined(RTE_ARCH_X86 ) +#if defined(RTE_ARCH_X86 ) || defined(RTE_ARCH_ARM64 )/* * Replenish buffers if needed when a transition has been made from * vector- to non-vector- receive processing.
drivers/net/bnxt/bnxt_rxr.h +1 -1
@@ -221,7 +221,7 @@ int bnxt_init_one_rx_ring(struct bnxt_rx_queue *rxq);int bnxt_rx_queue_start (struct rte_eth_dev *dev,uint16_t rx_queue_id);int bnxt_rx_queue_stop (struct rte_eth_dev *dev,uint16_t rx_queue_id); -#ifdef RTE_ARCH_X86 +#if defined(RTE_ARCH_X86 ) || defined(RTE_ARCH_ARM64 )uint16_t bnxt_recv_pkts_vec (void *rx_queue,struct rte_mbuf **rx_pkts,uint16_t nb_pkts);int bnxt_rxq_vec_setup (struct bnxt_rx_queue *rxq);
drivers/net/bnxt/bnxt_rxtx_vec_common.h new file +57 -0
57 lines not on this page · raw message
drivers/net/bnxt/bnxt_rxtx_vec_neon.c new file +469 -0
469 lines not on this page · raw message
drivers/net/bnxt/bnxt_rxtx_vec_sse.c +2 -44
68 lines not on this page · raw message
drivers/net/bnxt/bnxt_txr.h +1 -1
@@ -59,7 +59,7 @@ uint16_t bnxt_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts);uint16_t bnxt_dummy_xmit_pkts (void *tx_queue,struct rte_mbuf **tx_pkts,uint16_t nb_pkts); -#ifdef RTE_ARCH_X86 +#if defined(RTE_ARCH_X86 ) || defined(RTE_ARCH_ARM64 )uint16_t bnxt_xmit_pkts_vec (void *tx_queue,struct rte_mbuf **tx_pkts,uint16_t nb_pkts);#endif
drivers/net/bnxt/meson.build +2 -0
@@ -68,4 +68,6 @@ sources = files('bnxt_cpr.c', if arch_subdir == 'x86' sources += files('bnxt_rxtx_vec_sse.c') +elif arch_subdir == 'arm' and host_machine.cpu_family().startswith('aarch64') + sources += files('bnxt_rxtx_vec_neon.c') endif
Signature · 1 line
2.21.1 (Apple Git-122.3)
Quoted 7 lines · Ajit Khaparde
v2->v3:
- update bnxt doc
- update 20.08 release notes
v3->v4:
- rebase against latest code base
Patchset applied to dpdk-next-net-brcm. Thanks
Quoted 32 lines
Ajit Khaparde (1):
doc: update release notesLance Richardson (3):
net/bnxt: disable vector receive for mark action net/bnxt: support Rx/Tx burst mode info net/bnxt: add ARM64 vector supportdoc/guides/nics/bnxt.rst | 6 +- doc/guides/nics/features/bnxt.ini | 1 + doc/guides/rel_notes/release_20_08.rst | 2 + drivers/net/bnxt/Makefile | 3 + drivers/net/bnxt/bnxt_ethdev.c | 52 ++- drivers/net/bnxt/bnxt_flow.c | 20 +- drivers/net/bnxt/bnxt_ring.c | 4 +- drivers/net/bnxt/bnxt_rxq.h | 2 +- drivers/net/bnxt/bnxt_rxr.c | 18 + drivers/net/bnxt/bnxt_rxr.h | 2 +- drivers/net/bnxt/bnxt_rxtx_vec_common.h | 57 +++ drivers/net/bnxt/bnxt_rxtx_vec_neon.c | 469 ++++++++++++++++++++++++ drivers/net/bnxt/bnxt_rxtx_vec_sse.c | 46 +-- drivers/net/bnxt/bnxt_txr.h | 2 +- drivers/net/bnxt/meson.build | 2 + 15 files changed, 619 insertions(+), 67 deletions(-) create mode 100644 drivers/net/bnxt/bnxt_rxtx_vec_common.h create mode 100644 drivers/net/bnxt/bnxt_rxtx_vec_neon.c--
2.21.1 (Apple Git-122.3)