Skip to content

Commit 0ccf59b

Browse files
ikhorndavem330
authored andcommitted
net: ethernet: ti: netcp_ethss: use cpts to check if packet needs timestamping
There is cpts function to check if packet can be timstamped with cpts. Seems that ptp_classify_raw cover all cases listed with "case". Signed-off-by: Ivan Khoronzhuk <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent f44f841 commit 0ccf59b

File tree

1 file changed

+1
-17
lines changed

1 file changed

+1
-17
lines changed

drivers/net/ethernet/ti/netcp_ethss.c

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2503,24 +2503,8 @@ static bool gbe_need_txtstamp(struct gbe_intf *gbe_intf,
25032503
const struct netcp_packet *p_info)
25042504
{
25052505
struct sk_buff *skb = p_info->skb;
2506-
unsigned int class = ptp_classify_raw(skb);
25072506

2508-
if (class == PTP_CLASS_NONE)
2509-
return false;
2510-
2511-
switch (class) {
2512-
case PTP_CLASS_V1_IPV4:
2513-
case PTP_CLASS_V1_IPV6:
2514-
case PTP_CLASS_V2_IPV4:
2515-
case PTP_CLASS_V2_IPV6:
2516-
case PTP_CLASS_V2_L2:
2517-
case (PTP_CLASS_V2_VLAN | PTP_CLASS_L2):
2518-
case (PTP_CLASS_V2_VLAN | PTP_CLASS_IPV4):
2519-
case (PTP_CLASS_V2_VLAN | PTP_CLASS_IPV6):
2520-
return true;
2521-
}
2522-
2523-
return false;
2507+
return cpts_can_timestamp(gbe_intf->gbe_dev->cpts, skb);
25242508
}
25252509

25262510
static int gbe_txtstamp_mark_pkt(struct gbe_intf *gbe_intf,

0 commit comments

Comments
 (0)