net: ethernet: ti: cpts: move enable/disable flags outside of cpts module
authorIvan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Mon, 12 Nov 2018 14:00:22 +0000 (16:00 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 14 Nov 2018 00:29:59 +0000 (16:29 -0800)
commita9423120343cb52efea6f471ff780eba7aab9b9f
treee445f6c5f9dffcb954913bbc6c2961aca9f4c8c0
parentf19dcd5f118d1795307e28e6e99f482469303edc
net: ethernet: ti: cpts: move enable/disable flags outside of cpts module

Each slave has it's own receive timestamp filter. But cpts rx/tx
timestamp enable flags are used to allow ts retrieve only for one
user. This limitation causes data path redundancy and setting overlap
if cpsw module is in dual-mac mode for instance.

If rx ts is enabled only for one port - the second interface must expect
every incoming packet to be PTP packet w/o absolutely any reason, and if
it's PTP - do unneeded stuff, as rx filter for second port is not set
and cpts fifo is not supposed to contain appropriate ts event.
That's not correct.

So, to fix control overlap and avoid redundant CPU cycles, the patch
splits rx/tx ts enable flags between network devices. After the patch,
PTP timestamping still should be used for only one port (or PTP id
counter has to be different for both ports as cpts IP is common).

Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ti/cpsw.c
drivers/net/ethernet/ti/cpts.c
drivers/net/ethernet/ti/cpts.h
drivers/net/ethernet/ti/netcp_ethss.c