diff mbox series

[net-next,1/3] net: stmmac: clarify priv->pause and pause module parameter

Message ID E1tkKmD-004ObA-9K@rmk-PC.armlinux.org.uk (mailing list archive)
State New
Delegated to: Netdev Maintainers
Headers show
Series net: stmmac: further cleanups | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers warning 4 maintainers not CCed: aou@eecs.berkeley.edu paul.walmsley@sifive.com 0x1207@gmail.com palmer@dabbelt.com
netdev/build_clang success Errors and warnings before: 1 this patch: 1
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 8 this patch: 8
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 32 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 36 this patch: 36
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2025-02-18--12-00 (tests: 891)

Commit Message

Russell King (Oracle) Feb. 18, 2025, 10:24 a.m. UTC
priv->pause corresponds with "pause_time" in the 802.3 specification,
and is also called "pause_time" in the various MAC backends. For
consistency, use the same name in the core stmmac code.

Clarify the units of the "pause" module parameter which sets up this
struct member to indicate that it's in units of the pause_quanta
defined by 802.3, which is 512 bit times.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac.h      | 2 +-
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

Comments

Mateusz Polchlopek Feb. 18, 2025, 11:17 a.m. UTC | #1
On 2/18/2025 11:24 AM, Russell King (Oracle) wrote:
> priv->pause corresponds with "pause_time" in the 802.3 specification,
> and is also called "pause_time" in the various MAC backends. For
> consistency, use the same name in the core stmmac code.
> 
> Clarify the units of the "pause" module parameter which sets up this
> struct member to indicate that it's in units of the pause_quanta
> defined by 802.3, which is 512 bit times.
> 
> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
> ---
>   drivers/net/ethernet/stmicro/stmmac/stmmac.h      | 2 +-
>   drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 6 +++---
>   2 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac.h b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
> index f05cae103d83..c602ace572b2 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac.h
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
> @@ -283,7 +283,7 @@ struct stmmac_priv {
>   
>   	int speed;
>   	unsigned int flow_ctrl;
> -	unsigned int pause;
> +	unsigned int pause_time;
>   	struct mii_bus *mii;
>   
>   	struct phylink_config phylink_config;
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> index fd8ca1524e43..c3a13bd8c9b3 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> @@ -94,7 +94,7 @@ MODULE_PARM_DESC(flow_ctrl, "Flow control ability [on/off]");
>   
>   static int pause = PAUSE_TIME;
>   module_param(pause, int, 0644);
> -MODULE_PARM_DESC(pause, "Flow Control Pause Time");
> +MODULE_PARM_DESC(pause, "Flow Control Pause Time (units of 512 bit times)");
>   
>   #define TC_DEFAULT 64
>   static int tc = TC_DEFAULT;
> @@ -865,7 +865,7 @@ static void stmmac_mac_flow_ctrl(struct stmmac_priv *priv, u32 duplex)
>   	u32 tx_cnt = priv->plat->tx_queues_to_use;
>   
>   	stmmac_flow_ctrl(priv, priv->hw, duplex, priv->flow_ctrl,
> -			priv->pause, tx_cnt);
> +			 priv->pause_time, tx_cnt);
>   }
>   
>   static unsigned long stmmac_mac_get_caps(struct phylink_config *config,
> @@ -7404,7 +7404,7 @@ int stmmac_dvr_probe(struct device *device,
>   		return -ENOMEM;
>   
>   	stmmac_set_ethtool_ops(ndev);
> -	priv->pause = pause;
> +	priv->pause_time = pause;
>   	priv->plat = plat_dat;
>   	priv->ioaddr = res->addr;
>   	priv->dev->base_addr = (unsigned long)res->addr;

Reviewed-by: Mateusz Polchlopek <mateusz.polchlopek@intel.com>
diff mbox series

Patch

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac.h b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
index f05cae103d83..c602ace572b2 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac.h
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
@@ -283,7 +283,7 @@  struct stmmac_priv {
 
 	int speed;
 	unsigned int flow_ctrl;
-	unsigned int pause;
+	unsigned int pause_time;
 	struct mii_bus *mii;
 
 	struct phylink_config phylink_config;
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index fd8ca1524e43..c3a13bd8c9b3 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -94,7 +94,7 @@  MODULE_PARM_DESC(flow_ctrl, "Flow control ability [on/off]");
 
 static int pause = PAUSE_TIME;
 module_param(pause, int, 0644);
-MODULE_PARM_DESC(pause, "Flow Control Pause Time");
+MODULE_PARM_DESC(pause, "Flow Control Pause Time (units of 512 bit times)");
 
 #define TC_DEFAULT 64
 static int tc = TC_DEFAULT;
@@ -865,7 +865,7 @@  static void stmmac_mac_flow_ctrl(struct stmmac_priv *priv, u32 duplex)
 	u32 tx_cnt = priv->plat->tx_queues_to_use;
 
 	stmmac_flow_ctrl(priv, priv->hw, duplex, priv->flow_ctrl,
-			priv->pause, tx_cnt);
+			 priv->pause_time, tx_cnt);
 }
 
 static unsigned long stmmac_mac_get_caps(struct phylink_config *config,
@@ -7404,7 +7404,7 @@  int stmmac_dvr_probe(struct device *device,
 		return -ENOMEM;
 
 	stmmac_set_ethtool_ops(ndev);
-	priv->pause = pause;
+	priv->pause_time = pause;
 	priv->plat = plat_dat;
 	priv->ioaddr = res->addr;
 	priv->dev->base_addr = (unsigned long)res->addr;