From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2D4DBA0350 for ; Mon, 21 Feb 2022 16:39:49 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1772F410F3; Mon, 21 Feb 2022 16:39:49 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 4C525410F7 for ; Mon, 21 Feb 2022 16:39:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645457986; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BmhYlGjc4uEGrsd9+WDtJsLR0XINM/FFKwURHW5y97U=; b=Jwg40jRUA1c9qtfZDz+N6sX4Nyxh8ys66M+9xPYuSifL260dNrP7HMNIkkRUO/r8SOWxEl mGXuusej1NlH463RPKkuuYZ/+3A8KvzuYA5Q1d3MXJd+AiqQs9Li6zCTqeF5dCmGYD2zWo YlY2o5GP5Z55wbPvYdmlp3K9pRO2vJY= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-620-ZTSq4qY3NlaTItsCKqWnag-1; Mon, 21 Feb 2022 10:39:44 -0500 X-MC-Unique: ZTSq4qY3NlaTItsCKqWnag-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 81638184608A; Mon, 21 Feb 2022 15:39:43 +0000 (UTC) Received: from rh.Home (unknown [10.39.195.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id BAFD77B9D9; Mon, 21 Feb 2022 15:39:42 +0000 (UTC) From: Kevin Traynor To: "Min Hu (Connor)" Cc: dpdk stable Subject: patch 'net/hns3: fix Rx/Tx functions update' has been queued to stable release 21.11.1 Date: Mon, 21 Feb 2022 15:34:50 +0000 Message-Id: <20220221153625.152324-101-ktraynor@redhat.com> In-Reply-To: <20220221153625.152324-1-ktraynor@redhat.com> References: <20220221153625.152324-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ktraynor@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 21.11.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 02/26/22. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable/commit/e073f410fb2679c059487fb6fd9dfb4a9256ef05 Thanks. Kevin --- >From e073f410fb2679c059487fb6fd9dfb4a9256ef05 Mon Sep 17 00:00:00 2001 From: "Min Hu (Connor)" Date: Mon, 17 Jan 2022 10:43:00 +0800 Subject: [PATCH] net/hns3: fix Rx/Tx functions update [ upstream commit 96c33cfb06cf59b785439058190060bde120f030 ] When fast path operation is introduced, the Rx/Tx function is done by object 'rte_eth_fp_ops'. So 'rte_eth_fp_ops' should be updated if 'fast-path functions' need to be changed, such as PMD receive function, prepare function and so on. This patch fixed receiving packets bug when fast path operation is introduced. Fixes: bba636698316 ("net/hns3: support Rx/Tx and related operations") Fixes: 168b7d79dada ("net/hns3: support set link up/down for PF") Signed-off-by: Min Hu (Connor) --- drivers/net/hns3/hns3_mp.c | 7 ++----- drivers/net/hns3/hns3_rxtx.c | 28 +++++++++++++++++++++++++++- 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/drivers/net/hns3/hns3_mp.c b/drivers/net/hns3/hns3_mp.c index 999b407f7d..e74ddea195 100644 --- a/drivers/net/hns3/hns3_mp.c +++ b/drivers/net/hns3/hns3_mp.c @@ -75,5 +75,4 @@ mp_secondary_handle(const struct rte_mp_msg *mp_msg, const void *peer) const struct hns3_mp_param *param = (const struct hns3_mp_param *)mp_msg->param; - eth_tx_prep_t prep = NULL; struct rte_eth_dev *dev; int ret; @@ -99,12 +98,10 @@ mp_secondary_handle(const struct rte_mp_msg *mp_msg, const void *peer) PMD_INIT_LOG(INFO, "port %u starting Tx datapath", dev->data->port_id); - dev->tx_pkt_burst = hns3_get_tx_function(dev, &prep); - dev->tx_pkt_prepare = prep; + hns3_start_tx_datapath(dev); break; case HNS3_MP_REQ_STOP_TX: PMD_INIT_LOG(INFO, "port %u stopping Tx datapath", dev->data->port_id); - dev->tx_pkt_burst = hns3_dummy_rxtx_burst; - dev->tx_pkt_prepare = NULL; + hns3_stop_tx_datapath(dev); break; default: diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c index d240e36e6a..c86aeb2366 100644 --- a/drivers/net/hns3/hns3_rxtx.c +++ b/drivers/net/hns3/hns3_rxtx.c @@ -4409,5 +4409,19 @@ hns3_trace_rxtx_function(struct rte_eth_dev *dev) } -void hns3_set_rxtx_function(struct rte_eth_dev *eth_dev) +static void +hns3_eth_dev_fp_ops_config(const struct rte_eth_dev *dev) +{ + struct rte_eth_fp_ops *fpo = rte_eth_fp_ops; + uint16_t port_id = dev->data->port_id; + + fpo[port_id].rx_pkt_burst = dev->rx_pkt_burst; + fpo[port_id].tx_pkt_burst = dev->tx_pkt_burst; + fpo[port_id].tx_pkt_prepare = dev->tx_pkt_prepare; + fpo[port_id].rx_descriptor_status = dev->rx_descriptor_status; + fpo[port_id].tx_descriptor_status = dev->tx_descriptor_status; +} + +void +hns3_set_rxtx_function(struct rte_eth_dev *eth_dev) { struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private); @@ -4430,4 +4444,6 @@ void hns3_set_rxtx_function(struct rte_eth_dev *eth_dev) eth_dev->tx_pkt_prepare = NULL; } + + hns3_eth_dev_fp_ops_config(eth_dev); } @@ -4730,4 +4746,9 @@ hns3_stop_tx_datapath(struct rte_eth_dev *dev) dev->tx_pkt_burst = hns3_dummy_rxtx_burst; dev->tx_pkt_prepare = NULL; + hns3_eth_dev_fp_ops_config(dev); + + if (rte_eal_process_type() == RTE_PROC_SECONDARY) + return; + rte_wmb(); /* Disable tx datapath on secondary process. */ @@ -4744,4 +4765,9 @@ hns3_start_tx_datapath(struct rte_eth_dev *dev) dev->tx_pkt_burst = hns3_get_tx_function(dev, &prep); dev->tx_pkt_prepare = prep; + hns3_eth_dev_fp_ops_config(dev); + + if (rte_eal_process_type() == RTE_PROC_SECONDARY) + return; + hns3_mp_req_start_tx(dev); } -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-02-21 15:22:46.802188793 +0000 +++ 0101-net-hns3-fix-Rx-Tx-functions-update.patch 2022-02-21 15:22:44.202704376 +0000 @@ -1 +1 @@ -From 96c33cfb06cf59b785439058190060bde120f030 Mon Sep 17 00:00:00 2001 +From e073f410fb2679c059487fb6fd9dfb4a9256ef05 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 96c33cfb06cf59b785439058190060bde120f030 ] + @@ -16 +17,0 @@ -Cc: stable@dpdk.org