Commit 573be693 authored by David S. Miller's avatar David S. Miller

Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next

Jeff Kirsher says:

====================
Intel Wired LAN Driver Updates

This series contains updates to ixgbe, ixgbevf, e1000e, igb and i40e.

Jacob converts the ixgbe low_water into an array which allows the
algorithm to output different values for different TCs and we can
distinguish between them.  Removes vlan_filter_disable() and
vlan_filter_enable() in ixgbe so that we can do the work directly in
set_rx_mode().  Changes the setting of multicast filters only when
the interface is not in promiscuous mode for multicast packets in
ixgbe.  Improves MAC filter handling by adding mac_table API based
on work done for igb, which includes functions to add/delete MAC
filters.

Mark changes register reads in ixgbe to an out-of-line function since
register reads are slow.

Emil provides a ixgbevf patch to update the driver description since
it supports more than just 82599 parts now.

David provides several cleanup patches for e1000e which resolve some
checkpatch issues as well as changing occurrences of returning 0 or 1 in
bool functions to returning true false or true.

Carolyn provides several cleanup patches for igb which fix checkpatch
warnings.

Mitch provides a fix for i40evf where the driver would correctly allow
the virtual function link state to be controlled by 'ip set link', but
would not report it correctly back.  This is fixed by filling out
the appropriate field in the VF info struct.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 2ebb1582 84ca55a0
...@@ -265,10 +265,10 @@ struct e1000_adapter { ...@@ -265,10 +265,10 @@ struct e1000_adapter {
u32 tx_hwtstamp_timeouts; u32 tx_hwtstamp_timeouts;
/* Rx */ /* Rx */
bool (*clean_rx) (struct e1000_ring *ring, int *work_done, bool (*clean_rx)(struct e1000_ring *ring, int *work_done,
int work_to_do) ____cacheline_aligned_in_smp; int work_to_do) ____cacheline_aligned_in_smp;
void (*alloc_rx_buf) (struct e1000_ring *ring, int cleaned_count, void (*alloc_rx_buf)(struct e1000_ring *ring, int cleaned_count,
gfp_t gfp); gfp_t gfp);
struct e1000_ring *rx_ring; struct e1000_ring *rx_ring;
u32 rx_int_delay; u32 rx_int_delay;
......
...@@ -169,6 +169,7 @@ static int e1000_get_settings(struct net_device *netdev, ...@@ -169,6 +169,7 @@ static int e1000_get_settings(struct net_device *netdev,
} }
} else if (!pm_runtime_suspended(netdev->dev.parent)) { } else if (!pm_runtime_suspended(netdev->dev.parent)) {
u32 status = er32(STATUS); u32 status = er32(STATUS);
if (status & E1000_STATUS_LU) { if (status & E1000_STATUS_LU) {
if (status & E1000_STATUS_SPEED_1000) if (status & E1000_STATUS_SPEED_1000)
speed = SPEED_1000; speed = SPEED_1000;
...@@ -783,25 +784,26 @@ static bool reg_pattern_test(struct e1000_adapter *adapter, u64 *data, ...@@ -783,25 +784,26 @@ static bool reg_pattern_test(struct e1000_adapter *adapter, u64 *data,
reg + (offset << 2), val, reg + (offset << 2), val,
(test[pat] & write & mask)); (test[pat] & write & mask));
*data = reg; *data = reg;
return 1; return true;
} }
} }
return 0; return false;
} }
static bool reg_set_and_check(struct e1000_adapter *adapter, u64 *data, static bool reg_set_and_check(struct e1000_adapter *adapter, u64 *data,
int reg, u32 mask, u32 write) int reg, u32 mask, u32 write)
{ {
u32 val; u32 val;
__ew32(&adapter->hw, reg, write & mask); __ew32(&adapter->hw, reg, write & mask);
val = __er32(&adapter->hw, reg); val = __er32(&adapter->hw, reg);
if ((write & mask) != (val & mask)) { if ((write & mask) != (val & mask)) {
e_err("set/check test failed (reg 0x%05X): got 0x%08X expected 0x%08X\n", e_err("set/check test failed (reg 0x%05X): got 0x%08X expected 0x%08X\n",
reg, (val & mask), (write & mask)); reg, (val & mask), (write & mask));
*data = reg; *data = reg;
return 1; return true;
} }
return 0; return false;
} }
#define REG_PATTERN_TEST_ARRAY(reg, offset, mask, write) \ #define REG_PATTERN_TEST_ARRAY(reg, offset, mask, write) \
...@@ -1717,6 +1719,7 @@ static int e1000_link_test(struct e1000_adapter *adapter, u64 *data) ...@@ -1717,6 +1719,7 @@ static int e1000_link_test(struct e1000_adapter *adapter, u64 *data)
*data = 0; *data = 0;
if (hw->phy.media_type == e1000_media_type_internal_serdes) { if (hw->phy.media_type == e1000_media_type_internal_serdes) {
int i = 0; int i = 0;
hw->mac.serdes_has_link = false; hw->mac.serdes_has_link = false;
/* On some blade server designs, link establishment /* On some blade server designs, link establishment
......
...@@ -1320,6 +1320,7 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw) ...@@ -1320,6 +1320,7 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw)
*/ */
if ((hw->mac.type == e1000_pch2lan) && link) { if ((hw->mac.type == e1000_pch2lan) && link) {
u32 reg; u32 reg;
reg = er32(STATUS); reg = er32(STATUS);
if (!(reg & (E1000_STATUS_FD | E1000_STATUS_SPEED_MASK))) { if (!(reg & (E1000_STATUS_FD | E1000_STATUS_SPEED_MASK))) {
reg = er32(TIPG); reg = er32(TIPG);
......
...@@ -599,6 +599,7 @@ static void e1000e_update_rdt_wa(struct e1000_ring *rx_ring, unsigned int i) ...@@ -599,6 +599,7 @@ static void e1000e_update_rdt_wa(struct e1000_ring *rx_ring, unsigned int i)
if (unlikely(!ret_val && (i != readl(rx_ring->tail)))) { if (unlikely(!ret_val && (i != readl(rx_ring->tail)))) {
u32 rctl = er32(RCTL); u32 rctl = er32(RCTL);
ew32(RCTL, rctl & ~E1000_RCTL_EN); ew32(RCTL, rctl & ~E1000_RCTL_EN);
e_err("ME firmware caused invalid RDT - resetting\n"); e_err("ME firmware caused invalid RDT - resetting\n");
schedule_work(&adapter->reset_task); schedule_work(&adapter->reset_task);
...@@ -615,6 +616,7 @@ static void e1000e_update_tdt_wa(struct e1000_ring *tx_ring, unsigned int i) ...@@ -615,6 +616,7 @@ static void e1000e_update_tdt_wa(struct e1000_ring *tx_ring, unsigned int i)
if (unlikely(!ret_val && (i != readl(tx_ring->tail)))) { if (unlikely(!ret_val && (i != readl(tx_ring->tail)))) {
u32 tctl = er32(TCTL); u32 tctl = er32(TCTL);
ew32(TCTL, tctl & ~E1000_TCTL_EN); ew32(TCTL, tctl & ~E1000_TCTL_EN);
e_err("ME firmware caused invalid TDT - resetting\n"); e_err("ME firmware caused invalid TDT - resetting\n");
schedule_work(&adapter->reset_task); schedule_work(&adapter->reset_task);
...@@ -1198,6 +1200,7 @@ static bool e1000_clean_tx_irq(struct e1000_ring *tx_ring) ...@@ -1198,6 +1200,7 @@ static bool e1000_clean_tx_irq(struct e1000_ring *tx_ring)
while ((eop_desc->upper.data & cpu_to_le32(E1000_TXD_STAT_DD)) && while ((eop_desc->upper.data & cpu_to_le32(E1000_TXD_STAT_DD)) &&
(count < tx_ring->count)) { (count < tx_ring->count)) {
bool cleaned = false; bool cleaned = false;
rmb(); /* read buffer_info after eop_desc */ rmb(); /* read buffer_info after eop_desc */
for (; !cleaned; count++) { for (; !cleaned; count++) {
tx_desc = E1000_TX_DESC(*tx_ring, i); tx_desc = E1000_TX_DESC(*tx_ring, i);
...@@ -1753,6 +1756,7 @@ static irqreturn_t e1000_intr_msi(int __always_unused irq, void *data) ...@@ -1753,6 +1756,7 @@ static irqreturn_t e1000_intr_msi(int __always_unused irq, void *data)
adapter->flags & FLAG_RX_NEEDS_RESTART) { adapter->flags & FLAG_RX_NEEDS_RESTART) {
/* disable receives */ /* disable receives */
u32 rctl = er32(RCTL); u32 rctl = er32(RCTL);
ew32(RCTL, rctl & ~E1000_RCTL_EN); ew32(RCTL, rctl & ~E1000_RCTL_EN);
adapter->flags |= FLAG_RESTART_NOW; adapter->flags |= FLAG_RESTART_NOW;
} }
...@@ -1960,6 +1964,7 @@ static void e1000_configure_msix(struct e1000_adapter *adapter) ...@@ -1960,6 +1964,7 @@ static void e1000_configure_msix(struct e1000_adapter *adapter)
/* Workaround issue with spurious interrupts on 82574 in MSI-X mode */ /* Workaround issue with spurious interrupts on 82574 in MSI-X mode */
if (hw->mac.type == e1000_82574) { if (hw->mac.type == e1000_82574) {
u32 rfctl = er32(RFCTL); u32 rfctl = er32(RFCTL);
rfctl |= E1000_RFCTL_ACK_DIS; rfctl |= E1000_RFCTL_ACK_DIS;
ew32(RFCTL, rfctl); ew32(RFCTL, rfctl);
} }
...@@ -2204,6 +2209,7 @@ static void e1000_irq_disable(struct e1000_adapter *adapter) ...@@ -2204,6 +2209,7 @@ static void e1000_irq_disable(struct e1000_adapter *adapter)
if (adapter->msix_entries) { if (adapter->msix_entries) {
int i; int i;
for (i = 0; i < adapter->num_vectors; i++) for (i = 0; i < adapter->num_vectors; i++)
synchronize_irq(adapter->msix_entries[i].vector); synchronize_irq(adapter->msix_entries[i].vector);
} else { } else {
...@@ -2921,6 +2927,7 @@ static void e1000_configure_tx(struct e1000_adapter *adapter) ...@@ -2921,6 +2927,7 @@ static void e1000_configure_tx(struct e1000_adapter *adapter)
if (adapter->flags2 & FLAG2_DMA_BURST) { if (adapter->flags2 & FLAG2_DMA_BURST) {
u32 txdctl = er32(TXDCTL(0)); u32 txdctl = er32(TXDCTL(0));
txdctl &= ~(E1000_TXDCTL_PTHRESH | E1000_TXDCTL_HTHRESH | txdctl &= ~(E1000_TXDCTL_PTHRESH | E1000_TXDCTL_HTHRESH |
E1000_TXDCTL_WTHRESH); E1000_TXDCTL_WTHRESH);
/* set up some performance related parameters to encourage the /* set up some performance related parameters to encourage the
...@@ -3239,6 +3246,7 @@ static void e1000_configure_rx(struct e1000_adapter *adapter) ...@@ -3239,6 +3246,7 @@ static void e1000_configure_rx(struct e1000_adapter *adapter)
if (adapter->flags & FLAG_IS_ICH) { if (adapter->flags & FLAG_IS_ICH) {
u32 rxdctl = er32(RXDCTL(0)); u32 rxdctl = er32(RXDCTL(0));
ew32(RXDCTL(0), rxdctl | 0x3); ew32(RXDCTL(0), rxdctl | 0x3);
} }
...@@ -4695,6 +4703,7 @@ static void e1000e_update_stats(struct e1000_adapter *adapter) ...@@ -4695,6 +4703,7 @@ static void e1000e_update_stats(struct e1000_adapter *adapter)
/* Correctable ECC Errors */ /* Correctable ECC Errors */
if (hw->mac.type == e1000_pch_lpt) { if (hw->mac.type == e1000_pch_lpt) {
u32 pbeccsts = er32(PBECCSTS); u32 pbeccsts = er32(PBECCSTS);
adapter->corr_errors += adapter->corr_errors +=
pbeccsts & E1000_PBECCSTS_CORR_ERR_CNT_MASK; pbeccsts & E1000_PBECCSTS_CORR_ERR_CNT_MASK;
adapter->uncorr_errors += adapter->uncorr_errors +=
...@@ -4808,6 +4817,7 @@ static void e1000e_enable_receives(struct e1000_adapter *adapter) ...@@ -4808,6 +4817,7 @@ static void e1000e_enable_receives(struct e1000_adapter *adapter)
(adapter->flags & FLAG_RESTART_NOW)) { (adapter->flags & FLAG_RESTART_NOW)) {
struct e1000_hw *hw = &adapter->hw; struct e1000_hw *hw = &adapter->hw;
u32 rctl = er32(RCTL); u32 rctl = er32(RCTL);
ew32(RCTL, rctl | E1000_RCTL_EN); ew32(RCTL, rctl | E1000_RCTL_EN);
adapter->flags &= ~FLAG_RESTART_NOW; adapter->flags &= ~FLAG_RESTART_NOW;
} }
...@@ -4930,6 +4940,7 @@ static void e1000_watchdog_task(struct work_struct *work) ...@@ -4930,6 +4940,7 @@ static void e1000_watchdog_task(struct work_struct *work)
if ((adapter->flags & FLAG_TARC_SPEED_MODE_BIT) && if ((adapter->flags & FLAG_TARC_SPEED_MODE_BIT) &&
!txb2b) { !txb2b) {
u32 tarc0; u32 tarc0;
tarc0 = er32(TARC(0)); tarc0 = er32(TARC(0));
tarc0 &= ~SPEED_MODE_BIT; tarc0 &= ~SPEED_MODE_BIT;
ew32(TARC(0), tarc0); ew32(TARC(0), tarc0);
...@@ -5170,7 +5181,7 @@ static bool e1000_tx_csum(struct e1000_ring *tx_ring, struct sk_buff *skb) ...@@ -5170,7 +5181,7 @@ static bool e1000_tx_csum(struct e1000_ring *tx_ring, struct sk_buff *skb)
__be16 protocol; __be16 protocol;
if (skb->ip_summed != CHECKSUM_PARTIAL) if (skb->ip_summed != CHECKSUM_PARTIAL)
return 0; return false;
if (skb->protocol == cpu_to_be16(ETH_P_8021Q)) if (skb->protocol == cpu_to_be16(ETH_P_8021Q))
protocol = vlan_eth_hdr(skb)->h_vlan_encapsulated_proto; protocol = vlan_eth_hdr(skb)->h_vlan_encapsulated_proto;
...@@ -5215,7 +5226,7 @@ static bool e1000_tx_csum(struct e1000_ring *tx_ring, struct sk_buff *skb) ...@@ -5215,7 +5226,7 @@ static bool e1000_tx_csum(struct e1000_ring *tx_ring, struct sk_buff *skb)
i = 0; i = 0;
tx_ring->next_to_use = i; tx_ring->next_to_use = i;
return 1; return true;
} }
static int e1000_tx_map(struct e1000_ring *tx_ring, struct sk_buff *skb, static int e1000_tx_map(struct e1000_ring *tx_ring, struct sk_buff *skb,
...@@ -6209,6 +6220,7 @@ static int __e1000_resume(struct pci_dev *pdev) ...@@ -6209,6 +6220,7 @@ static int __e1000_resume(struct pci_dev *pdev)
e1e_wphy(&adapter->hw, BM_WUS, ~0); e1e_wphy(&adapter->hw, BM_WUS, ~0);
} else { } else {
u32 wus = er32(WUS); u32 wus = er32(WUS);
if (wus) { if (wus) {
e_info("MAC Wakeup cause - %s\n", e_info("MAC Wakeup cause - %s\n",
wus & E1000_WUS_EX ? "Unicast Packet" : wus & E1000_WUS_EX ? "Unicast Packet" :
...@@ -7027,7 +7039,7 @@ static const struct pci_error_handlers e1000_err_handler = { ...@@ -7027,7 +7039,7 @@ static const struct pci_error_handlers e1000_err_handler = {
.resume = e1000_io_resume, .resume = e1000_io_resume,
}; };
static DEFINE_PCI_DEVICE_TABLE(e1000_pci_tbl) = { static const struct pci_device_id e1000_pci_tbl[] = {
{ PCI_VDEVICE(INTEL, E1000_DEV_ID_82571EB_COPPER), board_82571 }, { PCI_VDEVICE(INTEL, E1000_DEV_ID_82571EB_COPPER), board_82571 },
{ PCI_VDEVICE(INTEL, E1000_DEV_ID_82571EB_FIBER), board_82571 }, { PCI_VDEVICE(INTEL, E1000_DEV_ID_82571EB_FIBER), board_82571 },
{ PCI_VDEVICE(INTEL, E1000_DEV_ID_82571EB_QUAD_COPPER), board_82571 }, { PCI_VDEVICE(INTEL, E1000_DEV_ID_82571EB_QUAD_COPPER), board_82571 },
...@@ -7144,6 +7156,7 @@ static struct pci_driver e1000_driver = { ...@@ -7144,6 +7156,7 @@ static struct pci_driver e1000_driver = {
static int __init e1000_init_module(void) static int __init e1000_init_module(void)
{ {
int ret; int ret;
pr_info("Intel(R) PRO/1000 Network Driver - %s\n", pr_info("Intel(R) PRO/1000 Network Driver - %s\n",
e1000e_driver_version); e1000e_driver_version);
pr_info("Copyright(c) 1999 - 2014 Intel Corporation.\n"); pr_info("Copyright(c) 1999 - 2014 Intel Corporation.\n");
......
...@@ -398,6 +398,7 @@ s32 e1000e_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data) ...@@ -398,6 +398,7 @@ s32 e1000e_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
/* Loop to allow for up to whole page write of eeprom */ /* Loop to allow for up to whole page write of eeprom */
while (widx < words) { while (widx < words) {
u16 word_out = data[widx]; u16 word_out = data[widx];
word_out = (word_out >> 8) | (word_out << 8); word_out = (word_out >> 8) | (word_out << 8);
e1000_shift_out_eec_bits(hw, word_out, 16); e1000_shift_out_eec_bits(hw, word_out, 16);
widx++; widx++;
......
...@@ -436,6 +436,7 @@ void e1000e_check_options(struct e1000_adapter *adapter) ...@@ -436,6 +436,7 @@ void e1000e_check_options(struct e1000_adapter *adapter)
if (num_IntMode > bd) { if (num_IntMode > bd) {
unsigned int int_mode = IntMode[bd]; unsigned int int_mode = IntMode[bd];
e1000_validate_option(&int_mode, &opt, adapter); e1000_validate_option(&int_mode, &opt, adapter);
adapter->int_mode = int_mode; adapter->int_mode = int_mode;
} else { } else {
...@@ -457,6 +458,7 @@ void e1000e_check_options(struct e1000_adapter *adapter) ...@@ -457,6 +458,7 @@ void e1000e_check_options(struct e1000_adapter *adapter)
if (num_SmartPowerDownEnable > bd) { if (num_SmartPowerDownEnable > bd) {
unsigned int spd = SmartPowerDownEnable[bd]; unsigned int spd = SmartPowerDownEnable[bd];
e1000_validate_option(&spd, &opt, adapter); e1000_validate_option(&spd, &opt, adapter);
if ((adapter->flags & FLAG_HAS_SMART_POWER_DOWN) && spd) if ((adapter->flags & FLAG_HAS_SMART_POWER_DOWN) && spd)
adapter->flags |= FLAG_SMART_POWER_DOWN; adapter->flags |= FLAG_SMART_POWER_DOWN;
...@@ -473,6 +475,7 @@ void e1000e_check_options(struct e1000_adapter *adapter) ...@@ -473,6 +475,7 @@ void e1000e_check_options(struct e1000_adapter *adapter)
if (num_CrcStripping > bd) { if (num_CrcStripping > bd) {
unsigned int crc_stripping = CrcStripping[bd]; unsigned int crc_stripping = CrcStripping[bd];
e1000_validate_option(&crc_stripping, &opt, adapter); e1000_validate_option(&crc_stripping, &opt, adapter);
if (crc_stripping == OPTION_ENABLED) { if (crc_stripping == OPTION_ENABLED) {
adapter->flags2 |= FLAG2_CRC_STRIPPING; adapter->flags2 |= FLAG2_CRC_STRIPPING;
...@@ -495,6 +498,7 @@ void e1000e_check_options(struct e1000_adapter *adapter) ...@@ -495,6 +498,7 @@ void e1000e_check_options(struct e1000_adapter *adapter)
if (num_KumeranLockLoss > bd) { if (num_KumeranLockLoss > bd) {
unsigned int kmrn_lock_loss = KumeranLockLoss[bd]; unsigned int kmrn_lock_loss = KumeranLockLoss[bd];
e1000_validate_option(&kmrn_lock_loss, &opt, adapter); e1000_validate_option(&kmrn_lock_loss, &opt, adapter);
enabled = kmrn_lock_loss; enabled = kmrn_lock_loss;
} }
......
...@@ -2896,6 +2896,7 @@ static s32 __e1000_write_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 data, ...@@ -2896,6 +2896,7 @@ static s32 __e1000_write_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 data,
(hw->phy.addr == 2) && (hw->phy.addr == 2) &&
!(MAX_PHY_REG_ADDRESS & reg) && (data & (1 << 11))) { !(MAX_PHY_REG_ADDRESS & reg) && (data & (1 << 11))) {
u16 data2 = 0x7EFF; u16 data2 = 0x7EFF;
ret_val = e1000_access_phy_debug_regs_hv(hw, ret_val = e1000_access_phy_debug_regs_hv(hw,
(1 << 6) | 0x3, (1 << 6) | 0x3,
&data2, false); &data2, false);
......
...@@ -2291,6 +2291,13 @@ int i40e_ndo_get_vf_config(struct net_device *netdev, ...@@ -2291,6 +2291,13 @@ int i40e_ndo_get_vf_config(struct net_device *netdev,
ivi->vlan = le16_to_cpu(vsi->info.pvid) & I40E_VLAN_MASK; ivi->vlan = le16_to_cpu(vsi->info.pvid) & I40E_VLAN_MASK;
ivi->qos = (le16_to_cpu(vsi->info.pvid) & I40E_PRIORITY_MASK) >> ivi->qos = (le16_to_cpu(vsi->info.pvid) & I40E_PRIORITY_MASK) >>
I40E_VLAN_PRIORITY_SHIFT; I40E_VLAN_PRIORITY_SHIFT;
if (vf->link_forced == false)
ivi->linkstate = IFLA_VF_LINK_STATE_AUTO;
else if (vf->link_up == true)
ivi->linkstate = IFLA_VF_LINK_STATE_ENABLE;
else
ivi->linkstate = IFLA_VF_LINK_STATE_DISABLE;
ret = 0; ret = 0;
error_param: error_param:
......
...@@ -73,9 +73,8 @@ static s32 igb_validate_nvm_checksum_82580(struct e1000_hw *hw); ...@@ -73,9 +73,8 @@ static s32 igb_validate_nvm_checksum_82580(struct e1000_hw *hw);
static s32 igb_update_nvm_checksum_82580(struct e1000_hw *hw); static s32 igb_update_nvm_checksum_82580(struct e1000_hw *hw);
static s32 igb_validate_nvm_checksum_i350(struct e1000_hw *hw); static s32 igb_validate_nvm_checksum_i350(struct e1000_hw *hw);
static s32 igb_update_nvm_checksum_i350(struct e1000_hw *hw); static s32 igb_update_nvm_checksum_i350(struct e1000_hw *hw);
static const u16 e1000_82580_rxpbs_table[] = static const u16 e1000_82580_rxpbs_table[] = {
{ 36, 72, 144, 1, 2, 4, 8, 16, 36, 72, 144, 1, 2, 4, 8, 16, 35, 70, 140 };
35, 70, 140 };
/** /**
* igb_sgmii_uses_mdio_82575 - Determine if I2C pins are for external MDIO * igb_sgmii_uses_mdio_82575 - Determine if I2C pins are for external MDIO
...@@ -1269,7 +1268,7 @@ static s32 igb_check_for_link_82575(struct e1000_hw *hw) ...@@ -1269,7 +1268,7 @@ static s32 igb_check_for_link_82575(struct e1000_hw *hw)
if (hw->phy.media_type != e1000_media_type_copper) { if (hw->phy.media_type != e1000_media_type_copper) {
ret_val = igb_get_pcs_speed_and_duplex_82575(hw, &speed, ret_val = igb_get_pcs_speed_and_duplex_82575(hw, &speed,
&duplex); &duplex);
/* Use this flag to determine if link needs to be checked or /* Use this flag to determine if link needs to be checked or
* not. If we have link clear the flag so that we do not * not. If we have link clear the flag so that we do not
* continue to check for link. * continue to check for link.
...@@ -1436,9 +1435,8 @@ static s32 igb_reset_hw_82575(struct e1000_hw *hw) ...@@ -1436,9 +1435,8 @@ static s32 igb_reset_hw_82575(struct e1000_hw *hw)
/* set the completion timeout for interface */ /* set the completion timeout for interface */
ret_val = igb_set_pcie_completion_timeout(hw); ret_val = igb_set_pcie_completion_timeout(hw);
if (ret_val) { if (ret_val)
hw_dbg("PCI-E Set completion timeout has failed.\n"); hw_dbg("PCI-E Set completion timeout has failed.\n");
}
hw_dbg("Masking off all interrupts\n"); hw_dbg("Masking off all interrupts\n");
wr32(E1000_IMC, 0xffffffff); wr32(E1000_IMC, 0xffffffff);
...@@ -1676,7 +1674,7 @@ static s32 igb_setup_serdes_link_82575(struct e1000_hw *hw) ...@@ -1676,7 +1674,7 @@ static s32 igb_setup_serdes_link_82575(struct e1000_hw *hw)
hw->mac.type == e1000_82576) { hw->mac.type == e1000_82576) {
ret_val = hw->nvm.ops.read(hw, NVM_COMPAT, 1, &data); ret_val = hw->nvm.ops.read(hw, NVM_COMPAT, 1, &data);
if (ret_val) { if (ret_val) {
printk(KERN_DEBUG "NVM Read Error\n\n"); hw_dbg(KERN_DEBUG "NVM Read Error\n\n");
return ret_val; return ret_val;
} }
...@@ -1689,7 +1687,7 @@ static s32 igb_setup_serdes_link_82575(struct e1000_hw *hw) ...@@ -1689,7 +1687,7 @@ static s32 igb_setup_serdes_link_82575(struct e1000_hw *hw)
* link either autoneg or be forced to 1000/Full * link either autoneg or be forced to 1000/Full
*/ */
ctrl_reg |= E1000_CTRL_SPD_1000 | E1000_CTRL_FRCSPD | ctrl_reg |= E1000_CTRL_SPD_1000 | E1000_CTRL_FRCSPD |
E1000_CTRL_FD | E1000_CTRL_FRCDPX; E1000_CTRL_FD | E1000_CTRL_FRCDPX;
/* set speed of 1000/Full if speed/duplex is forced */ /* set speed of 1000/Full if speed/duplex is forced */
reg |= E1000_PCS_LCTL_FSV_1000 | E1000_PCS_LCTL_FDV_FULL; reg |= E1000_PCS_LCTL_FSV_1000 | E1000_PCS_LCTL_FDV_FULL;
...@@ -2005,14 +2003,14 @@ static s32 igb_set_pcie_completion_timeout(struct e1000_hw *hw) ...@@ -2005,14 +2003,14 @@ static s32 igb_set_pcie_completion_timeout(struct e1000_hw *hw)
* 16ms to 55ms * 16ms to 55ms
*/ */
ret_val = igb_read_pcie_cap_reg(hw, PCIE_DEVICE_CONTROL2, ret_val = igb_read_pcie_cap_reg(hw, PCIE_DEVICE_CONTROL2,
&pcie_devctl2); &pcie_devctl2);
if (ret_val) if (ret_val)
goto out; goto out;
pcie_devctl2 |= PCIE_DEVICE_CONTROL2_16ms; pcie_devctl2 |= PCIE_DEVICE_CONTROL2_16ms;
ret_val = igb_write_pcie_cap_reg(hw, PCIE_DEVICE_CONTROL2, ret_val = igb_write_pcie_cap_reg(hw, PCIE_DEVICE_CONTROL2,
&pcie_devctl2); &pcie_devctl2);
out: out:
/* disable completion timeout resend */ /* disable completion timeout resend */
gcr &= ~E1000_GCR_CMPL_TMOUT_RESEND; gcr &= ~E1000_GCR_CMPL_TMOUT_RESEND;
...@@ -2436,8 +2434,7 @@ static s32 igb_update_nvm_checksum_82580(struct e1000_hw *hw) ...@@ -2436,8 +2434,7 @@ static s32 igb_update_nvm_checksum_82580(struct e1000_hw *hw)
ret_val = hw->nvm.ops.read(hw, NVM_COMPATIBILITY_REG_3, 1, &nvm_data); ret_val = hw->nvm.ops.read(hw, NVM_COMPATIBILITY_REG_3, 1, &nvm_data);
if (ret_val) { if (ret_val) {
hw_dbg("NVM Read Error while updating checksum" hw_dbg("NVM Read Error while updating checksum compatibility bit.\n");
" compatibility bit.\n");
goto out; goto out;
} }
...@@ -2447,8 +2444,7 @@ static s32 igb_update_nvm_checksum_82580(struct e1000_hw *hw) ...@@ -2447,8 +2444,7 @@ static s32 igb_update_nvm_checksum_82580(struct e1000_hw *hw)
ret_val = hw->nvm.ops.write(hw, NVM_COMPATIBILITY_REG_3, 1, ret_val = hw->nvm.ops.write(hw, NVM_COMPATIBILITY_REG_3, 1,
&nvm_data); &nvm_data);
if (ret_val) { if (ret_val) {
hw_dbg("NVM Write Error while updating checksum" hw_dbg("NVM Write Error while updating checksum compatibility bit.\n");
" compatibility bit.\n");
goto out; goto out;
} }
} }
......
...@@ -37,9 +37,9 @@ s32 igb_write_i2c_byte(struct e1000_hw *hw, u8 byte_offset, u8 dev_addr, ...@@ -37,9 +37,9 @@ s32 igb_write_i2c_byte(struct e1000_hw *hw, u8 byte_offset, u8 dev_addr,
u8 data); u8 data);
#define ID_LED_DEFAULT_82575_SERDES ((ID_LED_DEF1_DEF2 << 12) | \ #define ID_LED_DEFAULT_82575_SERDES ((ID_LED_DEF1_DEF2 << 12) | \
(ID_LED_DEF1_DEF2 << 8) | \ (ID_LED_DEF1_DEF2 << 8) | \
(ID_LED_DEF1_DEF2 << 4) | \ (ID_LED_DEF1_DEF2 << 4) | \
(ID_LED_OFF1_ON2)) (ID_LED_OFF1_ON2))
#define E1000_RAR_ENTRIES_82575 16 #define E1000_RAR_ENTRIES_82575 16
#define E1000_RAR_ENTRIES_82576 24 #define E1000_RAR_ENTRIES_82576 24
...@@ -67,16 +67,16 @@ s32 igb_write_i2c_byte(struct e1000_hw *hw, u8 byte_offset, u8 dev_addr, ...@@ -67,16 +67,16 @@ s32 igb_write_i2c_byte(struct e1000_hw *hw, u8 byte_offset, u8 dev_addr,
#define E1000_MRQC_RSS_FIELD_IPV6_UDP_EX 0x01000000 #define E1000_MRQC_RSS_FIELD_IPV6_UDP_EX 0x01000000
#define E1000_EICR_TX_QUEUE ( \ #define E1000_EICR_TX_QUEUE ( \
E1000_EICR_TX_QUEUE0 | \ E1000_EICR_TX_QUEUE0 | \
E1000_EICR_TX_QUEUE1 | \ E1000_EICR_TX_QUEUE1 | \
E1000_EICR_TX_QUEUE2 | \ E1000_EICR_TX_QUEUE2 | \
E1000_EICR_TX_QUEUE3) E1000_EICR_TX_QUEUE3)
#define E1000_EICR_RX_QUEUE ( \ #define E1000_EICR_RX_QUEUE ( \
E1000_EICR_RX_QUEUE0 | \ E1000_EICR_RX_QUEUE0 | \
E1000_EICR_RX_QUEUE1 | \ E1000_EICR_RX_QUEUE1 | \
E1000_EICR_RX_QUEUE2 | \ E1000_EICR_RX_QUEUE2 | \
E1000_EICR_RX_QUEUE3) E1000_EICR_RX_QUEUE3)
/* Immediate Interrupt Rx (A.K.A. Low Latency Interrupt) */ /* Immediate Interrupt Rx (A.K.A. Low Latency Interrupt) */
#define E1000_IMIREXT_SIZE_BP 0x00001000 /* Packet size bypass */ #define E1000_IMIREXT_SIZE_BP 0x00001000 /* Packet size bypass */
......
...@@ -101,11 +101,11 @@ ...@@ -101,11 +101,11 @@
/* Same mask, but for extended and packet split descriptors */ /* Same mask, but for extended and packet split descriptors */
#define E1000_RXDEXT_ERR_FRAME_ERR_MASK ( \ #define E1000_RXDEXT_ERR_FRAME_ERR_MASK ( \
E1000_RXDEXT_STATERR_CE | \ E1000_RXDEXT_STATERR_CE | \
E1000_RXDEXT_STATERR_SE | \ E1000_RXDEXT_STATERR_SE | \
E1000_RXDEXT_STATERR_SEQ | \ E1000_RXDEXT_STATERR_SEQ | \
E1000_RXDEXT_STATERR_CXE | \ E1000_RXDEXT_STATERR_CXE | \
E1000_RXDEXT_STATERR_RXE) E1000_RXDEXT_STATERR_RXE)
#define E1000_MRQC_RSS_FIELD_IPV4_TCP 0x00010000 #define E1000_MRQC_RSS_FIELD_IPV4_TCP 0x00010000
#define E1000_MRQC_RSS_FIELD_IPV4 0x00020000 #define E1000_MRQC_RSS_FIELD_IPV4 0x00020000
...@@ -406,12 +406,12 @@ ...@@ -406,12 +406,12 @@
* o LSC = Link Status Change * o LSC = Link Status Change
*/ */
#define IMS_ENABLE_MASK ( \ #define IMS_ENABLE_MASK ( \
E1000_IMS_RXT0 | \ E1000_IMS_RXT0 | \
E1000_IMS_TXDW | \ E1000_IMS_TXDW | \
E1000_IMS_RXDMT0 | \ E1000_IMS_RXDMT0 | \
E1000_IMS_RXSEQ | \ E1000_IMS_RXSEQ | \
E1000_IMS_LSC | \ E1000_IMS_LSC | \
E1000_IMS_DOUTSYNC) E1000_IMS_DOUTSYNC)
/* Interrupt Mask Set */ /* Interrupt Mask Set */
#define E1000_IMS_TXDW E1000_ICR_TXDW /* Transmit desc written back */ #define E1000_IMS_TXDW E1000_ICR_TXDW /* Transmit desc written back */
...@@ -1011,8 +1011,7 @@ ...@@ -1011,8 +1011,7 @@
#define E1000_VFTA_ENTRY_BIT_SHIFT_MASK 0x1F #define E1000_VFTA_ENTRY_BIT_SHIFT_MASK 0x1F
/* DMA Coalescing register fields */ /* DMA Coalescing register fields */
#define E1000_PCIEMISC_LX_DECISION 0x00000080 /* Lx power decision based #define E1000_PCIEMISC_LX_DECISION 0x00000080 /* Lx power on DMA coal */
on DMA coal */
/* Tx Rate-Scheduler Config fields */ /* Tx Rate-Scheduler Config fields */
#define E1000_RTTBCNRC_RS_ENA 0x80000000 #define E1000_RTTBCNRC_RS_ENA 0x80000000
......
...@@ -320,15 +320,15 @@ struct e1000_host_mng_command_info { ...@@ -320,15 +320,15 @@ struct e1000_host_mng_command_info {
#include "e1000_mbx.h" #include "e1000_mbx.h"
struct e1000_mac_operations { struct e1000_mac_operations {
s32 (*check_for_link)(struct e1000_hw *); s32 (*check_for_link)(struct e1000_hw *);
s32 (*reset_hw)(struct e1000_hw *); s32 (*reset_hw)(struct e1000_hw *);
s32 (*init_hw)(struct e1000_hw *); s32 (*init_hw)(struct e1000_hw *);
bool (*check_mng_mode)(struct e1000_hw *); bool (*check_mng_mode)(struct e1000_hw *);
s32 (*setup_physical_interface)(struct e1000_hw *); s32 (*setup_physical_interface)(struct e1000_hw *);
void (*rar_set)(struct e1000_hw *, u8 *, u32); void (*rar_set)(struct e1000_hw *, u8 *, u32);
s32 (*read_mac_addr)(struct e1000_hw *); s32 (*read_mac_addr)(struct e1000_hw *);
s32 (*get_speed_and_duplex)(struct e1000_hw *, u16 *, u16 *); s32 (*get_speed_and_duplex)(struct e1000_hw *, u16 *, u16 *);
s32 (*acquire_swfw_sync)(struct e1000_hw *, u16); s32 (*acquire_swfw_sync)(struct e1000_hw *, u16);
void (*release_swfw_sync)(struct e1000_hw *, u16); void (*release_swfw_sync)(struct e1000_hw *, u16);
#ifdef CONFIG_IGB_HWMON #ifdef CONFIG_IGB_HWMON
s32 (*get_thermal_sensor_data)(struct e1000_hw *); s32 (*get_thermal_sensor_data)(struct e1000_hw *);
...@@ -338,31 +338,31 @@ struct e1000_mac_operations { ...@@ -338,31 +338,31 @@ struct e1000_mac_operations {
}; };
struct e1000_phy_operations { struct e1000_phy_operations {
s32 (*acquire)(struct e1000_hw *); s32 (*acquire)(struct e1000_hw *);
s32 (*check_polarity)(struct e1000_hw *); s32 (*check_polarity)(struct e1000_hw *);
s32 (*check_reset_block)(struct e1000_hw *); s32 (*check_reset_block)(struct e1000_hw *);
s32 (*force_speed_duplex)(struct e1000_hw *); s32 (*force_speed_duplex)(struct e1000_hw *);
s32 (*get_cfg_done)(struct e1000_hw *hw); s32 (*get_cfg_done)(struct e1000_hw *hw);
s32 (*get_cable_length)(struct e1000_hw *); s32 (*get_cable_length)(struct e1000_hw *);
s32 (*get_phy_info)(struct e1000_hw *); s32 (*get_phy_info)(struct e1000_hw *);
s32 (*read_reg)(struct e1000_hw *, u32, u16 *); s32 (*read_reg)(struct e1000_hw *, u32, u16 *);
void (*release)(struct e1000_hw *); void (*release)(struct e1000_hw *);
s32 (*reset)(struct e1000_hw *); s32 (*reset)(struct e1000_hw *);
s32 (*set_d0_lplu_state)(struct e1000_hw *, bool); s32 (*set_d0_lplu_state)(struct e1000_hw *, bool);
s32 (*set_d3_lplu_state)(struct e1000_hw *, bool); s32 (*set_d3_lplu_state)(struct e1000_hw *, bool);
s32 (*write_reg)(struct e1000_hw *, u32, u16); s32 (*write_reg)(struct e1000_hw *, u32, u16);
s32 (*read_i2c_byte)(struct e1000_hw *, u8, u8, u8 *); s32 (*read_i2c_byte)(struct e1000_hw *, u8, u8, u8 *);
s32 (*write_i2c_byte)(struct e1000_hw *, u8, u8, u8); s32 (*write_i2c_byte)(struct e1000_hw *, u8, u8, u8);
}; };
struct e1000_nvm_operations { struct e1000_nvm_operations {
s32 (*acquire)(struct e1000_hw *); s32 (*acquire)(struct e1000_hw *);
s32 (*read)(struct e1000_hw *, u16, u16, u16 *); s32 (*read)(struct e1000_hw *, u16, u16, u16 *);
void (*release)(struct e1000_hw *); void (*release)(struct e1000_hw *);
s32 (*write)(struct e1000_hw *, u16, u16, u16 *); s32 (*write)(struct e1000_hw *, u16, u16, u16 *);
s32 (*update)(struct e1000_hw *); s32 (*update)(struct e1000_hw *);
s32 (*validate)(struct e1000_hw *); s32 (*validate)(struct e1000_hw *);
s32 (*valid_led_default)(struct e1000_hw *, u16 *); s32 (*valid_led_default)(struct e1000_hw *, u16 *);
}; };
#define E1000_MAX_SENSORS 3 #define E1000_MAX_SENSORS 3
......
...@@ -442,7 +442,7 @@ static u32 igb_hash_mc_addr(struct e1000_hw *hw, u8 *mc_addr) ...@@ -442,7 +442,7 @@ static u32 igb_hash_mc_addr(struct e1000_hw *hw, u8 *mc_addr)
* The caller must have a packed mc_addr_list of multicast addresses. * The caller must have a packed mc_addr_list of multicast addresses.
**/ **/
void igb_update_mc_addr_list(struct e1000_hw *hw, void igb_update_mc_addr_list(struct e1000_hw *hw,
u8 *mc_addr_list, u32 mc_addr_count) u8 *mc_addr_list, u32 mc_addr_count)
{ {
u32 hash_value, hash_bit, hash_reg; u32 hash_value, hash_bit, hash_reg;
int i; int i;
...@@ -866,8 +866,7 @@ s32 igb_config_fc_after_link_up(struct e1000_hw *hw) ...@@ -866,8 +866,7 @@ s32 igb_config_fc_after_link_up(struct e1000_hw *hw)
goto out; goto out;
if (!(mii_status_reg & MII_SR_AUTONEG_COMPLETE)) { if (!(mii_status_reg & MII_SR_AUTONEG_COMPLETE)) {
hw_dbg("Copper PHY and Auto Neg " hw_dbg("Copper PHY and Auto Neg has not completed.\n");
"has not completed.\n");
goto out; goto out;
} }
...@@ -932,8 +931,7 @@ s32 igb_config_fc_after_link_up(struct e1000_hw *hw) ...@@ -932,8 +931,7 @@ s32 igb_config_fc_after_link_up(struct e1000_hw *hw)
hw_dbg("Flow Control = FULL.\r\n"); hw_dbg("Flow Control = FULL.\r\n");
} else { } else {
hw->fc.current_mode = e1000_fc_rx_pause; hw->fc.current_mode = e1000_fc_rx_pause;
hw_dbg("Flow Control = " hw_dbg("Flow Control = RX PAUSE frames only.\r\n");
"RX PAUSE frames only.\r\n");
} }
} }
/* For receiving PAUSE frames ONLY. /* For receiving PAUSE frames ONLY.
...@@ -1299,7 +1297,7 @@ static s32 igb_valid_led_default(struct e1000_hw *hw, u16 *data) ...@@ -1299,7 +1297,7 @@ static s32 igb_valid_led_default(struct e1000_hw *hw, u16 *data)
} }
if (*data == ID_LED_RESERVED_0000 || *data == ID_LED_RESERVED_FFFF) { if (*data == ID_LED_RESERVED_0000 || *data == ID_LED_RESERVED_FFFF) {
switch(hw->phy.media_type) { switch (hw->phy.media_type) {
case e1000_media_type_internal_serdes: case e1000_media_type_internal_serdes:
*data = ID_LED_DEFAULT_82575_SERDES; *data = ID_LED_DEFAULT_82575_SERDES;
break; break;
......
...@@ -480,6 +480,7 @@ s32 igb_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data) ...@@ -480,6 +480,7 @@ s32 igb_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
/* Loop to allow for up to whole page write of eeprom */ /* Loop to allow for up to whole page write of eeprom */
while (widx < words) { while (widx < words) {
u16 word_out = data[widx]; u16 word_out = data[widx];
word_out = (word_out >> 8) | (word_out << 8); word_out = (word_out >> 8) | (word_out << 8);
igb_shift_out_eec_bits(hw, word_out, 16); igb_shift_out_eec_bits(hw, word_out, 16);
widx++; widx++;
......
...@@ -32,7 +32,7 @@ void igb_release_nvm(struct e1000_hw *hw); ...@@ -32,7 +32,7 @@ void igb_release_nvm(struct e1000_hw *hw);
s32 igb_read_mac_addr(struct e1000_hw *hw); s32 igb_read_mac_addr(struct e1000_hw *hw);
s32 igb_read_part_num(struct e1000_hw *hw, u32 *part_num); s32 igb_read_part_num(struct e1000_hw *hw, u32 *part_num);
s32 igb_read_part_string(struct e1000_hw *hw, u8 *part_num, s32 igb_read_part_string(struct e1000_hw *hw, u8 *part_num,
u32 part_num_size); u32 part_num_size);
s32 igb_read_nvm_eerd(struct e1000_hw *hw, u16 offset, u16 words, u16 *data); s32 igb_read_nvm_eerd(struct e1000_hw *hw, u16 offset, u16 words, u16 *data);
s32 igb_read_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data); s32 igb_read_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data);
s32 igb_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data); s32 igb_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data);
......
...@@ -924,8 +924,7 @@ static s32 igb_copper_link_autoneg(struct e1000_hw *hw) ...@@ -924,8 +924,7 @@ static s32 igb_copper_link_autoneg(struct e1000_hw *hw)
if (phy->autoneg_wait_to_complete) { if (phy->autoneg_wait_to_complete) {
ret_val = igb_wait_autoneg(hw); ret_val = igb_wait_autoneg(hw);
if (ret_val) { if (ret_val) {
hw_dbg("Error while waiting for " hw_dbg("Error while waiting for autoneg to complete\n");
"autoneg to complete\n");
goto out; goto out;
} }
} }
......
...@@ -301,9 +301,9 @@ ...@@ -301,9 +301,9 @@
#define E1000_RA2 0x054E0 /* 2nd half of Rx address array - RW Array */ #define E1000_RA2 0x054E0 /* 2nd half of Rx address array - RW Array */
#define E1000_PSRTYPE(_i) (0x05480 + ((_i) * 4)) #define E1000_PSRTYPE(_i) (0x05480 + ((_i) * 4))
#define E1000_RAL(_i) (((_i) <= 15) ? (0x05400 + ((_i) * 8)) : \ #define E1000_RAL(_i) (((_i) <= 15) ? (0x05400 + ((_i) * 8)) : \
(0x054E0 + ((_i - 16) * 8))) (0x054E0 + ((_i - 16) * 8)))
#define E1000_RAH(_i) (((_i) <= 15) ? (0x05404 + ((_i) * 8)) : \ #define E1000_RAH(_i) (((_i) <= 15) ? (0x05404 + ((_i) * 8)) : \
(0x054E4 + ((_i - 16) * 8))) (0x054E4 + ((_i - 16) * 8)))
#define E1000_IP4AT_REG(_i) (0x05840 + ((_i) * 8)) #define E1000_IP4AT_REG(_i) (0x05840 + ((_i) * 8))
#define E1000_IP6AT_REG(_i) (0x05880 + ((_i) * 4)) #define E1000_IP6AT_REG(_i) (0x05880 + ((_i) * 4))
#define E1000_WUPM_REG(_i) (0x05A00 + ((_i) * 4)) #define E1000_WUPM_REG(_i) (0x05A00 + ((_i) * 4))
...@@ -358,8 +358,7 @@ ...@@ -358,8 +358,7 @@
#define E1000_VMBMEM(_n) (0x00800 + (64 * (_n))) #define E1000_VMBMEM(_n) (0x00800 + (64 * (_n)))
#define E1000_VMOLR(_n) (0x05AD0 + (4 * (_n))) #define E1000_VMOLR(_n) (0x05AD0 + (4 * (_n)))
#define E1000_DVMOLR(_n) (0x0C038 + (64 * (_n))) #define E1000_DVMOLR(_n) (0x0C038 + (64 * (_n)))
#define E1000_VLVF(_n) (0x05D00 + (4 * (_n))) /* VLAN Virtual Machine #define E1000_VLVF(_n) (0x05D00 + (4 * (_n))) /* VLAN VM Filter */
* Filter - RW */
#define E1000_VMVIR(_n) (0x03700 + (4 * (_n))) #define E1000_VMVIR(_n) (0x03700 + (4 * (_n)))
struct e1000_hw; struct e1000_hw;
......
...@@ -198,6 +198,7 @@ struct igb_tx_buffer { ...@@ -198,6 +198,7 @@ struct igb_tx_buffer {
unsigned int bytecount; unsigned int bytecount;
u16 gso_segs; u16 gso_segs;
__be16 protocol; __be16 protocol;
DEFINE_DMA_UNMAP_ADDR(dma); DEFINE_DMA_UNMAP_ADDR(dma);
DEFINE_DMA_UNMAP_LEN(len); DEFINE_DMA_UNMAP_LEN(len);
u32 tx_flags; u32 tx_flags;
......
...@@ -1060,8 +1060,8 @@ static struct igb_reg_test reg_test_i350[] = { ...@@ -1060,8 +1060,8 @@ static struct igb_reg_test reg_test_i350[] = {
{ E1000_TDT(0), 0x100, 4, PATTERN_TEST, 0x0000FFFF, 0x0000FFFF }, { E1000_TDT(0), 0x100, 4, PATTERN_TEST, 0x0000FFFF, 0x0000FFFF },
{ E1000_TDT(4), 0x40, 4, PATTERN_TEST, 0x0000FFFF, 0x0000FFFF }, { E1000_TDT(4), 0x40, 4, PATTERN_TEST, 0x0000FFFF, 0x0000FFFF },
{ E1000_RCTL, 0x100, 1, SET_READ_TEST, 0xFFFFFFFF, 0x00000000 }, { E1000_RCTL, 0x100, 1, SET_READ_TEST, 0xFFFFFFFF, 0x00000000 },
{ E1000_RCTL, 0x100, 1, SET_READ_TEST, 0x04CFB0FE, 0x003FFFFB }, { E1000_RCTL, 0x100, 1, SET_READ_TEST, 0x04CFB0FE, 0x003FFFFB },
{ E1000_RCTL, 0x100, 1, SET_READ_TEST, 0x04CFB0FE, 0xFFFFFFFF }, { E1000_RCTL, 0x100, 1, SET_READ_TEST, 0x04CFB0FE, 0xFFFFFFFF },
{ E1000_TCTL, 0x100, 1, SET_READ_TEST, 0xFFFFFFFF, 0x00000000 }, { E1000_TCTL, 0x100, 1, SET_READ_TEST, 0xFFFFFFFF, 0x00000000 },
{ E1000_RA, 0, 16, TABLE64_TEST_LO, { E1000_RA, 0, 16, TABLE64_TEST_LO,
0xFFFFFFFF, 0xFFFFFFFF }, 0xFFFFFFFF, 0xFFFFFFFF },
...@@ -1103,8 +1103,8 @@ static struct igb_reg_test reg_test_82580[] = { ...@@ -1103,8 +1103,8 @@ static struct igb_reg_test reg_test_82580[] = {
{ E1000_TDT(0), 0x100, 4, PATTERN_TEST, 0x0000FFFF, 0x0000FFFF }, { E1000_TDT(0), 0x100, 4, PATTERN_TEST, 0x0000FFFF, 0x0000FFFF },
{ E1000_TDT(4), 0x40, 4, PATTERN_TEST, 0x0000FFFF, 0x0000FFFF }, { E1000_TDT(4), 0x40, 4, PATTERN_TEST, 0x0000FFFF, 0x0000FFFF },
{ E1000_RCTL, 0x100, 1, SET_READ_TEST, 0xFFFFFFFF, 0x00000000 }, { E1000_RCTL, 0x100, 1, SET_READ_TEST, 0xFFFFFFFF, 0x00000000 },
{ E1000_RCTL, 0x100, 1, SET_READ_TEST, 0x04CFB0FE, 0x003FFFFB }, { E1000_RCTL, 0x100, 1, SET_READ_TEST, 0x04CFB0FE, 0x003FFFFB },
{ E1000_RCTL, 0x100, 1, SET_READ_TEST, 0x04CFB0FE, 0xFFFFFFFF }, { E1000_RCTL, 0x100, 1, SET_READ_TEST, 0x04CFB0FE, 0xFFFFFFFF },
{ E1000_TCTL, 0x100, 1, SET_READ_TEST, 0xFFFFFFFF, 0x00000000 }, { E1000_TCTL, 0x100, 1, SET_READ_TEST, 0xFFFFFFFF, 0x00000000 },
{ E1000_RA, 0, 16, TABLE64_TEST_LO, { E1000_RA, 0, 16, TABLE64_TEST_LO,
0xFFFFFFFF, 0xFFFFFFFF }, 0xFFFFFFFF, 0xFFFFFFFF },
...@@ -1149,14 +1149,14 @@ static struct igb_reg_test reg_test_82576[] = { ...@@ -1149,14 +1149,14 @@ static struct igb_reg_test reg_test_82576[] = {
{ E1000_TDBAH(4), 0x40, 12, PATTERN_TEST, 0xFFFFFFFF, 0xFFFFFFFF }, { E1000_TDBAH(4), 0x40, 12, PATTERN_TEST, 0xFFFFFFFF, 0xFFFFFFFF },
{ E1000_TDLEN(4), 0x40, 12, PATTERN_TEST, 0x000FFFF0, 0x000FFFFF }, { E1000_TDLEN(4), 0x40, 12, PATTERN_TEST, 0x000FFFF0, 0x000FFFFF },
{ E1000_RCTL, 0x100, 1, SET_READ_TEST, 0xFFFFFFFF, 0x00000000 }, { E1000_RCTL, 0x100, 1, SET_READ_TEST, 0xFFFFFFFF, 0x00000000 },
{ E1000_RCTL, 0x100, 1, SET_READ_TEST, 0x04CFB0FE, 0x003FFFFB }, { E1000_RCTL, 0x100, 1, SET_READ_TEST, 0x04CFB0FE, 0x003FFFFB },
{ E1000_RCTL, 0x100, 1, SET_READ_TEST, 0x04CFB0FE, 0xFFFFFFFF }, { E1000_RCTL, 0x100, 1, SET_READ_TEST, 0x04CFB0FE, 0xFFFFFFFF },
{ E1000_TCTL, 0x100, 1, SET_READ_TEST, 0xFFFFFFFF, 0x00000000 }, { E1000_TCTL, 0x100, 1, SET_READ_TEST, 0xFFFFFFFF, 0x00000000 },
{ E1000_RA, 0, 16, TABLE64_TEST_LO, 0xFFFFFFFF, 0xFFFFFFFF }, { E1000_RA, 0, 16, TABLE64_TEST_LO, 0xFFFFFFFF, 0xFFFFFFFF },
{ E1000_RA, 0, 16, TABLE64_TEST_HI, 0x83FFFFFF, 0xFFFFFFFF }, { E1000_RA, 0, 16, TABLE64_TEST_HI, 0x83FFFFFF, 0xFFFFFFFF },
{ E1000_RA2, 0, 8, TABLE64_TEST_LO, 0xFFFFFFFF, 0xFFFFFFFF }, { E1000_RA2, 0, 8, TABLE64_TEST_LO, 0xFFFFFFFF, 0xFFFFFFFF },
{ E1000_RA2, 0, 8, TABLE64_TEST_HI, 0x83FFFFFF, 0xFFFFFFFF }, { E1000_RA2, 0, 8, TABLE64_TEST_HI, 0x83FFFFFF, 0xFFFFFFFF },
{ E1000_MTA, 0, 128,TABLE32_TEST, 0xFFFFFFFF, 0xFFFFFFFF }, { E1000_MTA, 0, 128, TABLE32_TEST, 0xFFFFFFFF, 0xFFFFFFFF },
{ 0, 0, 0, 0 } { 0, 0, 0, 0 }
}; };
...@@ -1196,8 +1196,8 @@ static bool reg_pattern_test(struct igb_adapter *adapter, u64 *data, ...@@ -1196,8 +1196,8 @@ static bool reg_pattern_test(struct igb_adapter *adapter, u64 *data,
{ {
struct e1000_hw *hw = &adapter->hw; struct e1000_hw *hw = &adapter->hw;
u32 pat, val; u32 pat, val;
static const u32 _test[] = static const u32 _test[] = {
{0x5A5A5A5A, 0xA5A5A5A5, 0x00000000, 0xFFFFFFFF}; 0x5A5A5A5A, 0xA5A5A5A5, 0x00000000, 0xFFFFFFFF};
for (pat = 0; pat < ARRAY_SIZE(_test); pat++) { for (pat = 0; pat < ARRAY_SIZE(_test); pat++) {
wr32(reg, (_test[pat] & write)); wr32(reg, (_test[pat] & write));
val = rd32(reg) & mask; val = rd32(reg) & mask;
...@@ -1218,6 +1218,7 @@ static bool reg_set_and_check(struct igb_adapter *adapter, u64 *data, ...@@ -1218,6 +1218,7 @@ static bool reg_set_and_check(struct igb_adapter *adapter, u64 *data,
{ {
struct e1000_hw *hw = &adapter->hw; struct e1000_hw *hw = &adapter->hw;
u32 val; u32 val;
wr32(reg, write & mask); wr32(reg, write & mask);
val = rd32(reg); val = rd32(reg);
if ((write & mask) != (val & mask)) { if ((write & mask) != (val & mask)) {
...@@ -1387,14 +1388,14 @@ static int igb_intr_test(struct igb_adapter *adapter, u64 *data) ...@@ -1387,14 +1388,14 @@ static int igb_intr_test(struct igb_adapter *adapter, u64 *data)
/* Hook up test interrupt handler just for this test */ /* Hook up test interrupt handler just for this test */
if (adapter->flags & IGB_FLAG_HAS_MSIX) { if (adapter->flags & IGB_FLAG_HAS_MSIX) {
if (request_irq(adapter->msix_entries[0].vector, if (request_irq(adapter->msix_entries[0].vector,
igb_test_intr, 0, netdev->name, adapter)) { igb_test_intr, 0, netdev->name, adapter)) {
*data = 1; *data = 1;
return -1; return -1;
} }
} else if (adapter->flags & IGB_FLAG_HAS_MSI) { } else if (adapter->flags & IGB_FLAG_HAS_MSI) {
shared_int = false; shared_int = false;
if (request_irq(irq, if (request_irq(irq,
igb_test_intr, 0, netdev->name, adapter)) { igb_test_intr, 0, netdev->name, adapter)) {
*data = 1; *data = 1;
return -1; return -1;
} }
...@@ -1949,6 +1950,7 @@ static int igb_link_test(struct igb_adapter *adapter, u64 *data) ...@@ -1949,6 +1950,7 @@ static int igb_link_test(struct igb_adapter *adapter, u64 *data)
*data = 0; *data = 0;
if (hw->phy.media_type == e1000_media_type_internal_serdes) { if (hw->phy.media_type == e1000_media_type_internal_serdes) {
int i = 0; int i = 0;
hw->mac.serdes_has_link = false; hw->mac.serdes_has_link = false;
/* On some blade server designs, link establishment /* On some blade server designs, link establishment
......
This diff is collapsed.
...@@ -155,7 +155,6 @@ struct vf_data_storage { ...@@ -155,7 +155,6 @@ struct vf_data_storage {
struct vf_macvlans { struct vf_macvlans {
struct list_head l; struct list_head l;
int vf; int vf;
int rar_entry;
bool free; bool free;
bool is_macvlan; bool is_macvlan;
u8 vf_macvlan[ETH_ALEN]; u8 vf_macvlan[ETH_ALEN];
...@@ -614,6 +613,15 @@ static inline void ixgbe_write_tail(struct ixgbe_ring *ring, u32 value) ...@@ -614,6 +613,15 @@ static inline void ixgbe_write_tail(struct ixgbe_ring *ring, u32 value)
#define MAX_MSIX_VECTORS_82598 18 #define MAX_MSIX_VECTORS_82598 18
#define MAX_Q_VECTORS_82598 16 #define MAX_Q_VECTORS_82598 16
struct ixgbe_mac_addr {
u8 addr[ETH_ALEN];
u16 queue;
u16 state; /* bitmask */
};
#define IXGBE_MAC_STATE_DEFAULT 0x1
#define IXGBE_MAC_STATE_MODIFIED 0x2
#define IXGBE_MAC_STATE_IN_USE 0x4
#define MAX_Q_VECTORS MAX_Q_VECTORS_82599 #define MAX_Q_VECTORS MAX_Q_VECTORS_82599
#define MAX_MSIX_COUNT MAX_MSIX_VECTORS_82599 #define MAX_MSIX_COUNT MAX_MSIX_VECTORS_82599
...@@ -785,6 +793,7 @@ struct ixgbe_adapter { ...@@ -785,6 +793,7 @@ struct ixgbe_adapter {
u32 timer_event_accumulator; u32 timer_event_accumulator;
u32 vferr_refcount; u32 vferr_refcount;
struct ixgbe_mac_addr *mac_table;
struct kobject *info_kobj; struct kobject *info_kobj;
#ifdef CONFIG_IXGBE_HWMON #ifdef CONFIG_IXGBE_HWMON
struct hwmon_buff *ixgbe_hwmon_buff; struct hwmon_buff *ixgbe_hwmon_buff;
...@@ -863,6 +872,13 @@ void ixgbe_update_stats(struct ixgbe_adapter *adapter); ...@@ -863,6 +872,13 @@ void ixgbe_update_stats(struct ixgbe_adapter *adapter);
int ixgbe_init_interrupt_scheme(struct ixgbe_adapter *adapter); int ixgbe_init_interrupt_scheme(struct ixgbe_adapter *adapter);
int ixgbe_wol_supported(struct ixgbe_adapter *adapter, u16 device_id, int ixgbe_wol_supported(struct ixgbe_adapter *adapter, u16 device_id,
u16 subdevice_id); u16 subdevice_id);
#ifdef CONFIG_PCI_IOV
void ixgbe_full_sync_mac_table(struct ixgbe_adapter *adapter);
#endif
int ixgbe_add_mac_filter(struct ixgbe_adapter *adapter,
u8 *addr, u16 queue);
int ixgbe_del_mac_filter(struct ixgbe_adapter *adapter,
u8 *addr, u16 queue);
void ixgbe_clear_interrupt_scheme(struct ixgbe_adapter *adapter); void ixgbe_clear_interrupt_scheme(struct ixgbe_adapter *adapter);
netdev_tx_t ixgbe_xmit_frame_ring(struct sk_buff *, struct ixgbe_adapter *, netdev_tx_t ixgbe_xmit_frame_ring(struct sk_buff *, struct ixgbe_adapter *,
struct ixgbe_ring *); struct ixgbe_ring *);
......
...@@ -337,19 +337,25 @@ static s32 ixgbe_fc_enable_82598(struct ixgbe_hw *hw) ...@@ -337,19 +337,25 @@ static s32 ixgbe_fc_enable_82598(struct ixgbe_hw *hw)
int i; int i;
bool link_up; bool link_up;
/* /* Validate the water mark configuration */
* Validate the water mark configuration for packet buffer 0. Zero if (!hw->fc.pause_time) {
* water marks indicate that the packet buffer was not configured
* and the watermarks for packet buffer 0 should always be configured.
*/
if (!hw->fc.low_water ||
!hw->fc.high_water[0] ||
!hw->fc.pause_time) {
hw_dbg(hw, "Invalid water mark configuration\n");
ret_val = IXGBE_ERR_INVALID_LINK_SETTINGS; ret_val = IXGBE_ERR_INVALID_LINK_SETTINGS;
goto out; goto out;
} }
/* Low water mark of zero causes XOFF floods */
for (i = 0; i < MAX_TRAFFIC_CLASS; i++) {
if ((hw->fc.current_mode & ixgbe_fc_tx_pause) &&
hw->fc.high_water[i]) {
if (!hw->fc.low_water[i] ||
hw->fc.low_water[i] >= hw->fc.high_water[i]) {
hw_dbg(hw, "Invalid water mark configuration\n");
ret_val = IXGBE_ERR_INVALID_LINK_SETTINGS;
goto out;
}
}
}
/* /*
* On 82598 having Rx FC on causes resets while doing 1G * On 82598 having Rx FC on causes resets while doing 1G
* so if it's on turn it off once we know link_speed. For * so if it's on turn it off once we know link_speed. For
...@@ -432,12 +438,11 @@ static s32 ixgbe_fc_enable_82598(struct ixgbe_hw *hw) ...@@ -432,12 +438,11 @@ static s32 ixgbe_fc_enable_82598(struct ixgbe_hw *hw)
IXGBE_WRITE_REG(hw, IXGBE_FCTRL, fctrl_reg); IXGBE_WRITE_REG(hw, IXGBE_FCTRL, fctrl_reg);
IXGBE_WRITE_REG(hw, IXGBE_RMCS, rmcs_reg); IXGBE_WRITE_REG(hw, IXGBE_RMCS, rmcs_reg);
fcrtl = (hw->fc.low_water << 10) | IXGBE_FCRTL_XONE;
/* Set up and enable Rx high/low water mark thresholds, enable XON. */ /* Set up and enable Rx high/low water mark thresholds, enable XON. */
for (i = 0; i < MAX_TRAFFIC_CLASS; i++) { for (i = 0; i < MAX_TRAFFIC_CLASS; i++) {
if ((hw->fc.current_mode & ixgbe_fc_tx_pause) && if ((hw->fc.current_mode & ixgbe_fc_tx_pause) &&
hw->fc.high_water[i]) { hw->fc.high_water[i]) {
fcrtl = (hw->fc.low_water[i] << 10) | IXGBE_FCRTL_XONE;
fcrth = (hw->fc.high_water[i] << 10) | IXGBE_FCRTH_FCEN; fcrth = (hw->fc.high_water[i] << 10) | IXGBE_FCRTH_FCEN;
IXGBE_WRITE_REG(hw, IXGBE_FCRTL(i), fcrtl); IXGBE_WRITE_REG(hw, IXGBE_FCRTL(i), fcrtl);
IXGBE_WRITE_REG(hw, IXGBE_FCRTH(i), fcrth); IXGBE_WRITE_REG(hw, IXGBE_FCRTH(i), fcrth);
......
...@@ -271,6 +271,7 @@ static s32 ixgbe_setup_fc(struct ixgbe_hw *hw) ...@@ -271,6 +271,7 @@ static s32 ixgbe_setup_fc(struct ixgbe_hw *hw)
**/ **/
s32 ixgbe_start_hw_generic(struct ixgbe_hw *hw) s32 ixgbe_start_hw_generic(struct ixgbe_hw *hw)
{ {
s32 ret_val;
u32 ctrl_ext; u32 ctrl_ext;
/* Set the media type */ /* Set the media type */
...@@ -292,12 +293,15 @@ s32 ixgbe_start_hw_generic(struct ixgbe_hw *hw) ...@@ -292,12 +293,15 @@ s32 ixgbe_start_hw_generic(struct ixgbe_hw *hw)
IXGBE_WRITE_FLUSH(hw); IXGBE_WRITE_FLUSH(hw);
/* Setup flow control */ /* Setup flow control */
ixgbe_setup_fc(hw); ret_val = ixgbe_setup_fc(hw);
if (!ret_val)
goto out;
/* Clear adapter stopped flag */ /* Clear adapter stopped flag */
hw->adapter_stopped = false; hw->adapter_stopped = false;
return 0; out:
return ret_val;
} }
/** /**
...@@ -2106,19 +2110,25 @@ s32 ixgbe_fc_enable_generic(struct ixgbe_hw *hw) ...@@ -2106,19 +2110,25 @@ s32 ixgbe_fc_enable_generic(struct ixgbe_hw *hw)
u32 fcrtl, fcrth; u32 fcrtl, fcrth;
int i; int i;
/* /* Validate the water mark configuration. */
* Validate the water mark configuration for packet buffer 0. Zero if (!hw->fc.pause_time) {
* water marks indicate that the packet buffer was not configured
* and the watermarks for packet buffer 0 should always be configured.
*/
if (!hw->fc.low_water ||
!hw->fc.high_water[0] ||
!hw->fc.pause_time) {
hw_dbg(hw, "Invalid water mark configuration\n");
ret_val = IXGBE_ERR_INVALID_LINK_SETTINGS; ret_val = IXGBE_ERR_INVALID_LINK_SETTINGS;
goto out; goto out;
} }
/* Low water mark of zero causes XOFF floods */
for (i = 0; i < MAX_TRAFFIC_CLASS; i++) {
if ((hw->fc.current_mode & ixgbe_fc_tx_pause) &&
hw->fc.high_water[i]) {
if (!hw->fc.low_water[i] ||
hw->fc.low_water[i] >= hw->fc.high_water[i]) {
hw_dbg(hw, "Invalid water mark configuration\n");
ret_val = IXGBE_ERR_INVALID_LINK_SETTINGS;
goto out;
}
}
}
/* Negotiate the fc mode to use */ /* Negotiate the fc mode to use */
ixgbe_fc_autoneg(hw); ixgbe_fc_autoneg(hw);
...@@ -2181,12 +2191,11 @@ s32 ixgbe_fc_enable_generic(struct ixgbe_hw *hw) ...@@ -2181,12 +2191,11 @@ s32 ixgbe_fc_enable_generic(struct ixgbe_hw *hw)
IXGBE_WRITE_REG(hw, IXGBE_MFLCN, mflcn_reg); IXGBE_WRITE_REG(hw, IXGBE_MFLCN, mflcn_reg);
IXGBE_WRITE_REG(hw, IXGBE_FCCFG, fccfg_reg); IXGBE_WRITE_REG(hw, IXGBE_FCCFG, fccfg_reg);
fcrtl = (hw->fc.low_water << 10) | IXGBE_FCRTL_XONE;
/* Set up and enable Rx high/low water mark thresholds, enable XON. */ /* Set up and enable Rx high/low water mark thresholds, enable XON. */
for (i = 0; i < MAX_TRAFFIC_CLASS; i++) { for (i = 0; i < MAX_TRAFFIC_CLASS; i++) {
if ((hw->fc.current_mode & ixgbe_fc_tx_pause) && if ((hw->fc.current_mode & ixgbe_fc_tx_pause) &&
hw->fc.high_water[i]) { hw->fc.high_water[i]) {
fcrtl = (hw->fc.low_water[i] << 10) | IXGBE_FCRTL_XONE;
IXGBE_WRITE_REG(hw, IXGBE_FCRTL_82599(i), fcrtl); IXGBE_WRITE_REG(hw, IXGBE_FCRTL_82599(i), fcrtl);
fcrth = (hw->fc.high_water[i] << 10) | IXGBE_FCRTH_FCEN; fcrth = (hw->fc.high_water[i] << 10) | IXGBE_FCRTH_FCEN;
} else { } else {
......
...@@ -141,8 +141,6 @@ static inline bool ixgbe_removed(void __iomem *addr) ...@@ -141,8 +141,6 @@ static inline bool ixgbe_removed(void __iomem *addr)
return unlikely(!addr); return unlikely(!addr);
} }
void ixgbe_check_remove(struct ixgbe_hw *hw, u32 reg);
static inline void ixgbe_write_reg(struct ixgbe_hw *hw, u32 reg, u32 value) static inline void ixgbe_write_reg(struct ixgbe_hw *hw, u32 reg, u32 value)
{ {
u8 __iomem *reg_addr = ACCESS_ONCE(hw->hw_addr); u8 __iomem *reg_addr = ACCESS_ONCE(hw->hw_addr);
...@@ -172,18 +170,7 @@ static inline void ixgbe_write_reg64(struct ixgbe_hw *hw, u32 reg, u64 value) ...@@ -172,18 +170,7 @@ static inline void ixgbe_write_reg64(struct ixgbe_hw *hw, u32 reg, u64 value)
} }
#define IXGBE_WRITE_REG64(a, reg, value) ixgbe_write_reg64((a), (reg), (value)) #define IXGBE_WRITE_REG64(a, reg, value) ixgbe_write_reg64((a), (reg), (value))
static inline u32 ixgbe_read_reg(struct ixgbe_hw *hw, u32 reg) u32 ixgbe_read_reg(struct ixgbe_hw *hw, u32 reg);
{
u8 __iomem *reg_addr = ACCESS_ONCE(hw->hw_addr);
u32 value;
if (ixgbe_removed(reg_addr))
return IXGBE_FAILED_READ_REG;
value = readl(reg_addr + reg);
if (unlikely(value == IXGBE_FAILED_READ_REG))
ixgbe_check_remove(hw, reg);
return value;
}
#define IXGBE_READ_REG(a, reg) ixgbe_read_reg((a), (reg)) #define IXGBE_READ_REG(a, reg) ixgbe_read_reg((a), (reg))
#define IXGBE_WRITE_REG_ARRAY(a, reg, offset, value) \ #define IXGBE_WRITE_REG_ARRAY(a, reg, offset, value) \
......
...@@ -208,7 +208,6 @@ s32 ixgbe_dcb_config_pfc_82598(struct ixgbe_hw *hw, u8 pfc_en) ...@@ -208,7 +208,6 @@ s32 ixgbe_dcb_config_pfc_82598(struct ixgbe_hw *hw, u8 pfc_en)
IXGBE_WRITE_REG(hw, IXGBE_FCTRL, reg); IXGBE_WRITE_REG(hw, IXGBE_FCTRL, reg);
fcrtl = (hw->fc.low_water << 10) | IXGBE_FCRTL_XONE;
/* Configure PFC Tx thresholds per TC */ /* Configure PFC Tx thresholds per TC */
for (i = 0; i < MAX_TRAFFIC_CLASS; i++) { for (i = 0; i < MAX_TRAFFIC_CLASS; i++) {
if (!(pfc_en & (1 << i))) { if (!(pfc_en & (1 << i))) {
...@@ -217,6 +216,7 @@ s32 ixgbe_dcb_config_pfc_82598(struct ixgbe_hw *hw, u8 pfc_en) ...@@ -217,6 +216,7 @@ s32 ixgbe_dcb_config_pfc_82598(struct ixgbe_hw *hw, u8 pfc_en)
continue; continue;
} }
fcrtl = (hw->fc.low_water[i] << 10) | IXGBE_FCRTL_XONE;
reg = (hw->fc.high_water[i] << 10) | IXGBE_FCRTH_FCEN; reg = (hw->fc.high_water[i] << 10) | IXGBE_FCRTH_FCEN;
IXGBE_WRITE_REG(hw, IXGBE_FCRTL(i), fcrtl); IXGBE_WRITE_REG(hw, IXGBE_FCRTL(i), fcrtl);
IXGBE_WRITE_REG(hw, IXGBE_FCRTH(i), reg); IXGBE_WRITE_REG(hw, IXGBE_FCRTH(i), reg);
......
...@@ -242,7 +242,6 @@ s32 ixgbe_dcb_config_pfc_82599(struct ixgbe_hw *hw, u8 pfc_en, u8 *prio_tc) ...@@ -242,7 +242,6 @@ s32 ixgbe_dcb_config_pfc_82599(struct ixgbe_hw *hw, u8 pfc_en, u8 *prio_tc)
max_tc = prio_tc[i]; max_tc = prio_tc[i];
} }
fcrtl = (hw->fc.low_water << 10) | IXGBE_FCRTL_XONE;
/* Configure PFC Tx thresholds per TC */ /* Configure PFC Tx thresholds per TC */
for (i = 0; i <= max_tc; i++) { for (i = 0; i <= max_tc; i++) {
...@@ -257,6 +256,7 @@ s32 ixgbe_dcb_config_pfc_82599(struct ixgbe_hw *hw, u8 pfc_en, u8 *prio_tc) ...@@ -257,6 +256,7 @@ s32 ixgbe_dcb_config_pfc_82599(struct ixgbe_hw *hw, u8 pfc_en, u8 *prio_tc)
if (enabled) { if (enabled) {
reg = (hw->fc.high_water[i] << 10) | IXGBE_FCRTH_FCEN; reg = (hw->fc.high_water[i] << 10) | IXGBE_FCRTH_FCEN;
fcrtl = (hw->fc.low_water[i] << 10) | IXGBE_FCRTL_XONE;
IXGBE_WRITE_REG(hw, IXGBE_FCRTL_82599(i), fcrtl); IXGBE_WRITE_REG(hw, IXGBE_FCRTL_82599(i), fcrtl);
} else { } else {
reg = IXGBE_READ_REG(hw, IXGBE_RXPBSIZE(i)) - 32; reg = IXGBE_READ_REG(hw, IXGBE_RXPBSIZE(i)) - 32;
......
...@@ -81,9 +81,7 @@ struct ixgbe_fcoe { ...@@ -81,9 +81,7 @@ struct ixgbe_fcoe {
void *extra_ddp_buffer; void *extra_ddp_buffer;
dma_addr_t extra_ddp_buffer_dma; dma_addr_t extra_ddp_buffer_dma;
unsigned long mode; unsigned long mode;
#ifdef CONFIG_IXGBE_DCB
u8 up; u8 up;
#endif
}; };
#endif /* _IXGBE_FCOE_H */ #endif /* _IXGBE_FCOE_H */
...@@ -72,8 +72,6 @@ static int __ixgbe_enable_sriov(struct ixgbe_adapter *adapter) ...@@ -72,8 +72,6 @@ static int __ixgbe_enable_sriov(struct ixgbe_adapter *adapter)
for (i = 0; i < num_vf_macvlans; i++) { for (i = 0; i < num_vf_macvlans; i++) {
mv_list->vf = -1; mv_list->vf = -1;
mv_list->free = true; mv_list->free = true;
mv_list->rar_entry = hw->mac.num_rar_entries -
(i + adapter->num_vfs + 1);
list_add(&mv_list->l, &adapter->vf_mvs.l); list_add(&mv_list->l, &adapter->vf_mvs.l);
mv_list++; mv_list++;
} }
...@@ -327,6 +325,7 @@ static int ixgbe_set_vf_multicasts(struct ixgbe_adapter *adapter, ...@@ -327,6 +325,7 @@ static int ixgbe_set_vf_multicasts(struct ixgbe_adapter *adapter,
u32 vector_bit; u32 vector_bit;
u32 vector_reg; u32 vector_reg;
u32 mta_reg; u32 mta_reg;
u32 vmolr = IXGBE_READ_REG(hw, IXGBE_VMOLR(vf));
/* only so many hash values supported */ /* only so many hash values supported */
entries = min(entries, IXGBE_MAX_VF_MC_ENTRIES); entries = min(entries, IXGBE_MAX_VF_MC_ENTRIES);
...@@ -353,25 +352,13 @@ static int ixgbe_set_vf_multicasts(struct ixgbe_adapter *adapter, ...@@ -353,25 +352,13 @@ static int ixgbe_set_vf_multicasts(struct ixgbe_adapter *adapter,
mta_reg |= (1 << vector_bit); mta_reg |= (1 << vector_bit);
IXGBE_WRITE_REG(hw, IXGBE_MTA(vector_reg), mta_reg); IXGBE_WRITE_REG(hw, IXGBE_MTA(vector_reg), mta_reg);
} }
vmolr |= IXGBE_VMOLR_ROMPE;
IXGBE_WRITE_REG(hw, IXGBE_VMOLR(vf), vmolr);
return 0; return 0;
} }
static void ixgbe_restore_vf_macvlans(struct ixgbe_adapter *adapter) #ifdef CONFIG_PCI_IOV
{
struct ixgbe_hw *hw = &adapter->hw;
struct list_head *pos;
struct vf_macvlans *entry;
list_for_each(pos, &adapter->vf_mvs.l) {
entry = list_entry(pos, struct vf_macvlans, l);
if (!entry->free)
hw->mac.ops.set_rar(hw, entry->rar_entry,
entry->vf_macvlan,
entry->vf, IXGBE_RAH_AV);
}
}
void ixgbe_restore_vf_multicasts(struct ixgbe_adapter *adapter) void ixgbe_restore_vf_multicasts(struct ixgbe_adapter *adapter)
{ {
struct ixgbe_hw *hw = &adapter->hw; struct ixgbe_hw *hw = &adapter->hw;
...@@ -382,6 +369,7 @@ void ixgbe_restore_vf_multicasts(struct ixgbe_adapter *adapter) ...@@ -382,6 +369,7 @@ void ixgbe_restore_vf_multicasts(struct ixgbe_adapter *adapter)
u32 mta_reg; u32 mta_reg;
for (i = 0; i < adapter->num_vfs; i++) { for (i = 0; i < adapter->num_vfs; i++) {
u32 vmolr = IXGBE_READ_REG(hw, IXGBE_VMOLR(i));
vfinfo = &adapter->vfinfo[i]; vfinfo = &adapter->vfinfo[i];
for (j = 0; j < vfinfo->num_vf_mc_hashes; j++) { for (j = 0; j < vfinfo->num_vf_mc_hashes; j++) {
hw->addr_ctrl.mta_in_use++; hw->addr_ctrl.mta_in_use++;
...@@ -391,11 +379,18 @@ void ixgbe_restore_vf_multicasts(struct ixgbe_adapter *adapter) ...@@ -391,11 +379,18 @@ void ixgbe_restore_vf_multicasts(struct ixgbe_adapter *adapter)
mta_reg |= (1 << vector_bit); mta_reg |= (1 << vector_bit);
IXGBE_WRITE_REG(hw, IXGBE_MTA(vector_reg), mta_reg); IXGBE_WRITE_REG(hw, IXGBE_MTA(vector_reg), mta_reg);
} }
if (vfinfo->num_vf_mc_hashes)
vmolr |= IXGBE_VMOLR_ROMPE;
else
vmolr &= ~IXGBE_VMOLR_ROMPE;
IXGBE_WRITE_REG(hw, IXGBE_VMOLR(i), vmolr);
} }
/* Restore any VF macvlans */ /* Restore any VF macvlans */
ixgbe_restore_vf_macvlans(adapter); ixgbe_full_sync_mac_table(adapter);
} }
#endif
static int ixgbe_set_vf_vlan(struct ixgbe_adapter *adapter, int add, int vid, static int ixgbe_set_vf_vlan(struct ixgbe_adapter *adapter, int add, int vid,
u32 vf) u32 vf)
...@@ -495,8 +490,7 @@ static s32 ixgbe_set_vf_lpe(struct ixgbe_adapter *adapter, u32 *msgbuf, u32 vf) ...@@ -495,8 +490,7 @@ static s32 ixgbe_set_vf_lpe(struct ixgbe_adapter *adapter, u32 *msgbuf, u32 vf)
static void ixgbe_set_vmolr(struct ixgbe_hw *hw, u32 vf, bool aupe) static void ixgbe_set_vmolr(struct ixgbe_hw *hw, u32 vf, bool aupe)
{ {
u32 vmolr = IXGBE_READ_REG(hw, IXGBE_VMOLR(vf)); u32 vmolr = IXGBE_READ_REG(hw, IXGBE_VMOLR(vf));
vmolr |= (IXGBE_VMOLR_ROMPE | vmolr |= IXGBE_VMOLR_BAM;
IXGBE_VMOLR_BAM);
if (aupe) if (aupe)
vmolr |= IXGBE_VMOLR_AUPE; vmolr |= IXGBE_VMOLR_AUPE;
else else
...@@ -514,7 +508,6 @@ static inline void ixgbe_vf_reset_event(struct ixgbe_adapter *adapter, u32 vf) ...@@ -514,7 +508,6 @@ static inline void ixgbe_vf_reset_event(struct ixgbe_adapter *adapter, u32 vf)
{ {
struct ixgbe_hw *hw = &adapter->hw; struct ixgbe_hw *hw = &adapter->hw;
struct vf_data_storage *vfinfo = &adapter->vfinfo[vf]; struct vf_data_storage *vfinfo = &adapter->vfinfo[vf];
int rar_entry = hw->mac.num_rar_entries - (vf + 1);
u8 num_tcs = netdev_get_num_tc(adapter->netdev); u8 num_tcs = netdev_get_num_tc(adapter->netdev);
/* add PF assigned VLAN or VLAN 0 */ /* add PF assigned VLAN or VLAN 0 */
...@@ -544,7 +537,7 @@ static inline void ixgbe_vf_reset_event(struct ixgbe_adapter *adapter, u32 vf) ...@@ -544,7 +537,7 @@ static inline void ixgbe_vf_reset_event(struct ixgbe_adapter *adapter, u32 vf)
/* Flush and reset the mta with the new values */ /* Flush and reset the mta with the new values */
ixgbe_set_rx_mode(adapter->netdev); ixgbe_set_rx_mode(adapter->netdev);
hw->mac.ops.clear_rar(hw, rar_entry); ixgbe_del_mac_filter(adapter, adapter->vfinfo[vf].vf_mac_addresses, vf);
/* reset VF api back to unknown */ /* reset VF api back to unknown */
adapter->vfinfo[vf].vf_api = ixgbe_mbox_api_10; adapter->vfinfo[vf].vf_api = ixgbe_mbox_api_10;
...@@ -553,11 +546,9 @@ static inline void ixgbe_vf_reset_event(struct ixgbe_adapter *adapter, u32 vf) ...@@ -553,11 +546,9 @@ static inline void ixgbe_vf_reset_event(struct ixgbe_adapter *adapter, u32 vf)
static int ixgbe_set_vf_mac(struct ixgbe_adapter *adapter, static int ixgbe_set_vf_mac(struct ixgbe_adapter *adapter,
int vf, unsigned char *mac_addr) int vf, unsigned char *mac_addr)
{ {
struct ixgbe_hw *hw = &adapter->hw; ixgbe_del_mac_filter(adapter, adapter->vfinfo[vf].vf_mac_addresses, vf);
int rar_entry = hw->mac.num_rar_entries - (vf + 1);
memcpy(adapter->vfinfo[vf].vf_mac_addresses, mac_addr, ETH_ALEN); memcpy(adapter->vfinfo[vf].vf_mac_addresses, mac_addr, ETH_ALEN);
hw->mac.ops.set_rar(hw, rar_entry, mac_addr, vf, IXGBE_RAH_AV); ixgbe_add_mac_filter(adapter, adapter->vfinfo[vf].vf_mac_addresses, vf);
return 0; return 0;
} }
...@@ -565,7 +556,6 @@ static int ixgbe_set_vf_mac(struct ixgbe_adapter *adapter, ...@@ -565,7 +556,6 @@ static int ixgbe_set_vf_mac(struct ixgbe_adapter *adapter,
static int ixgbe_set_vf_macvlan(struct ixgbe_adapter *adapter, static int ixgbe_set_vf_macvlan(struct ixgbe_adapter *adapter,
int vf, int index, unsigned char *mac_addr) int vf, int index, unsigned char *mac_addr)
{ {
struct ixgbe_hw *hw = &adapter->hw;
struct list_head *pos; struct list_head *pos;
struct vf_macvlans *entry; struct vf_macvlans *entry;
...@@ -576,7 +566,8 @@ static int ixgbe_set_vf_macvlan(struct ixgbe_adapter *adapter, ...@@ -576,7 +566,8 @@ static int ixgbe_set_vf_macvlan(struct ixgbe_adapter *adapter,
entry->vf = -1; entry->vf = -1;
entry->free = true; entry->free = true;
entry->is_macvlan = false; entry->is_macvlan = false;
hw->mac.ops.clear_rar(hw, entry->rar_entry); ixgbe_del_mac_filter(adapter,
entry->vf_macvlan, vf);
} }
} }
} }
...@@ -612,7 +603,7 @@ static int ixgbe_set_vf_macvlan(struct ixgbe_adapter *adapter, ...@@ -612,7 +603,7 @@ static int ixgbe_set_vf_macvlan(struct ixgbe_adapter *adapter,
entry->vf = vf; entry->vf = vf;
memcpy(entry->vf_macvlan, mac_addr, ETH_ALEN); memcpy(entry->vf_macvlan, mac_addr, ETH_ALEN);
hw->mac.ops.set_rar(hw, entry->rar_entry, mac_addr, vf, IXGBE_RAH_AV); ixgbe_add_mac_filter(adapter, mac_addr, vf);
return 0; return 0;
} }
......
...@@ -34,7 +34,9 @@ ...@@ -34,7 +34,9 @@
*/ */
#define IXGBE_MAX_VFS_DRV_LIMIT (IXGBE_MAX_VF_FUNCTIONS - 1) #define IXGBE_MAX_VFS_DRV_LIMIT (IXGBE_MAX_VF_FUNCTIONS - 1)
#ifdef CONFIG_PCI_IOV
void ixgbe_restore_vf_multicasts(struct ixgbe_adapter *adapter); void ixgbe_restore_vf_multicasts(struct ixgbe_adapter *adapter);
#endif
void ixgbe_msg_task(struct ixgbe_adapter *adapter); void ixgbe_msg_task(struct ixgbe_adapter *adapter);
int ixgbe_vf_configuration(struct pci_dev *pdev, unsigned int event_mask); int ixgbe_vf_configuration(struct pci_dev *pdev, unsigned int event_mask);
void ixgbe_disable_tx_rx(struct ixgbe_adapter *adapter); void ixgbe_disable_tx_rx(struct ixgbe_adapter *adapter);
......
...@@ -2746,7 +2746,7 @@ struct ixgbe_bus_info { ...@@ -2746,7 +2746,7 @@ struct ixgbe_bus_info {
/* Flow control parameters */ /* Flow control parameters */
struct ixgbe_fc_info { struct ixgbe_fc_info {
u32 high_water[MAX_TRAFFIC_CLASS]; /* Flow Control High-water */ u32 high_water[MAX_TRAFFIC_CLASS]; /* Flow Control High-water */
u32 low_water; /* Flow Control Low-water */ u32 low_water[MAX_TRAFFIC_CLASS]; /* Flow Control Low-water */
u16 pause_time; /* Flow Control Pause timer */ u16 pause_time; /* Flow Control Pause timer */
bool send_xon; /* Flow control send XON */ bool send_xon; /* Flow control send XON */
bool strict_ieee; /* Strict IEEE mode */ bool strict_ieee; /* Strict IEEE mode */
......
...@@ -85,7 +85,7 @@ static DEFINE_PCI_DEVICE_TABLE(ixgbevf_pci_tbl) = { ...@@ -85,7 +85,7 @@ static DEFINE_PCI_DEVICE_TABLE(ixgbevf_pci_tbl) = {
MODULE_DEVICE_TABLE(pci, ixgbevf_pci_tbl); MODULE_DEVICE_TABLE(pci, ixgbevf_pci_tbl);
MODULE_AUTHOR("Intel Corporation, <linux.nics@intel.com>"); MODULE_AUTHOR("Intel Corporation, <linux.nics@intel.com>");
MODULE_DESCRIPTION("Intel(R) 82599 Virtual Function Driver"); MODULE_DESCRIPTION("Intel(R) 10 Gigabit Virtual Function Network Driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_VERSION(DRV_VERSION); MODULE_VERSION(DRV_VERSION);
......
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