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 3079A1B4B6 for ; Thu, 7 Feb 2019 13:18:15 +0100 (CET) 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 0D7A4600061 for ; Thu, 7 Feb 2019 12:18:14 +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; Thu, 7 Feb 2019 04:18:10 -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.1395.4 via Frontend Transport; Thu, 7 Feb 2019 04:18:09 -0800 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 x17CI8i9013245 for ; Thu, 7 Feb 2019 12:18:08 GMT Received: from ukv-loginhost.uk.solarflarecom.com (localhost [127.0.0.1]) by ukv-loginhost.uk.solarflarecom.com (Postfix) with ESMTP id A45DF1613EB for ; Thu, 7 Feb 2019 12:18:08 +0000 (GMT) From: Andrew Rybchenko To: Date: Thu, 7 Feb 2019 12:17:35 +0000 Message-ID: <1549541873-17403-13-git-send-email-arybchenko@solarflare.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1549541873-17403-1-git-send-email-arybchenko@solarflare.com> References: <1549541873-17403-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-24412.006 X-TM-AS-Result: No-4.867600-4.000000-10 X-TMASE-MatchedRID: i/wEjRUPNdw2jeY+Udg/IrMjW/sniEQKSjyMfjCRfaPfUZT83lbkED0J SifQ1MZ59spbMCBlXHFikKk0n7J+WT1LciJB3541EhGH3CRdKUXljSRvSGpq3MNNczdXNJoiteP PVOPX6wIcdSYUJM2UOhnHvHnQkZWJwdbU3akH5Ay3UCG/IQp2PjQAp53S718HGB5fXKRWYOijxY yRBa/qJcFwgTvxipFajoczmuoPCq00aEISWnGCnaueh7gXlaRTa6/nh33aIEm4xE6RbM6JWtK3c WeOGvbhc1BSWuecgSR57oXK2H7pLDPRVOsyasgmV8mP9SzXaZE3I8DUyOoaeU+wJNKvG6HQ1PNk ozhRY3HUNR3AhwxI7LAXtf+fj2qblExlQIQeRG0= X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--4.867600-4.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.5.1010-24412.006 X-MDID: 1549541894-5l8mC_DVXsXh Subject: [dpdk-dev] [PATCH 12/30] net/sfc: support Rx descriptor status in secondary process 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: Thu, 07 Feb 2019 12:18:15 -0000 If Rx datapath supports multi-process, secondary process should be able to use Rx descriptor status and related API. Signed-off-by: Andrew Rybchenko --- doc/guides/rel_notes/release_19_05.rst | 7 +++++++ drivers/net/sfc/sfc_dp_rx.h | 3 +++ drivers/net/sfc/sfc_ethdev.c | 27 ++++++++++++++++++++++---- drivers/net/sfc/sfc_rx.c | 16 +++++++++++++++ 4 files changed, 49 insertions(+), 4 deletions(-) diff --git a/doc/guides/rel_notes/release_19_05.rst b/doc/guides/rel_notes/release_19_05.rst index e3a7ed22f..93f28926a 100644 --- a/doc/guides/rel_notes/release_19_05.rst +++ b/doc/guides/rel_notes/release_19_05.rst @@ -54,6 +54,13 @@ New Features Also, make sure to start the actual text at the margin. ========================================================= +* **Updated Solarflare network PMD.** + + Updated the sfc_efx driver including the following changes: + + * Added support for Rx descriptor status and related API in a secondary + process. + Removed Items ------------- diff --git a/drivers/net/sfc/sfc_dp_rx.h b/drivers/net/sfc/sfc_dp_rx.h index ce96e83f6..7e911648e 100644 --- a/drivers/net/sfc/sfc_dp_rx.h +++ b/drivers/net/sfc/sfc_dp_rx.h @@ -228,6 +228,9 @@ sfc_dp_find_rx_by_caps(struct sfc_dp_list *head, unsigned int avail_caps) return (p == NULL) ? NULL : container_of(p, struct sfc_dp_rx, dp); } +/** Get Rx datapath ops by the datapath RxQ handle */ +const struct sfc_dp_rx *sfc_dp_rx_by_dp_rxq(const struct sfc_dp_rxq *dp_rxq); + extern struct sfc_dp_rx sfc_efx_rx; extern struct sfc_dp_rx sfc_ef10_rx; extern struct sfc_dp_rx sfc_ef10_essb_rx; diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c index 71be88f3e..5bc73d512 100644 --- a/drivers/net/sfc/sfc_ethdev.c +++ b/drivers/net/sfc/sfc_ethdev.c @@ -1117,6 +1117,10 @@ sfc_tx_queue_info_get(struct rte_eth_dev *dev, uint16_t tx_queue_id, sfc_adapter_unlock(sa); } +/* + * The function is used by the secondary process as well. It must not + * use any process-local pointers from the adapter data. + */ static uint32_t sfc_rx_queue_count(struct rte_eth_dev *dev, uint16_t rx_queue_id) { @@ -1133,22 +1137,34 @@ sfc_rx_queue_count(struct rte_eth_dev *dev, uint16_t rx_queue_id) return sap->dp_rx->qdesc_npending(rxq_info->dp); } +/* + * The function is used by the secondary process as well. It must not + * use any process-local pointers from the adapter data. + */ 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); + const struct sfc_dp_rx *dp_rx; + + dp_rx = sfc_dp_rx_by_dp_rxq(dp_rxq); - return offset < rxq->evq->sa->priv.dp_rx->qdesc_npending(dp_rxq); + return offset < dp_rx->qdesc_npending(dp_rxq); } +/* + * The function is used by the secondary process as well. It must not + * use any process-local pointers from the adapter data. + */ static int sfc_rx_descriptor_status(void *queue, uint16_t offset) { struct sfc_dp_rxq *dp_rxq = queue; - struct sfc_rxq *rxq = sfc_rxq_by_dp_rxq(dp_rxq); + const struct sfc_dp_rx *dp_rx; - return rxq->evq->sa->priv.dp_rx->qdesc_status(dp_rxq, offset); + dp_rx = sfc_dp_rx_by_dp_rxq(dp_rxq); + + return dp_rx->qdesc_status(dp_rxq, offset); } static int @@ -1877,6 +1893,9 @@ sfc_eth_dev_clear_ops(struct rte_eth_dev *dev) } static const struct eth_dev_ops sfc_eth_dev_secondary_ops = { + .rx_queue_count = sfc_rx_queue_count, + .rx_descriptor_done = sfc_rx_descriptor_done, + .rx_descriptor_status = sfc_rx_descriptor_status, .rxq_info_get = sfc_rx_queue_info_get, .txq_info_get = sfc_tx_queue_info_get, }; diff --git a/drivers/net/sfc/sfc_rx.c b/drivers/net/sfc/sfc_rx.c index 886a7a2fd..3c1e77974 100644 --- a/drivers/net/sfc/sfc_rx.c +++ b/drivers/net/sfc/sfc_rx.c @@ -360,6 +360,22 @@ sfc_efx_rx_qdesc_status(struct sfc_dp_rxq *dp_rxq, uint16_t offset) return RTE_ETH_RX_DESC_UNAVAIL; } +/** Get Rx datapath ops by the datapath RxQ handle */ +const struct sfc_dp_rx * +sfc_dp_rx_by_dp_rxq(const struct sfc_dp_rxq *dp_rxq) +{ + const struct sfc_dp_queue *dpq = &dp_rxq->dpq; + struct rte_eth_dev *eth_dev; + struct sfc_adapter_priv *sap; + + SFC_ASSERT(rte_eth_dev_is_valid_port(dpq->port_id)); + eth_dev = &rte_eth_devices[dpq->port_id]; + + sap = sfc_adapter_priv_by_eth_dev(eth_dev); + + return sap->dp_rx; +} + struct sfc_rxq_info * sfc_rxq_info_by_dp_rxq(const struct sfc_dp_rxq *dp_rxq) { -- 2.17.1