Commit a3748a9c authored by David S. Miller's avatar David S. Miller

Merge branch '10GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue

Jeff Kirsher says:

====================
10GbE Intel Wired LAN Driver Updates 2015-12-29

This series contains updates to ixgbe and ixgbevf.

William Dauchy provides a fix for ixgbevf that was implemented for ixgbe,
commit 5d6002b7 ("ixgbe: Fix handling of NAPI budget when multiple
queues are enabled per vector"). The issue was that the polling routine
would increase the budget for receive to at least 1 per queue if multiple
queues were present, which resulted in receive packets being processed
when the budget was 0.

Emil provides minor cleanups for ixgbevf, one being that we need to
check rx_itr_setting with == and not &, since it is not a mask.  Added
QSFP PHY support in ixgbe to allow for more accurate reporting of port
settings.  Fixed the max RSS limit for X550 which is 63, not 64.

Veola fixes ixgbe ethtool reporting of backplane type interfaces as
1000/10000baseT link modes, instead, report the media as KR, KX or KX4
based on the backplane interface present.

Mark cleans up redundancy in the setting of hw_enc_features that makes
it appear that X550 has more encapsulation features than other devices.
Also do not set NETIF_F_SG any longer since that is set by the
register_netdev() call.  Also fixed the X550EM_x revision check, which
needs to check a value, not just a bit.

Alex Duyck fixes additional bugs in ixgbe_clear_vf_vlans(), one being
that the mask was using a divide instead of a modulus, which resulted
in the mask bit being incorrectly set to 0 or 1 based on the value of
the VF being tested.  Alex also found that he was not consistent in
using the "word" argument as an offset or as a register offset, so
made the code consistently use word as the offset in the array.

v2: dropped patch 8 of the original series, as it was undoing a part of
    the fix Alex Duyck was doing in patch 9 of the original series.
    Dropped based on feedback from Emil (the author).
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 1ab8c11f ab3a3b7b
...@@ -317,7 +317,7 @@ enum ixgbe_ring_f_enum { ...@@ -317,7 +317,7 @@ enum ixgbe_ring_f_enum {
}; };
#define IXGBE_MAX_RSS_INDICES 16 #define IXGBE_MAX_RSS_INDICES 16
#define IXGBE_MAX_RSS_INDICES_X550 64 #define IXGBE_MAX_RSS_INDICES_X550 63
#define IXGBE_MAX_VMDQ_INDICES 64 #define IXGBE_MAX_VMDQ_INDICES 64
#define IXGBE_MAX_FDIR_INDICES 63 /* based on q_vector limit */ #define IXGBE_MAX_FDIR_INDICES 63 /* based on q_vector limit */
#define IXGBE_MAX_FCOE_INDICES 8 #define IXGBE_MAX_FCOE_INDICES 8
......
...@@ -151,6 +151,34 @@ static const char ixgbe_gstrings_test[][ETH_GSTRING_LEN] = { ...@@ -151,6 +151,34 @@ static const char ixgbe_gstrings_test[][ETH_GSTRING_LEN] = {
}; };
#define IXGBE_TEST_LEN sizeof(ixgbe_gstrings_test) / ETH_GSTRING_LEN #define IXGBE_TEST_LEN sizeof(ixgbe_gstrings_test) / ETH_GSTRING_LEN
/* currently supported speeds for 10G */
#define ADVRTSD_MSK_10G (SUPPORTED_10000baseT_Full | \
SUPPORTED_10000baseKX4_Full | \
SUPPORTED_10000baseKR_Full)
#define ixgbe_isbackplane(type) ((type) == ixgbe_media_type_backplane)
static u32 ixgbe_get_supported_10gtypes(struct ixgbe_hw *hw)
{
if (!ixgbe_isbackplane(hw->phy.media_type))
return SUPPORTED_10000baseT_Full;
switch (hw->device_id) {
case IXGBE_DEV_ID_82598:
case IXGBE_DEV_ID_82599_KX4:
case IXGBE_DEV_ID_82599_KX4_MEZZ:
case IXGBE_DEV_ID_X550EM_X_KX4:
return SUPPORTED_10000baseKX4_Full;
case IXGBE_DEV_ID_82598_BX:
case IXGBE_DEV_ID_82599_KR:
case IXGBE_DEV_ID_X550EM_X_KR:
return SUPPORTED_10000baseKR_Full;
default:
return SUPPORTED_10000baseKX4_Full |
SUPPORTED_10000baseKR_Full;
}
}
static int ixgbe_get_settings(struct net_device *netdev, static int ixgbe_get_settings(struct net_device *netdev,
struct ethtool_cmd *ecmd) struct ethtool_cmd *ecmd)
{ {
...@@ -165,29 +193,30 @@ static int ixgbe_get_settings(struct net_device *netdev, ...@@ -165,29 +193,30 @@ 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 |= ixgbe_get_supported_10gtypes(hw);
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)
ecmd->supported |= SUPPORTED_100baseT_Full; ecmd->supported |= ixgbe_isbackplane(hw->phy.media_type) ?
SUPPORTED_1000baseKX_Full :
SUPPORTED_1000baseT_Full;
/* default advertised speed if phy.autoneg_advertised isn't set */
ecmd->advertising = ecmd->supported;
/* set the advertised speeds */ /* set the advertised speeds */
if (hw->phy.autoneg_advertised) { if (hw->phy.autoneg_advertised) {
ecmd->advertising = 0;
if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_100_FULL) if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_100_FULL)
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 |= ecmd->supported & ADVRTSD_MSK_10G;
if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_1GB_FULL) if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_1GB_FULL) {
if (ecmd->supported & SUPPORTED_1000baseKX_Full)
ecmd->advertising |= ADVERTISED_1000baseKX_Full;
else
ecmd->advertising |= ADVERTISED_1000baseT_Full; ecmd->advertising |= ADVERTISED_1000baseT_Full;
}
} else { } else {
/* default modes in case phy.autoneg_advertised isn't set */
if (supported_link & IXGBE_LINK_SPEED_10GB_FULL)
ecmd->advertising |= ADVERTISED_10000baseT_Full;
if (supported_link & IXGBE_LINK_SPEED_1GB_FULL)
ecmd->advertising |= ADVERTISED_1000baseT_Full;
if (supported_link & IXGBE_LINK_SPEED_100_FULL)
ecmd->advertising |= ADVERTISED_100baseT_Full;
if (hw->phy.multispeed_fiber && !autoneg) { if (hw->phy.multispeed_fiber && !autoneg) {
if (supported_link & IXGBE_LINK_SPEED_10GB_FULL) if (supported_link & IXGBE_LINK_SPEED_10GB_FULL)
ecmd->advertising = ADVERTISED_10000baseT_Full; ecmd->advertising = ADVERTISED_10000baseT_Full;
...@@ -225,6 +254,10 @@ static int ixgbe_get_settings(struct net_device *netdev, ...@@ -225,6 +254,10 @@ static int ixgbe_get_settings(struct net_device *netdev,
case ixgbe_phy_sfp_avago: case ixgbe_phy_sfp_avago:
case ixgbe_phy_sfp_intel: case ixgbe_phy_sfp_intel:
case ixgbe_phy_sfp_unknown: case ixgbe_phy_sfp_unknown:
case ixgbe_phy_qsfp_passive_unknown:
case ixgbe_phy_qsfp_active_unknown:
case ixgbe_phy_qsfp_intel:
case ixgbe_phy_qsfp_unknown:
/* SFP+ devices, further checking needed */ /* SFP+ devices, further checking needed */
switch (adapter->hw.phy.sfp_type) { switch (adapter->hw.phy.sfp_type) {
case ixgbe_sfp_type_da_cu: case ixgbe_sfp_type_da_cu:
......
...@@ -9015,8 +9015,7 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -9015,8 +9015,7 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
netdev->vlan_features |= NETIF_F_IPV6_CSUM; netdev->vlan_features |= NETIF_F_IPV6_CSUM;
netdev->vlan_features |= NETIF_F_SG; netdev->vlan_features |= NETIF_F_SG;
netdev->hw_enc_features |= NETIF_F_SG | NETIF_F_IP_CSUM | netdev->hw_enc_features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM;
NETIF_F_IPV6_CSUM;
netdev->priv_flags |= IFF_UNICAST_FLT; netdev->priv_flags |= IFF_UNICAST_FLT;
netdev->priv_flags |= IFF_SUPP_NOFCS; netdev->priv_flags |= IFF_SUPP_NOFCS;
...@@ -9025,9 +9024,7 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -9025,9 +9024,7 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
switch (adapter->hw.mac.type) { switch (adapter->hw.mac.type) {
case ixgbe_mac_X550: case ixgbe_mac_X550:
case ixgbe_mac_X550EM_x: case ixgbe_mac_X550EM_x:
netdev->hw_enc_features |= NETIF_F_RXCSUM | netdev->hw_enc_features |= NETIF_F_RXCSUM;
NETIF_F_IP_CSUM |
NETIF_F_IPV6_CSUM;
break; break;
default: default:
break; break;
......
...@@ -593,11 +593,11 @@ static void ixgbe_clear_vf_vlans(struct ixgbe_adapter *adapter, u32 vf) ...@@ -593,11 +593,11 @@ static void ixgbe_clear_vf_vlans(struct ixgbe_adapter *adapter, u32 vf)
/* post increment loop, covers VLVF_ENTRIES - 1 to 0 */ /* post increment loop, covers VLVF_ENTRIES - 1 to 0 */
for (i = IXGBE_VLVF_ENTRIES; i--;) { for (i = IXGBE_VLVF_ENTRIES; i--;) {
u32 word = IXGBE_VLVFB(i * 2 + vf / 32);
u32 bits[2], vlvfb, vid, vfta, vlvf; u32 bits[2], vlvfb, vid, vfta, vlvf;
u32 mask = 1 << (vf / 32); u32 word = i * 2 + vf / 32;
u32 mask = 1 << (vf % 32);
vlvfb = IXGBE_READ_REG(hw, word); vlvfb = IXGBE_READ_REG(hw, IXGBE_VLVFB(word));
/* if our bit isn't set we can skip it */ /* if our bit isn't set we can skip it */
if (!(vlvfb & mask)) if (!(vlvfb & mask))
...@@ -608,7 +608,7 @@ static void ixgbe_clear_vf_vlans(struct ixgbe_adapter *adapter, u32 vf) ...@@ -608,7 +608,7 @@ static void ixgbe_clear_vf_vlans(struct ixgbe_adapter *adapter, u32 vf)
/* create 64b mask to chedk to see if we should clear VLVF */ /* create 64b mask to chedk to see if we should clear VLVF */
bits[word % 2] = vlvfb; bits[word % 2] = vlvfb;
bits[(word % 2) ^ 1] = IXGBE_READ_REG(hw, word ^ 1); bits[~word % 2] = IXGBE_READ_REG(hw, IXGBE_VLVFB(word ^ 1));
/* if promisc is enabled, PF will be present, leave VFTA */ /* if promisc is enabled, PF will be present, leave VFTA */
if (adapter->flags2 & IXGBE_FLAG2_VLAN_PROMISC) { if (adapter->flags2 & IXGBE_FLAG2_VLAN_PROMISC) {
......
...@@ -3520,7 +3520,7 @@ struct ixgbe_info { ...@@ -3520,7 +3520,7 @@ struct ixgbe_info {
#define IXGBE_FUSES0_GROUP(_i) (0x11158 + ((_i) * 4)) #define IXGBE_FUSES0_GROUP(_i) (0x11158 + ((_i) * 4))
#define IXGBE_FUSES0_300MHZ BIT(5) #define IXGBE_FUSES0_300MHZ BIT(5)
#define IXGBE_FUSES0_REV1 BIT(6) #define IXGBE_FUSES0_REV_MASK (3 << 6)
#define IXGBE_KRM_PORT_CAR_GEN_CTRL(P) ((P) ? 0x8010 : 0x4010) #define IXGBE_KRM_PORT_CAR_GEN_CTRL(P) ((P) ? 0x8010 : 0x4010)
#define IXGBE_KRM_LINK_CTRL_1(P) ((P) ? 0x820C : 0x420C) #define IXGBE_KRM_LINK_CTRL_1(P) ((P) ? 0x820C : 0x420C)
......
...@@ -1857,10 +1857,6 @@ static s32 ixgbe_enter_lplu_t_x550em(struct ixgbe_hw *hw) ...@@ -1857,10 +1857,6 @@ static s32 ixgbe_enter_lplu_t_x550em(struct ixgbe_hw *hw)
u32 save_autoneg; u32 save_autoneg;
bool link_up; bool link_up;
/* SW LPLU not required on later HW revisions. */
if (IXGBE_FUSES0_REV1 & IXGBE_READ_REG(hw, IXGBE_FUSES0_GROUP(0)))
return 0;
/* If blocked by MNG FW, then don't restart AN */ /* If blocked by MNG FW, then don't restart AN */
if (ixgbe_check_reset_blocked(hw)) if (ixgbe_check_reset_blocked(hw))
return 0; return 0;
...@@ -2000,8 +1996,9 @@ static s32 ixgbe_init_phy_ops_X550em(struct ixgbe_hw *hw) ...@@ -2000,8 +1996,9 @@ static s32 ixgbe_init_phy_ops_X550em(struct ixgbe_hw *hw)
ixgbe_setup_internal_phy_t_x550em; ixgbe_setup_internal_phy_t_x550em;
/* setup SW LPLU only for first revision */ /* setup SW LPLU only for first revision */
if (!(IXGBE_FUSES0_REV1 & IXGBE_READ_REG(hw, if (hw->mac.type == ixgbe_mac_X550EM_x &&
IXGBE_FUSES0_GROUP(0)))) !(IXGBE_READ_REG(hw, IXGBE_FUSES0_GROUP(0)) &
IXGBE_FUSES0_REV_MASK))
phy->ops.enter_lplu = ixgbe_enter_lplu_t_x550em; phy->ops.enter_lplu = ixgbe_enter_lplu_t_x550em;
phy->ops.handle_lasi = ixgbe_handle_lasi_ext_t_x550em; phy->ops.handle_lasi = ixgbe_handle_lasi_ext_t_x550em;
......
...@@ -1016,6 +1016,8 @@ static int ixgbevf_poll(struct napi_struct *napi, int budget) ...@@ -1016,6 +1016,8 @@ static int ixgbevf_poll(struct napi_struct *napi, int budget)
ixgbevf_for_each_ring(ring, q_vector->tx) ixgbevf_for_each_ring(ring, q_vector->tx)
clean_complete &= ixgbevf_clean_tx_irq(q_vector, ring); clean_complete &= ixgbevf_clean_tx_irq(q_vector, ring);
if (budget <= 0)
return budget;
#ifdef CONFIG_NET_RX_BUSY_POLL #ifdef CONFIG_NET_RX_BUSY_POLL
if (!ixgbevf_qv_lock_napi(q_vector)) if (!ixgbevf_qv_lock_napi(q_vector))
return budget; return budget;
...@@ -1045,7 +1047,7 @@ static int ixgbevf_poll(struct napi_struct *napi, int budget) ...@@ -1045,7 +1047,7 @@ static int ixgbevf_poll(struct napi_struct *napi, int budget)
return budget; return budget;
/* all work done, exit the polling mode */ /* all work done, exit the polling mode */
napi_complete_done(napi, work_done); napi_complete_done(napi, work_done);
if (adapter->rx_itr_setting & 1) if (adapter->rx_itr_setting == 1)
ixgbevf_set_itr(q_vector); ixgbevf_set_itr(q_vector);
if (!test_bit(__IXGBEVF_DOWN, &adapter->state) && if (!test_bit(__IXGBEVF_DOWN, &adapter->state) &&
!test_bit(__IXGBEVF_REMOVING, &adapter->state)) !test_bit(__IXGBEVF_REMOVING, &adapter->state))
...@@ -1248,9 +1250,10 @@ static void ixgbevf_set_itr(struct ixgbevf_q_vector *q_vector) ...@@ -1248,9 +1250,10 @@ static void ixgbevf_set_itr(struct ixgbevf_q_vector *q_vector)
new_itr = IXGBE_20K_ITR; new_itr = IXGBE_20K_ITR;
break; break;
case bulk_latency: case bulk_latency:
default:
new_itr = IXGBE_12K_ITR; new_itr = IXGBE_12K_ITR;
break; break;
default:
break;
} }
if (new_itr != q_vector->itr) { if (new_itr != q_vector->itr) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment