DPDK patches and discussions
 help / color / mirror / Atom feed
From: <psatheesh@marvell.com>
To: Nithin Dabilpuram <ndabilpuram@marvell.com>,
	Kiran Kumar K <kirankumark@marvell.com>,
	Sunil Kumar Kori <skori@marvell.com>,
	Satha Rao <skoteshwar@marvell.com>
Cc: <dev@dpdk.org>, Satheesh Paul <psatheesh@marvell.com>,
	"Jerin Jacob Kollanukkaran" <jerinj@marvell.com>
Subject: [dpdk-dev] [PATCH] net/cnxk: fix updating Rx/Tx functions in fastpath ops
Date: Tue, 25 Jan 2022 15:09:40 +0530	[thread overview]
Message-ID: <20220125093940.910029-1-psatheesh@marvell.com> (raw)

From: Satheesh Paul <psatheesh@marvell.com>

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 <psatheesh@marvell.com>
Reviewed-by: Jerin Jacob Kollanukkaran <jerinj@marvell.com>
---
 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


             reply	other threads:[~2022-01-25  9:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-25  9:39 psatheesh [this message]
2022-02-17  8:50 ` Jerin Jacob

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220125093940.910029-1-psatheesh@marvell.com \
    --to=psatheesh@marvell.com \
    --cc=dev@dpdk.org \
    --cc=jerinj@marvell.com \
    --cc=kirankumark@marvell.com \
    --cc=ndabilpuram@marvell.com \
    --cc=skori@marvell.com \
    --cc=skoteshwar@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).