Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 454adb00 authored by Mark Rustad's avatar Mark Rustad Committed by Jeff Kirsher
Browse files

ixgbe: Add support for reporting 2.5G link speed



Now that we can do 2.5G link speed, we need to be able to report it.
Also change the nested triadic involved in creating the log message
to instead use a simpler switch statement to set a string pointer.

Signed-off-by: default avatarMark Rustad <mark.d.rustad@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 7e3f5c88
Loading
Loading
Loading
Loading
+7 −0
Original line number Original line Diff line number Diff line
@@ -166,6 +166,8 @@ static int ixgbe_get_settings(struct net_device *netdev,
	/* set the supported link speeds */
	/* set the supported link speeds */
	if (supported_link & IXGBE_LINK_SPEED_10GB_FULL)
	if (supported_link & IXGBE_LINK_SPEED_10GB_FULL)
		ecmd->supported |= SUPPORTED_10000baseT_Full;
		ecmd->supported |= SUPPORTED_10000baseT_Full;
	if (supported_link & IXGBE_LINK_SPEED_2_5GB_FULL)
		ecmd->supported |= SUPPORTED_2500baseX_Full;
	if (supported_link & IXGBE_LINK_SPEED_1GB_FULL)
	if (supported_link & IXGBE_LINK_SPEED_1GB_FULL)
		ecmd->supported |= SUPPORTED_1000baseT_Full;
		ecmd->supported |= SUPPORTED_1000baseT_Full;
	if (supported_link & IXGBE_LINK_SPEED_100_FULL)
	if (supported_link & IXGBE_LINK_SPEED_100_FULL)
@@ -177,6 +179,8 @@ static int ixgbe_get_settings(struct net_device *netdev,
			ecmd->advertising |= ADVERTISED_100baseT_Full;
			ecmd->advertising |= ADVERTISED_100baseT_Full;
		if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_10GB_FULL)
		if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_10GB_FULL)
			ecmd->advertising |= ADVERTISED_10000baseT_Full;
			ecmd->advertising |= ADVERTISED_10000baseT_Full;
		if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_2_5GB_FULL)
			ecmd->advertising |= ADVERTISED_2500baseX_Full;
		if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_1GB_FULL)
		if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_1GB_FULL)
			ecmd->advertising |= ADVERTISED_1000baseT_Full;
			ecmd->advertising |= ADVERTISED_1000baseT_Full;
	} else {
	} else {
@@ -286,6 +290,9 @@ static int ixgbe_get_settings(struct net_device *netdev,
		case IXGBE_LINK_SPEED_10GB_FULL:
		case IXGBE_LINK_SPEED_10GB_FULL:
			ethtool_cmd_speed_set(ecmd, SPEED_10000);
			ethtool_cmd_speed_set(ecmd, SPEED_10000);
			break;
			break;
		case IXGBE_LINK_SPEED_2_5GB_FULL:
			ethtool_cmd_speed_set(ecmd, SPEED_2500);
			break;
		case IXGBE_LINK_SPEED_1GB_FULL:
		case IXGBE_LINK_SPEED_1GB_FULL:
			ethtool_cmd_speed_set(ecmd, SPEED_1000);
			ethtool_cmd_speed_set(ecmd, SPEED_1000);
			break;
			break;
+19 −8
Original line number Original line Diff line number Diff line
@@ -6380,6 +6380,7 @@ static void ixgbe_watchdog_link_is_up(struct ixgbe_adapter *adapter)
	struct net_device *upper;
	struct net_device *upper;
	struct list_head *iter;
	struct list_head *iter;
	u32 link_speed = adapter->link_speed;
	u32 link_speed = adapter->link_speed;
	const char *speed_str;
	bool flow_rx, flow_tx;
	bool flow_rx, flow_tx;


	/* only continue if link was previously down */
	/* only continue if link was previously down */
@@ -6417,14 +6418,24 @@ static void ixgbe_watchdog_link_is_up(struct ixgbe_adapter *adapter)
	if (test_bit(__IXGBE_PTP_RUNNING, &adapter->state))
	if (test_bit(__IXGBE_PTP_RUNNING, &adapter->state))
		ixgbe_ptp_start_cyclecounter(adapter);
		ixgbe_ptp_start_cyclecounter(adapter);


	e_info(drv, "NIC Link is Up %s, Flow Control: %s\n",
	switch (link_speed) {
	       (link_speed == IXGBE_LINK_SPEED_10GB_FULL ?
	case IXGBE_LINK_SPEED_10GB_FULL:
	       "10 Gbps" :
		speed_str = "10 Gbps";
	       (link_speed == IXGBE_LINK_SPEED_1GB_FULL ?
		break;
	       "1 Gbps" :
	case IXGBE_LINK_SPEED_2_5GB_FULL:
	       (link_speed == IXGBE_LINK_SPEED_100_FULL ?
		speed_str = "2.5 Gbps";
	       "100 Mbps" :
		break;
	       "unknown speed"))),
	case IXGBE_LINK_SPEED_1GB_FULL:
		speed_str = "1 Gbps";
		break;
	case IXGBE_LINK_SPEED_100_FULL:
		speed_str = "100 Mbps";
		break;
	default:
		speed_str = "unknown speed";
		break;
	}
	e_info(drv, "NIC Link is Up %s, Flow Control: %s\n", speed_str,
	       ((flow_rx && flow_tx) ? "RX/TX" :
	       ((flow_rx && flow_tx) ? "RX/TX" :
	       (flow_rx ? "RX" :
	       (flow_rx ? "RX" :
	       (flow_tx ? "TX" : "None"))));
	       (flow_tx ? "TX" : "None"))));