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>] [day] [month] [year] [list]
Message-ID: <op.vwqu5trx6ywr33@esapekka-pc.rad1>
Date:	Wed, 8 Jun 2011 09:33:19 +0300
From:	Esa-Pekka Pyokkimies <esa-pekka.pyokkimies@...nesoft.com>
To:	<netdev@...r.kernel.org>
Subject: [PATCH] ixgbe: Report PAUSE flags to ethtool

Hello!

I noticed that ixgbe driver doesn't report SUPPORTED_Pause and
ADVERTISED_Pause flags to ethtool. This means that ethtool
always reports:
	Supported pause frame use: No
	Advertised pause frame use: No
I added reporting for capabilities and advertising.
I tested it with our ixgbe card and latest ethtool
   from git repo. I also need to add capability to
change advertising parameters with "ethtool -s advertise %x",
but will send in a different patch if this patch looks ok.

Signed-off-by: Esa-Pekka Pyokkimies <esa-pekka.pyokkimies@...nesoft.com>
---
diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c
b/drivers/net/ixgbe/ixgbe_ethtool.c
index cb1555b..6005116 100644
--- a/drivers/net/ixgbe/ixgbe_ethtool.c
+++ b/drivers/net/ixgbe/ixgbe_ethtool.c
@@ -150,6 +150,7 @@ static int ixgbe_get_settings(struct net_device
*netdev,
    	bool link_up;

    	ecmd->supported = SUPPORTED_10000baseT_Full;
+	ecmd->supported |= SUPPORTED_Pause;
    	ecmd->autoneg = AUTONEG_ENABLE;
    	ecmd->transceiver = XCVR_EXTERNAL;
    	if ((hw->phy.media_type == ixgbe_media_type_copper) ||
@@ -231,6 +232,21 @@ static int ixgbe_get_settings(struct net_device
*netdev,
    		ecmd->autoneg = AUTONEG_DISABLE;
    	}

+	if (hw->fc.current_mode == ixgbe_fc_full) {
+		ecmd->advertising |= ADVERTISED_Pause;
+	} else if (hw->fc.current_mode == ixgbe_fc_rx_pause) {
+		ecmd->advertising |= ADVERTISED_Pause;
+		ecmd->advertising |= ADVERTISED_Asym_Pause;
+	} else if (hw->fc.current_mode == ixgbe_fc_tx_pause) {
+		ecmd->advertising |= ADVERTISED_Asym_Pause;
+	} else if (hw->fc.current_mode == ixgbe_fc_none) {
+		/* Correctly initialized */
+	} else if (hw->fc.current_mode == ixgbe_fc_pfc) {
+		/* Ethtool doesn't know about this mode */
+	} else {
+		/* Future modes */
+	}
+
    	/* Get PHY type */
    	switch (adapter->hw.phy.type) {
    	case ixgbe_phy_tn:


-- 
Using Opera's revolutionary email client: http://www.opera.com/mail/
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ