DPDK patches and discussions
 help / color / mirror / Atom feed
From: Andrew Boyer <aboyer@pensando.io>
To: dev@dpdk.org
Cc: Alfredo Cardigliano <cardigliano@ntop.org>,
	Andrew Boyer <aboyer@pensando.io>
Subject: [dpdk-dev] [PATCH 06/13] net/ionic: clean up Tx queue version support
Date: Mon, 18 Jan 2021 12:35:01 -0800	[thread overview]
Message-ID: <20210118203508.1332-7-aboyer@pensando.io> (raw)
In-Reply-To: <20210118203508.1332-1-aboyer@pensando.io>

The ionic PMD only supports TX queue version 1 or greater.
Version 1 introduced a new SGL format with support for more
fragments per descriptor.

Signed-off-by: Andrew Boyer <aboyer@pensando.io>
---
 drivers/net/ionic/ionic_dev.h    | 2 +-
 drivers/net/ionic/ionic_ethdev.c | 8 ++++----
 drivers/net/ionic/ionic_lif.c    | 7 ++++++-
 drivers/net/ionic/ionic_rxtx.c   | 8 ++++----
 4 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/drivers/net/ionic/ionic_dev.h b/drivers/net/ionic/ionic_dev.h
index 6931930543..ea89218662 100644
--- a/drivers/net/ionic/ionic_dev.h
+++ b/drivers/net/ionic/ionic_dev.h
@@ -107,7 +107,7 @@ static inline void ionic_struct_size_checks(void)
 
 	/* I/O */
 	RTE_BUILD_BUG_ON(sizeof(struct ionic_txq_desc) != 16);
-	RTE_BUILD_BUG_ON(sizeof(struct ionic_txq_sg_desc) != 128);
+	RTE_BUILD_BUG_ON(sizeof(struct ionic_txq_sg_desc_v1) != 256);
 	RTE_BUILD_BUG_ON(sizeof(struct ionic_txq_comp) != 16);
 
 	RTE_BUILD_BUG_ON(sizeof(struct ionic_rxq_desc) != 16);
diff --git a/drivers/net/ionic/ionic_ethdev.c b/drivers/net/ionic/ionic_ethdev.c
index 9238bf7d36..bc9a946ab5 100644
--- a/drivers/net/ionic/ionic_ethdev.c
+++ b/drivers/net/ionic/ionic_ethdev.c
@@ -70,12 +70,12 @@ static const struct rte_eth_desc_lim rx_desc_lim = {
 	.nb_align = 1,
 };
 
-static const struct rte_eth_desc_lim tx_desc_lim = {
+static const struct rte_eth_desc_lim tx_desc_lim_v1 = {
 	.nb_max = IONIC_MAX_RING_DESC,
 	.nb_min = IONIC_MIN_RING_DESC,
 	.nb_align = 1,
-	.nb_seg_max = IONIC_TX_MAX_SG_ELEMS,
-	.nb_mtu_seg_max = IONIC_TX_MAX_SG_ELEMS,
+	.nb_seg_max = IONIC_TX_MAX_SG_ELEMS_V1,
+	.nb_mtu_seg_max = IONIC_TX_MAX_SG_ELEMS_V1,
 };
 
 static const struct eth_dev_ops ionic_eth_dev_ops = {
@@ -440,7 +440,7 @@ ionic_dev_info_get(struct rte_eth_dev *eth_dev,
 		0;
 
 	dev_info->rx_desc_lim = rx_desc_lim;
-	dev_info->tx_desc_lim = tx_desc_lim;
+	dev_info->tx_desc_lim = tx_desc_lim_v1;
 
 	/* Driver-preferred Rx/Tx parameters */
 	dev_info->default_rxportconf.burst_size = 32;
diff --git a/drivers/net/ionic/ionic_lif.c b/drivers/net/ionic/ionic_lif.c
index 0d2b3d56a7..ec35d81cd5 100644
--- a/drivers/net/ionic/ionic_lif.c
+++ b/drivers/net/ionic/ionic_lif.c
@@ -761,7 +761,7 @@ ionic_tx_qcq_alloc(struct ionic_lif *lif, uint32_t index, uint16_t ntxq_descs,
 		ntxq_descs,
 		sizeof(struct ionic_txq_desc),
 		sizeof(struct ionic_txq_comp),
-		sizeof(struct ionic_txq_sg_desc),
+		sizeof(struct ionic_txq_sg_desc_v1),
 		&lif->txqcqs[index]);
 	if (err)
 		return err;
@@ -925,6 +925,11 @@ ionic_lif_alloc(struct ionic_lif *lif)
 
 	ionic_lif_queue_identify(lif);
 
+	if (lif->qtype_info[IONIC_QTYPE_TXQ].version < 1) {
+		IONIC_PRINT(ERR, "FW too old, please upgrade");
+		return -ENXIO;
+	}
+
 	IONIC_PRINT(DEBUG, "Allocating Lif Info");
 
 	rte_spinlock_init(&lif->adminq_lock);
diff --git a/drivers/net/ionic/ionic_rxtx.c b/drivers/net/ionic/ionic_rxtx.c
index 5d0e9d5d5a..c3a44faa21 100644
--- a/drivers/net/ionic/ionic_rxtx.c
+++ b/drivers/net/ionic/ionic_rxtx.c
@@ -311,9 +311,9 @@ static struct ionic_txq_desc *
 ionic_tx_tso_next(struct ionic_queue *q, struct ionic_txq_sg_elem **elem)
 {
 	struct ionic_txq_desc *desc_base = q->base;
-	struct ionic_txq_sg_desc *sg_desc_base = q->sg_base;
+	struct ionic_txq_sg_desc_v1 *sg_desc_base = q->sg_base;
 	struct ionic_txq_desc *desc = &desc_base[q->head_idx];
-	struct ionic_txq_sg_desc *sg_desc = &sg_desc_base[q->head_idx];
+	struct ionic_txq_sg_desc_v1 *sg_desc = &sg_desc_base[q->head_idx];
 
 	*elem = sg_desc->elems;
 	return desc;
@@ -446,9 +446,9 @@ ionic_tx(struct ionic_queue *q, struct rte_mbuf *txm,
 		uint64_t offloads, bool not_xmit_more)
 {
 	struct ionic_txq_desc *desc_base = q->base;
-	struct ionic_txq_sg_desc *sg_desc_base = q->sg_base;
+	struct ionic_txq_sg_desc_v1 *sg_desc_base = q->sg_base;
 	struct ionic_txq_desc *desc = &desc_base[q->head_idx];
-	struct ionic_txq_sg_desc *sg_desc = &sg_desc_base[q->head_idx];
+	struct ionic_txq_sg_desc_v1 *sg_desc = &sg_desc_base[q->head_idx];
 	struct ionic_txq_sg_elem *elem = sg_desc->elems;
 	struct ionic_tx_stats *stats = IONIC_Q_TO_TX_STATS(q);
 	struct rte_mbuf *txm_seg;
-- 
2.17.1


  parent reply	other threads:[~2021-01-18 20:36 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-18 20:34 [dpdk-dev] [PATCH 00/13] net/ionic: fixes and optimizations Andrew Boyer
2021-01-18 20:34 ` [dpdk-dev] [PATCH 01/13] net/ionic: strip out unneeded interrupt code Andrew Boyer
2021-01-18 20:34 ` [dpdk-dev] [PATCH 02/13] net/ionic: observe endianness in firmware commands Andrew Boyer
2021-01-18 20:34 ` [dpdk-dev] [PATCH 03/13] net/ionic: observe endianness in Rx filter code Andrew Boyer
2021-01-18 20:34 ` [dpdk-dev] [PATCH 04/13] net/ionic: add an array-size macro Andrew Boyer
2021-01-27 17:22   ` Ferruh Yigit
2021-01-27 17:40     ` Andrew Boyer
2021-01-29 22:44   ` [dpdk-dev] [PATCH v2 4/13] net/ionic: use the existing " Andrew Boyer
2021-02-02 12:45     ` Ferruh Yigit
2021-01-18 20:35 ` [dpdk-dev] [PATCH 05/13] net/ionic: query firmware for supported queue versions Andrew Boyer
2021-01-18 20:35 ` Andrew Boyer [this message]
2021-01-27 17:30   ` [dpdk-dev] [PATCH 06/13] net/ionic: clean up Tx queue version support Ferruh Yigit
2021-01-27 17:46     ` Andrew Boyer
2021-01-29 22:44   ` [dpdk-dev] [PATCH v2 6/13] " Andrew Boyer
2021-02-02 12:46     ` Ferruh Yigit
2021-02-05 20:20     ` Thomas Monjalon
2021-02-05 20:26       ` Andrew Boyer
2021-02-05 20:34         ` Thomas Monjalon
2021-01-18 20:35 ` [dpdk-dev] [PATCH 07/13] net/ionic: inline queue flush function Andrew Boyer
2021-01-27 17:36   ` Ferruh Yigit
2021-01-27 17:43     ` Andrew Boyer
2021-01-27 17:50       ` Ferruh Yigit
2021-01-18 20:35 ` [dpdk-dev] [PATCH 08/13] net/ionic: inline queue space function Andrew Boyer
2021-01-18 20:35 ` [dpdk-dev] [PATCH 09/13] net/ionic: observe endiannness in ioread/iowrite Andrew Boyer
2021-01-18 20:35 ` [dpdk-dev] [PATCH 10/13] net/ionic: fix to allow separate L3 and L4 csum offload Andrew Boyer
2021-01-18 20:35 ` [dpdk-dev] [PATCH 11/13] net/ionic: convert per-queue offloads into queue flags Andrew Boyer
2021-01-18 20:35 ` [dpdk-dev] [PATCH 12/13] net/ionic: fix up function attribute tags Andrew Boyer
2021-01-18 20:35 ` [dpdk-dev] [PATCH 13/13] net/ionic: fix address handling in transmit code Andrew Boyer
2021-01-27 18:02 ` [dpdk-dev] [PATCH 00/13] net/ionic: fixes and optimizations Ferruh Yigit
2021-01-27 18:10   ` Andrew Boyer
2021-01-27 22:23     ` Ferruh Yigit
2021-01-27 22:25       ` Ferruh Yigit
2021-01-29 22:44 [dpdk-dev] [PATCH] net: redefine array size macros Andrew Boyer
2021-02-01 22:28 ` Thomas Monjalon
2021-02-01 22:32   ` Andrew Boyer
2021-02-02 12:30     ` Ferruh Yigit
2021-02-22 17:09       ` Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210118203508.1332-7-aboyer@pensando.io \
    --to=aboyer@pensando.io \
    --cc=cardigliano@ntop.org \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).