lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <SJ0PR11MB5866248BE5B93F4AEB55EE77E5B32@SJ0PR11MB5866.namprd11.prod.outlook.com>
Date: Mon, 14 Apr 2025 14:01:25 +0000
From: "Loktionov, Aleksandr" <aleksandr.loktionov@...el.com>
To: Martyna Szapar-Mudlaw <martyna.szapar-mudlaw@...ux.intel.com>,
	"intel-wired-lan@...ts.osuosl.org" <intel-wired-lan@...ts.osuosl.org>
CC: "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: RE: [Intel-wired-lan] [PATCH iwl-next v2 2/2] ixgbe: add
 link_down_events statistic



> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@...osl.org> On Behalf Of
> Martyna Szapar-Mudlaw
> Sent: Monday, April 14, 2025 3:00 PM
> To: intel-wired-lan@...ts.osuosl.org
> Cc: netdev@...r.kernel.org; Martyna Szapar-Mudlaw <martyna.szapar-
> mudlaw@...ux.intel.com>
> Subject: [Intel-wired-lan] [PATCH iwl-next v2 2/2] ixgbe: add
> link_down_events statistic
> 
> Introduce a link_down_events counter to the ixgbe driver, incremented each
> time the link transitions from up to down.
> This counter can help diagnose issues related to link stability, such as port
> flapping or unexpected link drops.
> 
> The value is exposed via ethtool's get_link_ext_stats() interface.
> 
> Signed-off-by: Martyna Szapar-Mudlaw <martyna.szapar-
> mudlaw@...ux.intel.com>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@...el.com>
> ---
>  drivers/net/ethernet/intel/ixgbe/ixgbe.h         | 1 +
>  drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c | 9 +++++++++
>  drivers/net/ethernet/intel/ixgbe/ixgbe_main.c    | 2 ++
>  3 files changed, 12 insertions(+)
> 
> diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe.h
> b/drivers/net/ethernet/intel/ixgbe/ixgbe.h
> index e6a380d4929b..7a8b4b6053c7 100644
> --- a/drivers/net/ethernet/intel/ixgbe/ixgbe.h
> +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe.h
> @@ -743,6 +743,7 @@ struct ixgbe_adapter {
>  	bool link_up;
>  	unsigned long sfp_poll_time;
>  	unsigned long link_check_timeout;
> +	u32 link_down_events;
> 
>  	struct timer_list service_timer;
>  	struct work_struct service_task;
> diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
> b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
> index f03925c1f521..e2c474209114 100644
> --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
> +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
> @@ -992,6 +992,14 @@ static void ixgbe_get_regs(struct net_device
> *netdev,
>  	regs_buff[1144] = IXGBE_READ_REG(hw, IXGBE_SECRXSTAT);  }
> 
> +static void ixgbe_get_link_ext_stats(struct net_device *netdev,
> +				     struct ethtool_link_ext_stats *stats) {
> +	struct ixgbe_adapter *adapter = netdev_priv(netdev);
> +
> +	stats->link_down_events = adapter->link_down_events; }
> +
>  static int ixgbe_get_eeprom_len(struct net_device *netdev)  {
>  	struct ixgbe_adapter *adapter = netdev_priv(netdev); @@ -3602,6
> +3610,7 @@ static const struct ethtool_ops ixgbe_ethtool_ops = {
>  	.set_wol                = ixgbe_set_wol,
>  	.nway_reset             = ixgbe_nway_reset,
>  	.get_link               = ethtool_op_get_link,
> +	.get_link_ext_stats	= ixgbe_get_link_ext_stats,
>  	.get_eeprom_len         = ixgbe_get_eeprom_len,
>  	.get_eeprom             = ixgbe_get_eeprom,
>  	.set_eeprom             = ixgbe_set_eeprom,
> diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
> b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
> index 467f81239e12..cb5c782817fa 100644
> --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
> +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
> @@ -7986,6 +7986,8 @@ static void ixgbe_watchdog_link_is_down(struct
> ixgbe_adapter *adapter)
>  	if (!netif_carrier_ok(netdev))
>  		return;
> 
> +	adapter->link_down_events++;
> +
>  	/* poll for SFP+ cable when link is down */
>  	if (ixgbe_is_sfp(hw) && hw->mac.type == ixgbe_mac_82598EB)
>  		adapter->flags2 |= IXGBE_FLAG2_SEARCH_FOR_SFP;
> --
> 2.47.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ