]> git.baikalelectronics.ru Git - kernel.git/commit
ice: xsk: allocate separate memory for XDP SW ring
authorMaciej Fijalkowski <maciej.fijalkowski@intel.com>
Mon, 13 Dec 2021 15:31:07 +0000 (16:31 +0100)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Fri, 17 Dec 2021 19:09:04 +0000 (11:09 -0800)
commit951e5a88d090956203b7592b30456dacc739e61c
treee9cb7dea13429a81c020f62bf670afb83ed1b468
parent053d3a2d55f6fd6ffd0a2518c215ab94ffd67a09
ice: xsk: allocate separate memory for XDP SW ring

Currently, the zero-copy data path is reusing the memory region that was
initially allocated for an array of struct ice_rx_buf for its own
purposes. This is error prone as it is based on the ice_rx_buf struct
always being the same size or bigger than what the zero-copy path needs.
There can also be old values present in that array giving rise to errors
when the zero-copy path uses it.

Fix this by freeing the ice_rx_buf region and allocating a new array for
the zero-copy path that has the right length and is initialized to zero.

Fixes: 0ca13f4b1ec3 ("ice: Use xdp_buf instead of rx_buf for xsk zero-copy")
Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@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_base.c
drivers/net/ethernet/intel/ice/ice_txrx.c
drivers/net/ethernet/intel/ice/ice_xsk.c