]> git.baikalelectronics.ru Git - kernel.git/commit
ice: respect metadata on XSK Rx to skb
authorAlexander Lobakin <alexandr.lobakin@intel.com>
Wed, 8 Dec 2021 14:06:58 +0000 (15:06 +0100)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Mon, 31 Jan 2022 17:46:05 +0000 (09:46 -0800)
commit847bba957a568342951a346e53afafc2caf59b7f
treecfc1e0aec3b76f930b557ec54751635b39aeb951
parent08e2acc449f69156a19abf4541b7db5936b9dee9
ice: respect metadata on XSK Rx to skb

For now, if the XDP prog returns XDP_PASS on XSK, the metadata will
be lost as it doesn't get copied to the skb.

Copy it along with the frame headers. Account its size on skb
allocation, and when copying just treat it as a part of the frame
and do a pull after to "move" it to the "reserved" zone.

net_prefetch() xdp->data_meta and align the copy size to speed-up
memcpy() a little and better match ice_construct_skb().

Fixes: c0e590e847b4 ("ice: Add support for AF_XDP")
Suggested-by: Jesper Dangaard Brouer <brouer@redhat.com>
Suggested-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Signed-off-by: Alexander Lobakin <alexandr.lobakin@intel.com>
Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Tested-by: Kiran Bhandare <kiranx.bhandare@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/ice/ice_xsk.c