diff mbox series

[net-next] net: ethernet: mtk_eth_soc: implement .{get,set}_pauseparam ethtool ops

Message ID e3ece47323444631d6cb479f32af0dfd6d145be0.1720088047.git.daniel@makrotopia.org (mailing list archive)
State Accepted
Commit 064fbc4e9b5a6dbda7fe7b67dc7e9e95d31f8d75
Delegated to: Netdev Maintainers
Headers show
Series [net-next] net: ethernet: mtk_eth_soc: implement .{get,set}_pauseparam ethtool ops | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
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: 839 this patch: 839
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 13 of 13 maintainers
netdev/build_clang success Errors and warnings before: 846 this patch: 846
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: 853 this patch: 853
netdev/checkpatch warning WARNING: line length of 87 exceeds 80 columns WARNING: line length of 88 exceeds 80 columns
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-07-05--06-00 (tests: 695)

Commit Message

Daniel Golle July 4, 2024, 10:14 a.m. UTC
Implement operations to get and set flow-control link parameters.
Both is done by simply calling phylink_ethtool_{get,set}_pauseparam().
Fix whitespace in mtk_ethtool_ops while at it.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
---
 drivers/net/ethernet/mediatek/mtk_eth_soc.c | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

Comments

Michal Kubiak July 4, 2024, 11:09 a.m. UTC | #1
On Thu, Jul 04, 2024 at 11:14:55AM +0100, Daniel Golle wrote:
> Implement operations to get and set flow-control link parameters.
> Both is done by simply calling phylink_ethtool_{get,set}_pauseparam().
> Fix whitespace in mtk_ethtool_ops while at it.
> 
> Signed-off-by: Daniel Golle <daniel@makrotopia.org>
> ---
>  drivers/net/ethernet/mediatek/mtk_eth_soc.c | 18 +++++++++++++++++-
>  1 file changed, 17 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
> index 13d78d9b3197..fbf5f566fdc5 100644
> --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
> +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
> @@ -4464,6 +4464,20 @@ static int mtk_set_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd)
>  	return ret;
>  }
>  
> +static void mtk_get_pauseparam(struct net_device *dev, struct ethtool_pauseparam *pause)
> +{
> +	struct mtk_mac *mac = netdev_priv(dev);
> +
> +	phylink_ethtool_get_pauseparam(mac->phylink, pause);
> +}
> +
> +static int mtk_set_pauseparam(struct net_device *dev, struct ethtool_pauseparam *pause)
> +{
> +	struct mtk_mac *mac = netdev_priv(dev);
> +
> +	return phylink_ethtool_set_pauseparam(mac->phylink, pause);
> +}
> +
>  static u16 mtk_select_queue(struct net_device *dev, struct sk_buff *skb,
>  			    struct net_device *sb_dev)
>  {
> @@ -4492,8 +4506,10 @@ static const struct ethtool_ops mtk_ethtool_ops = {
>  	.get_strings		= mtk_get_strings,
>  	.get_sset_count		= mtk_get_sset_count,
>  	.get_ethtool_stats	= mtk_get_ethtool_stats,
> +	.get_pauseparam		= mtk_get_pauseparam,
> +	.set_pauseparam		= mtk_set_pauseparam,
>  	.get_rxnfc		= mtk_get_rxnfc,
> -	.set_rxnfc              = mtk_set_rxnfc,
> +	.set_rxnfc		= mtk_set_rxnfc,
>  };
>  
>  static const struct net_device_ops mtk_netdev_ops = {
> -- 
> 2.45.2
> 

The patch looks correct.

Thanks,
Reviewed-by: Michal Kubiak <michal.kubiak@intel.com>
Russell King (Oracle) July 4, 2024, 11:40 a.m. UTC | #2
On Thu, Jul 04, 2024 at 11:14:55AM +0100, Daniel Golle wrote:
> Implement operations to get and set flow-control link parameters.
> Both is done by simply calling phylink_ethtool_{get,set}_pauseparam().
> Fix whitespace in mtk_ethtool_ops while at it.
> 
> Signed-off-by: Daniel Golle <daniel@makrotopia.org>

Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>

Thanks!
Rui Salvaterra July 4, 2024, 5:51 p.m. UTC | #3
Hi, Daniel,


On Thu, 4 Jul 2024 at 11:14, Daniel Golle <daniel@makrotopia.org> wrote:
>
> Implement operations to get and set flow-control link parameters.
> Both is done by simply calling phylink_ethtool_{get,set}_pauseparam().
> Fix whitespace in mtk_ethtool_ops while at it.

[patch snipped]

Working flawlessly on my Redmi AC2100. This is thus

Tested-by: Rui Salvaterra <rsalvaterra@gmail.com>


Thanks,

Rui
patchwork-bot+netdevbpf@kernel.org July 6, 2024, 12:50 a.m. UTC | #4
Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Thu, 4 Jul 2024 11:14:55 +0100 you wrote:
> Implement operations to get and set flow-control link parameters.
> Both is done by simply calling phylink_ethtool_{get,set}_pauseparam().
> Fix whitespace in mtk_ethtool_ops while at it.
> 
> Signed-off-by: Daniel Golle <daniel@makrotopia.org>
> ---
>  drivers/net/ethernet/mediatek/mtk_eth_soc.c | 18 +++++++++++++++++-
>  1 file changed, 17 insertions(+), 1 deletion(-)

Here is the summary with links:
  - [net-next] net: ethernet: mtk_eth_soc: implement .{get,set}_pauseparam ethtool ops
    https://git.kernel.org/netdev/net-next/c/064fbc4e9b5a

You are awesome, thank you!
diff mbox series

Patch

diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
index 13d78d9b3197..fbf5f566fdc5 100644
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -4464,6 +4464,20 @@  static int mtk_set_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd)
 	return ret;
 }
 
+static void mtk_get_pauseparam(struct net_device *dev, struct ethtool_pauseparam *pause)
+{
+	struct mtk_mac *mac = netdev_priv(dev);
+
+	phylink_ethtool_get_pauseparam(mac->phylink, pause);
+}
+
+static int mtk_set_pauseparam(struct net_device *dev, struct ethtool_pauseparam *pause)
+{
+	struct mtk_mac *mac = netdev_priv(dev);
+
+	return phylink_ethtool_set_pauseparam(mac->phylink, pause);
+}
+
 static u16 mtk_select_queue(struct net_device *dev, struct sk_buff *skb,
 			    struct net_device *sb_dev)
 {
@@ -4492,8 +4506,10 @@  static const struct ethtool_ops mtk_ethtool_ops = {
 	.get_strings		= mtk_get_strings,
 	.get_sset_count		= mtk_get_sset_count,
 	.get_ethtool_stats	= mtk_get_ethtool_stats,
+	.get_pauseparam		= mtk_get_pauseparam,
+	.set_pauseparam		= mtk_set_pauseparam,
 	.get_rxnfc		= mtk_get_rxnfc,
-	.set_rxnfc              = mtk_set_rxnfc,
+	.set_rxnfc		= mtk_set_rxnfc,
 };
 
 static const struct net_device_ops mtk_netdev_ops = {