net: ptp: do not reimplement PTP/BPF classifier
authorDaniel Borkmann <dborkman@redhat.com>
Fri, 28 Mar 2014 17:58:22 +0000 (18:58 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 31 Mar 2014 04:45:09 +0000 (00:45 -0400)
commit164d8c6665213c931645578310256da7b1259331
tree336d19cb5fd510a3aaf6b1eb908f256c0cb9ee09
parente62d2df084e2849edffb206559725fa81bb569a8
net: ptp: do not reimplement PTP/BPF classifier

There are currently pch_gbe, cpts, and ixp4xx_eth drivers that open-code
and reimplement a BPF classifier for the PTP protocol. Since all of them
effectively do the very same thing and load the very same PTP/BPF filter,
we can just consolidate that code by introducing ptp_classify_raw() in
the time-stamping core framework which can be used in drivers.

As drivers get initialized after bootstrapping the core networking
subsystem, they can make use of ptp_insns wrapped through
ptp_classify_raw(), which allows to simplify and remove PTP classifier
setup code in drivers.

Joint work with Alexei Starovoitov.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: Alexei Starovoitov <ast@plumgrid.com>
Cc: Richard Cochran <richard.cochran@omicron.at>
Cc: Jiri Benc <jbenc@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
drivers/net/ethernet/ti/cpts.c
drivers/net/ethernet/xscale/ixp4xx_eth.c
include/linux/ptp_classify.h
net/core/timestamping.c