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 BD668A04A7; Tue, 25 Jan 2022 10:39:50 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A6475426D2; Tue, 25 Jan 2022 10:39:50 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 6CDC4411A7 for ; Tue, 25 Jan 2022 10:39:49 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 20P2eoGU025025 for ; Tue, 25 Jan 2022 01:39:48 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=J1Ke250gPBL+UASCYjl+jt6cjyJ+YCYQHvTuqpUcsRw=; b=R/pFnSQiLFzTaPb8uojmtmJ5E1ekQ1EVTOy//E3AT77QvRNrDbhndrAgZfRvLWdUaQy9 cs3pdxBFBY4Fb0CttGcn1eiYnX/72a7umvGv4SVpeEcFBgwWPQXduRtrsim9m0eAhVe6 9MsUeMxRCqUk9J5tgJT4ex2eLtl0mf4gqxq6uSdf4v0DlaltvLwPGYS8WOBWICQu/dJ2 mJs3yXZK9PXHoBiwuA+j3ri17A8iTN+0vdQDJ6k54llD7MltRysO4otoEIEHpBTAYi2M VXtauCgLvy+QhZMaiAU7He72773HJ95GEjvyOuaTy3NLj1mz4sWi2dFBtwOfbtwk9ioB aw== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3dt8muh7vq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Tue, 25 Jan 2022 01:39:48 -0800 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 25 Jan 2022 01:39:46 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 25 Jan 2022 01:39:46 -0800 Received: from localhost.localdomain (unknown [10.28.34.33]) by maili.marvell.com (Postfix) with ESMTP id 15E2A3F704F; Tue, 25 Jan 2022 01:39:43 -0800 (PST) From: To: Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao CC: , Satheesh Paul , "Jerin Jacob Kollanukkaran" Subject: [dpdk-dev] [PATCH] net/cnxk: fix updating Rx/Tx functions in fastpath ops Date: Tue, 25 Jan 2022 15:09:40 +0530 Message-ID: <20220125093940.910029-1-psatheesh@marvell.com> X-Mailer: git-send-email 2.25.4 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: cBz1ERz4fAGqWUxgUckNyLt3hP0ZbB-3 X-Proofpoint-GUID: cBz1ERz4fAGqWUxgUckNyLt3hP0ZbB-3 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.816,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2022-01-25_02,2022-01-24_02,2021-12-02_01 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Satheesh Paul When Rx/Tx functions are updated such as in an rte flow rule creation with VLAN stripping or marking action, update the fastpath ops table as well. Fixes: b951c2efcb1 ("net/cnxk: add Rx burst for CN9K") Fixes: f742a9a6681 ("net/cnxk: add Rx burst for CN10K") Signed-off-by: Satheesh Paul Reviewed-by: Jerin Jacob Kollanukkaran --- drivers/net/cnxk/cn10k_rx.c | 4 ++++ drivers/net/cnxk/cn10k_rx_select.c | 4 ++++ drivers/net/cnxk/cn10k_tx_select.c | 4 ++++ drivers/net/cnxk/cn9k_rx.c | 4 ++++ drivers/net/cnxk/cn9k_rx_select.c | 4 ++++ drivers/net/cnxk/cn9k_tx.c | 4 ++++ drivers/net/cnxk/cn9k_tx_select.c | 4 ++++ 7 files changed, 28 insertions(+) diff --git a/drivers/net/cnxk/cn10k_rx.c b/drivers/net/cnxk/cn10k_rx.c index 5d603514c0..15f71b14bd 100644 --- a/drivers/net/cnxk/cn10k_rx.c +++ b/drivers/net/cnxk/cn10k_rx.c @@ -31,6 +31,10 @@ pick_rx_func(struct rte_eth_dev *eth_dev, [!!(dev->rx_offload_flags & NIX_RX_OFFLOAD_PTYPE_F)] [!!(dev->rx_offload_flags & NIX_RX_OFFLOAD_RSS_F)]; + if (eth_dev->data->dev_started) + rte_eth_fp_ops[eth_dev->data->port_id].rx_pkt_burst = + eth_dev->rx_pkt_burst; + rte_atomic_thread_fence(__ATOMIC_RELEASE); } diff --git a/drivers/net/cnxk/cn10k_rx_select.c b/drivers/net/cnxk/cn10k_rx_select.c index 5ca18feb1e..60a3688114 100644 --- a/drivers/net/cnxk/cn10k_rx_select.c +++ b/drivers/net/cnxk/cn10k_rx_select.c @@ -15,6 +15,10 @@ pick_rx_func(struct rte_eth_dev *eth_dev, eth_dev->rx_pkt_burst = rx_burst[dev->rx_offload_flags & (NIX_RX_OFFLOAD_MAX - 1)]; + if (eth_dev->data->dev_started) + rte_eth_fp_ops[eth_dev->data->port_id].rx_pkt_burst = + eth_dev->rx_pkt_burst; + rte_atomic_thread_fence(__ATOMIC_RELEASE); } diff --git a/drivers/net/cnxk/cn10k_tx_select.c b/drivers/net/cnxk/cn10k_tx_select.c index 0b8e3f35b9..037ab6f447 100644 --- a/drivers/net/cnxk/cn10k_tx_select.c +++ b/drivers/net/cnxk/cn10k_tx_select.c @@ -14,6 +14,10 @@ pick_tx_func(struct rte_eth_dev *eth_dev, /* [SEC] [TSP] [TSO] [NOFF] [VLAN] [OL3_OL4_CSUM] [IL3_IL4_CSUM] */ eth_dev->tx_pkt_burst = tx_burst[dev->tx_offload_flags & (NIX_TX_OFFLOAD_MAX - 1)]; + + if (eth_dev->data->dev_started) + rte_eth_fp_ops[eth_dev->data->port_id].tx_pkt_burst = + eth_dev->tx_pkt_burst; } void diff --git a/drivers/net/cnxk/cn9k_rx.c b/drivers/net/cnxk/cn9k_rx.c index 8d504c4a6d..185b643692 100644 --- a/drivers/net/cnxk/cn9k_rx.c +++ b/drivers/net/cnxk/cn9k_rx.c @@ -31,6 +31,10 @@ pick_rx_func(struct rte_eth_dev *eth_dev, [!!(dev->rx_offload_flags & NIX_RX_OFFLOAD_PTYPE_F)] [!!(dev->rx_offload_flags & NIX_RX_OFFLOAD_RSS_F)]; + if (eth_dev->data->dev_started) + rte_eth_fp_ops[eth_dev->data->port_id].rx_pkt_burst = + eth_dev->rx_pkt_burst; + rte_atomic_thread_fence(__ATOMIC_RELEASE); } diff --git a/drivers/net/cnxk/cn9k_rx_select.c b/drivers/net/cnxk/cn9k_rx_select.c index d07a5e890c..fb66d9df7c 100644 --- a/drivers/net/cnxk/cn9k_rx_select.c +++ b/drivers/net/cnxk/cn9k_rx_select.c @@ -15,6 +15,10 @@ pick_rx_func(struct rte_eth_dev *eth_dev, eth_dev->rx_pkt_burst = rx_burst[dev->rx_offload_flags & (NIX_RX_OFFLOAD_MAX - 1)]; + if (eth_dev->data->dev_started) + rte_eth_fp_ops[eth_dev->data->port_id].rx_pkt_burst = + eth_dev->rx_pkt_burst; + rte_atomic_thread_fence(__ATOMIC_RELEASE); } diff --git a/drivers/net/cnxk/cn9k_tx.c b/drivers/net/cnxk/cn9k_tx.c index f3f19fed97..f99e5d3e23 100644 --- a/drivers/net/cnxk/cn9k_tx.c +++ b/drivers/net/cnxk/cn9k_tx.c @@ -36,6 +36,10 @@ pick_tx_func(struct rte_eth_dev *eth_dev, [!!(dev->tx_offload_flags & NIX_TX_OFFLOAD_VLAN_QINQ_F)] [!!(dev->tx_offload_flags & NIX_TX_OFFLOAD_OL3_OL4_CSUM_F)] [!!(dev->tx_offload_flags & NIX_TX_OFFLOAD_L3_L4_CSUM_F)]; + + if (eth_dev->data->dev_started) + rte_eth_fp_ops[eth_dev->data->port_id].tx_pkt_burst = + eth_dev->tx_pkt_burst; } void diff --git a/drivers/net/cnxk/cn9k_tx_select.c b/drivers/net/cnxk/cn9k_tx_select.c index c1fb2f41d5..a84f74a918 100644 --- a/drivers/net/cnxk/cn9k_tx_select.c +++ b/drivers/net/cnxk/cn9k_tx_select.c @@ -14,6 +14,10 @@ pick_tx_func(struct rte_eth_dev *eth_dev, /* [TS] [TSO] [NOFF] [VLAN] [OL3_OL4_CSUM] [IL3_IL4_CSUM] */ eth_dev->tx_pkt_burst = tx_burst[dev->tx_offload_flags & (NIX_TX_OFFLOAD_MAX - 1)]; + + if (eth_dev->data->dev_started) + rte_eth_fp_ops[eth_dev->data->port_id].tx_pkt_burst = + eth_dev->tx_pkt_burst; } void -- 2.25.4