DPDK patches and discussions
 help / color / mirror / Atom feed
From: Andrew Boyer <andrew.boyer@amd.com>
To: <dev@dpdk.org>
Cc: Neel Patel <neel.patel@amd.com>, <stable@dpdk.org>,
	Andrew Boyer <andrew.boyer@amd.com>
Subject: [PATCH 04/13] net/ionic: fix missing volatile type for cqe pointers
Date: Fri, 2 Feb 2024 11:32:29 -0800	[thread overview]
Message-ID: <20240202193238.62669-5-andrew.boyer@amd.com> (raw)
In-Reply-To: <20240202193238.62669-1-andrew.boyer@amd.com>

From: Neel Patel <neel.patel@amd.com>

This memory may be changed by the hardware, so the volatile
keyword is required for correctness.

Fixes: e86a6fcc7cf3 ("net/ionic: add optimized non-scattered Rx/Tx")
cc: stable@dpdk.org

Signed-off-by: Andrew Boyer <andrew.boyer@amd.com>
Signed-off-by: Neel Patel <neel.patel@amd.com>
---
 drivers/net/ionic/ionic_rxtx.c        | 4 ++--
 drivers/net/ionic/ionic_rxtx_sg.c     | 8 +++++---
 drivers/net/ionic/ionic_rxtx_simple.c | 8 +++++---
 3 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ionic/ionic_rxtx.c b/drivers/net/ionic/ionic_rxtx.c
index d92b231f8f..d92fa1cca7 100644
--- a/drivers/net/ionic/ionic_rxtx.c
+++ b/drivers/net/ionic/ionic_rxtx.c
@@ -755,7 +755,7 @@ 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;
+	volatile struct ionic_rxq_comp *cq_desc;
 	uint16_t mask, head, tail, pos;
 	bool done_color;
 
@@ -794,7 +794,7 @@ ionic_dev_tx_descriptor_status(void *tx_queue, uint16_t offset)
 {
 	struct ionic_tx_qcq *txq = tx_queue;
 	struct ionic_qcq *qcq = &txq->qcq;
-	struct ionic_txq_comp *cq_desc;
+	volatile struct ionic_txq_comp *cq_desc;
 	uint16_t mask, head, tail, pos, cq_pos;
 	bool done_color;
 
diff --git a/drivers/net/ionic/ionic_rxtx_sg.c b/drivers/net/ionic/ionic_rxtx_sg.c
index 6c028a698c..1392342463 100644
--- a/drivers/net/ionic/ionic_rxtx_sg.c
+++ b/drivers/net/ionic/ionic_rxtx_sg.c
@@ -28,7 +28,8 @@ ionic_tx_flush_sg(struct ionic_tx_qcq *txq)
 	struct ionic_queue *q = &txq->qcq.q;
 	struct ionic_tx_stats *stats = &txq->stats;
 	struct rte_mbuf *txm;
-	struct ionic_txq_comp *cq_desc, *cq_desc_base = cq->base;
+	struct ionic_txq_comp *cq_desc_base = cq->base;
+	volatile struct ionic_txq_comp *cq_desc;
 	void **info;
 	uint32_t i;
 
@@ -254,7 +255,7 @@ ionic_xmit_pkts_sg(void *tx_queue, struct rte_mbuf **tx_pkts,
  */
 static __rte_always_inline void
 ionic_rx_clean_one_sg(struct ionic_rx_qcq *rxq,
-		struct ionic_rxq_comp *cq_desc,
+		volatile struct ionic_rxq_comp *cq_desc,
 		struct ionic_rx_service *rx_svc)
 {
 	struct ionic_queue *q = &rxq->qcq.q;
@@ -440,7 +441,8 @@ ionic_rxq_service_sg(struct ionic_rx_qcq *rxq, uint32_t work_to_do,
 	struct ionic_cq *cq = &rxq->qcq.cq;
 	struct ionic_queue *q = &rxq->qcq.q;
 	struct ionic_rxq_desc *q_desc_base = q->base;
-	struct ionic_rxq_comp *cq_desc, *cq_desc_base = cq->base;
+	struct ionic_rxq_comp *cq_desc_base = cq->base;
+	volatile struct ionic_rxq_comp *cq_desc;
 	uint32_t work_done = 0;
 	uint64_t then, now, hz, delta;
 
diff --git a/drivers/net/ionic/ionic_rxtx_simple.c b/drivers/net/ionic/ionic_rxtx_simple.c
index 5969287b66..00152c885a 100644
--- a/drivers/net/ionic/ionic_rxtx_simple.c
+++ b/drivers/net/ionic/ionic_rxtx_simple.c
@@ -28,7 +28,8 @@ ionic_tx_flush(struct ionic_tx_qcq *txq)
 	struct ionic_queue *q = &txq->qcq.q;
 	struct ionic_tx_stats *stats = &txq->stats;
 	struct rte_mbuf *txm;
-	struct ionic_txq_comp *cq_desc, *cq_desc_base = cq->base;
+	struct ionic_txq_comp *cq_desc_base = cq->base;
+	volatile struct ionic_txq_comp *cq_desc;
 	void **info;
 
 	cq_desc = &cq_desc_base[cq->tail_idx];
@@ -227,7 +228,7 @@ ionic_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
  */
 static __rte_always_inline void
 ionic_rx_clean_one(struct ionic_rx_qcq *rxq,
-		struct ionic_rxq_comp *cq_desc,
+		volatile struct ionic_rxq_comp *cq_desc,
 		struct ionic_rx_service *rx_svc)
 {
 	struct ionic_queue *q = &rxq->qcq.q;
@@ -361,7 +362,8 @@ ionic_rxq_service(struct ionic_rx_qcq *rxq, uint32_t work_to_do,
 	struct ionic_cq *cq = &rxq->qcq.cq;
 	struct ionic_queue *q = &rxq->qcq.q;
 	struct ionic_rxq_desc *q_desc_base = q->base;
-	struct ionic_rxq_comp *cq_desc, *cq_desc_base = cq->base;
+	struct ionic_rxq_comp *cq_desc_base = cq->base;
+	volatile struct ionic_rxq_comp *cq_desc;
 	uint32_t work_done = 0;
 	uint64_t then, now, hz, delta;
 
-- 
2.17.1


  parent reply	other threads:[~2024-02-02 19:33 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-02 19:32 [PATCH 00/13] net/ionic: miscellaneous fixes and improvements Andrew Boyer
2024-02-02 19:32 ` [PATCH 01/13] net/ionic: add stat for completion queue entries processed Andrew Boyer
2024-02-03  4:24   ` Stephen Hemminger
2024-02-05 12:49     ` Boyer, Andrew
2024-02-02 19:32 ` [PATCH 02/13] net/ionic: increase max supported MTU to 9750 bytes Andrew Boyer
2024-02-02 19:32 ` [PATCH 03/13] net/ionic: don't auto-enable Rx scatter-gather a second time Andrew Boyer
2024-02-02 19:32 ` Andrew Boyer [this message]
2024-02-03  4:26   ` [PATCH 04/13] net/ionic: fix missing volatile type for cqe pointers Stephen Hemminger
2024-02-05 13:33     ` Boyer, Andrew
2024-02-02 19:32 ` [PATCH 05/13] net/ionic: replace non-standard type in structure definition Andrew Boyer
2024-02-02 19:32 ` [PATCH 06/13] net/ionic: memcpy descriptors when using Q-in-CMB Andrew Boyer
2024-02-02 19:32 ` [PATCH 07/13] net/ionic: fix RSS query routine Andrew Boyer
2024-02-02 19:32 ` [PATCH 08/13] net/ionic: report 1G and 200G link speeds when applicable Andrew Boyer
2024-02-02 19:32 ` [PATCH 09/13] net/ionic: add flexible firmware xstat counters Andrew Boyer
2024-02-02 19:32 ` [PATCH 10/13] net/ionic: fix device close sequence to avoid crash Andrew Boyer
2024-02-02 19:32 ` [PATCH 11/13] net/ionic: optimize device close operation Andrew Boyer
2024-02-02 19:32 ` [PATCH 12/13] net/ionic: optimize device stop operation Andrew Boyer
2024-02-02 19:32 ` [PATCH 13/13] net/ionic: optimize device start operation Andrew Boyer
2024-02-03  4:28   ` Stephen Hemminger
2024-02-05 13:21     ` Boyer, Andrew
2024-02-05 18:44 ` [PATCH 00/13] net/ionic: miscellaneous fixes and improvements Patrick Robb
2024-02-05 19:41   ` Boyer, Andrew
2024-02-07  2:18 ` [PATCH v2 " Andrew Boyer
2024-02-07  2:18 ` [PATCH v2 01/13] net/ionic: add stat for completion queue entries processed Andrew Boyer
2024-02-07  2:18 ` [PATCH v2 02/13] net/ionic: increase max supported MTU to 9750 bytes Andrew Boyer
2024-02-07  2:18 ` [PATCH v2 03/13] net/ionic: don't auto-enable Rx scatter-gather a second time Andrew Boyer
2024-02-07  2:18 ` [PATCH v2 04/13] net/ionic: fix missing volatile type for cqe pointers Andrew Boyer
2024-02-07  2:18 ` [PATCH v2 05/13] net/ionic: replace non-standard type in structure definition Andrew Boyer
2024-02-07  2:18 ` [PATCH v2 06/13] net/ionic: memcpy descriptors when using Q-in-CMB Andrew Boyer
2024-02-07  2:18 ` [PATCH v2 07/13] net/ionic: fix RSS query routine Andrew Boyer
2024-02-07  2:18 ` [PATCH v2 08/13] net/ionic: report 1G and 200G link speeds when applicable Andrew Boyer
2024-02-07  2:18 ` [PATCH v2 09/13] net/ionic: add flexible firmware xstat counters Andrew Boyer
2024-02-07  2:18 ` [PATCH v2 10/13] net/ionic: fix device close sequence to avoid crash Andrew Boyer
2024-02-07  2:18 ` [PATCH v2 11/13] net/ionic: optimize device close operation Andrew Boyer
2024-02-07  2:18 ` [PATCH v2 12/13] net/ionic: optimize device stop operation Andrew Boyer
2024-02-07  2:18 ` [PATCH v2 13/13] net/ionic: optimize device start operation Andrew Boyer
2024-02-07  3:13 ` [PATCH v3 00/13] net/ionic: miscellaneous fixes and improvements Andrew Boyer
2024-02-07  3:13   ` [PATCH v3 01/13] net/ionic: add stat for completion queue entries processed Andrew Boyer
2024-02-07  3:13   ` [PATCH v3 02/13] net/ionic: increase max supported MTU to 9750 bytes Andrew Boyer
2024-02-07  3:13   ` [PATCH v3 03/13] net/ionic: don't auto-enable Rx scatter-gather a second time Andrew Boyer
2024-02-07  3:13   ` [PATCH v3 04/13] net/ionic: fix missing volatile type for cqe pointers Andrew Boyer
2024-02-07  3:13   ` [PATCH v3 05/13] net/ionic: replace non-standard type in structure definition Andrew Boyer
2024-02-07  3:13   ` [PATCH v3 06/13] net/ionic: memcpy descriptors when using Q-in-CMB Andrew Boyer
2024-02-07  3:13   ` [PATCH v3 07/13] net/ionic: fix RSS query routine Andrew Boyer
2024-02-07  3:13   ` [PATCH v3 08/13] net/ionic: report 1G and 200G link speeds when applicable Andrew Boyer
2024-02-07  3:13   ` [PATCH v3 09/13] net/ionic: add flexible firmware xstat counters Andrew Boyer
2024-02-07  3:13   ` [PATCH v3 10/13] net/ionic: fix device close sequence to avoid crash Andrew Boyer
2024-02-07  3:13   ` [PATCH v3 11/13] net/ionic: optimize device close operation Andrew Boyer
2024-02-07  3:13   ` [PATCH v3 12/13] net/ionic: optimize device stop operation Andrew Boyer
2024-02-07  3:13   ` [PATCH v3 13/13] net/ionic: optimize device start operation Andrew Boyer
2024-02-07 15:45   ` [PATCH v3 00/13] net/ionic: miscellaneous fixes and improvements Ferruh Yigit
2024-02-08 15:32     ` 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=20240202193238.62669-5-andrew.boyer@amd.com \
    --to=andrew.boyer@amd.com \
    --cc=dev@dpdk.org \
    --cc=neel.patel@amd.com \
    --cc=stable@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).