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

Commit f9161585 authored by David S. Miller's avatar David S. Miller
Browse files


Jeff Kirsher says:

====================
Intel Wired LAN Driver Updates 2015-05-04

This series contains updates to igb, e100, e1000e and ixgbe.

Todd cleans up igb_enable_mas() since it should only be called for the
82575 silicon and has no clear return, so modify the function to void.

Jean Sacren found upon inspection that 'err' did not need to be
initialized, since it is immediately overwritten.

Alex Duyck provides two patches for e1000e, the first cleans up the
handling VLAN_HLEN as a part of max frame size.  Fixes the issue:
c751a3d5 ("e1000e: Correctly include VLAN_HLEN when changing
interface MTU").  The second fixes an issue where the driver was not
allowing jumbo frames to be enabled when CRC stripping was disabled,
however it was allowing CRC stripping to be disabled while jumbo frames
were enabled.

Jeff (me) fixes a warning found on PPC where the use of do_div() needed
to use u64 arg and not s64.

Mark provides three ixgbe patches, first to fix the Intel On-chip System
Fabric (IOSF) Sideband message interfaces, to serialize access using both
PHY bits in the SWFW_SEMAPHORE register.  Then fixes how semaphore bits
were released, since they should be released in reverse of the order that
they were taken.  Lastly updates ixgbe to use a signed type to hold
error codes, since error codes are negative, so consistently use signed
types when handling them.

v2: dropped the previous #6-#8 patches by Hiroshi Shimanoto based on
    feedback from Or Gerlitz (and David Miller) that it appears there
    needs to be further discussion on how this gets implemented.
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents c373dac5 a1e869de
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -874,7 +874,7 @@ static int e100_exec_cb(struct nic *nic, struct sk_buff *skb,
{
{
	struct cb *cb;
	struct cb *cb;
	unsigned long flags;
	unsigned long flags;
	int err = 0;
	int err;


	spin_lock_irqsave(&nic->cb_lock, flags);
	spin_lock_irqsave(&nic->cb_lock, flags);


+1 −1
Original line number Original line Diff line number Diff line
@@ -2010,7 +2010,7 @@ const struct e1000_info e1000_82573_info = {
	.flags2			= FLAG2_DISABLE_ASPM_L1
	.flags2			= FLAG2_DISABLE_ASPM_L1
				  | FLAG2_DISABLE_ASPM_L0S,
				  | FLAG2_DISABLE_ASPM_L0S,
	.pba			= 20,
	.pba			= 20,
	.max_hw_frame_size	= ETH_FRAME_LEN + ETH_FCS_LEN,
	.max_hw_frame_size	= VLAN_ETH_FRAME_LEN + ETH_FCS_LEN,
	.get_variants		= e1000_get_variants_82571,
	.get_variants		= e1000_get_variants_82571,
	.mac_ops		= &e82571_mac_ops,
	.mac_ops		= &e82571_mac_ops,
	.phy_ops		= &e82_phy_ops_m88,
	.phy_ops		= &e82_phy_ops_m88,
+12 −11
Original line number Original line Diff line number Diff line
@@ -1015,7 +1015,7 @@ static s32 e1000_platform_pm_pch_lpt(struct e1000_hw *hw, bool link)
		u16 max_snoop, max_nosnoop;
		u16 max_snoop, max_nosnoop;
		u16 max_ltr_enc;	/* max LTR latency encoded */
		u16 max_ltr_enc;	/* max LTR latency encoded */
		s64 lat_ns;	/* latency (ns) */
		s64 lat_ns;	/* latency (ns) */
		s64 value;
		u64 value;
		u32 rxa;
		u32 rxa;


		if (!hw->adapter->max_frame_size) {
		if (!hw->adapter->max_frame_size) {
@@ -1042,12 +1042,13 @@ static s32 e1000_platform_pm_pch_lpt(struct e1000_hw *hw, bool link)
		 */
		 */
		lat_ns = ((s64)rxa * 1024 -
		lat_ns = ((s64)rxa * 1024 -
			  (2 * (s64)hw->adapter->max_frame_size)) * 8 * 1000;
			  (2 * (s64)hw->adapter->max_frame_size)) * 8 * 1000;
		if (lat_ns < 0)
		if (lat_ns < 0) {
			lat_ns = 0;
			value = 0;
		else
		} else {
			do_div(lat_ns, speed);

			value = lat_ns;
			value = lat_ns;
			do_div(value, speed);
		}

		while (value > PCI_LTR_VALUE_MASK) {
		while (value > PCI_LTR_VALUE_MASK) {
			scale++;
			scale++;
			value = DIV_ROUND_UP(value, (1 << 5));
			value = DIV_ROUND_UP(value, (1 << 5));
@@ -1563,7 +1564,7 @@ static s32 e1000_get_variants_ich8lan(struct e1000_adapter *adapter)
	    ((adapter->hw.mac.type >= e1000_pch2lan) &&
	    ((adapter->hw.mac.type >= e1000_pch2lan) &&
	     (!(er32(CTRL_EXT) & E1000_CTRL_EXT_LSECCK)))) {
	     (!(er32(CTRL_EXT) & E1000_CTRL_EXT_LSECCK)))) {
		adapter->flags &= ~FLAG_HAS_JUMBO_FRAMES;
		adapter->flags &= ~FLAG_HAS_JUMBO_FRAMES;
		adapter->max_hw_frame_size = ETH_FRAME_LEN + ETH_FCS_LEN;
		adapter->max_hw_frame_size = VLAN_ETH_FRAME_LEN + ETH_FCS_LEN;


		hw->mac.ops.blink_led = NULL;
		hw->mac.ops.blink_led = NULL;
	}
	}
@@ -5681,7 +5682,7 @@ const struct e1000_info e1000_ich8_info = {
				  | FLAG_HAS_FLASH
				  | FLAG_HAS_FLASH
				  | FLAG_APME_IN_WUC,
				  | FLAG_APME_IN_WUC,
	.pba			= 8,
	.pba			= 8,
	.max_hw_frame_size	= ETH_FRAME_LEN + ETH_FCS_LEN,
	.max_hw_frame_size	= VLAN_ETH_FRAME_LEN + ETH_FCS_LEN,
	.get_variants		= e1000_get_variants_ich8lan,
	.get_variants		= e1000_get_variants_ich8lan,
	.mac_ops		= &ich8_mac_ops,
	.mac_ops		= &ich8_mac_ops,
	.phy_ops		= &ich8_phy_ops,
	.phy_ops		= &ich8_phy_ops,
@@ -5754,7 +5755,7 @@ const struct e1000_info e1000_pch2_info = {
	.flags2			= FLAG2_HAS_PHY_STATS
	.flags2			= FLAG2_HAS_PHY_STATS
				  | FLAG2_HAS_EEE,
				  | FLAG2_HAS_EEE,
	.pba			= 26,
	.pba			= 26,
	.max_hw_frame_size	= 9018,
	.max_hw_frame_size	= 9022,
	.get_variants		= e1000_get_variants_ich8lan,
	.get_variants		= e1000_get_variants_ich8lan,
	.mac_ops		= &ich8_mac_ops,
	.mac_ops		= &ich8_mac_ops,
	.phy_ops		= &ich8_phy_ops,
	.phy_ops		= &ich8_phy_ops,
@@ -5774,7 +5775,7 @@ const struct e1000_info e1000_pch_lpt_info = {
	.flags2			= FLAG2_HAS_PHY_STATS
	.flags2			= FLAG2_HAS_PHY_STATS
				  | FLAG2_HAS_EEE,
				  | FLAG2_HAS_EEE,
	.pba			= 26,
	.pba			= 26,
	.max_hw_frame_size	= 9018,
	.max_hw_frame_size	= 9022,
	.get_variants		= e1000_get_variants_ich8lan,
	.get_variants		= e1000_get_variants_ich8lan,
	.mac_ops		= &ich8_mac_ops,
	.mac_ops		= &ich8_mac_ops,
	.phy_ops		= &ich8_phy_ops,
	.phy_ops		= &ich8_phy_ops,
@@ -5794,7 +5795,7 @@ const struct e1000_info e1000_pch_spt_info = {
	.flags2			= FLAG2_HAS_PHY_STATS
	.flags2			= FLAG2_HAS_PHY_STATS
				  | FLAG2_HAS_EEE,
				  | FLAG2_HAS_EEE,
	.pba			= 26,
	.pba			= 26,
	.max_hw_frame_size	= 9018,
	.max_hw_frame_size	= 9022,
	.get_variants		= e1000_get_variants_ich8lan,
	.get_variants		= e1000_get_variants_ich8lan,
	.mac_ops		= &ich8_mac_ops,
	.mac_ops		= &ich8_mac_ops,
	.phy_ops		= &ich8_phy_ops,
	.phy_ops		= &ich8_phy_ops,
+22 −10
Original line number Original line Diff line number Diff line
@@ -3807,7 +3807,7 @@ void e1000e_reset(struct e1000_adapter *adapter)
	/* reset Packet Buffer Allocation to default */
	/* reset Packet Buffer Allocation to default */
	ew32(PBA, pba);
	ew32(PBA, pba);


	if (adapter->max_frame_size > ETH_FRAME_LEN + ETH_FCS_LEN) {
	if (adapter->max_frame_size > (VLAN_ETH_FRAME_LEN + ETH_FCS_LEN)) {
		/* To maintain wire speed transmits, the Tx FIFO should be
		/* To maintain wire speed transmits, the Tx FIFO should be
		 * large enough to accommodate two full transmit packets,
		 * large enough to accommodate two full transmit packets,
		 * rounded up to the next 1KB and expressed in KB.  Likewise,
		 * rounded up to the next 1KB and expressed in KB.  Likewise,
@@ -4196,9 +4196,9 @@ static int e1000_sw_init(struct e1000_adapter *adapter)
{
{
	struct net_device *netdev = adapter->netdev;
	struct net_device *netdev = adapter->netdev;


	adapter->rx_buffer_len = ETH_FRAME_LEN + VLAN_HLEN + ETH_FCS_LEN;
	adapter->rx_buffer_len = VLAN_ETH_FRAME_LEN + ETH_FCS_LEN;
	adapter->rx_ps_bsize0 = 128;
	adapter->rx_ps_bsize0 = 128;
	adapter->max_frame_size = netdev->mtu + ETH_HLEN + ETH_FCS_LEN;
	adapter->max_frame_size = netdev->mtu + VLAN_ETH_HLEN + ETH_FCS_LEN;
	adapter->min_frame_size = ETH_ZLEN + ETH_FCS_LEN;
	adapter->min_frame_size = ETH_ZLEN + ETH_FCS_LEN;
	adapter->tx_ring_count = E1000_DEFAULT_TXD;
	adapter->tx_ring_count = E1000_DEFAULT_TXD;
	adapter->rx_ring_count = E1000_DEFAULT_RXD;
	adapter->rx_ring_count = E1000_DEFAULT_RXD;
@@ -5781,17 +5781,17 @@ struct rtnl_link_stats64 *e1000e_get_stats64(struct net_device *netdev,
static int e1000_change_mtu(struct net_device *netdev, int new_mtu)
static int e1000_change_mtu(struct net_device *netdev, int new_mtu)
{
{
	struct e1000_adapter *adapter = netdev_priv(netdev);
	struct e1000_adapter *adapter = netdev_priv(netdev);
	int max_frame = new_mtu + VLAN_HLEN + ETH_HLEN + ETH_FCS_LEN;
	int max_frame = new_mtu + VLAN_ETH_HLEN + ETH_FCS_LEN;


	/* Jumbo frame support */
	/* Jumbo frame support */
	if ((max_frame > ETH_FRAME_LEN + ETH_FCS_LEN) &&
	if ((max_frame > (VLAN_ETH_FRAME_LEN + ETH_FCS_LEN)) &&
	    !(adapter->flags & FLAG_HAS_JUMBO_FRAMES)) {
	    !(adapter->flags & FLAG_HAS_JUMBO_FRAMES)) {
		e_err("Jumbo Frames not supported.\n");
		e_err("Jumbo Frames not supported.\n");
		return -EINVAL;
		return -EINVAL;
	}
	}


	/* Supported frame sizes */
	/* Supported frame sizes */
	if ((new_mtu < ETH_ZLEN + ETH_FCS_LEN + VLAN_HLEN) ||
	if ((new_mtu < (VLAN_ETH_ZLEN + ETH_FCS_LEN)) ||
	    (max_frame > adapter->max_hw_frame_size)) {
	    (max_frame > adapter->max_hw_frame_size)) {
		e_err("Unsupported MTU setting\n");
		e_err("Unsupported MTU setting\n");
		return -EINVAL;
		return -EINVAL;
@@ -5831,10 +5831,8 @@ static int e1000_change_mtu(struct net_device *netdev, int new_mtu)
		adapter->rx_buffer_len = 4096;
		adapter->rx_buffer_len = 4096;


	/* adjust allocation if LPE protects us, and we aren't using SBP */
	/* adjust allocation if LPE protects us, and we aren't using SBP */
	if ((max_frame == ETH_FRAME_LEN + ETH_FCS_LEN) ||
	if (max_frame <= (VLAN_ETH_FRAME_LEN + ETH_FCS_LEN))
	    (max_frame == ETH_FRAME_LEN + VLAN_HLEN + ETH_FCS_LEN))
		adapter->rx_buffer_len = VLAN_ETH_FRAME_LEN + ETH_FCS_LEN;
		adapter->rx_buffer_len = ETH_FRAME_LEN + VLAN_HLEN
		    + ETH_FCS_LEN;


	if (netif_running(netdev))
	if (netif_running(netdev))
		e1000e_up(adapter);
		e1000e_up(adapter);
@@ -6678,6 +6676,19 @@ static void e1000_eeprom_checks(struct e1000_adapter *adapter)
	}
	}
}
}


static netdev_features_t e1000_fix_features(struct net_device *netdev,
					    netdev_features_t features)
{
	struct e1000_adapter *adapter = netdev_priv(netdev);
	struct e1000_hw *hw = &adapter->hw;

	/* Jumbo frame workaround on 82579 and newer requires CRC be stripped */
	if ((hw->mac.type >= e1000_pch2lan) && (netdev->mtu > ETH_DATA_LEN))
		features &= ~NETIF_F_RXFCS;

	return features;
}

static int e1000_set_features(struct net_device *netdev,
static int e1000_set_features(struct net_device *netdev,
			      netdev_features_t features)
			      netdev_features_t features)
{
{
@@ -6734,6 +6745,7 @@ static const struct net_device_ops e1000e_netdev_ops = {
	.ndo_poll_controller	= e1000_netpoll,
	.ndo_poll_controller	= e1000_netpoll,
#endif
#endif
	.ndo_set_features = e1000_set_features,
	.ndo_set_features = e1000_set_features,
	.ndo_fix_features = e1000_fix_features,
};
};


/**
/**
+7 −20
Original line number Original line Diff line number Diff line
@@ -1834,31 +1834,19 @@ void igb_reinit_locked(struct igb_adapter *adapter)
 *
 *
 * @adapter: adapter struct
 * @adapter: adapter struct
 **/
 **/
static s32 igb_enable_mas(struct igb_adapter *adapter)
static void igb_enable_mas(struct igb_adapter *adapter)
{
{
	struct e1000_hw *hw = &adapter->hw;
	struct e1000_hw *hw = &adapter->hw;
	u32 connsw;
	u32 connsw = rd32(E1000_CONNSW);
	s32 ret_val = 0;

	connsw = rd32(E1000_CONNSW);
	if (!(hw->phy.media_type == e1000_media_type_copper))
		return ret_val;


	/* configure for SerDes media detect */
	/* configure for SerDes media detect */
	if (!(connsw & E1000_CONNSW_SERDESD)) {
	if ((hw->phy.media_type == e1000_media_type_copper) &&
	    (!(connsw & E1000_CONNSW_SERDESD))) {
		connsw |= E1000_CONNSW_ENRGSRC;
		connsw |= E1000_CONNSW_ENRGSRC;
		connsw |= E1000_CONNSW_AUTOSENSE_EN;
		connsw |= E1000_CONNSW_AUTOSENSE_EN;
		wr32(E1000_CONNSW, connsw);
		wr32(E1000_CONNSW, connsw);
		wrfl();
		wrfl();
	} else if (connsw & E1000_CONNSW_SERDESD) {
		/* already SerDes, no need to enable anything */
		return ret_val;
	} else {
		netdev_info(adapter->netdev,
			"MAS: Unable to configure feature, disabling..\n");
		adapter->flags &= ~IGB_FLAG_MAS_ENABLE;
	}
	}
	return ret_val;
}
}


void igb_reset(struct igb_adapter *adapter)
void igb_reset(struct igb_adapter *adapter)
@@ -1978,10 +1966,9 @@ void igb_reset(struct igb_adapter *adapter)
		adapter->ei.get_invariants(hw);
		adapter->ei.get_invariants(hw);
		adapter->flags &= ~IGB_FLAG_MEDIA_RESET;
		adapter->flags &= ~IGB_FLAG_MEDIA_RESET;
	}
	}
	if (adapter->flags & IGB_FLAG_MAS_ENABLE) {
	if ((mac->type == e1000_82575) &&
		if (igb_enable_mas(adapter))
	    (adapter->flags & IGB_FLAG_MAS_ENABLE)) {
			dev_err(&pdev->dev,
		igb_enable_mas(adapter);
				"Error enabling Media Auto Sense\n");
	}
	}
	if (hw->mac.ops.init_hw(hw))
	if (hw->mac.ops.init_hw(hw))
		dev_err(&pdev->dev, "Hardware Error\n");
		dev_err(&pdev->dev, "Hardware Error\n");
Loading