OSDN Git Service

ice: Make Tx threshold dependent on ring length
authorMaciej Fijalkowski <maciej.fijalkowski@intel.com>
Tue, 25 Jan 2022 16:04:42 +0000 (17:04 +0100)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 27 Jan 2022 16:25:32 +0000 (17:25 +0100)
commit3dd411efe1edbddd08d024645f119df53398e746
tree8313af5f5c03cad274c49c8b8f2b705bac1d02e2
parent3876ff525de70ae850f3aa9b7c295e9cf7253b0e
ice: Make Tx threshold dependent on ring length

XDP_TX workloads use a concept of Tx threshold that indicates the
interval of setting RS bit on descriptors which in turn tells the HW to
generate an interrupt to signal the completion of Tx on HW side. It is
currently based on a constant value of 32 which might not work out well
for various sizes of ring combined with for example batch size that can
be set via SO_BUSY_POLL_BUDGET.

Internal tests based on AF_XDP showed that most convenient setup of
mentioned threshold is when it is equal to quarter of a ring length.

Make use of recently introduced ICE_RING_QUARTER macro and use this
value as a substitute for ICE_TX_THRESH.

Align also ethtool -G callback so that next_dd/next_rs fields are up to
date in terms of the ring size.

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-5-maciej.fijalkowski@intel.com
drivers/net/ethernet/intel/ice/ice_ethtool.c
drivers/net/ethernet/intel/ice/ice_main.c
drivers/net/ethernet/intel/ice/ice_txrx.h
drivers/net/ethernet/intel/ice/ice_txrx_lib.c