Skip to content

Commit 1007f59

Browse files
Alexander Duyckdavem330
Alexander Duyck
authored andcommitted
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 <alexander.h.duyck@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 2251ae4 commit 1007f59

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

net/core/timestamping.c

+5-1
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,15 @@ bool skb_defer_rx_timestamp(struct sk_buff *skb)
6060
struct phy_device *phydev;
6161
unsigned int type;
6262

63+
if (!skb->dev || !skb->dev->phydev || !skb->dev->phydev->drv)
64+
return false;
65+
6366
if (skb_headroom(skb) < ETH_HLEN)
6467
return false;
68+
6569
__skb_push(skb, ETH_HLEN);
6670

67-
type = classify(skb);
71+
type = ptp_classify_raw(skb);
6872

6973
__skb_pull(skb, ETH_HLEN);
7074

0 commit comments

Comments
 (0)