qede: Handle infinite driver spinning for Tx timestamp.
authorSudarsana Reddy Kalluru <skalluru@marvell.com>
Tue, 28 May 2019 03:21:33 +0000 (20:21 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 29 May 2019 07:01:30 +0000 (00:01 -0700)
commit9adebac37e7d26c5cd73776a0279574afe3f410b
treede67505141d52178f9d6ba8bf50c6aa062a6a321
parent24c6203bb986d1b3c8ae8176fbfde907d35d6328
qede: Handle infinite driver spinning for Tx timestamp.

In PTP Tx implementation, driver kept scheduling a poll thread until the
timestamp is available. In the error scenarios (e.g. app requesting the
timestamp for non-ptp packet), this thread kept waiting for the timestamp
forever.  This patch add changes to report such scenario as an error and
terminate the thread. Added a timeout of 2 seconds i.e., max time to wait
for Tx timestamp. Added a stat value ptp_skip_txts for reporting the number
of packets for which Tx timestamping is skipped.

Signed-off-by: Sudarsana Reddy Kalluru <skalluru@marvell.com>
Signed-off-by: Michal Kalderon <mkalderon@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/qlogic/qede/qede.h
drivers/net/ethernet/qlogic/qede/qede_ethtool.c
drivers/net/ethernet/qlogic/qede/qede_main.c
drivers/net/ethernet/qlogic/qede/qede_ptp.c