net/cnxk: fix updating Rx/Tx functions in fastpath ops
PATCH 1/1 net/cnxk: fix updating Rx/Tx functions in fastpath ops
From: Satheesh Paul <[email protected]>
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 <[email protected]>
Reviewed-by Jerin Jacob Kollanukkaran <[email protected]>
--- 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(+)
drivers/net/cnxk/cn10k_rx.c +4 -0
@@ -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); }
drivers/net/cnxk/cn10k_rx_select.c +4 -0
@@ -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); }
drivers/net/cnxk/cn10k_tx_select.c +4 -0
@@ -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
drivers/net/cnxk/cn9k_rx.c +4 -0
@@ -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); }
drivers/net/cnxk/cn9k_rx_select.c +4 -0
@@ -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); }
drivers/net/cnxk/cn9k_tx.c +4 -0
@@ -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
drivers/net/cnxk/cn9k_tx_select.c +4 -0
@@ -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
Signature · 1 line
2.25.4
Quoted 7 lines · On Tue, Jan 25, 2022 at 3:09 PM <[email protected]> wrote:
From: Satheesh Paul <[email protected]>
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.
Quoted 5 lines
Fixes b951c2efcb1 ("net/cnxk: add Rx burst for CN9K")Fixes f742a9a6681 ("net/cnxk: add Rx burst for CN10K")Signed-off-by Satheesh Paul <[email protected]>Reviewed-by Jerin Jacob Kollanukkaran <[email protected]>
Updated the commit as follows and applied to
dpdk-next-net-mrvl/for-next-net. Thanks
net/cnxk: fix Rx/Tx function update
When Rx/Tx functions are updated such as in a 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 <[email protected]>
Reviewed-by Jerin Jacob <[email protected]>
Quoted 118 lines
--- 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(+)drivers/net/cnxk/cn10k_rx.c +4
-0@@ -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); }drivers/net/cnxk/cn10k_rx_select.c +4
-0@@ -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); }drivers/net/cnxk/cn10k_tx_select.c +4
-0@@ -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 drivers/net/cnxk/cn9k_rx.c +4
-0@@ -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); }drivers/net/cnxk/cn9k_rx_select.c +4
-0@@ -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); }drivers/net/cnxk/cn9k_tx.c +4
-0@@ -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 drivers/net/cnxk/cn9k_tx_select.c +4
-1@@ -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