]> git.baikalelectronics.ru Git - kernel.git/commit
ice: xsk: Force rings to be sized to power of 2
authorMaciej Fijalkowski <maciej.fijalkowski@intel.com>
Tue, 25 Jan 2022 16:04:40 +0000 (17:04 +0100)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 27 Jan 2022 16:25:32 +0000 (17:25 +0100)
commit3093f60adba08084ceb343a2e8860af41d9ebfb2
tree56778d3ab8c53e09bd016244850761c6c0c8c842
parent778448bbcdf163778e3fc670c535d0a6cb765160
ice: xsk: Force rings to be sized to power of 2

With the upcoming introduction of batching to XSK data path,
performance wise it will be the best to have the ring descriptor count
to be aligned to power of 2.

Check if ring sizes that user is going to attach the XSK socket fulfill
the condition above. For Tx side, although check is being done against
the Tx queue and in the end the socket will be attached to the XDP
queue, it is fine since XDP queues get the ring->count setting from Tx
queues.

Suggested-by: Alexander Lobakin <alexandr.lobakin@intel.com>
Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Reviewed-by: Alexander Lobakin <alexandr.lobakin@intel.com>
Acked-by: Magnus Karlsson <magnus.karlsson@intel.com>
Link: https://lore.kernel.org/bpf/20220125160446.78976-3-maciej.fijalkowski@intel.com
drivers/net/ethernet/intel/ice/ice_xsk.c