net: ethernet: ti: cpts: optimize packet to event matching
authorGrygorii Strashko <grygorii.strashko@ti.com>
Thu, 23 Apr 2020 14:20:17 +0000 (17:20 +0300)
committerDavid S. Miller <davem@davemloft.net>
Thu, 23 Apr 2020 19:50:20 +0000 (12:50 -0700)
commit3bfd41b57811d76412af57f4884e28ad78c2ab2f
tree552df8022d1fb9e26bd8a18d13356c280d2d5d24
parent856e59ab7e6d3c85ee739f3f53341d47c88d454e
net: ethernet: ti: cpts: optimize packet to event matching

Now the CPTS driver performs packet (skb) parsing every time when it needs
to match packet to CPTS event (including ptp_classify_raw() calls).

This patch optimizes matching process by parsing packet only once upon
arrival and stores PTP specific data in skb->cb using the same fromat as in
CPTS HW event. As result, all future matching reduces to comparing two u32
values.

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Acked-by: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ti/cpts.c