igc: Refactor Rx timestamp handling
authorAndre Guedes <andre.guedes@intel.com>
Wed, 10 Mar 2021 07:13:18 +0000 (23:13 -0800)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Mon, 29 Mar 2021 15:49:20 +0000 (08:49 -0700)
commite1ed4f92a6256ec11445de51c2b5a7d89289f8d1
treeee908f19f84fec01cde0367fbaa4268d736cc838
parenta39f5e530559e0e39ab26b28ce5fa9550fd3ec5b
igc: Refactor Rx timestamp handling

Refactor the Rx timestamp handling in preparation to land
XDP support.

Rx timestamps are put in the Rx buffer by hardware, before the packet
data. When creating the xdp buffer, we will need to check the Rx
descriptor to determine if the buffer contains timestamp information
and consider the offset when setting xdp.data.

The Rx descriptor check is already done in igc_construct_skb(). To
avoid code duplication, this patch moves the timestamp handling to
igc_clean_rx_irq() so both skb and xdp paths can reuse it.

Signed-off-by: Andre Guedes <andre.guedes@intel.com>
Signed-off-by: Vedang Patel <vedang.patel@intel.com>
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
Reviewed-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Tested-by: Dvora Fuxbrumer <dvorax.fuxbrumer@linux.intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/igc/igc.h
drivers/net/ethernet/intel/igc/igc_main.c
drivers/net/ethernet/intel/igc/igc_ptp.c