Commit dcfba949 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

Jeff Kirsher says:

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

This series contains updates to e1000, e1000e, igb, igbvf, ixgb, ixgbe,
ixgbevf and i40evf.

Mark fixes an issue with ixgbe and ixgbevf by adding a bit to indicate
when workqueues have been initialized.  This permits the register read
error handling from attempting to use them prior to that, which also
generates warnings.  Checking for a detected removal after initializing
the work queues allows the probe function to return an error without
getting the workqueue involved.  Further, if the error_detected
callback is entered before the workqueues are initialized, exit without
recovery since the device initialization was so truncated.

Francois Romieu provides several patches to all the drivers to remove
the open coded skb_cow_head.

Jakub Kicinski provides a fix for igb where last_rx_timestamp should be
updated only when Rx time stamp is read.

Mitch provides a fix for i40evf where a recent change broke the RSS LUT
programming causing it to be programmed with all 0's.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 0f2eea4b 5b7af02c
This diff is collapsed.
...@@ -2682,14 +2682,13 @@ static int e1000_tso(struct e1000_adapter *adapter, ...@@ -2682,14 +2682,13 @@ static int e1000_tso(struct e1000_adapter *adapter,
u32 cmd_length = 0; u32 cmd_length = 0;
u16 ipcse = 0, tucse, mss; u16 ipcse = 0, tucse, mss;
u8 ipcss, ipcso, tucss, tucso, hdr_len; u8 ipcss, ipcso, tucss, tucso, hdr_len;
int err;
if (skb_is_gso(skb)) { if (skb_is_gso(skb)) {
if (skb_header_cloned(skb)) { int err;
err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC);
if (err) err = skb_cow_head(skb, 0);
return err; if (err < 0)
} return err;
hdr_len = skb_transport_offset(skb) + tcp_hdrlen(skb); hdr_len = skb_transport_offset(skb) + tcp_hdrlen(skb);
mss = skb_shinfo(skb)->gso_size; mss = skb_shinfo(skb)->gso_size;
......
...@@ -5100,16 +5100,14 @@ static int e1000_tso(struct e1000_ring *tx_ring, struct sk_buff *skb) ...@@ -5100,16 +5100,14 @@ static int e1000_tso(struct e1000_ring *tx_ring, struct sk_buff *skb)
u32 cmd_length = 0; u32 cmd_length = 0;
u16 ipcse = 0, mss; u16 ipcse = 0, mss;
u8 ipcss, ipcso, tucss, tucso, hdr_len; u8 ipcss, ipcso, tucss, tucso, hdr_len;
int err;
if (!skb_is_gso(skb)) if (!skb_is_gso(skb))
return 0; return 0;
if (skb_header_cloned(skb)) { err = skb_cow_head(skb, 0);
int err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC); if (err < 0)
return err;
if (err)
return err;
}
hdr_len = skb_transport_offset(skb) + tcp_hdrlen(skb); hdr_len = skb_transport_offset(skb) + tcp_hdrlen(skb);
mss = skb_shinfo(skb)->gso_size; mss = skb_shinfo(skb)->gso_size;
......
...@@ -1114,20 +1114,18 @@ static int i40e_tso(struct i40e_ring *tx_ring, struct sk_buff *skb, ...@@ -1114,20 +1114,18 @@ static int i40e_tso(struct i40e_ring *tx_ring, struct sk_buff *skb,
u64 *cd_type_cmd_tso_mss, u32 *cd_tunneling) u64 *cd_type_cmd_tso_mss, u32 *cd_tunneling)
{ {
u32 cd_cmd, cd_tso_len, cd_mss; u32 cd_cmd, cd_tso_len, cd_mss;
struct ipv6hdr *ipv6h;
struct tcphdr *tcph; struct tcphdr *tcph;
struct iphdr *iph; struct iphdr *iph;
u32 l4len; u32 l4len;
int err; int err;
struct ipv6hdr *ipv6h;
if (!skb_is_gso(skb)) if (!skb_is_gso(skb))
return 0; return 0;
if (skb_header_cloned(skb)) { err = skb_cow_head(skb, 0);
err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC); if (err < 0)
if (err) return err;
return err;
}
if (protocol == htons(ETH_P_IP)) { if (protocol == htons(ETH_P_IP)) {
iph = skb->encapsulation ? inner_ip_hdr(skb) : ip_hdr(skb); iph = skb->encapsulation ? inner_ip_hdr(skb) : ip_hdr(skb);
......
...@@ -1412,6 +1412,14 @@ static void i40evf_watchdog_task(struct work_struct *work) ...@@ -1412,6 +1412,14 @@ static void i40evf_watchdog_task(struct work_struct *work)
schedule_work(&adapter->adminq_task); schedule_work(&adapter->adminq_task);
} }
/**
* i40evf_configure_rss - increment to next available tx queue
* @adapter: board private structure
* @j: queue counter
*
* Helper function for RSS programming to increment through available
* queus. Returns the next queue value.
**/
static int next_queue(struct i40evf_adapter *adapter, int j) static int next_queue(struct i40evf_adapter *adapter, int j)
{ {
j += 1; j += 1;
...@@ -1451,10 +1459,14 @@ static void i40evf_configure_rss(struct i40evf_adapter *adapter) ...@@ -1451,10 +1459,14 @@ static void i40evf_configure_rss(struct i40evf_adapter *adapter)
/* Populate the LUT with max no. of queues in round robin fashion */ /* Populate the LUT with max no. of queues in round robin fashion */
j = adapter->vsi_res->num_queue_pairs; j = adapter->vsi_res->num_queue_pairs;
for (i = 0; i <= I40E_VFQF_HLUT_MAX_INDEX; i++) { for (i = 0; i <= I40E_VFQF_HLUT_MAX_INDEX; i++) {
lut = next_queue(adapter, j); j = next_queue(adapter, j);
lut |= next_queue(adapter, j) << 8; lut = j;
lut |= next_queue(adapter, j) << 16; j = next_queue(adapter, j);
lut |= next_queue(adapter, j) << 24; lut |= j << 8;
j = next_queue(adapter, j);
lut |= j << 16;
j = next_queue(adapter, j);
lut |= j << 24;
wr32(hw, I40E_VFQF_HLUT(i), lut); wr32(hw, I40E_VFQF_HLUT(i), lut);
} }
i40e_flush(hw); i40e_flush(hw);
......
...@@ -241,7 +241,6 @@ struct igb_ring { ...@@ -241,7 +241,6 @@ struct igb_ring {
struct igb_tx_buffer *tx_buffer_info; struct igb_tx_buffer *tx_buffer_info;
struct igb_rx_buffer *rx_buffer_info; struct igb_rx_buffer *rx_buffer_info;
}; };
unsigned long last_rx_timestamp;
void *desc; /* descriptor ring memory */ void *desc; /* descriptor ring memory */
unsigned long flags; /* ring specific flags */ unsigned long flags; /* ring specific flags */
void __iomem *tail; /* pointer to ring tail register */ void __iomem *tail; /* pointer to ring tail register */
...@@ -437,6 +436,7 @@ struct igb_adapter { ...@@ -437,6 +436,7 @@ struct igb_adapter {
struct hwtstamp_config tstamp_config; struct hwtstamp_config tstamp_config;
unsigned long ptp_tx_start; unsigned long ptp_tx_start;
unsigned long last_rx_ptp_check; unsigned long last_rx_ptp_check;
unsigned long last_rx_timestamp;
spinlock_t tmreg_lock; spinlock_t tmreg_lock;
struct cyclecounter cc; struct cyclecounter cc;
struct timecounter tc; struct timecounter tc;
...@@ -533,20 +533,6 @@ void igb_ptp_rx_hang(struct igb_adapter *adapter); ...@@ -533,20 +533,6 @@ void igb_ptp_rx_hang(struct igb_adapter *adapter);
void igb_ptp_rx_rgtstamp(struct igb_q_vector *q_vector, struct sk_buff *skb); void igb_ptp_rx_rgtstamp(struct igb_q_vector *q_vector, struct sk_buff *skb);
void igb_ptp_rx_pktstamp(struct igb_q_vector *q_vector, unsigned char *va, void igb_ptp_rx_pktstamp(struct igb_q_vector *q_vector, unsigned char *va,
struct sk_buff *skb); struct sk_buff *skb);
static inline void igb_ptp_rx_hwtstamp(struct igb_ring *rx_ring,
union e1000_adv_rx_desc *rx_desc,
struct sk_buff *skb)
{
if (igb_test_staterr(rx_desc, E1000_RXDADV_STAT_TS) &&
!igb_test_staterr(rx_desc, E1000_RXDADV_STAT_TSIP))
igb_ptp_rx_rgtstamp(rx_ring->q_vector, skb);
/* Update the last_rx_timestamp timer in order to enable watchdog check
* for error case of latched timestamp on a dropped packet.
*/
rx_ring->last_rx_timestamp = jiffies;
}
int igb_ptp_set_ts_config(struct net_device *netdev, struct ifreq *ifr); int igb_ptp_set_ts_config(struct net_device *netdev, struct ifreq *ifr);
int igb_ptp_get_ts_config(struct net_device *netdev, struct ifreq *ifr); int igb_ptp_get_ts_config(struct net_device *netdev, struct ifreq *ifr);
#ifdef CONFIG_IGB_HWMON #ifdef CONFIG_IGB_HWMON
......
...@@ -4605,6 +4605,7 @@ static int igb_tso(struct igb_ring *tx_ring, ...@@ -4605,6 +4605,7 @@ static int igb_tso(struct igb_ring *tx_ring,
struct sk_buff *skb = first->skb; struct sk_buff *skb = first->skb;
u32 vlan_macip_lens, type_tucmd; u32 vlan_macip_lens, type_tucmd;
u32 mss_l4len_idx, l4len; u32 mss_l4len_idx, l4len;
int err;
if (skb->ip_summed != CHECKSUM_PARTIAL) if (skb->ip_summed != CHECKSUM_PARTIAL)
return 0; return 0;
...@@ -4612,11 +4613,9 @@ static int igb_tso(struct igb_ring *tx_ring, ...@@ -4612,11 +4613,9 @@ static int igb_tso(struct igb_ring *tx_ring,
if (!skb_is_gso(skb)) if (!skb_is_gso(skb))
return 0; return 0;
if (skb_header_cloned(skb)) { err = skb_cow_head(skb, 0);
int err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC); if (err < 0)
if (err) return err;
return err;
}
/* ADV DTYP TUCMD MKRLOC/ISCSIHEDLEN */ /* ADV DTYP TUCMD MKRLOC/ISCSIHEDLEN */
type_tucmd = E1000_ADVTXD_TUCMD_L4T_TCP; type_tucmd = E1000_ADVTXD_TUCMD_L4T_TCP;
...@@ -6955,7 +6954,9 @@ static void igb_process_skb_fields(struct igb_ring *rx_ring, ...@@ -6955,7 +6954,9 @@ static void igb_process_skb_fields(struct igb_ring *rx_ring,
igb_rx_checksum(rx_ring, rx_desc, skb); igb_rx_checksum(rx_ring, rx_desc, skb);
igb_ptp_rx_hwtstamp(rx_ring, rx_desc, skb); if (igb_test_staterr(rx_desc, E1000_RXDADV_STAT_TS) &&
!igb_test_staterr(rx_desc, E1000_RXDADV_STAT_TSIP))
igb_ptp_rx_rgtstamp(rx_ring->q_vector, skb);
if ((dev->features & NETIF_F_HW_VLAN_CTAG_RX) && if ((dev->features & NETIF_F_HW_VLAN_CTAG_RX) &&
igb_test_staterr(rx_desc, E1000_RXD_STAT_VP)) { igb_test_staterr(rx_desc, E1000_RXD_STAT_VP)) {
......
...@@ -427,10 +427,8 @@ static void igb_ptp_overflow_check(struct work_struct *work) ...@@ -427,10 +427,8 @@ static void igb_ptp_overflow_check(struct work_struct *work)
void igb_ptp_rx_hang(struct igb_adapter *adapter) void igb_ptp_rx_hang(struct igb_adapter *adapter)
{ {
struct e1000_hw *hw = &adapter->hw; struct e1000_hw *hw = &adapter->hw;
struct igb_ring *rx_ring;
u32 tsyncrxctl = rd32(E1000_TSYNCRXCTL); u32 tsyncrxctl = rd32(E1000_TSYNCRXCTL);
unsigned long rx_event; unsigned long rx_event;
int n;
if (hw->mac.type != e1000_82576) if (hw->mac.type != e1000_82576)
return; return;
...@@ -445,11 +443,8 @@ void igb_ptp_rx_hang(struct igb_adapter *adapter) ...@@ -445,11 +443,8 @@ void igb_ptp_rx_hang(struct igb_adapter *adapter)
/* Determine the most recent watchdog or rx_timestamp event */ /* Determine the most recent watchdog or rx_timestamp event */
rx_event = adapter->last_rx_ptp_check; rx_event = adapter->last_rx_ptp_check;
for (n = 0; n < adapter->num_rx_queues; n++) { if (time_after(adapter->last_rx_timestamp, rx_event))
rx_ring = adapter->rx_ring[n]; rx_event = adapter->last_rx_timestamp;
if (time_after(rx_ring->last_rx_timestamp, rx_event))
rx_event = rx_ring->last_rx_timestamp;
}
/* Only need to read the high RXSTMP register to clear the lock */ /* Only need to read the high RXSTMP register to clear the lock */
if (time_is_before_jiffies(rx_event + 5 * HZ)) { if (time_is_before_jiffies(rx_event + 5 * HZ)) {
...@@ -540,6 +535,11 @@ void igb_ptp_rx_rgtstamp(struct igb_q_vector *q_vector, ...@@ -540,6 +535,11 @@ void igb_ptp_rx_rgtstamp(struct igb_q_vector *q_vector,
regval |= (u64)rd32(E1000_RXSTMPH) << 32; regval |= (u64)rd32(E1000_RXSTMPH) << 32;
igb_ptp_systim_to_hwtstamp(adapter, skb_hwtstamps(skb), regval); igb_ptp_systim_to_hwtstamp(adapter, skb_hwtstamps(skb), regval);
/* Update the last_rx_timestamp timer in order to enable watchdog check
* for error case of latched timestamp on a dropped packet.
*/
adapter->last_rx_timestamp = jiffies;
} }
/** /**
......
...@@ -1910,20 +1910,18 @@ static int igbvf_tso(struct igbvf_adapter *adapter, ...@@ -1910,20 +1910,18 @@ static int igbvf_tso(struct igbvf_adapter *adapter,
struct sk_buff *skb, u32 tx_flags, u8 *hdr_len) struct sk_buff *skb, u32 tx_flags, u8 *hdr_len)
{ {
struct e1000_adv_tx_context_desc *context_desc; struct e1000_adv_tx_context_desc *context_desc;
unsigned int i;
int err;
struct igbvf_buffer *buffer_info; struct igbvf_buffer *buffer_info;
u32 info = 0, tu_cmd = 0; u32 info = 0, tu_cmd = 0;
u32 mss_l4len_idx, l4len; u32 mss_l4len_idx, l4len;
unsigned int i;
int err;
*hdr_len = 0; *hdr_len = 0;
if (skb_header_cloned(skb)) { err = skb_cow_head(skb, 0);
err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC); if (err < 0) {
if (err) { dev_err(&adapter->pdev->dev, "igbvf_tso returning an error\n");
dev_err(&adapter->pdev->dev, return err;
"igbvf_tso returning an error\n");
return err;
}
} }
l4len = tcp_hdrlen(skb); l4len = tcp_hdrlen(skb);
......
...@@ -1220,17 +1220,15 @@ ixgb_tso(struct ixgb_adapter *adapter, struct sk_buff *skb) ...@@ -1220,17 +1220,15 @@ ixgb_tso(struct ixgb_adapter *adapter, struct sk_buff *skb)
unsigned int i; unsigned int i;
u8 ipcss, ipcso, tucss, tucso, hdr_len; u8 ipcss, ipcso, tucss, tucso, hdr_len;
u16 ipcse, tucse, mss; u16 ipcse, tucse, mss;
int err;
if (likely(skb_is_gso(skb))) { if (likely(skb_is_gso(skb))) {
struct ixgb_buffer *buffer_info; struct ixgb_buffer *buffer_info;
struct iphdr *iph; struct iphdr *iph;
int err;
if (skb_header_cloned(skb)) { err = skb_cow_head(skb, 0);
err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC); if (err < 0)
if (err) return err;
return err;
}
hdr_len = skb_transport_offset(skb) + tcp_hdrlen(skb); hdr_len = skb_transport_offset(skb) + tcp_hdrlen(skb);
mss = skb_shinfo(skb)->gso_size; mss = skb_shinfo(skb)->gso_size;
......
...@@ -811,6 +811,7 @@ enum ixgbe_state_t { ...@@ -811,6 +811,7 @@ enum ixgbe_state_t {
__IXGBE_DISABLED, __IXGBE_DISABLED,
__IXGBE_REMOVING, __IXGBE_REMOVING,
__IXGBE_SERVICE_SCHED, __IXGBE_SERVICE_SCHED,
__IXGBE_SERVICE_INITED,
__IXGBE_IN_SFP_INIT, __IXGBE_IN_SFP_INIT,
__IXGBE_PTP_RUNNING, __IXGBE_PTP_RUNNING,
__IXGBE_PTP_TX_IN_PROGRESS, __IXGBE_PTP_TX_IN_PROGRESS,
......
...@@ -297,7 +297,8 @@ static void ixgbe_remove_adapter(struct ixgbe_hw *hw) ...@@ -297,7 +297,8 @@ static void ixgbe_remove_adapter(struct ixgbe_hw *hw)
return; return;
hw->hw_addr = NULL; hw->hw_addr = NULL;
e_dev_err("Adapter removed\n"); e_dev_err("Adapter removed\n");
ixgbe_service_event_schedule(adapter); if (test_bit(__IXGBE_SERVICE_INITED, &adapter->state))
ixgbe_service_event_schedule(adapter);
} }
void ixgbe_check_remove(struct ixgbe_hw *hw, u32 reg) void ixgbe_check_remove(struct ixgbe_hw *hw, u32 reg)
...@@ -6509,6 +6510,7 @@ static int ixgbe_tso(struct ixgbe_ring *tx_ring, ...@@ -6509,6 +6510,7 @@ static int ixgbe_tso(struct ixgbe_ring *tx_ring,
struct sk_buff *skb = first->skb; struct sk_buff *skb = first->skb;
u32 vlan_macip_lens, type_tucmd; u32 vlan_macip_lens, type_tucmd;
u32 mss_l4len_idx, l4len; u32 mss_l4len_idx, l4len;
int err;
if (skb->ip_summed != CHECKSUM_PARTIAL) if (skb->ip_summed != CHECKSUM_PARTIAL)
return 0; return 0;
...@@ -6516,11 +6518,9 @@ static int ixgbe_tso(struct ixgbe_ring *tx_ring, ...@@ -6516,11 +6518,9 @@ static int ixgbe_tso(struct ixgbe_ring *tx_ring,
if (!skb_is_gso(skb)) if (!skb_is_gso(skb))
return 0; return 0;
if (skb_header_cloned(skb)) { err = skb_cow_head(skb, 0);
int err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC); if (err < 0)
if (err) return err;
return err;
}
/* ADV DTYP TUCMD MKRLOC/ISCSIHEDLEN */ /* ADV DTYP TUCMD MKRLOC/ISCSIHEDLEN */
type_tucmd = IXGBE_ADVTXD_TUCMD_L4T_TCP; type_tucmd = IXGBE_ADVTXD_TUCMD_L4T_TCP;
...@@ -7077,8 +7077,8 @@ netdev_tx_t ixgbe_xmit_frame_ring(struct sk_buff *skb, ...@@ -7077,8 +7077,8 @@ netdev_tx_t ixgbe_xmit_frame_ring(struct sk_buff *skb,
IXGBE_TX_FLAGS_VLAN_PRIO_SHIFT; IXGBE_TX_FLAGS_VLAN_PRIO_SHIFT;
if (tx_flags & IXGBE_TX_FLAGS_SW_VLAN) { if (tx_flags & IXGBE_TX_FLAGS_SW_VLAN) {
struct vlan_ethhdr *vhdr; struct vlan_ethhdr *vhdr;
if (skb_header_cloned(skb) &&
pskb_expand_head(skb, 0, 0, GFP_ATOMIC)) if (skb_cow_head(skb, 0))
goto out_drop; goto out_drop;
vhdr = (struct vlan_ethhdr *)skb->data; vhdr = (struct vlan_ethhdr *)skb->data;
vhdr->h_vlan_TCI = htons(tx_flags >> vhdr->h_vlan_TCI = htons(tx_flags >>
...@@ -8023,6 +8023,10 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -8023,6 +8023,10 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
/* EEPROM */ /* EEPROM */
memcpy(&hw->eeprom.ops, ii->eeprom_ops, sizeof(hw->eeprom.ops)); memcpy(&hw->eeprom.ops, ii->eeprom_ops, sizeof(hw->eeprom.ops));
eec = IXGBE_READ_REG(hw, IXGBE_EEC); eec = IXGBE_READ_REG(hw, IXGBE_EEC);
if (ixgbe_removed(hw->hw_addr)) {
err = -EIO;
goto err_ioremap;
}
/* If EEPROM is valid (bit 8 = 1), use default otherwise use bit bang */ /* If EEPROM is valid (bit 8 = 1), use default otherwise use bit bang */
if (!(eec & (1 << 8))) if (!(eec & (1 << 8)))
hw->eeprom.ops.read = &ixgbe_read_eeprom_bit_bang_generic; hw->eeprom.ops.read = &ixgbe_read_eeprom_bit_bang_generic;
...@@ -8185,7 +8189,12 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -8185,7 +8189,12 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
setup_timer(&adapter->service_timer, &ixgbe_service_timer, setup_timer(&adapter->service_timer, &ixgbe_service_timer,
(unsigned long) adapter); (unsigned long) adapter);
if (ixgbe_removed(hw->hw_addr)) {
err = -EIO;
goto err_sw_init;
}
INIT_WORK(&adapter->service_task, ixgbe_service_task); INIT_WORK(&adapter->service_task, ixgbe_service_task);
set_bit(__IXGBE_SERVICE_INITED, &adapter->state);
clear_bit(__IXGBE_SERVICE_SCHED, &adapter->state); clear_bit(__IXGBE_SERVICE_SCHED, &adapter->state);
err = ixgbe_init_interrupt_scheme(adapter); err = ixgbe_init_interrupt_scheme(adapter);
...@@ -8494,6 +8503,9 @@ static pci_ers_result_t ixgbe_io_error_detected(struct pci_dev *pdev, ...@@ -8494,6 +8503,9 @@ static pci_ers_result_t ixgbe_io_error_detected(struct pci_dev *pdev,
skip_bad_vf_detection: skip_bad_vf_detection:
#endif /* CONFIG_PCI_IOV */ #endif /* CONFIG_PCI_IOV */
if (!test_bit(__IXGBE_SERVICE_INITED, &adapter->state))
return PCI_ERS_RESULT_DISCONNECT;
rtnl_lock(); rtnl_lock();
netif_device_detach(netdev); netif_device_detach(netdev);
......
...@@ -421,6 +421,7 @@ enum ixbgevf_state_t { ...@@ -421,6 +421,7 @@ enum ixbgevf_state_t {
__IXGBEVF_DOWN, __IXGBEVF_DOWN,
__IXGBEVF_DISABLED, __IXGBEVF_DISABLED,
__IXGBEVF_REMOVING, __IXGBEVF_REMOVING,
__IXGBEVF_WORK_INIT,
}; };
struct ixgbevf_cb { struct ixgbevf_cb {
......
...@@ -107,7 +107,8 @@ static void ixgbevf_remove_adapter(struct ixgbe_hw *hw) ...@@ -107,7 +107,8 @@ static void ixgbevf_remove_adapter(struct ixgbe_hw *hw)
return; return;
hw->hw_addr = NULL; hw->hw_addr = NULL;
dev_err(&adapter->pdev->dev, "Adapter removed\n"); dev_err(&adapter->pdev->dev, "Adapter removed\n");
schedule_work(&adapter->watchdog_task); if (test_bit(__IXGBEVF_WORK_INIT, &adapter->state))
schedule_work(&adapter->watchdog_task);
} }
static void ixgbevf_check_remove(struct ixgbe_hw *hw, u32 reg) static void ixgbevf_check_remove(struct ixgbe_hw *hw, u32 reg)
...@@ -2838,6 +2839,7 @@ static int ixgbevf_tso(struct ixgbevf_ring *tx_ring, ...@@ -2838,6 +2839,7 @@ static int ixgbevf_tso(struct ixgbevf_ring *tx_ring,
struct sk_buff *skb = first->skb; struct sk_buff *skb = first->skb;
u32 vlan_macip_lens, type_tucmd; u32 vlan_macip_lens, type_tucmd;
u32 mss_l4len_idx, l4len; u32 mss_l4len_idx, l4len;
int err;
if (skb->ip_summed != CHECKSUM_PARTIAL) if (skb->ip_summed != CHECKSUM_PARTIAL)
return 0; return 0;
...@@ -2845,11 +2847,9 @@ static int ixgbevf_tso(struct ixgbevf_ring *tx_ring, ...@@ -2845,11 +2847,9 @@ static int ixgbevf_tso(struct ixgbevf_ring *tx_ring,
if (!skb_is_gso(skb)) if (!skb_is_gso(skb))
return 0; return 0;
if (skb_header_cloned(skb)) { err = skb_cow_head(skb, 0);
int err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC); if (err < 0)
if (err) return err;
return err;
}
/* ADV DTYP TUCMD MKRLOC/ISCSIHEDLEN */ /* ADV DTYP TUCMD MKRLOC/ISCSIHEDLEN */
type_tucmd = IXGBE_ADVTXD_TUCMD_L4T_TCP; type_tucmd = IXGBE_ADVTXD_TUCMD_L4T_TCP;
...@@ -3573,8 +3573,13 @@ static int ixgbevf_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -3573,8 +3573,13 @@ static int ixgbevf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
adapter->watchdog_timer.function = ixgbevf_watchdog; adapter->watchdog_timer.function = ixgbevf_watchdog;
adapter->watchdog_timer.data = (unsigned long)adapter; adapter->watchdog_timer.data = (unsigned long)adapter;
if (IXGBE_REMOVED(hw->hw_addr)) {
err = -EIO;
goto err_sw_init;
}
INIT_WORK(&adapter->reset_task, ixgbevf_reset_task); INIT_WORK(&adapter->reset_task, ixgbevf_reset_task);
INIT_WORK(&adapter->watchdog_task, ixgbevf_watchdog_task); INIT_WORK(&adapter->watchdog_task, ixgbevf_watchdog_task);
set_bit(__IXGBEVF_WORK_INIT, &adapter->state);
err = ixgbevf_init_interrupt_scheme(adapter); err = ixgbevf_init_interrupt_scheme(adapter);
if (err) if (err)
...@@ -3667,6 +3672,9 @@ static pci_ers_result_t ixgbevf_io_error_detected(struct pci_dev *pdev, ...@@ -3667,6 +3672,9 @@ static pci_ers_result_t ixgbevf_io_error_detected(struct pci_dev *pdev,
struct net_device *netdev = pci_get_drvdata(pdev); struct net_device *netdev = pci_get_drvdata(pdev);
struct ixgbevf_adapter *adapter = netdev_priv(netdev); struct ixgbevf_adapter *adapter = netdev_priv(netdev);
if (!test_bit(__IXGBEVF_WORK_INIT, &adapter->state))
return PCI_ERS_RESULT_DISCONNECT;
rtnl_lock(); rtnl_lock();
netif_device_detach(netdev); netif_device_detach(netdev);
......
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