Thread (11 messages) 11 messages, 2 authors, 2024-10-31

Re: [PATCH net-next v7 1/8] net: stmmac: Introduce separate files for FPE implementation

From: Vladimir Oltean <olteanv@gmail.com>
Date: 2024-10-31 17:29:50
Also in: linux-arm-kernel, lkml

On Thu, Oct 31, 2024 at 08:37:55PM +0800, Furong Xu wrote:
+void stmmac_fpe_link_state_handle(struct stmmac_priv *priv, bool is_up)
+{
+	struct stmmac_fpe_cfg *fpe_cfg = &priv->fpe_cfg;
+	unsigned long flags;
+
+	timer_shutdown_sync(&fpe_cfg->verify_timer);
+
+	spin_lock_irqsave(&fpe_cfg->lock, flags);
+
+	if (is_up && fpe_cfg->pmac_enabled) {
+		/* VERIFY process requires pmac enabled when NIC comes up */
+		stmmac_fpe_configure(priv, priv->ioaddr, fpe_cfg,
+				     priv->plat->tx_queues_to_use,
+				     priv->plat->rx_queues_to_use,
+				     false, true);
+
+		/* New link => maybe new partner => new verification process */
+		stmmac_fpe_apply(priv);
+	} else {
+		/* No link => turn off EFPE */
+		stmmac_fpe_configure(priv, priv->ioaddr, fpe_cfg,
+				     priv->plat->tx_queues_to_use,
+				     priv->plat->rx_queues_to_use,
+				     false, false);
+	}
+
+	spin_unlock_irqrestore(&fpe_cfg->lock, flags);
+}
+
+void stmmac_fpe_apply(struct stmmac_priv *priv)
This is absolutely minor, but could you please sort the functions in
their natural calling order (callee first, caller second)? It's fine now
that stmmac_fpe_apply() has its function prototype exported, and that
works as a forward declaration because we also include stmmac_fpe.h.
But if somebody were to unexport stmmac_fpe_apply() in the future, they
would also have to move it too.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help