* [PATCH] net/mana: use the correct WQE count for ringing RQ doorbell
@ 2023-07-10 21:35 longli
2023-07-10 23:51 ` [Patch v2] " longli
0 siblings, 1 reply; 4+ messages in thread
From: longli @ 2023-07-10 21:35 UTC (permalink / raw)
To: Ferruh Yigit, Andrew Rybchenko; +Cc: dev, Ajay Sharma, Long Li
From: Long Li <longli@microsoft.com>
The hardware specification specifies that WQE_COUNT should set to 0 for
the Receive Queue. Although currently the hardware doesn't enforce the
check, in the future releases it may check on this value.
---
drivers/net/mana/mana.h | 2 +-
drivers/net/mana/rx.c | 11 +++++++----
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/drivers/net/mana/mana.h b/drivers/net/mana/mana.h
index dfeda531eb..5801491d75 100644
--- a/drivers/net/mana/mana.h
+++ b/drivers/net/mana/mana.h
@@ -457,7 +457,7 @@ extern int mana_logtype_init;
int mana_ring_doorbell(void *db_page, enum gdma_queue_types queue_type,
uint32_t queue_id, uint32_t tail, uint8_t arm);
-int mana_rq_ring_doorbell(struct mana_rxq *rxq, uint8_t arm);
+int mana_rq_ring_doorbell(struct mana_rxq *rxq);
int gdma_post_work_request(struct mana_gdma_queue *queue,
struct gdma_work_request *work_req,
diff --git a/drivers/net/mana/rx.c b/drivers/net/mana/rx.c
index b840e402f9..4b8aca49ef 100644
--- a/drivers/net/mana/rx.c
+++ b/drivers/net/mana/rx.c
@@ -22,7 +22,7 @@ static uint8_t mana_rss_hash_key_default[TOEPLITZ_HASH_KEY_SIZE_IN_BYTES] = {
};
int
-mana_rq_ring_doorbell(struct mana_rxq *rxq, uint8_t arm)
+mana_rq_ring_doorbell(struct mana_rxq *rxq)
{
struct mana_priv *priv = rxq->priv;
int ret;
@@ -36,10 +36,13 @@ mana_rq_ring_doorbell(struct mana_rxq *rxq, uint8_t arm)
db_page = process_priv->db_page;
}
+ /* Hardware Spec specifies that software client should set 0 for
+ * wqe_cnt for Receive Queues.
+ */
ret = mana_ring_doorbell(db_page, GDMA_QUEUE_RECEIVE,
rxq->gdma_rq.id,
rxq->gdma_rq.head * GDMA_WQE_ALIGNMENT_UNIT_SIZE,
- arm);
+ 0);
if (ret)
DP_LOG(ERR, "failed to ring RX doorbell ret %d", ret);
@@ -120,7 +123,7 @@ mana_alloc_and_post_rx_wqes(struct mana_rxq *rxq)
}
}
- mana_rq_ring_doorbell(rxq, rxq->num_desc);
+ mana_rq_ring_doorbell(rxq);
return ret;
}
@@ -532,7 +535,7 @@ mana_rx_burst(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n)
}
if (wqe_posted)
- mana_rq_ring_doorbell(rxq, wqe_posted);
+ mana_rq_ring_doorbell(rxq);
return pkt_received;
}
--
2.34.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Patch v2] net/mana: use the correct WQE count for ringing RQ doorbell
2023-07-10 21:35 [PATCH] net/mana: use the correct WQE count for ringing RQ doorbell longli
@ 2023-07-10 23:51 ` longli
2023-07-11 10:27 ` Ferruh Yigit
2023-07-11 11:01 ` Ferruh Yigit
0 siblings, 2 replies; 4+ messages in thread
From: longli @ 2023-07-10 23:51 UTC (permalink / raw)
To: Ferruh Yigit, Andrew Rybchenko; +Cc: dev, Ajay Sharma, Long Li
From: Long Li <longli@microsoft.com>
The hardware specification specifies that WQE_COUNT should set to 0 for
the Receive Queue. Although currently the hardware doesn't enforce the
check, in the future releases it may check on this value.
Signed-off-by: Long Li <longli@microsoft.com>
---
Change log:
v2: added "Signed-off-by"
drivers/net/mana/mana.h | 2 +-
drivers/net/mana/rx.c | 11 +++++++----
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/drivers/net/mana/mana.h b/drivers/net/mana/mana.h
index dfeda531eb..5801491d75 100644
--- a/drivers/net/mana/mana.h
+++ b/drivers/net/mana/mana.h
@@ -457,7 +457,7 @@ extern int mana_logtype_init;
int mana_ring_doorbell(void *db_page, enum gdma_queue_types queue_type,
uint32_t queue_id, uint32_t tail, uint8_t arm);
-int mana_rq_ring_doorbell(struct mana_rxq *rxq, uint8_t arm);
+int mana_rq_ring_doorbell(struct mana_rxq *rxq);
int gdma_post_work_request(struct mana_gdma_queue *queue,
struct gdma_work_request *work_req,
diff --git a/drivers/net/mana/rx.c b/drivers/net/mana/rx.c
index b840e402f9..4b8aca49ef 100644
--- a/drivers/net/mana/rx.c
+++ b/drivers/net/mana/rx.c
@@ -22,7 +22,7 @@ static uint8_t mana_rss_hash_key_default[TOEPLITZ_HASH_KEY_SIZE_IN_BYTES] = {
};
int
-mana_rq_ring_doorbell(struct mana_rxq *rxq, uint8_t arm)
+mana_rq_ring_doorbell(struct mana_rxq *rxq)
{
struct mana_priv *priv = rxq->priv;
int ret;
@@ -36,10 +36,13 @@ mana_rq_ring_doorbell(struct mana_rxq *rxq, uint8_t arm)
db_page = process_priv->db_page;
}
+ /* Hardware Spec specifies that software client should set 0 for
+ * wqe_cnt for Receive Queues.
+ */
ret = mana_ring_doorbell(db_page, GDMA_QUEUE_RECEIVE,
rxq->gdma_rq.id,
rxq->gdma_rq.head * GDMA_WQE_ALIGNMENT_UNIT_SIZE,
- arm);
+ 0);
if (ret)
DP_LOG(ERR, "failed to ring RX doorbell ret %d", ret);
@@ -120,7 +123,7 @@ mana_alloc_and_post_rx_wqes(struct mana_rxq *rxq)
}
}
- mana_rq_ring_doorbell(rxq, rxq->num_desc);
+ mana_rq_ring_doorbell(rxq);
return ret;
}
@@ -532,7 +535,7 @@ mana_rx_burst(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n)
}
if (wqe_posted)
- mana_rq_ring_doorbell(rxq, wqe_posted);
+ mana_rq_ring_doorbell(rxq);
return pkt_received;
}
--
2.34.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Patch v2] net/mana: use the correct WQE count for ringing RQ doorbell
2023-07-10 23:51 ` [Patch v2] " longli
@ 2023-07-11 10:27 ` Ferruh Yigit
2023-07-11 11:01 ` Ferruh Yigit
1 sibling, 0 replies; 4+ messages in thread
From: Ferruh Yigit @ 2023-07-11 10:27 UTC (permalink / raw)
To: longli, Andrew Rybchenko; +Cc: dev, Ajay Sharma, Long Li
On 7/11/2023 12:51 AM, longli@linuxonhyperv.com wrote:
> From: Long Li <longli@microsoft.com>
>
> The hardware specification specifies that WQE_COUNT should set to 0 for
> the Receive Queue. Although currently the hardware doesn't enforce the
> check, in the future releases it may check on this value.
>
> Signed-off-by: Long Li <longli@microsoft.com>
>
Is Fixes tag intentionally omitted since change is because of HW / Spec
change, instead of code being wrong when implemented?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Patch v2] net/mana: use the correct WQE count for ringing RQ doorbell
2023-07-10 23:51 ` [Patch v2] " longli
2023-07-11 10:27 ` Ferruh Yigit
@ 2023-07-11 11:01 ` Ferruh Yigit
1 sibling, 0 replies; 4+ messages in thread
From: Ferruh Yigit @ 2023-07-11 11:01 UTC (permalink / raw)
To: longli, Andrew Rybchenko; +Cc: dev, Ajay Sharma, Long Li
On 7/11/2023 12:51 AM, longli@linuxonhyperv.com wrote:
> From: Long Li <longli@microsoft.com>
>
> The hardware specification specifies that WQE_COUNT should set to 0 for
> the Receive Queue. Although currently the hardware doesn't enforce the
> check, in the future releases it may check on this value.
>
> Signed-off-by: Long Li <longli@microsoft.com>
>
Applied to dpdk-next-net/main, thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-07-11 11:01 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-10 21:35 [PATCH] net/mana: use the correct WQE count for ringing RQ doorbell longli
2023-07-10 23:51 ` [Patch v2] " longli
2023-07-11 10:27 ` Ferruh Yigit
2023-07-11 11:01 ` Ferruh Yigit
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).