]> git.baikalelectronics.ru Git - kernel.git/commit
igb: check timestamp validity
authorJesse Brandeburg <jesse.brandeburg@intel.com>
Wed, 3 Mar 2021 20:51:03 +0000 (12:51 -0800)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Fri, 19 Mar 2021 15:47:46 +0000 (08:47 -0700)
commitba061e156bcc35551f0a6e73f2c696290e477f39
treee21a085692568a68b7b66ac6c57203af7fde531e
parent29c0d5aaf02cc0a586bbf6afc8b51ec713d4c9f6
igb: check timestamp validity

Add a couple of checks to make sure timestamping is on and that the
timestamp value from DMA is valid. This avoids any functional issues
that could come from a misinterpreted time stamp.

One of the functions changed doesn't need a return value added because
there was no value in checking from the calling locations.

While here, fix a couple of reverse christmas tree issues next to
the code being changed.

Fixes: fbd292053675 ("igb: Pull timestamp from fragment before adding it to skb")
Fixes: d0049eb03c6f ("igb: add XDP support")
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Dave Switzer <david.switzer@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/igb/igb.h
drivers/net/ethernet/intel/igb/igb_main.c
drivers/net/ethernet/intel/igb/igb_ptp.c