diff options
author | Richard Cochran <richardcochran@gmail.com> | 2012-04-20 22:50:35 +0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-04-21 23:27:45 +0400 |
commit | 32127a0a0a35706c18df11cd7ad69e96214b3c68 (patch) | |
tree | 78a10204d205c8b2a682d15764c3c7bcd40b30ba /drivers/net/ethernet | |
parent | 358dfb6d77c016af764c0f7007697e5f5bc322c2 (diff) | |
download | linux-32127a0a0a35706c18df11cd7ad69e96214b3c68.tar.xz |
pch_gbe: run the ptp bpf just once per packet
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>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r-- | drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c index 53ac2fb78ab6..e9b785e0cc94 100644 --- a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c +++ b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c @@ -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; |