net/ionic: updates for 22.11 release
Subsystems (2)
cover net/ionic: updates for 22.11 release
This patch series provides features and performance improvements relevant for the upstream release of DPDK 22.11.
There are some bits (like struct ionic_dev_intf) only useful for drivers and device types which have not yet been upstreamed. All of the changes are confined to the ionic PMD.
Links to the product brief PDFs in patch 6 will be added as soon as they are available.
Andrew Boyer (35):
net/ionic: fix up endianness for Rx and Tx handling net/ionic: fix up endianness for RSS
net/ionic: fix to set the adapter name for logging net/ionic: fix up the Rx filter save API net/ionic: fix up reported error stats net/ionic: update documentation and copyrights net/ionic: update license terms to remove GPL net/ionic: update MTU calculations
net/ionic: simplify code by removing doorbell map helper net/ionic: remove unused identifiers
net/ionic: only allocate interrupts if required net/ionic: move PCI-specific code to a separate file net/ionic: only request notifyq interrupt if supported net/ionic: replace void pointer with actual type net/ionic: free all buffers during Rx queue stop net/ionic: precalculate segment lengths on receive side net/ionic: use a helper variable in packet Tx function net/ionic: do one-time init of receive descriptors net/ionic: overhaul receive side for performance net/ionic: overhaul transmit side for performance net/ionic: add support for mbuf fast free net/ionic: do bulk allocations of receive mbufs net/ionic: add a lookup table for packet type net/ionic: add a lookup table for checksum flags net/ionic: advertise supported packet types net/ionic: add Rx descriptor status functions net/ionic: add Tx descriptor status function net/ionic: add Q-in-CMB option controlled by devarg net/ionic: update array allocations to use calloc net/ionic: add alignment and socket info in allocations net/ionic: allow client to specify Tx free threshold net/ionic: add optimized handlers for non-scattered Rx/Tx net/ionic: use a helper variable for page size net/ionic: retry init commands up to five times net/ionic: add watchdogs to protect each queue type
MAINTAINERS | 4 +- doc/guides/nics/features/ionic.ini | 3 + doc/guides/nics/ionic.rst | 28 +- doc/guides/rel_notes/release_22_11.rst | 11 + drivers/net/ionic/ionic.h | 27 +- drivers/net/ionic/ionic_dev.c | 79 +-- drivers/net/ionic/ionic_dev.h | 40 +- drivers/net/ionic/ionic_dev_pci.c | 274 ++++++++ drivers/net/ionic/ionic_ethdev.c | 254 +++---- drivers/net/ionic/ionic_ethdev.h | 15 +- drivers/net/ionic/ionic_if.h | 13 +- drivers/net/ionic/ionic_lif.c | 310 ++++++--- drivers/net/ionic/ionic_lif.h | 33 +- drivers/net/ionic/ionic_logs.h | 4 +- drivers/net/ionic/ionic_mac_api.c | 4 +- drivers/net/ionic/ionic_mac_api.h | 4 +- drivers/net/ionic/ionic_main.c | 32 +- drivers/net/ionic/ionic_osdep.h | 4 +- drivers/net/ionic/ionic_regs.h | 4 +- drivers/net/ionic/ionic_rx_filter.c | 9 +- drivers/net/ionic/ionic_rx_filter.h | 4 +- drivers/net/ionic/ionic_rxtx.c | 916 +++++++++---------------- drivers/net/ionic/ionic_rxtx.h | 56 +- drivers/net/ionic/ionic_rxtx_sg.c | 544 +++++++++++++++ drivers/net/ionic/ionic_rxtx_simple.c | 465 +++++++++++++ drivers/net/ionic/meson.build | 7 +- 26 files changed, 2154 insertions(+), 990 deletions(-) create mode 100644 drivers/net/ionic/ionic_dev_pci.c create mode 100644 drivers/net/ionic/ionic_rxtx_sg.c create mode 100644 drivers/net/ionic/ionic_rxtx_simple.c
Signature · 1 line
2.17.1
PATCH 1/35 net/ionic: fix up endianness for Rx and Tx handling
These fields all need to be LE when talking to the FW.
--- drivers/net/ionic/ionic_rxtx.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-)
drivers/net/ionic/ionic_rxtx.c +15 -12
@@ -300,18 +300,20 @@ ionic_tx_tso_post(struct ionic_queue *q, struct ionic_txq_desc *desc, bool start, bool done) { void **info; +uint64_t cmd;uint8_t flags =0 ; flags |= has_vlan ?IONIC_TXQ_DESC_FLAG_VLAN :0 ; flags |= encap ?IONIC_TXQ_DESC_FLAG_ENCAP :0 ; flags |= start ?IONIC_TXQ_DESC_FLAG_TSO_SOT :0 ; flags |= done ?IONIC_TXQ_DESC_FLAG_TSO_EOT :0 ; - desc->cmd =encode_txq_desc_cmd (IONIC_TXQ_DESC_OPCODE_TSO , + cmd =encode_txq_desc_cmd (IONIC_TXQ_DESC_OPCODE_TSO , flags, nsge, addr); - desc->len = len; - desc->vlan_tci = vlan_tci; - desc->hdr_len = hdrlen; - desc->mss = mss; + desc->cmd =rte_cpu_to_le_64 (cmd); + desc->len =rte_cpu_to_le_16 (len); + desc->vlan_tci =rte_cpu_to_le_16 (vlan_tci); + desc->hdr_len =rte_cpu_to_le_16 (hdrlen); + desc->mss =rte_cpu_to_le_16 (mss);if (done) { info =IONIC_INFO_PTR (q, q->head_idx);
@@ -423,7 +425,7 @@ ionic_tx_tso(struct ionic_tx_qcq *txq, struct rte_mbuf *txm) len =RTE_MIN (frag_left, left); frag_left -= len; elem->addr = next_addr; - elem->len = len; + elem->len =rte_cpu_to_le_16 (len); elem++; desc_nsge++; }else {
@@ -470,7 +472,7 @@ ionic_tx(struct ionic_tx_qcq *txq, struct rte_mbuf *txm)bool encap;bool has_vlan;uint64_t ol_flags = txm->ol_flags; -uint64_t addr; +uint64_t addr, cmd;uint8_t opcode =IONIC_TXQ_DESC_OPCODE_CSUM_NONE ;uint8_t flags =0 ;
@@ -505,9 +507,10 @@ ionic_tx(struct ionic_tx_qcq *txq, struct rte_mbuf *txm) addr =rte_cpu_to_le_64 (rte_mbuf_data_iova (txm)); - desc->cmd =encode_txq_desc_cmd (opcode, flags, txm->nb_segs -1 , addr); - desc->len = txm->data_len; - desc->vlan_tci = txm->vlan_tci; + cmd =encode_txq_desc_cmd (opcode, flags, txm->nb_segs -1 , addr); + desc->cmd =rte_cpu_to_le_64 (cmd); + desc->len =rte_cpu_to_le_16 (txm->data_len); + desc->vlan_tci =rte_cpu_to_le_16 (txm->vlan_tci); info[0 ] = txm;
@@ -515,7 +518,7 @@ ionic_tx(struct ionic_tx_qcq *txq, struct rte_mbuf *txm) txm_seg = txm->next;while (txm_seg !=NULL ) { - elem->len = txm_seg->data_len; + elem->len =rte_cpu_to_le_16 (txm_seg->data_len); elem->addr =rte_cpu_to_le_64 (rte_mbuf_data_iova (txm_seg)); elem++; txm_seg = txm_seg->next;
@@ -845,7 +848,7 @@ ionic_rx_clean(struct ionic_rx_qcq *rxq,/* Vlan Strip */ if (cq_desc->csum_flags &IONIC_RXQ_COMP_CSUM_F_VLAN ) { pkt_flags |=RTE_MBUF_F_RX_VLAN |RTE_MBUF_F_RX_VLAN_STRIPPED ; - rxm->vlan_tci = cq_desc->vlan_tci; + rxm->vlan_tci =rte_le_to_cpu_16 (cq_desc->vlan_tci); }/* Checksum */
Signature · 1 line
2.17.1
PATCH 1/35 net/ionic: fix up endianness for Rx and Tx handling
In reply to Andrew BoyerThese fields all need to be LE when talking to the FW.
--- drivers/net/ionic/ionic_rxtx.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-)
drivers/net/ionic/ionic_rxtx.c +15 -12
@@ -300,18 +300,20 @@ ionic_tx_tso_post(struct ionic_queue *q, struct ionic_txq_desc *desc, bool start, bool done) { void **info; +uint64_t cmd;uint8_t flags =0 ; flags |= has_vlan ?IONIC_TXQ_DESC_FLAG_VLAN :0 ; flags |= encap ?IONIC_TXQ_DESC_FLAG_ENCAP :0 ; flags |= start ?IONIC_TXQ_DESC_FLAG_TSO_SOT :0 ; flags |= done ?IONIC_TXQ_DESC_FLAG_TSO_EOT :0 ; - desc->cmd =encode_txq_desc_cmd (IONIC_TXQ_DESC_OPCODE_TSO , + cmd =encode_txq_desc_cmd (IONIC_TXQ_DESC_OPCODE_TSO , flags, nsge, addr); - desc->len = len; - desc->vlan_tci = vlan_tci; - desc->hdr_len = hdrlen; - desc->mss = mss; + desc->cmd =rte_cpu_to_le_64 (cmd); + desc->len =rte_cpu_to_le_16 (len); + desc->vlan_tci =rte_cpu_to_le_16 (vlan_tci); + desc->hdr_len =rte_cpu_to_le_16 (hdrlen); + desc->mss =rte_cpu_to_le_16 (mss);if (done) { info =IONIC_INFO_PTR (q, q->head_idx);
@@ -423,7 +425,7 @@ ionic_tx_tso(struct ionic_tx_qcq *txq, struct rte_mbuf *txm) len =RTE_MIN (frag_left, left); frag_left -= len; elem->addr = next_addr; - elem->len = len; + elem->len =rte_cpu_to_le_16 (len); elem++; desc_nsge++; }else {
@@ -470,7 +472,7 @@ ionic_tx(struct ionic_tx_qcq *txq, struct rte_mbuf *txm)bool encap;bool has_vlan;uint64_t ol_flags = txm->ol_flags; -uint64_t addr; +uint64_t addr, cmd;uint8_t opcode =IONIC_TXQ_DESC_OPCODE_CSUM_NONE ;uint8_t flags =0 ;
@@ -505,9 +507,10 @@ ionic_tx(struct ionic_tx_qcq *txq, struct rte_mbuf *txm) addr =rte_cpu_to_le_64 (rte_mbuf_data_iova (txm)); - desc->cmd =encode_txq_desc_cmd (opcode, flags, txm->nb_segs -1 , addr); - desc->len = txm->data_len; - desc->vlan_tci = txm->vlan_tci; + cmd =encode_txq_desc_cmd (opcode, flags, txm->nb_segs -1 , addr); + desc->cmd =rte_cpu_to_le_64 (cmd); + desc->len =rte_cpu_to_le_16 (txm->data_len); + desc->vlan_tci =rte_cpu_to_le_16 (txm->vlan_tci); info[0 ] = txm;
@@ -515,7 +518,7 @@ ionic_tx(struct ionic_tx_qcq *txq, struct rte_mbuf *txm) txm_seg = txm->next;while (txm_seg !=NULL ) { - elem->len = txm_seg->data_len; + elem->len =rte_cpu_to_le_16 (txm_seg->data_len); elem->addr =rte_cpu_to_le_64 (rte_mbuf_data_iova (txm_seg)); elem++; txm_seg = txm_seg->next;
@@ -845,7 +848,7 @@ ionic_rx_clean(struct ionic_rx_qcq *rxq,/* Vlan Strip */ if (cq_desc->csum_flags &IONIC_RXQ_COMP_CSUM_F_VLAN ) { pkt_flags |=RTE_MBUF_F_RX_VLAN |RTE_MBUF_F_RX_VLAN_STRIPPED ; - rxm->vlan_tci = cq_desc->vlan_tci; + rxm->vlan_tci =rte_le_to_cpu_16 (cq_desc->vlan_tci); }/* Checksum */
Signature · 1 line
2.17.1
PATCH 2/35 net/ionic: fix up endianness for RSS
In reply to Andrew BoyerThis field needs to be LE when talking to the FW.
--- drivers/net/ionic/ionic_rxtx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ionic/ionic_rxtx.c +1 -1
@@ -843,7 +843,7 @@ ionic_rx_clean(struct ionic_rx_qcq *rxq,/* RSS */ pkt_flags |=RTE_MBUF_F_RX_RSS_HASH ; - rxm->hash.rss = cq_desc->rss_hash; + rxm->hash.rss =rte_le_to_cpu_32 (cq_desc->rss_hash);/* Vlan Strip */ if (cq_desc->csum_flags &IONIC_RXQ_COMP_CSUM_F_VLAN ) {
Signature · 1 line
2.17.1
PATCH 2/35 net/ionic: fix up endianness for RSS
In reply to Andrew BoyerThis field needs to be LE when talking to the FW.
--- drivers/net/ionic/ionic_rxtx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ionic/ionic_rxtx.c +1 -1
@@ -843,7 +843,7 @@ ionic_rx_clean(struct ionic_rx_qcq *rxq,/* RSS */ pkt_flags |=RTE_MBUF_F_RX_RSS_HASH ; - rxm->hash.rss = cq_desc->rss_hash; + rxm->hash.rss =rte_le_to_cpu_32 (cq_desc->rss_hash);/* Vlan Strip */ if (cq_desc->csum_flags &IONIC_RXQ_COMP_CSUM_F_VLAN ) {
Signature · 1 line
2.17.1
PATCH 3/35 net/ionic: fix to set the adapter name for logging
In reply to Andrew BoyerOtherwise the log messages will be garbled.
--- drivers/net/ionic/ionic_dev.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/ionic/ionic_dev.c +4 -1
@@ -55,7 +55,10 @@ ionic_dev_setup(struct ionic_adapter *adapter)ioread8 (&idev->dev_info->fw_version[i]); adapter->fw_version[IONIC_DEVINFO_FWVERS_BUFLEN -1 ] ='\0' ; -IONIC_PRINT (DEBUG ,"Firmware version: %s" , adapter->fw_version); + adapter->name = adapter->pci_dev->device.name; + +IONIC_PRINT (DEBUG ,"%s firmware version: %s" , + adapter->name, adapter->fw_version);/* BAR1: doorbells */ bar++;
Signature · 1 line
2.17.1
PATCH 3/35 net/ionic: fix to set the adapter name for logging
In reply to Andrew BoyerOtherwise the log messages will be garbled.
--- drivers/net/ionic/ionic_dev.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/ionic/ionic_dev.c +4 -1
@@ -55,7 +55,10 @@ ionic_dev_setup(struct ionic_adapter *adapter)ioread8 (&idev->dev_info->fw_version[i]); adapter->fw_version[IONIC_DEVINFO_FWVERS_BUFLEN -1 ] ='\0' ; -IONIC_PRINT (DEBUG ,"Firmware version: %s" , adapter->fw_version); + adapter->name = adapter->pci_dev->device.name; + +IONIC_PRINT (DEBUG ,"%s firmware version: %s" , + adapter->name, adapter->fw_version);/* BAR1: doorbells */ bar++;
Signature · 1 line
2.17.1
PATCH 4/35 net/ionic: fix up the Rx filter save API
In reply to Andrew BoyerCheck the match variable after copying cmd info, or else there can be unexpected results.
--- drivers/net/ionic/ionic_rx_filter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ionic/ionic_rx_filter.c +1 -1
@@ -63,8 +63,8 @@ ionic_rx_filter_save(struct ionic_lif *lif, uint32_t flow_id, f->flow_id = flow_id; f->filter_id =rte_le_to_cpu_32 (ctx->comp.rx_filter_add.filter_id); f->rxq_index = rxq_index; - f->match =rte_le_to_cpu_16 (f->cmd.match);memcpy (&f->cmd, &ctx->cmd,sizeof (f->cmd)); + f->match =rte_le_to_cpu_16 (f->cmd.match);switch (f->match) {case IONIC_RX_FILTER_MATCH_VLAN :
Signature · 1 line
2.17.1
PATCH 4/35 net/ionic: fix up the Rx filter save API
In reply to Andrew BoyerCheck the match variable after copying cmd info, or else there can be unexpected results.
--- drivers/net/ionic/ionic_rx_filter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ionic/ionic_rx_filter.c +1 -1
@@ -63,8 +63,8 @@ ionic_rx_filter_save(struct ionic_lif *lif, uint32_t flow_id, f->flow_id = flow_id; f->filter_id =rte_le_to_cpu_32 (ctx->comp.rx_filter_add.filter_id); f->rxq_index = rxq_index; - f->match =rte_le_to_cpu_16 (f->cmd.match);memcpy (&f->cmd, &ctx->cmd,sizeof (f->cmd)); + f->match =rte_le_to_cpu_16 (f->cmd.match);switch (f->match) {case IONIC_RX_FILTER_MATCH_VLAN :
Signature · 1 line
2.17.1
PATCH 5/35 net/ionic: fix up reported error stats
In reply to Andrew BoyerReport descriptor errors in ierrors instead of imissed. Don't report rx_queue_empty or rx_queue_disabled in imissed, since those packet errors are already included in the rx_*_drop_packets counters.
This makes the reported stats correct.
--- drivers/net/ionic/ionic_lif.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/ionic/ionic_lif.c +2 -4
@@ -132,7 +132,7 @@ ionic_lif_get_abs_stats(const struct ionic_lif *lif, struct rte_eth_stats *statsfor (i =0 ; i < lif->nrxqcqs; i++) {struct ionic_rx_stats *rx_stats = &lif->rxqcqs[i]->stats; - stats->imissed += + stats->ierrors += rx_stats->no_cb_arg + rx_stats->bad_cq_status + rx_stats->no_room +
@@ -144,10 +144,8 @@ ionic_lif_get_abs_stats(const struct ionic_lif *lif, struct rte_eth_stats *stats ls->rx_mcast_drop_packets + ls->rx_bcast_drop_packets; - stats->imissed += - ls->rx_queue_empty + + stats->ierrors += ls->rx_dma_error + - ls->rx_queue_disabled + ls->rx_desc_fetch_error + ls->rx_desc_data_error;
Signature · 1 line
2.17.1
PATCH 5/35 net/ionic: fix up reported error stats
In reply to Andrew BoyerReport descriptor errors in ierrors instead of imissed. Don't report rx_queue_empty or rx_queue_disabled in imissed, since those packet errors are already included in the rx_*_drop_packets counters.
This makes the reported stats correct.
--- drivers/net/ionic/ionic_lif.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/ionic/ionic_lif.c +2 -4
@@ -132,7 +132,7 @@ ionic_lif_get_abs_stats(const struct ionic_lif *lif, struct rte_eth_stats *statsfor (i =0 ; i < lif->nrxqcqs; i++) {struct ionic_rx_stats *rx_stats = &lif->rxqcqs[i]->stats; - stats->imissed += + stats->ierrors += rx_stats->no_cb_arg + rx_stats->bad_cq_status + rx_stats->no_room +
@@ -144,10 +144,8 @@ ionic_lif_get_abs_stats(const struct ionic_lif *lif, struct rte_eth_stats *stats ls->rx_mcast_drop_packets + ls->rx_bcast_drop_packets; - stats->imissed += - ls->rx_queue_empty + + stats->ierrors += ls->rx_dma_error + - ls->rx_queue_disabled + ls->rx_desc_fetch_error + ls->rx_desc_data_error;
Signature · 1 line
2.17.1
PATCH 6/35 net/ionic: update documentation and copyrights
In reply to Andrew BoyerPensando Systems has been acquired by AMD.
Update all copyright strings and email addresses.
--- MAINTAINERS | 4 ++-- doc/guides/nics/ionic.rst | 16 ++++++++-------- doc/guides/rel_notes/release_22_11.rst | 5 +++++ drivers/net/ionic/ionic.h | 6 +++--- drivers/net/ionic/ionic_dev.c | 2 +- drivers/net/ionic/ionic_dev.h | 2 +- drivers/net/ionic/ionic_ethdev.c | 2 +- drivers/net/ionic/ionic_ethdev.h | 2 +- drivers/net/ionic/ionic_if.h | 2 +- drivers/net/ionic/ionic_lif.c | 2 +- drivers/net/ionic/ionic_lif.h | 2 +- drivers/net/ionic/ionic_logs.h | 2 +- drivers/net/ionic/ionic_mac_api.c | 2 +- drivers/net/ionic/ionic_mac_api.h | 2 +- drivers/net/ionic/ionic_main.c | 2 +- drivers/net/ionic/ionic_osdep.h | 2 +- drivers/net/ionic/ionic_regs.h | 2 +- drivers/net/ionic/ionic_rx_filter.c | 2 +- drivers/net/ionic/ionic_rx_filter.h | 2 +- drivers/net/ionic/ionic_rxtx.c | 2 +- drivers/net/ionic/ionic_rxtx.h | 2 +- drivers/net/ionic/meson.build | 2 +- 22 files changed, 36 insertions(+), 31 deletions(-)
MAINTAINERS +2 -2
@@ -895,8 +895,8 @@ F: doc/guides/nics/pfe.rst F: drivers/net/pfe/ F: doc/guides/nics/features/pfe.ini -Pensando ionic -M: Andrew Boyer <[email protected]> +AMD Pensando ionic +M: Andrew Boyer <[email protected]> F: drivers/net/ionic/ F: doc/guides/nics/ionic.rst F: doc/guides/nics/features/ionic.ini
doc/guides/nics/ionic.rst +8 -8
@@ -1,22 +1,22 @@ .. SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) - Copyright(c) 2018-2020 Pensando Systems, Inc. All rights reserved. + Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. IONIC Driver ============ -The ionic driver provides support for Pensando server adapters. +The ionic driver provides support for AMD Pensando server adapters. It currently supports the below models: -- DSC-25 dual-port 25G Distributed Services Card `(pdf) <https://pensando.io/wp-content/uploads/2020/03/Pensando-DSC-25-Product-Brief.pdf>`__ -- DSC-100 dual-port 100G Distributed Services Card `(pdf) <https://pensando.io/wp-content/uploads/2020/03/Pensando-DSC-100-Product-Brief.pdf>`__ +- DSC-25 dual-port 25G Distributed Services Card +- DSC-100 dual-port 100G Distributed Services Card +- DSC-200 dual-port 200G Distributed Services Card `(pdf) <https://www.amd.com/system/files/documents/pensando-dsc-200-product-brief.pdf>`__ -Please visit the Pensando web site at https://pensando.io for more information. -The `Documents <https://pensando.io/documents/>`_ page contains Product Briefs and other product information. +Please visit the AMD Pensando web site at https://www.amd.com/en/accelerators/pensando for more information. Identifying the Adapter ----------------------- -To determine if one or more Pensando DSC Ethernet devices are installed +To determine if one or more AMD Pensando DSC Ethernet devices are installed on the host, check for the PCI devices: .. code-block:: console
@@ -30,7 +30,7 @@ Firmware Support The ionic PMD requires firmware which supports 16 segment transmit SGLs. This support was added prior to version 1.0. For help upgrading older versions, -please contact Pensando support. +please contact AMD Pensando support. Building DPDK -------------
doc/guides/rel_notes/release_22_11.rst +5 -0
@@ -78,6 +78,11 @@ New Features * Added support to set device link down/up. +* **Updated AMD Pensando ionic driver.** + + Updated the ionic PMD with new features and improvements, including: + + * Updated to reflect that Pensando has been acquired by AMD. Removed Items -------------
drivers/net/ionic/ionic.h +3 -3
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) -* Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved. +* Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. */ #ifndef _IONIC_H_
@@ -15,8 +15,8 @@#include "ionic_osdep.h" #define IONIC_DRV_NAME "ionic" -#define IONIC_DRV_DESCRIPTION "Pensando Ethernet NIC Driver" -#define IONIC_DRV_VERSION "0.11.0-49" +#define IONIC_DRV_DESCRIPTION "AMD Pensando Ethernet NIC Driver" +#define IONIC_DRV_VERSION "1.17.0-65"/* Vendor ID */ #define IONIC_PENSANDO_VENDOR_ID 0x1dd8
drivers/net/ionic/ionic_dev.c +1 -1
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) -* Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved. +* Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. */ #include <stdbool.h>
drivers/net/ionic/ionic_dev.h +1 -1
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) -* Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved. +* Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. */ #ifndef _IONIC_DEV_H_
drivers/net/ionic/ionic_ethdev.c +1 -1
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) -* Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved. +* Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. */ #include <rte_pci.h>
drivers/net/ionic/ionic_ethdev.h +1 -1
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) -* Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved. +* Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. */ #ifndef _IONIC_ETHDEV_H_
drivers/net/ionic/ionic_if.h +1 -1
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB OR BSD-3-Clause */ -/* Copyright (c) 2017-2020 Pensando Systems, Inc. All rights reserved. */ +/* Copyright 2017-2022 Advanced Micro Devices, Inc. All Rights Reserved. */ #ifndef _IONIC_IF_H_#define _IONIC_IF_H_
drivers/net/ionic/ionic_lif.c +1 -1
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) -* Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved. +* Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. */ #include <rte_malloc.h>
drivers/net/ionic/ionic_lif.h +1 -1
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) -* Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved. +* Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. */ #ifndef _IONIC_LIF_H_
drivers/net/ionic/ionic_logs.h +1 -1
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) -* Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved. +* Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. */ #ifndef _IONIC_LOGS_H_
drivers/net/ionic/ionic_mac_api.c +1 -1
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) -* Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved. +* Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. */ #include <stdbool.h>
drivers/net/ionic/ionic_mac_api.h +1 -1
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) -* Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved. +* Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. */ #ifndef _IONIC_API_H_
drivers/net/ionic/ionic_main.c +1 -1
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) -* Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved. +* Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. */ #include <stdbool.h>
drivers/net/ionic/ionic_osdep.h +1 -1
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) -* Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved. +* Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. */ #ifndef _IONIC_OSDEP_
drivers/net/ionic/ionic_regs.h +1 -1
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) -* Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved. +* Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. */ #ifndef _IONIC_REGS_H_
drivers/net/ionic/ionic_rx_filter.c +1 -1
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) -* Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved. +* Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. */ #include <errno.h>
drivers/net/ionic/ionic_rx_filter.h +1 -1
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) -* Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved. +* Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. */ #ifndef _IONIC_RX_FILTER_H_
drivers/net/ionic/ionic_rxtx.c +1 -1
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) -* Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved. +* Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. */ #include <sys/queue.h>
drivers/net/ionic/ionic_rxtx.h +1 -1
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) -* Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved. +* Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. */ #ifndef _IONIC_RXTX_H_
drivers/net/ionic/meson.build +1 -1
@@ -1,5 +1,5 @@ # SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) -# Copyright(c) 2019 Pensando +# Copyright 2019-2022 Advanced Micro Devices, Inc. All Rights Reserved. if is_windows build = false
Signature · 1 line
2.17.1
Re: [PATCH 06/35] net/ionic: update documentation and copyrights
Quoted 34 lines · Andrew Boyer
Pensando Systems has been acquired by AMD.
Update all copyright strings and email addresses.Signed-off-by Andrew Boyer <[email protected]>--- MAINTAINERS | 4 ++-- doc/guides/nics/ionic.rst | 16 ++++++++-------- doc/guides/rel_notes/release_22_11.rst | 5 +++++ drivers/net/ionic/ionic.h | 6 +++--- drivers/net/ionic/ionic_dev.c | 2 +- drivers/net/ionic/ionic_dev.h | 2 +- drivers/net/ionic/ionic_ethdev.c | 2 +- drivers/net/ionic/ionic_ethdev.h | 2 +- drivers/net/ionic/ionic_if.h | 2 +- drivers/net/ionic/ionic_lif.c | 2 +- drivers/net/ionic/ionic_lif.h | 2 +- drivers/net/ionic/ionic_logs.h | 2 +- drivers/net/ionic/ionic_mac_api.c | 2 +- drivers/net/ionic/ionic_mac_api.h | 2 +- drivers/net/ionic/ionic_main.c | 2 +- drivers/net/ionic/ionic_osdep.h | 2 +- drivers/net/ionic/ionic_regs.h | 2 +- drivers/net/ionic/ionic_rx_filter.c | 2 +- drivers/net/ionic/ionic_rx_filter.h | 2 +- drivers/net/ionic/ionic_rxtx.c | 2 +- drivers/net/ionic/ionic_rxtx.h | 2 +- drivers/net/ionic/meson.build | 2 +- 22 files changed, 36 insertions(+), 31 deletions(-)MAINTAINERS +0
-0
MAINTAINERS F: doc/guides/nics/pfe.rst · line 902
Quoted 10 lines
MAINTAINERS +2
-2@@ -895,8 +895,8 @@ F: doc/guides/nics/pfe.rst F: drivers/net/pfe/ F: doc/guides/nics/features/pfe.ini -Pensando ionic -M: Andrew Boyer <[email protected]> +AMD Pensando ionic +M: Andrew Boyer <[email protected]> F: drivers/net/ionic/ F: doc/guides/nics/ionic.rst F: doc/guides/nics/features/ionic.ini
Need to move the block up after other AMD driver, since it is sorted alphabetically.
Quoted 11 lines
doc/guides/nics/ionic.rst +1
-1@@ -1,22 +1,22 @@ .. SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) - Copyright(c) 2018-2020 Pensando Systems, Inc. All rights reserved. + Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. IONIC Driver ============
doc/guides/nics/ionic.rst line 12
Quoted 10 lines
doc/guides/nics/ionic.rst +4
-3-The ionic driver provides support for Pensando server adapters. +The ionic driver provides support for AMD Pensando server adapters. It currently supports the below models: -- DSC-25 dual-port 25G Distributed Services Card `(pdf) <https://pensando.io/wp-content/uploads/2020/03/Pensando-DSC-25-Product-Brief.pdf>`__ -- DSC-100 dual-port 100G Distributed Services Card `(pdf) <https://pensando.io/wp-content/uploads/2020/03/Pensando-DSC-100-Product-Brief.pdf>`__ +- DSC-25 dual-port 25G Distributed Services Card +- DSC-100 dual-port 100G Distributed Services Card +- DSC-200 dual-port 200G Distributed Services Card `(pdf) <https://www.amd.com/system/files/documents/pensando-dsc-200-product-brief.pdf>`__
This 'DSC-200' support seems an addition, can you please separate it from this patch.
Quoted 27 lines
doc/guides/nics/ionic.rst +3
-4-Please visit the Pensando web site at https://pensando.io for more information. -The `Documents <https://pensando.io/documents/>`_ page contains Product Briefs and other product information. +Please visit the AMD Pensando web site at https://www.amd.com/en/accelerators/pensando for more information. Identifying the Adapter ----------------------- -To determine if one or more Pensando DSC Ethernet devices are installed +To determine if one or more AMD Pensando DSC Ethernet devices are installed on the host, check for the PCI devices: .. code-block:: console@@ -30,7 +30,7 @@ Firmware Support The ionic PMD requires firmware which supports 16 segment transmit SGLs. This support was added prior to version 1.0. For help upgrading older versions, -please contact Pensando support. +please contact AMD Pensando support. Building DPDK -------------doc/guides/rel_notes/release_22_11.rst +0
-0
doc/guides/rel_notes/release_22_11.rst New Features · line 86
Quoted 9 lines
doc/guides/rel_notes/release_22_11.rst +5
-0@@ -78,6 +78,11 @@ New Features * Added support to set device link down/up. +* **Updated AMD Pensando ionic driver.** + + Updated the ionic PMD with new features and improvements, including: + + * Updated to reflect that Pensando has been acquired by AMD.
Need to move this block, to sort it alphabetically in the network drivers group.
Quoted 14 lines
doc/guides/rel_notes/release_22_11.rst +0
-0Removed Items -------------drivers/net/ionic/ionic.h +1
-1@@ -1,5 +1,5 @@/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) -* Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved. +* Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. */ #ifndef _IONIC_H_
drivers/net/ionic/ionic.h line 19
Quoted 7 lines
drivers/net/ionic/ionic.h +2
-2@@ -15,8 +15,8 @@#include "ionic_osdep.h" #define IONIC_DRV_NAME "ionic" -#define IONIC_DRV_DESCRIPTION "Pensando Ethernet NIC Driver" -#define IONIC_DRV_VERSION "0.11.0-49" +#define IONIC_DRV_DESCRIPTION "AMD Pensando Ethernet NIC Driver" +#define IONIC_DRV_VERSION "1.17.0-65"
If there is a driver version change, can you please make it in different patch that clarifies the change of the version, unless this version change is purely because of company change but I doubt that is the case.
drivers/net/ionic/ionic_dev.c line 2
Quoted 11 lines
drivers/net/ionic/ionic.h +0
-0/* Vendor ID */ #define IONIC_PENSANDO_VENDOR_ID 0x1dd8drivers/net/ionic/ionic_dev.c +1
-1@@ -1,5 +1,5 @@/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) -* Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved. +* Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved.
I am not sure what is the additional benefit of the "All Rights Reserved." note when there is copyright and license in place, but it is common to have that note in separate line after Coypright line. Making it consistent can be helpful in the future if we have scripts to parse the copyright lines etc..
If not blocked by the legal, can you please move the "All Rights Reserved." to the next line below copyright?
And if possible, can you please question if "All Rights Reserved." line is required at all?
PATCH 6/35 net/ionic: update documentation and copyrights
In reply to Andrew BoyerPensando Systems has been acquired by AMD.
Update all copyright strings and email addresses.
--- MAINTAINERS | 4 ++-- doc/guides/nics/ionic.rst | 16 ++++++++-------- doc/guides/rel_notes/release_22_11.rst | 7 ++++++- drivers/net/ionic/ionic.h | 6 +++--- drivers/net/ionic/ionic_dev.c | 2 +- drivers/net/ionic/ionic_dev.h | 2 +- drivers/net/ionic/ionic_ethdev.c | 2 +- drivers/net/ionic/ionic_ethdev.h | 2 +- drivers/net/ionic/ionic_if.h | 2 +- drivers/net/ionic/ionic_lif.c | 2 +- drivers/net/ionic/ionic_lif.h | 2 +- drivers/net/ionic/ionic_logs.h | 2 +- drivers/net/ionic/ionic_mac_api.c | 2 +- drivers/net/ionic/ionic_mac_api.h | 2 +- drivers/net/ionic/ionic_main.c | 2 +- drivers/net/ionic/ionic_osdep.h | 2 +- drivers/net/ionic/ionic_regs.h | 2 +- drivers/net/ionic/ionic_rx_filter.c | 2 +- drivers/net/ionic/ionic_rx_filter.h | 2 +- drivers/net/ionic/ionic_rxtx.c | 2 +- drivers/net/ionic/ionic_rxtx.h | 2 +- drivers/net/ionic/meson.build | 2 +- 22 files changed, 37 insertions(+), 32 deletions(-)
MAINTAINERS +2 -2
@@ -904,8 +904,8 @@ F: doc/guides/nics/pfe.rst F: drivers/net/pfe/ F: doc/guides/nics/features/pfe.ini -Pensando ionic -M: Andrew Boyer <[email protected]> +AMD Pensando ionic +M: Andrew Boyer <[email protected]> F: drivers/net/ionic/ F: doc/guides/nics/ionic.rst F: doc/guides/nics/features/ionic.ini
doc/guides/nics/ionic.rst +8 -8
@@ -1,22 +1,22 @@ .. SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) - Copyright(c) 2018-2020 Pensando Systems, Inc. All rights reserved. + Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. IONIC Driver ============ -The ionic driver provides support for Pensando server adapters. +The ionic driver provides support for AMD Pensando server adapters. It currently supports the below models: -- DSC-25 dual-port 25G Distributed Services Card `(pdf) <https://pensando.io/wp-content/uploads/2020/03/Pensando-DSC-25-Product-Brief.pdf>`__ -- DSC-100 dual-port 100G Distributed Services Card `(pdf) <https://pensando.io/wp-content/uploads/2020/03/Pensando-DSC-100-Product-Brief.pdf>`__ +- DSC-25 dual-port 25G Distributed Services Card `(pdf) <https://pensandoio.secure.force.com/DownloadFile?id=a0L4T000004IKurUAG>`__ +- DSC-100 dual-port 100G Distributed Services Card `(pdf) <https://pensandoio.secure.force.com/DownloadFile?id=a0L4T000004IKuwUAG>`__ +- DSC-200 dual-port 200G Distributed Services Card `(pdf) <https://www.amd.com/system/files/documents/pensando-dsc-200-product-brief.pdf>`__ -Please visit the Pensando web site at https://pensando.io for more information. -The `Documents <https://pensando.io/documents/>`_ page contains Product Briefs and other product information. +Please visit the AMD Pensando web site at https://www.amd.com/en/accelerators/pensando for more information. Identifying the Adapter ----------------------- -To determine if one or more Pensando DSC Ethernet devices are installed +To determine if one or more AMD Pensando DSC Ethernet devices are installed on the host, check for the PCI devices: .. code-block:: console
@@ -30,7 +30,7 @@ Firmware Support The ionic PMD requires firmware which supports 16 segment transmit SGLs. This support was added prior to version 1.0. For help upgrading older versions, -please contact Pensando support. +please contact AMD Pensando support. Building DPDK -------------
doc/guides/rel_notes/release_22_11.rst +6 -1
@@ -159,6 +159,12 @@ New Features * Added support to set device link down/up. +* **Updated AMD Pensando ionic driver.** + + Updated the ionic PMD with new features and improvements, including: + + * Updated to reflect that Pensando has been acquired by AMD. + * **Added support for MACsec in rte_security.** Added MACsec transform for rte_security session and added new API
@@ -200,7 +206,6 @@ New Features into single event containing ``rte_event_vector`` whose event type is ``RTE_EVENT_TYPE_CRYPTODEV_VECTOR``. - Removed Items -------------
drivers/net/ionic/ionic.h +3 -3
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) -* Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved. +* Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. */ #ifndef _IONIC_H_
@@ -15,8 +15,8 @@#include "ionic_osdep.h" #define IONIC_DRV_NAME "ionic" -#define IONIC_DRV_DESCRIPTION "Pensando Ethernet NIC Driver" -#define IONIC_DRV_VERSION "0.11.0-49" +#define IONIC_DRV_DESCRIPTION "AMD Pensando Ethernet NIC Driver" +#define IONIC_DRV_VERSION "1.17.0-65"/* Vendor ID */ #define IONIC_PENSANDO_VENDOR_ID 0x1dd8
drivers/net/ionic/ionic_dev.c +1 -1
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) -* Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved. +* Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. */ #include <stdbool.h>
drivers/net/ionic/ionic_dev.h +1 -1
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) -* Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved. +* Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. */ #ifndef _IONIC_DEV_H_
drivers/net/ionic/ionic_ethdev.c +1 -1
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) -* Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved. +* Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. */ #include <rte_pci.h>
drivers/net/ionic/ionic_ethdev.h +1 -1
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) -* Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved. +* Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. */ #ifndef _IONIC_ETHDEV_H_
drivers/net/ionic/ionic_if.h +1 -1
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB OR BSD-3-Clause */ -/* Copyright (c) 2017-2020 Pensando Systems, Inc. All rights reserved. */ +/* Copyright 2017-2022 Advanced Micro Devices, Inc. All Rights Reserved. */ #ifndef _IONIC_IF_H_#define _IONIC_IF_H_
drivers/net/ionic/ionic_lif.c +1 -1
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) -* Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved. +* Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. */ #include <rte_malloc.h>
drivers/net/ionic/ionic_lif.h +1 -1
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) -* Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved. +* Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. */ #ifndef _IONIC_LIF_H_
drivers/net/ionic/ionic_logs.h +1 -1
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) -* Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved. +* Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. */ #ifndef _IONIC_LOGS_H_
drivers/net/ionic/ionic_mac_api.c +1 -1
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) -* Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved. +* Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. */ #include <stdbool.h>
drivers/net/ionic/ionic_mac_api.h +1 -1
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) -* Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved. +* Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. */ #ifndef _IONIC_API_H_
drivers/net/ionic/ionic_main.c +1 -1
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) -* Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved. +* Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. */ #include <stdbool.h>
drivers/net/ionic/ionic_osdep.h +1 -1
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) -* Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved. +* Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. */ #ifndef _IONIC_OSDEP_
drivers/net/ionic/ionic_regs.h +1 -1
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) -* Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved. +* Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. */ #ifndef _IONIC_REGS_H_
drivers/net/ionic/ionic_rx_filter.c +1 -1
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) -* Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved. +* Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. */ #include <errno.h>
drivers/net/ionic/ionic_rx_filter.h +1 -1
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) -* Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved. +* Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. */ #ifndef _IONIC_RX_FILTER_H_
drivers/net/ionic/ionic_rxtx.c +1 -1
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) -* Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved. +* Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. */ #include <sys/queue.h>
drivers/net/ionic/ionic_rxtx.h +1 -1
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) -* Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved. +* Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. */ #ifndef _IONIC_RXTX_H_
drivers/net/ionic/meson.build +1 -1
@@ -1,5 +1,5 @@ # SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) -# Copyright(c) 2019 Pensando +# Copyright 2019-2022 Advanced Micro Devices, Inc. All Rights Reserved. if is_windows build = false
Signature · 1 line
2.17.1
PATCH 7/35 net/ionic: update license terms to remove GPL
In reply to Andrew BoyerRemove GPL2 and leave only BSD-3-Clause. This is more in line with the norms of the DPDK community.
--- drivers/net/ionic/ionic.h | 2 +- drivers/net/ionic/ionic_dev.c | 2 +- drivers/net/ionic/ionic_dev.h | 2 +- drivers/net/ionic/ionic_ethdev.c | 2 +- drivers/net/ionic/ionic_ethdev.h | 2 +- drivers/net/ionic/ionic_if.h | 5 +++-- drivers/net/ionic/ionic_lif.c | 2 +- drivers/net/ionic/ionic_lif.h | 2 +- drivers/net/ionic/ionic_logs.h | 2 +- drivers/net/ionic/ionic_mac_api.c | 2 +- drivers/net/ionic/ionic_mac_api.h | 2 +- drivers/net/ionic/ionic_main.c | 2 +- drivers/net/ionic/ionic_osdep.h | 2 +- drivers/net/ionic/ionic_regs.h | 2 +- drivers/net/ionic/ionic_rx_filter.c | 2 +- drivers/net/ionic/ionic_rx_filter.h | 2 +- drivers/net/ionic/ionic_rxtx.c | 2 +- drivers/net/ionic/ionic_rxtx.h | 2 +- drivers/net/ionic/meson.build | 2 +- 19 files changed, 21 insertions(+), 20 deletions(-)
drivers/net/ionic/ionic.h +1 -1
@@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) +/* SPDX-License-Identifier: BSD-3-Clause * Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. */
drivers/net/ionic/ionic_dev.c +1 -1
@@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) +/* SPDX-License-Identifier: BSD-3-Clause * Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. */
drivers/net/ionic/ionic_dev.h +1 -1
@@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) +/* SPDX-License-Identifier: BSD-3-Clause * Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. */
drivers/net/ionic/ionic_ethdev.c +1 -1
@@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) +/* SPDX-License-Identifier: BSD-3-Clause * Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. */
drivers/net/ionic/ionic_ethdev.h +1 -1
@@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) +/* SPDX-License-Identifier: BSD-3-Clause * Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. */
drivers/net/ionic/ionic_if.h +3 -2
@@ -1,5 +1,6 @@ -/* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB OR BSD-3-Clause */ -/* Copyright 2017-2022 Advanced Micro Devices, Inc. All Rights Reserved. */ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright 2017-2022 Advanced Micro Devices, Inc. All Rights Reserved. +*/ #ifndef _IONIC_IF_H_#define _IONIC_IF_H_
drivers/net/ionic/ionic_lif.c +1 -1
@@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) +/* SPDX-License-Identifier: BSD-3-Clause * Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. */
drivers/net/ionic/ionic_lif.h +1 -1
@@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) +/* SPDX-License-Identifier: BSD-3-Clause * Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. */
drivers/net/ionic/ionic_logs.h +1 -1
@@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) +/* SPDX-License-Identifier: BSD-3-Clause * Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. */
drivers/net/ionic/ionic_mac_api.c +1 -1
@@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) +/* SPDX-License-Identifier: BSD-3-Clause * Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. */
drivers/net/ionic/ionic_mac_api.h +1 -1
@@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) +/* SPDX-License-Identifier: BSD-3-Clause * Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. */
drivers/net/ionic/ionic_main.c +1 -1
@@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) +/* SPDX-License-Identifier: BSD-3-Clause * Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. */
drivers/net/ionic/ionic_osdep.h +1 -1
@@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) +/* SPDX-License-Identifier: BSD-3-Clause * Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. */
drivers/net/ionic/ionic_regs.h +1 -1
@@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) +/* SPDX-License-Identifier: BSD-3-Clause * Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. */
drivers/net/ionic/ionic_rx_filter.c +1 -1
@@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) +/* SPDX-License-Identifier: BSD-3-Clause * Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. */
drivers/net/ionic/ionic_rx_filter.h +1 -1
@@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) +/* SPDX-License-Identifier: BSD-3-Clause * Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. */
drivers/net/ionic/ionic_rxtx.c +1 -1
@@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) +/* SPDX-License-Identifier: BSD-3-Clause * Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. */
drivers/net/ionic/ionic_rxtx.h +1 -1
@@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) +/* SPDX-License-Identifier: BSD-3-Clause * Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. */
drivers/net/ionic/meson.build +1 -1
@@ -1,4 +1,4 @@ -# SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) +# SPDX-License-Identifier: BSD-3-Clause # Copyright 2019-2022 Advanced Micro Devices, Inc. All Rights Reserved. if is_windows
Signature · 1 line
2.17.1
Re: [PATCH 07/35] net/ionic: update license terms to remove GPL
Quoted 4 lines · Andrew Boyer
Remove GPL2 and leave only BSD-3-Clause. This is more in line with the norms of the DPDK community.
Signed-off-by Andrew Boyer<[email protected]>
ack.
Thanks for the cleanup.
PATCH 7/35 net/ionic: update license terms to remove GPL
In reply to Andrew BoyerRemove GPL2 and leave only BSD-3-Clause. This is more in line with the norms of the DPDK community.
--- drivers/net/ionic/ionic.h | 2 +- drivers/net/ionic/ionic_dev.c | 2 +- drivers/net/ionic/ionic_dev.h | 2 +- drivers/net/ionic/ionic_ethdev.c | 2 +- drivers/net/ionic/ionic_ethdev.h | 2 +- drivers/net/ionic/ionic_if.h | 5 +++-- drivers/net/ionic/ionic_lif.c | 2 +- drivers/net/ionic/ionic_lif.h | 2 +- drivers/net/ionic/ionic_logs.h | 2 +- drivers/net/ionic/ionic_mac_api.c | 2 +- drivers/net/ionic/ionic_mac_api.h | 2 +- drivers/net/ionic/ionic_main.c | 2 +- drivers/net/ionic/ionic_osdep.h | 2 +- drivers/net/ionic/ionic_regs.h | 2 +- drivers/net/ionic/ionic_rx_filter.c | 2 +- drivers/net/ionic/ionic_rx_filter.h | 2 +- drivers/net/ionic/ionic_rxtx.c | 2 +- drivers/net/ionic/ionic_rxtx.h | 2 +- drivers/net/ionic/meson.build | 2 +- 19 files changed, 21 insertions(+), 20 deletions(-)
drivers/net/ionic/ionic.h +1 -1
@@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) +/* SPDX-License-Identifier: BSD-3-Clause * Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. */
drivers/net/ionic/ionic_dev.c +1 -1
@@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) +/* SPDX-License-Identifier: BSD-3-Clause * Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. */
drivers/net/ionic/ionic_dev.h +1 -1
@@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) +/* SPDX-License-Identifier: BSD-3-Clause * Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. */
drivers/net/ionic/ionic_ethdev.c +1 -1
@@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) +/* SPDX-License-Identifier: BSD-3-Clause * Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. */
drivers/net/ionic/ionic_ethdev.h +1 -1
@@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) +/* SPDX-License-Identifier: BSD-3-Clause * Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. */
drivers/net/ionic/ionic_if.h +3 -2
@@ -1,5 +1,6 @@ -/* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB OR BSD-3-Clause */ -/* Copyright 2017-2022 Advanced Micro Devices, Inc. All Rights Reserved. */ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright 2017-2022 Advanced Micro Devices, Inc. All Rights Reserved. +*/ #ifndef _IONIC_IF_H_#define _IONIC_IF_H_
drivers/net/ionic/ionic_lif.c +1 -1
@@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) +/* SPDX-License-Identifier: BSD-3-Clause * Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. */
drivers/net/ionic/ionic_lif.h +1 -1
@@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) +/* SPDX-License-Identifier: BSD-3-Clause * Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. */
drivers/net/ionic/ionic_logs.h +1 -1
@@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) +/* SPDX-License-Identifier: BSD-3-Clause * Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. */
drivers/net/ionic/ionic_mac_api.c +1 -1
@@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) +/* SPDX-License-Identifier: BSD-3-Clause * Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. */
drivers/net/ionic/ionic_mac_api.h +1 -1
@@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) +/* SPDX-License-Identifier: BSD-3-Clause * Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. */
drivers/net/ionic/ionic_main.c +1 -1
@@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) +/* SPDX-License-Identifier: BSD-3-Clause * Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. */
drivers/net/ionic/ionic_osdep.h +1 -1
@@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) +/* SPDX-License-Identifier: BSD-3-Clause * Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. */
drivers/net/ionic/ionic_regs.h +1 -1
@@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) +/* SPDX-License-Identifier: BSD-3-Clause * Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. */
drivers/net/ionic/ionic_rx_filter.c +1 -1
@@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) +/* SPDX-License-Identifier: BSD-3-Clause * Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. */
drivers/net/ionic/ionic_rx_filter.h +1 -1
@@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) +/* SPDX-License-Identifier: BSD-3-Clause * Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. */
drivers/net/ionic/ionic_rxtx.c +1 -1
@@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) +/* SPDX-License-Identifier: BSD-3-Clause * Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. */
drivers/net/ionic/ionic_rxtx.h +1 -1
@@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) +/* SPDX-License-Identifier: BSD-3-Clause * Copyright 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. */
drivers/net/ionic/meson.build +1 -1
@@ -1,4 +1,4 @@ -# SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) +# SPDX-License-Identifier: BSD-3-Clause # Copyright 2019-2022 Advanced Micro Devices, Inc. All Rights Reserved. if is_windows
Signature · 1 line
2.17.1
PATCH 8/35 net/ionic: update MTU calculations
In reply to Andrew BoyerTest min and max MTU against values read from firmware, for correctness. Update the firmware field name, for clarity.
The device must be stopped before changing MTU, for correctness. Store the calculated frame size in the queue, for performance.
--- drivers/net/ionic/ionic_dev.h | 5 +++- drivers/net/ionic/ionic_ethdev.c | 40 +++++++++++++++++++++----------- drivers/net/ionic/ionic_if.h | 8 +++---- drivers/net/ionic/ionic_lif.c | 10 +++----- drivers/net/ionic/ionic_lif.h | 4 +++- drivers/net/ionic/ionic_rxtx.c | 26 +++++++++------------ 6 files changed, 51 insertions(+), 42 deletions(-)
drivers/net/ionic/ionic_dev.h +4 -1
@@ -11,8 +11,11 @@#include "ionic_if.h" #include "ionic_regs.h" +#define VLAN_TAG_SIZE 4 +#define IONIC_MIN_MTU RTE_ETHER_MIN_MTU -#define IONIC_MAX_MTU 9194 +#define IONIC_MAX_MTU 9378 +#define IONIC_ETH_OVERHEAD (RTE_ETHER_HDR_LEN + VLAN_TAG_SIZE)#define IONIC_MAX_RING_DESC 32768#define IONIC_MIN_RING_DESC 16
drivers/net/ionic/ionic_ethdev.c +26 -14
@@ -343,18 +343,17 @@ static int ionic_dev_mtu_set(struct rte_eth_dev *eth_dev, uint16_t mtu) {struct ionic_lif *lif =IONIC_ETH_DEV_TO_LIF (eth_dev); -int err; -IONIC_PRINT_CALL (); +if (lif->state &IONIC_LIF_F_UP ) { +IONIC_PRINT (ERR ,"Stop %s before setting mtu" , lif->name); +return -EBUSY ; + } -/* -* Note: mtu check against IONIC_MIN_MTU, IONIC_MAX_MTU -* is done by the API. -*/ +/* Note: mtu check against min/max is done by the API */ +IONIC_PRINT (INFO ,"Setting mtu %u" , mtu); - err =ionic_lif_change_mtu (lif, mtu); -if (err) -return err; +/* Update the frame size used by the Rx path */ + lif->frame_size = mtu +IONIC_ETH_OVERHEAD ;return 0 ; }
@@ -376,12 +375,16 @@ ionic_dev_info_get(struct rte_eth_dev *eth_dev,rte_le_to_cpu_32 (cfg->queue_count[IONIC_QTYPE_TXQ ]);/* Also add ETHER_CRC_LEN if the adapter is able to keep CRC */ - dev_info->min_rx_bufsize =IONIC_MIN_MTU +RTE_ETHER_HDR_LEN ; - dev_info->max_rx_pktlen =IONIC_MAX_MTU +RTE_ETHER_HDR_LEN ; - dev_info->max_mac_addrs = adapter->max_mac_addrs; - dev_info->min_mtu =IONIC_MIN_MTU ; - dev_info->max_mtu =IONIC_MAX_MTU ; + dev_info->min_mtu =RTE_MAX ((uint32_t )IONIC_MIN_MTU , +rte_le_to_cpu_32 (ident->lif.eth.min_mtu)); + dev_info->max_mtu =RTE_MIN ((uint32_t )IONIC_MAX_MTU , +rte_le_to_cpu_32 (ident->lif.eth.max_mtu)); + dev_info->min_rx_bufsize = dev_info->min_mtu +IONIC_ETH_OVERHEAD ; + dev_info->max_rx_pktlen = dev_info->max_mtu +IONIC_ETH_OVERHEAD ; + dev_info->max_lro_pkt_size = + eth_dev->data->dev_conf.rxmode.max_lro_pkt_size; + dev_info->max_mac_addrs = adapter->max_mac_addrs; dev_info->hash_key_size =IONIC_RSS_HASH_KEY_SIZE ; dev_info->reta_size =rte_le_to_cpu_16 (ident->lif.eth.rss_ind_tbl_sz); dev_info->flow_type_rss_offloads =IONIC_ETH_RSS_OFFLOAD_ALL ;
@@ -889,6 +892,15 @@ ionic_dev_start(struct rte_eth_dev *eth_dev)if (dev_conf->lpbk_mode)IONIC_PRINT (WARNING ,"Loopback mode not supported" ); + lif->frame_size = eth_dev->data->mtu +IONIC_ETH_OVERHEAD ; + + err =ionic_lif_change_mtu (lif, eth_dev->data->mtu); +if (err) { +IONIC_PRINT (ERR ,"Cannot set LIF frame size %u: %d" , + lif->frame_size, err); +return err; + } + err =ionic_lif_start (lif);if (err) {IONIC_PRINT (ERR ,"Cannot start LIF: %d" , err);
drivers/net/ionic/ionic_if.h +4 -4
@@ -401,8 +401,8 @@ union ionic_lif_config {* @version: Ethernet identify structure version * @max_ucast_filters: Number of perfect unicast addresses supported * @max_mcast_filters: Number of perfect multicast addresses supported -* @min_frame_size: Minimum size of frames to be sent -* @max_frame_size: Maximum size of frames to be sent +* @min_mtu: Minimum MTU of frames to be sent +* @max_mtu: Maximum MTU of frames to be sent * @config: LIF config struct with features, mtu, mac, q counts * * @rdma: RDMA identify structure
@@ -434,8 +434,8 @@ union ionic_lif_identity {__le32 max_ucast_filters;__le32 max_mcast_filters;__le16 rss_ind_tbl_sz; -__le32 min_frame_size; -__le32 max_frame_size; +__le32 min_mtu; +__le32 max_mtu;u8 rsvd2[106 ];union ionic_lif_config config; }__rte_packed eth;
drivers/net/ionic/ionic_lif.c +3 -7
@@ -536,7 +536,7 @@ ionic_dev_allmulticast_disable(struct rte_eth_dev *eth_dev) }int -ionic_lif_change_mtu (struct ionic_lif *lif,int new_mtu) +ionic_lif_change_mtu (struct ionic_lif *lif,uint32_t new_mtu) {struct ionic_admin_ctx ctx = { .pending_work = true,
@@ -546,13 +546,8 @@ ionic_lif_change_mtu(struct ionic_lif *lif, int new_mtu) .mtu = rte_cpu_to_le_32(new_mtu), }, }; -int err; - - err =ionic_adminq_post_wait (lif, &ctx); -if (err) -return err; -return 0 ; +return ionic_adminq_post_wait (lif, &ctx); }int
@@ -730,6 +725,7 @@ ionic_rx_qcq_alloc(struct ionic_lif *lif, uint32_t socket_id, uint32_t index,int err; flags =IONIC_QCQ_F_SG ; + err = ionic_qcq_alloc(lif, IONIC_QTYPE_RXQ, sizeof(struct ionic_rx_qcq),
drivers/net/ionic/ionic_lif.h +3 -1
@@ -81,6 +81,7 @@ struct ionic_rx_qcq {/* cacheline2 */ struct rte_mempool *mb_pool; +uint16_t frame_size;/* Based on configured MTU */ uint16_t flags;/* cacheline3 (inside stats) */
@@ -123,6 +124,7 @@ struct ionic_lif {struct ionic_adapter *adapter;struct rte_eth_dev *eth_dev;uint16_t port_id;/**< Device port identifier */ +uint16_t frame_size;uint32_t hw_index;uint32_t state;uint32_t ntxqcqs;
@@ -181,7 +183,7 @@ int ionic_intr_alloc(struct ionic_lif *lif, struct ionic_intr_info *intr);int ionic_qcq_service (struct ionic_qcq *qcq,int budget,ionic_cq_cb cb,void *cb_arg); -int ionic_lif_change_mtu (struct ionic_lif *lif,int new_mtu); +int ionic_lif_change_mtu (struct ionic_lif *lif,uint32_t new_mtu); int ionic_dev_add_mac(struct rte_eth_dev *eth_dev, struct rte_ether_addr *mac_addr,
drivers/net/ionic/ionic_rxtx.c +11 -15
@@ -772,8 +772,6 @@ ionic_rx_clean(struct ionic_rx_qcq *rxq,struct ionic_rxq_comp *cq_desc_base = cq->base;struct ionic_rxq_comp *cq_desc = &cq_desc_base[cq_desc_index];struct rte_mbuf *rxm, *rxm_seg; -uint32_t max_frame_size = - rxq->qcq.lif->eth_dev->data->mtu +RTE_ETHER_HDR_LEN ;uint64_t pkt_flags =0 ;uint32_t pkt_type;struct ionic_rx_stats *stats = &rxq->stats;
@@ -814,8 +812,7 @@ ionic_rx_clean(struct ionic_rx_qcq *rxq,return ; } -if (cq_desc->len > max_frame_size || - cq_desc->len ==0 ) { +if (cq_desc->len > rxq->frame_size || cq_desc->len ==0 ) { stats->bad_len++;ionic_rx_recycle (q, q_desc_index, rxm);return ;
@@ -936,7 +933,7 @@ ionic_rx_recycle(struct ionic_queue *q, uint32_t q_desc_index, } static __rte_always_inline int -ionic_rx_fill (struct ionic_rx_qcq *rxq,uint32_t len) +ionic_rx_fill (struct ionic_rx_qcq *rxq) {struct ionic_queue *q = &rxq->qcq.q;struct ionic_rxq_desc *desc, *desc_base = q->base;
@@ -961,7 +958,7 @@ ionic_rx_fill(struct ionic_rx_qcq *rxq, uint32_t len) info =IONIC_INFO_PTR (q, q->head_idx); - nsegs = (len + buf_size -1 ) / buf_size; + nsegs = (rxq->frame_size + buf_size -1 ) / buf_size; desc = &desc_base[q->head_idx]; dma_addr =rte_cpu_to_le_64 (rte_mbuf_data_iova_default (rxm));
@@ -996,9 +993,9 @@ ionic_rx_fill(struct ionic_rx_qcq *rxq, uint32_t len) prev_rxm_seg = rxm_seg; } -if (size < len) +if (size < rxq->frame_size)IONIC_PRINT (ERR ,"Rx SG size is not sufficient (%d < %d)" , - size, len); + size, rxq->frame_size); info[0 ] = rxm;
@@ -1016,7 +1013,6 @@ ionic_rx_fill(struct ionic_rx_qcq *rxq, uint32_t len) int __rte_coldionic_dev_rx_queue_start (struct rte_eth_dev *eth_dev,uint16_t rx_queue_id) { -uint32_t frame_size = eth_dev->data->mtu +RTE_ETHER_HDR_LEN ;uint8_t *rx_queue_state = eth_dev->data->rx_queue_state;struct ionic_rx_qcq *rxq;int err;
@@ -1029,8 +1025,10 @@ ionic_dev_rx_queue_start(struct rte_eth_dev *eth_dev, uint16_t rx_queue_id) rxq = eth_dev->data->rx_queues[rx_queue_id]; -IONIC_PRINT (DEBUG ,"Starting RX queue %u, %u descs (size: %u)" , - rx_queue_id, rxq->qcq.q.num_descs, frame_size); + rxq->frame_size = rxq->qcq.lif->frame_size -RTE_ETHER_CRC_LEN ; + +IONIC_PRINT (DEBUG ,"Starting RX queue %u, %u descs, size %u" , + rx_queue_id, rxq->qcq.q.num_descs, rxq->frame_size);if (!(rxq->flags &IONIC_QCQ_F_INITED )) { err =ionic_lif_rxq_init (rxq);
@@ -1041,7 +1039,7 @@ ionic_dev_rx_queue_start(struct rte_eth_dev *eth_dev, uint16_t rx_queue_id) }/* Allocate buffers for descriptor rings */ -if (ionic_rx_fill (rxq, frame_size) !=0 ) { +if (ionic_rx_fill (rxq) !=0 ) {IONIC_PRINT (ERR ,"Could not alloc mbuf for queue:%d" , rx_queue_id);return -1 ;
@@ -1129,8 +1127,6 @@ ionic_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) {struct ionic_rx_qcq *rxq = rx_queue; -uint32_t frame_size = - rxq->qcq.lif->eth_dev->data->mtu +RTE_ETHER_HDR_LEN ;struct ionic_rx_service service_cb_arg; service_cb_arg.rx_pkts = rx_pkts;
@@ -1139,7 +1135,7 @@ ionic_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,ionic_rxq_service (rxq, nb_pkts, &service_cb_arg); -ionic_rx_fill (rxq, frame_size); +ionic_rx_fill (rxq);return service_cb_arg.nb_rx; }
Signature · 1 line
2.17.1
PATCH 8/35 net/ionic: update MTU calculations
In reply to Andrew BoyerTest min and max MTU against values read from firmware, for correctness. Update the firmware field name, for clarity.
The device must be stopped before changing MTU, for correctness. Store the calculated frame size in the queue, for performance.
--- drivers/net/ionic/ionic_dev.h | 5 +++- drivers/net/ionic/ionic_ethdev.c | 40 +++++++++++++++++++++----------- drivers/net/ionic/ionic_if.h | 8 +++---- drivers/net/ionic/ionic_lif.c | 10 +++----- drivers/net/ionic/ionic_lif.h | 4 +++- drivers/net/ionic/ionic_rxtx.c | 26 +++++++++------------ 6 files changed, 51 insertions(+), 42 deletions(-)
drivers/net/ionic/ionic_dev.h +4 -1
@@ -11,8 +11,11 @@#include "ionic_if.h" #include "ionic_regs.h" +#define VLAN_TAG_SIZE 4 +#define IONIC_MIN_MTU RTE_ETHER_MIN_MTU -#define IONIC_MAX_MTU 9194 +#define IONIC_MAX_MTU 9378 +#define IONIC_ETH_OVERHEAD (RTE_ETHER_HDR_LEN + VLAN_TAG_SIZE)#define IONIC_MAX_RING_DESC 32768#define IONIC_MIN_RING_DESC 16
drivers/net/ionic/ionic_ethdev.c +26 -14
@@ -343,18 +343,17 @@ static int ionic_dev_mtu_set(struct rte_eth_dev *eth_dev, uint16_t mtu) {struct ionic_lif *lif =IONIC_ETH_DEV_TO_LIF (eth_dev); -int err; -IONIC_PRINT_CALL (); +if (lif->state &IONIC_LIF_F_UP ) { +IONIC_PRINT (ERR ,"Stop %s before setting mtu" , lif->name); +return -EBUSY ; + } -/* -* Note: mtu check against IONIC_MIN_MTU, IONIC_MAX_MTU -* is done by the API. -*/ +/* Note: mtu check against min/max is done by the API */ +IONIC_PRINT (INFO ,"Setting mtu %u" , mtu); - err =ionic_lif_change_mtu (lif, mtu); -if (err) -return err; +/* Update the frame size used by the Rx path */ + lif->frame_size = mtu +IONIC_ETH_OVERHEAD ;return 0 ; }
@@ -376,12 +375,16 @@ ionic_dev_info_get(struct rte_eth_dev *eth_dev,rte_le_to_cpu_32 (cfg->queue_count[IONIC_QTYPE_TXQ ]);/* Also add ETHER_CRC_LEN if the adapter is able to keep CRC */ - dev_info->min_rx_bufsize =IONIC_MIN_MTU +RTE_ETHER_HDR_LEN ; - dev_info->max_rx_pktlen =IONIC_MAX_MTU +RTE_ETHER_HDR_LEN ; - dev_info->max_mac_addrs = adapter->max_mac_addrs; - dev_info->min_mtu =IONIC_MIN_MTU ; - dev_info->max_mtu =IONIC_MAX_MTU ; + dev_info->min_mtu =RTE_MAX ((uint32_t )IONIC_MIN_MTU , +rte_le_to_cpu_32 (ident->lif.eth.min_mtu)); + dev_info->max_mtu =RTE_MIN ((uint32_t )IONIC_MAX_MTU , +rte_le_to_cpu_32 (ident->lif.eth.max_mtu)); + dev_info->min_rx_bufsize = dev_info->min_mtu +IONIC_ETH_OVERHEAD ; + dev_info->max_rx_pktlen = dev_info->max_mtu +IONIC_ETH_OVERHEAD ; + dev_info->max_lro_pkt_size = + eth_dev->data->dev_conf.rxmode.max_lro_pkt_size; + dev_info->max_mac_addrs = adapter->max_mac_addrs; dev_info->hash_key_size =IONIC_RSS_HASH_KEY_SIZE ; dev_info->reta_size =rte_le_to_cpu_16 (ident->lif.eth.rss_ind_tbl_sz); dev_info->flow_type_rss_offloads =IONIC_ETH_RSS_OFFLOAD_ALL ;
@@ -889,6 +892,15 @@ ionic_dev_start(struct rte_eth_dev *eth_dev)if (dev_conf->lpbk_mode)IONIC_PRINT (WARNING ,"Loopback mode not supported" ); + lif->frame_size = eth_dev->data->mtu +IONIC_ETH_OVERHEAD ; + + err =ionic_lif_change_mtu (lif, eth_dev->data->mtu); +if (err) { +IONIC_PRINT (ERR ,"Cannot set LIF frame size %u: %d" , + lif->frame_size, err); +return err; + } + err =ionic_lif_start (lif);if (err) {IONIC_PRINT (ERR ,"Cannot start LIF: %d" , err);
drivers/net/ionic/ionic_if.h +4 -4
@@ -401,8 +401,8 @@ union ionic_lif_config {* @version: Ethernet identify structure version * @max_ucast_filters: Number of perfect unicast addresses supported * @max_mcast_filters: Number of perfect multicast addresses supported -* @min_frame_size: Minimum size of frames to be sent -* @max_frame_size: Maximum size of frames to be sent +* @min_mtu: Minimum MTU of frames to be sent +* @max_mtu: Maximum MTU of frames to be sent * @config: LIF config struct with features, mtu, mac, q counts * * @rdma: RDMA identify structure
@@ -434,8 +434,8 @@ union ionic_lif_identity {__le32 max_ucast_filters;__le32 max_mcast_filters;__le16 rss_ind_tbl_sz; -__le32 min_frame_size; -__le32 max_frame_size; +__le32 min_mtu; +__le32 max_mtu;u8 rsvd2[106 ];union ionic_lif_config config; }__rte_packed eth;
drivers/net/ionic/ionic_lif.c +3 -7
@@ -536,7 +536,7 @@ ionic_dev_allmulticast_disable(struct rte_eth_dev *eth_dev) }int -ionic_lif_change_mtu (struct ionic_lif *lif,int new_mtu) +ionic_lif_change_mtu (struct ionic_lif *lif,uint32_t new_mtu) {struct ionic_admin_ctx ctx = { .pending_work = true,
@@ -546,13 +546,8 @@ ionic_lif_change_mtu(struct ionic_lif *lif, int new_mtu) .mtu = rte_cpu_to_le_32(new_mtu), }, }; -int err; - - err =ionic_adminq_post_wait (lif, &ctx); -if (err) -return err; -return 0 ; +return ionic_adminq_post_wait (lif, &ctx); }int
@@ -730,6 +725,7 @@ ionic_rx_qcq_alloc(struct ionic_lif *lif, uint32_t socket_id, uint32_t index,int err; flags =IONIC_QCQ_F_SG ; + err = ionic_qcq_alloc(lif, IONIC_QTYPE_RXQ, sizeof(struct ionic_rx_qcq),
drivers/net/ionic/ionic_lif.h +3 -1
@@ -81,6 +81,7 @@ struct ionic_rx_qcq {/* cacheline2 */ struct rte_mempool *mb_pool; +uint16_t frame_size;/* Based on configured MTU */ uint16_t flags;/* cacheline3 (inside stats) */
@@ -123,6 +124,7 @@ struct ionic_lif {struct ionic_adapter *adapter;struct rte_eth_dev *eth_dev;uint16_t port_id;/**< Device port identifier */ +uint16_t frame_size;uint32_t hw_index;uint32_t state;uint32_t ntxqcqs;
@@ -181,7 +183,7 @@ int ionic_intr_alloc(struct ionic_lif *lif, struct ionic_intr_info *intr);int ionic_qcq_service (struct ionic_qcq *qcq,int budget,ionic_cq_cb cb,void *cb_arg); -int ionic_lif_change_mtu (struct ionic_lif *lif,int new_mtu); +int ionic_lif_change_mtu (struct ionic_lif *lif,uint32_t new_mtu); int ionic_dev_add_mac(struct rte_eth_dev *eth_dev, struct rte_ether_addr *mac_addr,
drivers/net/ionic/ionic_rxtx.c +11 -15
@@ -772,8 +772,6 @@ ionic_rx_clean(struct ionic_rx_qcq *rxq,struct ionic_rxq_comp *cq_desc_base = cq->base;struct ionic_rxq_comp *cq_desc = &cq_desc_base[cq_desc_index];struct rte_mbuf *rxm, *rxm_seg; -uint32_t max_frame_size = - rxq->qcq.lif->eth_dev->data->mtu +RTE_ETHER_HDR_LEN ;uint64_t pkt_flags =0 ;uint32_t pkt_type;struct ionic_rx_stats *stats = &rxq->stats;
@@ -814,8 +812,7 @@ ionic_rx_clean(struct ionic_rx_qcq *rxq,return ; } -if (cq_desc->len > max_frame_size || - cq_desc->len ==0 ) { +if (cq_desc->len > rxq->frame_size || cq_desc->len ==0 ) { stats->bad_len++;ionic_rx_recycle (q, q_desc_index, rxm);return ;
@@ -936,7 +933,7 @@ ionic_rx_recycle(struct ionic_queue *q, uint32_t q_desc_index, } static __rte_always_inline int -ionic_rx_fill (struct ionic_rx_qcq *rxq,uint32_t len) +ionic_rx_fill (struct ionic_rx_qcq *rxq) {struct ionic_queue *q = &rxq->qcq.q;struct ionic_rxq_desc *desc, *desc_base = q->base;
@@ -961,7 +958,7 @@ ionic_rx_fill(struct ionic_rx_qcq *rxq, uint32_t len) info =IONIC_INFO_PTR (q, q->head_idx); - nsegs = (len + buf_size -1 ) / buf_size; + nsegs = (rxq->frame_size + buf_size -1 ) / buf_size; desc = &desc_base[q->head_idx]; dma_addr =rte_cpu_to_le_64 (rte_mbuf_data_iova_default (rxm));
@@ -996,9 +993,9 @@ ionic_rx_fill(struct ionic_rx_qcq *rxq, uint32_t len) prev_rxm_seg = rxm_seg; } -if (size < len) +if (size < rxq->frame_size)IONIC_PRINT (ERR ,"Rx SG size is not sufficient (%d < %d)" , - size, len); + size, rxq->frame_size); info[0 ] = rxm;
@@ -1016,7 +1013,6 @@ ionic_rx_fill(struct ionic_rx_qcq *rxq, uint32_t len) int __rte_coldionic_dev_rx_queue_start (struct rte_eth_dev *eth_dev,uint16_t rx_queue_id) { -uint32_t frame_size = eth_dev->data->mtu +RTE_ETHER_HDR_LEN ;uint8_t *rx_queue_state = eth_dev->data->rx_queue_state;struct ionic_rx_qcq *rxq;int err;
@@ -1029,8 +1025,10 @@ ionic_dev_rx_queue_start(struct rte_eth_dev *eth_dev, uint16_t rx_queue_id) rxq = eth_dev->data->rx_queues[rx_queue_id]; -IONIC_PRINT (DEBUG ,"Starting RX queue %u, %u descs (size: %u)" , - rx_queue_id, rxq->qcq.q.num_descs, frame_size); + rxq->frame_size = rxq->qcq.lif->frame_size -RTE_ETHER_CRC_LEN ; + +IONIC_PRINT (DEBUG ,"Starting RX queue %u, %u descs, size %u" , + rx_queue_id, rxq->qcq.q.num_descs, rxq->frame_size);if (!(rxq->flags &IONIC_QCQ_F_INITED )) { err =ionic_lif_rxq_init (rxq);
@@ -1041,7 +1039,7 @@ ionic_dev_rx_queue_start(struct rte_eth_dev *eth_dev, uint16_t rx_queue_id) }/* Allocate buffers for descriptor rings */ -if (ionic_rx_fill (rxq, frame_size) !=0 ) { +if (ionic_rx_fill (rxq) !=0 ) {IONIC_PRINT (ERR ,"Could not alloc mbuf for queue:%d" , rx_queue_id);return -1 ;
@@ -1129,8 +1127,6 @@ ionic_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) {struct ionic_rx_qcq *rxq = rx_queue; -uint32_t frame_size = - rxq->qcq.lif->eth_dev->data->mtu +RTE_ETHER_HDR_LEN ;struct ionic_rx_service service_cb_arg; service_cb_arg.rx_pkts = rx_pkts;
@@ -1139,7 +1135,7 @@ ionic_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,ionic_rxq_service (rxq, nb_pkts, &service_cb_arg); -ionic_rx_fill (rxq, frame_size); +ionic_rx_fill (rxq);return service_cb_arg.nb_rx; }
Signature · 1 line
2.17.1
PATCH 9/35 net/ionic: simplify code by removing doorbell map helper
In reply to Andrew BoyerThere is only one doorbell page in DPDK configurations, so no helper function is needed.
--- drivers/net/ionic/ionic_lif.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-)
drivers/net/ionic/ionic_lif.c +1 -12
@@ -846,17 +846,6 @@ ionic_notify_qcq_alloc(struct ionic_lif *lif)return 0 ; } -static void * -ionic_bus_map_dbpage (struct ionic_adapter *adapter,int page_num) -{ -char *vaddr = adapter->bars[IONIC_PCI_BAR_DBELL ].vaddr; - -if (adapter->num_bars <=IONIC_PCI_BAR_DBELL ) -return NULL ; - -return (void *)&vaddr[page_num <<PAGE_SHIFT ]; -} -static void ionic_lif_queue_identify (struct ionic_lif *lif) {
@@ -959,7 +948,7 @@ ionic_lif_alloc(struct ionic_lif *lif)rte_spinlock_init (&lif->adminq_lock);rte_spinlock_init (&lif->adminq_service_lock); - lif->kern_dbpage =ionic_bus_map_dbpage (adapter,0 ); + lif->kern_dbpage = adapter->idev.db_pages;if (!lif->kern_dbpage) {IONIC_PRINT (ERR ,"Cannot map dbpage, aborting" );return -ENOMEM ;
Signature · 1 line
2.17.1
PATCH 9/35 net/ionic: simplify code by removing doorbell map helper
In reply to Andrew BoyerThere is only one doorbell page in DPDK configurations, so no helper function is needed.
--- drivers/net/ionic/ionic_lif.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-)
drivers/net/ionic/ionic_lif.c +1 -12
@@ -846,17 +846,6 @@ ionic_notify_qcq_alloc(struct ionic_lif *lif)return 0 ; } -static void * -ionic_bus_map_dbpage (struct ionic_adapter *adapter,int page_num) -{ -char *vaddr = adapter->bars[IONIC_PCI_BAR_DBELL ].vaddr; - -if (adapter->num_bars <=IONIC_PCI_BAR_DBELL ) -return NULL ; - -return (void *)&vaddr[page_num <<PAGE_SHIFT ]; -} -static void ionic_lif_queue_identify (struct ionic_lif *lif) {
@@ -959,7 +948,7 @@ ionic_lif_alloc(struct ionic_lif *lif)rte_spinlock_init (&lif->adminq_lock);rte_spinlock_init (&lif->adminq_service_lock); - lif->kern_dbpage =ionic_bus_map_dbpage (adapter,0 ); + lif->kern_dbpage = adapter->idev.db_pages;if (!lif->kern_dbpage) {IONIC_PRINT (ERR ,"Cannot map dbpage, aborting" );return -ENOMEM ;
Signature · 1 line
2.17.1
PATCH 10/35 net/ionic: remove unused identifiers
In reply to Andrew BoyerThese bits are not used. Remove them to simplify the code. Fix the spacing on the IONIC_ALIGN #define.
--- drivers/net/ionic/ionic.h | 1 - drivers/net/ionic/ionic_dev.h | 4 +--- drivers/net/ionic/ionic_ethdev.h | 2 -- 3 files changed, 1 insertion(+), 6 deletions(-)
drivers/net/ionic/ionic.h +0 -1
@@ -62,7 +62,6 @@ struct ionic_adapter {bool link_up;char fw_version[IONIC_DEVINFO_FWVERS_BUFLEN ];struct rte_pci_device *pci_dev; -LIST_ENTRY (ionic_adapter) pci_adapters; };/** ionic_admin_ctx - Admin command context.
drivers/net/ionic/ionic_dev.h +1 -3
@@ -21,12 +21,10 @@#define IONIC_MIN_RING_DESC 16#define IONIC_DEF_TXRX_DESC 4096 -#define IONIC_LIFS_MAX 1024 -#define IONIC_DEVCMD_TIMEOUT 5/* devcmd_timeout */ #define IONIC_DEVCMD_CHECK_PERIOD_US 10/* devcmd status chk period */ -#define IONIC_ALIGN 4096 +#define IONIC_ALIGN 4096struct ionic_adapter ;
drivers/net/ionic/ionic_ethdev.h +0 -2
@@ -17,8 +17,6 @@#define IONIC_ETH_DEV_TO_LIF (eth_dev) ((struct ionic_lif *) \ (eth_dev)->data->dev_private) -#define IONIC_ETH_DEV_TO_ADAPTER (eth_dev) \ - (IONIC_ETH_DEV_TO_LIF(eth_dev)->adapter)int ionic_dev_link_update (struct rte_eth_dev *eth_dev,int wait_to_complete);
Signature · 1 line
2.17.1
PATCH 10/35 net/ionic: remove unused identifiers
In reply to Andrew BoyerThese bits are not used. Remove them to simplify the code. Fix the spacing on the IONIC_ALIGN #define.
--- drivers/net/ionic/ionic.h | 1 - drivers/net/ionic/ionic_dev.h | 4 +--- drivers/net/ionic/ionic_ethdev.h | 2 -- 3 files changed, 1 insertion(+), 6 deletions(-)
drivers/net/ionic/ionic.h +0 -1
@@ -62,7 +62,6 @@ struct ionic_adapter {bool link_up;char fw_version[IONIC_DEVINFO_FWVERS_BUFLEN ];struct rte_pci_device *pci_dev; -LIST_ENTRY (ionic_adapter) pci_adapters; };/** ionic_admin_ctx - Admin command context.
drivers/net/ionic/ionic_dev.h +1 -3
@@ -21,12 +21,10 @@#define IONIC_MIN_RING_DESC 16#define IONIC_DEF_TXRX_DESC 4096 -#define IONIC_LIFS_MAX 1024 -#define IONIC_DEVCMD_TIMEOUT 5/* devcmd_timeout */ #define IONIC_DEVCMD_CHECK_PERIOD_US 10/* devcmd status chk period */ -#define IONIC_ALIGN 4096 +#define IONIC_ALIGN 4096struct ionic_adapter ;
drivers/net/ionic/ionic_ethdev.h +0 -2
@@ -17,8 +17,6 @@#define IONIC_ETH_DEV_TO_LIF (eth_dev) ((struct ionic_lif *) \ (eth_dev)->data->dev_private) -#define IONIC_ETH_DEV_TO_ADAPTER (eth_dev) \ - (IONIC_ETH_DEV_TO_LIF(eth_dev)->adapter)int ionic_dev_link_update (struct rte_eth_dev *eth_dev,int wait_to_complete);
Signature · 1 line
2.17.1
PATCH 11/35 net/ionic: only allocate interrupts if required
In reply to Andrew BoyerThere is no need to allocate the interrupt vector list if datapath packet interrupts are not enabled.
This conserves resources.
--- drivers/net/ionic/ionic_ethdev.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
drivers/net/ionic/ionic_ethdev.c +7 -5
@@ -1082,14 +1082,16 @@ ionic_configure_intr(struct ionic_adapter *adapter)return -1 ; } -if (rte_intr_dp_is_en (intr_handle)) +if (rte_intr_dp_is_en (intr_handle)) {IONIC_PRINT (DEBUG ,"Packet I/O interrupt on datapath is enabled" ); -if (rte_intr_vec_list_alloc (intr_handle,"intr_vec" , adapter->nintrs)) { -IONIC_PRINT (ERR ,"Failed to allocate %u vectors" , - adapter->nintrs); -return -ENOMEM ; +if (rte_intr_vec_list_alloc (intr_handle,"intr_vec" , + adapter->nintrs)) { +IONIC_PRINT (ERR ,"Failed to allocate %u vectors" , + adapter->nintrs); +return -ENOMEM ; + } } err = rte_intr_callback_register(intr_handle,
Signature · 1 line
2.17.1
PATCH 11/35 net/ionic: only allocate interrupts if required
In reply to Andrew BoyerThere is no need to allocate the interrupt vector list if datapath packet interrupts are not enabled.
This conserves resources.
--- drivers/net/ionic/ionic_ethdev.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
drivers/net/ionic/ionic_ethdev.c +7 -5
@@ -1082,14 +1082,16 @@ ionic_configure_intr(struct ionic_adapter *adapter)return -1 ; } -if (rte_intr_dp_is_en (intr_handle)) +if (rte_intr_dp_is_en (intr_handle)) {IONIC_PRINT (DEBUG ,"Packet I/O interrupt on datapath is enabled" ); -if (rte_intr_vec_list_alloc (intr_handle,"intr_vec" , adapter->nintrs)) { -IONIC_PRINT (ERR ,"Failed to allocate %u vectors" , - adapter->nintrs); -return -ENOMEM ; +if (rte_intr_vec_list_alloc (intr_handle,"intr_vec" , + adapter->nintrs)) { +IONIC_PRINT (ERR ,"Failed to allocate %u vectors" , + adapter->nintrs); +return -ENOMEM ; + } } err = rte_intr_callback_register(intr_handle,
Signature · 1 line
2.17.1
PATCH 12/35 net/ionic: move PCI-specific code to a separate file
In reply to Andrew BoyerFor future support of virtual devices, move the PCI code to its own file. Create a new device interface, struct ionic_dev_intf, to plug in to common code.
--- drivers/net/ionic/ionic.h | 13 +- drivers/net/ionic/ionic_dev.c | 62 --------- drivers/net/ionic/ionic_dev.h | 13 +- drivers/net/ionic/ionic_dev_pci.c | 216 ++++++++++++++++++++++++++++++ drivers/net/ionic/ionic_ethdev.c | 161 ++++++---------------- drivers/net/ionic/ionic_ethdev.h | 9 ++ drivers/net/ionic/ionic_main.c | 2 +- drivers/net/ionic/meson.build | 1 + 8 files changed, 286 insertions(+), 191 deletions(-) create mode 100644 drivers/net/ionic/ionic_dev_pci.c
drivers/net/ionic/ionic.h +8 -5
@@ -8,8 +8,6 @@#include <stdint.h> #include <inttypes.h> -#include <bus_pci_driver.h> -#include "ionic_dev.h" #include "ionic_if.h" #include "ionic_osdep.h"
@@ -42,6 +40,11 @@ struct ionic_hw {uint16_t vendor_id; }; +struct ionic_bars { +struct ionic_dev_bar bar[IONIC_BARS_MAX ]; +uint32_t num_bars; +}; +/* * Structure to store private data for each driver instance (for each adapter). */
@@ -49,10 +52,10 @@ struct ionic_adapter {struct ionic_hw hw;struct ionic_dev idev;const char *name; -struct ionic_dev_bar bars[IONIC_BARS_MAX ]; +struct ionic_bars bars; +const struct ionic_dev_intf *intf;struct ionic_identity ident;struct ionic_lif *lif; -uint32_t num_bars;uint32_t max_ntxqs_per_lif;uint32_t max_nrxqs_per_lif;uint32_t max_mac_addrs;
@@ -61,7 +64,7 @@ struct ionic_adapter {bool intrs[IONIC_INTR_CTRL_REGS_MAX ];bool link_up;char fw_version[IONIC_DEVINFO_FWVERS_BUFLEN ]; -struct rte_pci_device *pci_dev; +void *bus_dev; };/** ionic_admin_ctx - Admin command context.
drivers/net/ionic/ionic_dev.c +0 -62
68 lines not on this page · raw message
drivers/net/ionic/ionic_dev.h +11 -2
@@ -173,14 +173,23 @@ struct ionic_cq {struct ionic_lif ;struct ionic_adapter ;struct ionic_qcq ; +struct rte_mempool ; +struct rte_eth_dev ; + +struct ionic_dev_intf { +int (*setup)(struct ionic_adapter *adapter); +void (*copy_bus_info)(struct ionic_adapter *adapter, +struct rte_eth_dev *eth_dev); +int (*configure_intr)(struct ionic_adapter *adapter); +void (*unconfigure_intr)(struct ionic_adapter *adapter); +void (*unmap_bars)(struct ionic_adapter *adapter); +};void ionic_intr_init (struct ionic_dev *idev,struct ionic_intr_info *intr,unsigned long index);const char *ionic_opcode_to_str (enum ionic_cmd_opcode opcode); -int ionic_dev_setup (struct ionic_adapter *adapter); -void ionic_dev_cmd_go (struct ionic_dev *idev,union ionic_dev_cmd *cmd);uint8_t ionic_dev_cmd_status (struct ionic_dev *idev);bool ionic_dev_cmd_done (struct ionic_dev *idev);
drivers/net/ionic/ionic_dev_pci.c new file +216 -0
216 lines not on this page · raw message
drivers/net/ionic/ionic_ethdev.c +40 -121
274 lines not on this page · raw message
drivers/net/ionic/ionic_ethdev.h +9 -0
@@ -18,6 +18,15 @@#define IONIC_ETH_DEV_TO_LIF (eth_dev) ((struct ionic_lif *) \ (eth_dev)->data->dev_private) +struct ionic_bars ; +struct ionic_dev_intf ; + +int eth_ionic_dev_probe (void *bus_dev,struct rte_device *rte_dev, +struct ionic_bars *bars,const struct ionic_dev_intf *intf, +uint16_t device_id,uint16_t vendor_id); +int eth_ionic_dev_remove (struct rte_device *rte_dev); + +void ionic_dev_interrupt_handler (void *param);int ionic_dev_link_update (struct rte_eth_dev *eth_dev,int wait_to_complete);#endif /* _IONIC_ETHDEV_H_ */
drivers/net/ionic/ionic_main.c +1 -1
@@ -336,7 +336,7 @@ ionic_dev_cmd_wait_check(struct ionic_dev *idev, unsigned long max_wait)int ionic_setup (struct ionic_adapter *adapter) { -return ionic_dev_setup (adapter); +return (*adapter->intf->setup)(adapter); }int
drivers/net/ionic/meson.build +1 -0
@@ -9,6 +9,7 @@ endif sources = files( 'ionic_dev.c', + 'ionic_dev_pci.c', 'ionic_ethdev.c', 'ionic_lif.c', 'ionic_mac_api.c',
Signature · 1 line
2.17.1
PATCH 12/35 net/ionic: move PCI-specific code to a separate file
In reply to Andrew BoyerFor future support of virtual devices, move the PCI code to its own file. Create a new device interface, struct ionic_dev_intf, to plug in to common code.
--- drivers/net/ionic/ionic.h | 13 +- drivers/net/ionic/ionic_dev.c | 62 --------- drivers/net/ionic/ionic_dev.h | 13 +- drivers/net/ionic/ionic_dev_pci.c | 216 ++++++++++++++++++++++++++++++ drivers/net/ionic/ionic_ethdev.c | 161 ++++++---------------- drivers/net/ionic/ionic_ethdev.h | 9 ++ drivers/net/ionic/ionic_main.c | 2 +- drivers/net/ionic/meson.build | 1 + 8 files changed, 286 insertions(+), 191 deletions(-) create mode 100644 drivers/net/ionic/ionic_dev_pci.c
drivers/net/ionic/ionic.h +8 -5
@@ -8,8 +8,6 @@#include <stdint.h> #include <inttypes.h> -#include <bus_pci_driver.h> -#include "ionic_dev.h" #include "ionic_if.h" #include "ionic_osdep.h"
@@ -42,6 +40,11 @@ struct ionic_hw {uint16_t vendor_id; }; +struct ionic_bars { +struct ionic_dev_bar bar[IONIC_BARS_MAX ]; +uint32_t num_bars; +}; +/* * Structure to store private data for each driver instance (for each adapter). */
@@ -49,10 +52,10 @@ struct ionic_adapter {struct ionic_hw hw;struct ionic_dev idev;const char *name; -struct ionic_dev_bar bars[IONIC_BARS_MAX ]; +struct ionic_bars bars; +const struct ionic_dev_intf *intf;struct ionic_identity ident;struct ionic_lif *lif; -uint32_t num_bars;uint32_t max_ntxqs_per_lif;uint32_t max_nrxqs_per_lif;uint32_t max_mac_addrs;
@@ -61,7 +64,7 @@ struct ionic_adapter {bool intrs[IONIC_INTR_CTRL_REGS_MAX ];bool link_up;char fw_version[IONIC_DEVINFO_FWVERS_BUFLEN ]; -struct rte_pci_device *pci_dev; +void *bus_dev; };/** ionic_admin_ctx - Admin command context.
drivers/net/ionic/ionic_dev.c +0 -62
68 lines not on this page · raw message
drivers/net/ionic/ionic_dev.h +11 -2
@@ -173,14 +173,23 @@ struct ionic_cq {struct ionic_lif ;struct ionic_adapter ;struct ionic_qcq ; +struct rte_mempool ; +struct rte_eth_dev ; + +struct ionic_dev_intf { +int (*setup)(struct ionic_adapter *adapter); +void (*copy_bus_info)(struct ionic_adapter *adapter, +struct rte_eth_dev *eth_dev); +int (*configure_intr)(struct ionic_adapter *adapter); +void (*unconfigure_intr)(struct ionic_adapter *adapter); +void (*unmap_bars)(struct ionic_adapter *adapter); +};void ionic_intr_init (struct ionic_dev *idev,struct ionic_intr_info *intr,unsigned long index);const char *ionic_opcode_to_str (enum ionic_cmd_opcode opcode); -int ionic_dev_setup (struct ionic_adapter *adapter); -void ionic_dev_cmd_go (struct ionic_dev *idev,union ionic_dev_cmd *cmd);uint8_t ionic_dev_cmd_status (struct ionic_dev *idev);bool ionic_dev_cmd_done (struct ionic_dev *idev);
drivers/net/ionic/ionic_dev_pci.c new file +216 -0
216 lines not on this page · raw message
drivers/net/ionic/ionic_ethdev.c +40 -121
274 lines not on this page · raw message
drivers/net/ionic/ionic_ethdev.h +9 -0
@@ -18,6 +18,15 @@#define IONIC_ETH_DEV_TO_LIF (eth_dev) ((struct ionic_lif *) \ (eth_dev)->data->dev_private) +struct ionic_bars ; +struct ionic_dev_intf ; + +int eth_ionic_dev_probe (void *bus_dev,struct rte_device *rte_dev, +struct ionic_bars *bars,const struct ionic_dev_intf *intf, +uint16_t device_id,uint16_t vendor_id); +int eth_ionic_dev_remove (struct rte_device *rte_dev); + +void ionic_dev_interrupt_handler (void *param);int ionic_dev_link_update (struct rte_eth_dev *eth_dev,int wait_to_complete);#endif /* _IONIC_ETHDEV_H_ */
drivers/net/ionic/ionic_main.c +1 -1
@@ -336,7 +336,7 @@ ionic_dev_cmd_wait_check(struct ionic_dev *idev, unsigned long max_wait)int ionic_setup (struct ionic_adapter *adapter) { -return ionic_dev_setup (adapter); +return (*adapter->intf->setup)(adapter); }int
drivers/net/ionic/meson.build +1 -0
@@ -9,6 +9,7 @@ endif sources = files( 'ionic_dev.c', + 'ionic_dev_pci.c', 'ionic_ethdev.c', 'ionic_lif.c', 'ionic_mac_api.c',
Signature · 1 line
2.17.1
PATCH 13/35 net/ionic: only request notifyq interrupt if supported
In reply to Andrew BoyerEnable the interrupt if the platform & device support it. This prevents spurious interrupts on virtual platforms.
--- drivers/net/ionic/ionic_lif.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
drivers/net/ionic/ionic_lif.c +9 -3
@@ -1350,6 +1350,7 @@ ionic_lif_notifyq_init(struct ionic_lif *lif)struct ionic_dev *idev = &lif->adapter->idev;struct ionic_notify_qcq *nqcq = lif->notifyqcq;struct ionic_queue *q = &nqcq->qcq.q; +uint16_t flags =IONIC_QINIT_F_ENA ;int err;struct ionic_admin_ctx ctx = {
@@ -1359,14 +1360,19 @@ ionic_lif_notifyq_init(struct ionic_lif *lif) .type = q->type, .ver = lif->qtype_info[q->type].version, .index = rte_cpu_to_le_32(q->index), - .intr_index = rte_cpu_to_le_16(nqcq->intr.index), - .flags = rte_cpu_to_le_16(IONIC_QINIT_F_IRQ | - IONIC_QINIT_F_ENA), + .intr_index = rte_cpu_to_le_16(IONIC_INTR_NONE), .ring_size = rte_log2_u32(q->num_descs), .ring_base = rte_cpu_to_le_64(q->base_pa), } }; +/* Only enable an interrupt if the device supports them */ +if (lif->adapter->intf->configure_intr !=NULL ) { + flags |=IONIC_QINIT_F_IRQ ; + ctx.cmd.q_init.intr_index =rte_cpu_to_le_16 (nqcq->intr.index); + } + ctx.cmd.q_init.flags =rte_cpu_to_le_16 (flags); +IONIC_PRINT (DEBUG ,"notifyq_init.index %d" , q->index);IONIC_PRINT (DEBUG ,"notifyq_init.ring_base 0x%" PRIx64"" , q->base_pa); IONIC_PRINT(DEBUG, "notifyq_init.ring_size %d",
Signature · 1 line
2.17.1
PATCH 13/35 net/ionic: only request notifyq interrupt if supported
In reply to Andrew BoyerEnable the interrupt if the platform & device support it. This prevents spurious interrupts on virtual platforms.
--- drivers/net/ionic/ionic_lif.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
drivers/net/ionic/ionic_lif.c +9 -3
@@ -1350,6 +1350,7 @@ ionic_lif_notifyq_init(struct ionic_lif *lif)struct ionic_dev *idev = &lif->adapter->idev;struct ionic_notify_qcq *nqcq = lif->notifyqcq;struct ionic_queue *q = &nqcq->qcq.q; +uint16_t flags =IONIC_QINIT_F_ENA ;int err;struct ionic_admin_ctx ctx = {
@@ -1359,14 +1360,19 @@ ionic_lif_notifyq_init(struct ionic_lif *lif) .type = q->type, .ver = lif->qtype_info[q->type].version, .index = rte_cpu_to_le_32(q->index), - .intr_index = rte_cpu_to_le_16(nqcq->intr.index), - .flags = rte_cpu_to_le_16(IONIC_QINIT_F_IRQ | - IONIC_QINIT_F_ENA), + .intr_index = rte_cpu_to_le_16(IONIC_INTR_NONE), .ring_size = rte_log2_u32(q->num_descs), .ring_base = rte_cpu_to_le_64(q->base_pa), } }; +/* Only enable an interrupt if the device supports them */ +if (lif->adapter->intf->configure_intr !=NULL ) { + flags |=IONIC_QINIT_F_IRQ ; + ctx.cmd.q_init.intr_index =rte_cpu_to_le_16 (nqcq->intr.index); + } + ctx.cmd.q_init.flags =rte_cpu_to_le_16 (flags); +IONIC_PRINT (DEBUG ,"notifyq_init.index %d" , q->index);IONIC_PRINT (DEBUG ,"notifyq_init.ring_base 0x%" PRIx64"" , q->base_pa); IONIC_PRINT(DEBUG, "notifyq_init.ring_size %d",
Signature · 1 line
2.17.1
PATCH 14/35 net/ionic: replace void pointer with actual type
In reply to Andrew BoyerThis makes the code safer by helping the compiler catch errors. Rename the variables, too; they're not callbacks anymore.
--- drivers/net/ionic/ionic_rxtx.c | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-)
drivers/net/ionic/ionic_rxtx.c +13 -15
@@ -765,7 +765,7 @@ ionic_dev_rx_queue_setup(struct rte_eth_dev *eth_dev, static __rte_always_inline voidionic_rx_clean (struct ionic_rx_qcq *rxq,uint32_t q_desc_index,uint32_t cq_desc_index, -void *service_cb_arg) +struct ionic_rx_service *rx_svc) {struct ionic_queue *q = &rxq->qcq.q;struct ionic_cq *cq = &rxq->qcq.cq;
@@ -775,8 +775,6 @@ ionic_rx_clean(struct ionic_rx_qcq *rxq,uint64_t pkt_flags =0 ;uint32_t pkt_type;struct ionic_rx_stats *stats = &rxq->stats; -struct ionic_rx_service *recv_args = (struct ionic_rx_service *) - service_cb_arg;uint32_t buf_size = (uint16_t ) (rte_pktmbuf_data_room_size (rxq->mb_pool) -RTE_PKTMBUF_HEADROOM );
@@ -789,7 +787,7 @@ ionic_rx_clean(struct ionic_rx_qcq *rxq, rxm = info[0 ]; -if (!recv_args) { +if (!rx_svc) { stats->no_cb_arg++;/* Flush */ rte_pktmbuf_free (rxm);
@@ -806,7 +804,7 @@ ionic_rx_clean(struct ionic_rx_qcq *rxq,return ; } -if (recv_args->nb_rx >= recv_args->nb_pkts) { +if (rx_svc->nb_rx >= rx_svc->nb_pkts) { stats->no_room++;ionic_rx_recycle (q, q_desc_index, rxm);return ;
@@ -907,8 +905,8 @@ ionic_rx_clean(struct ionic_rx_qcq *rxq, rxm->packet_type = pkt_type; - recv_args->rx_pkts[recv_args->nb_rx] = rxm; - recv_args->nb_rx++; + rx_svc->rx_pkts[rx_svc->nb_rx] = rxm; + rx_svc->nb_rx++; stats->packets++; stats->bytes += rxm->pkt_len;
@@ -1052,7 +1050,7 @@ ionic_dev_rx_queue_start(struct rte_eth_dev *eth_dev, uint16_t rx_queue_id) static __rte_always_inline voidionic_rxq_service (struct ionic_rx_qcq *rxq,uint32_t work_to_do, -void *service_cb_arg) +struct ionic_rx_service *rx_svc) {struct ionic_cq *cq = &rxq->qcq.cq;struct ionic_queue *q = &rxq->qcq.q;
@@ -1088,7 +1086,7 @@ ionic_rxq_service(struct ionic_rx_qcq *rxq, uint32_t work_to_do,rte_prefetch0 (&q->info[q->tail_idx]);ionic_rx_clean (rxq, curr_q_tail_idx, curr_cq_tail_idx, - service_cb_arg); + rx_svc); }while (more);
@@ -1127,15 +1125,15 @@ ionic_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) {struct ionic_rx_qcq *rxq = rx_queue; -struct ionic_rx_service service_cb_arg; +struct ionic_rx_service rx_svc; - service_cb_arg.rx_pkts = rx_pkts; - service_cb_arg.nb_pkts = nb_pkts; - service_cb_arg.nb_rx =0 ; + rx_svc.rx_pkts = rx_pkts; + rx_svc.nb_pkts = nb_pkts; + rx_svc.nb_rx =0 ; -ionic_rxq_service (rxq, nb_pkts, &service_cb_arg); +ionic_rxq_service (rxq, nb_pkts, &rx_svc);ionic_rx_fill (rxq); -return service_cb_arg.nb_rx; +return rx_svc.nb_rx; }
Signature · 1 line
2.17.1
PATCH 14/35 net/ionic: replace void pointer with actual type
In reply to Andrew BoyerThis makes the code safer by helping the compiler catch errors. Rename the variables, too; they're not callbacks anymore.
--- drivers/net/ionic/ionic_rxtx.c | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-)
drivers/net/ionic/ionic_rxtx.c +13 -15
@@ -765,7 +765,7 @@ ionic_dev_rx_queue_setup(struct rte_eth_dev *eth_dev, static __rte_always_inline voidionic_rx_clean (struct ionic_rx_qcq *rxq,uint32_t q_desc_index,uint32_t cq_desc_index, -void *service_cb_arg) +struct ionic_rx_service *rx_svc) {struct ionic_queue *q = &rxq->qcq.q;struct ionic_cq *cq = &rxq->qcq.cq;
@@ -775,8 +775,6 @@ ionic_rx_clean(struct ionic_rx_qcq *rxq,uint64_t pkt_flags =0 ;uint32_t pkt_type;struct ionic_rx_stats *stats = &rxq->stats; -struct ionic_rx_service *recv_args = (struct ionic_rx_service *) - service_cb_arg;uint32_t buf_size = (uint16_t ) (rte_pktmbuf_data_room_size (rxq->mb_pool) -RTE_PKTMBUF_HEADROOM );
@@ -789,7 +787,7 @@ ionic_rx_clean(struct ionic_rx_qcq *rxq, rxm = info[0 ]; -if (!recv_args) { +if (!rx_svc) { stats->no_cb_arg++;/* Flush */ rte_pktmbuf_free (rxm);
@@ -806,7 +804,7 @@ ionic_rx_clean(struct ionic_rx_qcq *rxq,return ; } -if (recv_args->nb_rx >= recv_args->nb_pkts) { +if (rx_svc->nb_rx >= rx_svc->nb_pkts) { stats->no_room++;ionic_rx_recycle (q, q_desc_index, rxm);return ;
@@ -907,8 +905,8 @@ ionic_rx_clean(struct ionic_rx_qcq *rxq, rxm->packet_type = pkt_type; - recv_args->rx_pkts[recv_args->nb_rx] = rxm; - recv_args->nb_rx++; + rx_svc->rx_pkts[rx_svc->nb_rx] = rxm; + rx_svc->nb_rx++; stats->packets++; stats->bytes += rxm->pkt_len;
@@ -1052,7 +1050,7 @@ ionic_dev_rx_queue_start(struct rte_eth_dev *eth_dev, uint16_t rx_queue_id) static __rte_always_inline voidionic_rxq_service (struct ionic_rx_qcq *rxq,uint32_t work_to_do, -void *service_cb_arg) +struct ionic_rx_service *rx_svc) {struct ionic_cq *cq = &rxq->qcq.cq;struct ionic_queue *q = &rxq->qcq.q;
@@ -1088,7 +1086,7 @@ ionic_rxq_service(struct ionic_rx_qcq *rxq, uint32_t work_to_do,rte_prefetch0 (&q->info[q->tail_idx]);ionic_rx_clean (rxq, curr_q_tail_idx, curr_cq_tail_idx, - service_cb_arg); + rx_svc); }while (more);
@@ -1127,15 +1125,15 @@ ionic_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) {struct ionic_rx_qcq *rxq = rx_queue; -struct ionic_rx_service service_cb_arg; +struct ionic_rx_service rx_svc; - service_cb_arg.rx_pkts = rx_pkts; - service_cb_arg.nb_pkts = nb_pkts; - service_cb_arg.nb_rx =0 ; + rx_svc.rx_pkts = rx_pkts; + rx_svc.nb_pkts = nb_pkts; + rx_svc.nb_rx =0 ; -ionic_rxq_service (rxq, nb_pkts, &service_cb_arg); +ionic_rxq_service (rxq, nb_pkts, &rx_svc);ionic_rx_fill (rxq); -return service_cb_arg.nb_rx; +return rx_svc.nb_rx; }
Signature · 1 line
2.17.1
PATCH 15/35 net/ionic: free all buffers during Rx queue stop
In reply to Andrew BoyerFree all of the mbufs in the receive queue when the queue is stopped. This will allow them to be resized when the MTU is changed.
--- drivers/net/ionic/ionic_dev.c | 16 +++++ drivers/net/ionic/ionic_dev.h | 2 + drivers/net/ionic/ionic_lif.c | 32 ++++----- drivers/net/ionic/ionic_lif.h | 4 -- drivers/net/ionic/ionic_rxtx.c | 116 +++++++++++++++------------------ 5 files changed, 81 insertions(+), 89 deletions(-)
drivers/net/ionic/ionic_dev.c +16 -0
@@ -317,6 +317,15 @@ ionic_cq_init(struct ionic_cq *cq, uint16_t num_descs)return 0 ; } +void +ionic_cq_reset (struct ionic_cq *cq) +{ + cq->tail_idx =0 ; + cq->done_color =1 ; + +memset (cq->base,0 ,sizeof (struct ionic_nop_comp ) * cq->num_descs); +} +void ionic_cq_map (struct ionic_cq *cq,void *base,rte_iova_t base_pa) {
@@ -379,3 +388,10 @@ ionic_q_sg_map(struct ionic_queue *q, void *base, rte_iova_t base_pa) q->sg_base = base; q->sg_base_pa = base_pa; } + +void +ionic_q_reset (struct ionic_queue *q) +{ + q->head_idx =0 ; + q->tail_idx =0 ; +}
drivers/net/ionic/ionic_dev.h +2 -0
@@ -225,6 +225,7 @@ struct ionic_doorbell __iomem *ionic_db_map(struct ionic_lif *lif, struct ionic_queue *q);int ionic_cq_init (struct ionic_cq *cq,uint16_t num_descs); +void ionic_cq_reset (struct ionic_cq *cq);void ionic_cq_map (struct ionic_cq *cq,void *base,rte_iova_t base_pa);typedef bool (*ionic_cq_cb )(struct ionic_cq *cq,uint16_t cq_desc_index,void *cb_arg);
@@ -232,6 +233,7 @@ uint32_t ionic_cq_service(struct ionic_cq *cq, uint32_t work_to_do, ionic_cq_cb cb, void *cb_arg);int ionic_q_init (struct ionic_queue *q,uint32_t index,uint16_t num_descs); +void ionic_q_reset (struct ionic_queue *q);void ionic_q_map (struct ionic_queue *q,void *base,rte_iova_t base_pa);void ionic_q_sg_map (struct ionic_queue *q,void *base,rte_iova_t base_pa);
drivers/net/ionic/ionic_lif.c +11 -21
@@ -30,25 +30,7 @@ static const uint8_t ionic_qtype_vers[IONIC_QTYPE_MAX] = {static int ionic_lif_addr_add (struct ionic_lif *lif,const uint8_t *addr);static int ionic_lif_addr_del (struct ionic_lif *lif,const uint8_t *addr); -int -ionic_qcq_enable (struct ionic_qcq *qcq) -{ -struct ionic_queue *q = &qcq->q; -struct ionic_lif *lif = qcq->lif; -struct ionic_admin_ctx ctx = { - .pending_work = true, - .cmd.q_control = { - .opcode =IONIC_CMD_Q_CONTROL , - .type = q->type, - .index =rte_cpu_to_le_32 (q->index), - .oper =IONIC_Q_ENABLE , - }, - }; - -return ionic_adminq_post_wait (lif, &ctx); -} - -int +static int ionic_qcq_disable (struct ionic_qcq *qcq) {struct ionic_queue *q = &qcq->q;
@@ -133,7 +115,6 @@ ionic_lif_get_abs_stats(const struct ionic_lif *lif, struct rte_eth_stats *statsfor (i =0 ; i < lif->nrxqcqs; i++) {struct ionic_rx_stats *rx_stats = &lif->rxqcqs[i]->stats; stats->ierrors += - rx_stats->no_cb_arg + rx_stats->bad_cq_status + rx_stats->no_room + rx_stats->bad_len;
@@ -154,7 +135,6 @@ ionic_lif_get_abs_stats(const struct ionic_lif *lif, struct rte_eth_stats *stats stats->q_ipackets[i] = rx_stats->packets; stats->q_ibytes[i] = rx_stats->bytes; stats->q_errors[i] = - rx_stats->no_cb_arg + rx_stats->bad_cq_status + rx_stats->no_room + rx_stats->bad_len;
@@ -1146,12 +1126,16 @@ ionic_lif_rss_teardown(struct ionic_lif *lif)void ionic_lif_txq_deinit (struct ionic_tx_qcq *txq) { +ionic_qcq_disable (&txq->qcq); + txq->flags &= ~IONIC_QCQ_F_INITED ; }void ionic_lif_rxq_deinit (struct ionic_rx_qcq *rxq) { +ionic_qcq_disable (&rxq->qcq); + rxq->flags &= ~IONIC_QCQ_F_INITED ; }
@@ -1488,6 +1472,9 @@ ionic_lif_txq_init(struct ionic_tx_qcq *txq) ctx.cmd.q_init.ring_size);IONIC_PRINT (DEBUG ,"txq_init.ver %u" , ctx.cmd.q_init.ver); +ionic_q_reset (q); +ionic_cq_reset (cq); + err =ionic_adminq_post_wait (lif, &ctx);if (err)return err;
@@ -1536,6 +1523,9 @@ ionic_lif_rxq_init(struct ionic_rx_qcq *rxq) ctx.cmd.q_init.ring_size);IONIC_PRINT (DEBUG ,"rxq_init.ver %u" , ctx.cmd.q_init.ver); +ionic_q_reset (q); +ionic_cq_reset (cq); + err =ionic_adminq_post_wait (lif, &ctx);if (err)return err;
drivers/net/ionic/ionic_lif.h +0 -4
@@ -39,7 +39,6 @@ struct ionic_tx_stats {struct ionic_rx_stats {uint64_t packets;uint64_t bytes; -uint64_t no_cb_arg;uint64_t bad_cq_status;uint64_t no_room;uint64_t bad_len;
@@ -207,9 +206,6 @@ int ionic_tx_qcq_alloc(struct ionic_lif *lif, uint32_t socket_id, struct ionic_tx_qcq **qcq_out);void ionic_qcq_free (struct ionic_qcq *qcq); -int ionic_qcq_enable (struct ionic_qcq *qcq); -int ionic_qcq_disable (struct ionic_qcq *qcq); -int ionic_lif_rxq_init (struct ionic_rx_qcq *rxq);void ionic_lif_rxq_deinit (struct ionic_rx_qcq *rxq);
drivers/net/ionic/ionic_rxtx.c +52 -64
192 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH 15/35 net/ionic: free all buffers during Rx queue stop
In reply to Andrew BoyerFree all of the mbufs in the receive queue when the queue is stopped. This will allow them to be resized when the MTU is changed.
--- drivers/net/ionic/ionic_dev.c | 16 +++++ drivers/net/ionic/ionic_dev.h | 2 + drivers/net/ionic/ionic_lif.c | 32 ++++----- drivers/net/ionic/ionic_lif.h | 4 -- drivers/net/ionic/ionic_rxtx.c | 116 +++++++++++++++------------------ 5 files changed, 81 insertions(+), 89 deletions(-)
drivers/net/ionic/ionic_dev.c +16 -0
@@ -317,6 +317,15 @@ ionic_cq_init(struct ionic_cq *cq, uint16_t num_descs)return 0 ; } +void +ionic_cq_reset (struct ionic_cq *cq) +{ + cq->tail_idx =0 ; + cq->done_color =1 ; + +memset (cq->base,0 ,sizeof (struct ionic_nop_comp ) * cq->num_descs); +} +void ionic_cq_map (struct ionic_cq *cq,void *base,rte_iova_t base_pa) {
@@ -379,3 +388,10 @@ ionic_q_sg_map(struct ionic_queue *q, void *base, rte_iova_t base_pa) q->sg_base = base; q->sg_base_pa = base_pa; } + +void +ionic_q_reset (struct ionic_queue *q) +{ + q->head_idx =0 ; + q->tail_idx =0 ; +}
drivers/net/ionic/ionic_dev.h +2 -0
@@ -225,6 +225,7 @@ struct ionic_doorbell __iomem *ionic_db_map(struct ionic_lif *lif, struct ionic_queue *q);int ionic_cq_init (struct ionic_cq *cq,uint16_t num_descs); +void ionic_cq_reset (struct ionic_cq *cq);void ionic_cq_map (struct ionic_cq *cq,void *base,rte_iova_t base_pa);typedef bool (*ionic_cq_cb )(struct ionic_cq *cq,uint16_t cq_desc_index,void *cb_arg);
@@ -232,6 +233,7 @@ uint32_t ionic_cq_service(struct ionic_cq *cq, uint32_t work_to_do, ionic_cq_cb cb, void *cb_arg);int ionic_q_init (struct ionic_queue *q,uint32_t index,uint16_t num_descs); +void ionic_q_reset (struct ionic_queue *q);void ionic_q_map (struct ionic_queue *q,void *base,rte_iova_t base_pa);void ionic_q_sg_map (struct ionic_queue *q,void *base,rte_iova_t base_pa);
drivers/net/ionic/ionic_lif.c +11 -21
@@ -30,25 +30,7 @@ static const uint8_t ionic_qtype_vers[IONIC_QTYPE_MAX] = {static int ionic_lif_addr_add (struct ionic_lif *lif,const uint8_t *addr);static int ionic_lif_addr_del (struct ionic_lif *lif,const uint8_t *addr); -int -ionic_qcq_enable (struct ionic_qcq *qcq) -{ -struct ionic_queue *q = &qcq->q; -struct ionic_lif *lif = qcq->lif; -struct ionic_admin_ctx ctx = { - .pending_work = true, - .cmd.q_control = { - .opcode =IONIC_CMD_Q_CONTROL , - .type = q->type, - .index =rte_cpu_to_le_32 (q->index), - .oper =IONIC_Q_ENABLE , - }, - }; - -return ionic_adminq_post_wait (lif, &ctx); -} - -int +static int ionic_qcq_disable (struct ionic_qcq *qcq) {struct ionic_queue *q = &qcq->q;
@@ -133,7 +115,6 @@ ionic_lif_get_abs_stats(const struct ionic_lif *lif, struct rte_eth_stats *statsfor (i =0 ; i < lif->nrxqcqs; i++) {struct ionic_rx_stats *rx_stats = &lif->rxqcqs[i]->stats; stats->ierrors += - rx_stats->no_cb_arg + rx_stats->bad_cq_status + rx_stats->no_room + rx_stats->bad_len;
@@ -154,7 +135,6 @@ ionic_lif_get_abs_stats(const struct ionic_lif *lif, struct rte_eth_stats *stats stats->q_ipackets[i] = rx_stats->packets; stats->q_ibytes[i] = rx_stats->bytes; stats->q_errors[i] = - rx_stats->no_cb_arg + rx_stats->bad_cq_status + rx_stats->no_room + rx_stats->bad_len;
@@ -1146,12 +1126,16 @@ ionic_lif_rss_teardown(struct ionic_lif *lif)void ionic_lif_txq_deinit (struct ionic_tx_qcq *txq) { +ionic_qcq_disable (&txq->qcq); + txq->flags &= ~IONIC_QCQ_F_INITED ; }void ionic_lif_rxq_deinit (struct ionic_rx_qcq *rxq) { +ionic_qcq_disable (&rxq->qcq); + rxq->flags &= ~IONIC_QCQ_F_INITED ; }
@@ -1488,6 +1472,9 @@ ionic_lif_txq_init(struct ionic_tx_qcq *txq) ctx.cmd.q_init.ring_size);IONIC_PRINT (DEBUG ,"txq_init.ver %u" , ctx.cmd.q_init.ver); +ionic_q_reset (q); +ionic_cq_reset (cq); + err =ionic_adminq_post_wait (lif, &ctx);if (err)return err;
@@ -1536,6 +1523,9 @@ ionic_lif_rxq_init(struct ionic_rx_qcq *rxq) ctx.cmd.q_init.ring_size);IONIC_PRINT (DEBUG ,"rxq_init.ver %u" , ctx.cmd.q_init.ver); +ionic_q_reset (q); +ionic_cq_reset (cq); + err =ionic_adminq_post_wait (lif, &ctx);if (err)return err;
drivers/net/ionic/ionic_lif.h +0 -4
@@ -39,7 +39,6 @@ struct ionic_tx_stats {struct ionic_rx_stats {uint64_t packets;uint64_t bytes; -uint64_t no_cb_arg;uint64_t bad_cq_status;uint64_t no_room;uint64_t bad_len;
@@ -207,9 +206,6 @@ int ionic_tx_qcq_alloc(struct ionic_lif *lif, uint32_t socket_id, struct ionic_tx_qcq **qcq_out);void ionic_qcq_free (struct ionic_qcq *qcq); -int ionic_qcq_enable (struct ionic_qcq *qcq); -int ionic_qcq_disable (struct ionic_qcq *qcq); -int ionic_lif_rxq_init (struct ionic_rx_qcq *rxq);void ionic_lif_rxq_deinit (struct ionic_rx_qcq *rxq);
drivers/net/ionic/ionic_rxtx.c +52 -64
192 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH 16/35 net/ionic: precalculate segment lengths on receive side
In reply to Andrew BoyerThe first (header) segment includes the standard headroom. Subsequent segments do not.
Store the fragment counts in the queue structure.
Precalculating improves performance by reducing
how much work must be done in the hot path.
--- drivers/net/ionic/ionic_dev.h | 1 + drivers/net/ionic/ionic_lif.c | 36 ++++++++++++++++++++++++-- drivers/net/ionic/ionic_lif.h | 4 ++- drivers/net/ionic/ionic_rxtx.c | 46 ++++++++++++++-------------------- 4 files changed, 57 insertions(+), 30 deletions(-)
drivers/net/ionic/ionic_dev.h +1 -0
@@ -137,6 +137,7 @@ struct ionic_dev {struct ionic_queue {uint16_t num_descs; +uint16_t num_segs;uint16_t head_idx;uint16_t tail_idx;uint16_t size_mask;
drivers/net/ionic/ionic_lif.c +34 -2
@@ -566,6 +566,7 @@ ionic_qcq_alloc(struct ionic_lif *lif,const char *type_name, uint16_t flags, uint16_t num_descs, + uint16_t num_segs, uint16_t desc_size, uint16_t cq_desc_size, uint16_t sg_desc_size,
@@ -616,6 +617,7 @@ ionic_qcq_alloc(struct ionic_lif *lif, goto err_out_free_qcq; } + new->q.num_segs = num_segs; new->q.type = type; err =ionic_q_init (&new->q, index, num_descs);
@@ -698,14 +700,38 @@ ionic_qcq_free(struct ionic_qcq *qcq)int ionic_rx_qcq_alloc (struct ionic_lif *lif,uint32_t socket_id,uint32_t index, -uint16_t nrxq_descs,struct ionic_rx_qcq **rxq_out) +uint16_t nrxq_descs,struct rte_mempool *mb_pool, +struct ionic_rx_qcq **rxq_out) {struct ionic_rx_qcq *rxq; -uint16_t flags; +uint16_t flags, seg_size, hdr_seg_size, max_segs, max_segs_fw; +uint32_t max_mtu;int err; flags =IONIC_QCQ_F_SG ; + seg_size =rte_pktmbuf_data_room_size (mb_pool); + +/* The first mbuf needs to leave headroom */ + hdr_seg_size = seg_size -RTE_PKTMBUF_HEADROOM ; + + max_mtu =rte_le_to_cpu_32 (lif->adapter->ident.lif.eth.max_mtu); + + max_segs_fw =IONIC_RX_MAX_SG_ELEMS +1 ; + +/* +* Calculate how many fragment pointers might be stored in queue. +*/ + max_segs =1 + (max_mtu +RTE_PKTMBUF_HEADROOM -1 ) / seg_size; + +IONIC_PRINT (DEBUG ,"rxq %u frame_size %u seg_size %u max_segs %u" , + index, lif->frame_size, seg_size, max_segs); +if (max_segs > max_segs_fw) { +IONIC_PRINT (ERR ,"Rx mbuf size insufficient (%d > %d avail)" , + max_segs, max_segs_fw); +return -EINVAL ; + } + err = ionic_qcq_alloc(lif, IONIC_QTYPE_RXQ, sizeof(struct ionic_rx_qcq),
@@ -714,6 +740,7 @@ ionic_rx_qcq_alloc(struct ionic_lif *lif, uint32_t socket_id, uint32_t index,"rx" , flags, nrxq_descs, + max_segs,sizeof (struct ionic_rxq_desc ),sizeof (struct ionic_rxq_comp ), sizeof(struct ionic_rxq_sg_desc),
@@ -722,6 +749,8 @@ ionic_rx_qcq_alloc(struct ionic_lif *lif, uint32_t socket_id, uint32_t index,return err; rxq->flags = flags; + rxq->seg_size = seg_size; + rxq->hdr_seg_size = hdr_seg_size; lif->rxqcqs[index] = rxq; *rxq_out = rxq;
@@ -749,6 +778,7 @@ ionic_tx_qcq_alloc(struct ionic_lif *lif, uint32_t socket_id, uint32_t index,"tx" , flags, ntxq_descs, +1 ,sizeof (struct ionic_txq_desc ),sizeof (struct ionic_txq_comp ), sizeof(struct ionic_txq_sg_desc_v1),
@@ -779,6 +809,7 @@ ionic_admin_qcq_alloc(struct ionic_lif *lif)"admin" , flags,IONIC_ADMINQ_LENGTH , +1 ,sizeof (struct ionic_admin_cmd ),sizeof (struct ionic_admin_comp ), 0,
@@ -805,6 +836,7 @@ ionic_notify_qcq_alloc(struct ionic_lif *lif)"notify" , flags,IONIC_NOTIFYQ_LENGTH , +1 ,sizeof (struct ionic_notifyq_cmd ),sizeof (union ionic_notifyq_comp ), 0,
drivers/net/ionic/ionic_lif.h +3 -1
@@ -81,6 +81,8 @@ struct ionic_rx_qcq {/* cacheline2 */ struct rte_mempool *mb_pool;uint16_t frame_size;/* Based on configured MTU */ +uint16_t hdr_seg_size;/* Length of first segment of RX chain */ +uint16_t seg_size;/* Length of all subsequent segments */ uint16_t flags;/* cacheline3 (inside stats) */
@@ -199,7 +201,7 @@ int ionic_dev_allmulticast_enable(struct rte_eth_dev *dev);int ionic_dev_allmulticast_disable (struct rte_eth_dev *dev);int ionic_rx_qcq_alloc (struct ionic_lif *lif,uint32_t socket_id, -uint32_t index,uint16_t nrxq_descs, +uint32_t index,uint16_t nrxq_descs,struct rte_mempool *mp,struct ionic_rx_qcq **qcq_out); int ionic_tx_qcq_alloc(struct ionic_lif *lif, uint32_t socket_id, uint32_t index, uint16_t ntxq_descs,
drivers/net/ionic/ionic_rxtx.c +19 -27
118 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH 16/35 net/ionic: precalculate segment lengths on receive side
In reply to Andrew BoyerThe first (header) segment includes the standard headroom. Subsequent segments do not.
Store the fragment counts in the queue structure.
Precalculating improves performance by reducing
how much work must be done in the hot path.
--- drivers/net/ionic/ionic_dev.h | 1 + drivers/net/ionic/ionic_lif.c | 36 ++++++++++++++++++++++++-- drivers/net/ionic/ionic_lif.h | 4 ++- drivers/net/ionic/ionic_rxtx.c | 46 ++++++++++++++-------------------- 4 files changed, 57 insertions(+), 30 deletions(-)
drivers/net/ionic/ionic_dev.h +1 -0
@@ -137,6 +137,7 @@ struct ionic_dev {struct ionic_queue {uint16_t num_descs; +uint16_t num_segs;uint16_t head_idx;uint16_t tail_idx;uint16_t size_mask;
drivers/net/ionic/ionic_lif.c +34 -2
@@ -566,6 +566,7 @@ ionic_qcq_alloc(struct ionic_lif *lif,const char *type_name, uint16_t flags, uint16_t num_descs, + uint16_t num_segs, uint16_t desc_size, uint16_t cq_desc_size, uint16_t sg_desc_size,
@@ -616,6 +617,7 @@ ionic_qcq_alloc(struct ionic_lif *lif, goto err_out_free_qcq; } + new->q.num_segs = num_segs; new->q.type = type; err =ionic_q_init (&new->q, index, num_descs);
@@ -698,14 +700,38 @@ ionic_qcq_free(struct ionic_qcq *qcq)int ionic_rx_qcq_alloc (struct ionic_lif *lif,uint32_t socket_id,uint32_t index, -uint16_t nrxq_descs,struct ionic_rx_qcq **rxq_out) +uint16_t nrxq_descs,struct rte_mempool *mb_pool, +struct ionic_rx_qcq **rxq_out) {struct ionic_rx_qcq *rxq; -uint16_t flags; +uint16_t flags, seg_size, hdr_seg_size, max_segs, max_segs_fw; +uint32_t max_mtu;int err; flags =IONIC_QCQ_F_SG ; + seg_size =rte_pktmbuf_data_room_size (mb_pool); + +/* The first mbuf needs to leave headroom */ + hdr_seg_size = seg_size -RTE_PKTMBUF_HEADROOM ; + + max_mtu =rte_le_to_cpu_32 (lif->adapter->ident.lif.eth.max_mtu); + + max_segs_fw =IONIC_RX_MAX_SG_ELEMS +1 ; + +/* +* Calculate how many fragment pointers might be stored in queue. +*/ + max_segs =1 + (max_mtu +RTE_PKTMBUF_HEADROOM -1 ) / seg_size; + +IONIC_PRINT (DEBUG ,"rxq %u frame_size %u seg_size %u max_segs %u" , + index, lif->frame_size, seg_size, max_segs); +if (max_segs > max_segs_fw) { +IONIC_PRINT (ERR ,"Rx mbuf size insufficient (%d > %d avail)" , + max_segs, max_segs_fw); +return -EINVAL ; + } + err = ionic_qcq_alloc(lif, IONIC_QTYPE_RXQ, sizeof(struct ionic_rx_qcq),
@@ -714,6 +740,7 @@ ionic_rx_qcq_alloc(struct ionic_lif *lif, uint32_t socket_id, uint32_t index,"rx" , flags, nrxq_descs, + max_segs,sizeof (struct ionic_rxq_desc ),sizeof (struct ionic_rxq_comp ), sizeof(struct ionic_rxq_sg_desc),
@@ -722,6 +749,8 @@ ionic_rx_qcq_alloc(struct ionic_lif *lif, uint32_t socket_id, uint32_t index,return err; rxq->flags = flags; + rxq->seg_size = seg_size; + rxq->hdr_seg_size = hdr_seg_size; lif->rxqcqs[index] = rxq; *rxq_out = rxq;
@@ -749,6 +778,7 @@ ionic_tx_qcq_alloc(struct ionic_lif *lif, uint32_t socket_id, uint32_t index,"tx" , flags, ntxq_descs, +1 ,sizeof (struct ionic_txq_desc ),sizeof (struct ionic_txq_comp ), sizeof(struct ionic_txq_sg_desc_v1),
@@ -779,6 +809,7 @@ ionic_admin_qcq_alloc(struct ionic_lif *lif)"admin" , flags,IONIC_ADMINQ_LENGTH , +1 ,sizeof (struct ionic_admin_cmd ),sizeof (struct ionic_admin_comp ), 0,
@@ -805,6 +836,7 @@ ionic_notify_qcq_alloc(struct ionic_lif *lif)"notify" , flags,IONIC_NOTIFYQ_LENGTH , +1 ,sizeof (struct ionic_notifyq_cmd ),sizeof (union ionic_notifyq_comp ), 0,
drivers/net/ionic/ionic_lif.h +3 -1
@@ -81,6 +81,8 @@ struct ionic_rx_qcq {/* cacheline2 */ struct rte_mempool *mb_pool;uint16_t frame_size;/* Based on configured MTU */ +uint16_t hdr_seg_size;/* Length of first segment of RX chain */ +uint16_t seg_size;/* Length of all subsequent segments */ uint16_t flags;/* cacheline3 (inside stats) */
@@ -199,7 +201,7 @@ int ionic_dev_allmulticast_enable(struct rte_eth_dev *dev);int ionic_dev_allmulticast_disable (struct rte_eth_dev *dev);int ionic_rx_qcq_alloc (struct ionic_lif *lif,uint32_t socket_id, -uint32_t index,uint16_t nrxq_descs, +uint32_t index,uint16_t nrxq_descs,struct rte_mempool *mp,struct ionic_rx_qcq **qcq_out); int ionic_tx_qcq_alloc(struct ionic_lif *lif, uint32_t socket_id, uint32_t index, uint16_t ntxq_descs,
drivers/net/ionic/ionic_rxtx.c +19 -27
118 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH 17/35 net/ionic: use a helper variable in packet Tx function
In reply to Andrew BoyerThis improves readability.
--- drivers/net/ionic/ionic_rxtx.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
drivers/net/ionic/ionic_rxtx.c +7 -4
@@ -560,6 +560,7 @@ ionic_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,struct ionic_tx_qcq *txq = tx_queue;struct ionic_queue *q = &txq->qcq.q;struct ionic_tx_stats *stats = &txq->stats; +struct rte_mbuf *mbuf;uint32_t next_q_head_idx;uint32_t bytes_tx =0 ;uint16_t nb_avail, nb_tx =0 ;
@@ -582,16 +583,18 @@ ionic_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,rte_prefetch0 (&q->info[next_q_head_idx]); } -if (tx_pkts[nb_tx]->ol_flags &RTE_MBUF_F_TX_TCP_SEG ) - err =ionic_tx_tso (txq, tx_pkts[nb_tx]); + mbuf = tx_pkts[nb_tx]; + +if (mbuf->ol_flags &RTE_MBUF_F_TX_TCP_SEG ) + err =ionic_tx_tso (txq, mbuf);else - err =ionic_tx (txq, tx_pkts[nb_tx]); + err =ionic_tx (txq, mbuf);if (err) { stats->drop += nb_pkts - nb_tx;break ; } - bytes_tx += tx_pkts[nb_tx]->pkt_len; + bytes_tx += mbuf->pkt_len; nb_tx++; }
Signature · 1 line
2.17.1
PATCH 17/35 net/ionic: use a helper variable in packet Tx function
In reply to Andrew BoyerThis improves readability.
--- drivers/net/ionic/ionic_rxtx.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
drivers/net/ionic/ionic_rxtx.c +7 -4
@@ -560,6 +560,7 @@ ionic_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,struct ionic_tx_qcq *txq = tx_queue;struct ionic_queue *q = &txq->qcq.q;struct ionic_tx_stats *stats = &txq->stats; +struct rte_mbuf *mbuf;uint32_t next_q_head_idx;uint32_t bytes_tx =0 ;uint16_t nb_avail, nb_tx =0 ;
@@ -582,16 +583,18 @@ ionic_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,rte_prefetch0 (&q->info[next_q_head_idx]); } -if (tx_pkts[nb_tx]->ol_flags &RTE_MBUF_F_TX_TCP_SEG ) - err =ionic_tx_tso (txq, tx_pkts[nb_tx]); + mbuf = tx_pkts[nb_tx]; + +if (mbuf->ol_flags &RTE_MBUF_F_TX_TCP_SEG ) + err =ionic_tx_tso (txq, mbuf);else - err =ionic_tx (txq, tx_pkts[nb_tx]); + err =ionic_tx (txq, mbuf);if (err) { stats->drop += nb_pkts - nb_tx;break ; } - bytes_tx += tx_pkts[nb_tx]->pkt_len; + bytes_tx += mbuf->pkt_len; nb_tx++; }
Signature · 1 line
2.17.1
PATCH 18/35 net/ionic: do one-time init of receive descriptors
In reply to Andrew BoyerThese fields don't need to be set in the hot path. This improves performance.
--- drivers/net/ionic/ionic_rxtx.c | 38 ++++++++++++++++++++++++++++++---- 1 file changed, 34 insertions(+), 4 deletions(-)
drivers/net/ionic/ionic_rxtx.c +34 -4
@@ -941,9 +941,6 @@ ionic_rx_fill(struct ionic_rx_qcq *rxq) desc = &desc_base[q->head_idx]; dma_addr =rte_cpu_to_le_64 (rte_mbuf_data_iova_default (rxm)); desc->addr = dma_addr; - desc->len = rxq->hdr_seg_size; - desc->opcode = (q->num_segs >1 ) ?IONIC_RXQ_DESC_OPCODE_SG : -IONIC_RXQ_DESC_OPCODE_SIMPLE ; rxm->next =NULL ; prev_rxm_seg = rxm;
@@ -963,7 +960,6 @@ ionic_rx_fill(struct ionic_rx_qcq *rxq) data_iova =rte_mbuf_data_iova (rxm_seg); dma_addr =rte_cpu_to_le_64 (data_iova); elem->addr = dma_addr; - elem->len = rxq->seg_size; elem++; rxm_seg->next =NULL ;
@@ -981,6 +977,38 @@ ionic_rx_fill(struct ionic_rx_qcq *rxq)return 0 ; } +/* +* Perform one-time initialization of descriptor fields +* which will not change for the life of the queue. +*/ +static void __rte_cold +ionic_rx_init_descriptors (struct ionic_rx_qcq *rxq) +{ +struct ionic_queue *q = &rxq->qcq.q; +struct ionic_rxq_desc *desc, *desc_base = q->base; +struct ionic_rxq_sg_desc *sg_desc, *sg_desc_base = q->sg_base; +uint32_t i, j; +uint8_t opcode; + + opcode = (q->num_segs >1 ) ? +IONIC_RXQ_DESC_OPCODE_SG :IONIC_RXQ_DESC_OPCODE_SIMPLE ; + +/* +* NB: Only the first segment needs to leave headroom (hdr_seg_size). +* Later segments (seg_size) do not. +*/ +for (i =0 ; i < q->num_descs; i++) { + desc = &desc_base[i]; + desc->len =rte_cpu_to_le_16 (rxq->hdr_seg_size); + desc->opcode = opcode; + + sg_desc = &sg_desc_base[i]; +for (j =0 ; j < q->num_segs -1u ; j++) + sg_desc->elems[j].len = +rte_cpu_to_le_16 (rxq->seg_size); + } +} +/* * Start Receive Units for specified queue. */
@@ -1010,6 +1038,8 @@ ionic_dev_rx_queue_start(struct rte_eth_dev *eth_dev, uint16_t rx_queue_id)IONIC_PRINT (DEBUG ,"Starting RX queue %u, %u descs, size %u segs %u" , rx_queue_id, q->num_descs, rxq->frame_size, q->num_segs); +ionic_rx_init_descriptors (rxq); + err =ionic_lif_rxq_init (rxq);if (err)return err;
Signature · 1 line
2.17.1
cover net/ionic: updates for 22.11 release
In reply to Andrew BoyerThis patch series provides features and performance improvements relevant for the upstream release of DPDK 22.11.
There are some bits (like struct ionic_dev_intf) only useful for drivers and device types which have not yet been upstreamed. All of the changes are confined to the ionic PMD.
---
v1:
* Rebased to avoid conflicts in release notes
* Added missing links to product briefs in patch 6
Andrew Boyer (35):
net/ionic: fix up endianness for Rx and Tx handling net/ionic: fix up endianness for RSS
net/ionic: fix to set the adapter name for logging net/ionic: fix up the Rx filter save API net/ionic: fix up reported error stats net/ionic: update documentation and copyrights net/ionic: update license terms to remove GPL net/ionic: update MTU calculations
net/ionic: simplify code by removing doorbell map helper net/ionic: remove unused identifiers
net/ionic: only allocate interrupts if required net/ionic: move PCI-specific code to a separate file net/ionic: only request notifyq interrupt if supported net/ionic: replace void pointer with actual type net/ionic: free all buffers during Rx queue stop net/ionic: precalculate segment lengths on receive side net/ionic: use a helper variable in packet Tx function net/ionic: do one-time init of receive descriptors net/ionic: overhaul receive side for performance net/ionic: overhaul transmit side for performance net/ionic: add support for mbuf fast free net/ionic: do bulk allocations of receive mbufs net/ionic: add a lookup table for packet type net/ionic: add a lookup table for checksum flags net/ionic: advertise supported packet types net/ionic: add Rx descriptor status functions net/ionic: add Tx descriptor status function net/ionic: add Q-in-CMB option controlled by devarg net/ionic: update array allocations to use calloc net/ionic: add alignment and socket info in allocations net/ionic: allow client to specify Tx free threshold net/ionic: add optimized handlers for non-scattered Rx/Tx net/ionic: use a helper variable for page size net/ionic: retry init commands up to five times net/ionic: add watchdogs to protect each queue type
MAINTAINERS | 4 +- doc/guides/nics/features/ionic.ini | 3 + doc/guides/nics/ionic.rst | 28 +- doc/guides/rel_notes/release_22_11.rst | 13 +- drivers/net/ionic/ionic.h | 27 +- drivers/net/ionic/ionic_dev.c | 79 +-- drivers/net/ionic/ionic_dev.h | 40 +- drivers/net/ionic/ionic_dev_pci.c | 274 ++++++++ drivers/net/ionic/ionic_ethdev.c | 254 +++---- drivers/net/ionic/ionic_ethdev.h | 15 +- drivers/net/ionic/ionic_if.h | 13 +- drivers/net/ionic/ionic_lif.c | 310 ++++++--- drivers/net/ionic/ionic_lif.h | 33 +- drivers/net/ionic/ionic_logs.h | 4 +- drivers/net/ionic/ionic_mac_api.c | 4 +- drivers/net/ionic/ionic_mac_api.h | 4 +- drivers/net/ionic/ionic_main.c | 32 +- drivers/net/ionic/ionic_osdep.h | 4 +- drivers/net/ionic/ionic_regs.h | 4 +- drivers/net/ionic/ionic_rx_filter.c | 9 +- drivers/net/ionic/ionic_rx_filter.h | 4 +- drivers/net/ionic/ionic_rxtx.c | 916 +++++++++---------------- drivers/net/ionic/ionic_rxtx.h | 56 +- drivers/net/ionic/ionic_rxtx_sg.c | 544 +++++++++++++++ drivers/net/ionic/ionic_rxtx_simple.c | 465 +++++++++++++ drivers/net/ionic/meson.build | 7 +- 26 files changed, 2155 insertions(+), 991 deletions(-) create mode 100644 drivers/net/ionic/ionic_dev_pci.c create mode 100644 drivers/net/ionic/ionic_rxtx_sg.c create mode 100644 drivers/net/ionic/ionic_rxtx_simple.c
Signature · 1 line
2.17.1
Quoted 45 lines · Andrew Boyer
This patch series provides features and performance improvements relevant for the upstream release of DPDK 22.11.
There are some bits (like struct
ionic_dev_intf) only useful for drivers and device types which have not yet been upstreamed. All of the changes are confined to the ionic PMD.Signed-off-by Andrew Boyer <[email protected]>Signed-off-by R Mohamed Shah <[email protected]>Signed-off-by Neel Patel <[email protected]>Signed-off-by Allen Hubbe <[email protected]>---
v1:
* Rebased to avoid conflicts in release notes
* Added missing links to product briefs in patch 6Andrew Boyer (35):
net/ionic: fix up endianness for Rx and Tx handling net/ionic: fix up endianness for RSS
net/ionic: fix to set the adapter name for logging net/ionic: fix up the Rx filter save API net/ionic: fix up reported error stats net/ionic: update documentation and copyrights net/ionic: update license terms to remove GPL net/ionic: update MTU calculations
net/ionic: simplify code by removing doorbell map helper net/ionic: remove unused identifiers
net/ionic: only allocate interrupts if required net/ionic: move PCI-specific code to a separate file net/ionic: only request notifyq interrupt if supported net/ionic: replace void pointer with actual type net/ionic: free all buffers during Rx queue stop net/ionic: precalculate segment lengths on receive side net/ionic: use a helper variable in packet Tx function net/ionic: do one-time init of receive descriptors net/ionic: overhaul receive side for performance net/ionic: overhaul transmit side for performance net/ionic: add support for mbuf fast free net/ionic: do bulk allocations of receive mbufs net/ionic: add a lookup table for packet type net/ionic: add a lookup table for checksum flags net/ionic: advertise supported packet types net/ionic: add Rx descriptor status functions net/ionic: add Tx descriptor status function
Quoted 9 lines
net/ionic: add Q-in-CMB option controlled by devarg net/ionic: update array allocations to use calloc net/ionic: add alignment and socket info in allocations net/ionic: allow client to specify Tx free threshold net/ionic: add optimized handlers for non-scattered Rx/Tx net/ionic: use a helper variable for page size net/ionic: retry init commands up to five times net/ionic: add watchdogs to protect each queue type
Hi Andrew,
I put some minor comments related to the copyright changes, rest looks good to me.
And in this version each patch looks like a new series in patchwork, not sure what caused it, but can you please be sure all patches in series sent by single 'git send-email' command, if it didn't done this way already. And please use '--in-reply-to' for next version:
https://doc.dpdk.org/guides/contributing/patches.html#sending-patches
Thanks,
ferruh
v2 cover net/ionic: updates for 22.11 release
In reply to Andrew BoyerThis patch series provides features and performance improvements relevant for the upstream release of DPDK 22.11.
There are some bits (like struct ionic_dev_intf) only useful for drivers and device types which have not yet been upstreamed. All of the changes are confined to the ionic PMD.
---
v1:
* Rebased to avoid conflicts in release notes
* Added missing links to product briefs in patch 6
v2:
* Split DSC-200 addition into its own patch
* Reverted driver ID string change
* Removed "All Rights Reserved" text
* Updated license on ionic.rst file
* Sorted our entry in maintainers file
* Sorted our entry in release notes
Andrew Boyer (36):
net/ionic: fix up endianness for Rx and Tx handling net/ionic: fix up endianness for RSS
net/ionic: fix to set the adapter name for logging net/ionic: fix up the Rx filter save API net/ionic: fix up reported error stats net/ionic: update documentation and copyrights net/ionic: update supported devices list net/ionic: update license terms to remove GPL net/ionic: update MTU calculations
net/ionic: simplify code by removing doorbell map helper net/ionic: remove unused identifiers
net/ionic: only allocate interrupts if required net/ionic: move PCI-specific code to a separate file net/ionic: only request notifyq interrupt if supported net/ionic: replace void pointer with actual type net/ionic: free all buffers during Rx queue stop net/ionic: precalculate segment lengths on receive side net/ionic: use a helper variable in packet Tx function net/ionic: do one-time init of receive descriptors net/ionic: overhaul receive side for performance net/ionic: overhaul transmit side for performance net/ionic: add support for mbuf fast free net/ionic: do bulk allocations of receive mbufs net/ionic: add a lookup table for packet type net/ionic: add a lookup table for checksum flags net/ionic: advertise supported packet types net/ionic: add Rx descriptor status functions net/ionic: add Tx descriptor status function net/ionic: add Q-in-CMB option controlled by devarg net/ionic: update array allocations to use calloc net/ionic: add alignment and socket info in allocations net/ionic: allow client to specify Tx free threshold net/ionic: add optimized handlers for non-scattered Rx/Tx net/ionic: use a helper variable for page size net/ionic: retry init commands up to five times net/ionic: add watchdogs to protect each queue type
MAINTAINERS | 12 +- doc/guides/nics/features/ionic.ini | 3 + doc/guides/nics/ionic.rst | 30 +- doc/guides/rel_notes/release_22_11.rst | 12 + drivers/net/ionic/ionic.h | 25 +- drivers/net/ionic/ionic_dev.c | 79 +-- drivers/net/ionic/ionic_dev.h | 40 +- drivers/net/ionic/ionic_dev_pci.c | 274 ++++++++ drivers/net/ionic/ionic_ethdev.c | 254 +++---- drivers/net/ionic/ionic_ethdev.h | 15 +- drivers/net/ionic/ionic_if.h | 13 +- drivers/net/ionic/ionic_lif.c | 310 ++++++--- drivers/net/ionic/ionic_lif.h | 33 +- drivers/net/ionic/ionic_logs.h | 4 +- drivers/net/ionic/ionic_mac_api.c | 4 +- drivers/net/ionic/ionic_mac_api.h | 4 +- drivers/net/ionic/ionic_main.c | 32 +- drivers/net/ionic/ionic_osdep.h | 4 +- drivers/net/ionic/ionic_regs.h | 4 +- drivers/net/ionic/ionic_rx_filter.c | 9 +- drivers/net/ionic/ionic_rx_filter.h | 4 +- drivers/net/ionic/ionic_rxtx.c | 916 +++++++++---------------- drivers/net/ionic/ionic_rxtx.h | 56 +- drivers/net/ionic/ionic_rxtx_sg.c | 544 +++++++++++++++ drivers/net/ionic/ionic_rxtx_simple.c | 465 +++++++++++++ drivers/net/ionic/meson.build | 7 +- 26 files changed, 2159 insertions(+), 994 deletions(-) create mode 100644 drivers/net/ionic/ionic_dev_pci.c create mode 100644 drivers/net/ionic/ionic_rxtx_sg.c create mode 100644 drivers/net/ionic/ionic_rxtx_simple.c
Signature · 1 line
2.17.1
Quoted 53 lines · Andrew Boyer
This patch series provides features and performance improvements relevant for the upstream release of DPDK 22.11.
There are some bits (like struct
ionic_dev_intf) only useful for drivers and device types which have not yet been upstreamed. All of the changes are confined to the ionic PMD.Signed-off-by Andrew Boyer <[email protected]>Signed-off-by R Mohamed Shah <[email protected]>Signed-off-by Neel Patel <[email protected]>Signed-off-by Allen Hubbe <[email protected]>---
v1:
* Rebased to avoid conflicts in release notes
* Added missing links to product briefs in patch 6
v2:
* Split DSC-200 addition into its own patch
* Reverted driver ID string change
* Removed "All Rights Reserved" text
* Updated license onionic.rstfile
* Sorted our entry in maintainers file
* Sorted our entry in release notesAndrew Boyer (36):
net/ionic: fix up endianness for Rx and Tx handling net/ionic: fix up endianness for RSS
net/ionic: fix to set the adapter name for logging net/ionic: fix up the Rx filter save API net/ionic: fix up reported error stats net/ionic: update documentation and copyrights net/ionic: update supported devices list net/ionic: update license terms to remove GPL net/ionic: update MTU calculations
net/ionic: simplify code by removing doorbell map helper net/ionic: remove unused identifiers
net/ionic: only allocate interrupts if required net/ionic: move PCI-specific code to a separate file net/ionic: only request notifyq interrupt if supported net/ionic: replace void pointer with actual type net/ionic: free all buffers during Rx queue stop net/ionic: precalculate segment lengths on receive side net/ionic: use a helper variable in packet Tx function net/ionic: do one-time init of receive descriptors net/ionic: overhaul receive side for performance net/ionic: overhaul transmit side for performance net/ionic: add support for mbuf fast free net/ionic: do bulk allocations of receive mbufs net/ionic: add a lookup table for packet type net/ionic: add a lookup table for checksum flags net/ionic: advertise supported packet types net/ionic: add Rx descriptor status functions net/ionic: add Tx descriptor status function
Quoted 9 lines
net/ionic: add Q-in-CMB option controlled by devarg net/ionic: update array allocations to use calloc net/ionic: add alignment and socket info in allocations net/ionic: allow client to specify Tx free threshold net/ionic: add optimized handlers for non-scattered Rx/Tx net/ionic: use a helper variable for page size net/ionic: retry init commands up to five times net/ionic: add watchdogs to protect each queue type
Series applied to dpdk-next-net/main, thanks.
PATCH v2 1/36 net/ionic: fix up endianness for Rx and Tx handling
In reply to Andrew BoyerThese fields all need to be LE when talking to the FW.
--- drivers/net/ionic/ionic_rxtx.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-)
drivers/net/ionic/ionic_rxtx.c +15 -12
@@ -300,18 +300,20 @@ ionic_tx_tso_post(struct ionic_queue *q, struct ionic_txq_desc *desc, bool start, bool done) { void **info; +uint64_t cmd;uint8_t flags =0 ; flags |= has_vlan ?IONIC_TXQ_DESC_FLAG_VLAN :0 ; flags |= encap ?IONIC_TXQ_DESC_FLAG_ENCAP :0 ; flags |= start ?IONIC_TXQ_DESC_FLAG_TSO_SOT :0 ; flags |= done ?IONIC_TXQ_DESC_FLAG_TSO_EOT :0 ; - desc->cmd =encode_txq_desc_cmd (IONIC_TXQ_DESC_OPCODE_TSO , + cmd =encode_txq_desc_cmd (IONIC_TXQ_DESC_OPCODE_TSO , flags, nsge, addr); - desc->len = len; - desc->vlan_tci = vlan_tci; - desc->hdr_len = hdrlen; - desc->mss = mss; + desc->cmd =rte_cpu_to_le_64 (cmd); + desc->len =rte_cpu_to_le_16 (len); + desc->vlan_tci =rte_cpu_to_le_16 (vlan_tci); + desc->hdr_len =rte_cpu_to_le_16 (hdrlen); + desc->mss =rte_cpu_to_le_16 (mss);if (done) { info =IONIC_INFO_PTR (q, q->head_idx);
@@ -423,7 +425,7 @@ ionic_tx_tso(struct ionic_tx_qcq *txq, struct rte_mbuf *txm) len =RTE_MIN (frag_left, left); frag_left -= len; elem->addr = next_addr; - elem->len = len; + elem->len =rte_cpu_to_le_16 (len); elem++; desc_nsge++; }else {
@@ -470,7 +472,7 @@ ionic_tx(struct ionic_tx_qcq *txq, struct rte_mbuf *txm)bool encap;bool has_vlan;uint64_t ol_flags = txm->ol_flags; -uint64_t addr; +uint64_t addr, cmd;uint8_t opcode =IONIC_TXQ_DESC_OPCODE_CSUM_NONE ;uint8_t flags =0 ;
@@ -505,9 +507,10 @@ ionic_tx(struct ionic_tx_qcq *txq, struct rte_mbuf *txm) addr =rte_cpu_to_le_64 (rte_mbuf_data_iova (txm)); - desc->cmd =encode_txq_desc_cmd (opcode, flags, txm->nb_segs -1 , addr); - desc->len = txm->data_len; - desc->vlan_tci = txm->vlan_tci; + cmd =encode_txq_desc_cmd (opcode, flags, txm->nb_segs -1 , addr); + desc->cmd =rte_cpu_to_le_64 (cmd); + desc->len =rte_cpu_to_le_16 (txm->data_len); + desc->vlan_tci =rte_cpu_to_le_16 (txm->vlan_tci); info[0 ] = txm;
@@ -515,7 +518,7 @@ ionic_tx(struct ionic_tx_qcq *txq, struct rte_mbuf *txm) txm_seg = txm->next;while (txm_seg !=NULL ) { - elem->len = txm_seg->data_len; + elem->len =rte_cpu_to_le_16 (txm_seg->data_len); elem->addr =rte_cpu_to_le_64 (rte_mbuf_data_iova (txm_seg)); elem++; txm_seg = txm_seg->next;
@@ -845,7 +848,7 @@ ionic_rx_clean(struct ionic_rx_qcq *rxq,/* Vlan Strip */ if (cq_desc->csum_flags &IONIC_RXQ_COMP_CSUM_F_VLAN ) { pkt_flags |=RTE_MBUF_F_RX_VLAN |RTE_MBUF_F_RX_VLAN_STRIPPED ; - rxm->vlan_tci = cq_desc->vlan_tci; + rxm->vlan_tci =rte_le_to_cpu_16 (cq_desc->vlan_tci); }/* Checksum */
Signature · 1 line
2.17.1
PATCH v2 2/36 net/ionic: fix up endianness for RSS
In reply to Andrew BoyerThis field needs to be LE when talking to the FW.
--- drivers/net/ionic/ionic_rxtx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ionic/ionic_rxtx.c +1 -1
@@ -843,7 +843,7 @@ ionic_rx_clean(struct ionic_rx_qcq *rxq,/* RSS */ pkt_flags |=RTE_MBUF_F_RX_RSS_HASH ; - rxm->hash.rss = cq_desc->rss_hash; + rxm->hash.rss =rte_le_to_cpu_32 (cq_desc->rss_hash);/* Vlan Strip */ if (cq_desc->csum_flags &IONIC_RXQ_COMP_CSUM_F_VLAN ) {
Signature · 1 line
2.17.1
PATCH v2 3/36 net/ionic: fix to set the adapter name for logging
In reply to Andrew BoyerOtherwise the log messages will be garbled.
--- drivers/net/ionic/ionic_dev.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/ionic/ionic_dev.c +4 -1
@@ -55,7 +55,10 @@ ionic_dev_setup(struct ionic_adapter *adapter)ioread8 (&idev->dev_info->fw_version[i]); adapter->fw_version[IONIC_DEVINFO_FWVERS_BUFLEN -1 ] ='\0' ; -IONIC_PRINT (DEBUG ,"Firmware version: %s" , adapter->fw_version); + adapter->name = adapter->pci_dev->device.name; + +IONIC_PRINT (DEBUG ,"%s firmware version: %s" , + adapter->name, adapter->fw_version);/* BAR1: doorbells */ bar++;
Signature · 1 line
2.17.1
PATCH v2 4/36 net/ionic: fix up the Rx filter save API
In reply to Andrew BoyerCheck the match variable after copying cmd info, or else there can be unexpected results.
--- drivers/net/ionic/ionic_rx_filter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ionic/ionic_rx_filter.c +1 -1
@@ -63,8 +63,8 @@ ionic_rx_filter_save(struct ionic_lif *lif, uint32_t flow_id, f->flow_id = flow_id; f->filter_id =rte_le_to_cpu_32 (ctx->comp.rx_filter_add.filter_id); f->rxq_index = rxq_index; - f->match =rte_le_to_cpu_16 (f->cmd.match);memcpy (&f->cmd, &ctx->cmd,sizeof (f->cmd)); + f->match =rte_le_to_cpu_16 (f->cmd.match);switch (f->match) {case IONIC_RX_FILTER_MATCH_VLAN :
Signature · 1 line
2.17.1
PATCH v2 5/36 net/ionic: fix up reported error stats
In reply to Andrew BoyerReport descriptor errors in ierrors instead of imissed. Don't report rx_queue_empty or rx_queue_disabled in imissed, since those packet errors are already included in the rx_*_drop_packets counters.
This makes the reported stats correct.
--- drivers/net/ionic/ionic_lif.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/ionic/ionic_lif.c +2 -4
@@ -132,7 +132,7 @@ ionic_lif_get_abs_stats(const struct ionic_lif *lif, struct rte_eth_stats *statsfor (i =0 ; i < lif->nrxqcqs; i++) {struct ionic_rx_stats *rx_stats = &lif->rxqcqs[i]->stats; - stats->imissed += + stats->ierrors += rx_stats->no_cb_arg + rx_stats->bad_cq_status + rx_stats->no_room +
@@ -144,10 +144,8 @@ ionic_lif_get_abs_stats(const struct ionic_lif *lif, struct rte_eth_stats *stats ls->rx_mcast_drop_packets + ls->rx_bcast_drop_packets; - stats->imissed += - ls->rx_queue_empty + + stats->ierrors += ls->rx_dma_error + - ls->rx_queue_disabled + ls->rx_desc_fetch_error + ls->rx_desc_data_error;
Signature · 1 line
2.17.1
PATCH v2 6/36 net/ionic: update documentation and copyrights
In reply to Andrew BoyerPensando Systems has been acquired by AMD.
Update all copyright strings and email addresses.
--- MAINTAINERS | 12 ++++++------ doc/guides/nics/ionic.rst | 15 +++++++-------- doc/guides/rel_notes/release_22_11.rst | 6 ++++++ drivers/net/ionic/ionic.h | 4 ++-- drivers/net/ionic/ionic_dev.c | 2 +- drivers/net/ionic/ionic_dev.h | 2 +- drivers/net/ionic/ionic_ethdev.c | 2 +- drivers/net/ionic/ionic_ethdev.h | 2 +- drivers/net/ionic/ionic_if.h | 2 +- drivers/net/ionic/ionic_lif.c | 2 +- drivers/net/ionic/ionic_lif.h | 2 +- drivers/net/ionic/ionic_logs.h | 2 +- drivers/net/ionic/ionic_mac_api.c | 2 +- drivers/net/ionic/ionic_mac_api.h | 2 +- drivers/net/ionic/ionic_main.c | 2 +- drivers/net/ionic/ionic_osdep.h | 2 +- drivers/net/ionic/ionic_regs.h | 2 +- drivers/net/ionic/ionic_rx_filter.c | 2 +- drivers/net/ionic/ionic_rx_filter.h | 2 +- drivers/net/ionic/ionic_rxtx.c | 2 +- drivers/net/ionic/ionic_rxtx.h | 2 +- drivers/net/ionic/meson.build | 2 +- 22 files changed, 39 insertions(+), 34 deletions(-)
MAINTAINERS +6 -6
@@ -630,6 +630,12 @@ F: drivers/net/axgbe/ F: doc/guides/nics/axgbe.rst F: doc/guides/nics/features/axgbe.ini +AMD Pensando ionic +M: Andrew Boyer <[email protected]> +F: drivers/net/ionic/ +F: doc/guides/nics/ionic.rst +F: doc/guides/nics/features/ionic.ini + Marvell/Aquantia atlantic M: Igor Russkikh <[email protected]> T: git://dpdk.org/next/dpdk-next-net-mrvl
@@ -895,12 +901,6 @@ F: doc/guides/nics/pfe.rst F: drivers/net/pfe/ F: doc/guides/nics/features/pfe.ini -Pensando ionic -M: Andrew Boyer <[email protected]> -F: drivers/net/ionic/ -F: doc/guides/nics/ionic.rst -F: doc/guides/nics/features/ionic.ini - Marvell QLogic bnx2x M: Rasesh Mody <[email protected]> M: Shahed Shaikh <[email protected]>
doc/guides/nics/ionic.rst +7 -8
@@ -1,22 +1,21 @@ .. SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) - Copyright(c) 2018-2020 Pensando Systems, Inc. All rights reserved. + Copyright 2018-2022 Advanced Micro Devices, Inc. IONIC Driver ============ -The ionic driver provides support for Pensando server adapters. +The ionic driver provides support for AMD Pensando server adapters. It currently supports the below models: -- DSC-25 dual-port 25G Distributed Services Card `(pdf) <https://pensando.io/wp-content/uploads/2020/03/Pensando-DSC-25-Product-Brief.pdf>`__ -- DSC-100 dual-port 100G Distributed Services Card `(pdf) <https://pensando.io/wp-content/uploads/2020/03/Pensando-DSC-100-Product-Brief.pdf>`__ +- DSC-25 dual-port 25G Distributed Services Card `(pdf) <https://pensandoio.secure.force.com/DownloadFile?id=a0L4T000004IKurUAG>`__ +- DSC-100 dual-port 100G Distributed Services Card `(pdf) <https://pensandoio.secure.force.com/DownloadFile?id=a0L4T000004IKuwUAG>`__ -Please visit the Pensando web site at https://pensando.io for more information. -The `Documents <https://pensando.io/documents/>`_ page contains Product Briefs and other product information. +Please visit the AMD Pensando web site at https://www.amd.com/en/accelerators/pensando for more information. Identifying the Adapter ----------------------- -To determine if one or more Pensando DSC Ethernet devices are installed +To determine if one or more AMD Pensando DSC Ethernet devices are installed on the host, check for the PCI devices: .. code-block:: console
@@ -30,7 +29,7 @@ Firmware Support The ionic PMD requires firmware which supports 16 segment transmit SGLs. This support was added prior to version 1.0. For help upgrading older versions, -please contact Pensando support. +please contact AMD Pensando support. Building DPDK -------------
doc/guides/rel_notes/release_22_11.rst +6 -0
@@ -140,6 +140,12 @@ New Features * Made compatible with libbpf v0.8.0 (when used with libxdp). +* **Updated AMD Pensando ionic driver.** + + Updated the ionic PMD with new features and improvements, including: + + * Updated to reflect that Pensando has been acquired by AMD. + * **Updated Intel iavf driver.** * Added flow subscription support.
drivers/net/ionic/ionic.h +2 -2
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) -* Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved. +* Copyright 2018-2022 Advanced Micro Devices, Inc. */ #ifndef _IONIC_H_
@@ -15,7 +15,7 @@#include "ionic_osdep.h" #define IONIC_DRV_NAME "ionic" -#define IONIC_DRV_DESCRIPTION "Pensando Ethernet NIC Driver" +#define IONIC_DRV_DESCRIPTION "AMD Pensando Ethernet NIC Driver"#define IONIC_DRV_VERSION "0.11.0-49"/* Vendor ID */
drivers/net/ionic/ionic_dev.c +1 -1
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) -* Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved. +* Copyright 2018-2022 Advanced Micro Devices, Inc. */ #include <stdbool.h>
drivers/net/ionic/ionic_dev.h +1 -1
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) -* Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved. +* Copyright 2018-2022 Advanced Micro Devices, Inc. */ #ifndef _IONIC_DEV_H_
drivers/net/ionic/ionic_ethdev.c +1 -1
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) -* Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved. +* Copyright 2018-2022 Advanced Micro Devices, Inc. */ #include <rte_pci.h>
drivers/net/ionic/ionic_ethdev.h +1 -1
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) -* Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved. +* Copyright 2018-2022 Advanced Micro Devices, Inc. */ #ifndef _IONIC_ETHDEV_H_
drivers/net/ionic/ionic_if.h +1 -1
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB OR BSD-3-Clause */ -/* Copyright (c) 2017-2020 Pensando Systems, Inc. All rights reserved. */ +/* Copyright 2017-2022 Advanced Micro Devices, Inc. */ #ifndef _IONIC_IF_H_#define _IONIC_IF_H_
drivers/net/ionic/ionic_lif.c +1 -1
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) -* Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved. +* Copyright 2018-2022 Advanced Micro Devices, Inc. */ #include <rte_malloc.h>
drivers/net/ionic/ionic_lif.h +1 -1
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) -* Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved. +* Copyright 2018-2022 Advanced Micro Devices, Inc. */ #ifndef _IONIC_LIF_H_
drivers/net/ionic/ionic_logs.h +1 -1
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) -* Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved. +* Copyright 2018-2022 Advanced Micro Devices, Inc. */ #ifndef _IONIC_LOGS_H_
drivers/net/ionic/ionic_mac_api.c +1 -1
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) -* Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved. +* Copyright 2018-2022 Advanced Micro Devices, Inc. */ #include <stdbool.h>
drivers/net/ionic/ionic_mac_api.h +1 -1
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) -* Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved. +* Copyright 2018-2022 Advanced Micro Devices, Inc. */ #ifndef _IONIC_API_H_
drivers/net/ionic/ionic_main.c +1 -1
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) -* Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved. +* Copyright 2018-2022 Advanced Micro Devices, Inc. */ #include <stdbool.h>
drivers/net/ionic/ionic_osdep.h +1 -1
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) -* Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved. +* Copyright 2018-2022 Advanced Micro Devices, Inc. */ #ifndef _IONIC_OSDEP_
drivers/net/ionic/ionic_regs.h +1 -1
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) -* Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved. +* Copyright 2018-2022 Advanced Micro Devices, Inc. */ #ifndef _IONIC_REGS_H_
drivers/net/ionic/ionic_rx_filter.c +1 -1
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) -* Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved. +* Copyright 2018-2022 Advanced Micro Devices, Inc. */ #include <errno.h>
drivers/net/ionic/ionic_rx_filter.h +1 -1
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) -* Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved. +* Copyright 2018-2022 Advanced Micro Devices, Inc. */ #ifndef _IONIC_RX_FILTER_H_
drivers/net/ionic/ionic_rxtx.c +1 -1
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) -* Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved. +* Copyright 2018-2022 Advanced Micro Devices, Inc. */ #include <sys/queue.h>
drivers/net/ionic/ionic_rxtx.h +1 -1
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) -* Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved. +* Copyright 2018-2022 Advanced Micro Devices, Inc. */ #ifndef _IONIC_RXTX_H_
drivers/net/ionic/meson.build +1 -1
@@ -1,5 +1,5 @@ # SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) -# Copyright(c) 2019 Pensando +# Copyright 2019-2022 Advanced Micro Devices, Inc. if is_windows build = false
Signature · 1 line
2.17.1
PATCH v2 7/36 net/ionic: update supported devices list
In reply to Andrew BoyerAdd listed support for the DSC-200.
--- doc/guides/nics/ionic.rst | 1 + 1 file changed, 1 insertion(+)
doc/guides/nics/ionic.rst +1 -0
@@ -9,6 +9,7 @@ It currently supports the below models: - DSC-25 dual-port 25G Distributed Services Card `(pdf) <https://pensandoio.secure.force.com/DownloadFile?id=a0L4T000004IKurUAG>`__ - DSC-100 dual-port 100G Distributed Services Card `(pdf) <https://pensandoio.secure.force.com/DownloadFile?id=a0L4T000004IKuwUAG>`__ +- DSC-200 dual-port 200G Distributed Services Card `(pdf) <https://www.amd.com/system/files/documents/pensando-dsc-200-product-brief.pdf>`__ Please visit the AMD Pensando web site at https://www.amd.com/en/accelerators/pensando for more information.
Signature · 1 line
2.17.1
PATCH v2 8/36 net/ionic: update license terms to remove GPL
In reply to Andrew BoyerRemove GPL2 and leave only BSD-3-Clause. This is more in line with the norms of the DPDK community.
--- doc/guides/nics/ionic.rst | 2 +- drivers/net/ionic/ionic.h | 2 +- drivers/net/ionic/ionic_dev.c | 2 +- drivers/net/ionic/ionic_dev.h | 2 +- drivers/net/ionic/ionic_ethdev.c | 2 +- drivers/net/ionic/ionic_ethdev.h | 2 +- drivers/net/ionic/ionic_if.h | 5 +++-- drivers/net/ionic/ionic_lif.c | 2 +- drivers/net/ionic/ionic_lif.h | 2 +- drivers/net/ionic/ionic_logs.h | 2 +- drivers/net/ionic/ionic_mac_api.c | 2 +- drivers/net/ionic/ionic_mac_api.h | 2 +- drivers/net/ionic/ionic_main.c | 2 +- drivers/net/ionic/ionic_osdep.h | 2 +- drivers/net/ionic/ionic_regs.h | 2 +- drivers/net/ionic/ionic_rx_filter.c | 2 +- drivers/net/ionic/ionic_rx_filter.h | 2 +- drivers/net/ionic/ionic_rxtx.c | 2 +- drivers/net/ionic/ionic_rxtx.h | 2 +- drivers/net/ionic/meson.build | 2 +- 20 files changed, 22 insertions(+), 21 deletions(-)
doc/guides/nics/ionic.rst +1 -1
@@ -1,4 +1,4 @@ -.. SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) +.. SPDX-License-Identifier: BSD-3-Clause Copyright 2018-2022 Advanced Micro Devices, Inc. IONIC Driver
drivers/net/ionic/ionic.h +1 -1
@@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) +/* SPDX-License-Identifier: BSD-3-Clause * Copyright 2018-2022 Advanced Micro Devices, Inc. */
drivers/net/ionic/ionic_dev.c +1 -1
@@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) +/* SPDX-License-Identifier: BSD-3-Clause * Copyright 2018-2022 Advanced Micro Devices, Inc. */
drivers/net/ionic/ionic_dev.h +1 -1
@@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) +/* SPDX-License-Identifier: BSD-3-Clause * Copyright 2018-2022 Advanced Micro Devices, Inc. */
drivers/net/ionic/ionic_ethdev.c +1 -1
@@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) +/* SPDX-License-Identifier: BSD-3-Clause * Copyright 2018-2022 Advanced Micro Devices, Inc. */
drivers/net/ionic/ionic_ethdev.h +1 -1
@@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) +/* SPDX-License-Identifier: BSD-3-Clause * Copyright 2018-2022 Advanced Micro Devices, Inc. */
drivers/net/ionic/ionic_if.h +3 -2
@@ -1,5 +1,6 @@ -/* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB OR BSD-3-Clause */ -/* Copyright 2017-2022 Advanced Micro Devices, Inc. */ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright 2017-2022 Advanced Micro Devices, Inc. +*/ #ifndef _IONIC_IF_H_#define _IONIC_IF_H_
drivers/net/ionic/ionic_lif.c +1 -1
@@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) +/* SPDX-License-Identifier: BSD-3-Clause * Copyright 2018-2022 Advanced Micro Devices, Inc. */
drivers/net/ionic/ionic_lif.h +1 -1
@@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) +/* SPDX-License-Identifier: BSD-3-Clause * Copyright 2018-2022 Advanced Micro Devices, Inc. */
drivers/net/ionic/ionic_logs.h +1 -1
@@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) +/* SPDX-License-Identifier: BSD-3-Clause * Copyright 2018-2022 Advanced Micro Devices, Inc. */
drivers/net/ionic/ionic_mac_api.c +1 -1
@@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) +/* SPDX-License-Identifier: BSD-3-Clause * Copyright 2018-2022 Advanced Micro Devices, Inc. */
drivers/net/ionic/ionic_mac_api.h +1 -1
@@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) +/* SPDX-License-Identifier: BSD-3-Clause * Copyright 2018-2022 Advanced Micro Devices, Inc. */
drivers/net/ionic/ionic_main.c +1 -1
@@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) +/* SPDX-License-Identifier: BSD-3-Clause * Copyright 2018-2022 Advanced Micro Devices, Inc. */
drivers/net/ionic/ionic_osdep.h +1 -1
@@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) +/* SPDX-License-Identifier: BSD-3-Clause * Copyright 2018-2022 Advanced Micro Devices, Inc. */
drivers/net/ionic/ionic_regs.h +1 -1
@@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) +/* SPDX-License-Identifier: BSD-3-Clause * Copyright 2018-2022 Advanced Micro Devices, Inc. */
drivers/net/ionic/ionic_rx_filter.c +1 -1
@@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) +/* SPDX-License-Identifier: BSD-3-Clause * Copyright 2018-2022 Advanced Micro Devices, Inc. */
drivers/net/ionic/ionic_rx_filter.h +1 -1
@@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) +/* SPDX-License-Identifier: BSD-3-Clause * Copyright 2018-2022 Advanced Micro Devices, Inc. */
drivers/net/ionic/ionic_rxtx.c +1 -1
@@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) +/* SPDX-License-Identifier: BSD-3-Clause * Copyright 2018-2022 Advanced Micro Devices, Inc. */
drivers/net/ionic/ionic_rxtx.h +1 -1
@@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) +/* SPDX-License-Identifier: BSD-3-Clause * Copyright 2018-2022 Advanced Micro Devices, Inc. */
drivers/net/ionic/meson.build +1 -1
@@ -1,4 +1,4 @@ -# SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) +# SPDX-License-Identifier: BSD-3-Clause # Copyright 2019-2022 Advanced Micro Devices, Inc. if is_windows
Signature · 1 line
2.17.1
PATCH v2 9/36 net/ionic: update MTU calculations
In reply to Andrew BoyerTest min and max MTU against values read from firmware, for correctness. Update the firmware field name, for clarity.
The device must be stopped before changing MTU, for correctness. Store the calculated frame size in the queue, for performance.
--- drivers/net/ionic/ionic_dev.h | 5 +++- drivers/net/ionic/ionic_ethdev.c | 40 +++++++++++++++++++++----------- drivers/net/ionic/ionic_if.h | 8 +++---- drivers/net/ionic/ionic_lif.c | 10 +++----- drivers/net/ionic/ionic_lif.h | 4 +++- drivers/net/ionic/ionic_rxtx.c | 26 +++++++++------------ 6 files changed, 51 insertions(+), 42 deletions(-)
drivers/net/ionic/ionic_dev.h +4 -1
@@ -11,8 +11,11 @@#include "ionic_if.h" #include "ionic_regs.h" +#define VLAN_TAG_SIZE 4 +#define IONIC_MIN_MTU RTE_ETHER_MIN_MTU -#define IONIC_MAX_MTU 9194 +#define IONIC_MAX_MTU 9378 +#define IONIC_ETH_OVERHEAD (RTE_ETHER_HDR_LEN + VLAN_TAG_SIZE)#define IONIC_MAX_RING_DESC 32768#define IONIC_MIN_RING_DESC 16
drivers/net/ionic/ionic_ethdev.c +26 -14
@@ -343,18 +343,17 @@ static int ionic_dev_mtu_set(struct rte_eth_dev *eth_dev, uint16_t mtu) {struct ionic_lif *lif =IONIC_ETH_DEV_TO_LIF (eth_dev); -int err; -IONIC_PRINT_CALL (); +if (lif->state &IONIC_LIF_F_UP ) { +IONIC_PRINT (ERR ,"Stop %s before setting mtu" , lif->name); +return -EBUSY ; + } -/* -* Note: mtu check against IONIC_MIN_MTU, IONIC_MAX_MTU -* is done by the API. -*/ +/* Note: mtu check against min/max is done by the API */ +IONIC_PRINT (INFO ,"Setting mtu %u" , mtu); - err =ionic_lif_change_mtu (lif, mtu); -if (err) -return err; +/* Update the frame size used by the Rx path */ + lif->frame_size = mtu +IONIC_ETH_OVERHEAD ;return 0 ; }
@@ -376,12 +375,16 @@ ionic_dev_info_get(struct rte_eth_dev *eth_dev,rte_le_to_cpu_32 (cfg->queue_count[IONIC_QTYPE_TXQ ]);/* Also add ETHER_CRC_LEN if the adapter is able to keep CRC */ - dev_info->min_rx_bufsize =IONIC_MIN_MTU +RTE_ETHER_HDR_LEN ; - dev_info->max_rx_pktlen =IONIC_MAX_MTU +RTE_ETHER_HDR_LEN ; - dev_info->max_mac_addrs = adapter->max_mac_addrs; - dev_info->min_mtu =IONIC_MIN_MTU ; - dev_info->max_mtu =IONIC_MAX_MTU ; + dev_info->min_mtu =RTE_MAX ((uint32_t )IONIC_MIN_MTU , +rte_le_to_cpu_32 (ident->lif.eth.min_mtu)); + dev_info->max_mtu =RTE_MIN ((uint32_t )IONIC_MAX_MTU , +rte_le_to_cpu_32 (ident->lif.eth.max_mtu)); + dev_info->min_rx_bufsize = dev_info->min_mtu +IONIC_ETH_OVERHEAD ; + dev_info->max_rx_pktlen = dev_info->max_mtu +IONIC_ETH_OVERHEAD ; + dev_info->max_lro_pkt_size = + eth_dev->data->dev_conf.rxmode.max_lro_pkt_size; + dev_info->max_mac_addrs = adapter->max_mac_addrs; dev_info->hash_key_size =IONIC_RSS_HASH_KEY_SIZE ; dev_info->reta_size =rte_le_to_cpu_16 (ident->lif.eth.rss_ind_tbl_sz); dev_info->flow_type_rss_offloads =IONIC_ETH_RSS_OFFLOAD_ALL ;
@@ -889,6 +892,15 @@ ionic_dev_start(struct rte_eth_dev *eth_dev)if (dev_conf->lpbk_mode)IONIC_PRINT (WARNING ,"Loopback mode not supported" ); + lif->frame_size = eth_dev->data->mtu +IONIC_ETH_OVERHEAD ; + + err =ionic_lif_change_mtu (lif, eth_dev->data->mtu); +if (err) { +IONIC_PRINT (ERR ,"Cannot set LIF frame size %u: %d" , + lif->frame_size, err); +return err; + } + err =ionic_lif_start (lif);if (err) {IONIC_PRINT (ERR ,"Cannot start LIF: %d" , err);
drivers/net/ionic/ionic_if.h +4 -4
@@ -401,8 +401,8 @@ union ionic_lif_config {* @version: Ethernet identify structure version * @max_ucast_filters: Number of perfect unicast addresses supported * @max_mcast_filters: Number of perfect multicast addresses supported -* @min_frame_size: Minimum size of frames to be sent -* @max_frame_size: Maximum size of frames to be sent +* @min_mtu: Minimum MTU of frames to be sent +* @max_mtu: Maximum MTU of frames to be sent * @config: LIF config struct with features, mtu, mac, q counts * * @rdma: RDMA identify structure
@@ -434,8 +434,8 @@ union ionic_lif_identity {__le32 max_ucast_filters;__le32 max_mcast_filters;__le16 rss_ind_tbl_sz; -__le32 min_frame_size; -__le32 max_frame_size; +__le32 min_mtu; +__le32 max_mtu;u8 rsvd2[106 ];union ionic_lif_config config; }__rte_packed eth;
drivers/net/ionic/ionic_lif.c +3 -7
@@ -536,7 +536,7 @@ ionic_dev_allmulticast_disable(struct rte_eth_dev *eth_dev) }int -ionic_lif_change_mtu (struct ionic_lif *lif,int new_mtu) +ionic_lif_change_mtu (struct ionic_lif *lif,uint32_t new_mtu) {struct ionic_admin_ctx ctx = { .pending_work = true,
@@ -546,13 +546,8 @@ ionic_lif_change_mtu(struct ionic_lif *lif, int new_mtu) .mtu = rte_cpu_to_le_32(new_mtu), }, }; -int err; - - err =ionic_adminq_post_wait (lif, &ctx); -if (err) -return err; -return 0 ; +return ionic_adminq_post_wait (lif, &ctx); }int
@@ -730,6 +725,7 @@ ionic_rx_qcq_alloc(struct ionic_lif *lif, uint32_t socket_id, uint32_t index,int err; flags =IONIC_QCQ_F_SG ; + err = ionic_qcq_alloc(lif, IONIC_QTYPE_RXQ, sizeof(struct ionic_rx_qcq),
drivers/net/ionic/ionic_lif.h +3 -1
@@ -81,6 +81,7 @@ struct ionic_rx_qcq {/* cacheline2 */ struct rte_mempool *mb_pool; +uint16_t frame_size;/* Based on configured MTU */ uint16_t flags;/* cacheline3 (inside stats) */
@@ -123,6 +124,7 @@ struct ionic_lif {struct ionic_adapter *adapter;struct rte_eth_dev *eth_dev;uint16_t port_id;/**< Device port identifier */ +uint16_t frame_size;uint32_t hw_index;uint32_t state;uint32_t ntxqcqs;
@@ -181,7 +183,7 @@ int ionic_intr_alloc(struct ionic_lif *lif, struct ionic_intr_info *intr);int ionic_qcq_service (struct ionic_qcq *qcq,int budget,ionic_cq_cb cb,void *cb_arg); -int ionic_lif_change_mtu (struct ionic_lif *lif,int new_mtu); +int ionic_lif_change_mtu (struct ionic_lif *lif,uint32_t new_mtu); int ionic_dev_add_mac(struct rte_eth_dev *eth_dev, struct rte_ether_addr *mac_addr,
drivers/net/ionic/ionic_rxtx.c +11 -15
@@ -772,8 +772,6 @@ ionic_rx_clean(struct ionic_rx_qcq *rxq,struct ionic_rxq_comp *cq_desc_base = cq->base;struct ionic_rxq_comp *cq_desc = &cq_desc_base[cq_desc_index];struct rte_mbuf *rxm, *rxm_seg; -uint32_t max_frame_size = - rxq->qcq.lif->eth_dev->data->mtu +RTE_ETHER_HDR_LEN ;uint64_t pkt_flags =0 ;uint32_t pkt_type;struct ionic_rx_stats *stats = &rxq->stats;
@@ -814,8 +812,7 @@ ionic_rx_clean(struct ionic_rx_qcq *rxq,return ; } -if (cq_desc->len > max_frame_size || - cq_desc->len ==0 ) { +if (cq_desc->len > rxq->frame_size || cq_desc->len ==0 ) { stats->bad_len++;ionic_rx_recycle (q, q_desc_index, rxm);return ;
@@ -936,7 +933,7 @@ ionic_rx_recycle(struct ionic_queue *q, uint32_t q_desc_index, } static __rte_always_inline int -ionic_rx_fill (struct ionic_rx_qcq *rxq,uint32_t len) +ionic_rx_fill (struct ionic_rx_qcq *rxq) {struct ionic_queue *q = &rxq->qcq.q;struct ionic_rxq_desc *desc, *desc_base = q->base;
@@ -961,7 +958,7 @@ ionic_rx_fill(struct ionic_rx_qcq *rxq, uint32_t len) info =IONIC_INFO_PTR (q, q->head_idx); - nsegs = (len + buf_size -1 ) / buf_size; + nsegs = (rxq->frame_size + buf_size -1 ) / buf_size; desc = &desc_base[q->head_idx]; dma_addr =rte_cpu_to_le_64 (rte_mbuf_data_iova_default (rxm));
@@ -996,9 +993,9 @@ ionic_rx_fill(struct ionic_rx_qcq *rxq, uint32_t len) prev_rxm_seg = rxm_seg; } -if (size < len) +if (size < rxq->frame_size)IONIC_PRINT (ERR ,"Rx SG size is not sufficient (%d < %d)" , - size, len); + size, rxq->frame_size); info[0 ] = rxm;
@@ -1016,7 +1013,6 @@ ionic_rx_fill(struct ionic_rx_qcq *rxq, uint32_t len) int __rte_coldionic_dev_rx_queue_start (struct rte_eth_dev *eth_dev,uint16_t rx_queue_id) { -uint32_t frame_size = eth_dev->data->mtu +RTE_ETHER_HDR_LEN ;uint8_t *rx_queue_state = eth_dev->data->rx_queue_state;struct ionic_rx_qcq *rxq;int err;
@@ -1029,8 +1025,10 @@ ionic_dev_rx_queue_start(struct rte_eth_dev *eth_dev, uint16_t rx_queue_id) rxq = eth_dev->data->rx_queues[rx_queue_id]; -IONIC_PRINT (DEBUG ,"Starting RX queue %u, %u descs (size: %u)" , - rx_queue_id, rxq->qcq.q.num_descs, frame_size); + rxq->frame_size = rxq->qcq.lif->frame_size -RTE_ETHER_CRC_LEN ; + +IONIC_PRINT (DEBUG ,"Starting RX queue %u, %u descs, size %u" , + rx_queue_id, rxq->qcq.q.num_descs, rxq->frame_size);if (!(rxq->flags &IONIC_QCQ_F_INITED )) { err =ionic_lif_rxq_init (rxq);
@@ -1041,7 +1039,7 @@ ionic_dev_rx_queue_start(struct rte_eth_dev *eth_dev, uint16_t rx_queue_id) }/* Allocate buffers for descriptor rings */ -if (ionic_rx_fill (rxq, frame_size) !=0 ) { +if (ionic_rx_fill (rxq) !=0 ) {IONIC_PRINT (ERR ,"Could not alloc mbuf for queue:%d" , rx_queue_id);return -1 ;
@@ -1129,8 +1127,6 @@ ionic_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) {struct ionic_rx_qcq *rxq = rx_queue; -uint32_t frame_size = - rxq->qcq.lif->eth_dev->data->mtu +RTE_ETHER_HDR_LEN ;struct ionic_rx_service service_cb_arg; service_cb_arg.rx_pkts = rx_pkts;
@@ -1139,7 +1135,7 @@ ionic_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,ionic_rxq_service (rxq, nb_pkts, &service_cb_arg); -ionic_rx_fill (rxq, frame_size); +ionic_rx_fill (rxq);return service_cb_arg.nb_rx; }
Signature · 1 line
2.17.1
PATCH v2 10/36 net/ionic: simplify code by removing doorbell map helper
In reply to Andrew BoyerThere is only one doorbell page in DPDK configurations, so no helper function is needed.
--- drivers/net/ionic/ionic_lif.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-)
drivers/net/ionic/ionic_lif.c +1 -12
@@ -846,17 +846,6 @@ ionic_notify_qcq_alloc(struct ionic_lif *lif)return 0 ; } -static void * -ionic_bus_map_dbpage (struct ionic_adapter *adapter,int page_num) -{ -char *vaddr = adapter->bars[IONIC_PCI_BAR_DBELL ].vaddr; - -if (adapter->num_bars <=IONIC_PCI_BAR_DBELL ) -return NULL ; - -return (void *)&vaddr[page_num <<PAGE_SHIFT ]; -} -static void ionic_lif_queue_identify (struct ionic_lif *lif) {
@@ -959,7 +948,7 @@ ionic_lif_alloc(struct ionic_lif *lif)rte_spinlock_init (&lif->adminq_lock);rte_spinlock_init (&lif->adminq_service_lock); - lif->kern_dbpage =ionic_bus_map_dbpage (adapter,0 ); + lif->kern_dbpage = adapter->idev.db_pages;if (!lif->kern_dbpage) {IONIC_PRINT (ERR ,"Cannot map dbpage, aborting" );return -ENOMEM ;
Signature · 1 line
2.17.1
PATCH v2 11/36 net/ionic: remove unused identifiers
In reply to Andrew BoyerThese bits are not used. Remove them to simplify the code. Fix the spacing on the IONIC_ALIGN #define.
--- drivers/net/ionic/ionic.h | 1 - drivers/net/ionic/ionic_dev.h | 4 +--- drivers/net/ionic/ionic_ethdev.h | 2 -- 3 files changed, 1 insertion(+), 6 deletions(-)
drivers/net/ionic/ionic.h +0 -1
@@ -62,7 +62,6 @@ struct ionic_adapter {bool link_up;char fw_version[IONIC_DEVINFO_FWVERS_BUFLEN ];struct rte_pci_device *pci_dev; -LIST_ENTRY (ionic_adapter) pci_adapters; };/** ionic_admin_ctx - Admin command context.
drivers/net/ionic/ionic_dev.h +1 -3
@@ -21,12 +21,10 @@#define IONIC_MIN_RING_DESC 16#define IONIC_DEF_TXRX_DESC 4096 -#define IONIC_LIFS_MAX 1024 -#define IONIC_DEVCMD_TIMEOUT 5/* devcmd_timeout */ #define IONIC_DEVCMD_CHECK_PERIOD_US 10/* devcmd status chk period */ -#define IONIC_ALIGN 4096 +#define IONIC_ALIGN 4096struct ionic_adapter ;
drivers/net/ionic/ionic_ethdev.h +0 -2
@@ -17,8 +17,6 @@#define IONIC_ETH_DEV_TO_LIF (eth_dev) ((struct ionic_lif *) \ (eth_dev)->data->dev_private) -#define IONIC_ETH_DEV_TO_ADAPTER (eth_dev) \ - (IONIC_ETH_DEV_TO_LIF(eth_dev)->adapter)int ionic_dev_link_update (struct rte_eth_dev *eth_dev,int wait_to_complete);
Signature · 1 line
2.17.1
PATCH v2 12/36 net/ionic: only allocate interrupts if required
In reply to Andrew BoyerThere is no need to allocate the interrupt vector list if datapath packet interrupts are not enabled.
This conserves resources.
--- drivers/net/ionic/ionic_ethdev.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
drivers/net/ionic/ionic_ethdev.c +7 -5
@@ -1082,14 +1082,16 @@ ionic_configure_intr(struct ionic_adapter *adapter)return -1 ; } -if (rte_intr_dp_is_en (intr_handle)) +if (rte_intr_dp_is_en (intr_handle)) {IONIC_PRINT (DEBUG ,"Packet I/O interrupt on datapath is enabled" ); -if (rte_intr_vec_list_alloc (intr_handle,"intr_vec" , adapter->nintrs)) { -IONIC_PRINT (ERR ,"Failed to allocate %u vectors" , - adapter->nintrs); -return -ENOMEM ; +if (rte_intr_vec_list_alloc (intr_handle,"intr_vec" , + adapter->nintrs)) { +IONIC_PRINT (ERR ,"Failed to allocate %u vectors" , + adapter->nintrs); +return -ENOMEM ; + } } err = rte_intr_callback_register(intr_handle,
Signature · 1 line
2.17.1
PATCH v2 13/36 net/ionic: move PCI-specific code to a separate file
In reply to Andrew BoyerFor future support of virtual devices, move the PCI code to its own file. Create a new device interface, struct ionic_dev_intf, to plug in to common code.
--- drivers/net/ionic/ionic.h | 13 +- drivers/net/ionic/ionic_dev.c | 62 --------- drivers/net/ionic/ionic_dev.h | 13 +- drivers/net/ionic/ionic_dev_pci.c | 216 ++++++++++++++++++++++++++++++ drivers/net/ionic/ionic_ethdev.c | 161 ++++++---------------- drivers/net/ionic/ionic_ethdev.h | 9 ++ drivers/net/ionic/ionic_main.c | 2 +- drivers/net/ionic/meson.build | 1 + 8 files changed, 286 insertions(+), 191 deletions(-) create mode 100644 drivers/net/ionic/ionic_dev_pci.c
drivers/net/ionic/ionic.h +8 -5
@@ -8,8 +8,6 @@#include <stdint.h> #include <inttypes.h> -#include <bus_pci_driver.h> -#include "ionic_dev.h" #include "ionic_if.h" #include "ionic_osdep.h"
@@ -42,6 +40,11 @@ struct ionic_hw {uint16_t vendor_id; }; +struct ionic_bars { +struct ionic_dev_bar bar[IONIC_BARS_MAX ]; +uint32_t num_bars; +}; +/* * Structure to store private data for each driver instance (for each adapter). */
@@ -49,10 +52,10 @@ struct ionic_adapter {struct ionic_hw hw;struct ionic_dev idev;const char *name; -struct ionic_dev_bar bars[IONIC_BARS_MAX ]; +struct ionic_bars bars; +const struct ionic_dev_intf *intf;struct ionic_identity ident;struct ionic_lif *lif; -uint32_t num_bars;uint32_t max_ntxqs_per_lif;uint32_t max_nrxqs_per_lif;uint32_t max_mac_addrs;
@@ -61,7 +64,7 @@ struct ionic_adapter {bool intrs[IONIC_INTR_CTRL_REGS_MAX ];bool link_up;char fw_version[IONIC_DEVINFO_FWVERS_BUFLEN ]; -struct rte_pci_device *pci_dev; +void *bus_dev; };/** ionic_admin_ctx - Admin command context.
drivers/net/ionic/ionic_dev.c +0 -62
68 lines not on this page · raw message
drivers/net/ionic/ionic_dev.h +11 -2
@@ -173,14 +173,23 @@ struct ionic_cq {struct ionic_lif ;struct ionic_adapter ;struct ionic_qcq ; +struct rte_mempool ; +struct rte_eth_dev ; + +struct ionic_dev_intf { +int (*setup)(struct ionic_adapter *adapter); +void (*copy_bus_info)(struct ionic_adapter *adapter, +struct rte_eth_dev *eth_dev); +int (*configure_intr)(struct ionic_adapter *adapter); +void (*unconfigure_intr)(struct ionic_adapter *adapter); +void (*unmap_bars)(struct ionic_adapter *adapter); +};void ionic_intr_init (struct ionic_dev *idev,struct ionic_intr_info *intr,unsigned long index);const char *ionic_opcode_to_str (enum ionic_cmd_opcode opcode); -int ionic_dev_setup (struct ionic_adapter *adapter); -void ionic_dev_cmd_go (struct ionic_dev *idev,union ionic_dev_cmd *cmd);uint8_t ionic_dev_cmd_status (struct ionic_dev *idev);bool ionic_dev_cmd_done (struct ionic_dev *idev);
drivers/net/ionic/ionic_dev_pci.c new file +216 -0
216 lines not on this page · raw message
drivers/net/ionic/ionic_ethdev.c +40 -121
274 lines not on this page · raw message
drivers/net/ionic/ionic_ethdev.h +9 -0
@@ -18,6 +18,15 @@#define IONIC_ETH_DEV_TO_LIF (eth_dev) ((struct ionic_lif *) \ (eth_dev)->data->dev_private) +struct ionic_bars ; +struct ionic_dev_intf ; + +int eth_ionic_dev_probe (void *bus_dev,struct rte_device *rte_dev, +struct ionic_bars *bars,const struct ionic_dev_intf *intf, +uint16_t device_id,uint16_t vendor_id); +int eth_ionic_dev_remove (struct rte_device *rte_dev); + +void ionic_dev_interrupt_handler (void *param);int ionic_dev_link_update (struct rte_eth_dev *eth_dev,int wait_to_complete);#endif /* _IONIC_ETHDEV_H_ */
drivers/net/ionic/ionic_main.c +1 -1
@@ -336,7 +336,7 @@ ionic_dev_cmd_wait_check(struct ionic_dev *idev, unsigned long max_wait)int ionic_setup (struct ionic_adapter *adapter) { -return ionic_dev_setup (adapter); +return (*adapter->intf->setup)(adapter); }int
drivers/net/ionic/meson.build +1 -0
@@ -9,6 +9,7 @@ endif sources = files( 'ionic_dev.c', + 'ionic_dev_pci.c', 'ionic_ethdev.c', 'ionic_lif.c', 'ionic_mac_api.c',
Signature · 1 line
2.17.1
PATCH v2 14/36 net/ionic: only request notifyq interrupt if supported
In reply to Andrew BoyerEnable the interrupt if the platform & device support it. This prevents spurious interrupts on virtual platforms.
--- drivers/net/ionic/ionic_lif.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
drivers/net/ionic/ionic_lif.c +9 -3
@@ -1350,6 +1350,7 @@ ionic_lif_notifyq_init(struct ionic_lif *lif)struct ionic_dev *idev = &lif->adapter->idev;struct ionic_notify_qcq *nqcq = lif->notifyqcq;struct ionic_queue *q = &nqcq->qcq.q; +uint16_t flags =IONIC_QINIT_F_ENA ;int err;struct ionic_admin_ctx ctx = {
@@ -1359,14 +1360,19 @@ ionic_lif_notifyq_init(struct ionic_lif *lif) .type = q->type, .ver = lif->qtype_info[q->type].version, .index = rte_cpu_to_le_32(q->index), - .intr_index = rte_cpu_to_le_16(nqcq->intr.index), - .flags = rte_cpu_to_le_16(IONIC_QINIT_F_IRQ | - IONIC_QINIT_F_ENA), + .intr_index = rte_cpu_to_le_16(IONIC_INTR_NONE), .ring_size = rte_log2_u32(q->num_descs), .ring_base = rte_cpu_to_le_64(q->base_pa), } }; +/* Only enable an interrupt if the device supports them */ +if (lif->adapter->intf->configure_intr !=NULL ) { + flags |=IONIC_QINIT_F_IRQ ; + ctx.cmd.q_init.intr_index =rte_cpu_to_le_16 (nqcq->intr.index); + } + ctx.cmd.q_init.flags =rte_cpu_to_le_16 (flags); +IONIC_PRINT (DEBUG ,"notifyq_init.index %d" , q->index);IONIC_PRINT (DEBUG ,"notifyq_init.ring_base 0x%" PRIx64"" , q->base_pa); IONIC_PRINT(DEBUG, "notifyq_init.ring_size %d",
Signature · 1 line
2.17.1
PATCH v2 15/36 net/ionic: replace void pointer with actual type
In reply to Andrew BoyerThis makes the code safer by helping the compiler catch errors. Rename the variables, too; they're not callbacks anymore.
--- drivers/net/ionic/ionic_rxtx.c | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-)
drivers/net/ionic/ionic_rxtx.c +13 -15
@@ -765,7 +765,7 @@ ionic_dev_rx_queue_setup(struct rte_eth_dev *eth_dev, static __rte_always_inline voidionic_rx_clean (struct ionic_rx_qcq *rxq,uint32_t q_desc_index,uint32_t cq_desc_index, -void *service_cb_arg) +struct ionic_rx_service *rx_svc) {struct ionic_queue *q = &rxq->qcq.q;struct ionic_cq *cq = &rxq->qcq.cq;
@@ -775,8 +775,6 @@ ionic_rx_clean(struct ionic_rx_qcq *rxq,uint64_t pkt_flags =0 ;uint32_t pkt_type;struct ionic_rx_stats *stats = &rxq->stats; -struct ionic_rx_service *recv_args = (struct ionic_rx_service *) - service_cb_arg;uint32_t buf_size = (uint16_t ) (rte_pktmbuf_data_room_size (rxq->mb_pool) -RTE_PKTMBUF_HEADROOM );
@@ -789,7 +787,7 @@ ionic_rx_clean(struct ionic_rx_qcq *rxq, rxm = info[0 ]; -if (!recv_args) { +if (!rx_svc) { stats->no_cb_arg++;/* Flush */ rte_pktmbuf_free (rxm);
@@ -806,7 +804,7 @@ ionic_rx_clean(struct ionic_rx_qcq *rxq,return ; } -if (recv_args->nb_rx >= recv_args->nb_pkts) { +if (rx_svc->nb_rx >= rx_svc->nb_pkts) { stats->no_room++;ionic_rx_recycle (q, q_desc_index, rxm);return ;
@@ -907,8 +905,8 @@ ionic_rx_clean(struct ionic_rx_qcq *rxq, rxm->packet_type = pkt_type; - recv_args->rx_pkts[recv_args->nb_rx] = rxm; - recv_args->nb_rx++; + rx_svc->rx_pkts[rx_svc->nb_rx] = rxm; + rx_svc->nb_rx++; stats->packets++; stats->bytes += rxm->pkt_len;
@@ -1052,7 +1050,7 @@ ionic_dev_rx_queue_start(struct rte_eth_dev *eth_dev, uint16_t rx_queue_id) static __rte_always_inline voidionic_rxq_service (struct ionic_rx_qcq *rxq,uint32_t work_to_do, -void *service_cb_arg) +struct ionic_rx_service *rx_svc) {struct ionic_cq *cq = &rxq->qcq.cq;struct ionic_queue *q = &rxq->qcq.q;
@@ -1088,7 +1086,7 @@ ionic_rxq_service(struct ionic_rx_qcq *rxq, uint32_t work_to_do,rte_prefetch0 (&q->info[q->tail_idx]);ionic_rx_clean (rxq, curr_q_tail_idx, curr_cq_tail_idx, - service_cb_arg); + rx_svc); }while (more);
@@ -1127,15 +1125,15 @@ ionic_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) {struct ionic_rx_qcq *rxq = rx_queue; -struct ionic_rx_service service_cb_arg; +struct ionic_rx_service rx_svc; - service_cb_arg.rx_pkts = rx_pkts; - service_cb_arg.nb_pkts = nb_pkts; - service_cb_arg.nb_rx =0 ; + rx_svc.rx_pkts = rx_pkts; + rx_svc.nb_pkts = nb_pkts; + rx_svc.nb_rx =0 ; -ionic_rxq_service (rxq, nb_pkts, &service_cb_arg); +ionic_rxq_service (rxq, nb_pkts, &rx_svc);ionic_rx_fill (rxq); -return service_cb_arg.nb_rx; +return rx_svc.nb_rx; }
Signature · 1 line
2.17.1
PATCH v2 16/36 net/ionic: free all buffers during Rx queue stop
In reply to Andrew BoyerFree all of the mbufs in the receive queue when the queue is stopped. This will allow them to be resized when the MTU is changed.
--- drivers/net/ionic/ionic_dev.c | 16 +++++ drivers/net/ionic/ionic_dev.h | 2 + drivers/net/ionic/ionic_lif.c | 32 ++++----- drivers/net/ionic/ionic_lif.h | 4 -- drivers/net/ionic/ionic_rxtx.c | 116 +++++++++++++++------------------ 5 files changed, 81 insertions(+), 89 deletions(-)
drivers/net/ionic/ionic_dev.c +16 -0
@@ -317,6 +317,15 @@ ionic_cq_init(struct ionic_cq *cq, uint16_t num_descs)return 0 ; } +void +ionic_cq_reset (struct ionic_cq *cq) +{ + cq->tail_idx =0 ; + cq->done_color =1 ; + +memset (cq->base,0 ,sizeof (struct ionic_nop_comp ) * cq->num_descs); +} +void ionic_cq_map (struct ionic_cq *cq,void *base,rte_iova_t base_pa) {
@@ -379,3 +388,10 @@ ionic_q_sg_map(struct ionic_queue *q, void *base, rte_iova_t base_pa) q->sg_base = base; q->sg_base_pa = base_pa; } + +void +ionic_q_reset (struct ionic_queue *q) +{ + q->head_idx =0 ; + q->tail_idx =0 ; +}
drivers/net/ionic/ionic_dev.h +2 -0
@@ -225,6 +225,7 @@ struct ionic_doorbell __iomem *ionic_db_map(struct ionic_lif *lif, struct ionic_queue *q);int ionic_cq_init (struct ionic_cq *cq,uint16_t num_descs); +void ionic_cq_reset (struct ionic_cq *cq);void ionic_cq_map (struct ionic_cq *cq,void *base,rte_iova_t base_pa);typedef bool (*ionic_cq_cb )(struct ionic_cq *cq,uint16_t cq_desc_index,void *cb_arg);
@@ -232,6 +233,7 @@ uint32_t ionic_cq_service(struct ionic_cq *cq, uint32_t work_to_do, ionic_cq_cb cb, void *cb_arg);int ionic_q_init (struct ionic_queue *q,uint32_t index,uint16_t num_descs); +void ionic_q_reset (struct ionic_queue *q);void ionic_q_map (struct ionic_queue *q,void *base,rte_iova_t base_pa);void ionic_q_sg_map (struct ionic_queue *q,void *base,rte_iova_t base_pa);
drivers/net/ionic/ionic_lif.c +11 -21
@@ -30,25 +30,7 @@ static const uint8_t ionic_qtype_vers[IONIC_QTYPE_MAX] = {static int ionic_lif_addr_add (struct ionic_lif *lif,const uint8_t *addr);static int ionic_lif_addr_del (struct ionic_lif *lif,const uint8_t *addr); -int -ionic_qcq_enable (struct ionic_qcq *qcq) -{ -struct ionic_queue *q = &qcq->q; -struct ionic_lif *lif = qcq->lif; -struct ionic_admin_ctx ctx = { - .pending_work = true, - .cmd.q_control = { - .opcode =IONIC_CMD_Q_CONTROL , - .type = q->type, - .index =rte_cpu_to_le_32 (q->index), - .oper =IONIC_Q_ENABLE , - }, - }; - -return ionic_adminq_post_wait (lif, &ctx); -} - -int +static int ionic_qcq_disable (struct ionic_qcq *qcq) {struct ionic_queue *q = &qcq->q;
@@ -133,7 +115,6 @@ ionic_lif_get_abs_stats(const struct ionic_lif *lif, struct rte_eth_stats *statsfor (i =0 ; i < lif->nrxqcqs; i++) {struct ionic_rx_stats *rx_stats = &lif->rxqcqs[i]->stats; stats->ierrors += - rx_stats->no_cb_arg + rx_stats->bad_cq_status + rx_stats->no_room + rx_stats->bad_len;
@@ -154,7 +135,6 @@ ionic_lif_get_abs_stats(const struct ionic_lif *lif, struct rte_eth_stats *stats stats->q_ipackets[i] = rx_stats->packets; stats->q_ibytes[i] = rx_stats->bytes; stats->q_errors[i] = - rx_stats->no_cb_arg + rx_stats->bad_cq_status + rx_stats->no_room + rx_stats->bad_len;
@@ -1146,12 +1126,16 @@ ionic_lif_rss_teardown(struct ionic_lif *lif)void ionic_lif_txq_deinit (struct ionic_tx_qcq *txq) { +ionic_qcq_disable (&txq->qcq); + txq->flags &= ~IONIC_QCQ_F_INITED ; }void ionic_lif_rxq_deinit (struct ionic_rx_qcq *rxq) { +ionic_qcq_disable (&rxq->qcq); + rxq->flags &= ~IONIC_QCQ_F_INITED ; }
@@ -1488,6 +1472,9 @@ ionic_lif_txq_init(struct ionic_tx_qcq *txq) ctx.cmd.q_init.ring_size);IONIC_PRINT (DEBUG ,"txq_init.ver %u" , ctx.cmd.q_init.ver); +ionic_q_reset (q); +ionic_cq_reset (cq); + err =ionic_adminq_post_wait (lif, &ctx);if (err)return err;
@@ -1536,6 +1523,9 @@ ionic_lif_rxq_init(struct ionic_rx_qcq *rxq) ctx.cmd.q_init.ring_size);IONIC_PRINT (DEBUG ,"rxq_init.ver %u" , ctx.cmd.q_init.ver); +ionic_q_reset (q); +ionic_cq_reset (cq); + err =ionic_adminq_post_wait (lif, &ctx);if (err)return err;
drivers/net/ionic/ionic_lif.h +0 -4
@@ -39,7 +39,6 @@ struct ionic_tx_stats {struct ionic_rx_stats {uint64_t packets;uint64_t bytes; -uint64_t no_cb_arg;uint64_t bad_cq_status;uint64_t no_room;uint64_t bad_len;
@@ -207,9 +206,6 @@ int ionic_tx_qcq_alloc(struct ionic_lif *lif, uint32_t socket_id, struct ionic_tx_qcq **qcq_out);void ionic_qcq_free (struct ionic_qcq *qcq); -int ionic_qcq_enable (struct ionic_qcq *qcq); -int ionic_qcq_disable (struct ionic_qcq *qcq); -int ionic_lif_rxq_init (struct ionic_rx_qcq *rxq);void ionic_lif_rxq_deinit (struct ionic_rx_qcq *rxq);
drivers/net/ionic/ionic_rxtx.c +52 -64
192 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH v2 17/36 net/ionic: precalculate segment lengths on receive side
In reply to Andrew BoyerThe first (header) segment includes the standard headroom. Subsequent segments do not.
Store the fragment counts in the queue structure.
Precalculating improves performance by reducing
how much work must be done in the hot path.
--- drivers/net/ionic/ionic_dev.h | 1 + drivers/net/ionic/ionic_lif.c | 36 ++++++++++++++++++++++++-- drivers/net/ionic/ionic_lif.h | 4 ++- drivers/net/ionic/ionic_rxtx.c | 46 ++++++++++++++-------------------- 4 files changed, 57 insertions(+), 30 deletions(-)
drivers/net/ionic/ionic_dev.h +1 -0
@@ -137,6 +137,7 @@ struct ionic_dev {struct ionic_queue {uint16_t num_descs; +uint16_t num_segs;uint16_t head_idx;uint16_t tail_idx;uint16_t size_mask;
drivers/net/ionic/ionic_lif.c +34 -2
@@ -566,6 +566,7 @@ ionic_qcq_alloc(struct ionic_lif *lif,const char *type_name, uint16_t flags, uint16_t num_descs, + uint16_t num_segs, uint16_t desc_size, uint16_t cq_desc_size, uint16_t sg_desc_size,
@@ -616,6 +617,7 @@ ionic_qcq_alloc(struct ionic_lif *lif, goto err_out_free_qcq; } + new->q.num_segs = num_segs; new->q.type = type; err =ionic_q_init (&new->q, index, num_descs);
@@ -698,14 +700,38 @@ ionic_qcq_free(struct ionic_qcq *qcq)int ionic_rx_qcq_alloc (struct ionic_lif *lif,uint32_t socket_id,uint32_t index, -uint16_t nrxq_descs,struct ionic_rx_qcq **rxq_out) +uint16_t nrxq_descs,struct rte_mempool *mb_pool, +struct ionic_rx_qcq **rxq_out) {struct ionic_rx_qcq *rxq; -uint16_t flags; +uint16_t flags, seg_size, hdr_seg_size, max_segs, max_segs_fw; +uint32_t max_mtu;int err; flags =IONIC_QCQ_F_SG ; + seg_size =rte_pktmbuf_data_room_size (mb_pool); + +/* The first mbuf needs to leave headroom */ + hdr_seg_size = seg_size -RTE_PKTMBUF_HEADROOM ; + + max_mtu =rte_le_to_cpu_32 (lif->adapter->ident.lif.eth.max_mtu); + + max_segs_fw =IONIC_RX_MAX_SG_ELEMS +1 ; + +/* +* Calculate how many fragment pointers might be stored in queue. +*/ + max_segs =1 + (max_mtu +RTE_PKTMBUF_HEADROOM -1 ) / seg_size; + +IONIC_PRINT (DEBUG ,"rxq %u frame_size %u seg_size %u max_segs %u" , + index, lif->frame_size, seg_size, max_segs); +if (max_segs > max_segs_fw) { +IONIC_PRINT (ERR ,"Rx mbuf size insufficient (%d > %d avail)" , + max_segs, max_segs_fw); +return -EINVAL ; + } + err = ionic_qcq_alloc(lif, IONIC_QTYPE_RXQ, sizeof(struct ionic_rx_qcq),
@@ -714,6 +740,7 @@ ionic_rx_qcq_alloc(struct ionic_lif *lif, uint32_t socket_id, uint32_t index,"rx" , flags, nrxq_descs, + max_segs,sizeof (struct ionic_rxq_desc ),sizeof (struct ionic_rxq_comp ), sizeof(struct ionic_rxq_sg_desc),
@@ -722,6 +749,8 @@ ionic_rx_qcq_alloc(struct ionic_lif *lif, uint32_t socket_id, uint32_t index,return err; rxq->flags = flags; + rxq->seg_size = seg_size; + rxq->hdr_seg_size = hdr_seg_size; lif->rxqcqs[index] = rxq; *rxq_out = rxq;
@@ -749,6 +778,7 @@ ionic_tx_qcq_alloc(struct ionic_lif *lif, uint32_t socket_id, uint32_t index,"tx" , flags, ntxq_descs, +1 ,sizeof (struct ionic_txq_desc ),sizeof (struct ionic_txq_comp ), sizeof(struct ionic_txq_sg_desc_v1),
@@ -779,6 +809,7 @@ ionic_admin_qcq_alloc(struct ionic_lif *lif)"admin" , flags,IONIC_ADMINQ_LENGTH , +1 ,sizeof (struct ionic_admin_cmd ),sizeof (struct ionic_admin_comp ), 0,
@@ -805,6 +836,7 @@ ionic_notify_qcq_alloc(struct ionic_lif *lif)"notify" , flags,IONIC_NOTIFYQ_LENGTH , +1 ,sizeof (struct ionic_notifyq_cmd ),sizeof (union ionic_notifyq_comp ), 0,
drivers/net/ionic/ionic_lif.h +3 -1
@@ -81,6 +81,8 @@ struct ionic_rx_qcq {/* cacheline2 */ struct rte_mempool *mb_pool;uint16_t frame_size;/* Based on configured MTU */ +uint16_t hdr_seg_size;/* Length of first segment of RX chain */ +uint16_t seg_size;/* Length of all subsequent segments */ uint16_t flags;/* cacheline3 (inside stats) */
@@ -199,7 +201,7 @@ int ionic_dev_allmulticast_enable(struct rte_eth_dev *dev);int ionic_dev_allmulticast_disable (struct rte_eth_dev *dev);int ionic_rx_qcq_alloc (struct ionic_lif *lif,uint32_t socket_id, -uint32_t index,uint16_t nrxq_descs, +uint32_t index,uint16_t nrxq_descs,struct rte_mempool *mp,struct ionic_rx_qcq **qcq_out); int ionic_tx_qcq_alloc(struct ionic_lif *lif, uint32_t socket_id, uint32_t index, uint16_t ntxq_descs,
drivers/net/ionic/ionic_rxtx.c +19 -27
118 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH v2 18/36 net/ionic: use a helper variable in packet Tx function
In reply to Andrew BoyerThis improves readability.
--- drivers/net/ionic/ionic_rxtx.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
drivers/net/ionic/ionic_rxtx.c +7 -4
@@ -560,6 +560,7 @@ ionic_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,struct ionic_tx_qcq *txq = tx_queue;struct ionic_queue *q = &txq->qcq.q;struct ionic_tx_stats *stats = &txq->stats; +struct rte_mbuf *mbuf;uint32_t next_q_head_idx;uint32_t bytes_tx =0 ;uint16_t nb_avail, nb_tx =0 ;
@@ -582,16 +583,18 @@ ionic_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,rte_prefetch0 (&q->info[next_q_head_idx]); } -if (tx_pkts[nb_tx]->ol_flags &RTE_MBUF_F_TX_TCP_SEG ) - err =ionic_tx_tso (txq, tx_pkts[nb_tx]); + mbuf = tx_pkts[nb_tx]; + +if (mbuf->ol_flags &RTE_MBUF_F_TX_TCP_SEG ) + err =ionic_tx_tso (txq, mbuf);else - err =ionic_tx (txq, tx_pkts[nb_tx]); + err =ionic_tx (txq, mbuf);if (err) { stats->drop += nb_pkts - nb_tx;break ; } - bytes_tx += tx_pkts[nb_tx]->pkt_len; + bytes_tx += mbuf->pkt_len; nb_tx++; }
Signature · 1 line
2.17.1
PATCH v2 19/36 net/ionic: do one-time init of receive descriptors
In reply to Andrew BoyerThese fields don't need to be set in the hot path. This improves performance.
--- drivers/net/ionic/ionic_rxtx.c | 38 ++++++++++++++++++++++++++++++---- 1 file changed, 34 insertions(+), 4 deletions(-)
drivers/net/ionic/ionic_rxtx.c +34 -4
@@ -941,9 +941,6 @@ ionic_rx_fill(struct ionic_rx_qcq *rxq) desc = &desc_base[q->head_idx]; dma_addr =rte_cpu_to_le_64 (rte_mbuf_data_iova_default (rxm)); desc->addr = dma_addr; - desc->len = rxq->hdr_seg_size; - desc->opcode = (q->num_segs >1 ) ?IONIC_RXQ_DESC_OPCODE_SG : -IONIC_RXQ_DESC_OPCODE_SIMPLE ; rxm->next =NULL ; prev_rxm_seg = rxm;
@@ -963,7 +960,6 @@ ionic_rx_fill(struct ionic_rx_qcq *rxq) data_iova =rte_mbuf_data_iova (rxm_seg); dma_addr =rte_cpu_to_le_64 (data_iova); elem->addr = dma_addr; - elem->len = rxq->seg_size; elem++; rxm_seg->next =NULL ;
@@ -981,6 +977,38 @@ ionic_rx_fill(struct ionic_rx_qcq *rxq)return 0 ; } +/* +* Perform one-time initialization of descriptor fields +* which will not change for the life of the queue. +*/ +static void __rte_cold +ionic_rx_init_descriptors (struct ionic_rx_qcq *rxq) +{ +struct ionic_queue *q = &rxq->qcq.q; +struct ionic_rxq_desc *desc, *desc_base = q->base; +struct ionic_rxq_sg_desc *sg_desc, *sg_desc_base = q->sg_base; +uint32_t i, j; +uint8_t opcode; + + opcode = (q->num_segs >1 ) ? +IONIC_RXQ_DESC_OPCODE_SG :IONIC_RXQ_DESC_OPCODE_SIMPLE ; + +/* +* NB: Only the first segment needs to leave headroom (hdr_seg_size). +* Later segments (seg_size) do not. +*/ +for (i =0 ; i < q->num_descs; i++) { + desc = &desc_base[i]; + desc->len =rte_cpu_to_le_16 (rxq->hdr_seg_size); + desc->opcode = opcode; + + sg_desc = &sg_desc_base[i]; +for (j =0 ; j < q->num_segs -1u ; j++) + sg_desc->elems[j].len = +rte_cpu_to_le_16 (rxq->seg_size); + } +} +/* * Start Receive Units for specified queue. */
@@ -1010,6 +1038,8 @@ ionic_dev_rx_queue_start(struct rte_eth_dev *eth_dev, uint16_t rx_queue_id)IONIC_PRINT (DEBUG ,"Starting RX queue %u, %u descs, size %u segs %u" , rx_queue_id, q->num_descs, rxq->frame_size, q->num_segs); +ionic_rx_init_descriptors (rxq); + err =ionic_lif_rxq_init (rxq);if (err)return err;
Signature · 1 line
2.17.1
PATCH v2 20/36 net/ionic: overhaul receive side for performance
In reply to Andrew BoyerLinearize RX mbuf chains in the expanded info array.
Clean one and fill one per CQE (completions are not coalesced). Touch the mbufs as little as possible in the fill stage. When touching the mbuf in the clean stage, use the rearm_data unions. Ring the doorbell once at the end of the bulk clean/fill.
--- doc/guides/rel_notes/release_22_11.rst | 1 + drivers/net/ionic/ionic_dev.h | 2 +- drivers/net/ionic/ionic_lif.c | 49 +++++- drivers/net/ionic/ionic_lif.h | 3 +- drivers/net/ionic/ionic_rxtx.c | 225 ++++++++++++------------- drivers/net/ionic/ionic_rxtx.h | 1 - 6 files changed, 159 insertions(+), 122 deletions(-)
doc/guides/rel_notes/release_22_11.rst +1 -0
@@ -145,6 +145,7 @@ New Features Updated the ionic PMD with new features and improvements, including: * Updated to reflect that Pensando has been acquired by AMD. + * Enhanced data path to provide substantial performance improvements. * **Updated Intel iavf driver.**
drivers/net/ionic/ionic_dev.h +1 -1
@@ -132,7 +132,7 @@ struct ionic_dev {#define Q_NEXT_TO_POST (_q, _n) (((_q)->head_idx + (_n)) & ((_q)->size_mask))#define Q_NEXT_TO_SRVC (_q, _n) (((_q)->tail_idx + (_n)) & ((_q)->size_mask)) -#define IONIC_INFO_IDX (_q, _i) (_i) +#define IONIC_INFO_IDX (_q, _i) ((_i) * (_q)->num_segs)#define IONIC_INFO_PTR (_q, _i) (&(_q)->info[IONIC_INFO_IDX((_q), _i)])struct ionic_queue {
drivers/net/ionic/ionic_lif.c +44 -5
89 lines not on this page · raw message
drivers/net/ionic/ionic_lif.h +2 -1
@@ -40,7 +40,6 @@ struct ionic_rx_stats {uint64_t packets;uint64_t bytes;uint64_t bad_cq_status; -uint64_t no_room;uint64_t bad_len;uint64_t mtods; };
@@ -80,6 +79,8 @@ struct ionic_rx_qcq {/* cacheline2 */ struct rte_mempool *mb_pool; +uint64_t rearm_data; +uint64_t rearm_seg_data;uint16_t frame_size;/* Based on configured MTU */ uint16_t hdr_seg_size;/* Length of first segment of RX chain */ uint16_t seg_size;/* Length of all subsequent segments */
drivers/net/ionic/ionic_rxtx.c +111 -114
333 lines not on this page · raw message
drivers/net/ionic/ionic_rxtx.h +0 -1
@@ -10,7 +10,6 @@struct ionic_rx_service {/* cb in */ struct rte_mbuf **rx_pkts; -uint16_t nb_pkts;/* cb out */ uint16_t nb_rx; };
Signature · 1 line
2.17.1
PATCH v2 21/36 net/ionic: overhaul transmit side for performance
In reply to Andrew BoyerLinearize Tx mbuf chains in the info array.
This avoids walking the mbuf chain during flush.
Move a few branches out of the hot path.
--- drivers/net/ionic/ionic_lif.c | 2 +- drivers/net/ionic/ionic_rxtx.c | 143 ++++++++++++++++++++------------- 2 files changed, 87 insertions(+), 58 deletions(-)
drivers/net/ionic/ionic_lif.c +1 -1
@@ -817,7 +817,7 @@ ionic_tx_qcq_alloc(struct ionic_lif *lif, uint32_t socket_id, uint32_t index,"tx" , flags, ntxq_descs, -1 , + num_segs_fw,sizeof (struct ionic_txq_desc ),sizeof (struct ionic_txq_comp ), sizeof(struct ionic_txq_sg_desc_v1),
drivers/net/ionic/ionic_rxtx.c +86 -57
231 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH v2 22/36 net/ionic: add support for mbuf fast free
In reply to Andrew BoyerUse a put() rather than a free() in the optimized case.
--- doc/guides/nics/features/ionic.ini | 1 + doc/guides/rel_notes/release_22_11.rst | 1 + drivers/net/ionic/ionic_ethdev.c | 2 +- drivers/net/ionic/ionic_lif.h | 1 + drivers/net/ionic/ionic_rxtx.c | 9 ++++++++- 5 files changed, 12 insertions(+), 2 deletions(-)
doc/guides/nics/features/ionic.ini +1 -0
@@ -7,6 +7,7 @@ Speed capabilities = Y Link status = Y Link status event = Y +Fast mbuf free = Y Queue start/stop = Y MTU update = Y Scattered Rx = Y
doc/guides/rel_notes/release_22_11.rst +1 -0
@@ -146,6 +146,7 @@ New Features * Updated to reflect that Pensando has been acquired by AMD. * Enhanced data path to provide substantial performance improvements. + * Added support for mbuf fast free. * **Updated Intel iavf driver.**
drivers/net/ionic/ionic_ethdev.c +1 -1
@@ -396,7 +396,7 @@ ionic_dev_info_get(struct rte_eth_dev *eth_dev,*/ dev_info->rx_queue_offload_capa =0 ; - dev_info->tx_queue_offload_capa =0 ; + dev_info->tx_queue_offload_capa =RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE ;/* * Per-port capabilities
drivers/net/ionic/ionic_lif.h +1 -0
@@ -50,6 +50,7 @@ struct ionic_rx_stats {#define IONIC_QCQ_F_CSUM_L3 BIT(7)#define IONIC_QCQ_F_CSUM_UDP BIT(8)#define IONIC_QCQ_F_CSUM_TCP BIT(9) +#define IONIC_QCQ_F_FAST_FREE BIT(10)/* Queue / Completion Queue */ struct ionic_qcq {
drivers/net/ionic/ionic_rxtx.c +8 -1
@@ -94,6 +94,8 @@ ionic_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id, qinfo->nb_desc = q->num_descs; qinfo->conf.offloads = dev->data->dev_conf.txmode.offloads; +if (txq->flags &IONIC_QCQ_F_FAST_FREE ) + qinfo->conf.offloads |=RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE ; qinfo->conf.tx_deferred_start = txq->flags &IONIC_QCQ_F_DEFERRED ; }
@@ -136,7 +138,10 @@ ionic_tx_flush(struct ionic_tx_qcq *txq)if (!txm)break ; -rte_pktmbuf_free_seg (txm); +if (txq->flags &IONIC_QCQ_F_FAST_FREE ) +rte_mempool_put (txm->pool, txm); +else +rte_pktmbuf_free_seg (txm); info[i] =NULL ; }
@@ -240,6 +245,8 @@ ionic_dev_tx_queue_setup(struct rte_eth_dev *eth_dev, uint16_t tx_queue_id, txq->flags |=IONIC_QCQ_F_CSUM_TCP ;if (offloads &RTE_ETH_TX_OFFLOAD_UDP_CKSUM ) txq->flags |=IONIC_QCQ_F_CSUM_UDP ; +if (offloads &RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE ) + txq->flags |=IONIC_QCQ_F_FAST_FREE ; eth_dev->data->tx_queues[tx_queue_id] = txq;
Signature · 1 line
2.17.1
PATCH v2 23/36 net/ionic: do bulk allocations of receive mbufs
In reply to Andrew BoyerDo bulk allocations to improve performance.
--- drivers/net/ionic/ionic_lif.h | 6 ++++++ drivers/net/ionic/ionic_rxtx.c | 35 ++++++++++++++++++++++++++-------- 2 files changed, 33 insertions(+), 8 deletions(-)
drivers/net/ionic/ionic_lif.h +6 -0
@@ -17,6 +17,8 @@#define IONIC_ADMINQ_LENGTH 16/* must be a power of two */ #define IONIC_NOTIFYQ_LENGTH 64/* must be a power of two */ +#define IONIC_MBUF_BULK_ALLOC 64/* Multiple of 4 */ +#define IONIC_RSS_OFFLOAD_ALL ( \ IONIC_RSS_TYPE_IPV4 | \ IONIC_RSS_TYPE_IPV4_TCP | \
@@ -86,9 +88,13 @@ struct ionic_rx_qcq {uint16_t hdr_seg_size;/* Length of first segment of RX chain */ uint16_t seg_size;/* Length of all subsequent segments */ uint16_t flags; +uint16_t mb_idx;/* cacheline3 (inside stats) */ struct ionic_rx_stats stats; + +/* cacheline4+ */ + struct rte_mbuf *mbs[IONIC_MBUF_BULK_ALLOC] __rte_cache_aligned; };struct ionic_tx_qcq {
drivers/net/ionic/ionic_rxtx.c +27 -8
@@ -77,6 +77,10 @@ ionic_rx_empty(struct ionic_rx_qcq *rxq)* fragments that were left dangling for later reuse */ ionic_empty_array (q->info, q->num_descs * q->num_segs,0 ); + +ionic_empty_array ((void **)rxq->mbs, +IONIC_MBUF_BULK_ALLOC , rxq->mb_idx); + rxq->mb_idx =0 ; }/*********************************************************************
@@ -950,6 +954,7 @@ ionic_rx_fill_one(struct ionic_rx_qcq *rxq)rte_iova_t data_iova;uint32_t i;void **info; +int ret; info =IONIC_INFO_PTR (q, q->head_idx); desc = &desc_base[q->head_idx];
@@ -959,12 +964,19 @@ ionic_rx_fill_one(struct ionic_rx_qcq *rxq)if (unlikely (info[0 ]))return 0 ; - rxm =rte_mbuf_raw_alloc (rxq->mb_pool); -if (unlikely (rxm ==NULL )) { -assert (0 ); -return -ENOMEM ; +if (rxq->mb_idx ==0 ) { + ret =rte_mempool_get_bulk (rxq->mb_pool, + (void **)rxq->mbs, +IONIC_MBUF_BULK_ALLOC ); +if (ret) { +assert (0 ); +return -ENOMEM ; + } + + rxq->mb_idx =IONIC_MBUF_BULK_ALLOC ; } + rxm = rxq->mbs[--rxq->mb_idx]; info[0 ] = rxm; data_iova =rte_mbuf_data_iova_default (rxm);
@@ -975,12 +987,19 @@ ionic_rx_fill_one(struct ionic_rx_qcq *rxq)if (info[i])return 0 ; - rxm_seg =rte_mbuf_raw_alloc (rxq->mb_pool); -if (rxm_seg ==NULL ) { -assert (0 ); -return -ENOMEM ; +if (rxq->mb_idx ==0 ) { + ret =rte_mempool_get_bulk (rxq->mb_pool, + (void **)rxq->mbs, +IONIC_MBUF_BULK_ALLOC ); +if (ret) { +assert (0 ); +return -ENOMEM ; + } + + rxq->mb_idx =IONIC_MBUF_BULK_ALLOC ; } + rxm_seg = rxq->mbs[--rxq->mb_idx]; info[i] = rxm_seg;/* The data_off does not get set to 0 until later */
Signature · 1 line
2.17.1
PATCH v2 24/36 net/ionic: add a lookup table for packet type
In reply to Andrew BoyerThis improves performance by reducing branching.
--- drivers/net/ionic/ionic_rxtx.c | 63 ++++++++++++++++------------------ 1 file changed, 29 insertions(+), 34 deletions(-)
drivers/net/ionic/ionic_rxtx.c +29 -34
@@ -804,6 +804,22 @@ ionic_dev_rx_queue_setup(struct rte_eth_dev *eth_dev,return 0 ; } +/* RTE_PTYPE_UNKNOWN is 0x0 */ +static const uint32_t ionic_ptype_table[IONIC_RXQ_COMP_PKT_TYPE_MASK ] + __rte_cache_aligned = { + [IONIC_PKT_TYPE_NON_IP ] =RTE_PTYPE_UNKNOWN , + [IONIC_PKT_TYPE_IPV4 ] =RTE_PTYPE_L2_ETHER |RTE_PTYPE_L3_IPV4 , + [IONIC_PKT_TYPE_IPV4_TCP ] = +RTE_PTYPE_L2_ETHER |RTE_PTYPE_L3_IPV4 |RTE_PTYPE_L4_TCP , + [IONIC_PKT_TYPE_IPV4_UDP ] = +RTE_PTYPE_L2_ETHER |RTE_PTYPE_L3_IPV4 |RTE_PTYPE_L4_UDP , + [IONIC_PKT_TYPE_IPV6 ] =RTE_PTYPE_L2_ETHER |RTE_PTYPE_L3_IPV6 , + [IONIC_PKT_TYPE_IPV6_TCP ] = +RTE_PTYPE_L2_ETHER |RTE_PTYPE_L3_IPV6 |RTE_PTYPE_L4_TCP , + [IONIC_PKT_TYPE_IPV6_UDP ] = +RTE_PTYPE_L2_ETHER |RTE_PTYPE_L3_IPV6 |RTE_PTYPE_L4_UDP , +}; +/* * Cleans one descriptor. Connects the filled mbufs into a chain. * Does not advance the tail index.
@@ -820,6 +836,7 @@ ionic_rx_clean_one(struct ionic_rx_qcq *rxq,uint32_t pkt_type;uint32_t left, i;uint16_t cq_desc_len; +uint8_t ptype;void **info; cq_desc_len =rte_le_to_cpu_16 (cq_desc->len);
@@ -895,41 +912,19 @@ ionic_rx_clean_one(struct ionic_rx_qcq *rxq, rxm->ol_flags = pkt_flags;/* Packet Type */ -switch (cq_desc->pkt_type_color &IONIC_RXQ_COMP_PKT_TYPE_MASK ) { -case IONIC_PKT_TYPE_IPV4 : - pkt_type =RTE_PTYPE_L2_ETHER |RTE_PTYPE_L3_IPV4 ; -break ; -case IONIC_PKT_TYPE_IPV6 : - pkt_type =RTE_PTYPE_L2_ETHER |RTE_PTYPE_L3_IPV6 ; -break ; -case IONIC_PKT_TYPE_IPV4_TCP : - pkt_type =RTE_PTYPE_L2_ETHER |RTE_PTYPE_L3_IPV4 | -RTE_PTYPE_L4_TCP ; -break ; -case IONIC_PKT_TYPE_IPV6_TCP : - pkt_type =RTE_PTYPE_L2_ETHER |RTE_PTYPE_L3_IPV6 | -RTE_PTYPE_L4_TCP ; -break ; -case IONIC_PKT_TYPE_IPV4_UDP : - pkt_type =RTE_PTYPE_L2_ETHER |RTE_PTYPE_L3_IPV4 | -RTE_PTYPE_L4_UDP ; -break ; -case IONIC_PKT_TYPE_IPV6_UDP : - pkt_type =RTE_PTYPE_L2_ETHER |RTE_PTYPE_L3_IPV6 | -RTE_PTYPE_L4_UDP ; -break ; -default : - { -struct rte_ether_hdr *eth_h =rte_pktmbuf_mtod (rxm, + ptype = cq_desc->pkt_type_color &IONIC_RXQ_COMP_PKT_TYPE_MASK ; + pkt_type = ionic_ptype_table[ptype]; +if (pkt_type ==RTE_PTYPE_UNKNOWN ) { +struct rte_ether_hdr *eth_h =rte_pktmbuf_mtod (rxm, struct rte_ether_hdr *); -uint16_t ether_type = eth_h->ether_type; -if (ether_type ==rte_cpu_to_be_16 (RTE_ETHER_TYPE_ARP )) - pkt_type =RTE_PTYPE_L2_ETHER_ARP ; -else - pkt_type =RTE_PTYPE_UNKNOWN ; - stats->mtods++; -break ; - } +uint16_t ether_type = eth_h->ether_type; +if (ether_type ==rte_cpu_to_be_16 (RTE_ETHER_TYPE_ARP )) + pkt_type =RTE_PTYPE_L2_ETHER_ARP ; +else if (ether_type ==rte_cpu_to_be_16 (RTE_ETHER_TYPE_LLDP )) + pkt_type =RTE_PTYPE_L2_ETHER_LLDP ; +else if (ether_type ==rte_cpu_to_be_16 (RTE_ETHER_TYPE_1588 )) + pkt_type =RTE_PTYPE_L2_ETHER_TIMESYNC ; + stats->mtods++; } rxm->packet_type = pkt_type;
Signature · 1 line
2.17.1
PATCH v2 25/36 net/ionic: add a lookup table for checksum flags
In reply to Andrew BoyerThis improves performance by reducing branching.
--- drivers/net/ionic/ionic_rxtx.c | 47 ++++++++++++++++++++++++---------- 1 file changed, 33 insertions(+), 14 deletions(-)
drivers/net/ionic/ionic_rxtx.c +33 -14
@@ -804,6 +804,36 @@ ionic_dev_rx_queue_setup(struct rte_eth_dev *eth_dev,return 0 ; } +#define IONIC_CSUM_FLAG_MASK (IONIC_RXQ_COMP_CSUM_F_VLAN - 1) +static const uint64_t ionic_csum_flags[IONIC_CSUM_FLAG_MASK ] + __rte_cache_aligned = { +/* IP_BAD set */ + [IONIC_RXQ_COMP_CSUM_F_IP_BAD ] =RTE_MBUF_F_RX_IP_CKSUM_BAD , + [IONIC_RXQ_COMP_CSUM_F_IP_BAD |IONIC_RXQ_COMP_CSUM_F_TCP_OK ] = +RTE_MBUF_F_RX_IP_CKSUM_BAD |RTE_MBUF_F_RX_L4_CKSUM_GOOD , + [IONIC_RXQ_COMP_CSUM_F_IP_BAD |IONIC_RXQ_COMP_CSUM_F_TCP_BAD ] = +RTE_MBUF_F_RX_IP_CKSUM_BAD |RTE_MBUF_F_RX_L4_CKSUM_BAD , + [IONIC_RXQ_COMP_CSUM_F_IP_BAD |IONIC_RXQ_COMP_CSUM_F_UDP_OK ] = +RTE_MBUF_F_RX_IP_CKSUM_BAD |RTE_MBUF_F_RX_L4_CKSUM_GOOD , + [IONIC_RXQ_COMP_CSUM_F_IP_BAD |IONIC_RXQ_COMP_CSUM_F_UDP_BAD ] = +RTE_MBUF_F_RX_IP_CKSUM_BAD |RTE_MBUF_F_RX_L4_CKSUM_BAD , +/* IP_OK set */ + [IONIC_RXQ_COMP_CSUM_F_IP_OK ] =RTE_MBUF_F_RX_IP_CKSUM_GOOD , + [IONIC_RXQ_COMP_CSUM_F_IP_OK |IONIC_RXQ_COMP_CSUM_F_TCP_OK ] = +RTE_MBUF_F_RX_IP_CKSUM_GOOD |RTE_MBUF_F_RX_L4_CKSUM_GOOD , + [IONIC_RXQ_COMP_CSUM_F_IP_OK |IONIC_RXQ_COMP_CSUM_F_TCP_BAD ] = +RTE_MBUF_F_RX_IP_CKSUM_GOOD |RTE_MBUF_F_RX_L4_CKSUM_BAD , + [IONIC_RXQ_COMP_CSUM_F_IP_OK |IONIC_RXQ_COMP_CSUM_F_UDP_OK ] = +RTE_MBUF_F_RX_IP_CKSUM_GOOD |RTE_MBUF_F_RX_L4_CKSUM_GOOD , + [IONIC_RXQ_COMP_CSUM_F_IP_OK |IONIC_RXQ_COMP_CSUM_F_UDP_BAD ] = +RTE_MBUF_F_RX_IP_CKSUM_GOOD |RTE_MBUF_F_RX_L4_CKSUM_BAD , +/* No IP flag set */ + [IONIC_RXQ_COMP_CSUM_F_TCP_OK ] =RTE_MBUF_F_RX_L4_CKSUM_GOOD , + [IONIC_RXQ_COMP_CSUM_F_TCP_BAD ] =RTE_MBUF_F_RX_L4_CKSUM_BAD , + [IONIC_RXQ_COMP_CSUM_F_UDP_OK ] =RTE_MBUF_F_RX_L4_CKSUM_GOOD , + [IONIC_RXQ_COMP_CSUM_F_UDP_BAD ] =RTE_MBUF_F_RX_L4_CKSUM_BAD , +}; +/* RTE_PTYPE_UNKNOWN is 0x0 */ static const uint32_t ionic_ptype_table[IONIC_RXQ_COMP_PKT_TYPE_MASK ] __rte_cache_aligned = {
@@ -836,7 +866,7 @@ ionic_rx_clean_one(struct ionic_rx_qcq *rxq,uint32_t pkt_type;uint32_t left, i;uint16_t cq_desc_len; -uint8_t ptype; +uint8_t ptype, cflags;void **info; cq_desc_len =rte_le_to_cpu_16 (cq_desc->len);
@@ -894,19 +924,8 @@ ionic_rx_clean_one(struct ionic_rx_qcq *rxq,/* Checksum */ if (cq_desc->csum_flags &IONIC_RXQ_COMP_CSUM_F_CALC ) { -if (cq_desc->csum_flags &IONIC_RXQ_COMP_CSUM_F_IP_OK ) - pkt_flags |=RTE_MBUF_F_RX_IP_CKSUM_GOOD ; -else if (cq_desc->csum_flags &IONIC_RXQ_COMP_CSUM_F_IP_BAD ) - pkt_flags |=RTE_MBUF_F_RX_IP_CKSUM_BAD ; - -if ((cq_desc->csum_flags &IONIC_RXQ_COMP_CSUM_F_TCP_OK ) || - (cq_desc->csum_flags &IONIC_RXQ_COMP_CSUM_F_UDP_OK )) - pkt_flags |=RTE_MBUF_F_RX_L4_CKSUM_GOOD ; -else if ((cq_desc->csum_flags & -IONIC_RXQ_COMP_CSUM_F_TCP_BAD ) || - (cq_desc->csum_flags & -IONIC_RXQ_COMP_CSUM_F_UDP_BAD )) - pkt_flags |=RTE_MBUF_F_RX_L4_CKSUM_BAD ; + cflags = cq_desc->csum_flags &IONIC_CSUM_FLAG_MASK ; + pkt_flags |= ionic_csum_flags[cflags]; } rxm->ol_flags = pkt_flags;
Signature · 1 line
2.17.1
PATCH v2 26/36 net/ionic: advertise supported packet types
In reply to Andrew BoyerThis improves performance, since clients may be able to skip SW packet classification.
--- doc/guides/rel_notes/release_22_11.rst | 1 + drivers/net/ionic/ionic_ethdev.c | 1 + drivers/net/ionic/ionic_rxtx.c | 19 +++++++++++++++++++ drivers/net/ionic/ionic_rxtx.h | 2 ++ 4 files changed, 23 insertions(+)
doc/guides/rel_notes/release_22_11.rst +1 -0
@@ -147,6 +147,7 @@ New Features * Updated to reflect that Pensando has been acquired by AMD. * Enhanced data path to provide substantial performance improvements. * Added support for mbuf fast free. + * Added support for advertising packet types. * **Updated Intel iavf driver.**
drivers/net/ionic/ionic_ethdev.c +1 -0
@@ -70,6 +70,7 @@ static const struct rte_eth_desc_lim tx_desc_lim_v1 = {static const struct eth_dev_ops ionic_eth_dev_ops = { .dev_infos_get = ionic_dev_info_get, + .dev_supported_ptypes_get = ionic_dev_supported_ptypes_get, .dev_configure = ionic_dev_configure, .mtu_set = ionic_dev_mtu_set, .dev_start = ionic_dev_start,
drivers/net/ionic/ionic_rxtx.c +19 -0
@@ -850,6 +850,25 @@ static const uint32_t ionic_ptype_table[IONIC_RXQ_COMP_PKT_TYPE_MASK] RTE_PTYPE_L2_ETHER | RTE_PTYPE_L3_IPV6 | RTE_PTYPE_L4_UDP, }; +const uint32_t * +ionic_dev_supported_ptypes_get(struct rte_eth_dev *dev __rte_unused) +{ +/* See ionic_ptype_table[] */ +static const uint32_t ptypes[] = { +RTE_PTYPE_L2_ETHER , +RTE_PTYPE_L2_ETHER_TIMESYNC , +RTE_PTYPE_L2_ETHER_LLDP , +RTE_PTYPE_L2_ETHER_ARP , +RTE_PTYPE_L3_IPV4 , +RTE_PTYPE_L3_IPV6 , +RTE_PTYPE_L4_TCP , +RTE_PTYPE_L4_UDP , +RTE_PTYPE_UNKNOWN + }; + +return ptypes; +} +/* * Cleans one descriptor. Connects the filled mbufs into a chain. * Does not advance the tail index.
drivers/net/ionic/ionic_rxtx.h +2 -0
@@ -40,4 +40,6 @@ void ionic_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,void ionic_txq_info_get (struct rte_eth_dev *dev,uint16_t queue_id,struct rte_eth_txq_info *qinfo); +const uint32_t *ionic_dev_supported_ptypes_get (struct rte_eth_dev *dev); +#endif /* _IONIC_RXTX_H_ */
Signature · 1 line
2.17.1
PATCH v2 27/36 net/ionic: add Rx descriptor status functions
In reply to Andrew BoyerThese may be useful for clients.
--- doc/guides/nics/features/ionic.ini | 1 + doc/guides/rel_notes/release_22_11.rst | 1 + drivers/net/ionic/ionic_ethdev.c | 2 ++ drivers/net/ionic/ionic_rxtx.c | 39 ++++++++++++++++++++++++++ drivers/net/ionic/ionic_rxtx.h | 2 ++ 5 files changed, 45 insertions(+)
doc/guides/nics/features/ionic.ini +1 -0
@@ -27,6 +27,7 @@ CRC offload = Y L3 checksum offload = Y L4 checksum offload = Y Packet type parsing = Y +Rx descriptor status = Y Basic stats = Y Extended stats = Y Stats per queue = Y
doc/guides/rel_notes/release_22_11.rst +1 -0
@@ -148,6 +148,7 @@ New Features * Enhanced data path to provide substantial performance improvements. * Added support for mbuf fast free. * Added support for advertising packet types. + * Added support for descriptor status functions. * **Updated Intel iavf driver.**
drivers/net/ionic/ionic_ethdev.c +2 -0
@@ -984,6 +984,8 @@ eth_ionic_dev_init(struct rte_eth_dev *eth_dev, void *init_params) eth_dev->tx_pkt_burst = &ionic_xmit_pkts; eth_dev->tx_pkt_prepare = &ionic_prep_pkts; + eth_dev->rx_descriptor_status = ionic_dev_rx_descriptor_status; +/* Multi-process not supported, primary does initialization anyway */ if (rte_eal_process_type () !=RTE_PROC_PRIMARY )return 0 ;
drivers/net/ionic/ionic_rxtx.c +39 -0
@@ -1235,3 +1235,42 @@ ionic_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,return rx_svc.nb_rx; } + +int +ionic_dev_rx_descriptor_status (void *rx_queue,uint16_t offset) +{ +struct ionic_rx_qcq *rxq = rx_queue; +struct ionic_qcq *qcq = &rxq->qcq; +struct ionic_rxq_comp *cq_desc; +uint16_t mask, head, tail, pos; +bool done_color; + + mask = qcq->q.size_mask; + +/* offset must be within the size of the ring */ +if (offset > mask) +return -EINVAL ; + + head = qcq->q.head_idx; + tail = qcq->q.tail_idx; + +/* offset is beyond what is posted */ +if (offset >= ((head - tail) & mask)) +return RTE_ETH_RX_DESC_UNAVAIL ; + +/* interested in this absolute position in the rxq */ + pos = (tail + offset) & mask; + +/* rx cq position == rx q position */ + cq_desc = qcq->cq.base; + cq_desc = &cq_desc[pos]; + +/* expected done color at this position */ + done_color = qcq->cq.done_color != (pos < tail); + +/* has the hw indicated the done color at this position? */ +if (color_match (cq_desc->pkt_type_color, done_color)) +return RTE_ETH_RX_DESC_DONE ; + +return RTE_ETH_RX_DESC_AVAIL ; +}
drivers/net/ionic/ionic_rxtx.h +2 -0
@@ -40,6 +40,8 @@ void ionic_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,void ionic_txq_info_get (struct rte_eth_dev *dev,uint16_t queue_id,struct rte_eth_txq_info *qinfo); +int ionic_dev_rx_descriptor_status (void *rx_queue,uint16_t offset); +const uint32_t *ionic_dev_supported_ptypes_get (struct rte_eth_dev *dev);#endif /* _IONIC_RXTX_H_ */
Signature · 1 line
2.17.1
PATCH v2 28/36 net/ionic: add Tx descriptor status function
In reply to Andrew BoyerThis may be useful for clients.
--- doc/guides/nics/features/ionic.ini | 1 + drivers/net/ionic/ionic_ethdev.c | 1 + drivers/net/ionic/ionic_rxtx.c | 51 ++++++++++++++++++++++++++++++ drivers/net/ionic/ionic_rxtx.h | 1 + 4 files changed, 54 insertions(+)
doc/guides/nics/features/ionic.ini +1 -0
@@ -28,6 +28,7 @@ L3 checksum offload = Y L4 checksum offload = Y Packet type parsing = Y Rx descriptor status = Y +Tx descriptor status = Y Basic stats = Y Extended stats = Y Stats per queue = Y
drivers/net/ionic/ionic_ethdev.c +1 -0
@@ -985,6 +985,7 @@ eth_ionic_dev_init(struct rte_eth_dev *eth_dev, void *init_params) eth_dev->tx_pkt_prepare = &ionic_prep_pkts; eth_dev->rx_descriptor_status = ionic_dev_rx_descriptor_status; + eth_dev->tx_descriptor_status = ionic_dev_tx_descriptor_status;/* Multi-process not supported, primary does initialization anyway */ if (rte_eal_process_type () !=RTE_PROC_PRIMARY )
drivers/net/ionic/ionic_rxtx.c +51 -0
54 lines not on this page · raw message
drivers/net/ionic/ionic_rxtx.h +1 -0
@@ -41,6 +41,7 @@ void ionic_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id, struct rte_eth_txq_info *qinfo);int ionic_dev_rx_descriptor_status (void *rx_queue,uint16_t offset); +int ionic_dev_tx_descriptor_status (void *tx_queue,uint16_t offset);const uint32_t *ionic_dev_supported_ptypes_get (struct rte_eth_dev *dev);
Signature · 1 line
2.17.1
PATCH v2 29/36 net/ionic: add Q-in-CMB option controlled by devarg
In reply to Andrew BoyerWhen 'ionic_cmb' is set to '1', queue memory will be allocated from the device's onboard memory (Controller Memory Buffer). In some configurations, this will dramatically reduce packet latency and increase PPS.
Add the WC_ACTIVATE flag to the PCI driver flags. Write combining must be enabled to achieve the maximum PPS.
When the queue is in the CMB, descriptors cannot be prefetched.
--- doc/guides/nics/ionic.rst | 12 ++++++ doc/guides/rel_notes/release_22_11.rst | 1 + drivers/net/ionic/ionic.h | 5 +++ drivers/net/ionic/ionic_dev.h | 3 ++ drivers/net/ionic/ionic_dev_pci.c | 60 +++++++++++++++++++++++++- drivers/net/ionic/ionic_ethdev.c | 9 ++++ drivers/net/ionic/ionic_lif.c | 38 ++++++++++++++++ drivers/net/ionic/ionic_lif.h | 2 + drivers/net/ionic/ionic_rxtx.c | 9 ++-- 9 files changed, 135 insertions(+), 4 deletions(-)
doc/guides/nics/ionic.rst +12 -0
@@ -32,6 +32,18 @@ The ionic PMD requires firmware which supports 16 segment transmit SGLs. This support was added prior to version 1.0. For help upgrading older versions, please contact AMD Pensando support. +Runtime Configuration +--------------------- + +- ``Queue in CMB support`` (default ``0``) + + Queue memory can be allocated from the Controller Memory Buffer (CMB) using + the ``ionic_cmb`` ``devargs`` parameter. + + For example:: + + -a 0000:b5:00.0,ionic_cmb=1 + Building DPDK -------------
doc/guides/rel_notes/release_22_11.rst +1 -0
@@ -149,6 +149,7 @@ New Features * Added support for mbuf fast free. * Added support for advertising packet types. * Added support for descriptor status functions. + * Added Q-in-CMB feature controlled by devarg ionic_cmb. * **Updated Intel iavf driver.**
drivers/net/ionic/ionic.h +5 -0
@@ -24,6 +24,9 @@#define IONIC_DEV_ID_ETH_VF 0x1003#define IONIC_DEV_ID_ETH_MGMT 0x1004 +/* Devargs */ +#define PMD_IONIC_CMB_KVARG "ionic_cmb" +enum ionic_mac_type {IONIC_MAC_UNKNOWN =0 ,IONIC_MAC_CAPRI ,
@@ -62,9 +65,11 @@ struct ionic_adapter {uint32_t link_speed;uint32_t nintrs;bool intrs[IONIC_INTR_CTRL_REGS_MAX ]; +bool q_in_cmb;bool link_up;char fw_version[IONIC_DEVINFO_FWVERS_BUFLEN ];void *bus_dev; +uint64_t cmb_offset; };/** ionic_admin_ctx - Admin command context.
drivers/net/ionic/ionic_dev.h +3 -0
@@ -176,9 +176,12 @@ struct ionic_adapter;struct ionic_qcq ;struct rte_mempool ;struct rte_eth_dev ; +struct rte_devargs ;struct ionic_dev_intf {int (*setup)(struct ionic_adapter *adapter); +int (*devargs)(struct ionic_adapter *adapter, +struct rte_devargs *devargs);void (*copy_bus_info)(struct ionic_adapter *adapter,struct rte_eth_dev *eth_dev);int (*configure_intr)(struct ionic_adapter *adapter);
drivers/net/ionic/ionic_dev_pci.c +59 -1
87 lines not on this page · raw message
drivers/net/ionic/ionic_ethdev.c +9 -0
@@ -1118,6 +1118,15 @@ eth_ionic_dev_probe(void *bus_dev, struct rte_device *rte_dev, adapter->intf = intf; +/* Parse device arguments */ +if (adapter->intf->devargs) { + err = (*adapter->intf->devargs)(adapter, rte_dev->devargs); +if (err) { +IONIC_PRINT (ERR ,"Cannot parse device arguments" ); + goto err_free_adapter; + } + } +/* Discover ionic dev resources */ err =ionic_setup (adapter);if (err) {
drivers/net/ionic/ionic_lif.c +38 -0
@@ -660,6 +660,21 @@ ionic_qcq_alloc(struct ionic_lif *lif,ionic_q_sg_map (&new->q, sg_base, sg_base_pa); } +if (flags &IONIC_QCQ_F_CMB ) { +/* alloc descriptor ring from nic memory */ +if (lif->adapter->cmb_offset + q_size > + lif->adapter->bars.bar[2 ].len) { +IONIC_PRINT (ERR ,"Cannot reserve queue from NIC mem" ); +return -ENOMEM ; + } + q_base = (void *) + ((uintptr_t )lif->adapter->bars.bar[2 ].vaddr + + (uintptr_t )lif->adapter->cmb_offset); +/* CMB PA is a relative address */ + q_base_pa = lif->adapter->cmb_offset; + lif->adapter->cmb_offset += q_size; + } +IONIC_PRINT (DEBUG ,"Q-Base-PA = %#jx CQ-Base-PA = %#jx " "SG-base-PA = %#jx" , q_base_pa, cq_base_pa, sg_base_pa);
@@ -744,6 +759,8 @@ ionic_rx_qcq_alloc(struct ionic_lif *lif, uint32_t socket_id, uint32_t index,int err; flags =IONIC_QCQ_F_SG ; +if (lif->state &IONIC_LIF_F_Q_IN_CMB ) + flags |=IONIC_QCQ_F_CMB ; seg_size =rte_pktmbuf_data_room_size (mb_pool);
@@ -806,6 +823,8 @@ ionic_tx_qcq_alloc(struct ionic_lif *lif, uint32_t socket_id, uint32_t index,int err; flags =IONIC_QCQ_F_SG ; +if (lif->state &IONIC_LIF_F_Q_IN_CMB ) + flags |=IONIC_QCQ_F_CMB ; num_segs_fw =IONIC_TX_MAX_SG_ELEMS_V1 +1 ;
@@ -994,6 +1013,19 @@ ionic_lif_alloc(struct ionic_lif *lif)return -ENXIO ; } +if (adapter->q_in_cmb) { +if (adapter->bars.num_bars >=3 && + lif->qtype_info[IONIC_QTYPE_RXQ ].version >=2 && + lif->qtype_info[IONIC_QTYPE_TXQ ].version >=3 ) { +IONIC_PRINT (INFO ,"%s enabled on %s" , +PMD_IONIC_CMB_KVARG , lif->name); + lif->state |=IONIC_LIF_F_Q_IN_CMB ; + }else { +IONIC_PRINT (ERR ,"%s not supported on %s, disabled" , +PMD_IONIC_CMB_KVARG , lif->name); + } + } +IONIC_PRINT (DEBUG ,"Allocating Lif Info" );rte_spinlock_init (&lif->adminq_lock);
@@ -1537,6 +1569,9 @@ ionic_lif_txq_init(struct ionic_tx_qcq *txq) };int err; +if (txq->flags &IONIC_QCQ_F_CMB ) + ctx.cmd.q_init.flags |=rte_cpu_to_le_16 (IONIC_QINIT_F_CMB ); +IONIC_PRINT (DEBUG ,"txq_init.index %d" , q->index);IONIC_PRINT (DEBUG ,"txq_init.ring_base 0x%" PRIx64"" , q->base_pa); IONIC_PRINT(DEBUG, "txq_init.ring_size %d",
@@ -1588,6 +1623,9 @@ ionic_lif_rxq_init(struct ionic_rx_qcq *rxq) };int err; +if (rxq->flags &IONIC_QCQ_F_CMB ) + ctx.cmd.q_init.flags |=rte_cpu_to_le_16 (IONIC_QINIT_F_CMB ); +IONIC_PRINT (DEBUG ,"rxq_init.index %d" , q->index);IONIC_PRINT (DEBUG ,"rxq_init.ring_base 0x%" PRIx64"" , q->base_pa); IONIC_PRINT(DEBUG, "rxq_init.ring_size %d",
drivers/net/ionic/ionic_lif.h +2 -0
@@ -49,6 +49,7 @@ struct ionic_rx_stats {#define IONIC_QCQ_F_INITED BIT(0)#define IONIC_QCQ_F_SG BIT(1)#define IONIC_QCQ_F_DEFERRED BIT(4) +#define IONIC_QCQ_F_CMB BIT(5)#define IONIC_QCQ_F_CSUM_L3 BIT(7)#define IONIC_QCQ_F_CSUM_UDP BIT(8)#define IONIC_QCQ_F_CSUM_TCP BIT(9)
@@ -126,6 +127,7 @@ struct ionic_qtype_info {#define IONIC_LIF_F_LINK_CHECK_NEEDED BIT(1)#define IONIC_LIF_F_UP BIT(2)#define IONIC_LIF_F_FW_RESET BIT(3) +#define IONIC_LIF_F_Q_IN_CMB BIT(4)#define IONIC_LIF_NAME_MAX_SZ (32)
drivers/net/ionic/ionic_rxtx.c +6 -3
@@ -600,7 +600,8 @@ ionic_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,int err;struct ionic_txq_desc *desc_base = q->base; -rte_prefetch0 (&desc_base[q->head_idx]); +if (!(txq->flags &IONIC_QCQ_F_CMB )) +rte_prefetch0 (&desc_base[q->head_idx]);rte_prefetch0 (IONIC_INFO_PTR (q, q->head_idx));if (tx_pkts) {
@@ -619,7 +620,8 @@ ionic_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,while (nb_tx < nb_pkts) {uint16_t next_idx =Q_NEXT_TO_POST (q,1 ); -rte_prefetch0 (&desc_base[next_idx]); +if (!(txq->flags &IONIC_QCQ_F_CMB )) +rte_prefetch0 (&desc_base[next_idx]);rte_prefetch0 (IONIC_INFO_PTR (q, next_idx));if (nb_tx +1 < nb_pkts) {
@@ -1172,7 +1174,8 @@ ionic_rxq_service(struct ionic_rx_qcq *rxq, uint32_t work_to_do,/* Prefetch 4 x 16B comp */ rte_prefetch0 (&cq_desc_base[Q_NEXT_TO_SRVC (cq,4 )]);/* Prefetch 4 x 16B descriptors */ -rte_prefetch0 (&q_desc_base[Q_NEXT_TO_POST (q,4 )]); +if (!(rxq->flags &IONIC_QCQ_F_CMB )) +rte_prefetch0 (&q_desc_base[Q_NEXT_TO_POST (q,4 )]);ionic_rx_clean_one (rxq, cq_desc, rx_svc);
Signature · 1 line
2.17.1
PATCH v2 30/36 net/ionic: update array allocations to use calloc
In reply to Andrew BoyerUse rte_calloc() where appropriate.
This makes the code clearer.
--- drivers/net/ionic/ionic_ethdev.c | 6 +++--- drivers/net/ionic/ionic_lif.c | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-)
drivers/net/ionic/ionic_ethdev.c +3 -3
@@ -1003,9 +1003,9 @@ eth_ionic_dev_init(struct rte_eth_dev *eth_dev, void *init_params) adapter->max_mac_addrs);/* Allocate memory for storing MAC addresses */ - eth_dev->data->mac_addrs =rte_zmalloc ("ionic" , -RTE_ETHER_ADDR_LEN * adapter->max_mac_addrs,0 ); - + eth_dev->data->mac_addrs =rte_calloc ("ionic" , + adapter->max_mac_addrs, +RTE_ETHER_ADDR_LEN ,0 );if (eth_dev->data->mac_addrs ==NULL ) { IONIC_PRINT(ERR, "Failed to allocate %u bytes needed to " "store MAC addresses",
drivers/net/ionic/ionic_lif.c +6 -6
@@ -1037,17 +1037,17 @@ ionic_lif_alloc(struct ionic_lif *lif)return -ENOMEM ; } - lif->txqcqs =rte_zmalloc ("ionic" ,sizeof (*lif->txqcqs) * - adapter->max_ntxqs_per_lif,0 ); - + lif->txqcqs =rte_calloc ("ionic" , + adapter->max_ntxqs_per_lif, +sizeof (*lif->txqcqs),0 );if (!lif->txqcqs) {IONIC_PRINT (ERR ,"Cannot allocate tx queues array" );return -ENOMEM ; } - lif->rxqcqs =rte_zmalloc ("ionic" ,sizeof (*lif->rxqcqs) * - adapter->max_nrxqs_per_lif,0 ); - + lif->rxqcqs =rte_calloc ("ionic" , + adapter->max_nrxqs_per_lif, +sizeof (*lif->rxqcqs),0 );if (!lif->rxqcqs) {IONIC_PRINT (ERR ,"Cannot allocate rx queues array" );return -ENOMEM ;
Signature · 1 line
2.17.1
PATCH v2 31/36 net/ionic: add alignment and socket info in allocations
In reply to Andrew BoyerThis will avoid memory access penalties on NUMA systems.
--- drivers/net/ionic/ionic_ethdev.c | 5 +++-- drivers/net/ionic/ionic_lif.c | 13 ++++++++----- drivers/net/ionic/ionic_rx_filter.c | 3 +-- 3 files changed, 12 insertions(+), 9 deletions(-)
drivers/net/ionic/ionic_ethdev.c +3 -2
@@ -1005,7 +1005,8 @@ eth_ionic_dev_init(struct rte_eth_dev *eth_dev, void *init_params)/* Allocate memory for storing MAC addresses */ eth_dev->data->mac_addrs =rte_calloc ("ionic" , adapter->max_mac_addrs, -RTE_ETHER_ADDR_LEN ,0 ); +RTE_ETHER_ADDR_LEN , +RTE_CACHE_LINE_SIZE );if (eth_dev->data->mac_addrs ==NULL ) { IONIC_PRINT(ERR, "Failed to allocate %u bytes needed to " "store MAC addresses",
@@ -1083,7 +1084,7 @@ eth_ionic_dev_probe(void *bus_dev, struct rte_device *rte_dev, goto err; } - adapter =rte_zmalloc ("ionic" ,sizeof (*adapter),0 ); + adapter =rte_zmalloc ("ionic" ,sizeof (*adapter),RTE_CACHE_LINE_SIZE );if (!adapter) {IONIC_PRINT (ERR ,"OOM" ); err = -ENOMEM ;
drivers/net/ionic/ionic_lif.c +8 -5
@@ -598,7 +598,8 @@ ionic_qcq_alloc(struct ionic_lif *lif, total_size +=rte_mem_page_size (); } - new =rte_zmalloc ("ionic" , struct_size,0 ); + new =rte_zmalloc_socket ("ionic" , struct_size, +RTE_CACHE_LINE_SIZE , socket_id);if (!new) {IONIC_PRINT (ERR ,"Cannot allocate queue structure" );return -ENOMEM ;
@@ -1037,17 +1038,19 @@ ionic_lif_alloc(struct ionic_lif *lif)return -ENOMEM ; } - lif->txqcqs =rte_calloc ("ionic" , + lif->txqcqs =rte_calloc_socket ("ionic" , adapter->max_ntxqs_per_lif, -sizeof (*lif->txqcqs),0 ); +sizeof (*lif->txqcqs), +RTE_CACHE_LINE_SIZE , socket_id);if (!lif->txqcqs) {IONIC_PRINT (ERR ,"Cannot allocate tx queues array" );return -ENOMEM ; } - lif->rxqcqs =rte_calloc ("ionic" , + lif->rxqcqs =rte_calloc_socket ("ionic" , adapter->max_nrxqs_per_lif, -sizeof (*lif->rxqcqs),0 ); +sizeof (*lif->rxqcqs), +RTE_CACHE_LINE_SIZE , socket_id);if (!lif->rxqcqs) {IONIC_PRINT (ERR ,"Cannot allocate rx queues array" );return -ENOMEM ;
drivers/net/ionic/ionic_rx_filter.c +1 -2
@@ -55,8 +55,7 @@ ionic_rx_filter_save(struct ionic_lif *lif, uint32_t flow_id,struct ionic_rx_filter *f;uint32_t key; - f =rte_zmalloc ("ionic" ,sizeof (*f),0 ); - + f =rte_zmalloc ("ionic" ,sizeof (*f),RTE_CACHE_LINE_SIZE );if (!f)return -ENOMEM ;
Signature · 1 line
2.17.1
PATCH v2 32/36 net/ionic: allow client to specify Tx free threshold
In reply to Andrew BoyerSome clients have opinions about how often to flush the transmit ring.
The default value is the number of Tx descriptors minus the default Tx burst size.
--- drivers/net/ionic/ionic_dev.h | 1 + drivers/net/ionic/ionic_ethdev.c | 4 ++-- drivers/net/ionic/ionic_lif.h | 1 + drivers/net/ionic/ionic_rxtx.c | 17 +++++++++++++++-- 4 files changed, 19 insertions(+), 4 deletions(-)
drivers/net/ionic/ionic_dev.h +1 -0
@@ -20,6 +20,7 @@#define IONIC_MAX_RING_DESC 32768#define IONIC_MIN_RING_DESC 16#define IONIC_DEF_TXRX_DESC 4096 +#define IONIC_DEF_TXRX_BURST 32#define IONIC_DEVCMD_TIMEOUT 5/* devcmd_timeout */ #define IONIC_DEVCMD_CHECK_PERIOD_US 10/* devcmd status chk period */
drivers/net/ionic/ionic_ethdev.c +2 -2
@@ -429,8 +429,8 @@ ionic_dev_info_get(struct rte_eth_dev *eth_dev, dev_info->tx_desc_lim = tx_desc_lim_v1;/* Driver-preferred Rx/Tx parameters */ - dev_info->default_rxportconf.burst_size =32 ; - dev_info->default_txportconf.burst_size =32 ; + dev_info->default_rxportconf.burst_size =IONIC_DEF_TXRX_BURST ; + dev_info->default_txportconf.burst_size =IONIC_DEF_TXRX_BURST ; dev_info->default_rxportconf.nb_queues =1 ; dev_info->default_txportconf.nb_queues =1 ; dev_info->default_rxportconf.ring_size =IONIC_DEF_TXRX_DESC ;
drivers/net/ionic/ionic_lif.h +1 -0
@@ -104,6 +104,7 @@ struct ionic_tx_qcq {/* cacheline2 */ uint16_t num_segs_fw;/* # segs supported by current FW */ +uint16_t free_thresh;uint16_t flags;struct ionic_tx_stats stats;
drivers/net/ionic/ionic_rxtx.c +15 -2
@@ -223,6 +223,13 @@ ionic_dev_tx_queue_setup(struct rte_eth_dev *eth_dev, uint16_t tx_queue_id,if (!rte_is_power_of_2 (nb_desc) || nb_desc <IONIC_MIN_RING_DESC )return -EINVAL ;/* or use IONIC_DEFAULT_RING_DESC */ +if (tx_conf->tx_free_thresh > nb_desc) { +IONIC_PRINT (ERR , +"tx_free_thresh must be less than nb_desc (%u)" , + nb_desc); +return -EINVAL ; + } +/* Free memory prior to re-allocation if needed... */ if (eth_dev->data->tx_queues[tx_queue_id] !=NULL ) {ionic_dev_tx_queue_release (eth_dev, tx_queue_id);
@@ -252,6 +259,10 @@ ionic_dev_tx_queue_setup(struct rte_eth_dev *eth_dev, uint16_t tx_queue_id,if (offloads &RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE ) txq->flags |=IONIC_QCQ_F_FAST_FREE ; + txq->free_thresh = + tx_conf->tx_free_thresh ? tx_conf->tx_free_thresh : + nb_desc -IONIC_DEF_TXRX_BURST ; + eth_dev->data->tx_queues[tx_queue_id] = txq;return 0 ;
@@ -609,8 +620,10 @@ ionic_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,rte_mbuf_prefetch_part2 (tx_pkts[0 ]); } -/* Cleaning old buffers */ -ionic_tx_flush (txq); +if (unlikely (ionic_q_space_avail (q) < txq->free_thresh)) { +/* Cleaning old buffers */ +ionic_tx_flush (txq); + } nb_avail =ionic_q_space_avail (q);if (unlikely (nb_avail < nb_pkts)) {
Signature · 1 line
2.17.1
PATCH v2 33/36 net/ionic: add optimized handlers for non-scattered Rx/Tx
In reply to Andrew BoyerThe code is very similar, but the simple case can skip a few branches in the hot path. This improves PPS when 10KB mbufs are used.
S/G is enabled on the Rx side by offload DEV_RX_OFFLOAD_SCATTER. S/G is enabled on the Tx side by offload DEV_TX_OFFLOAD_MULTI_SEGS.
S/G is automatically enabled on the Rx side if the provided mbufs are too small to hold the maximum possible frame.
To enable S/G in testpmd, add these args:
--rx-offloads=0x2000 --tx-offloads=0x8000
--- doc/guides/rel_notes/release_22_11.rst | 1 + drivers/net/ionic/ionic_ethdev.c | 25 +- drivers/net/ionic/ionic_lif.c | 61 ++- drivers/net/ionic/ionic_lif.h | 1 + drivers/net/ionic/ionic_rxtx.c | 576 ++----------------------- drivers/net/ionic/ionic_rxtx.h | 46 +- drivers/net/ionic/ionic_rxtx_sg.c | 496 +++++++++++++++++++++ drivers/net/ionic/ionic_rxtx_simple.c | 417 ++++++++++++++++++ drivers/net/ionic/meson.build | 2 + 9 files changed, 1054 insertions(+), 571 deletions(-) create mode 100644 drivers/net/ionic/ionic_rxtx_sg.c create mode 100644 drivers/net/ionic/ionic_rxtx_simple.c
doc/guides/rel_notes/release_22_11.rst +1 -0
@@ -150,6 +150,7 @@ New Features * Added support for advertising packet types. * Added support for descriptor status functions. * Added Q-in-CMB feature controlled by devarg ionic_cmb. + * Added optimized handlers for non-scattered Rx and Tx. * **Updated Intel iavf driver.**
drivers/net/ionic/ionic_ethdev.c +19 -6
@@ -828,8 +828,6 @@ ionic_dev_configure(struct rte_eth_dev *eth_dev)ionic_lif_configure (lif); -ionic_lif_set_features (lif); -return 0 ; }
@@ -883,6 +881,13 @@ ionic_dev_start(struct rte_eth_dev *eth_dev)if (dev_conf->lpbk_mode)IONIC_PRINT (WARNING ,"Loopback mode not supported" ); +/* Re-set features in case SG flag was added in rx_queue_setup() */ + err =ionic_lif_set_features (lif); +if (err) { +IONIC_PRINT (ERR ,"Cannot set LIF features: %d" , err); +return err; + } + lif->frame_size = eth_dev->data->mtu +IONIC_ETH_OVERHEAD ; err =ionic_lif_change_mtu (lif, eth_dev->data->mtu);
@@ -917,6 +922,18 @@ ionic_dev_start(struct rte_eth_dev *eth_dev) speed); } +if (lif->hw_features &IONIC_ETH_HW_RX_SG ) + eth_dev->rx_pkt_burst = &ionic_recv_pkts_sg; +else + eth_dev->rx_pkt_burst = &ionic_recv_pkts; + +if (lif->hw_features &IONIC_ETH_HW_TX_SG ) + eth_dev->tx_pkt_burst = &ionic_xmit_pkts_sg; +else + eth_dev->tx_pkt_burst = &ionic_xmit_pkts; + + eth_dev->tx_pkt_prepare = &ionic_prep_pkts; +ionic_dev_link_update (eth_dev,0 );return 0 ;
@@ -980,10 +997,6 @@ eth_ionic_dev_init(struct rte_eth_dev *eth_dev, void *init_params)IONIC_PRINT_CALL (); eth_dev->dev_ops = &ionic_eth_dev_ops; - eth_dev->rx_pkt_burst = &ionic_recv_pkts; - eth_dev->tx_pkt_burst = &ionic_xmit_pkts; - eth_dev->tx_pkt_prepare = &ionic_prep_pkts; - eth_dev->rx_descriptor_status = ionic_dev_rx_descriptor_status; eth_dev->tx_descriptor_status = ionic_dev_tx_descriptor_status;
drivers/net/ionic/ionic_lif.c +44 -17
123 lines not on this page · raw message
drivers/net/ionic/ionic_lif.h +1 -0
@@ -188,6 +188,7 @@ void ionic_lif_stop(struct ionic_lif *lif);void ionic_lif_configure (struct ionic_lif *lif);void ionic_lif_configure_vlan_offload (struct ionic_lif *lif,int mask); +void ionic_lif_configure_rx_sg_offload (struct ionic_lif *lif);void ionic_lif_reset (struct ionic_lif *lif);int ionic_intr_alloc (struct ionic_lif *lif,struct ionic_intr_info *intr);
drivers/net/ionic/ionic_rxtx.c +35 -541
695 lines not on this page · raw message
drivers/net/ionic/ionic_rxtx.h +39 -7
63 lines not on this page · raw message
drivers/net/ionic/ionic_rxtx_sg.c new file +496 -0
496 lines not on this page · raw message
drivers/net/ionic/ionic_rxtx_simple.c new file +417 -0
417 lines not on this page · raw message
drivers/net/ionic/meson.build +2 -0
@@ -16,4 +16,6 @@ sources = files( 'ionic_main.c', 'ionic_rx_filter.c', 'ionic_rxtx.c', + 'ionic_rxtx_simple.c', + 'ionic_rxtx_sg.c', )
Signature · 1 line
2.17.1
PATCH v2 34/36 net/ionic: use a helper variable for page size
In reply to Andrew BoyerThis improves readability.
--- drivers/net/ionic/ionic_lif.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-)
drivers/net/ionic/ionic_lif.c +12 -14
@@ -576,6 +576,7 @@ ionic_qcq_alloc(struct ionic_lif *lif,rte_iova_t q_base_pa =0 ;rte_iova_t cq_base_pa =0 ;rte_iova_t sg_base_pa =0 ; +size_t page_size =rte_mem_page_size ();int err; *qcq =NULL ;
@@ -584,18 +585,18 @@ ionic_qcq_alloc(struct ionic_lif *lif, cq_size = num_descs * cq_desc_size; sg_size = num_descs * sg_desc_size; - total_size =RTE_ALIGN (q_size,rte_mem_page_size ()) + -RTE_ALIGN (cq_size,rte_mem_page_size ()); + total_size =RTE_ALIGN (q_size, page_size) + +RTE_ALIGN (cq_size, page_size);/* * Note: aligning q_size/cq_size is not enough due to cq_base address * aligning as q_base could be not aligned to the page. -* Adding rte_mem_page_size(). +* Adding page_size. */ - total_size +=rte_mem_page_size (); + total_size += page_size;if (flags &IONIC_QCQ_F_SG ) { - total_size +=RTE_ALIGN (sg_size,rte_mem_page_size ()); - total_size +=rte_mem_page_size (); + total_size +=RTE_ALIGN (sg_size, page_size); + total_size += page_size; } new = rte_zmalloc_socket("ionic", struct_size,
@@ -610,7 +611,7 @@ ionic_qcq_alloc(struct ionic_lif *lif,/* Most queue types will store 1 ptr per descriptor */ new->q.info =rte_calloc_socket ("ionic" , num_descs * num_segs,sizeof (void *), -rte_mem_page_size (), socket_id); + page_size, socket_id);if (!new->q.info) {IONIC_PRINT (ERR ,"Cannot allocate queue info" ); err = -ENOMEM ;
@@ -648,16 +649,13 @@ ionic_qcq_alloc(struct ionic_lif *lif, q_base = new->base; q_base_pa = new->base_pa; - cq_base = (void *)RTE_ALIGN ((uintptr_t )q_base + q_size, -rte_mem_page_size ()); - cq_base_pa =RTE_ALIGN (q_base_pa + q_size, -rte_mem_page_size ()); + cq_base = (void *)RTE_ALIGN ((uintptr_t )q_base + q_size, page_size); + cq_base_pa =RTE_ALIGN (q_base_pa + q_size, page_size);if (flags &IONIC_QCQ_F_SG ) { sg_base = (void *)RTE_ALIGN ((uintptr_t )cq_base + cq_size, -rte_mem_page_size ()); - sg_base_pa =RTE_ALIGN (cq_base_pa + cq_size, -rte_mem_page_size ()); + page_size); + sg_base_pa =RTE_ALIGN (cq_base_pa + cq_size, page_size);ionic_q_sg_map (&new->q, sg_base, sg_base_pa); }
Signature · 1 line
2.17.1
PATCH v2 35/36 net/ionic: retry init commands up to five times
In reply to Andrew BoyerIn some configurations, the FW may return EAGAIN if it is not able to respond to commands immediately. Retry the init commands in this case to prevent errors from reaching the client.
Fix up some return-code stuff while here, for clarity.
--- drivers/net/ionic/ionic_dev.h | 1 + drivers/net/ionic/ionic_lif.c | 14 ++++++++++++++ drivers/net/ionic/ionic_main.c | 4 ++-- 3 files changed, 17 insertions(+), 2 deletions(-)
drivers/net/ionic/ionic_dev.h +1 -0
@@ -24,6 +24,7 @@#define IONIC_DEVCMD_TIMEOUT 5/* devcmd_timeout */ #define IONIC_DEVCMD_CHECK_PERIOD_US 10/* devcmd status chk period */ +#define IONIC_DEVCMD_RETRY_WAIT_US 20000#define IONIC_ALIGN 4096
drivers/net/ionic/ionic_lif.c +14 -0
@@ -1423,10 +1423,17 @@ ionic_lif_adminq_init(struct ionic_lif *lif)struct ionic_admin_qcq *aqcq = lif->adminqcq;struct ionic_queue *q = &aqcq->qcq.q;struct ionic_q_init_comp comp; +uint32_t retries =5 ;int err; +retry_adminq_init:ionic_dev_cmd_adminq_init (idev, &aqcq->qcq); err =ionic_dev_cmd_wait_check (idev,IONIC_DEVCMD_TIMEOUT ); +if (err == -EAGAIN && retries >0 ) { + retries--; +rte_delay_us_block (IONIC_DEVCMD_RETRY_WAIT_US ); + goto retry_adminq_init; + }if (err)return err;
@@ -1713,12 +1720,19 @@ ionic_lif_init(struct ionic_lif *lif) {struct ionic_dev *idev = &lif->adapter->idev;struct ionic_lif_init_comp comp; +uint32_t retries =5 ;int err;memset (&lif->stats_base,0 ,sizeof (lif->stats_base)); +retry_lif_init:ionic_dev_cmd_lif_init (idev, lif->info_pa); err =ionic_dev_cmd_wait_check (idev,IONIC_DEVCMD_TIMEOUT ); +if (err == -EAGAIN && retries >0 ) { + retries--; +rte_delay_us_block (IONIC_DEVCMD_RETRY_WAIT_US ); + goto retry_lif_init; + }if (err)return err;
drivers/net/ionic/ionic_main.c +2 -2
@@ -313,10 +313,10 @@ ionic_dev_cmd_check_error(struct ionic_dev *idev)uint8_t status; status =ionic_dev_cmd_status (idev); -if (status ==0 ) +if (status ==IONIC_RC_SUCCESS )return 0 ; -return -EIO ; +return (status ==IONIC_RC_EAGAIN ) ? -EAGAIN : -EIO ; }int
Signature · 1 line
2.17.1
PATCH v2 36/36 net/ionic: add watchdogs to protect each queue type
In reply to Andrew BoyerRing the doorbell again for the following scenarios:
* No receives posted but Rx queue not empty after deadline
* No transmits posted but Tx work still pending after deadline
* Admin queue work still pending after deadline
This will help the queues recover in the extremely rare case that a doorbell is missed by the FW.
--- drivers/net/ionic/ionic_dev.h | 4 +++ drivers/net/ionic/ionic_lif.h | 3 ++ drivers/net/ionic/ionic_main.c | 22 ++++++++++++ drivers/net/ionic/ionic_rxtx.c | 1 + drivers/net/ionic/ionic_rxtx_sg.c | 50 ++++++++++++++++++++++++++- drivers/net/ionic/ionic_rxtx_simple.c | 50 ++++++++++++++++++++++++++- 6 files changed, 128 insertions(+), 2 deletions(-)
drivers/net/ionic/ionic_dev.h +4 -0
@@ -26,6 +26,10 @@#define IONIC_DEVCMD_CHECK_PERIOD_US 10/* devcmd status chk period */ #define IONIC_DEVCMD_RETRY_WAIT_US 20000 +#define IONIC_Q_WDOG_MS 10/* 10ms */ +#define IONIC_Q_WDOG_MAX_MS 5000/* 5s */ +#define IONIC_ADMINQ_WDOG_MS 500/* 500ms */ +#define IONIC_ALIGN 4096struct ionic_adapter ;
drivers/net/ionic/ionic_lif.h +3 -0
@@ -85,6 +85,8 @@ struct ionic_rx_qcq {struct rte_mempool *mb_pool;uint64_t rearm_data;uint64_t rearm_seg_data; +uint64_t last_wdog_cycles; +uint64_t wdog_ms;uint16_t frame_size;/* Based on configured MTU */ uint16_t hdr_seg_size;/* Length of first segment of RX chain */ uint16_t seg_size;/* Length of all subsequent segments */
@@ -103,6 +105,7 @@ struct ionic_tx_qcq {struct ionic_qcq qcq;/* cacheline2 */ +uint64_t last_wdog_cycles;uint16_t num_segs_fw;/* # segs supported by current FW */ uint16_t free_thresh;uint16_t flags;
drivers/net/ionic/ionic_main.c +22 -0
@@ -230,10 +230,16 @@ static int ionic_adminq_wait_for_completion(struct ionic_lif *lif, struct ionic_admin_ctx *ctx, unsigned long max_wait) { + struct ionic_queue *q = &lif->adminqcq->qcq.q;unsigned long step_usec =IONIC_DEVCMD_CHECK_PERIOD_US ; +unsigned long step_deadline;unsigned long max_wait_usec = max_wait *1000000L ;unsigned long elapsed_usec =0 ;int budget =8 ; +uint16_t idx; +void **info; + + step_deadline =IONIC_ADMINQ_WDOG_MS *1000 / step_usec;while (ctx->pending_work && elapsed_usec < max_wait_usec) {/*
@@ -245,10 +251,26 @@ ionic_adminq_wait_for_completion(struct ionic_lif *lif,ionic_qcq_service (&lif->adminqcq->qcq, budget, ionic_adminq_service,NULL ); +/* +* Ring the doorbell again if work is pending after deadline. +*/ +if (ctx->pending_work && !step_deadline) { + step_deadline =IONIC_ADMINQ_WDOG_MS * +1000 / step_usec; + +rte_spinlock_lock (&lif->adminq_lock); + idx =Q_NEXT_TO_POST (q,-1 ); + info =IONIC_INFO_PTR (q, idx); +if (info[0 ] == ctx) +ionic_q_flush (q); +rte_spinlock_unlock (&lif->adminq_lock); + } +rte_spinlock_unlock (&lif->adminq_service_lock);rte_delay_us_block (step_usec); elapsed_usec += step_usec; + step_deadline--; }return (!ctx->pending_work);
drivers/net/ionic/ionic_rxtx.c +1 -0
@@ -551,6 +551,7 @@ ionic_dev_rx_queue_setup(struct rte_eth_dev *eth_dev, } rxq->mb_pool = mp; + rxq->wdog_ms =IONIC_Q_WDOG_MS ;/* * Note: the interface does not currently support
drivers/net/ionic/ionic_rxtx_sg.c +49 -1
77 lines not on this page · raw message
drivers/net/ionic/ionic_rxtx_simple.c +49 -1
77 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH 18/35 net/ionic: do one-time init of receive descriptors
In reply to Andrew BoyerThese fields don't need to be set in the hot path. This improves performance.
--- drivers/net/ionic/ionic_rxtx.c | 38 ++++++++++++++++++++++++++++++---- 1 file changed, 34 insertions(+), 4 deletions(-)
drivers/net/ionic/ionic_rxtx.c +34 -4
@@ -941,9 +941,6 @@ ionic_rx_fill(struct ionic_rx_qcq *rxq) desc = &desc_base[q->head_idx]; dma_addr =rte_cpu_to_le_64 (rte_mbuf_data_iova_default (rxm)); desc->addr = dma_addr; - desc->len = rxq->hdr_seg_size; - desc->opcode = (q->num_segs >1 ) ?IONIC_RXQ_DESC_OPCODE_SG : -IONIC_RXQ_DESC_OPCODE_SIMPLE ; rxm->next =NULL ; prev_rxm_seg = rxm;
@@ -963,7 +960,6 @@ ionic_rx_fill(struct ionic_rx_qcq *rxq) data_iova =rte_mbuf_data_iova (rxm_seg); dma_addr =rte_cpu_to_le_64 (data_iova); elem->addr = dma_addr; - elem->len = rxq->seg_size; elem++; rxm_seg->next =NULL ;
@@ -981,6 +977,38 @@ ionic_rx_fill(struct ionic_rx_qcq *rxq)return 0 ; } +/* +* Perform one-time initialization of descriptor fields +* which will not change for the life of the queue. +*/ +static void __rte_cold +ionic_rx_init_descriptors (struct ionic_rx_qcq *rxq) +{ +struct ionic_queue *q = &rxq->qcq.q; +struct ionic_rxq_desc *desc, *desc_base = q->base; +struct ionic_rxq_sg_desc *sg_desc, *sg_desc_base = q->sg_base; +uint32_t i, j; +uint8_t opcode; + + opcode = (q->num_segs >1 ) ? +IONIC_RXQ_DESC_OPCODE_SG :IONIC_RXQ_DESC_OPCODE_SIMPLE ; + +/* +* NB: Only the first segment needs to leave headroom (hdr_seg_size). +* Later segments (seg_size) do not. +*/ +for (i =0 ; i < q->num_descs; i++) { + desc = &desc_base[i]; + desc->len =rte_cpu_to_le_16 (rxq->hdr_seg_size); + desc->opcode = opcode; + + sg_desc = &sg_desc_base[i]; +for (j =0 ; j < q->num_segs -1u ; j++) + sg_desc->elems[j].len = +rte_cpu_to_le_16 (rxq->seg_size); + } +} +/* * Start Receive Units for specified queue. */
@@ -1010,6 +1038,8 @@ ionic_dev_rx_queue_start(struct rte_eth_dev *eth_dev, uint16_t rx_queue_id)IONIC_PRINT (DEBUG ,"Starting RX queue %u, %u descs, size %u segs %u" , rx_queue_id, q->num_descs, rxq->frame_size, q->num_segs); +ionic_rx_init_descriptors (rxq); + err =ionic_lif_rxq_init (rxq);if (err)return err;
Signature · 1 line
2.17.1
PATCH 19/35 net/ionic: overhaul receive side for performance
In reply to Andrew BoyerLinearize RX mbuf chains in the expanded info array.
Clean one and fill one per CQE (completions are not coalesced). Touch the mbufs as little as possible in the fill stage. When touching the mbuf in the clean stage, use the rearm_data unions. Ring the doorbell once at the end of the bulk clean/fill.
--- doc/guides/rel_notes/release_22_11.rst | 1 + drivers/net/ionic/ionic_dev.h | 2 +- drivers/net/ionic/ionic_lif.c | 49 +++++- drivers/net/ionic/ionic_lif.h | 3 +- drivers/net/ionic/ionic_rxtx.c | 225 ++++++++++++------------- drivers/net/ionic/ionic_rxtx.h | 1 - 6 files changed, 159 insertions(+), 122 deletions(-)
doc/guides/rel_notes/release_22_11.rst +1 -0
@@ -83,6 +83,7 @@ New Features Updated the ionic PMD with new features and improvements, including: * Updated to reflect that Pensando has been acquired by AMD. + * Enhanced data path to provide substantial performance improvements. Removed Items -------------
drivers/net/ionic/ionic_dev.h +1 -1
@@ -132,7 +132,7 @@ struct ionic_dev {#define Q_NEXT_TO_POST (_q, _n) (((_q)->head_idx + (_n)) & ((_q)->size_mask))#define Q_NEXT_TO_SRVC (_q, _n) (((_q)->tail_idx + (_n)) & ((_q)->size_mask)) -#define IONIC_INFO_IDX (_q, _i) (_i) +#define IONIC_INFO_IDX (_q, _i) ((_i) * (_q)->num_segs)#define IONIC_INFO_PTR (_q, _i) (&(_q)->info[IONIC_INFO_IDX((_q), _i)])struct ionic_queue {
drivers/net/ionic/ionic_lif.c +44 -5
89 lines not on this page · raw message
drivers/net/ionic/ionic_lif.h +2 -1
@@ -40,7 +40,6 @@ struct ionic_rx_stats {uint64_t packets;uint64_t bytes;uint64_t bad_cq_status; -uint64_t no_room;uint64_t bad_len;uint64_t mtods; };
@@ -80,6 +79,8 @@ struct ionic_rx_qcq {/* cacheline2 */ struct rte_mempool *mb_pool; +uint64_t rearm_data; +uint64_t rearm_seg_data;uint16_t frame_size;/* Based on configured MTU */ uint16_t hdr_seg_size;/* Length of first segment of RX chain */ uint16_t seg_size;/* Length of all subsequent segments */
drivers/net/ionic/ionic_rxtx.c +111 -114
333 lines not on this page · raw message
drivers/net/ionic/ionic_rxtx.h +0 -1
@@ -10,7 +10,6 @@struct ionic_rx_service {/* cb in */ struct rte_mbuf **rx_pkts; -uint16_t nb_pkts;/* cb out */ uint16_t nb_rx; };
Signature · 1 line
2.17.1
PATCH 19/35 net/ionic: overhaul receive side for performance
In reply to Andrew BoyerLinearize RX mbuf chains in the expanded info array.
Clean one and fill one per CQE (completions are not coalesced). Touch the mbufs as little as possible in the fill stage. When touching the mbuf in the clean stage, use the rearm_data unions. Ring the doorbell once at the end of the bulk clean/fill.
--- doc/guides/rel_notes/release_22_11.rst | 1 + drivers/net/ionic/ionic_dev.h | 2 +- drivers/net/ionic/ionic_lif.c | 49 +++++- drivers/net/ionic/ionic_lif.h | 3 +- drivers/net/ionic/ionic_rxtx.c | 225 ++++++++++++------------- drivers/net/ionic/ionic_rxtx.h | 1 - 6 files changed, 159 insertions(+), 122 deletions(-)
doc/guides/rel_notes/release_22_11.rst +1 -0
@@ -164,6 +164,7 @@ New Features Updated the ionic PMD with new features and improvements, including: * Updated to reflect that Pensando has been acquired by AMD. + * Enhanced data path to provide substantial performance improvements. * **Added support for MACsec in rte_security.**
drivers/net/ionic/ionic_dev.h +1 -1
@@ -132,7 +132,7 @@ struct ionic_dev {#define Q_NEXT_TO_POST (_q, _n) (((_q)->head_idx + (_n)) & ((_q)->size_mask))#define Q_NEXT_TO_SRVC (_q, _n) (((_q)->tail_idx + (_n)) & ((_q)->size_mask)) -#define IONIC_INFO_IDX (_q, _i) (_i) +#define IONIC_INFO_IDX (_q, _i) ((_i) * (_q)->num_segs)#define IONIC_INFO_PTR (_q, _i) (&(_q)->info[IONIC_INFO_IDX((_q), _i)])struct ionic_queue {
drivers/net/ionic/ionic_lif.c +44 -5
89 lines not on this page · raw message
drivers/net/ionic/ionic_lif.h +2 -1
@@ -40,7 +40,6 @@ struct ionic_rx_stats {uint64_t packets;uint64_t bytes;uint64_t bad_cq_status; -uint64_t no_room;uint64_t bad_len;uint64_t mtods; };
@@ -80,6 +79,8 @@ struct ionic_rx_qcq {/* cacheline2 */ struct rte_mempool *mb_pool; +uint64_t rearm_data; +uint64_t rearm_seg_data;uint16_t frame_size;/* Based on configured MTU */ uint16_t hdr_seg_size;/* Length of first segment of RX chain */ uint16_t seg_size;/* Length of all subsequent segments */
drivers/net/ionic/ionic_rxtx.c +111 -114
333 lines not on this page · raw message
drivers/net/ionic/ionic_rxtx.h +0 -1
@@ -10,7 +10,6 @@struct ionic_rx_service {/* cb in */ struct rte_mbuf **rx_pkts; -uint16_t nb_pkts;/* cb out */ uint16_t nb_rx; };
Signature · 1 line
2.17.1
PATCH 20/35 net/ionic: overhaul transmit side for performance
In reply to Andrew BoyerLinearize Tx mbuf chains in the info array.
This avoids walking the mbuf chain during flush.
Move a few branches out of the hot path.
--- drivers/net/ionic/ionic_lif.c | 2 +- drivers/net/ionic/ionic_rxtx.c | 143 ++++++++++++++++++++------------- 2 files changed, 87 insertions(+), 58 deletions(-)
drivers/net/ionic/ionic_lif.c +1 -1
@@ -817,7 +817,7 @@ ionic_tx_qcq_alloc(struct ionic_lif *lif, uint32_t socket_id, uint32_t index,"tx" , flags, ntxq_descs, -1 , + num_segs_fw,sizeof (struct ionic_txq_desc ),sizeof (struct ionic_txq_comp ), sizeof(struct ionic_txq_sg_desc_v1),
drivers/net/ionic/ionic_rxtx.c +86 -57
231 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH 20/35 net/ionic: overhaul transmit side for performance
In reply to Andrew BoyerLinearize Tx mbuf chains in the info array.
This avoids walking the mbuf chain during flush.
Move a few branches out of the hot path.
--- drivers/net/ionic/ionic_lif.c | 2 +- drivers/net/ionic/ionic_rxtx.c | 143 ++++++++++++++++++++------------- 2 files changed, 87 insertions(+), 58 deletions(-)
drivers/net/ionic/ionic_lif.c +1 -1
@@ -817,7 +817,7 @@ ionic_tx_qcq_alloc(struct ionic_lif *lif, uint32_t socket_id, uint32_t index,"tx" , flags, ntxq_descs, -1 , + num_segs_fw,sizeof (struct ionic_txq_desc ),sizeof (struct ionic_txq_comp ), sizeof(struct ionic_txq_sg_desc_v1),
drivers/net/ionic/ionic_rxtx.c +86 -57
231 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH 21/35 net/ionic: add support for mbuf fast free
In reply to Andrew BoyerUse a put() rather than a free() in the optimized case.
--- doc/guides/nics/features/ionic.ini | 1 + doc/guides/rel_notes/release_22_11.rst | 1 + drivers/net/ionic/ionic_ethdev.c | 2 +- drivers/net/ionic/ionic_lif.h | 1 + drivers/net/ionic/ionic_rxtx.c | 9 ++++++++- 5 files changed, 12 insertions(+), 2 deletions(-)
doc/guides/nics/features/ionic.ini +1 -0
@@ -7,6 +7,7 @@ Speed capabilities = Y Link status = Y Link status event = Y +Fast mbuf free = Y Queue start/stop = Y MTU update = Y Scattered Rx = Y
doc/guides/rel_notes/release_22_11.rst +1 -0
@@ -84,6 +84,7 @@ New Features * Updated to reflect that Pensando has been acquired by AMD. * Enhanced data path to provide substantial performance improvements. + * Added support for mbuf fast free. Removed Items -------------
drivers/net/ionic/ionic_ethdev.c +1 -1
@@ -396,7 +396,7 @@ ionic_dev_info_get(struct rte_eth_dev *eth_dev,*/ dev_info->rx_queue_offload_capa =0 ; - dev_info->tx_queue_offload_capa =0 ; + dev_info->tx_queue_offload_capa =RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE ;/* * Per-port capabilities
drivers/net/ionic/ionic_lif.h +1 -0
@@ -50,6 +50,7 @@ struct ionic_rx_stats {#define IONIC_QCQ_F_CSUM_L3 BIT(7)#define IONIC_QCQ_F_CSUM_UDP BIT(8)#define IONIC_QCQ_F_CSUM_TCP BIT(9) +#define IONIC_QCQ_F_FAST_FREE BIT(10)/* Queue / Completion Queue */ struct ionic_qcq {
drivers/net/ionic/ionic_rxtx.c +8 -1
@@ -94,6 +94,8 @@ ionic_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id, qinfo->nb_desc = q->num_descs; qinfo->conf.offloads = dev->data->dev_conf.txmode.offloads; +if (txq->flags &IONIC_QCQ_F_FAST_FREE ) + qinfo->conf.offloads |=RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE ; qinfo->conf.tx_deferred_start = txq->flags &IONIC_QCQ_F_DEFERRED ; }
@@ -136,7 +138,10 @@ ionic_tx_flush(struct ionic_tx_qcq *txq)if (!txm)break ; -rte_pktmbuf_free_seg (txm); +if (txq->flags &IONIC_QCQ_F_FAST_FREE ) +rte_mempool_put (txm->pool, txm); +else +rte_pktmbuf_free_seg (txm); info[i] =NULL ; }
@@ -240,6 +245,8 @@ ionic_dev_tx_queue_setup(struct rte_eth_dev *eth_dev, uint16_t tx_queue_id, txq->flags |=IONIC_QCQ_F_CSUM_TCP ;if (offloads &RTE_ETH_TX_OFFLOAD_UDP_CKSUM ) txq->flags |=IONIC_QCQ_F_CSUM_UDP ; +if (offloads &RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE ) + txq->flags |=IONIC_QCQ_F_FAST_FREE ; eth_dev->data->tx_queues[tx_queue_id] = txq;
Signature · 1 line
2.17.1
PATCH 21/35 net/ionic: add support for mbuf fast free
In reply to Andrew BoyerUse a put() rather than a free() in the optimized case.
--- doc/guides/nics/features/ionic.ini | 1 + doc/guides/rel_notes/release_22_11.rst | 1 + drivers/net/ionic/ionic_ethdev.c | 2 +- drivers/net/ionic/ionic_lif.h | 1 + drivers/net/ionic/ionic_rxtx.c | 9 ++++++++- 5 files changed, 12 insertions(+), 2 deletions(-)
doc/guides/nics/features/ionic.ini +1 -0
@@ -7,6 +7,7 @@ Speed capabilities = Y Link status = Y Link status event = Y +Fast mbuf free = Y Queue start/stop = Y MTU update = Y Scattered Rx = Y
doc/guides/rel_notes/release_22_11.rst +1 -0
@@ -165,6 +165,7 @@ New Features * Updated to reflect that Pensando has been acquired by AMD. * Enhanced data path to provide substantial performance improvements. + * Added support for mbuf fast free. * **Added support for MACsec in rte_security.**
drivers/net/ionic/ionic_ethdev.c +1 -1
@@ -396,7 +396,7 @@ ionic_dev_info_get(struct rte_eth_dev *eth_dev,*/ dev_info->rx_queue_offload_capa =0 ; - dev_info->tx_queue_offload_capa =0 ; + dev_info->tx_queue_offload_capa =RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE ;/* * Per-port capabilities
drivers/net/ionic/ionic_lif.h +1 -0
@@ -50,6 +50,7 @@ struct ionic_rx_stats {#define IONIC_QCQ_F_CSUM_L3 BIT(7)#define IONIC_QCQ_F_CSUM_UDP BIT(8)#define IONIC_QCQ_F_CSUM_TCP BIT(9) +#define IONIC_QCQ_F_FAST_FREE BIT(10)/* Queue / Completion Queue */ struct ionic_qcq {
drivers/net/ionic/ionic_rxtx.c +8 -1
@@ -94,6 +94,8 @@ ionic_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id, qinfo->nb_desc = q->num_descs; qinfo->conf.offloads = dev->data->dev_conf.txmode.offloads; +if (txq->flags &IONIC_QCQ_F_FAST_FREE ) + qinfo->conf.offloads |=RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE ; qinfo->conf.tx_deferred_start = txq->flags &IONIC_QCQ_F_DEFERRED ; }
@@ -136,7 +138,10 @@ ionic_tx_flush(struct ionic_tx_qcq *txq)if (!txm)break ; -rte_pktmbuf_free_seg (txm); +if (txq->flags &IONIC_QCQ_F_FAST_FREE ) +rte_mempool_put (txm->pool, txm); +else +rte_pktmbuf_free_seg (txm); info[i] =NULL ; }
@@ -240,6 +245,8 @@ ionic_dev_tx_queue_setup(struct rte_eth_dev *eth_dev, uint16_t tx_queue_id, txq->flags |=IONIC_QCQ_F_CSUM_TCP ;if (offloads &RTE_ETH_TX_OFFLOAD_UDP_CKSUM ) txq->flags |=IONIC_QCQ_F_CSUM_UDP ; +if (offloads &RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE ) + txq->flags |=IONIC_QCQ_F_FAST_FREE ; eth_dev->data->tx_queues[tx_queue_id] = txq;
Signature · 1 line
2.17.1
PATCH 22/35 net/ionic: do bulk allocations of receive mbufs
In reply to Andrew BoyerDo bulk allocations to improve performance.
--- drivers/net/ionic/ionic_lif.h | 6 ++++++ drivers/net/ionic/ionic_rxtx.c | 35 ++++++++++++++++++++++++++-------- 2 files changed, 33 insertions(+), 8 deletions(-)
drivers/net/ionic/ionic_lif.h +6 -0
@@ -17,6 +17,8 @@#define IONIC_ADMINQ_LENGTH 16/* must be a power of two */ #define IONIC_NOTIFYQ_LENGTH 64/* must be a power of two */ +#define IONIC_MBUF_BULK_ALLOC 64/* Multiple of 4 */ +#define IONIC_RSS_OFFLOAD_ALL ( \ IONIC_RSS_TYPE_IPV4 | \ IONIC_RSS_TYPE_IPV4_TCP | \
@@ -86,9 +88,13 @@ struct ionic_rx_qcq {uint16_t hdr_seg_size;/* Length of first segment of RX chain */ uint16_t seg_size;/* Length of all subsequent segments */ uint16_t flags; +uint16_t mb_idx;/* cacheline3 (inside stats) */ struct ionic_rx_stats stats; + +/* cacheline4+ */ + struct rte_mbuf *mbs[IONIC_MBUF_BULK_ALLOC] __rte_cache_aligned; };struct ionic_tx_qcq {
drivers/net/ionic/ionic_rxtx.c +27 -8
@@ -77,6 +77,10 @@ ionic_rx_empty(struct ionic_rx_qcq *rxq)* fragments that were left dangling for later reuse */ ionic_empty_array (q->info, q->num_descs * q->num_segs,0 ); + +ionic_empty_array ((void **)rxq->mbs, +IONIC_MBUF_BULK_ALLOC , rxq->mb_idx); + rxq->mb_idx =0 ; }/*********************************************************************
@@ -950,6 +954,7 @@ ionic_rx_fill_one(struct ionic_rx_qcq *rxq)rte_iova_t data_iova;uint32_t i;void **info; +int ret; info =IONIC_INFO_PTR (q, q->head_idx); desc = &desc_base[q->head_idx];
@@ -959,12 +964,19 @@ ionic_rx_fill_one(struct ionic_rx_qcq *rxq)if (unlikely (info[0 ]))return 0 ; - rxm =rte_mbuf_raw_alloc (rxq->mb_pool); -if (unlikely (rxm ==NULL )) { -assert (0 ); -return -ENOMEM ; +if (rxq->mb_idx ==0 ) { + ret =rte_mempool_get_bulk (rxq->mb_pool, + (void **)rxq->mbs, +IONIC_MBUF_BULK_ALLOC ); +if (ret) { +assert (0 ); +return -ENOMEM ; + } + + rxq->mb_idx =IONIC_MBUF_BULK_ALLOC ; } + rxm = rxq->mbs[--rxq->mb_idx]; info[0 ] = rxm; data_iova =rte_mbuf_data_iova_default (rxm);
@@ -975,12 +987,19 @@ ionic_rx_fill_one(struct ionic_rx_qcq *rxq)if (info[i])return 0 ; - rxm_seg =rte_mbuf_raw_alloc (rxq->mb_pool); -if (rxm_seg ==NULL ) { -assert (0 ); -return -ENOMEM ; +if (rxq->mb_idx ==0 ) { + ret =rte_mempool_get_bulk (rxq->mb_pool, + (void **)rxq->mbs, +IONIC_MBUF_BULK_ALLOC ); +if (ret) { +assert (0 ); +return -ENOMEM ; + } + + rxq->mb_idx =IONIC_MBUF_BULK_ALLOC ; } + rxm_seg = rxq->mbs[--rxq->mb_idx]; info[i] = rxm_seg;/* The data_off does not get set to 0 until later */
Signature · 1 line
2.17.1
PATCH 22/35 net/ionic: do bulk allocations of receive mbufs
In reply to Andrew BoyerDo bulk allocations to improve performance.
--- drivers/net/ionic/ionic_lif.h | 6 ++++++ drivers/net/ionic/ionic_rxtx.c | 35 ++++++++++++++++++++++++++-------- 2 files changed, 33 insertions(+), 8 deletions(-)
drivers/net/ionic/ionic_lif.h +6 -0
@@ -17,6 +17,8 @@#define IONIC_ADMINQ_LENGTH 16/* must be a power of two */ #define IONIC_NOTIFYQ_LENGTH 64/* must be a power of two */ +#define IONIC_MBUF_BULK_ALLOC 64/* Multiple of 4 */ +#define IONIC_RSS_OFFLOAD_ALL ( \ IONIC_RSS_TYPE_IPV4 | \ IONIC_RSS_TYPE_IPV4_TCP | \
@@ -86,9 +88,13 @@ struct ionic_rx_qcq {uint16_t hdr_seg_size;/* Length of first segment of RX chain */ uint16_t seg_size;/* Length of all subsequent segments */ uint16_t flags; +uint16_t mb_idx;/* cacheline3 (inside stats) */ struct ionic_rx_stats stats; + +/* cacheline4+ */ + struct rte_mbuf *mbs[IONIC_MBUF_BULK_ALLOC] __rte_cache_aligned; };struct ionic_tx_qcq {
drivers/net/ionic/ionic_rxtx.c +27 -8
@@ -77,6 +77,10 @@ ionic_rx_empty(struct ionic_rx_qcq *rxq)* fragments that were left dangling for later reuse */ ionic_empty_array (q->info, q->num_descs * q->num_segs,0 ); + +ionic_empty_array ((void **)rxq->mbs, +IONIC_MBUF_BULK_ALLOC , rxq->mb_idx); + rxq->mb_idx =0 ; }/*********************************************************************
@@ -950,6 +954,7 @@ ionic_rx_fill_one(struct ionic_rx_qcq *rxq)rte_iova_t data_iova;uint32_t i;void **info; +int ret; info =IONIC_INFO_PTR (q, q->head_idx); desc = &desc_base[q->head_idx];
@@ -959,12 +964,19 @@ ionic_rx_fill_one(struct ionic_rx_qcq *rxq)if (unlikely (info[0 ]))return 0 ; - rxm =rte_mbuf_raw_alloc (rxq->mb_pool); -if (unlikely (rxm ==NULL )) { -assert (0 ); -return -ENOMEM ; +if (rxq->mb_idx ==0 ) { + ret =rte_mempool_get_bulk (rxq->mb_pool, + (void **)rxq->mbs, +IONIC_MBUF_BULK_ALLOC ); +if (ret) { +assert (0 ); +return -ENOMEM ; + } + + rxq->mb_idx =IONIC_MBUF_BULK_ALLOC ; } + rxm = rxq->mbs[--rxq->mb_idx]; info[0 ] = rxm; data_iova =rte_mbuf_data_iova_default (rxm);
@@ -975,12 +987,19 @@ ionic_rx_fill_one(struct ionic_rx_qcq *rxq)if (info[i])return 0 ; - rxm_seg =rte_mbuf_raw_alloc (rxq->mb_pool); -if (rxm_seg ==NULL ) { -assert (0 ); -return -ENOMEM ; +if (rxq->mb_idx ==0 ) { + ret =rte_mempool_get_bulk (rxq->mb_pool, + (void **)rxq->mbs, +IONIC_MBUF_BULK_ALLOC ); +if (ret) { +assert (0 ); +return -ENOMEM ; + } + + rxq->mb_idx =IONIC_MBUF_BULK_ALLOC ; } + rxm_seg = rxq->mbs[--rxq->mb_idx]; info[i] = rxm_seg;/* The data_off does not get set to 0 until later */
Signature · 1 line
2.17.1
PATCH 23/35 net/ionic: add a lookup table for packet type
In reply to Andrew BoyerThis improves performance by reducing branching.
--- drivers/net/ionic/ionic_rxtx.c | 63 ++++++++++++++++------------------ 1 file changed, 29 insertions(+), 34 deletions(-)
drivers/net/ionic/ionic_rxtx.c +29 -34
@@ -804,6 +804,22 @@ ionic_dev_rx_queue_setup(struct rte_eth_dev *eth_dev,return 0 ; } +/* RTE_PTYPE_UNKNOWN is 0x0 */ +static const uint32_t ionic_ptype_table[IONIC_RXQ_COMP_PKT_TYPE_MASK ] + __rte_cache_aligned = { + [IONIC_PKT_TYPE_NON_IP ] =RTE_PTYPE_UNKNOWN , + [IONIC_PKT_TYPE_IPV4 ] =RTE_PTYPE_L2_ETHER |RTE_PTYPE_L3_IPV4 , + [IONIC_PKT_TYPE_IPV4_TCP ] = +RTE_PTYPE_L2_ETHER |RTE_PTYPE_L3_IPV4 |RTE_PTYPE_L4_TCP , + [IONIC_PKT_TYPE_IPV4_UDP ] = +RTE_PTYPE_L2_ETHER |RTE_PTYPE_L3_IPV4 |RTE_PTYPE_L4_UDP , + [IONIC_PKT_TYPE_IPV6 ] =RTE_PTYPE_L2_ETHER |RTE_PTYPE_L3_IPV6 , + [IONIC_PKT_TYPE_IPV6_TCP ] = +RTE_PTYPE_L2_ETHER |RTE_PTYPE_L3_IPV6 |RTE_PTYPE_L4_TCP , + [IONIC_PKT_TYPE_IPV6_UDP ] = +RTE_PTYPE_L2_ETHER |RTE_PTYPE_L3_IPV6 |RTE_PTYPE_L4_UDP , +}; +/* * Cleans one descriptor. Connects the filled mbufs into a chain. * Does not advance the tail index.
@@ -820,6 +836,7 @@ ionic_rx_clean_one(struct ionic_rx_qcq *rxq,uint32_t pkt_type;uint32_t left, i;uint16_t cq_desc_len; +uint8_t ptype;void **info; cq_desc_len =rte_le_to_cpu_16 (cq_desc->len);
@@ -895,41 +912,19 @@ ionic_rx_clean_one(struct ionic_rx_qcq *rxq, rxm->ol_flags = pkt_flags;/* Packet Type */ -switch (cq_desc->pkt_type_color &IONIC_RXQ_COMP_PKT_TYPE_MASK ) { -case IONIC_PKT_TYPE_IPV4 : - pkt_type =RTE_PTYPE_L2_ETHER |RTE_PTYPE_L3_IPV4 ; -break ; -case IONIC_PKT_TYPE_IPV6 : - pkt_type =RTE_PTYPE_L2_ETHER |RTE_PTYPE_L3_IPV6 ; -break ; -case IONIC_PKT_TYPE_IPV4_TCP : - pkt_type =RTE_PTYPE_L2_ETHER |RTE_PTYPE_L3_IPV4 | -RTE_PTYPE_L4_TCP ; -break ; -case IONIC_PKT_TYPE_IPV6_TCP : - pkt_type =RTE_PTYPE_L2_ETHER |RTE_PTYPE_L3_IPV6 | -RTE_PTYPE_L4_TCP ; -break ; -case IONIC_PKT_TYPE_IPV4_UDP : - pkt_type =RTE_PTYPE_L2_ETHER |RTE_PTYPE_L3_IPV4 | -RTE_PTYPE_L4_UDP ; -break ; -case IONIC_PKT_TYPE_IPV6_UDP : - pkt_type =RTE_PTYPE_L2_ETHER |RTE_PTYPE_L3_IPV6 | -RTE_PTYPE_L4_UDP ; -break ; -default : - { -struct rte_ether_hdr *eth_h =rte_pktmbuf_mtod (rxm, + ptype = cq_desc->pkt_type_color &IONIC_RXQ_COMP_PKT_TYPE_MASK ; + pkt_type = ionic_ptype_table[ptype]; +if (pkt_type ==RTE_PTYPE_UNKNOWN ) { +struct rte_ether_hdr *eth_h =rte_pktmbuf_mtod (rxm, struct rte_ether_hdr *); -uint16_t ether_type = eth_h->ether_type; -if (ether_type ==rte_cpu_to_be_16 (RTE_ETHER_TYPE_ARP )) - pkt_type =RTE_PTYPE_L2_ETHER_ARP ; -else - pkt_type =RTE_PTYPE_UNKNOWN ; - stats->mtods++; -break ; - } +uint16_t ether_type = eth_h->ether_type; +if (ether_type ==rte_cpu_to_be_16 (RTE_ETHER_TYPE_ARP )) + pkt_type =RTE_PTYPE_L2_ETHER_ARP ; +else if (ether_type ==rte_cpu_to_be_16 (RTE_ETHER_TYPE_LLDP )) + pkt_type =RTE_PTYPE_L2_ETHER_LLDP ; +else if (ether_type ==rte_cpu_to_be_16 (RTE_ETHER_TYPE_1588 )) + pkt_type =RTE_PTYPE_L2_ETHER_TIMESYNC ; + stats->mtods++; } rxm->packet_type = pkt_type;
Signature · 1 line
2.17.1
PATCH 23/35 net/ionic: add a lookup table for packet type
In reply to Andrew BoyerThis improves performance by reducing branching.
--- drivers/net/ionic/ionic_rxtx.c | 63 ++++++++++++++++------------------ 1 file changed, 29 insertions(+), 34 deletions(-)
drivers/net/ionic/ionic_rxtx.c +29 -34
@@ -804,6 +804,22 @@ ionic_dev_rx_queue_setup(struct rte_eth_dev *eth_dev,return 0 ; } +/* RTE_PTYPE_UNKNOWN is 0x0 */ +static const uint32_t ionic_ptype_table[IONIC_RXQ_COMP_PKT_TYPE_MASK ] + __rte_cache_aligned = { + [IONIC_PKT_TYPE_NON_IP ] =RTE_PTYPE_UNKNOWN , + [IONIC_PKT_TYPE_IPV4 ] =RTE_PTYPE_L2_ETHER |RTE_PTYPE_L3_IPV4 , + [IONIC_PKT_TYPE_IPV4_TCP ] = +RTE_PTYPE_L2_ETHER |RTE_PTYPE_L3_IPV4 |RTE_PTYPE_L4_TCP , + [IONIC_PKT_TYPE_IPV4_UDP ] = +RTE_PTYPE_L2_ETHER |RTE_PTYPE_L3_IPV4 |RTE_PTYPE_L4_UDP , + [IONIC_PKT_TYPE_IPV6 ] =RTE_PTYPE_L2_ETHER |RTE_PTYPE_L3_IPV6 , + [IONIC_PKT_TYPE_IPV6_TCP ] = +RTE_PTYPE_L2_ETHER |RTE_PTYPE_L3_IPV6 |RTE_PTYPE_L4_TCP , + [IONIC_PKT_TYPE_IPV6_UDP ] = +RTE_PTYPE_L2_ETHER |RTE_PTYPE_L3_IPV6 |RTE_PTYPE_L4_UDP , +}; +/* * Cleans one descriptor. Connects the filled mbufs into a chain. * Does not advance the tail index.
@@ -820,6 +836,7 @@ ionic_rx_clean_one(struct ionic_rx_qcq *rxq,uint32_t pkt_type;uint32_t left, i;uint16_t cq_desc_len; +uint8_t ptype;void **info; cq_desc_len =rte_le_to_cpu_16 (cq_desc->len);
@@ -895,41 +912,19 @@ ionic_rx_clean_one(struct ionic_rx_qcq *rxq, rxm->ol_flags = pkt_flags;/* Packet Type */ -switch (cq_desc->pkt_type_color &IONIC_RXQ_COMP_PKT_TYPE_MASK ) { -case IONIC_PKT_TYPE_IPV4 : - pkt_type =RTE_PTYPE_L2_ETHER |RTE_PTYPE_L3_IPV4 ; -break ; -case IONIC_PKT_TYPE_IPV6 : - pkt_type =RTE_PTYPE_L2_ETHER |RTE_PTYPE_L3_IPV6 ; -break ; -case IONIC_PKT_TYPE_IPV4_TCP : - pkt_type =RTE_PTYPE_L2_ETHER |RTE_PTYPE_L3_IPV4 | -RTE_PTYPE_L4_TCP ; -break ; -case IONIC_PKT_TYPE_IPV6_TCP : - pkt_type =RTE_PTYPE_L2_ETHER |RTE_PTYPE_L3_IPV6 | -RTE_PTYPE_L4_TCP ; -break ; -case IONIC_PKT_TYPE_IPV4_UDP : - pkt_type =RTE_PTYPE_L2_ETHER |RTE_PTYPE_L3_IPV4 | -RTE_PTYPE_L4_UDP ; -break ; -case IONIC_PKT_TYPE_IPV6_UDP : - pkt_type =RTE_PTYPE_L2_ETHER |RTE_PTYPE_L3_IPV6 | -RTE_PTYPE_L4_UDP ; -break ; -default : - { -struct rte_ether_hdr *eth_h =rte_pktmbuf_mtod (rxm, + ptype = cq_desc->pkt_type_color &IONIC_RXQ_COMP_PKT_TYPE_MASK ; + pkt_type = ionic_ptype_table[ptype]; +if (pkt_type ==RTE_PTYPE_UNKNOWN ) { +struct rte_ether_hdr *eth_h =rte_pktmbuf_mtod (rxm, struct rte_ether_hdr *); -uint16_t ether_type = eth_h->ether_type; -if (ether_type ==rte_cpu_to_be_16 (RTE_ETHER_TYPE_ARP )) - pkt_type =RTE_PTYPE_L2_ETHER_ARP ; -else - pkt_type =RTE_PTYPE_UNKNOWN ; - stats->mtods++; -break ; - } +uint16_t ether_type = eth_h->ether_type; +if (ether_type ==rte_cpu_to_be_16 (RTE_ETHER_TYPE_ARP )) + pkt_type =RTE_PTYPE_L2_ETHER_ARP ; +else if (ether_type ==rte_cpu_to_be_16 (RTE_ETHER_TYPE_LLDP )) + pkt_type =RTE_PTYPE_L2_ETHER_LLDP ; +else if (ether_type ==rte_cpu_to_be_16 (RTE_ETHER_TYPE_1588 )) + pkt_type =RTE_PTYPE_L2_ETHER_TIMESYNC ; + stats->mtods++; } rxm->packet_type = pkt_type;
Signature · 1 line
2.17.1
PATCH 24/35 net/ionic: add a lookup table for checksum flags
In reply to Andrew BoyerThis improves performance by reducing branching.
--- drivers/net/ionic/ionic_rxtx.c | 47 ++++++++++++++++++++++++---------- 1 file changed, 33 insertions(+), 14 deletions(-)
drivers/net/ionic/ionic_rxtx.c +33 -14
@@ -804,6 +804,36 @@ ionic_dev_rx_queue_setup(struct rte_eth_dev *eth_dev,return 0 ; } +#define IONIC_CSUM_FLAG_MASK (IONIC_RXQ_COMP_CSUM_F_VLAN - 1) +static const uint64_t ionic_csum_flags[IONIC_CSUM_FLAG_MASK ] + __rte_cache_aligned = { +/* IP_BAD set */ + [IONIC_RXQ_COMP_CSUM_F_IP_BAD ] =RTE_MBUF_F_RX_IP_CKSUM_BAD , + [IONIC_RXQ_COMP_CSUM_F_IP_BAD |IONIC_RXQ_COMP_CSUM_F_TCP_OK ] = +RTE_MBUF_F_RX_IP_CKSUM_BAD |RTE_MBUF_F_RX_L4_CKSUM_GOOD , + [IONIC_RXQ_COMP_CSUM_F_IP_BAD |IONIC_RXQ_COMP_CSUM_F_TCP_BAD ] = +RTE_MBUF_F_RX_IP_CKSUM_BAD |RTE_MBUF_F_RX_L4_CKSUM_BAD , + [IONIC_RXQ_COMP_CSUM_F_IP_BAD |IONIC_RXQ_COMP_CSUM_F_UDP_OK ] = +RTE_MBUF_F_RX_IP_CKSUM_BAD |RTE_MBUF_F_RX_L4_CKSUM_GOOD , + [IONIC_RXQ_COMP_CSUM_F_IP_BAD |IONIC_RXQ_COMP_CSUM_F_UDP_BAD ] = +RTE_MBUF_F_RX_IP_CKSUM_BAD |RTE_MBUF_F_RX_L4_CKSUM_BAD , +/* IP_OK set */ + [IONIC_RXQ_COMP_CSUM_F_IP_OK ] =RTE_MBUF_F_RX_IP_CKSUM_GOOD , + [IONIC_RXQ_COMP_CSUM_F_IP_OK |IONIC_RXQ_COMP_CSUM_F_TCP_OK ] = +RTE_MBUF_F_RX_IP_CKSUM_GOOD |RTE_MBUF_F_RX_L4_CKSUM_GOOD , + [IONIC_RXQ_COMP_CSUM_F_IP_OK |IONIC_RXQ_COMP_CSUM_F_TCP_BAD ] = +RTE_MBUF_F_RX_IP_CKSUM_GOOD |RTE_MBUF_F_RX_L4_CKSUM_BAD , + [IONIC_RXQ_COMP_CSUM_F_IP_OK |IONIC_RXQ_COMP_CSUM_F_UDP_OK ] = +RTE_MBUF_F_RX_IP_CKSUM_GOOD |RTE_MBUF_F_RX_L4_CKSUM_GOOD , + [IONIC_RXQ_COMP_CSUM_F_IP_OK |IONIC_RXQ_COMP_CSUM_F_UDP_BAD ] = +RTE_MBUF_F_RX_IP_CKSUM_GOOD |RTE_MBUF_F_RX_L4_CKSUM_BAD , +/* No IP flag set */ + [IONIC_RXQ_COMP_CSUM_F_TCP_OK ] =RTE_MBUF_F_RX_L4_CKSUM_GOOD , + [IONIC_RXQ_COMP_CSUM_F_TCP_BAD ] =RTE_MBUF_F_RX_L4_CKSUM_BAD , + [IONIC_RXQ_COMP_CSUM_F_UDP_OK ] =RTE_MBUF_F_RX_L4_CKSUM_GOOD , + [IONIC_RXQ_COMP_CSUM_F_UDP_BAD ] =RTE_MBUF_F_RX_L4_CKSUM_BAD , +}; +/* RTE_PTYPE_UNKNOWN is 0x0 */ static const uint32_t ionic_ptype_table[IONIC_RXQ_COMP_PKT_TYPE_MASK ] __rte_cache_aligned = {
@@ -836,7 +866,7 @@ ionic_rx_clean_one(struct ionic_rx_qcq *rxq,uint32_t pkt_type;uint32_t left, i;uint16_t cq_desc_len; -uint8_t ptype; +uint8_t ptype, cflags;void **info; cq_desc_len =rte_le_to_cpu_16 (cq_desc->len);
@@ -894,19 +924,8 @@ ionic_rx_clean_one(struct ionic_rx_qcq *rxq,/* Checksum */ if (cq_desc->csum_flags &IONIC_RXQ_COMP_CSUM_F_CALC ) { -if (cq_desc->csum_flags &IONIC_RXQ_COMP_CSUM_F_IP_OK ) - pkt_flags |=RTE_MBUF_F_RX_IP_CKSUM_GOOD ; -else if (cq_desc->csum_flags &IONIC_RXQ_COMP_CSUM_F_IP_BAD ) - pkt_flags |=RTE_MBUF_F_RX_IP_CKSUM_BAD ; - -if ((cq_desc->csum_flags &IONIC_RXQ_COMP_CSUM_F_TCP_OK ) || - (cq_desc->csum_flags &IONIC_RXQ_COMP_CSUM_F_UDP_OK )) - pkt_flags |=RTE_MBUF_F_RX_L4_CKSUM_GOOD ; -else if ((cq_desc->csum_flags & -IONIC_RXQ_COMP_CSUM_F_TCP_BAD ) || - (cq_desc->csum_flags & -IONIC_RXQ_COMP_CSUM_F_UDP_BAD )) - pkt_flags |=RTE_MBUF_F_RX_L4_CKSUM_BAD ; + cflags = cq_desc->csum_flags &IONIC_CSUM_FLAG_MASK ; + pkt_flags |= ionic_csum_flags[cflags]; } rxm->ol_flags = pkt_flags;
Signature · 1 line
2.17.1
PATCH 24/35 net/ionic: add a lookup table for checksum flags
In reply to Andrew BoyerThis improves performance by reducing branching.
--- drivers/net/ionic/ionic_rxtx.c | 47 ++++++++++++++++++++++++---------- 1 file changed, 33 insertions(+), 14 deletions(-)
drivers/net/ionic/ionic_rxtx.c +33 -14
@@ -804,6 +804,36 @@ ionic_dev_rx_queue_setup(struct rte_eth_dev *eth_dev,return 0 ; } +#define IONIC_CSUM_FLAG_MASK (IONIC_RXQ_COMP_CSUM_F_VLAN - 1) +static const uint64_t ionic_csum_flags[IONIC_CSUM_FLAG_MASK ] + __rte_cache_aligned = { +/* IP_BAD set */ + [IONIC_RXQ_COMP_CSUM_F_IP_BAD ] =RTE_MBUF_F_RX_IP_CKSUM_BAD , + [IONIC_RXQ_COMP_CSUM_F_IP_BAD |IONIC_RXQ_COMP_CSUM_F_TCP_OK ] = +RTE_MBUF_F_RX_IP_CKSUM_BAD |RTE_MBUF_F_RX_L4_CKSUM_GOOD , + [IONIC_RXQ_COMP_CSUM_F_IP_BAD |IONIC_RXQ_COMP_CSUM_F_TCP_BAD ] = +RTE_MBUF_F_RX_IP_CKSUM_BAD |RTE_MBUF_F_RX_L4_CKSUM_BAD , + [IONIC_RXQ_COMP_CSUM_F_IP_BAD |IONIC_RXQ_COMP_CSUM_F_UDP_OK ] = +RTE_MBUF_F_RX_IP_CKSUM_BAD |RTE_MBUF_F_RX_L4_CKSUM_GOOD , + [IONIC_RXQ_COMP_CSUM_F_IP_BAD |IONIC_RXQ_COMP_CSUM_F_UDP_BAD ] = +RTE_MBUF_F_RX_IP_CKSUM_BAD |RTE_MBUF_F_RX_L4_CKSUM_BAD , +/* IP_OK set */ + [IONIC_RXQ_COMP_CSUM_F_IP_OK ] =RTE_MBUF_F_RX_IP_CKSUM_GOOD , + [IONIC_RXQ_COMP_CSUM_F_IP_OK |IONIC_RXQ_COMP_CSUM_F_TCP_OK ] = +RTE_MBUF_F_RX_IP_CKSUM_GOOD |RTE_MBUF_F_RX_L4_CKSUM_GOOD , + [IONIC_RXQ_COMP_CSUM_F_IP_OK |IONIC_RXQ_COMP_CSUM_F_TCP_BAD ] = +RTE_MBUF_F_RX_IP_CKSUM_GOOD |RTE_MBUF_F_RX_L4_CKSUM_BAD , + [IONIC_RXQ_COMP_CSUM_F_IP_OK |IONIC_RXQ_COMP_CSUM_F_UDP_OK ] = +RTE_MBUF_F_RX_IP_CKSUM_GOOD |RTE_MBUF_F_RX_L4_CKSUM_GOOD , + [IONIC_RXQ_COMP_CSUM_F_IP_OK |IONIC_RXQ_COMP_CSUM_F_UDP_BAD ] = +RTE_MBUF_F_RX_IP_CKSUM_GOOD |RTE_MBUF_F_RX_L4_CKSUM_BAD , +/* No IP flag set */ + [IONIC_RXQ_COMP_CSUM_F_TCP_OK ] =RTE_MBUF_F_RX_L4_CKSUM_GOOD , + [IONIC_RXQ_COMP_CSUM_F_TCP_BAD ] =RTE_MBUF_F_RX_L4_CKSUM_BAD , + [IONIC_RXQ_COMP_CSUM_F_UDP_OK ] =RTE_MBUF_F_RX_L4_CKSUM_GOOD , + [IONIC_RXQ_COMP_CSUM_F_UDP_BAD ] =RTE_MBUF_F_RX_L4_CKSUM_BAD , +}; +/* RTE_PTYPE_UNKNOWN is 0x0 */ static const uint32_t ionic_ptype_table[IONIC_RXQ_COMP_PKT_TYPE_MASK ] __rte_cache_aligned = {
@@ -836,7 +866,7 @@ ionic_rx_clean_one(struct ionic_rx_qcq *rxq,uint32_t pkt_type;uint32_t left, i;uint16_t cq_desc_len; -uint8_t ptype; +uint8_t ptype, cflags;void **info; cq_desc_len =rte_le_to_cpu_16 (cq_desc->len);
@@ -894,19 +924,8 @@ ionic_rx_clean_one(struct ionic_rx_qcq *rxq,/* Checksum */ if (cq_desc->csum_flags &IONIC_RXQ_COMP_CSUM_F_CALC ) { -if (cq_desc->csum_flags &IONIC_RXQ_COMP_CSUM_F_IP_OK ) - pkt_flags |=RTE_MBUF_F_RX_IP_CKSUM_GOOD ; -else if (cq_desc->csum_flags &IONIC_RXQ_COMP_CSUM_F_IP_BAD ) - pkt_flags |=RTE_MBUF_F_RX_IP_CKSUM_BAD ; - -if ((cq_desc->csum_flags &IONIC_RXQ_COMP_CSUM_F_TCP_OK ) || - (cq_desc->csum_flags &IONIC_RXQ_COMP_CSUM_F_UDP_OK )) - pkt_flags |=RTE_MBUF_F_RX_L4_CKSUM_GOOD ; -else if ((cq_desc->csum_flags & -IONIC_RXQ_COMP_CSUM_F_TCP_BAD ) || - (cq_desc->csum_flags & -IONIC_RXQ_COMP_CSUM_F_UDP_BAD )) - pkt_flags |=RTE_MBUF_F_RX_L4_CKSUM_BAD ; + cflags = cq_desc->csum_flags &IONIC_CSUM_FLAG_MASK ; + pkt_flags |= ionic_csum_flags[cflags]; } rxm->ol_flags = pkt_flags;
Signature · 1 line
2.17.1
PATCH 25/35 net/ionic: advertise supported packet types
In reply to Andrew BoyerThis improves performance, since clients may be able to skip SW packet classification.
--- doc/guides/rel_notes/release_22_11.rst | 1 + drivers/net/ionic/ionic_ethdev.c | 1 + drivers/net/ionic/ionic_rxtx.c | 19 +++++++++++++++++++ drivers/net/ionic/ionic_rxtx.h | 2 ++ 4 files changed, 23 insertions(+)
doc/guides/rel_notes/release_22_11.rst +1 -0
@@ -85,6 +85,7 @@ New Features * Updated to reflect that Pensando has been acquired by AMD. * Enhanced data path to provide substantial performance improvements. * Added support for mbuf fast free. + * Added support for advertising packet types. Removed Items -------------
drivers/net/ionic/ionic_ethdev.c +1 -0
@@ -70,6 +70,7 @@ static const struct rte_eth_desc_lim tx_desc_lim_v1 = {static const struct eth_dev_ops ionic_eth_dev_ops = { .dev_infos_get = ionic_dev_info_get, + .dev_supported_ptypes_get = ionic_dev_supported_ptypes_get, .dev_configure = ionic_dev_configure, .mtu_set = ionic_dev_mtu_set, .dev_start = ionic_dev_start,
drivers/net/ionic/ionic_rxtx.c +19 -0
@@ -850,6 +850,25 @@ static const uint32_t ionic_ptype_table[IONIC_RXQ_COMP_PKT_TYPE_MASK] RTE_PTYPE_L2_ETHER | RTE_PTYPE_L3_IPV6 | RTE_PTYPE_L4_UDP, }; +const uint32_t * +ionic_dev_supported_ptypes_get(struct rte_eth_dev *dev __rte_unused) +{ +/* See ionic_ptype_table[] */ +static const uint32_t ptypes[] = { +RTE_PTYPE_L2_ETHER , +RTE_PTYPE_L2_ETHER_TIMESYNC , +RTE_PTYPE_L2_ETHER_LLDP , +RTE_PTYPE_L2_ETHER_ARP , +RTE_PTYPE_L3_IPV4 , +RTE_PTYPE_L3_IPV6 , +RTE_PTYPE_L4_TCP , +RTE_PTYPE_L4_UDP , +RTE_PTYPE_UNKNOWN + }; + +return ptypes; +} +/* * Cleans one descriptor. Connects the filled mbufs into a chain. * Does not advance the tail index.
drivers/net/ionic/ionic_rxtx.h +2 -0
@@ -40,4 +40,6 @@ void ionic_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,void ionic_txq_info_get (struct rte_eth_dev *dev,uint16_t queue_id,struct rte_eth_txq_info *qinfo); +const uint32_t *ionic_dev_supported_ptypes_get (struct rte_eth_dev *dev); +#endif /* _IONIC_RXTX_H_ */
Signature · 1 line
2.17.1
PATCH 25/35 net/ionic: advertise supported packet types
In reply to Andrew BoyerThis improves performance, since clients may be able to skip SW packet classification.
--- doc/guides/rel_notes/release_22_11.rst | 1 + drivers/net/ionic/ionic_ethdev.c | 1 + drivers/net/ionic/ionic_rxtx.c | 19 +++++++++++++++++++ drivers/net/ionic/ionic_rxtx.h | 2 ++ 4 files changed, 23 insertions(+)
doc/guides/rel_notes/release_22_11.rst +1 -0
@@ -166,6 +166,7 @@ New Features * Updated to reflect that Pensando has been acquired by AMD. * Enhanced data path to provide substantial performance improvements. * Added support for mbuf fast free. + * Added support for advertising packet types. * **Added support for MACsec in rte_security.**
drivers/net/ionic/ionic_ethdev.c +1 -0
@@ -70,6 +70,7 @@ static const struct rte_eth_desc_lim tx_desc_lim_v1 = {static const struct eth_dev_ops ionic_eth_dev_ops = { .dev_infos_get = ionic_dev_info_get, + .dev_supported_ptypes_get = ionic_dev_supported_ptypes_get, .dev_configure = ionic_dev_configure, .mtu_set = ionic_dev_mtu_set, .dev_start = ionic_dev_start,
drivers/net/ionic/ionic_rxtx.c +19 -0
@@ -850,6 +850,25 @@ static const uint32_t ionic_ptype_table[IONIC_RXQ_COMP_PKT_TYPE_MASK] RTE_PTYPE_L2_ETHER | RTE_PTYPE_L3_IPV6 | RTE_PTYPE_L4_UDP, }; +const uint32_t * +ionic_dev_supported_ptypes_get(struct rte_eth_dev *dev __rte_unused) +{ +/* See ionic_ptype_table[] */ +static const uint32_t ptypes[] = { +RTE_PTYPE_L2_ETHER , +RTE_PTYPE_L2_ETHER_TIMESYNC , +RTE_PTYPE_L2_ETHER_LLDP , +RTE_PTYPE_L2_ETHER_ARP , +RTE_PTYPE_L3_IPV4 , +RTE_PTYPE_L3_IPV6 , +RTE_PTYPE_L4_TCP , +RTE_PTYPE_L4_UDP , +RTE_PTYPE_UNKNOWN + }; + +return ptypes; +} +/* * Cleans one descriptor. Connects the filled mbufs into a chain. * Does not advance the tail index.
drivers/net/ionic/ionic_rxtx.h +2 -0
@@ -40,4 +40,6 @@ void ionic_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,void ionic_txq_info_get (struct rte_eth_dev *dev,uint16_t queue_id,struct rte_eth_txq_info *qinfo); +const uint32_t *ionic_dev_supported_ptypes_get (struct rte_eth_dev *dev); +#endif /* _IONIC_RXTX_H_ */
Signature · 1 line
2.17.1
PATCH 26/35 net/ionic: add Rx descriptor status functions
In reply to Andrew BoyerThese may be useful for clients.
--- doc/guides/nics/features/ionic.ini | 1 + doc/guides/rel_notes/release_22_11.rst | 1 + drivers/net/ionic/ionic_ethdev.c | 2 ++ drivers/net/ionic/ionic_rxtx.c | 39 ++++++++++++++++++++++++++ drivers/net/ionic/ionic_rxtx.h | 2 ++ 5 files changed, 45 insertions(+)
doc/guides/nics/features/ionic.ini +1 -0
@@ -27,6 +27,7 @@ CRC offload = Y L3 checksum offload = Y L4 checksum offload = Y Packet type parsing = Y +Rx descriptor status = Y Basic stats = Y Extended stats = Y Stats per queue = Y
doc/guides/rel_notes/release_22_11.rst +1 -0
@@ -86,6 +86,7 @@ New Features * Enhanced data path to provide substantial performance improvements. * Added support for mbuf fast free. * Added support for advertising packet types. + * Added support for descriptor status functions. Removed Items -------------
drivers/net/ionic/ionic_ethdev.c +2 -0
@@ -984,6 +984,8 @@ eth_ionic_dev_init(struct rte_eth_dev *eth_dev, void *init_params) eth_dev->tx_pkt_burst = &ionic_xmit_pkts; eth_dev->tx_pkt_prepare = &ionic_prep_pkts; + eth_dev->rx_descriptor_status = ionic_dev_rx_descriptor_status; +/* Multi-process not supported, primary does initialization anyway */ if (rte_eal_process_type () !=RTE_PROC_PRIMARY )return 0 ;
drivers/net/ionic/ionic_rxtx.c +39 -0
@@ -1235,3 +1235,42 @@ ionic_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,return rx_svc.nb_rx; } + +int +ionic_dev_rx_descriptor_status (void *rx_queue,uint16_t offset) +{ +struct ionic_rx_qcq *rxq = rx_queue; +struct ionic_qcq *qcq = &rxq->qcq; +struct ionic_rxq_comp *cq_desc; +uint16_t mask, head, tail, pos; +bool done_color; + + mask = qcq->q.size_mask; + +/* offset must be within the size of the ring */ +if (offset > mask) +return -EINVAL ; + + head = qcq->q.head_idx; + tail = qcq->q.tail_idx; + +/* offset is beyond what is posted */ +if (offset >= ((head - tail) & mask)) +return RTE_ETH_RX_DESC_UNAVAIL ; + +/* interested in this absolute position in the rxq */ + pos = (tail + offset) & mask; + +/* rx cq position == rx q position */ + cq_desc = qcq->cq.base; + cq_desc = &cq_desc[pos]; + +/* expected done color at this position */ + done_color = qcq->cq.done_color != (pos < tail); + +/* has the hw indicated the done color at this position? */ +if (color_match (cq_desc->pkt_type_color, done_color)) +return RTE_ETH_RX_DESC_DONE ; + +return RTE_ETH_RX_DESC_AVAIL ; +}
drivers/net/ionic/ionic_rxtx.h +2 -0
@@ -40,6 +40,8 @@ void ionic_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,void ionic_txq_info_get (struct rte_eth_dev *dev,uint16_t queue_id,struct rte_eth_txq_info *qinfo); +int ionic_dev_rx_descriptor_status (void *rx_queue,uint16_t offset); +const uint32_t *ionic_dev_supported_ptypes_get (struct rte_eth_dev *dev);#endif /* _IONIC_RXTX_H_ */
Signature · 1 line
2.17.1
PATCH 26/35 net/ionic: add Rx descriptor status functions
In reply to Andrew BoyerThese may be useful for clients.
--- doc/guides/nics/features/ionic.ini | 1 + doc/guides/rel_notes/release_22_11.rst | 1 + drivers/net/ionic/ionic_ethdev.c | 2 ++ drivers/net/ionic/ionic_rxtx.c | 39 ++++++++++++++++++++++++++ drivers/net/ionic/ionic_rxtx.h | 2 ++ 5 files changed, 45 insertions(+)
doc/guides/nics/features/ionic.ini +1 -0
@@ -27,6 +27,7 @@ CRC offload = Y L3 checksum offload = Y L4 checksum offload = Y Packet type parsing = Y +Rx descriptor status = Y Basic stats = Y Extended stats = Y Stats per queue = Y
doc/guides/rel_notes/release_22_11.rst +1 -0
@@ -167,6 +167,7 @@ New Features * Enhanced data path to provide substantial performance improvements. * Added support for mbuf fast free. * Added support for advertising packet types. + * Added support for descriptor status functions. * **Added support for MACsec in rte_security.**
drivers/net/ionic/ionic_ethdev.c +2 -0
@@ -984,6 +984,8 @@ eth_ionic_dev_init(struct rte_eth_dev *eth_dev, void *init_params) eth_dev->tx_pkt_burst = &ionic_xmit_pkts; eth_dev->tx_pkt_prepare = &ionic_prep_pkts; + eth_dev->rx_descriptor_status = ionic_dev_rx_descriptor_status; +/* Multi-process not supported, primary does initialization anyway */ if (rte_eal_process_type () !=RTE_PROC_PRIMARY )return 0 ;
drivers/net/ionic/ionic_rxtx.c +39 -0
@@ -1235,3 +1235,42 @@ ionic_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,return rx_svc.nb_rx; } + +int +ionic_dev_rx_descriptor_status (void *rx_queue,uint16_t offset) +{ +struct ionic_rx_qcq *rxq = rx_queue; +struct ionic_qcq *qcq = &rxq->qcq; +struct ionic_rxq_comp *cq_desc; +uint16_t mask, head, tail, pos; +bool done_color; + + mask = qcq->q.size_mask; + +/* offset must be within the size of the ring */ +if (offset > mask) +return -EINVAL ; + + head = qcq->q.head_idx; + tail = qcq->q.tail_idx; + +/* offset is beyond what is posted */ +if (offset >= ((head - tail) & mask)) +return RTE_ETH_RX_DESC_UNAVAIL ; + +/* interested in this absolute position in the rxq */ + pos = (tail + offset) & mask; + +/* rx cq position == rx q position */ + cq_desc = qcq->cq.base; + cq_desc = &cq_desc[pos]; + +/* expected done color at this position */ + done_color = qcq->cq.done_color != (pos < tail); + +/* has the hw indicated the done color at this position? */ +if (color_match (cq_desc->pkt_type_color, done_color)) +return RTE_ETH_RX_DESC_DONE ; + +return RTE_ETH_RX_DESC_AVAIL ; +}
drivers/net/ionic/ionic_rxtx.h +2 -0
@@ -40,6 +40,8 @@ void ionic_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,void ionic_txq_info_get (struct rte_eth_dev *dev,uint16_t queue_id,struct rte_eth_txq_info *qinfo); +int ionic_dev_rx_descriptor_status (void *rx_queue,uint16_t offset); +const uint32_t *ionic_dev_supported_ptypes_get (struct rte_eth_dev *dev);#endif /* _IONIC_RXTX_H_ */
Signature · 1 line
2.17.1
PATCH 27/35 net/ionic: add Tx descriptor status function
In reply to Andrew BoyerThis may be useful for clients.
--- doc/guides/nics/features/ionic.ini | 1 + drivers/net/ionic/ionic_ethdev.c | 1 + drivers/net/ionic/ionic_rxtx.c | 51 ++++++++++++++++++++++++++++++ drivers/net/ionic/ionic_rxtx.h | 1 + 4 files changed, 54 insertions(+)
doc/guides/nics/features/ionic.ini +1 -0
@@ -28,6 +28,7 @@ L3 checksum offload = Y L4 checksum offload = Y Packet type parsing = Y Rx descriptor status = Y +Tx descriptor status = Y Basic stats = Y Extended stats = Y Stats per queue = Y
drivers/net/ionic/ionic_ethdev.c +1 -0
@@ -985,6 +985,7 @@ eth_ionic_dev_init(struct rte_eth_dev *eth_dev, void *init_params) eth_dev->tx_pkt_prepare = &ionic_prep_pkts; eth_dev->rx_descriptor_status = ionic_dev_rx_descriptor_status; + eth_dev->tx_descriptor_status = ionic_dev_tx_descriptor_status;/* Multi-process not supported, primary does initialization anyway */ if (rte_eal_process_type () !=RTE_PROC_PRIMARY )
drivers/net/ionic/ionic_rxtx.c +51 -0
54 lines not on this page · raw message
drivers/net/ionic/ionic_rxtx.h +1 -0
@@ -41,6 +41,7 @@ void ionic_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id, struct rte_eth_txq_info *qinfo);int ionic_dev_rx_descriptor_status (void *rx_queue,uint16_t offset); +int ionic_dev_tx_descriptor_status (void *tx_queue,uint16_t offset);const uint32_t *ionic_dev_supported_ptypes_get (struct rte_eth_dev *dev);
Signature · 1 line
2.17.1
PATCH 27/35 net/ionic: add Tx descriptor status function
In reply to Andrew BoyerThis may be useful for clients.
--- doc/guides/nics/features/ionic.ini | 1 + drivers/net/ionic/ionic_ethdev.c | 1 + drivers/net/ionic/ionic_rxtx.c | 51 ++++++++++++++++++++++++++++++ drivers/net/ionic/ionic_rxtx.h | 1 + 4 files changed, 54 insertions(+)
doc/guides/nics/features/ionic.ini +1 -0
@@ -28,6 +28,7 @@ L3 checksum offload = Y L4 checksum offload = Y Packet type parsing = Y Rx descriptor status = Y +Tx descriptor status = Y Basic stats = Y Extended stats = Y Stats per queue = Y
drivers/net/ionic/ionic_ethdev.c +1 -0
@@ -985,6 +985,7 @@ eth_ionic_dev_init(struct rte_eth_dev *eth_dev, void *init_params) eth_dev->tx_pkt_prepare = &ionic_prep_pkts; eth_dev->rx_descriptor_status = ionic_dev_rx_descriptor_status; + eth_dev->tx_descriptor_status = ionic_dev_tx_descriptor_status;/* Multi-process not supported, primary does initialization anyway */ if (rte_eal_process_type () !=RTE_PROC_PRIMARY )
drivers/net/ionic/ionic_rxtx.c +51 -0
54 lines not on this page · raw message
drivers/net/ionic/ionic_rxtx.h +1 -0
@@ -41,6 +41,7 @@ void ionic_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id, struct rte_eth_txq_info *qinfo);int ionic_dev_rx_descriptor_status (void *rx_queue,uint16_t offset); +int ionic_dev_tx_descriptor_status (void *tx_queue,uint16_t offset);const uint32_t *ionic_dev_supported_ptypes_get (struct rte_eth_dev *dev);
Signature · 1 line
2.17.1
PATCH 28/35 net/ionic: add Q-in-CMB option controlled by devarg
In reply to Andrew BoyerWhen 'ionic_cmb' is set to '1', queue memory will be allocated from the device's onboard memory (Controller Memory Buffer). In some configurations, this will dramatically reduce packet latency and increase PPS.
Add the WC_ACTIVATE flag to the PCI driver flags. Write combining must be enabled to achieve the maximum PPS.
When the queue is in the CMB, descriptors cannot be prefetched.
--- doc/guides/nics/ionic.rst | 12 ++++++ doc/guides/rel_notes/release_22_11.rst | 1 + drivers/net/ionic/ionic.h | 5 +++ drivers/net/ionic/ionic_dev.h | 3 ++ drivers/net/ionic/ionic_dev_pci.c | 60 +++++++++++++++++++++++++- drivers/net/ionic/ionic_ethdev.c | 9 ++++ drivers/net/ionic/ionic_lif.c | 38 ++++++++++++++++ drivers/net/ionic/ionic_lif.h | 2 + drivers/net/ionic/ionic_rxtx.c | 9 ++-- 9 files changed, 135 insertions(+), 4 deletions(-)
doc/guides/nics/ionic.rst +12 -0
@@ -32,6 +32,18 @@ The ionic PMD requires firmware which supports 16 segment transmit SGLs. This support was added prior to version 1.0. For help upgrading older versions, please contact AMD Pensando support. +Runtime Configuration +--------------------- + +- ``Queue in CMB support`` (default ``0``) + + Queue memory can be allocated from the Controller Memory Buffer (CMB) using + the ``ionic_cmb`` ``devargs`` parameter. + + For example:: + + -a 0000:b5:00.0,ionic_cmb=1 + Building DPDK -------------
doc/guides/rel_notes/release_22_11.rst +1 -0
@@ -87,6 +87,7 @@ New Features * Added support for mbuf fast free. * Added support for advertising packet types. * Added support for descriptor status functions. + * Added Q-in-CMB feature controlled by devarg ionic_cmb. Removed Items -------------
drivers/net/ionic/ionic.h +5 -0
@@ -24,6 +24,9 @@#define IONIC_DEV_ID_ETH_VF 0x1003#define IONIC_DEV_ID_ETH_MGMT 0x1004 +/* Devargs */ +#define PMD_IONIC_CMB_KVARG "ionic_cmb" +enum ionic_mac_type {IONIC_MAC_UNKNOWN =0 ,IONIC_MAC_CAPRI ,
@@ -62,9 +65,11 @@ struct ionic_adapter {uint32_t link_speed;uint32_t nintrs;bool intrs[IONIC_INTR_CTRL_REGS_MAX ]; +bool q_in_cmb;bool link_up;char fw_version[IONIC_DEVINFO_FWVERS_BUFLEN ];void *bus_dev; +uint64_t cmb_offset; };/** ionic_admin_ctx - Admin command context.
drivers/net/ionic/ionic_dev.h +3 -0
@@ -176,9 +176,12 @@ struct ionic_adapter;struct ionic_qcq ;struct rte_mempool ;struct rte_eth_dev ; +struct rte_devargs ;struct ionic_dev_intf {int (*setup)(struct ionic_adapter *adapter); +int (*devargs)(struct ionic_adapter *adapter, +struct rte_devargs *devargs);void (*copy_bus_info)(struct ionic_adapter *adapter,struct rte_eth_dev *eth_dev);int (*configure_intr)(struct ionic_adapter *adapter);
drivers/net/ionic/ionic_dev_pci.c +59 -1
87 lines not on this page · raw message
drivers/net/ionic/ionic_ethdev.c +9 -0
@@ -1118,6 +1118,15 @@ eth_ionic_dev_probe(void *bus_dev, struct rte_device *rte_dev, adapter->intf = intf; +/* Parse device arguments */ +if (adapter->intf->devargs) { + err = (*adapter->intf->devargs)(adapter, rte_dev->devargs); +if (err) { +IONIC_PRINT (ERR ,"Cannot parse device arguments" ); + goto err_free_adapter; + } + } +/* Discover ionic dev resources */ err =ionic_setup (adapter);if (err) {
drivers/net/ionic/ionic_lif.c +38 -0
@@ -660,6 +660,21 @@ ionic_qcq_alloc(struct ionic_lif *lif,ionic_q_sg_map (&new->q, sg_base, sg_base_pa); } +if (flags &IONIC_QCQ_F_CMB ) { +/* alloc descriptor ring from nic memory */ +if (lif->adapter->cmb_offset + q_size > + lif->adapter->bars.bar[2 ].len) { +IONIC_PRINT (ERR ,"Cannot reserve queue from NIC mem" ); +return -ENOMEM ; + } + q_base = (void *) + ((uintptr_t )lif->adapter->bars.bar[2 ].vaddr + + (uintptr_t )lif->adapter->cmb_offset); +/* CMB PA is a relative address */ + q_base_pa = lif->adapter->cmb_offset; + lif->adapter->cmb_offset += q_size; + } +IONIC_PRINT (DEBUG ,"Q-Base-PA = %#jx CQ-Base-PA = %#jx " "SG-base-PA = %#jx" , q_base_pa, cq_base_pa, sg_base_pa);
@@ -744,6 +759,8 @@ ionic_rx_qcq_alloc(struct ionic_lif *lif, uint32_t socket_id, uint32_t index,int err; flags =IONIC_QCQ_F_SG ; +if (lif->state &IONIC_LIF_F_Q_IN_CMB ) + flags |=IONIC_QCQ_F_CMB ; seg_size =rte_pktmbuf_data_room_size (mb_pool);
@@ -806,6 +823,8 @@ ionic_tx_qcq_alloc(struct ionic_lif *lif, uint32_t socket_id, uint32_t index,int err; flags =IONIC_QCQ_F_SG ; +if (lif->state &IONIC_LIF_F_Q_IN_CMB ) + flags |=IONIC_QCQ_F_CMB ; num_segs_fw =IONIC_TX_MAX_SG_ELEMS_V1 +1 ;
@@ -994,6 +1013,19 @@ ionic_lif_alloc(struct ionic_lif *lif)return -ENXIO ; } +if (adapter->q_in_cmb) { +if (adapter->bars.num_bars >=3 && + lif->qtype_info[IONIC_QTYPE_RXQ ].version >=2 && + lif->qtype_info[IONIC_QTYPE_TXQ ].version >=3 ) { +IONIC_PRINT (INFO ,"%s enabled on %s" , +PMD_IONIC_CMB_KVARG , lif->name); + lif->state |=IONIC_LIF_F_Q_IN_CMB ; + }else { +IONIC_PRINT (ERR ,"%s not supported on %s, disabled" , +PMD_IONIC_CMB_KVARG , lif->name); + } + } +IONIC_PRINT (DEBUG ,"Allocating Lif Info" );rte_spinlock_init (&lif->adminq_lock);
@@ -1537,6 +1569,9 @@ ionic_lif_txq_init(struct ionic_tx_qcq *txq) };int err; +if (txq->flags &IONIC_QCQ_F_CMB ) + ctx.cmd.q_init.flags |=rte_cpu_to_le_16 (IONIC_QINIT_F_CMB ); +IONIC_PRINT (DEBUG ,"txq_init.index %d" , q->index);IONIC_PRINT (DEBUG ,"txq_init.ring_base 0x%" PRIx64"" , q->base_pa); IONIC_PRINT(DEBUG, "txq_init.ring_size %d",
@@ -1588,6 +1623,9 @@ ionic_lif_rxq_init(struct ionic_rx_qcq *rxq) };int err; +if (rxq->flags &IONIC_QCQ_F_CMB ) + ctx.cmd.q_init.flags |=rte_cpu_to_le_16 (IONIC_QINIT_F_CMB ); +IONIC_PRINT (DEBUG ,"rxq_init.index %d" , q->index);IONIC_PRINT (DEBUG ,"rxq_init.ring_base 0x%" PRIx64"" , q->base_pa); IONIC_PRINT(DEBUG, "rxq_init.ring_size %d",
drivers/net/ionic/ionic_lif.h +2 -0
@@ -49,6 +49,7 @@ struct ionic_rx_stats {#define IONIC_QCQ_F_INITED BIT(0)#define IONIC_QCQ_F_SG BIT(1)#define IONIC_QCQ_F_DEFERRED BIT(4) +#define IONIC_QCQ_F_CMB BIT(5)#define IONIC_QCQ_F_CSUM_L3 BIT(7)#define IONIC_QCQ_F_CSUM_UDP BIT(8)#define IONIC_QCQ_F_CSUM_TCP BIT(9)
@@ -126,6 +127,7 @@ struct ionic_qtype_info {#define IONIC_LIF_F_LINK_CHECK_NEEDED BIT(1)#define IONIC_LIF_F_UP BIT(2)#define IONIC_LIF_F_FW_RESET BIT(3) +#define IONIC_LIF_F_Q_IN_CMB BIT(4)#define IONIC_LIF_NAME_MAX_SZ (32)
drivers/net/ionic/ionic_rxtx.c +6 -3
@@ -600,7 +600,8 @@ ionic_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,int err;struct ionic_txq_desc *desc_base = q->base; -rte_prefetch0 (&desc_base[q->head_idx]); +if (!(txq->flags &IONIC_QCQ_F_CMB )) +rte_prefetch0 (&desc_base[q->head_idx]);rte_prefetch0 (IONIC_INFO_PTR (q, q->head_idx));if (tx_pkts) {
@@ -619,7 +620,8 @@ ionic_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,while (nb_tx < nb_pkts) {uint16_t next_idx =Q_NEXT_TO_POST (q,1 ); -rte_prefetch0 (&desc_base[next_idx]); +if (!(txq->flags &IONIC_QCQ_F_CMB )) +rte_prefetch0 (&desc_base[next_idx]);rte_prefetch0 (IONIC_INFO_PTR (q, next_idx));if (nb_tx +1 < nb_pkts) {
@@ -1172,7 +1174,8 @@ ionic_rxq_service(struct ionic_rx_qcq *rxq, uint32_t work_to_do,/* Prefetch 4 x 16B comp */ rte_prefetch0 (&cq_desc_base[Q_NEXT_TO_SRVC (cq,4 )]);/* Prefetch 4 x 16B descriptors */ -rte_prefetch0 (&q_desc_base[Q_NEXT_TO_POST (q,4 )]); +if (!(rxq->flags &IONIC_QCQ_F_CMB )) +rte_prefetch0 (&q_desc_base[Q_NEXT_TO_POST (q,4 )]);ionic_rx_clean_one (rxq, cq_desc, rx_svc);
Signature · 1 line
2.17.1
PATCH 28/35 net/ionic: add Q-in-CMB option controlled by devarg
In reply to Andrew BoyerWhen 'ionic_cmb' is set to '1', queue memory will be allocated from the device's onboard memory (Controller Memory Buffer). In some configurations, this will dramatically reduce packet latency and increase PPS.
Add the WC_ACTIVATE flag to the PCI driver flags. Write combining must be enabled to achieve the maximum PPS.
When the queue is in the CMB, descriptors cannot be prefetched.
--- doc/guides/nics/ionic.rst | 12 ++++++ doc/guides/rel_notes/release_22_11.rst | 1 + drivers/net/ionic/ionic.h | 5 +++ drivers/net/ionic/ionic_dev.h | 3 ++ drivers/net/ionic/ionic_dev_pci.c | 60 +++++++++++++++++++++++++- drivers/net/ionic/ionic_ethdev.c | 9 ++++ drivers/net/ionic/ionic_lif.c | 38 ++++++++++++++++ drivers/net/ionic/ionic_lif.h | 2 + drivers/net/ionic/ionic_rxtx.c | 9 ++-- 9 files changed, 135 insertions(+), 4 deletions(-)
doc/guides/nics/ionic.rst +12 -0
@@ -32,6 +32,18 @@ The ionic PMD requires firmware which supports 16 segment transmit SGLs. This support was added prior to version 1.0. For help upgrading older versions, please contact AMD Pensando support. +Runtime Configuration +--------------------- + +- ``Queue in CMB support`` (default ``0``) + + Queue memory can be allocated from the Controller Memory Buffer (CMB) using + the ``ionic_cmb`` ``devargs`` parameter. + + For example:: + + -a 0000:b5:00.0,ionic_cmb=1 + Building DPDK -------------
doc/guides/rel_notes/release_22_11.rst +1 -0
@@ -168,6 +168,7 @@ New Features * Added support for mbuf fast free. * Added support for advertising packet types. * Added support for descriptor status functions. + * Added Q-in-CMB feature controlled by devarg ionic_cmb. * **Added support for MACsec in rte_security.**
drivers/net/ionic/ionic.h +5 -0
@@ -24,6 +24,9 @@#define IONIC_DEV_ID_ETH_VF 0x1003#define IONIC_DEV_ID_ETH_MGMT 0x1004 +/* Devargs */ +#define PMD_IONIC_CMB_KVARG "ionic_cmb" +enum ionic_mac_type {IONIC_MAC_UNKNOWN =0 ,IONIC_MAC_CAPRI ,
@@ -62,9 +65,11 @@ struct ionic_adapter {uint32_t link_speed;uint32_t nintrs;bool intrs[IONIC_INTR_CTRL_REGS_MAX ]; +bool q_in_cmb;bool link_up;char fw_version[IONIC_DEVINFO_FWVERS_BUFLEN ];void *bus_dev; +uint64_t cmb_offset; };/** ionic_admin_ctx - Admin command context.
drivers/net/ionic/ionic_dev.h +3 -0
@@ -176,9 +176,12 @@ struct ionic_adapter;struct ionic_qcq ;struct rte_mempool ;struct rte_eth_dev ; +struct rte_devargs ;struct ionic_dev_intf {int (*setup)(struct ionic_adapter *adapter); +int (*devargs)(struct ionic_adapter *adapter, +struct rte_devargs *devargs);void (*copy_bus_info)(struct ionic_adapter *adapter,struct rte_eth_dev *eth_dev);int (*configure_intr)(struct ionic_adapter *adapter);
drivers/net/ionic/ionic_dev_pci.c +59 -1
87 lines not on this page · raw message
drivers/net/ionic/ionic_ethdev.c +9 -0
@@ -1118,6 +1118,15 @@ eth_ionic_dev_probe(void *bus_dev, struct rte_device *rte_dev, adapter->intf = intf; +/* Parse device arguments */ +if (adapter->intf->devargs) { + err = (*adapter->intf->devargs)(adapter, rte_dev->devargs); +if (err) { +IONIC_PRINT (ERR ,"Cannot parse device arguments" ); + goto err_free_adapter; + } + } +/* Discover ionic dev resources */ err =ionic_setup (adapter);if (err) {
drivers/net/ionic/ionic_lif.c +38 -0
@@ -660,6 +660,21 @@ ionic_qcq_alloc(struct ionic_lif *lif,ionic_q_sg_map (&new->q, sg_base, sg_base_pa); } +if (flags &IONIC_QCQ_F_CMB ) { +/* alloc descriptor ring from nic memory */ +if (lif->adapter->cmb_offset + q_size > + lif->adapter->bars.bar[2 ].len) { +IONIC_PRINT (ERR ,"Cannot reserve queue from NIC mem" ); +return -ENOMEM ; + } + q_base = (void *) + ((uintptr_t )lif->adapter->bars.bar[2 ].vaddr + + (uintptr_t )lif->adapter->cmb_offset); +/* CMB PA is a relative address */ + q_base_pa = lif->adapter->cmb_offset; + lif->adapter->cmb_offset += q_size; + } +IONIC_PRINT (DEBUG ,"Q-Base-PA = %#jx CQ-Base-PA = %#jx " "SG-base-PA = %#jx" , q_base_pa, cq_base_pa, sg_base_pa);
@@ -744,6 +759,8 @@ ionic_rx_qcq_alloc(struct ionic_lif *lif, uint32_t socket_id, uint32_t index,int err; flags =IONIC_QCQ_F_SG ; +if (lif->state &IONIC_LIF_F_Q_IN_CMB ) + flags |=IONIC_QCQ_F_CMB ; seg_size =rte_pktmbuf_data_room_size (mb_pool);
@@ -806,6 +823,8 @@ ionic_tx_qcq_alloc(struct ionic_lif *lif, uint32_t socket_id, uint32_t index,int err; flags =IONIC_QCQ_F_SG ; +if (lif->state &IONIC_LIF_F_Q_IN_CMB ) + flags |=IONIC_QCQ_F_CMB ; num_segs_fw =IONIC_TX_MAX_SG_ELEMS_V1 +1 ;
@@ -994,6 +1013,19 @@ ionic_lif_alloc(struct ionic_lif *lif)return -ENXIO ; } +if (adapter->q_in_cmb) { +if (adapter->bars.num_bars >=3 && + lif->qtype_info[IONIC_QTYPE_RXQ ].version >=2 && + lif->qtype_info[IONIC_QTYPE_TXQ ].version >=3 ) { +IONIC_PRINT (INFO ,"%s enabled on %s" , +PMD_IONIC_CMB_KVARG , lif->name); + lif->state |=IONIC_LIF_F_Q_IN_CMB ; + }else { +IONIC_PRINT (ERR ,"%s not supported on %s, disabled" , +PMD_IONIC_CMB_KVARG , lif->name); + } + } +IONIC_PRINT (DEBUG ,"Allocating Lif Info" );rte_spinlock_init (&lif->adminq_lock);
@@ -1537,6 +1569,9 @@ ionic_lif_txq_init(struct ionic_tx_qcq *txq) };int err; +if (txq->flags &IONIC_QCQ_F_CMB ) + ctx.cmd.q_init.flags |=rte_cpu_to_le_16 (IONIC_QINIT_F_CMB ); +IONIC_PRINT (DEBUG ,"txq_init.index %d" , q->index);IONIC_PRINT (DEBUG ,"txq_init.ring_base 0x%" PRIx64"" , q->base_pa); IONIC_PRINT(DEBUG, "txq_init.ring_size %d",
@@ -1588,6 +1623,9 @@ ionic_lif_rxq_init(struct ionic_rx_qcq *rxq) };int err; +if (rxq->flags &IONIC_QCQ_F_CMB ) + ctx.cmd.q_init.flags |=rte_cpu_to_le_16 (IONIC_QINIT_F_CMB ); +IONIC_PRINT (DEBUG ,"rxq_init.index %d" , q->index);IONIC_PRINT (DEBUG ,"rxq_init.ring_base 0x%" PRIx64"" , q->base_pa); IONIC_PRINT(DEBUG, "rxq_init.ring_size %d",
drivers/net/ionic/ionic_lif.h +2 -0
@@ -49,6 +49,7 @@ struct ionic_rx_stats {#define IONIC_QCQ_F_INITED BIT(0)#define IONIC_QCQ_F_SG BIT(1)#define IONIC_QCQ_F_DEFERRED BIT(4) +#define IONIC_QCQ_F_CMB BIT(5)#define IONIC_QCQ_F_CSUM_L3 BIT(7)#define IONIC_QCQ_F_CSUM_UDP BIT(8)#define IONIC_QCQ_F_CSUM_TCP BIT(9)
@@ -126,6 +127,7 @@ struct ionic_qtype_info {#define IONIC_LIF_F_LINK_CHECK_NEEDED BIT(1)#define IONIC_LIF_F_UP BIT(2)#define IONIC_LIF_F_FW_RESET BIT(3) +#define IONIC_LIF_F_Q_IN_CMB BIT(4)#define IONIC_LIF_NAME_MAX_SZ (32)
drivers/net/ionic/ionic_rxtx.c +6 -3
@@ -600,7 +600,8 @@ ionic_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,int err;struct ionic_txq_desc *desc_base = q->base; -rte_prefetch0 (&desc_base[q->head_idx]); +if (!(txq->flags &IONIC_QCQ_F_CMB )) +rte_prefetch0 (&desc_base[q->head_idx]);rte_prefetch0 (IONIC_INFO_PTR (q, q->head_idx));if (tx_pkts) {
@@ -619,7 +620,8 @@ ionic_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,while (nb_tx < nb_pkts) {uint16_t next_idx =Q_NEXT_TO_POST (q,1 ); -rte_prefetch0 (&desc_base[next_idx]); +if (!(txq->flags &IONIC_QCQ_F_CMB )) +rte_prefetch0 (&desc_base[next_idx]);rte_prefetch0 (IONIC_INFO_PTR (q, next_idx));if (nb_tx +1 < nb_pkts) {
@@ -1172,7 +1174,8 @@ ionic_rxq_service(struct ionic_rx_qcq *rxq, uint32_t work_to_do,/* Prefetch 4 x 16B comp */ rte_prefetch0 (&cq_desc_base[Q_NEXT_TO_SRVC (cq,4 )]);/* Prefetch 4 x 16B descriptors */ -rte_prefetch0 (&q_desc_base[Q_NEXT_TO_POST (q,4 )]); +if (!(rxq->flags &IONIC_QCQ_F_CMB )) +rte_prefetch0 (&q_desc_base[Q_NEXT_TO_POST (q,4 )]);ionic_rx_clean_one (rxq, cq_desc, rx_svc);
Signature · 1 line
2.17.1
PATCH 29/35 net/ionic: update array allocations to use calloc
In reply to Andrew BoyerUse rte_calloc() where appropriate.
This makes the code clearer.
--- drivers/net/ionic/ionic_ethdev.c | 6 +++--- drivers/net/ionic/ionic_lif.c | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-)
drivers/net/ionic/ionic_ethdev.c +3 -3
@@ -1003,9 +1003,9 @@ eth_ionic_dev_init(struct rte_eth_dev *eth_dev, void *init_params) adapter->max_mac_addrs);/* Allocate memory for storing MAC addresses */ - eth_dev->data->mac_addrs =rte_zmalloc ("ionic" , -RTE_ETHER_ADDR_LEN * adapter->max_mac_addrs,0 ); - + eth_dev->data->mac_addrs =rte_calloc ("ionic" , + adapter->max_mac_addrs, +RTE_ETHER_ADDR_LEN ,0 );if (eth_dev->data->mac_addrs ==NULL ) { IONIC_PRINT(ERR, "Failed to allocate %u bytes needed to " "store MAC addresses",
drivers/net/ionic/ionic_lif.c +6 -6
@@ -1037,17 +1037,17 @@ ionic_lif_alloc(struct ionic_lif *lif)return -ENOMEM ; } - lif->txqcqs =rte_zmalloc ("ionic" ,sizeof (*lif->txqcqs) * - adapter->max_ntxqs_per_lif,0 ); - + lif->txqcqs =rte_calloc ("ionic" , + adapter->max_ntxqs_per_lif, +sizeof (*lif->txqcqs),0 );if (!lif->txqcqs) {IONIC_PRINT (ERR ,"Cannot allocate tx queues array" );return -ENOMEM ; } - lif->rxqcqs =rte_zmalloc ("ionic" ,sizeof (*lif->rxqcqs) * - adapter->max_nrxqs_per_lif,0 ); - + lif->rxqcqs =rte_calloc ("ionic" , + adapter->max_nrxqs_per_lif, +sizeof (*lif->rxqcqs),0 );if (!lif->rxqcqs) {IONIC_PRINT (ERR ,"Cannot allocate rx queues array" );return -ENOMEM ;
Signature · 1 line
2.17.1
PATCH 29/35 net/ionic: update array allocations to use calloc
In reply to Andrew BoyerUse rte_calloc() where appropriate.
This makes the code clearer.
--- drivers/net/ionic/ionic_ethdev.c | 6 +++--- drivers/net/ionic/ionic_lif.c | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-)
drivers/net/ionic/ionic_ethdev.c +3 -3
@@ -1003,9 +1003,9 @@ eth_ionic_dev_init(struct rte_eth_dev *eth_dev, void *init_params) adapter->max_mac_addrs);/* Allocate memory for storing MAC addresses */ - eth_dev->data->mac_addrs =rte_zmalloc ("ionic" , -RTE_ETHER_ADDR_LEN * adapter->max_mac_addrs,0 ); - + eth_dev->data->mac_addrs =rte_calloc ("ionic" , + adapter->max_mac_addrs, +RTE_ETHER_ADDR_LEN ,0 );if (eth_dev->data->mac_addrs ==NULL ) { IONIC_PRINT(ERR, "Failed to allocate %u bytes needed to " "store MAC addresses",
drivers/net/ionic/ionic_lif.c +6 -6
@@ -1037,17 +1037,17 @@ ionic_lif_alloc(struct ionic_lif *lif)return -ENOMEM ; } - lif->txqcqs =rte_zmalloc ("ionic" ,sizeof (*lif->txqcqs) * - adapter->max_ntxqs_per_lif,0 ); - + lif->txqcqs =rte_calloc ("ionic" , + adapter->max_ntxqs_per_lif, +sizeof (*lif->txqcqs),0 );if (!lif->txqcqs) {IONIC_PRINT (ERR ,"Cannot allocate tx queues array" );return -ENOMEM ; } - lif->rxqcqs =rte_zmalloc ("ionic" ,sizeof (*lif->rxqcqs) * - adapter->max_nrxqs_per_lif,0 ); - + lif->rxqcqs =rte_calloc ("ionic" , + adapter->max_nrxqs_per_lif, +sizeof (*lif->rxqcqs),0 );if (!lif->rxqcqs) {IONIC_PRINT (ERR ,"Cannot allocate rx queues array" );return -ENOMEM ;
Signature · 1 line
2.17.1
PATCH 30/35 net/ionic: add alignment and socket info in allocations
In reply to Andrew BoyerThis will avoid memory access penalties on NUMA systems.
--- drivers/net/ionic/ionic_ethdev.c | 5 +++-- drivers/net/ionic/ionic_lif.c | 13 ++++++++----- drivers/net/ionic/ionic_rx_filter.c | 3 +-- 3 files changed, 12 insertions(+), 9 deletions(-)
drivers/net/ionic/ionic_ethdev.c +3 -2
@@ -1005,7 +1005,8 @@ eth_ionic_dev_init(struct rte_eth_dev *eth_dev, void *init_params)/* Allocate memory for storing MAC addresses */ eth_dev->data->mac_addrs =rte_calloc ("ionic" , adapter->max_mac_addrs, -RTE_ETHER_ADDR_LEN ,0 ); +RTE_ETHER_ADDR_LEN , +RTE_CACHE_LINE_SIZE );if (eth_dev->data->mac_addrs ==NULL ) { IONIC_PRINT(ERR, "Failed to allocate %u bytes needed to " "store MAC addresses",
@@ -1083,7 +1084,7 @@ eth_ionic_dev_probe(void *bus_dev, struct rte_device *rte_dev, goto err; } - adapter =rte_zmalloc ("ionic" ,sizeof (*adapter),0 ); + adapter =rte_zmalloc ("ionic" ,sizeof (*adapter),RTE_CACHE_LINE_SIZE );if (!adapter) {IONIC_PRINT (ERR ,"OOM" ); err = -ENOMEM ;
drivers/net/ionic/ionic_lif.c +8 -5
@@ -598,7 +598,8 @@ ionic_qcq_alloc(struct ionic_lif *lif, total_size +=rte_mem_page_size (); } - new =rte_zmalloc ("ionic" , struct_size,0 ); + new =rte_zmalloc_socket ("ionic" , struct_size, +RTE_CACHE_LINE_SIZE , socket_id);if (!new) {IONIC_PRINT (ERR ,"Cannot allocate queue structure" );return -ENOMEM ;
@@ -1037,17 +1038,19 @@ ionic_lif_alloc(struct ionic_lif *lif)return -ENOMEM ; } - lif->txqcqs =rte_calloc ("ionic" , + lif->txqcqs =rte_calloc_socket ("ionic" , adapter->max_ntxqs_per_lif, -sizeof (*lif->txqcqs),0 ); +sizeof (*lif->txqcqs), +RTE_CACHE_LINE_SIZE , socket_id);if (!lif->txqcqs) {IONIC_PRINT (ERR ,"Cannot allocate tx queues array" );return -ENOMEM ; } - lif->rxqcqs =rte_calloc ("ionic" , + lif->rxqcqs =rte_calloc_socket ("ionic" , adapter->max_nrxqs_per_lif, -sizeof (*lif->rxqcqs),0 ); +sizeof (*lif->rxqcqs), +RTE_CACHE_LINE_SIZE , socket_id);if (!lif->rxqcqs) {IONIC_PRINT (ERR ,"Cannot allocate rx queues array" );return -ENOMEM ;
drivers/net/ionic/ionic_rx_filter.c +1 -2
@@ -55,8 +55,7 @@ ionic_rx_filter_save(struct ionic_lif *lif, uint32_t flow_id,struct ionic_rx_filter *f;uint32_t key; - f =rte_zmalloc ("ionic" ,sizeof (*f),0 ); - + f =rte_zmalloc ("ionic" ,sizeof (*f),RTE_CACHE_LINE_SIZE );if (!f)return -ENOMEM ;
Signature · 1 line
2.17.1
PATCH 30/35 net/ionic: add alignment and socket info in allocations
In reply to Andrew BoyerThis will avoid memory access penalties on NUMA systems.
--- drivers/net/ionic/ionic_ethdev.c | 5 +++-- drivers/net/ionic/ionic_lif.c | 13 ++++++++----- drivers/net/ionic/ionic_rx_filter.c | 3 +-- 3 files changed, 12 insertions(+), 9 deletions(-)
drivers/net/ionic/ionic_ethdev.c +3 -2
@@ -1005,7 +1005,8 @@ eth_ionic_dev_init(struct rte_eth_dev *eth_dev, void *init_params)/* Allocate memory for storing MAC addresses */ eth_dev->data->mac_addrs =rte_calloc ("ionic" , adapter->max_mac_addrs, -RTE_ETHER_ADDR_LEN ,0 ); +RTE_ETHER_ADDR_LEN , +RTE_CACHE_LINE_SIZE );if (eth_dev->data->mac_addrs ==NULL ) { IONIC_PRINT(ERR, "Failed to allocate %u bytes needed to " "store MAC addresses",
@@ -1083,7 +1084,7 @@ eth_ionic_dev_probe(void *bus_dev, struct rte_device *rte_dev, goto err; } - adapter =rte_zmalloc ("ionic" ,sizeof (*adapter),0 ); + adapter =rte_zmalloc ("ionic" ,sizeof (*adapter),RTE_CACHE_LINE_SIZE );if (!adapter) {IONIC_PRINT (ERR ,"OOM" ); err = -ENOMEM ;
drivers/net/ionic/ionic_lif.c +8 -5
@@ -598,7 +598,8 @@ ionic_qcq_alloc(struct ionic_lif *lif, total_size +=rte_mem_page_size (); } - new =rte_zmalloc ("ionic" , struct_size,0 ); + new =rte_zmalloc_socket ("ionic" , struct_size, +RTE_CACHE_LINE_SIZE , socket_id);if (!new) {IONIC_PRINT (ERR ,"Cannot allocate queue structure" );return -ENOMEM ;
@@ -1037,17 +1038,19 @@ ionic_lif_alloc(struct ionic_lif *lif)return -ENOMEM ; } - lif->txqcqs =rte_calloc ("ionic" , + lif->txqcqs =rte_calloc_socket ("ionic" , adapter->max_ntxqs_per_lif, -sizeof (*lif->txqcqs),0 ); +sizeof (*lif->txqcqs), +RTE_CACHE_LINE_SIZE , socket_id);if (!lif->txqcqs) {IONIC_PRINT (ERR ,"Cannot allocate tx queues array" );return -ENOMEM ; } - lif->rxqcqs =rte_calloc ("ionic" , + lif->rxqcqs =rte_calloc_socket ("ionic" , adapter->max_nrxqs_per_lif, -sizeof (*lif->rxqcqs),0 ); +sizeof (*lif->rxqcqs), +RTE_CACHE_LINE_SIZE , socket_id);if (!lif->rxqcqs) {IONIC_PRINT (ERR ,"Cannot allocate rx queues array" );return -ENOMEM ;
drivers/net/ionic/ionic_rx_filter.c +1 -2
@@ -55,8 +55,7 @@ ionic_rx_filter_save(struct ionic_lif *lif, uint32_t flow_id,struct ionic_rx_filter *f;uint32_t key; - f =rte_zmalloc ("ionic" ,sizeof (*f),0 ); - + f =rte_zmalloc ("ionic" ,sizeof (*f),RTE_CACHE_LINE_SIZE );if (!f)return -ENOMEM ;
Signature · 1 line
2.17.1
PATCH 31/35 net/ionic: allow client to specify Tx free threshold
In reply to Andrew BoyerSome clients have opinions about how often to flush the transmit ring.
The default value is the number of Tx descriptors minus the default Tx burst size.
--- drivers/net/ionic/ionic_dev.h | 1 + drivers/net/ionic/ionic_ethdev.c | 4 ++-- drivers/net/ionic/ionic_lif.h | 1 + drivers/net/ionic/ionic_rxtx.c | 17 +++++++++++++++-- 4 files changed, 19 insertions(+), 4 deletions(-)
drivers/net/ionic/ionic_dev.h +1 -0
@@ -20,6 +20,7 @@#define IONIC_MAX_RING_DESC 32768#define IONIC_MIN_RING_DESC 16#define IONIC_DEF_TXRX_DESC 4096 +#define IONIC_DEF_TXRX_BURST 32#define IONIC_DEVCMD_TIMEOUT 5/* devcmd_timeout */ #define IONIC_DEVCMD_CHECK_PERIOD_US 10/* devcmd status chk period */
drivers/net/ionic/ionic_ethdev.c +2 -2
@@ -429,8 +429,8 @@ ionic_dev_info_get(struct rte_eth_dev *eth_dev, dev_info->tx_desc_lim = tx_desc_lim_v1;/* Driver-preferred Rx/Tx parameters */ - dev_info->default_rxportconf.burst_size =32 ; - dev_info->default_txportconf.burst_size =32 ; + dev_info->default_rxportconf.burst_size =IONIC_DEF_TXRX_BURST ; + dev_info->default_txportconf.burst_size =IONIC_DEF_TXRX_BURST ; dev_info->default_rxportconf.nb_queues =1 ; dev_info->default_txportconf.nb_queues =1 ; dev_info->default_rxportconf.ring_size =IONIC_DEF_TXRX_DESC ;
drivers/net/ionic/ionic_lif.h +1 -0
@@ -104,6 +104,7 @@ struct ionic_tx_qcq {/* cacheline2 */ uint16_t num_segs_fw;/* # segs supported by current FW */ +uint16_t free_thresh;uint16_t flags;struct ionic_tx_stats stats;
drivers/net/ionic/ionic_rxtx.c +15 -2
@@ -223,6 +223,13 @@ ionic_dev_tx_queue_setup(struct rte_eth_dev *eth_dev, uint16_t tx_queue_id,if (!rte_is_power_of_2 (nb_desc) || nb_desc <IONIC_MIN_RING_DESC )return -EINVAL ;/* or use IONIC_DEFAULT_RING_DESC */ +if (tx_conf->tx_free_thresh > nb_desc) { +IONIC_PRINT (ERR , +"tx_free_thresh must be less than nb_desc (%u)" , + nb_desc); +return -EINVAL ; + } +/* Free memory prior to re-allocation if needed... */ if (eth_dev->data->tx_queues[tx_queue_id] !=NULL ) {ionic_dev_tx_queue_release (eth_dev, tx_queue_id);
@@ -252,6 +259,10 @@ ionic_dev_tx_queue_setup(struct rte_eth_dev *eth_dev, uint16_t tx_queue_id,if (offloads &RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE ) txq->flags |=IONIC_QCQ_F_FAST_FREE ; + txq->free_thresh = + tx_conf->tx_free_thresh ? tx_conf->tx_free_thresh : + nb_desc -IONIC_DEF_TXRX_BURST ; + eth_dev->data->tx_queues[tx_queue_id] = txq;return 0 ;
@@ -609,8 +620,10 @@ ionic_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,rte_mbuf_prefetch_part2 (tx_pkts[0 ]); } -/* Cleaning old buffers */ -ionic_tx_flush (txq); +if (unlikely (ionic_q_space_avail (q) < txq->free_thresh)) { +/* Cleaning old buffers */ +ionic_tx_flush (txq); + } nb_avail =ionic_q_space_avail (q);if (unlikely (nb_avail < nb_pkts)) {
Signature · 1 line
2.17.1
PATCH 31/35 net/ionic: allow client to specify Tx free threshold
In reply to Andrew BoyerSome clients have opinions about how often to flush the transmit ring.
The default value is the number of Tx descriptors minus the default Tx burst size.
--- drivers/net/ionic/ionic_dev.h | 1 + drivers/net/ionic/ionic_ethdev.c | 4 ++-- drivers/net/ionic/ionic_lif.h | 1 + drivers/net/ionic/ionic_rxtx.c | 17 +++++++++++++++-- 4 files changed, 19 insertions(+), 4 deletions(-)
drivers/net/ionic/ionic_dev.h +1 -0
@@ -20,6 +20,7 @@#define IONIC_MAX_RING_DESC 32768#define IONIC_MIN_RING_DESC 16#define IONIC_DEF_TXRX_DESC 4096 +#define IONIC_DEF_TXRX_BURST 32#define IONIC_DEVCMD_TIMEOUT 5/* devcmd_timeout */ #define IONIC_DEVCMD_CHECK_PERIOD_US 10/* devcmd status chk period */
drivers/net/ionic/ionic_ethdev.c +2 -2
@@ -429,8 +429,8 @@ ionic_dev_info_get(struct rte_eth_dev *eth_dev, dev_info->tx_desc_lim = tx_desc_lim_v1;/* Driver-preferred Rx/Tx parameters */ - dev_info->default_rxportconf.burst_size =32 ; - dev_info->default_txportconf.burst_size =32 ; + dev_info->default_rxportconf.burst_size =IONIC_DEF_TXRX_BURST ; + dev_info->default_txportconf.burst_size =IONIC_DEF_TXRX_BURST ; dev_info->default_rxportconf.nb_queues =1 ; dev_info->default_txportconf.nb_queues =1 ; dev_info->default_rxportconf.ring_size =IONIC_DEF_TXRX_DESC ;
drivers/net/ionic/ionic_lif.h +1 -0
@@ -104,6 +104,7 @@ struct ionic_tx_qcq {/* cacheline2 */ uint16_t num_segs_fw;/* # segs supported by current FW */ +uint16_t free_thresh;uint16_t flags;struct ionic_tx_stats stats;
drivers/net/ionic/ionic_rxtx.c +15 -2
@@ -223,6 +223,13 @@ ionic_dev_tx_queue_setup(struct rte_eth_dev *eth_dev, uint16_t tx_queue_id,if (!rte_is_power_of_2 (nb_desc) || nb_desc <IONIC_MIN_RING_DESC )return -EINVAL ;/* or use IONIC_DEFAULT_RING_DESC */ +if (tx_conf->tx_free_thresh > nb_desc) { +IONIC_PRINT (ERR , +"tx_free_thresh must be less than nb_desc (%u)" , + nb_desc); +return -EINVAL ; + } +/* Free memory prior to re-allocation if needed... */ if (eth_dev->data->tx_queues[tx_queue_id] !=NULL ) {ionic_dev_tx_queue_release (eth_dev, tx_queue_id);
@@ -252,6 +259,10 @@ ionic_dev_tx_queue_setup(struct rte_eth_dev *eth_dev, uint16_t tx_queue_id,if (offloads &RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE ) txq->flags |=IONIC_QCQ_F_FAST_FREE ; + txq->free_thresh = + tx_conf->tx_free_thresh ? tx_conf->tx_free_thresh : + nb_desc -IONIC_DEF_TXRX_BURST ; + eth_dev->data->tx_queues[tx_queue_id] = txq;return 0 ;
@@ -609,8 +620,10 @@ ionic_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,rte_mbuf_prefetch_part2 (tx_pkts[0 ]); } -/* Cleaning old buffers */ -ionic_tx_flush (txq); +if (unlikely (ionic_q_space_avail (q) < txq->free_thresh)) { +/* Cleaning old buffers */ +ionic_tx_flush (txq); + } nb_avail =ionic_q_space_avail (q);if (unlikely (nb_avail < nb_pkts)) {
Signature · 1 line
2.17.1
PATCH 32/35 net/ionic: add optimized handlers for non-scattered Rx/Tx
In reply to Andrew BoyerThe code is very similar, but the simple case can skip a few branches in the hot path. This improves PPS when 10KB mbufs are used.
S/G is enabled on the Rx side by offload DEV_RX_OFFLOAD_SCATTER. S/G is enabled on the Tx side by offload DEV_TX_OFFLOAD_MULTI_SEGS.
S/G is automatically enabled on the Rx side if the provided mbufs are too small to hold the maximum possible frame.
To enable S/G in testpmd, add these args:
--rx-offloads=0x2000 --tx-offloads=0x8000
--- doc/guides/rel_notes/release_22_11.rst | 1 + drivers/net/ionic/ionic_ethdev.c | 25 +- drivers/net/ionic/ionic_lif.c | 61 ++- drivers/net/ionic/ionic_lif.h | 1 + drivers/net/ionic/ionic_rxtx.c | 576 ++----------------------- drivers/net/ionic/ionic_rxtx.h | 46 +- drivers/net/ionic/ionic_rxtx_sg.c | 496 +++++++++++++++++++++ drivers/net/ionic/ionic_rxtx_simple.c | 417 ++++++++++++++++++ drivers/net/ionic/meson.build | 2 + 9 files changed, 1054 insertions(+), 571 deletions(-) create mode 100644 drivers/net/ionic/ionic_rxtx_sg.c create mode 100644 drivers/net/ionic/ionic_rxtx_simple.c
doc/guides/rel_notes/release_22_11.rst +1 -0
@@ -88,6 +88,7 @@ New Features * Added support for advertising packet types. * Added support for descriptor status functions. * Added Q-in-CMB feature controlled by devarg ionic_cmb. + * Added optimized handlers for non-scattered Rx and Tx. Removed Items -------------
drivers/net/ionic/ionic_ethdev.c +19 -6
@@ -828,8 +828,6 @@ ionic_dev_configure(struct rte_eth_dev *eth_dev)ionic_lif_configure (lif); -ionic_lif_set_features (lif); -return 0 ; }
@@ -883,6 +881,13 @@ ionic_dev_start(struct rte_eth_dev *eth_dev)if (dev_conf->lpbk_mode)IONIC_PRINT (WARNING ,"Loopback mode not supported" ); +/* Re-set features in case SG flag was added in rx_queue_setup() */ + err =ionic_lif_set_features (lif); +if (err) { +IONIC_PRINT (ERR ,"Cannot set LIF features: %d" , err); +return err; + } + lif->frame_size = eth_dev->data->mtu +IONIC_ETH_OVERHEAD ; err =ionic_lif_change_mtu (lif, eth_dev->data->mtu);
@@ -917,6 +922,18 @@ ionic_dev_start(struct rte_eth_dev *eth_dev) speed); } +if (lif->hw_features &IONIC_ETH_HW_RX_SG ) + eth_dev->rx_pkt_burst = &ionic_recv_pkts_sg; +else + eth_dev->rx_pkt_burst = &ionic_recv_pkts; + +if (lif->hw_features &IONIC_ETH_HW_TX_SG ) + eth_dev->tx_pkt_burst = &ionic_xmit_pkts_sg; +else + eth_dev->tx_pkt_burst = &ionic_xmit_pkts; + + eth_dev->tx_pkt_prepare = &ionic_prep_pkts; +ionic_dev_link_update (eth_dev,0 );return 0 ;
@@ -980,10 +997,6 @@ eth_ionic_dev_init(struct rte_eth_dev *eth_dev, void *init_params)IONIC_PRINT_CALL (); eth_dev->dev_ops = &ionic_eth_dev_ops; - eth_dev->rx_pkt_burst = &ionic_recv_pkts; - eth_dev->tx_pkt_burst = &ionic_xmit_pkts; - eth_dev->tx_pkt_prepare = &ionic_prep_pkts; - eth_dev->rx_descriptor_status = ionic_dev_rx_descriptor_status; eth_dev->tx_descriptor_status = ionic_dev_tx_descriptor_status;
drivers/net/ionic/ionic_lif.c +44 -17
123 lines not on this page · raw message
drivers/net/ionic/ionic_lif.h +1 -0
@@ -188,6 +188,7 @@ void ionic_lif_stop(struct ionic_lif *lif);void ionic_lif_configure (struct ionic_lif *lif);void ionic_lif_configure_vlan_offload (struct ionic_lif *lif,int mask); +void ionic_lif_configure_rx_sg_offload (struct ionic_lif *lif);void ionic_lif_reset (struct ionic_lif *lif);int ionic_intr_alloc (struct ionic_lif *lif,struct ionic_intr_info *intr);
drivers/net/ionic/ionic_rxtx.c +35 -541
695 lines not on this page · raw message
drivers/net/ionic/ionic_rxtx.h +39 -7
63 lines not on this page · raw message
drivers/net/ionic/ionic_rxtx_sg.c new file +496 -0
496 lines not on this page · raw message
drivers/net/ionic/ionic_rxtx_simple.c new file +417 -0
417 lines not on this page · raw message
drivers/net/ionic/meson.build +2 -0
@@ -16,4 +16,6 @@ sources = files( 'ionic_main.c', 'ionic_rx_filter.c', 'ionic_rxtx.c', + 'ionic_rxtx_simple.c', + 'ionic_rxtx_sg.c', )
Signature · 1 line
2.17.1
PATCH 32/35 net/ionic: add optimized handlers for non-scattered Rx/Tx
In reply to Andrew BoyerThe code is very similar, but the simple case can skip a few branches in the hot path. This improves PPS when 10KB mbufs are used.
S/G is enabled on the Rx side by offload DEV_RX_OFFLOAD_SCATTER. S/G is enabled on the Tx side by offload DEV_TX_OFFLOAD_MULTI_SEGS.
S/G is automatically enabled on the Rx side if the provided mbufs are too small to hold the maximum possible frame.
To enable S/G in testpmd, add these args:
--rx-offloads=0x2000 --tx-offloads=0x8000
--- doc/guides/rel_notes/release_22_11.rst | 1 + drivers/net/ionic/ionic_ethdev.c | 25 +- drivers/net/ionic/ionic_lif.c | 61 ++- drivers/net/ionic/ionic_lif.h | 1 + drivers/net/ionic/ionic_rxtx.c | 576 ++----------------------- drivers/net/ionic/ionic_rxtx.h | 46 +- drivers/net/ionic/ionic_rxtx_sg.c | 496 +++++++++++++++++++++ drivers/net/ionic/ionic_rxtx_simple.c | 417 ++++++++++++++++++ drivers/net/ionic/meson.build | 2 + 9 files changed, 1054 insertions(+), 571 deletions(-) create mode 100644 drivers/net/ionic/ionic_rxtx_sg.c create mode 100644 drivers/net/ionic/ionic_rxtx_simple.c
doc/guides/rel_notes/release_22_11.rst +1 -0
@@ -169,6 +169,7 @@ New Features * Added support for advertising packet types. * Added support for descriptor status functions. * Added Q-in-CMB feature controlled by devarg ionic_cmb. + * Added optimized handlers for non-scattered Rx and Tx. * **Added support for MACsec in rte_security.**
drivers/net/ionic/ionic_ethdev.c +19 -6
@@ -828,8 +828,6 @@ ionic_dev_configure(struct rte_eth_dev *eth_dev)ionic_lif_configure (lif); -ionic_lif_set_features (lif); -return 0 ; }
@@ -883,6 +881,13 @@ ionic_dev_start(struct rte_eth_dev *eth_dev)if (dev_conf->lpbk_mode)IONIC_PRINT (WARNING ,"Loopback mode not supported" ); +/* Re-set features in case SG flag was added in rx_queue_setup() */ + err =ionic_lif_set_features (lif); +if (err) { +IONIC_PRINT (ERR ,"Cannot set LIF features: %d" , err); +return err; + } + lif->frame_size = eth_dev->data->mtu +IONIC_ETH_OVERHEAD ; err =ionic_lif_change_mtu (lif, eth_dev->data->mtu);
@@ -917,6 +922,18 @@ ionic_dev_start(struct rte_eth_dev *eth_dev) speed); } +if (lif->hw_features &IONIC_ETH_HW_RX_SG ) + eth_dev->rx_pkt_burst = &ionic_recv_pkts_sg; +else + eth_dev->rx_pkt_burst = &ionic_recv_pkts; + +if (lif->hw_features &IONIC_ETH_HW_TX_SG ) + eth_dev->tx_pkt_burst = &ionic_xmit_pkts_sg; +else + eth_dev->tx_pkt_burst = &ionic_xmit_pkts; + + eth_dev->tx_pkt_prepare = &ionic_prep_pkts; +ionic_dev_link_update (eth_dev,0 );return 0 ;
@@ -980,10 +997,6 @@ eth_ionic_dev_init(struct rte_eth_dev *eth_dev, void *init_params)IONIC_PRINT_CALL (); eth_dev->dev_ops = &ionic_eth_dev_ops; - eth_dev->rx_pkt_burst = &ionic_recv_pkts; - eth_dev->tx_pkt_burst = &ionic_xmit_pkts; - eth_dev->tx_pkt_prepare = &ionic_prep_pkts; - eth_dev->rx_descriptor_status = ionic_dev_rx_descriptor_status; eth_dev->tx_descriptor_status = ionic_dev_tx_descriptor_status;
drivers/net/ionic/ionic_lif.c +44 -17
123 lines not on this page · raw message
drivers/net/ionic/ionic_lif.h +1 -0
@@ -188,6 +188,7 @@ void ionic_lif_stop(struct ionic_lif *lif);void ionic_lif_configure (struct ionic_lif *lif);void ionic_lif_configure_vlan_offload (struct ionic_lif *lif,int mask); +void ionic_lif_configure_rx_sg_offload (struct ionic_lif *lif);void ionic_lif_reset (struct ionic_lif *lif);int ionic_intr_alloc (struct ionic_lif *lif,struct ionic_intr_info *intr);
drivers/net/ionic/ionic_rxtx.c +35 -541
695 lines not on this page · raw message
drivers/net/ionic/ionic_rxtx.h +39 -7
63 lines not on this page · raw message
drivers/net/ionic/ionic_rxtx_sg.c new file +496 -0
496 lines not on this page · raw message
drivers/net/ionic/ionic_rxtx_simple.c new file +417 -0
417 lines not on this page · raw message
drivers/net/ionic/meson.build +2 -0
@@ -16,4 +16,6 @@ sources = files( 'ionic_main.c', 'ionic_rx_filter.c', 'ionic_rxtx.c', + 'ionic_rxtx_simple.c', + 'ionic_rxtx_sg.c', )
Signature · 1 line
2.17.1
PATCH 33/35 net/ionic: use a helper variable for page size
In reply to Andrew BoyerThis improves readability.
--- drivers/net/ionic/ionic_lif.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-)
drivers/net/ionic/ionic_lif.c +12 -14
@@ -576,6 +576,7 @@ ionic_qcq_alloc(struct ionic_lif *lif,rte_iova_t q_base_pa =0 ;rte_iova_t cq_base_pa =0 ;rte_iova_t sg_base_pa =0 ; +size_t page_size =rte_mem_page_size ();int err; *qcq =NULL ;
@@ -584,18 +585,18 @@ ionic_qcq_alloc(struct ionic_lif *lif, cq_size = num_descs * cq_desc_size; sg_size = num_descs * sg_desc_size; - total_size =RTE_ALIGN (q_size,rte_mem_page_size ()) + -RTE_ALIGN (cq_size,rte_mem_page_size ()); + total_size =RTE_ALIGN (q_size, page_size) + +RTE_ALIGN (cq_size, page_size);/* * Note: aligning q_size/cq_size is not enough due to cq_base address * aligning as q_base could be not aligned to the page. -* Adding rte_mem_page_size(). +* Adding page_size. */ - total_size +=rte_mem_page_size (); + total_size += page_size;if (flags &IONIC_QCQ_F_SG ) { - total_size +=RTE_ALIGN (sg_size,rte_mem_page_size ()); - total_size +=rte_mem_page_size (); + total_size +=RTE_ALIGN (sg_size, page_size); + total_size += page_size; } new = rte_zmalloc_socket("ionic", struct_size,
@@ -610,7 +611,7 @@ ionic_qcq_alloc(struct ionic_lif *lif,/* Most queue types will store 1 ptr per descriptor */ new->q.info =rte_calloc_socket ("ionic" , num_descs * num_segs,sizeof (void *), -rte_mem_page_size (), socket_id); + page_size, socket_id);if (!new->q.info) {IONIC_PRINT (ERR ,"Cannot allocate queue info" ); err = -ENOMEM ;
@@ -648,16 +649,13 @@ ionic_qcq_alloc(struct ionic_lif *lif, q_base = new->base; q_base_pa = new->base_pa; - cq_base = (void *)RTE_ALIGN ((uintptr_t )q_base + q_size, -rte_mem_page_size ()); - cq_base_pa =RTE_ALIGN (q_base_pa + q_size, -rte_mem_page_size ()); + cq_base = (void *)RTE_ALIGN ((uintptr_t )q_base + q_size, page_size); + cq_base_pa =RTE_ALIGN (q_base_pa + q_size, page_size);if (flags &IONIC_QCQ_F_SG ) { sg_base = (void *)RTE_ALIGN ((uintptr_t )cq_base + cq_size, -rte_mem_page_size ()); - sg_base_pa =RTE_ALIGN (cq_base_pa + cq_size, -rte_mem_page_size ()); + page_size); + sg_base_pa =RTE_ALIGN (cq_base_pa + cq_size, page_size);ionic_q_sg_map (&new->q, sg_base, sg_base_pa); }
Signature · 1 line
2.17.1
PATCH 33/35 net/ionic: use a helper variable for page size
In reply to Andrew BoyerThis improves readability.
--- drivers/net/ionic/ionic_lif.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-)
drivers/net/ionic/ionic_lif.c +12 -14
@@ -576,6 +576,7 @@ ionic_qcq_alloc(struct ionic_lif *lif,rte_iova_t q_base_pa =0 ;rte_iova_t cq_base_pa =0 ;rte_iova_t sg_base_pa =0 ; +size_t page_size =rte_mem_page_size ();int err; *qcq =NULL ;
@@ -584,18 +585,18 @@ ionic_qcq_alloc(struct ionic_lif *lif, cq_size = num_descs * cq_desc_size; sg_size = num_descs * sg_desc_size; - total_size =RTE_ALIGN (q_size,rte_mem_page_size ()) + -RTE_ALIGN (cq_size,rte_mem_page_size ()); + total_size =RTE_ALIGN (q_size, page_size) + +RTE_ALIGN (cq_size, page_size);/* * Note: aligning q_size/cq_size is not enough due to cq_base address * aligning as q_base could be not aligned to the page. -* Adding rte_mem_page_size(). +* Adding page_size. */ - total_size +=rte_mem_page_size (); + total_size += page_size;if (flags &IONIC_QCQ_F_SG ) { - total_size +=RTE_ALIGN (sg_size,rte_mem_page_size ()); - total_size +=rte_mem_page_size (); + total_size +=RTE_ALIGN (sg_size, page_size); + total_size += page_size; } new = rte_zmalloc_socket("ionic", struct_size,
@@ -610,7 +611,7 @@ ionic_qcq_alloc(struct ionic_lif *lif,/* Most queue types will store 1 ptr per descriptor */ new->q.info =rte_calloc_socket ("ionic" , num_descs * num_segs,sizeof (void *), -rte_mem_page_size (), socket_id); + page_size, socket_id);if (!new->q.info) {IONIC_PRINT (ERR ,"Cannot allocate queue info" ); err = -ENOMEM ;
@@ -648,16 +649,13 @@ ionic_qcq_alloc(struct ionic_lif *lif, q_base = new->base; q_base_pa = new->base_pa; - cq_base = (void *)RTE_ALIGN ((uintptr_t )q_base + q_size, -rte_mem_page_size ()); - cq_base_pa =RTE_ALIGN (q_base_pa + q_size, -rte_mem_page_size ()); + cq_base = (void *)RTE_ALIGN ((uintptr_t )q_base + q_size, page_size); + cq_base_pa =RTE_ALIGN (q_base_pa + q_size, page_size);if (flags &IONIC_QCQ_F_SG ) { sg_base = (void *)RTE_ALIGN ((uintptr_t )cq_base + cq_size, -rte_mem_page_size ()); - sg_base_pa =RTE_ALIGN (cq_base_pa + cq_size, -rte_mem_page_size ()); + page_size); + sg_base_pa =RTE_ALIGN (cq_base_pa + cq_size, page_size);ionic_q_sg_map (&new->q, sg_base, sg_base_pa); }
Signature · 1 line
2.17.1
PATCH 34/35 net/ionic: retry init commands up to five times
In reply to Andrew BoyerIn some configurations, the FW may return EAGAIN if it is not able to respond to commands immediately. Retry the init commands in this case to prevent errors from reaching the client.
Fix up some return-code stuff while here, for clarity.
--- drivers/net/ionic/ionic_dev.h | 1 + drivers/net/ionic/ionic_lif.c | 14 ++++++++++++++ drivers/net/ionic/ionic_main.c | 4 ++-- 3 files changed, 17 insertions(+), 2 deletions(-)
drivers/net/ionic/ionic_dev.h +1 -0
@@ -24,6 +24,7 @@#define IONIC_DEVCMD_TIMEOUT 5/* devcmd_timeout */ #define IONIC_DEVCMD_CHECK_PERIOD_US 10/* devcmd status chk period */ +#define IONIC_DEVCMD_RETRY_WAIT_US 20000#define IONIC_ALIGN 4096
drivers/net/ionic/ionic_lif.c +14 -0
@@ -1423,10 +1423,17 @@ ionic_lif_adminq_init(struct ionic_lif *lif)struct ionic_admin_qcq *aqcq = lif->adminqcq;struct ionic_queue *q = &aqcq->qcq.q;struct ionic_q_init_comp comp; +uint32_t retries =5 ;int err; +retry_adminq_init:ionic_dev_cmd_adminq_init (idev, &aqcq->qcq); err =ionic_dev_cmd_wait_check (idev,IONIC_DEVCMD_TIMEOUT ); +if (err == -EAGAIN && retries >0 ) { + retries--; +rte_delay_us_block (IONIC_DEVCMD_RETRY_WAIT_US ); + goto retry_adminq_init; + }if (err)return err;
@@ -1713,12 +1720,19 @@ ionic_lif_init(struct ionic_lif *lif) {struct ionic_dev *idev = &lif->adapter->idev;struct ionic_lif_init_comp comp; +uint32_t retries =5 ;int err;memset (&lif->stats_base,0 ,sizeof (lif->stats_base)); +retry_lif_init:ionic_dev_cmd_lif_init (idev, lif->info_pa); err =ionic_dev_cmd_wait_check (idev,IONIC_DEVCMD_TIMEOUT ); +if (err == -EAGAIN && retries >0 ) { + retries--; +rte_delay_us_block (IONIC_DEVCMD_RETRY_WAIT_US ); + goto retry_lif_init; + }if (err)return err;
drivers/net/ionic/ionic_main.c +2 -2
@@ -313,10 +313,10 @@ ionic_dev_cmd_check_error(struct ionic_dev *idev)uint8_t status; status =ionic_dev_cmd_status (idev); -if (status ==0 ) +if (status ==IONIC_RC_SUCCESS )return 0 ; -return -EIO ; +return (status ==IONIC_RC_EAGAIN ) ? -EAGAIN : -EIO ; }int
Signature · 1 line
2.17.1
PATCH 34/35 net/ionic: retry init commands up to five times
In reply to Andrew BoyerIn some configurations, the FW may return EAGAIN if it is not able to respond to commands immediately. Retry the init commands in this case to prevent errors from reaching the client.
Fix up some return-code stuff while here, for clarity.
--- drivers/net/ionic/ionic_dev.h | 1 + drivers/net/ionic/ionic_lif.c | 14 ++++++++++++++ drivers/net/ionic/ionic_main.c | 4 ++-- 3 files changed, 17 insertions(+), 2 deletions(-)
drivers/net/ionic/ionic_dev.h +1 -0
@@ -24,6 +24,7 @@#define IONIC_DEVCMD_TIMEOUT 5/* devcmd_timeout */ #define IONIC_DEVCMD_CHECK_PERIOD_US 10/* devcmd status chk period */ +#define IONIC_DEVCMD_RETRY_WAIT_US 20000#define IONIC_ALIGN 4096
drivers/net/ionic/ionic_lif.c +14 -0
@@ -1423,10 +1423,17 @@ ionic_lif_adminq_init(struct ionic_lif *lif)struct ionic_admin_qcq *aqcq = lif->adminqcq;struct ionic_queue *q = &aqcq->qcq.q;struct ionic_q_init_comp comp; +uint32_t retries =5 ;int err; +retry_adminq_init:ionic_dev_cmd_adminq_init (idev, &aqcq->qcq); err =ionic_dev_cmd_wait_check (idev,IONIC_DEVCMD_TIMEOUT ); +if (err == -EAGAIN && retries >0 ) { + retries--; +rte_delay_us_block (IONIC_DEVCMD_RETRY_WAIT_US ); + goto retry_adminq_init; + }if (err)return err;
@@ -1713,12 +1720,19 @@ ionic_lif_init(struct ionic_lif *lif) {struct ionic_dev *idev = &lif->adapter->idev;struct ionic_lif_init_comp comp; +uint32_t retries =5 ;int err;memset (&lif->stats_base,0 ,sizeof (lif->stats_base)); +retry_lif_init:ionic_dev_cmd_lif_init (idev, lif->info_pa); err =ionic_dev_cmd_wait_check (idev,IONIC_DEVCMD_TIMEOUT ); +if (err == -EAGAIN && retries >0 ) { + retries--; +rte_delay_us_block (IONIC_DEVCMD_RETRY_WAIT_US ); + goto retry_lif_init; + }if (err)return err;
drivers/net/ionic/ionic_main.c +2 -2
@@ -313,10 +313,10 @@ ionic_dev_cmd_check_error(struct ionic_dev *idev)uint8_t status; status =ionic_dev_cmd_status (idev); -if (status ==0 ) +if (status ==IONIC_RC_SUCCESS )return 0 ; -return -EIO ; +return (status ==IONIC_RC_EAGAIN ) ? -EAGAIN : -EIO ; }int
Signature · 1 line
2.17.1
PATCH 35/35 net/ionic: add watchdogs to protect each queue type
In reply to Andrew BoyerRing the doorbell again for the following scenarios:
* No receives posted but Rx queue not empty after deadline
* No transmits posted but Tx work still pending after deadline
* Admin queue work still pending after deadline
This will help the queues recover in the extremely rare case that a doorbell is missed by the FW.
--- drivers/net/ionic/ionic_dev.h | 4 +++ drivers/net/ionic/ionic_lif.h | 3 ++ drivers/net/ionic/ionic_main.c | 22 ++++++++++++ drivers/net/ionic/ionic_rxtx.c | 1 + drivers/net/ionic/ionic_rxtx_sg.c | 50 ++++++++++++++++++++++++++- drivers/net/ionic/ionic_rxtx_simple.c | 50 ++++++++++++++++++++++++++- 6 files changed, 128 insertions(+), 2 deletions(-)
drivers/net/ionic/ionic_dev.h +4 -0
@@ -26,6 +26,10 @@#define IONIC_DEVCMD_CHECK_PERIOD_US 10/* devcmd status chk period */ #define IONIC_DEVCMD_RETRY_WAIT_US 20000 +#define IONIC_Q_WDOG_MS 10/* 10ms */ +#define IONIC_Q_WDOG_MAX_MS 5000/* 5s */ +#define IONIC_ADMINQ_WDOG_MS 500/* 500ms */ +#define IONIC_ALIGN 4096struct ionic_adapter ;
drivers/net/ionic/ionic_lif.h +3 -0
@@ -85,6 +85,8 @@ struct ionic_rx_qcq {struct rte_mempool *mb_pool;uint64_t rearm_data;uint64_t rearm_seg_data; +uint64_t last_wdog_cycles; +uint64_t wdog_ms;uint16_t frame_size;/* Based on configured MTU */ uint16_t hdr_seg_size;/* Length of first segment of RX chain */ uint16_t seg_size;/* Length of all subsequent segments */
@@ -103,6 +105,7 @@ struct ionic_tx_qcq {struct ionic_qcq qcq;/* cacheline2 */ +uint64_t last_wdog_cycles;uint16_t num_segs_fw;/* # segs supported by current FW */ uint16_t free_thresh;uint16_t flags;
drivers/net/ionic/ionic_main.c +22 -0
@@ -230,10 +230,16 @@ static int ionic_adminq_wait_for_completion(struct ionic_lif *lif, struct ionic_admin_ctx *ctx, unsigned long max_wait) { + struct ionic_queue *q = &lif->adminqcq->qcq.q;unsigned long step_usec =IONIC_DEVCMD_CHECK_PERIOD_US ; +unsigned long step_deadline;unsigned long max_wait_usec = max_wait *1000000L ;unsigned long elapsed_usec =0 ;int budget =8 ; +uint16_t idx; +void **info; + + step_deadline =IONIC_ADMINQ_WDOG_MS *1000 / step_usec;while (ctx->pending_work && elapsed_usec < max_wait_usec) {/*
@@ -245,10 +251,26 @@ ionic_adminq_wait_for_completion(struct ionic_lif *lif,ionic_qcq_service (&lif->adminqcq->qcq, budget, ionic_adminq_service,NULL ); +/* +* Ring the doorbell again if work is pending after deadline. +*/ +if (ctx->pending_work && !step_deadline) { + step_deadline =IONIC_ADMINQ_WDOG_MS * +1000 / step_usec; + +rte_spinlock_lock (&lif->adminq_lock); + idx =Q_NEXT_TO_POST (q,-1 ); + info =IONIC_INFO_PTR (q, idx); +if (info[0 ] == ctx) +ionic_q_flush (q); +rte_spinlock_unlock (&lif->adminq_lock); + } +rte_spinlock_unlock (&lif->adminq_service_lock);rte_delay_us_block (step_usec); elapsed_usec += step_usec; + step_deadline--; }return (!ctx->pending_work);
drivers/net/ionic/ionic_rxtx.c +1 -0
@@ -551,6 +551,7 @@ ionic_dev_rx_queue_setup(struct rte_eth_dev *eth_dev, } rxq->mb_pool = mp; + rxq->wdog_ms =IONIC_Q_WDOG_MS ;/* * Note: the interface does not currently support
drivers/net/ionic/ionic_rxtx_sg.c +49 -1
77 lines not on this page · raw message
drivers/net/ionic/ionic_rxtx_simple.c +49 -1
77 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH 35/35 net/ionic: add watchdogs to protect each queue type
In reply to Andrew BoyerRing the doorbell again for the following scenarios:
* No receives posted but Rx queue not empty after deadline
* No transmits posted but Tx work still pending after deadline
* Admin queue work still pending after deadline
This will help the queues recover in the extremely rare case that a doorbell is missed by the FW.
--- drivers/net/ionic/ionic_dev.h | 4 +++ drivers/net/ionic/ionic_lif.h | 3 ++ drivers/net/ionic/ionic_main.c | 22 ++++++++++++ drivers/net/ionic/ionic_rxtx.c | 1 + drivers/net/ionic/ionic_rxtx_sg.c | 50 ++++++++++++++++++++++++++- drivers/net/ionic/ionic_rxtx_simple.c | 50 ++++++++++++++++++++++++++- 6 files changed, 128 insertions(+), 2 deletions(-)
drivers/net/ionic/ionic_dev.h +4 -0
@@ -26,6 +26,10 @@#define IONIC_DEVCMD_CHECK_PERIOD_US 10/* devcmd status chk period */ #define IONIC_DEVCMD_RETRY_WAIT_US 20000 +#define IONIC_Q_WDOG_MS 10/* 10ms */ +#define IONIC_Q_WDOG_MAX_MS 5000/* 5s */ +#define IONIC_ADMINQ_WDOG_MS 500/* 500ms */ +#define IONIC_ALIGN 4096struct ionic_adapter ;
drivers/net/ionic/ionic_lif.h +3 -0
@@ -85,6 +85,8 @@ struct ionic_rx_qcq {struct rte_mempool *mb_pool;uint64_t rearm_data;uint64_t rearm_seg_data; +uint64_t last_wdog_cycles; +uint64_t wdog_ms;uint16_t frame_size;/* Based on configured MTU */ uint16_t hdr_seg_size;/* Length of first segment of RX chain */ uint16_t seg_size;/* Length of all subsequent segments */
@@ -103,6 +105,7 @@ struct ionic_tx_qcq {struct ionic_qcq qcq;/* cacheline2 */ +uint64_t last_wdog_cycles;uint16_t num_segs_fw;/* # segs supported by current FW */ uint16_t free_thresh;uint16_t flags;
drivers/net/ionic/ionic_main.c +22 -0
@@ -230,10 +230,16 @@ static int ionic_adminq_wait_for_completion(struct ionic_lif *lif, struct ionic_admin_ctx *ctx, unsigned long max_wait) { + struct ionic_queue *q = &lif->adminqcq->qcq.q;unsigned long step_usec =IONIC_DEVCMD_CHECK_PERIOD_US ; +unsigned long step_deadline;unsigned long max_wait_usec = max_wait *1000000L ;unsigned long elapsed_usec =0 ;int budget =8 ; +uint16_t idx; +void **info; + + step_deadline =IONIC_ADMINQ_WDOG_MS *1000 / step_usec;while (ctx->pending_work && elapsed_usec < max_wait_usec) {/*
@@ -245,10 +251,26 @@ ionic_adminq_wait_for_completion(struct ionic_lif *lif,ionic_qcq_service (&lif->adminqcq->qcq, budget, ionic_adminq_service,NULL ); +/* +* Ring the doorbell again if work is pending after deadline. +*/ +if (ctx->pending_work && !step_deadline) { + step_deadline =IONIC_ADMINQ_WDOG_MS * +1000 / step_usec; + +rte_spinlock_lock (&lif->adminq_lock); + idx =Q_NEXT_TO_POST (q,-1 ); + info =IONIC_INFO_PTR (q, idx); +if (info[0 ] == ctx) +ionic_q_flush (q); +rte_spinlock_unlock (&lif->adminq_lock); + } +rte_spinlock_unlock (&lif->adminq_service_lock);rte_delay_us_block (step_usec); elapsed_usec += step_usec; + step_deadline--; }return (!ctx->pending_work);
drivers/net/ionic/ionic_rxtx.c +1 -0
@@ -551,6 +551,7 @@ ionic_dev_rx_queue_setup(struct rte_eth_dev *eth_dev, } rxq->mb_pool = mp; + rxq->wdog_ms =IONIC_Q_WDOG_MS ;/* * Note: the interface does not currently support
drivers/net/ionic/ionic_rxtx_sg.c +49 -1
77 lines not on this page · raw message
drivers/net/ionic/ionic_rxtx_simple.c +49 -1
77 lines not on this page · raw message
Signature · 1 line
2.17.1