|
@@ -674,9 +674,9 @@ struct net_device *igb_get_hw_dev(struct e1000_hw *hw)
|
|
|
static int __init igb_init_module(void)
|
|
|
{
|
|
|
int ret;
|
|
|
+
|
|
|
pr_info("%s - version %s\n",
|
|
|
igb_driver_string, igb_driver_version);
|
|
|
-
|
|
|
pr_info("%s\n", igb_copyright);
|
|
|
|
|
|
#ifdef CONFIG_IGB_DCA
|
|
@@ -1338,6 +1338,7 @@ static int igb_alloc_q_vectors(struct igb_adapter *adapter)
|
|
|
for (; v_idx < q_vectors; v_idx++) {
|
|
|
int rqpv = DIV_ROUND_UP(rxr_remaining, q_vectors - v_idx);
|
|
|
int tqpv = DIV_ROUND_UP(txr_remaining, q_vectors - v_idx);
|
|
|
+
|
|
|
err = igb_alloc_q_vector(adapter, q_vectors, v_idx,
|
|
|
tqpv, txr_idx, rqpv, rxr_idx);
|
|
|
|
|
@@ -1477,6 +1478,7 @@ static void igb_irq_disable(struct igb_adapter *adapter)
|
|
|
*/
|
|
|
if (adapter->flags & IGB_FLAG_HAS_MSIX) {
|
|
|
u32 regval = rd32(E1000_EIAM);
|
|
|
+
|
|
|
wr32(E1000_EIAM, regval & ~adapter->eims_enable_mask);
|
|
|
wr32(E1000_EIMC, adapter->eims_enable_mask);
|
|
|
regval = rd32(E1000_EIAC);
|
|
@@ -1488,6 +1490,7 @@ static void igb_irq_disable(struct igb_adapter *adapter)
|
|
|
wrfl();
|
|
|
if (adapter->flags & IGB_FLAG_HAS_MSIX) {
|
|
|
int i;
|
|
|
+
|
|
|
for (i = 0; i < adapter->num_q_vectors; i++)
|
|
|
synchronize_irq(adapter->msix_entries[i].vector);
|
|
|
} else {
|
|
@@ -1506,6 +1509,7 @@ static void igb_irq_enable(struct igb_adapter *adapter)
|
|
|
if (adapter->flags & IGB_FLAG_HAS_MSIX) {
|
|
|
u32 ims = E1000_IMS_LSC | E1000_IMS_DOUTSYNC | E1000_IMS_DRSTA;
|
|
|
u32 regval = rd32(E1000_EIAC);
|
|
|
+
|
|
|
wr32(E1000_EIAC, regval | adapter->eims_enable_mask);
|
|
|
regval = rd32(E1000_EIAM);
|
|
|
wr32(E1000_EIAM, regval | adapter->eims_enable_mask);
|
|
@@ -1738,6 +1742,7 @@ int igb_up(struct igb_adapter *adapter)
|
|
|
/* notify VFs that reset has been completed */
|
|
|
if (adapter->vfs_allocated_count) {
|
|
|
u32 reg_data = rd32(E1000_CTRL_EXT);
|
|
|
+
|
|
|
reg_data |= E1000_CTRL_EXT_PFRSTD;
|
|
|
wr32(E1000_CTRL_EXT, reg_data);
|
|
|
}
|
|
@@ -1953,6 +1958,7 @@ void igb_reset(struct igb_adapter *adapter)
|
|
|
/* disable receive for all VFs and wait one second */
|
|
|
if (adapter->vfs_allocated_count) {
|
|
|
int i;
|
|
|
+
|
|
|
for (i = 0 ; i < adapter->vfs_allocated_count; i++)
|
|
|
adapter->vf_data[i].flags &= IGB_VF_FLAG_PF_SET_MAC;
|
|
|
|
|
@@ -3070,6 +3076,7 @@ static int __igb_open(struct net_device *netdev, bool resuming)
|
|
|
/* notify VFs that reset has been completed */
|
|
|
if (adapter->vfs_allocated_count) {
|
|
|
u32 reg_data = rd32(E1000_CTRL_EXT);
|
|
|
+
|
|
|
reg_data |= E1000_CTRL_EXT_PFRSTD;
|
|
|
wr32(E1000_CTRL_EXT, reg_data);
|
|
|
}
|
|
@@ -3241,7 +3248,7 @@ void igb_setup_tctl(struct igb_adapter *adapter)
|
|
|
* Configure a transmit ring after a reset.
|
|
|
**/
|
|
|
void igb_configure_tx_ring(struct igb_adapter *adapter,
|
|
|
- struct igb_ring *ring)
|
|
|
+ struct igb_ring *ring)
|
|
|
{
|
|
|
struct e1000_hw *hw = &adapter->hw;
|
|
|
u32 txdctl = 0;
|
|
@@ -3423,6 +3430,7 @@ static void igb_setup_mrqc(struct igb_adapter *adapter)
|
|
|
if (hw->mac.type > e1000_82575) {
|
|
|
/* Set the default pool for the PF's first queue */
|
|
|
u32 vtctl = rd32(E1000_VT_CTL);
|
|
|
+
|
|
|
vtctl &= ~(E1000_VT_CTL_DEFAULT_POOL_MASK |
|
|
|
E1000_VT_CTL_DISABLE_DEF_POOL);
|
|
|
vtctl |= adapter->vfs_allocated_count <<
|
|
@@ -3504,7 +3512,7 @@ void igb_setup_rctl(struct igb_adapter *adapter)
|
|
|
}
|
|
|
|
|
|
static inline int igb_set_vf_rlpml(struct igb_adapter *adapter, int size,
|
|
|
- int vfn)
|
|
|
+ int vfn)
|
|
|
{
|
|
|
struct e1000_hw *hw = &adapter->hw;
|
|
|
u32 vmolr;
|
|
@@ -4070,7 +4078,7 @@ static void igb_spoof_check(struct igb_adapter *adapter)
|
|
|
if (!adapter->wvbr)
|
|
|
return;
|
|
|
|
|
|
- for(j = 0; j < adapter->vfs_allocated_count; j++) {
|
|
|
+ for (j = 0; j < adapter->vfs_allocated_count; j++) {
|
|
|
if (adapter->wvbr & (1 << j) ||
|
|
|
adapter->wvbr & (1 << (j + IGB_STAGGERED_QUEUE_OFFSET))) {
|
|
|
dev_warn(&adapter->pdev->dev,
|
|
@@ -4202,6 +4210,7 @@ static void igb_watchdog_task(struct work_struct *work)
|
|
|
|
|
|
if (!netif_carrier_ok(netdev)) {
|
|
|
u32 ctrl;
|
|
|
+
|
|
|
hw->mac.ops.get_speed_and_duplex(hw,
|
|
|
&adapter->link_speed,
|
|
|
&adapter->link_duplex);
|
|
@@ -4333,6 +4342,7 @@ static void igb_watchdog_task(struct work_struct *work)
|
|
|
/* Cause software interrupt to ensure Rx ring is cleaned */
|
|
|
if (adapter->flags & IGB_FLAG_HAS_MSIX) {
|
|
|
u32 eics = 0;
|
|
|
+
|
|
|
for (i = 0; i < adapter->num_q_vectors; i++)
|
|
|
eics |= adapter->q_vector[i]->eims_value;
|
|
|
wr32(E1000_EICS, eics);
|
|
@@ -4663,6 +4673,7 @@ static void igb_tx_csum(struct igb_ring *tx_ring, struct igb_tx_buffer *first)
|
|
|
return;
|
|
|
} else {
|
|
|
u8 l4_hdr = 0;
|
|
|
+
|
|
|
switch (first->protocol) {
|
|
|
case htons(ETH_P_IP):
|
|
|
vlan_macip_lens |= skb_network_header_len(skb);
|
|
@@ -4950,6 +4961,7 @@ netdev_tx_t igb_xmit_frame_ring(struct sk_buff *skb,
|
|
|
*/
|
|
|
if (NETDEV_FRAG_PAGE_MAX_SIZE > IGB_MAX_DATA_PER_TXD) {
|
|
|
unsigned short f;
|
|
|
+
|
|
|
for (f = 0; f < skb_shinfo(skb)->nr_frags; f++)
|
|
|
count += TXD_USE_COUNT(skb_shinfo(skb)->frags[f].size);
|
|
|
} else {
|
|
@@ -5607,6 +5619,7 @@ static int igb_set_vf_promisc(struct igb_adapter *adapter, u32 *msgbuf, u32 vf)
|
|
|
vmolr |= E1000_VMOLR_MPME;
|
|
|
} else if (vf_data->num_vf_mc_hashes) {
|
|
|
int j;
|
|
|
+
|
|
|
vmolr |= E1000_VMOLR_ROMPE;
|
|
|
for (j = 0; j < vf_data->num_vf_mc_hashes; j++)
|
|
|
igb_mta_set(hw, vf_data->vf_mc_hashes[j]);
|
|
@@ -5658,6 +5671,7 @@ static void igb_restore_vf_multicasts(struct igb_adapter *adapter)
|
|
|
|
|
|
for (i = 0; i < adapter->vfs_allocated_count; i++) {
|
|
|
u32 vmolr = rd32(E1000_VMOLR(i));
|
|
|
+
|
|
|
vmolr &= ~(E1000_VMOLR_ROMPE | E1000_VMOLR_MPME);
|
|
|
|
|
|
vf_data = &adapter->vf_data[i];
|
|
@@ -5756,6 +5770,7 @@ static s32 igb_vlvf_set(struct igb_adapter *adapter, u32 vid, bool add, u32 vf)
|
|
|
|
|
|
if (!adapter->vf_data[vf].vlans_enabled) {
|
|
|
u32 size;
|
|
|
+
|
|
|
reg = rd32(E1000_VMOLR(vf));
|
|
|
size = reg & E1000_VMOLR_RLPML_MASK;
|
|
|
size += 4;
|
|
@@ -5784,6 +5799,7 @@ static s32 igb_vlvf_set(struct igb_adapter *adapter, u32 vid, bool add, u32 vf)
|
|
|
adapter->vf_data[vf].vlans_enabled--;
|
|
|
if (!adapter->vf_data[vf].vlans_enabled) {
|
|
|
u32 size;
|
|
|
+
|
|
|
reg = rd32(E1000_VMOLR(vf));
|
|
|
size = reg & E1000_VMOLR_RLPML_MASK;
|
|
|
size -= 4;
|
|
@@ -5888,8 +5904,8 @@ static int igb_set_vf_vlan(struct igb_adapter *adapter, u32 *msgbuf, u32 vf)
|
|
|
*/
|
|
|
if (!add && (adapter->netdev->flags & IFF_PROMISC)) {
|
|
|
u32 vlvf, bits;
|
|
|
-
|
|
|
int regndx = igb_find_vlvf_entry(adapter, vid);
|
|
|
+
|
|
|
if (regndx < 0)
|
|
|
goto out;
|
|
|
/* See if any other pools are set for this VLAN filter
|
|
@@ -6949,6 +6965,7 @@ static void igb_process_skb_fields(struct igb_ring *rx_ring,
|
|
|
if ((dev->features & NETIF_F_HW_VLAN_CTAG_RX) &&
|
|
|
igb_test_staterr(rx_desc, E1000_RXD_STAT_VP)) {
|
|
|
u16 vid;
|
|
|
+
|
|
|
if (igb_test_staterr(rx_desc, E1000_RXDEXT_STATERR_LB) &&
|
|
|
test_bit(IGB_RING_FLAG_RX_LB_VLAN_BSWAP, &rx_ring->flags))
|
|
|
vid = be16_to_cpu(rx_desc->wb.upper.vlan);
|
|
@@ -7158,7 +7175,7 @@ static int igb_mii_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
|
|
|
break;
|
|
|
case SIOCGMIIREG:
|
|
|
if (igb_read_phy_reg(&adapter->hw, data->reg_num & 0x1F,
|
|
|
- &data->val_out))
|
|
|
+ &data->val_out))
|
|
|
return -EIO;
|
|
|
break;
|
|
|
case SIOCSMIIREG:
|
|
@@ -8035,6 +8052,7 @@ static void igb_init_dmac(struct igb_adapter *adapter, u32 pba)
|
|
|
} /* endif adapter->dmac is not disabled */
|
|
|
} else if (hw->mac.type == e1000_82580) {
|
|
|
u32 reg = rd32(E1000_PCIEMISC);
|
|
|
+
|
|
|
wr32(E1000_PCIEMISC, reg & ~E1000_PCIEMISC_LX_DECISION);
|
|
|
wr32(E1000_DMACR, 0);
|
|
|
}
|