Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

netdevsim: move ethtool pause params in separate struct

This will help the refactoring in the next commit
when coalesce and ring settings are added.

Signed-off-by: Antonio Cardace <acardace@redhat.com>
Reviewed-by: Michal Kubecek <mkubecek@suse.cz>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Antonio Cardace and committed by
Jakub Kicinski
77f9591b 4ae21993

+13 -9
+8 -8
drivers/net/netdevsim/ethtool.c
··· 13 13 { 14 14 struct netdevsim *ns = netdev_priv(dev); 15 15 16 - if (ns->ethtool.report_stats_rx) 16 + if (ns->ethtool.pauseparam.report_stats_rx) 17 17 pause_stats->rx_pause_frames = 1; 18 - if (ns->ethtool.report_stats_tx) 18 + if (ns->ethtool.pauseparam.report_stats_tx) 19 19 pause_stats->tx_pause_frames = 2; 20 20 } 21 21 ··· 25 25 struct netdevsim *ns = netdev_priv(dev); 26 26 27 27 pause->autoneg = 0; /* We don't support ksettings, so can't pretend */ 28 - pause->rx_pause = ns->ethtool.rx; 29 - pause->tx_pause = ns->ethtool.tx; 28 + pause->rx_pause = ns->ethtool.pauseparam.rx; 29 + pause->tx_pause = ns->ethtool.pauseparam.tx; 30 30 } 31 31 32 32 static int ··· 37 37 if (pause->autoneg) 38 38 return -EINVAL; 39 39 40 - ns->ethtool.rx = pause->rx_pause; 41 - ns->ethtool.tx = pause->tx_pause; 40 + ns->ethtool.pauseparam.rx = pause->rx_pause; 41 + ns->ethtool.pauseparam.tx = pause->tx_pause; 42 42 return 0; 43 43 } 44 44 ··· 58 58 59 59 dir = debugfs_create_dir("pause", ethtool); 60 60 debugfs_create_bool("report_stats_rx", 0600, dir, 61 - &ns->ethtool.report_stats_rx); 61 + &ns->ethtool.pauseparam.report_stats_rx); 62 62 debugfs_create_bool("report_stats_tx", 0600, dir, 63 - &ns->ethtool.report_stats_tx); 63 + &ns->ethtool.pauseparam.report_stats_tx); 64 64 }
+5 -1
drivers/net/netdevsim/netdevsim.h
··· 51 51 u32 ok; 52 52 }; 53 53 54 - struct nsim_ethtool { 54 + struct nsim_ethtool_pauseparam { 55 55 bool rx; 56 56 bool tx; 57 57 bool report_stats_rx; 58 58 bool report_stats_tx; 59 + }; 60 + 61 + struct nsim_ethtool { 62 + struct nsim_ethtool_pauseparam pauseparam; 59 63 }; 60 64 61 65 struct netdevsim {