From patchwork Tue Oct 13 13:45:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Rybchenko X-Patchwork-Id: 80536 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3AC53A04C0; Tue, 13 Oct 2020 15:56:06 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9675D1DC46; Tue, 13 Oct 2020 15:46:46 +0200 (CEST) Received: from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com [67.231.154.164]) by dpdk.org (Postfix) with ESMTP id 0258A1DB76 for ; Tue, 13 Oct 2020 15:46:04 +0200 (CEST) Received: from mx1-us1.ppe-hosted.com (unknown [10.110.50.143]) by dispatch1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTP id 4B53A200B4 for ; Tue, 13 Oct 2020 13:46:02 +0000 (UTC) Received: from us4-mdac16-38.at1.mdlocal (unknown [10.110.51.53]) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTP id 498EA8009B for ; Tue, 13 Oct 2020 13:46:02 +0000 (UTC) X-Virus-Scanned: Proofpoint Essentials engine Received: from mx1-us1.ppe-hosted.com (unknown [10.110.49.106]) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id D0CD04007C for ; Tue, 13 Oct 2020 13:46:01 +0000 (UTC) Received: from webmail.solarflare.com (uk.solarflare.com [193.34.186.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id 99F3CB4005B for ; Tue, 13 Oct 2020 13:46:01 +0000 (UTC) Received: from ukex01.SolarFlarecom.com (10.17.10.4) by ukex01.SolarFlarecom.com (10.17.10.4) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 13 Oct 2020 14:45:56 +0100 Received: from opal.uk.solarflarecom.com (10.17.10.1) by ukex01.SolarFlarecom.com (10.17.10.4) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 13 Oct 2020 14:45:56 +0100 Received: from ukv-loginhost.uk.solarflarecom.com (ukv-loginhost.uk.solarflarecom.com [10.17.10.39]) by opal.uk.solarflarecom.com (8.13.8/8.13.8) with ESMTP id 09DDjtxn006031 for ; Tue, 13 Oct 2020 14:45:55 +0100 Received: from ukv-loginhost.uk.solarflarecom.com (localhost [127.0.0.1]) by ukv-loginhost.uk.solarflarecom.com (Postfix) with ESMTP id E4F131613A9 for ; Tue, 13 Oct 2020 14:45:55 +0100 (BST) From: Andrew Rybchenko To: Date: Tue, 13 Oct 2020 14:45:30 +0100 Message-ID: <1602596753-32282-14-git-send-email-arybchenko@solarflare.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1602596753-32282-1-git-send-email-arybchenko@solarflare.com> References: <1602596753-32282-1-git-send-email-arybchenko@solarflare.com> MIME-Version: 1.0 X-TM-AS-Product-Ver: SMEX-12.5.0.1300-8.6.1012-25722.003 X-TM-AS-Result: No-2.757300-8.000000-10 X-TMASE-MatchedRID: hgmjX17TATB8CONowvwu6zIjK23O9D33fXRAc+s3RFdjLp8Cm8vwFz6P hj6DfZCErdoLblq9S5ra/g/NGTW3Mk4/zpVKysysR/j040fRFpJ/7iVTXtdMVZsoi2XrUn/Jn6K dMrRsL14qtq5d3cxkNS5+kwsVEldXaD2y/5ZEZ37JE92kbRecmN2iCQt6GyYyWIYRfyL4JjRMqE 9/a8nGL5hKwb7gN6f4uEQ6l4YCyopAtqUGH3fEpGKtTnXEmHi9I6KkAL2A5kcMtYrw9BuTwqSmS PRgKSZMuowvJdIWQm5DDKa3G4nrLQ== X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--2.757300-8.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.6.1012-25722.003 X-MDID: 1602596762-aSiaE0MjMTlj X-PPE-DISP: 1602596762;aSiaE0MjMTlj Subject: [dpdk-dev] [PATCH 13/36] net/sfc: implement libefx Tx descs complete event callbacks 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" These callbacks are used when event queue is polled via libefx. The libefx polling is used for management event queue, but we do not expect any Tx complete events on it, and for datapath event queue at flushing. Signed-off-by: Andrew Rybchenko --- drivers/net/sfc/sfc_ev.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/drivers/net/sfc/sfc_ev.c b/drivers/net/sfc/sfc_ev.c index 322a391100..ac3cd75577 100644 --- a/drivers/net/sfc/sfc_ev.c +++ b/drivers/net/sfc/sfc_ev.c @@ -269,6 +269,30 @@ sfc_ev_dp_tx(void *arg, __rte_unused uint32_t label, uint32_t id) return evq->sa->priv.dp_tx->qtx_ev(dp_txq, id); } +static boolean_t +sfc_ev_nop_tx_ndescs(void *arg, uint32_t label, unsigned int ndescs) +{ + struct sfc_evq *evq = arg; + + sfc_err(evq->sa, "EVQ %u unexpected Tx event label=%u ndescs=%#x", + evq->evq_index, label, ndescs); + return B_TRUE; +} + +static boolean_t +sfc_ev_dp_tx_ndescs(void *arg, __rte_unused uint32_t label, + unsigned int ndescs) +{ + struct sfc_evq *evq = arg; + struct sfc_dp_txq *dp_txq; + + dp_txq = evq->dp_txq; + SFC_ASSERT(dp_txq != NULL); + + SFC_ASSERT(evq->sa->priv.dp_tx->qtx_ev != NULL); + return evq->sa->priv.dp_tx->qtx_ev(dp_txq, ndescs); +} + static boolean_t sfc_ev_exception(void *arg, uint32_t code, __rte_unused uint32_t data) { @@ -458,6 +482,7 @@ static const efx_ev_callbacks_t sfc_ev_callbacks = { .eec_rx_packets = sfc_ev_nop_rx_packets, .eec_rx_ps = sfc_ev_nop_rx_ps, .eec_tx = sfc_ev_nop_tx, + .eec_tx_ndescs = sfc_ev_nop_tx_ndescs, .eec_exception = sfc_ev_exception, .eec_rxq_flush_done = sfc_ev_nop_rxq_flush_done, .eec_rxq_flush_failed = sfc_ev_nop_rxq_flush_failed, @@ -475,6 +500,7 @@ static const efx_ev_callbacks_t sfc_ev_callbacks_efx_rx = { .eec_rx_packets = sfc_ev_nop_rx_packets, .eec_rx_ps = sfc_ev_nop_rx_ps, .eec_tx = sfc_ev_nop_tx, + .eec_tx_ndescs = sfc_ev_nop_tx_ndescs, .eec_exception = sfc_ev_exception, .eec_rxq_flush_done = sfc_ev_rxq_flush_done, .eec_rxq_flush_failed = sfc_ev_rxq_flush_failed, @@ -492,6 +518,7 @@ static const efx_ev_callbacks_t sfc_ev_callbacks_dp_rx = { .eec_rx_packets = sfc_ev_dp_rx_packets, .eec_rx_ps = sfc_ev_dp_rx_ps, .eec_tx = sfc_ev_nop_tx, + .eec_tx_ndescs = sfc_ev_nop_tx_ndescs, .eec_exception = sfc_ev_exception, .eec_rxq_flush_done = sfc_ev_rxq_flush_done, .eec_rxq_flush_failed = sfc_ev_rxq_flush_failed, @@ -509,6 +536,7 @@ static const efx_ev_callbacks_t sfc_ev_callbacks_efx_tx = { .eec_rx_packets = sfc_ev_nop_rx_packets, .eec_rx_ps = sfc_ev_nop_rx_ps, .eec_tx = sfc_ev_tx, + .eec_tx_ndescs = sfc_ev_nop_tx_ndescs, .eec_exception = sfc_ev_exception, .eec_rxq_flush_done = sfc_ev_nop_rxq_flush_done, .eec_rxq_flush_failed = sfc_ev_nop_rxq_flush_failed, @@ -526,6 +554,7 @@ static const efx_ev_callbacks_t sfc_ev_callbacks_dp_tx = { .eec_rx_packets = sfc_ev_nop_rx_packets, .eec_rx_ps = sfc_ev_nop_rx_ps, .eec_tx = sfc_ev_dp_tx, + .eec_tx_ndescs = sfc_ev_dp_tx_ndescs, .eec_exception = sfc_ev_exception, .eec_rxq_flush_done = sfc_ev_nop_rxq_flush_done, .eec_rxq_flush_failed = sfc_ev_nop_rxq_flush_failed,