summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
diff options
context:
space:
mode:
authorMark Rustad2014-08-09 09:02:09 +0200
committerJeff Kirsher2014-09-18 12:19:10 +0200
commitd52349337392b122a1bcd57d191e2a0329b2d9b2 (patch)
tree3f6953cc94698a9e7754946c3e5a3c6dec741f1e /drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
parentixgbe: remove useless bd_number from adapter struct (diff)
downloadkernel-qcow2-linux-d52349337392b122a1bcd57d191e2a0329b2d9b2.tar.gz
kernel-qcow2-linux-d52349337392b122a1bcd57d191e2a0329b2d9b2.tar.xz
kernel-qcow2-linux-d52349337392b122a1bcd57d191e2a0329b2d9b2.zip
ixgbe: Do not schedule an uninitialized workqueue entry
If a hardware Tx timestamp is requested, an uninitialized workqueue entry may be scheduled, especially on an 82598 adapter. Add a check for a PTP clock to avoid that. Also only apply the unlikely to the first term of the conditional. That will make the rest of the checks be in the cold path. Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Acked-by: Matthew Vick <matthew.vick@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/ixgbe/ixgbe_main.c')
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_main.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index bcd697c4b08a..06ef5a32a893 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -7108,9 +7108,10 @@ netdev_tx_t ixgbe_xmit_frame_ring(struct sk_buff *skb,
tx_flags |= IXGBE_TX_FLAGS_SW_VLAN;
}
- if (unlikely(skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP &&
- !test_and_set_bit_lock(__IXGBE_PTP_TX_IN_PROGRESS,
- &adapter->state))) {
+ if (unlikely(skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP) &&
+ adapter->ptp_clock &&
+ !test_and_set_bit_lock(__IXGBE_PTP_TX_IN_PROGRESS,
+ &adapter->state)) {
skb_shinfo(skb)->tx_flags |= SKBTX_IN_PROGRESS;
tx_flags |= IXGBE_TX_FLAGS_TSTAMP;