From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nbfkord-smmo02.seg.att.com (nbfkord-smmo02.seg.att.com [209.65.160.78]) by dpdk.org (Postfix) with ESMTP id E71DFFA47 for ; Fri, 2 Dec 2016 08:45:14 +0100 (CET) Received: from unknown [12.187.104.26] by nbfkord-smmo02.seg.att.com(mxl_mta-7.2.4-7) with SMTP id a8621485.0.106138.00-2393.245961.nbfkord-smmo02.seg.att.com (envelope-from ); Fri, 02 Dec 2016 07:45:16 +0000 (UTC) X-MXL-Hash: 5841268c7d669792-16310f1c37ae77dd5359a2fc9aa9b53ac51d58ea Received: from ocex03.SolarFlarecom.com (10.20.40.36) by ocex03.SolarFlarecom.com (10.20.40.36) with Microsoft SMTP Server (TLS) id 15.0.1044.25; Thu, 1 Dec 2016 23:45:02 -0800 Received: from opal.uk.solarflarecom.com (10.17.10.1) by ocex03.SolarFlarecom.com (10.20.40.36) with Microsoft SMTP Server (TLS) id 15.0.1044.25 via Frontend Transport; Thu, 1 Dec 2016 23:45:02 -0800 Received: from uklogin.uk.solarflarecom.com (uklogin.uk.solarflarecom.com [10.17.10.10]) by opal.uk.solarflarecom.com (8.13.8/8.13.8) with ESMTP id uB27j0G2005898 for ; Fri, 2 Dec 2016 07:45:00 GMT Received: from uklogin.uk.solarflarecom.com (localhost.localdomain [127.0.0.1]) by uklogin.uk.solarflarecom.com (8.13.8/8.13.8) with ESMTP id uB27ixwt026628 for ; Fri, 2 Dec 2016 07:45:00 GMT From: Andrew Rybchenko To: Date: Fri, 2 Dec 2016 07:44:38 +0000 Message-ID: <1480664691-26561-19-git-send-email-arybchenko@solarflare.com> X-Mailer: git-send-email 1.8.2.3 In-Reply-To: <1480664691-26561-1-git-send-email-arybchenko@solarflare.com> References: <1480664691-26561-1-git-send-email-arybchenko@solarflare.com> MIME-Version: 1.0 Content-Type: text/plain X-AnalysisOut: [v=2.1 cv=NIXTjhOg c=1 sm=1 tr=0 a=8BlWFWvVlq5taO8ncb8nKg==] X-AnalysisOut: [:17 a=n5n_aSjo0skA:10 a=zRKbQ67AAAAA:8 a=GXR-bymMMbl77G2L-] X-AnalysisOut: [qYA:9 a=PA03WX8tBzeizutn5_OT:22] X-Spam: [F=0.2000000000; CM=0.500; S=0.200(2015072901)] X-MAIL-FROM: X-SOURCE-IP: [12.187.104.26] Subject: [dpdk-dev] [PATCH 18/31] net/sfc: add RxQ descriptor done callback X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 07:45:16 -0000 Reviewed-by: Andrew Lee Reviewed-by: Robert Stonehouse Signed-off-by: Andrew Rybchenko --- drivers/net/sfc/sfc_ethdev.c | 9 +++++++++ drivers/net/sfc/sfc_rx.c | 11 +++++++++++ drivers/net/sfc/sfc_rx.h | 1 + 3 files changed, 21 insertions(+) diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c index 163f9ed..59dcdb4 100644 --- a/drivers/net/sfc/sfc_ethdev.c +++ b/drivers/net/sfc/sfc_ethdev.c @@ -855,6 +855,14 @@ sfc_rx_queue_count(struct rte_eth_dev *dev, uint16_t rx_queue_id) return sfc_rx_qdesc_npending(sa, rx_queue_id); } +static int +sfc_rx_descriptor_done(void *queue, uint16_t offset) +{ + struct sfc_rxq *rxq = queue; + + return sfc_rx_qdesc_done(rxq, offset); +} + static const struct eth_dev_ops sfc_eth_dev_ops = { .dev_configure = sfc_dev_configure, .dev_start = sfc_dev_start, @@ -876,6 +884,7 @@ static const struct eth_dev_ops sfc_eth_dev_ops = { .rx_queue_setup = sfc_rx_queue_setup, .rx_queue_release = sfc_rx_queue_release, .rx_queue_count = sfc_rx_queue_count, + .rx_descriptor_done = sfc_rx_descriptor_done, .tx_queue_setup = sfc_tx_queue_setup, .tx_queue_release = sfc_tx_queue_release, .flow_ctrl_get = sfc_flow_ctrl_get, diff --git a/drivers/net/sfc/sfc_rx.c b/drivers/net/sfc/sfc_rx.c index ff9d799..802beb2 100644 --- a/drivers/net/sfc/sfc_rx.c +++ b/drivers/net/sfc/sfc_rx.c @@ -273,6 +273,17 @@ sfc_rx_qdesc_npending(struct sfc_adapter *sa, unsigned int sw_index) return rxq->pending - rxq->completed; } +int +sfc_rx_qdesc_done(struct sfc_rxq *rxq, unsigned int offset) +{ + if ((rxq->state & SFC_RXQ_RUNNING) == 0) + return 0; + + sfc_ev_qpoll(rxq->evq); + + return offset < (rxq->pending - rxq->completed); +} + static void sfc_rx_qpurge(struct sfc_rxq *rxq) { diff --git a/drivers/net/sfc/sfc_rx.h b/drivers/net/sfc/sfc_rx.h index 8064af6..8d8e709 100644 --- a/drivers/net/sfc/sfc_rx.h +++ b/drivers/net/sfc/sfc_rx.h @@ -142,6 +142,7 @@ uint16_t sfc_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, unsigned int sfc_rx_qdesc_npending(struct sfc_adapter *sa, unsigned int sw_index); +int sfc_rx_qdesc_done(struct sfc_rxq *rxq, unsigned int offset); #ifdef __cplusplus } -- 2.5.5