From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com [148.163.129.52]) by dpdk.org (Postfix) with ESMTP id 7C5184C96 for ; Wed, 29 Aug 2018 09:36:05 +0200 (CEST) X-Virus-Scanned: Proofpoint Essentials engine Received: from webmail.solarflare.com (webmail.solarflare.com [12.187.104.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mx1-us3.ppe-hosted.com (Proofpoint Essentials ESMTP Server) with ESMTPS id 3DAF0600056; Wed, 29 Aug 2018 07:36:04 +0000 (UTC) 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.1395.4; Wed, 29 Aug 2018 00:36:01 -0700 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.1395.4 via Frontend Transport; Wed, 29 Aug 2018 00:36:00 -0700 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 w7T7Zxuu025599; Wed, 29 Aug 2018 08:35:59 +0100 Received: from ukv-loginhost.uk.solarflarecom.com (localhost [127.0.0.1]) by ukv-loginhost.uk.solarflarecom.com (Postfix) with ESMTP id 591A11626D2; Wed, 29 Aug 2018 08:35:59 +0100 (BST) From: Andrew Rybchenko To: CC: Igor Romanov Date: Wed, 29 Aug 2018 08:35:34 +0100 Message-ID: <1535528134-20319-2-git-send-email-arybchenko@solarflare.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1535528134-20319-1-git-send-email-arybchenko@solarflare.com> References: <1535528134-20319-1-git-send-email-arybchenko@solarflare.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-Product-Ver: SMEX-12.5.0.1300-8.5.1010-24060.005 X-TM-AS-Result: No-1.208000-4.000000-10 X-TMASE-MatchedRID: rsJmA+R6AF/Ot+/gOYaZxQPZZctd3P4BXru95hSuhjRZVbxJogyhUzK2 ieu8M5yx7lGe7/57bl+/08jbUug8/BCR6UNmPZVEoprTEHvewADqorGIcSSE7hL6MU7t349bd6W KiwhZWBjGSqxW6PLJadC4I7fLwdY3IkVsNYB2lkueAiCmPx4NwBnUJ0Ek6yhjxEHRux+uk8ifEz J5hPndGXuX+WmqT1txbOzqsvcNAwpM6kGVKj0nS57Vr9UbZBhL5TipTElZFHqiRruO+BeHftniO mvqLC3NwrWhkQwlwjuvwgcN+u+WEpN1JFeUKeMEiOOUXfTkScBZSbxIRLLN37zfneGoTKOTw8g2 HBNcF5k= X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10-1.208000-4.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.5.1010-24060.005 X-MDID: 1535528164-IdIw7TzenuyO Subject: [dpdk-dev] [PATCH 2/2] net/sfc: support runtime Tx queue setup 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: Wed, 29 Aug 2018 07:36:05 -0000 From: Igor Romanov Signed-off-by: Igor Romanov Signed-off-by: Andrew Rybchenko --- doc/guides/nics/features/sfc_efx.ini | 1 + drivers/net/sfc/sfc_ethdev.c | 7 ++++++- drivers/net/sfc/sfc_tx.c | 8 +++++--- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/doc/guides/nics/features/sfc_efx.ini b/doc/guides/nics/features/sfc_efx.ini index 5d2e90102..d1aa83313 100644 --- a/doc/guides/nics/features/sfc_efx.ini +++ b/doc/guides/nics/features/sfc_efx.ini @@ -10,6 +10,7 @@ Link status event = Y Fast mbuf free = Y Queue start/stop = Y Runtime Rx queue setup = Y +Runtime Tx queue setup = Y MTU update = Y Jumbo frame = Y Scattered Rx = Y diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c index 9b5324ca6..435bde67f 100644 --- a/drivers/net/sfc/sfc_ethdev.c +++ b/drivers/net/sfc/sfc_ethdev.c @@ -172,7 +172,8 @@ sfc_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) if (sa->dp_tx->get_dev_info != NULL) sa->dp_tx->get_dev_info(dev_info); - dev_info->dev_capa = RTE_ETH_DEV_CAPA_RUNTIME_RX_QUEUE_SETUP; + dev_info->dev_capa = RTE_ETH_DEV_CAPA_RUNTIME_RX_QUEUE_SETUP | + RTE_ETH_DEV_CAPA_RUNTIME_TX_QUEUE_SETUP; } static const uint32_t * @@ -1197,6 +1198,9 @@ sfc_tx_queue_start(struct rte_eth_dev *dev, uint16_t tx_queue_id) if (sa->state != SFC_ADAPTER_STARTED) goto fail_not_started; + if (sa->txq_info[tx_queue_id].txq == NULL) + goto fail_not_setup; + rc = sfc_tx_qstart(sa, tx_queue_id); if (rc != 0) goto fail_tx_qstart; @@ -1208,6 +1212,7 @@ sfc_tx_queue_start(struct rte_eth_dev *dev, uint16_t tx_queue_id) fail_tx_qstart: +fail_not_setup: fail_not_started: sfc_adapter_unlock(sa); SFC_ASSERT(rc > 0); diff --git a/drivers/net/sfc/sfc_tx.c b/drivers/net/sfc/sfc_tx.c index 6d42a1a65..8af08b37c 100644 --- a/drivers/net/sfc/sfc_tx.c +++ b/drivers/net/sfc/sfc_tx.c @@ -421,6 +421,7 @@ sfc_tx_qstart(struct sfc_adapter *sa, unsigned int sw_index) txq = txq_info->txq; + SFC_ASSERT(txq != NULL); SFC_ASSERT(txq->state == SFC_TXQ_INITIALIZED); evq = txq->evq; @@ -501,7 +502,7 @@ sfc_tx_qstop(struct sfc_adapter *sa, unsigned int sw_index) txq = txq_info->txq; - if (txq->state == SFC_TXQ_INITIALIZED) + if (txq == NULL || txq->state == SFC_TXQ_INITIALIZED) return; SFC_ASSERT(txq->state & SFC_TXQ_STARTED); @@ -578,8 +579,9 @@ sfc_tx_start(struct sfc_adapter *sa) goto fail_efx_tx_init; for (sw_index = 0; sw_index < sa->txq_count; ++sw_index) { - if (!(sa->txq_info[sw_index].deferred_start) || - sa->txq_info[sw_index].deferred_started) { + if (sa->txq_info[sw_index].txq != NULL && + (!(sa->txq_info[sw_index].deferred_start) || + sa->txq_info[sw_index].deferred_started)) { rc = sfc_tx_qstart(sa, sw_index); if (rc != 0) goto fail_tx_qstart; -- 2.17.1