Patchwork [dpdk-dev,06/30] net/sfc: remove wrappers around Rx descriptor count and done

login
register
mail settings
Submitter Andrew Rybchenko
Date Feb. 7, 2019, 12:17 p.m.
Message ID <1549541873-17403-7-git-send-email-arybchenko@solarflare.com>
Download mbox | patch
Permalink /patch/720411/
State New
Headers show

Comments

Andrew Rybchenko - Feb. 7, 2019, 12:17 p.m.
These wrappers are used in single place and just complicate reading
and understanding if these ops could be supported in secondary process.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 drivers/net/sfc/sfc_ethdev.c | 12 ++++++++++--
 drivers/net/sfc/sfc_rx.c     | 22 ----------------------
 drivers/net/sfc/sfc_rx.h     |  4 ----
 3 files changed, 10 insertions(+), 28 deletions(-)

Patch

diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c
index 87a2c9431..36dc580ae 100644
--- a/drivers/net/sfc/sfc_ethdev.c
+++ b/drivers/net/sfc/sfc_ethdev.c
@@ -1119,16 +1119,24 @@  static uint32_t
 sfc_rx_queue_count(struct rte_eth_dev *dev, uint16_t rx_queue_id)
 {
 	struct sfc_adapter *sa = dev->data->dev_private;
+	struct sfc_rxq *rxq;
+
+	SFC_ASSERT(rx_queue_id < sa->rxq_count);
+	rxq = sa->rxq_info[rx_queue_id].rxq;
 
-	return sfc_rx_qdesc_npending(sa, rx_queue_id);
+	if (rxq == NULL || (rxq->state & SFC_RXQ_STARTED) == 0)
+		return 0;
+
+	return sa->dp_rx->qdesc_npending(rxq->dp);
 }
 
 static int
 sfc_rx_descriptor_done(void *queue, uint16_t offset)
 {
 	struct sfc_dp_rxq *dp_rxq = queue;
+	struct sfc_rxq *rxq = sfc_rxq_by_dp_rxq(dp_rxq);
 
-	return sfc_rx_qdesc_done(dp_rxq, offset);
+	return offset < rxq->evq->sa->dp_rx->qdesc_npending(dp_rxq);
 }
 
 static int
diff --git a/drivers/net/sfc/sfc_rx.c b/drivers/net/sfc/sfc_rx.c
index dcccb96b1..44aee29e9 100644
--- a/drivers/net/sfc/sfc_rx.c
+++ b/drivers/net/sfc/sfc_rx.c
@@ -530,28 +530,6 @@  struct sfc_dp_rx sfc_efx_rx = {
 	.pkt_burst		= sfc_efx_recv_pkts,
 };
 
-unsigned int
-sfc_rx_qdesc_npending(struct sfc_adapter *sa, unsigned int sw_index)
-{
-	struct sfc_rxq *rxq;
-
-	SFC_ASSERT(sw_index < sa->rxq_count);
-	rxq = sa->rxq_info[sw_index].rxq;
-
-	if (rxq == NULL || (rxq->state & SFC_RXQ_STARTED) == 0)
-		return 0;
-
-	return sa->dp_rx->qdesc_npending(rxq->dp);
-}
-
-int
-sfc_rx_qdesc_done(struct sfc_dp_rxq *dp_rxq, unsigned int offset)
-{
-	struct sfc_rxq *rxq = sfc_rxq_by_dp_rxq(dp_rxq);
-
-	return offset < rxq->evq->sa->dp_rx->qdesc_npending(dp_rxq);
-}
-
 static void
 sfc_rx_qflush(struct sfc_adapter *sa, unsigned int sw_index)
 {
diff --git a/drivers/net/sfc/sfc_rx.h b/drivers/net/sfc/sfc_rx.h
index 7231379a6..06e8eac8d 100644
--- a/drivers/net/sfc/sfc_rx.h
+++ b/drivers/net/sfc/sfc_rx.h
@@ -149,10 +149,6 @@  uint64_t sfc_rx_get_queue_offload_caps(struct sfc_adapter *sa);
 void sfc_rx_qflush_done(struct sfc_rxq *rxq);
 void sfc_rx_qflush_failed(struct sfc_rxq *rxq);
 
-unsigned int sfc_rx_qdesc_npending(struct sfc_adapter *sa,
-				   unsigned int sw_index);
-int sfc_rx_qdesc_done(struct sfc_dp_rxq *dp_rxq, unsigned int offset);
-
 int sfc_rx_hash_init(struct sfc_adapter *sa);
 void sfc_rx_hash_fini(struct sfc_adapter *sa);
 int sfc_rx_hf_rte_to_efx(struct sfc_adapter *sa, uint64_t rte,