Perform early MTU setup for event mode path in order
to update the Rx/Tx offload flags before Rx adapter setup
starts.

Signed-off-by: Nithin Dabilpuram <ndabilpu...@marvell.com>
---
 drivers/net/cnxk/cn10k_ethdev.c | 11 +++++++++++
 drivers/net/cnxk/cn9k_ethdev.c  | 11 +++++++++++
 2 files changed, 22 insertions(+)

diff --git a/drivers/net/cnxk/cn10k_ethdev.c b/drivers/net/cnxk/cn10k_ethdev.c
index de688f0..bc9e10f 100644
--- a/drivers/net/cnxk/cn10k_ethdev.c
+++ b/drivers/net/cnxk/cn10k_ethdev.c
@@ -248,6 +248,17 @@ cn10k_nix_rx_queue_setup(struct rte_eth_dev *eth_dev, 
uint16_t qid,
        if (rc)
                return rc;
 
+       /* Do initial mtu setup for RQ0 before device start */
+       if (!qid) {
+               rc = nix_recalc_mtu(eth_dev);
+               if (rc)
+                       return rc;
+
+               /* Update offload flags */
+               dev->rx_offload_flags = nix_rx_offload_flags(eth_dev);
+               dev->tx_offload_flags = nix_tx_offload_flags(eth_dev);
+       }
+
        rq = &dev->rqs[qid];
        cq = &dev->cqs[qid];
 
diff --git a/drivers/net/cnxk/cn9k_ethdev.c b/drivers/net/cnxk/cn9k_ethdev.c
index 18cc27e..de33fa7 100644
--- a/drivers/net/cnxk/cn9k_ethdev.c
+++ b/drivers/net/cnxk/cn9k_ethdev.c
@@ -241,6 +241,17 @@ cn9k_nix_rx_queue_setup(struct rte_eth_dev *eth_dev, 
uint16_t qid,
        if (rc)
                return rc;
 
+       /* Do initial mtu setup for RQ0 before device start */
+       if (!qid) {
+               rc = nix_recalc_mtu(eth_dev);
+               if (rc)
+                       return rc;
+
+               /* Update offload flags */
+               dev->rx_offload_flags = nix_rx_offload_flags(eth_dev);
+               dev->tx_offload_flags = nix_tx_offload_flags(eth_dev);
+       }
+
        rq = &dev->rqs[qid];
        cq = &dev->cqs[qid];
 
-- 
2.8.4

Reply via email to