]> 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)
commit136328b5d1701236dc7fba78051cc2689bc76102
treecfc1e0aec3b76f930b557ec54751635b39aeb951
parent4ae0344994161fd55b799d8928bf51ac89ab5223
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: a40d09f79c37 ("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