From: Marcin Szycik <[email protected]>

netif_keep_dst() only needs to be called once for the uplink VSI, not
once for each port representor.  Move it from ice_eswitch_setup_repr()
to ice_eswitch_enable_switchdev().

Fixes: defd52455aee ("ice: do Tx through PF netdev in slow-path")
Signed-off-by: Marcin Szycik <[email protected]>
Signed-off-by: Aleksandr Loktionov <[email protected]>
---

 drivers/net/ethernet/intel/ice/ice_eswitch.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_eswitch.c 
b/drivers/net/ethernet/intel/ice/ice_eswitch.c
index 2e4f096..c30e27b 100644
--- a/drivers/net/ethernet/intel/ice/ice_eswitch.c
+++ b/drivers/net/ethernet/intel/ice/ice_eswitch.c
@@ -117,8 +117,6 @@ static int ice_eswitch_setup_repr(struct ice_pf *pf, struct 
ice_repr *repr)
        if (!repr->dst)
                return -ENOMEM;
 
-       netif_keep_dst(uplink_vsi->netdev);
-
        dst = repr->dst;
        dst->u.port_info.port_id = vsi->vsi_num;
        dst->u.port_info.lower_dev = uplink_vsi->netdev;
@@ -312,6 +310,8 @@ static int ice_eswitch_enable_switchdev(struct ice_pf *pf)
        if (ice_eswitch_br_offloads_init(pf))
                goto err_br_offloads;
 
+       netif_keep_dst(uplink_vsi->netdev);
+
        pf->eswitch.is_running = true;
 
        return 0;
-- 
2.52.0

Reply via email to