]> git.baikalelectronics.ru Git - kernel.git/commit
igb: Fix XDP with PTP enabled
authorKurt Kanzenbach <kurt@linutronix.de>
Mon, 3 May 2021 07:28:00 +0000 (09:28 +0200)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Thu, 3 Jun 2021 15:38:37 +0000 (08:38 -0700)
commit48bea05d9a6b31abc737022c9cd6a5955fd3a341
tree87dcbf49b372be1014f04271aa75f243b0f76412
parent78bab370e1de72cfba6f97a9e6fb8389b669dc96
igb: Fix XDP with PTP enabled

When using native XDP with the igb driver, the XDP frame data doesn't point to
the beginning of the packet. It's off by 16 bytes. Everything works as expected
with XDP skb mode.

Actually these 16 bytes are used to store the packet timestamps. Therefore, pull
the timestamp before executing any XDP operations and adjust all other code
accordingly. The igc driver does it like that as well.

Tested with Intel i210 card and AF_XDP sockets.

Fixes: d0049eb03c6f ("igb: add XDP support")
Signed-off-by: Kurt Kanzenbach <kurt@linutronix.de>
Acked-by: Jesper Dangaard Brouer <brouer@redhat.com>
Tested-by: Sandeep Penigalapati <sandeep.penigalapati@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