patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Hernan Vargas <hernan.vargas@intel.com>
To: stable@dpdk.org, ktraynor@redhat.com
Cc: nicolas.chautru@intel.com,
	Hernan Vargas <hernan.vargas@intel.com>,
	Maxime Coquelin <maxime.coquelin@redhat.com>
Subject: [PATCH 21.11 7/7] baseband/acc100: fix double MSI intr in TB mode
Date: Wed, 16 Nov 2022 20:46:52 -0800	[thread overview]
Message-ID: <20221117044652.163000-8-hernan.vargas@intel.com> (raw)
In-Reply-To: <20221117044652.163000-1-hernan.vargas@intel.com>

[ upstream commit beaf1f876c2c871f0197f9dd090eabed8f7e1e3d ]

Fix logical bug in SW causing MSI to be issued twice when running in
transport block mode.

Fixes: f404dfe35cc ("baseband/acc100: support 4G processing")
Fixes: bec597b78a0 ("baseband/acc200: add LTE processing")

Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 drivers/baseband/acc100/rte_acc100_pmd.c | 39 ++++--------------------
 1 file changed, 6 insertions(+), 33 deletions(-)

diff --git a/drivers/baseband/acc100/rte_acc100_pmd.c b/drivers/baseband/acc100/rte_acc100_pmd.c
index 3030265c16..eba6eb0df4 100644
--- a/drivers/baseband/acc100/rte_acc100_pmd.c
+++ b/drivers/baseband/acc100/rte_acc100_pmd.c
@@ -2073,6 +2073,7 @@ acc100_dma_enqueue(struct acc100_queue *q, uint16_t n,
 		struct rte_bbdev_stats *queue_stats)
 {
 	union acc100_enqueue_reg_fmt enq_req;
+	union acc100_dma_desc *desc;
 #ifdef RTE_BBDEV_OFFLOAD_COST
 	uint64_t start_time = 0;
 	queue_stats->acc_offload_cycles = 0;
@@ -2080,13 +2081,17 @@ acc100_dma_enqueue(struct acc100_queue *q, uint16_t n,
 	RTE_SET_USED(queue_stats);
 #endif
 
+	/* Set Sdone and IRQ enable bit on last descriptor. */
+	desc = q->ring_addr + ((q->sw_ring_head + n - 1) & q->sw_ring_wrap_mask);
+	desc->req.sdone_enable = 1;
+	desc->req.irq_enable = q->irq_enable;
+
 	enq_req.val = 0;
 	/* Setting offset, 100b for 256 DMA Desc */
 	enq_req.addr_offset = ACC100_DESC_OFFSET;
 
 	/* Split ops into batches */
 	do {
-		union acc100_dma_desc *desc;
 		uint16_t enq_batch_size;
 		uint64_t offset;
 		rte_iova_t req_elem_addr;
@@ -2638,7 +2643,6 @@ enqueue_enc_one_op_tb(struct acc100_queue *q, struct rte_bbdev_enc_op *op,
 
 	/* Set SDone on last CB descriptor for TB mode. */
 	desc->req.sdone_enable = 1;
-	desc->req.irq_enable = q->irq_enable;
 
 	return current_enqueued_cbs;
 }
@@ -3202,7 +3206,6 @@ enqueue_ldpc_dec_one_op_tb(struct acc100_queue *q, struct rte_bbdev_dec_op *op,
 #endif
 	/* Set SDone on last CB descriptor for TB mode */
 	desc->req.sdone_enable = 1;
-	desc->req.irq_enable = q->irq_enable;
 
 	return current_enqueued_cbs;
 }
@@ -3304,7 +3307,6 @@ enqueue_dec_one_op_tb(struct acc100_queue *q, struct rte_bbdev_dec_op *op,
 #endif
 	/* Set SDone on last CB descriptor for TB mode */
 	desc->req.sdone_enable = 1;
-	desc->req.irq_enable = q->irq_enable;
 
 	return current_enqueued_cbs;
 }
@@ -3407,7 +3409,6 @@ acc100_enqueue_enc_cb(struct rte_bbdev_queue_data *q_data,
 	struct acc100_queue *q = q_data->queue_private;
 	int32_t avail = acc100_ring_avail_enq(q);
 	uint16_t i;
-	union acc100_dma_desc *desc;
 	int ret;
 
 	for (i = 0; i < num; ++i) {
@@ -3424,12 +3425,6 @@ acc100_enqueue_enc_cb(struct rte_bbdev_queue_data *q_data,
 	if (unlikely(i == 0))
 		return 0; /* Nothing to enqueue */
 
-	/* Set SDone in last CB in enqueued ops for CB mode*/
-	desc = q->ring_addr + ((q->sw_ring_head + i - 1)
-			& q->sw_ring_wrap_mask);
-	desc->req.sdone_enable = 1;
-	desc->req.irq_enable = q->irq_enable;
-
 	acc100_dma_enqueue(q, i, &q_data->queue_stats);
 
 	/* Update stats */
@@ -3463,7 +3458,6 @@ acc100_enqueue_ldpc_enc_cb(struct rte_bbdev_queue_data *q_data,
 	struct acc100_queue *q = q_data->queue_private;
 	int32_t avail = acc100_ring_avail_enq(q);
 	uint16_t i = 0;
-	union acc100_dma_desc *desc;
 	int ret, desc_idx = 0;
 	int16_t enq, left = num;
 
@@ -3491,12 +3485,6 @@ acc100_enqueue_ldpc_enc_cb(struct rte_bbdev_queue_data *q_data,
 	if (unlikely(i == 0))
 		return 0; /* Nothing to enqueue */
 
-	/* Set SDone in last CB in enqueued ops for CB mode*/
-	desc = q->ring_addr + ((q->sw_ring_head + desc_idx - 1)
-			& q->sw_ring_wrap_mask);
-	desc->req.sdone_enable = 1;
-	desc->req.irq_enable = q->irq_enable;
-
 	acc100_dma_enqueue(q, desc_idx, &q_data->queue_stats);
 
 	/* Update stats */
@@ -3593,7 +3581,6 @@ acc100_enqueue_dec_cb(struct rte_bbdev_queue_data *q_data,
 	struct acc100_queue *q = q_data->queue_private;
 	int32_t avail = acc100_ring_avail_enq(q);
 	uint16_t i;
-	union acc100_dma_desc *desc;
 	int ret;
 
 	for (i = 0; i < num; ++i) {
@@ -3610,12 +3597,6 @@ acc100_enqueue_dec_cb(struct rte_bbdev_queue_data *q_data,
 	if (unlikely(i == 0))
 		return 0; /* Nothing to enqueue */
 
-	/* Set SDone in last CB in enqueued ops for CB mode*/
-	desc = q->ring_addr + ((q->sw_ring_head + i - 1)
-			& q->sw_ring_wrap_mask);
-	desc->req.sdone_enable = 1;
-	desc->req.irq_enable = q->irq_enable;
-
 	acc100_dma_enqueue(q, i, &q_data->queue_stats);
 
 	/* Update stats */
@@ -3681,7 +3662,6 @@ acc100_enqueue_ldpc_dec_cb(struct rte_bbdev_queue_data *q_data,
 	struct acc100_queue *q = q_data->queue_private;
 	int32_t avail = acc100_ring_avail_enq(q);
 	uint16_t i;
-	union acc100_dma_desc *desc;
 	int ret;
 	bool same_op = false;
 	for (i = 0; i < num; ++i) {
@@ -3707,13 +3687,6 @@ acc100_enqueue_ldpc_dec_cb(struct rte_bbdev_queue_data *q_data,
 	if (unlikely(i == 0))
 		return 0; /* Nothing to enqueue */
 
-	/* Set SDone in last CB in enqueued ops for CB mode*/
-	desc = q->ring_addr + ((q->sw_ring_head + i - 1)
-			& q->sw_ring_wrap_mask);
-
-	desc->req.sdone_enable = 1;
-	desc->req.irq_enable = q->irq_enable;
-
 	acc100_dma_enqueue(q, i, &q_data->queue_stats);
 
 	/* Update stats */
-- 
2.37.1


  parent reply	other threads:[~2022-11-16 20:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-17  4:46 [PATCH 21.11 0/7] baseband/acc100: backporting patches Hernan Vargas
2022-11-17  4:46 ` [PATCH 21.11 1/7] baseband/acc100: add LDPC encoder padding function Hernan Vargas
2022-11-17  4:46 ` [PATCH 21.11 2/7] baseband/acc100: check AQ availability Hernan Vargas
2022-11-17  4:46 ` [PATCH 21.11 3/7] baseband/acc100: fix ring availability calculation Hernan Vargas
2022-11-17  4:46 ` [PATCH 21.11 4/7] baseband/acc100: enforce additional check on FCW Hernan Vargas
2022-11-17  4:46 ` [PATCH 21.11 5/7] baseband/acc100: fix null HARQ input case Hernan Vargas
2022-11-17  4:46 ` [PATCH 21.11 6/7] baseband/acc100: fix ring/queue allocation Hernan Vargas
2022-11-17  4:46 ` Hernan Vargas [this message]
2022-11-23 18:13 ` [PATCH 21.11 0/7] baseband/acc100: backporting patches Kevin Traynor

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=20221117044652.163000-8-hernan.vargas@intel.com \
    --to=hernan.vargas@intel.com \
    --cc=ktraynor@redhat.com \
    --cc=maxime.coquelin@redhat.com \
    --cc=nicolas.chautru@intel.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).