Skip to content

Commit

Permalink
pch_gbe: run the ptp bpf just once per packet
Browse files Browse the repository at this point in the history
This patch fixes code which needlessly ran the BPF twice per
packet. Instead, we just run the classifier once and test
whether the packet is any kind of PTP event message.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Richard Cochran authored and David S. Miller committed Apr 21, 2012
1 parent 358dfb6 commit 32127a0
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,8 @@ static int pch_ptp_match(struct sk_buff *skb, u16 uid_hi, u32 uid_lo, u16 seqid)
u16 *hi, *id;
u32 lo;

if ((sk_run_filter(skb, ptp_filter) != PTP_CLASS_V2_IPV4) &&
(sk_run_filter(skb, ptp_filter) != PTP_CLASS_V1_IPV4)) {
if (sk_run_filter(skb, ptp_filter) == PTP_CLASS_NONE)
return 0;
}

offset = ETH_HLEN + IPV4_HLEN(data) + UDP_HLEN;

Expand Down

0 comments on commit 32127a0

Please sign in to comment.