@@ -1216,6 +1216,10 @@ static int stmmac_get_mm(struct net_device *ndev,
if (!stmmac_fpe_supported(priv))
return -EOPNOTSUPP;
+ state->rx_min_frag_size = ETH_ZLEN;
+ frag_size = stmmac_fpe_get_add_frag_size(priv);
+ state->tx_min_frag_size = ethtool_mm_frag_size_add_to_min(frag_size);
+
spin_lock_irqsave(&priv->fpe_cfg.lock, flags);
state->max_verify_time = STMMAC_FPE_MM_MAX_VERIFY_TIME_MS;
@@ -1224,7 +1228,6 @@ static int stmmac_get_mm(struct net_device *ndev,
state->verify_time = priv->fpe_cfg.verify_time;
state->tx_enabled = priv->fpe_cfg.tx_enabled;
state->verify_status = priv->fpe_cfg.status;
- state->rx_min_frag_size = ETH_ZLEN;
/* FPE active if common tx_enabled and
* (verification success or disabled(forced))
@@ -1236,9 +1239,6 @@ static int stmmac_get_mm(struct net_device *ndev,
else
state->tx_active = false;
- frag_size = stmmac_fpe_get_add_frag_size(priv);
- state->tx_min_frag_size = ethtool_mm_frag_size_add_to_min(frag_size);
-
spin_unlock_irqrestore(&priv->fpe_cfg.lock, flags);
return 0;
@@ -1258,6 +1258,8 @@ static int stmmac_set_mm(struct net_device *ndev, struct ethtool_mm_cfg *cfg,
if (err)
return err;
+ stmmac_fpe_set_add_frag_size(priv, frag_size);
+
/* Wait for the verification that's currently in progress to finish */
timer_shutdown_sync(&fpe_cfg->verify_timer);
@@ -1271,7 +1273,6 @@ static int stmmac_set_mm(struct net_device *ndev, struct ethtool_mm_cfg *cfg,
if (!cfg->verify_enabled)
fpe_cfg->status = ETHTOOL_MM_VERIFY_STATUS_DISABLED;
- stmmac_fpe_set_add_frag_size(priv, frag_size);
stmmac_fpe_apply(priv);
spin_unlock_irqrestore(&fpe_cfg->lock, flags);