DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 1/2] net/sfc: support ops to check ready descriptors in ESSB Rx
@ 2018-06-29 15:41 Andrew Rybchenko
  2018-06-29 15:41 ` [dpdk-dev] [PATCH 2/2] net/sfc: support Rx descriptor status for EF10 ESSB datapath Andrew Rybchenko
  2018-07-04 18:30 ` [dpdk-dev] [PATCH 1/2] net/sfc: support ops to check ready descriptors in ESSB Rx Ferruh Yigit
  0 siblings, 2 replies; 3+ messages in thread
From: Andrew Rybchenko @ 2018-06-29 15:41 UTC (permalink / raw)
  To: dev

Implement EF10 ESSB Rx datapath callback to get number of pending
descriptors.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
---
 drivers/net/sfc/sfc_ef10_essb_rx.c | 27 +++++++++++++++++++++------
 1 file changed, 21 insertions(+), 6 deletions(-)

diff --git a/drivers/net/sfc/sfc_ef10_essb_rx.c b/drivers/net/sfc/sfc_ef10_essb_rx.c
index dcb5cb24c..257e40db1 100644
--- a/drivers/net/sfc/sfc_ef10_essb_rx.c
+++ b/drivers/net/sfc/sfc_ef10_essb_rx.c
@@ -404,13 +404,28 @@ sfc_ef10_essb_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
 
 static sfc_dp_rx_qdesc_npending_t sfc_ef10_essb_rx_qdesc_npending;
 static unsigned int
-sfc_ef10_essb_rx_qdesc_npending(__rte_unused struct sfc_dp_rxq *dp_rxq)
+sfc_ef10_essb_rx_qdesc_npending(struct sfc_dp_rxq *dp_rxq)
 {
-	/*
-	 * Correct implementation requires EvQ polling and events
-	 * processing.
-	 */
-	return -ENOTSUP;
+	struct sfc_ef10_essb_rxq *rxq = sfc_ef10_essb_rxq_by_dp_rxq(dp_rxq);
+	const unsigned int evq_old_read_ptr = rxq->evq_read_ptr;
+	efx_qword_t rx_ev;
+
+	if (unlikely(rxq->flags & (SFC_EF10_ESSB_RXQ_NOT_RUNNING |
+				   SFC_EF10_ESSB_RXQ_EXCEPTION)))
+		return rxq->bufs_pending;
+
+	while (sfc_ef10_essb_rx_event_get(rxq, &rx_ev)) {
+		/*
+		 * DROP_EVENT is an internal to the NIC, software should
+		 * never see it and, therefore, may ignore it.
+		 */
+		sfc_ef10_essb_rx_process_ev(rxq, rx_ev);
+	}
+
+	sfc_ef10_ev_qclear(rxq->evq_hw_ring, rxq->evq_ptr_mask,
+			   evq_old_read_ptr, rxq->evq_read_ptr);
+
+	return rxq->bufs_pending;
 }
 
 static sfc_dp_rx_qdesc_status_t sfc_ef10_essb_rx_qdesc_status;
-- 
2.17.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [dpdk-dev] [PATCH 2/2] net/sfc: support Rx descriptor status for EF10 ESSB datapath
  2018-06-29 15:41 [dpdk-dev] [PATCH 1/2] net/sfc: support ops to check ready descriptors in ESSB Rx Andrew Rybchenko
@ 2018-06-29 15:41 ` Andrew Rybchenko
  2018-07-04 18:30 ` [dpdk-dev] [PATCH 1/2] net/sfc: support ops to check ready descriptors in ESSB Rx Ferruh Yigit
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Rybchenko @ 2018-06-29 15:41 UTC (permalink / raw)
  To: dev

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
---
 drivers/net/sfc/sfc_ef10_essb_rx.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/drivers/net/sfc/sfc_ef10_essb_rx.c b/drivers/net/sfc/sfc_ef10_essb_rx.c
index 257e40db1..040380650 100644
--- a/drivers/net/sfc/sfc_ef10_essb_rx.c
+++ b/drivers/net/sfc/sfc_ef10_essb_rx.c
@@ -430,10 +430,19 @@ sfc_ef10_essb_rx_qdesc_npending(struct sfc_dp_rxq *dp_rxq)
 
 static sfc_dp_rx_qdesc_status_t sfc_ef10_essb_rx_qdesc_status;
 static int
-sfc_ef10_essb_rx_qdesc_status(__rte_unused struct sfc_dp_rxq *dp_rxq,
-			      __rte_unused uint16_t offset)
+sfc_ef10_essb_rx_qdesc_status(struct sfc_dp_rxq *dp_rxq, uint16_t offset)
 {
-	return -ENOTSUP;
+	struct sfc_ef10_essb_rxq *rxq = sfc_ef10_essb_rxq_by_dp_rxq(dp_rxq);
+	unsigned int pending = sfc_ef10_essb_rx_qdesc_npending(dp_rxq);
+
+	if (offset < pending)
+		return RTE_ETH_RX_DESC_DONE;
+
+	if (offset < (rxq->added - rxq->completed) * rxq->block_size +
+		     rxq->left_in_completed - rxq->block_size)
+		return RTE_ETH_RX_DESC_AVAIL;
+
+	return RTE_ETH_RX_DESC_UNAVAIL;
 }
 
 static sfc_dp_rx_get_dev_info_t sfc_ef10_essb_rx_get_dev_info;
-- 
2.17.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH 1/2] net/sfc: support ops to check ready descriptors in ESSB Rx
  2018-06-29 15:41 [dpdk-dev] [PATCH 1/2] net/sfc: support ops to check ready descriptors in ESSB Rx Andrew Rybchenko
  2018-06-29 15:41 ` [dpdk-dev] [PATCH 2/2] net/sfc: support Rx descriptor status for EF10 ESSB datapath Andrew Rybchenko
@ 2018-07-04 18:30 ` Ferruh Yigit
  1 sibling, 0 replies; 3+ messages in thread
From: Ferruh Yigit @ 2018-07-04 18:30 UTC (permalink / raw)
  To: Andrew Rybchenko, dev

On 6/29/2018 4:41 PM, Andrew Rybchenko wrote:
> Implement EF10 ESSB Rx datapath callback to get number of pending
> descriptors.
> 
> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
> Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>

Series applied to dpdk-next-net/master, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-07-04 18:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-29 15:41 [dpdk-dev] [PATCH 1/2] net/sfc: support ops to check ready descriptors in ESSB Rx Andrew Rybchenko
2018-06-29 15:41 ` [dpdk-dev] [PATCH 2/2] net/sfc: support Rx descriptor status for EF10 ESSB datapath Andrew Rybchenko
2018-07-04 18:30 ` [dpdk-dev] [PATCH 1/2] net/sfc: support ops to check ready descriptors in ESSB Rx 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).