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 E66511B4BD for ; Thu, 7 Feb 2019 13:18:16 +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 15EB4600053 for ; Thu, 7 Feb 2019 12:18:15 +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:10 -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 x17CI8rF013258 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 CE9821613E4 for ; Thu, 7 Feb 2019 12:18:08 +0000 (GMT) From: Andrew Rybchenko To: Date: Thu, 7 Feb 2019 12:17:38 +0000 Message-ID: <1549541873-17403-16-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-5.194900-4.000000-10 X-TMASE-MatchedRID: TCPSmmY0AVPMHUInqqZ02h+WEMjoO9WWTJDl9FKHbrkaK6XhXABo9yH3 fZSwSQ1serb3e1hTuhFzZI042SBkozW+K/PcvqBrsTcWkxuDrdKVKmGUZ/WnkQqiCYa6w8tvWTF H84r4cDQEvqH635UJYlgVldL/B76CHxPMjOKY7A8LbigRnpKlKWxlRJiH4397u4y55aOoCkxkvt xnu2htzA+6zRbgLa/kIooLu5Vi3hvMvnwwvXCXZw== X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--5.194900-4.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.5.1010-24412.006 X-MDID: 1549541895-fApsC92lcLzo Subject: [dpdk-dev] [PATCH 15/30] net/sfc: support Tx 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:17 -0000 If Tx datapath supports multi-process, secondary process should be able to use Tx descriptor status API. Signed-off-by: Andrew Rybchenko --- doc/guides/rel_notes/release_19_05.rst | 1 + drivers/net/sfc/sfc_dp_tx.h | 3 +++ drivers/net/sfc/sfc_ethdev.c | 11 +++++++++-- drivers/net/sfc/sfc_tx.c | 15 +++++++++++++++ 4 files changed, 28 insertions(+), 2 deletions(-) diff --git a/doc/guides/rel_notes/release_19_05.rst b/doc/guides/rel_notes/release_19_05.rst index 93f28926a..6d65c8eae 100644 --- a/doc/guides/rel_notes/release_19_05.rst +++ b/doc/guides/rel_notes/release_19_05.rst @@ -60,6 +60,7 @@ New Features * Added support for Rx descriptor status and related API in a secondary process. + * Added support for Tx descriptor status API in a secondary process. Removed Items diff --git a/drivers/net/sfc/sfc_dp_tx.h b/drivers/net/sfc/sfc_dp_tx.h index c246871cd..fd492f21f 100644 --- a/drivers/net/sfc/sfc_dp_tx.h +++ b/drivers/net/sfc/sfc_dp_tx.h @@ -182,6 +182,9 @@ sfc_dp_find_tx_by_caps(struct sfc_dp_list *head, unsigned int avail_caps) return (p == NULL) ? NULL : container_of(p, struct sfc_dp_tx, dp); } +/** Get Tx datapath ops by the datapath TxQ handle */ +const struct sfc_dp_tx *sfc_dp_tx_by_dp_txq(const struct sfc_dp_txq *dp_txq); + extern struct sfc_dp_tx sfc_efx_tx; extern struct sfc_dp_tx sfc_ef10_tx; extern struct sfc_dp_tx sfc_ef10_simple_tx; diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c index 80a1d7a3d..c6e1e87ce 100644 --- a/drivers/net/sfc/sfc_ethdev.c +++ b/drivers/net/sfc/sfc_ethdev.c @@ -1167,13 +1167,19 @@ sfc_rx_descriptor_status(void *queue, uint16_t offset) return dp_rx->qdesc_status(dp_rxq, offset); } +/* + * 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_tx_descriptor_status(void *queue, uint16_t offset) { struct sfc_dp_txq *dp_txq = queue; - struct sfc_txq *txq = sfc_txq_by_dp_txq(dp_txq); + const struct sfc_dp_tx *dp_tx; + + dp_tx = sfc_dp_tx_by_dp_txq(dp_txq); - return txq->evq->sa->priv.dp_tx->qdesc_status(dp_txq, offset); + return dp_tx->qdesc_status(dp_txq, offset); } static int @@ -1896,6 +1902,7 @@ 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, + .tx_descriptor_status = sfc_tx_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_tx.c b/drivers/net/sfc/sfc_tx.c index 1ee4e78a1..4357dbfd8 100644 --- a/drivers/net/sfc/sfc_tx.c +++ b/drivers/net/sfc/sfc_tx.c @@ -854,6 +854,21 @@ sfc_efx_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) return pkts_sent; } +const struct sfc_dp_tx * +sfc_dp_tx_by_dp_txq(const struct sfc_dp_txq *dp_txq) +{ + const struct sfc_dp_queue *dpq = &dp_txq->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_tx; +} + struct sfc_txq_info * sfc_txq_info_by_dp_txq(const struct sfc_dp_txq *dp_txq) { -- 2.17.1