[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20250828144558.304304-3-konrad.leszczynski@intel.com>
Date: Thu, 28 Aug 2025 16:45:56 +0200
From: Konrad Leszczynski <konrad.leszczynski@...el.com>
To: davem@...emloft.net,
andrew+netdev@...n.ch,
edumazet@...gle.com,
kuba@...nel.org,
pabeni@...hat.com
Cc: netdev@...r.kernel.org,
linux-kernel@...r.kernel.org,
cezary.rojewski@...el.com,
sebastian.basierski@...el.com,
Karol Jurczenia <karol.jurczenia@...el.com>,
Konrad Leszczynski <konrad.leszczynski@...el.com>
Subject: [PATCH net-next 2/4] net: stmmac: set TE/RE bits for ARP Offload when interface down
From: Karol Jurczenia <karol.jurczenia@...el.com>
When the network interface is brought down and ARP Offload is enabled,
set the TE (Transmitter Enable) and RE (Receiver Enable) bits.
Ensure that the Network Interface Card (NIC) can continue handling ARP
responses in hardware even when the interface is down.
Reviewed-by: Sebastian Basierski <sebastian.basierski@...el.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@...el.com>
Signed-off-by: Karol Jurczenia <karol.jurczenia@...el.com>
Signed-off-by: Konrad Leszczynski <konrad.leszczynski@...el.com>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 244ef484bb88..8977e5aebc71 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -950,7 +950,9 @@ static void stmmac_mac_link_down(struct phylink_config *config,
{
struct stmmac_priv *priv = netdev_priv(to_net_dev(config->dev));
- stmmac_mac_set(priv, priv->ioaddr, false);
+ if (!(priv->plat->flags & STMMAC_FLAG_ARP_OFFLOAD_EN))
+ stmmac_mac_set(priv, priv->ioaddr, false);
+
if (priv->dma_cap.eee)
stmmac_set_eee_pls(priv, priv->hw, false);
@@ -4183,6 +4185,10 @@ static int stmmac_release(struct net_device *dev)
/* Release and free the Rx/Tx resources */
free_dma_desc_resources(priv, &priv->dma_conf);
+ /* Disable MAC Rx/Tx */
+ stmmac_mac_set(priv, priv->ioaddr, priv->plat->flags &
+ STMMAC_FLAG_ARP_OFFLOAD_EN);
+
/* Powerdown Serdes if there is */
if (priv->plat->serdes_powerdown)
priv->plat->serdes_powerdown(dev, priv->plat->bsp_priv);
--
2.34.1
Powered by blists - more mailing lists