]> git.baikalelectronics.ru Git - kernel.git/commit
igb: protect TX timestamping from API misuse
authorCliff Spradlin <cspradlin@google.com>
Mon, 19 Jun 2017 20:30:43 +0000 (13:30 -0700)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Wed, 9 Aug 2017 00:43:18 +0000 (17:43 -0700)
commitb460fba77405bb4c4f04ec9ac61da856452bc6aa
tree66f276c731d252924006295691a1bf0cd16d051b
parente51cc50bb95970c1c765328bd9ed39a5a027cf83
igb: protect TX timestamping from API misuse

HW timestamping can only be requested for a packet if the NIC is first
setup via ioctl(SIOCSHWTSTAMP). If this step was skipped, then the igb
driver still allowed TX packets to request HW timestamping. In this
situation, the _IGB_PTP_TX_IN_PROGRESS flag was set and would never
clear. This prevented any future HW timestamping requests to succeed.

Fix this by checking that the NIC is configured for HW TX timestamping
before accepting a HW TX timestamping request.

Signed-off-by: Cliff Spradlin <cspradlin@google.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/igb/igb_main.c