ionic: check for valid tx_mode on SKBTX_HW_TSTAMP xmit
authorShannon Nelson <snelson@pensando.io>
Wed, 7 Apr 2021 23:19:56 +0000 (16:19 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 8 Apr 2021 20:18:49 +0000 (13:18 -0700)
Make sure the device is in a Tx offload mode before calling the
hwstamp offload xmit.

Signed-off-by: Shannon Nelson <snelson@pensando.io>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/pensando/ionic/ionic_txrx.c

index 3478b0f..765050a 100644 (file)
@@ -1233,7 +1233,7 @@ netdev_tx_t ionic_start_xmit(struct sk_buff *skb, struct net_device *netdev)
        }
 
        if (unlikely(skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP))
-               if (lif->hwstamp_txq)
+               if (lif->hwstamp_txq && lif->phc->ts_config_tx_mode)
                        return ionic_start_hwstamp_xmit(skb, netdev);
 
        if (unlikely(queue_index >= lif->nxqs))