aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/timestamping.c
diff options
context:
space:
mode:
authorAlexander Duyck <[email protected]>2015-07-09 18:02:52 +0000
committerDavid S. Miller <[email protected]>2015-07-09 21:17:15 +0000
commit1007f59dce53a22cba164f854d7bdc171c85dc79 (patch)
tree93a5a9f8c10fcc4e442d22f5d2d63daf899667e3 /net/core/timestamping.c
parenttcp: v1 always send a quick ack when quickacks are enabled (diff)
downloadkernel-1007f59dce53a22cba164f854d7bdc171c85dc79.tar.gz
kernel-1007f59dce53a22cba164f854d7bdc171c85dc79.zip
net: skb_defer_rx_timestamp should check for phydev before setting up classify
This change makes it so that the call skb_defer_rx_timestamp will first check for a phydev before going in and manipulating the skb->data and skb->len values. By doing this we can avoid unnecessary work on network devices that don't support phydev. As a result we reduce the total instruction count needed to process this on most devices. Signed-off-by: Alexander Duyck <[email protected]> Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'net/core/timestamping.c')
-rw-r--r--net/core/timestamping.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/net/core/timestamping.c b/net/core/timestamping.c
index 43d3dd62fcc8..42689d5c468c 100644
--- a/net/core/timestamping.c
+++ b/net/core/timestamping.c
@@ -60,11 +60,15 @@ bool skb_defer_rx_timestamp(struct sk_buff *skb)
struct phy_device *phydev;
unsigned int type;
+ if (!skb->dev || !skb->dev->phydev || !skb->dev->phydev->drv)
+ return false;
+
if (skb_headroom(skb) < ETH_HLEN)
return false;
+
__skb_push(skb, ETH_HLEN);
- type = classify(skb);
+ type = ptp_classify_raw(skb);
__skb_pull(skb, ETH_HLEN);