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 39F534C88 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 01C1C60005C; 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 w7T7ZxgT025596; 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 B2A6A1626D1; Wed, 29 Aug 2018 08:35:58 +0100 (BST) From: Andrew Rybchenko To: CC: Igor Romanov Date: Wed, 29 Aug 2018 08:35:33 +0100 Message-ID: <1535528134-20319-1-git-send-email-arybchenko@solarflare.com> X-Mailer: git-send-email 1.8.3.1 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-2.004400-4.000000-10 X-TMASE-MatchedRID: MIEO2Rh1L0+AiWRjG7Ut6Uf49ONH0RaSSjyMfjCRfaPfUZT83lbkEN9K AxBFQOUwita2ZcVF+htTozlOz4GDWSIOuxx4sxXh4bl1FkKDELeOJZyIAulM014FIfTmLWNL+a/ zdHOJ3WluGEko8qKwwQnZf3s4/G36p3SZbh8en8FC4WIP7GtYLH0tCKdnhB589yM15V5aWpj6C0 ePs7A07UngwKs5Oejn6jKWWBL9GVOdVzrwnM9wdldh4D7QZqWQFZ0xxTYGTkvlA+3f0dQNAI5GQ h7V1ePZuE8NwH0mCzjQq/gJhetOPL63IuBi/qGJ2kC7SwvGlKhDwb7Jglhh1lFkOwaJdCKgviPE qcclEtxVyvbTg/runA== X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10-2.004400-4.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.5.1010-24060.005 X-MDID: 1535528164-B3CWWrW_dTOa Subject: [dpdk-dev] [PATCH 1/2] net/sfc: support runtime Rx 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 | 6 ++++++ drivers/net/sfc/sfc_rx.c | 6 ++++-- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/doc/guides/nics/features/sfc_efx.ini b/doc/guides/nics/features/sfc_efx.ini index 8a497ee05..5d2e90102 100644 --- a/doc/guides/nics/features/sfc_efx.ini +++ b/doc/guides/nics/features/sfc_efx.ini @@ -9,6 +9,7 @@ Link status = Y Link status event = Y Fast mbuf free = Y Queue start/stop = Y +Runtime Rx 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 9decbf5af..9b5324ca6 100644 --- a/drivers/net/sfc/sfc_ethdev.c +++ b/drivers/net/sfc/sfc_ethdev.c @@ -171,6 +171,8 @@ sfc_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) sa->dp_rx->get_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; } static const uint32_t * @@ -1143,6 +1145,9 @@ sfc_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id) if (sa->state != SFC_ADAPTER_STARTED) goto fail_not_started; + if (sa->rxq_info[rx_queue_id].rxq == NULL) + goto fail_not_setup; + rc = sfc_rx_qstart(sa, rx_queue_id); if (rc != 0) goto fail_rx_qstart; @@ -1154,6 +1159,7 @@ sfc_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id) return 0; fail_rx_qstart: +fail_not_setup: fail_not_started: sfc_adapter_unlock(sa); SFC_ASSERT(rc > 0); diff --git a/drivers/net/sfc/sfc_rx.c b/drivers/net/sfc/sfc_rx.c index d8503e201..c6321d174 100644 --- a/drivers/net/sfc/sfc_rx.c +++ b/drivers/net/sfc/sfc_rx.c @@ -673,6 +673,7 @@ sfc_rx_qstart(struct sfc_adapter *sa, unsigned int sw_index) rxq_info = &sa->rxq_info[sw_index]; rxq = rxq_info->rxq; + SFC_ASSERT(rxq != NULL); SFC_ASSERT(rxq->state == SFC_RXQ_INITIALIZED); evq = rxq->evq; @@ -763,7 +764,7 @@ sfc_rx_qstop(struct sfc_adapter *sa, unsigned int sw_index) rxq_info = &sa->rxq_info[sw_index]; rxq = rxq_info->rxq; - if (rxq->state == SFC_RXQ_INITIALIZED) + if (rxq == NULL || rxq->state == SFC_RXQ_INITIALIZED) return; SFC_ASSERT(rxq->state & SFC_RXQ_STARTED); @@ -1363,7 +1364,8 @@ sfc_rx_start(struct sfc_adapter *sa) goto fail_rss_config; for (sw_index = 0; sw_index < sa->rxq_count; ++sw_index) { - if ((!sa->rxq_info[sw_index].deferred_start || + if (sa->rxq_info[sw_index].rxq != NULL && + (!sa->rxq_info[sw_index].deferred_start || sa->rxq_info[sw_index].deferred_started)) { rc = sfc_rx_qstart(sa, sw_index); if (rc != 0) -- 2.17.1