From: Andrew Rybchenko Date: Thu, 7 Feb 2019 12:17:29 +0000 (+0000) Subject: net/sfc: remove wrappers around Rx descriptor count and done X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=768629c69aee00df38dcd4b61204f8046b6453ad;p=dpdk.git net/sfc: remove wrappers around Rx descriptor count and done 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 --- diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c index 87a2c94314..36dc580ae3 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 dcccb96b1c..44aee29e95 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 7231379a6e..06e8eac8db 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,