patch 'net/ionic: fix endianness for Rx and Tx' has been queued to stable release 20.11.7

luca.boccassi at gmail.com luca.boccassi at gmail.com
Sat Nov 5 18:11:16 CET 2022


Hi,

FYI, your patch has been queued to stable release 20.11.7

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/07/22. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/58351ee33337bfaa6782a86b91c2ba5426c86312

Thanks.

Luca Boccassi

---
>From 58351ee33337bfaa6782a86b91c2ba5426c86312 Mon Sep 17 00:00:00 2001
From: Andrew Boyer <andrew.boyer at amd.com>
Date: Tue, 18 Oct 2022 12:40:56 -0700
Subject: [PATCH] net/ionic: fix endianness for Rx and Tx

[ upstream commit 4a7355999062ba6096c8b0f48b4df344df9bf60f ]

These fields all need to be LE when talking to the FW.

Fixes: a27d901331da ("net/ionic: add Rx and Tx handling")

Signed-off-by: Andrew Boyer <andrew.boyer at amd.com>
---
 drivers/net/ionic/ionic_rxtx.c | 27 +++++++++++++++------------
 1 file changed, 15 insertions(+), 12 deletions(-)

diff --git a/drivers/net/ionic/ionic_rxtx.c b/drivers/net/ionic/ionic_rxtx.c
index 9466099352..61d909eee2 100644
--- a/drivers/net/ionic/ionic_rxtx.c
+++ b/drivers/net/ionic/ionic_rxtx.c
@@ -279,18 +279,20 @@ ionic_tx_tso_post(struct ionic_queue *q, struct ionic_txq_desc *desc,
 		uint16_t vlan_tci, bool has_vlan,
 		bool start, bool done)
 {
+	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);
 
 	ionic_q_post(q, done, NULL, done ? txm : NULL);
 }
@@ -397,7 +399,7 @@ ionic_tx_tso(struct ionic_queue *q, 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 {
@@ -445,7 +447,7 @@ ionic_tx(struct ionic_queue *q, 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;
 
@@ -477,13 +479,14 @@ ionic_tx(struct ionic_queue *q, 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);
 
 	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));
 		stats->frags++;
 		elem++;
@@ -796,7 +799,7 @@ ionic_rx_clean(struct ionic_queue *q,
 	/* Vlan Strip */
 	if (cq_desc->csum_flags & IONIC_RXQ_COMP_CSUM_F_VLAN) {
 		pkt_flags |= PKT_RX_VLAN | PKT_RX_VLAN_STRIPPED;
-		rxm->vlan_tci = cq_desc->vlan_tci;
+		rxm->vlan_tci = rte_le_to_cpu_16(cq_desc->vlan_tci);
 	}
 
 	/* Checksum */
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-11-05 17:11:10.175253369 +0000
+++ 0017-net-ionic-fix-endianness-for-Rx-and-Tx.patch	2022-11-05 17:11:08.626941612 +0000
@@ -1 +1 @@
-From 4a7355999062ba6096c8b0f48b4df344df9bf60f Mon Sep 17 00:00:00 2001
+From 58351ee33337bfaa6782a86b91c2ba5426c86312 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 4a7355999062ba6096c8b0f48b4df344df9bf60f ]
+
@@ -9 +10,0 @@
-Cc: stable at dpdk.org
@@ -17 +18 @@
-index 9f602de6a9..af2d89f9fa 100644
+index 9466099352..61d909eee2 100644
@@ -20 +21,2 @@
-@@ -300,18 +300,20 @@ ionic_tx_tso_post(struct ionic_queue *q, struct ionic_txq_desc *desc,
+@@ -279,18 +279,20 @@ ionic_tx_tso_post(struct ionic_queue *q, struct ionic_txq_desc *desc,
+ 		uint16_t vlan_tci, bool has_vlan,
@@ -23 +24,0 @@
- 	void **info;
@@ -44,3 +45,3 @@
- 	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)
+ 	ionic_q_post(q, done, NULL, done ? txm : NULL);
+ }
+@@ -397,7 +399,7 @@ ionic_tx_tso(struct ionic_queue *q, struct rte_mbuf *txm,
@@ -55 +56 @@
-@@ -470,7 +472,7 @@ ionic_tx(struct ionic_tx_qcq *txq, struct rte_mbuf *txm)
+@@ -445,7 +447,7 @@ ionic_tx(struct ionic_queue *q, struct rte_mbuf *txm,
@@ -64 +65 @@
-@@ -505,9 +507,10 @@ ionic_tx(struct ionic_tx_qcq *txq, struct rte_mbuf *txm)
+@@ -477,13 +479,14 @@ ionic_tx(struct ionic_queue *q, struct rte_mbuf *txm,
@@ -76,4 +76,0 @@
- 	info[0] = txm;
- 
-@@ -515,7 +518,7 @@ ionic_tx(struct ionic_tx_qcq *txq, struct rte_mbuf *txm)
- 
@@ -84,0 +82 @@
+ 		stats->frags++;
@@ -86,2 +84 @@
- 		txm_seg = txm_seg->next;
-@@ -845,7 +848,7 @@ ionic_rx_clean(struct ionic_rx_qcq *rxq,
+@@ -796,7 +799,7 @@ ionic_rx_clean(struct ionic_queue *q,
@@ -90 +87 @@
- 		pkt_flags |= RTE_MBUF_F_RX_VLAN | RTE_MBUF_F_RX_VLAN_STRIPPED;
+ 		pkt_flags |= PKT_RX_VLAN | PKT_RX_VLAN_STRIPPED;


More information about the stable mailing list