summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMagnus Karlsson <magnus.karlsson@intel.com>2022-03-28 16:21:21 +0200
committerAlexei Starovoitov <ast@kernel.org>2022-03-28 19:56:28 -0700
commit30d19d57d513821c58de4556e7445982ed22b923 (patch)
tree4d9bcf39ab12323e8037f671cf28bcd849c50466 /drivers
parenta95a4d9b39b0324402569ed7395aae59b8fd2b11 (diff)
downloadlinux-30d19d57d513821c58de4556e7445982ed22b923.tar.bz2
ice: xsk: Eliminate unnecessary loop iteration
The NIC Tx ring completion routine cleans entries from the ring in batches. However, it processes one more batch than it is supposed to. Note that this does not matter from a functionality point of view since it will not find a set DD bit for the next batch and just exit the loop. But from a performance perspective, it is faster to terminate the loop before and not issue an expensive read over PCIe to get the DD bit. Fixes: 126cdfe1007a ("ice: xsk: Improve AF_XDP ZC Tx and use batching API") Signed-off-by: Magnus Karlsson <magnus.karlsson@intel.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Link: https://lore.kernel.org/bpf/20220328142123.170157-3-maciej.fijalkowski@intel.com
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ethernet/intel/ice/ice_xsk.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/intel/ice/ice_xsk.c b/drivers/net/ethernet/intel/ice/ice_xsk.c
index 88853a6ed931..51427cb4971a 100644
--- a/drivers/net/ethernet/intel/ice/ice_xsk.c
+++ b/drivers/net/ethernet/intel/ice/ice_xsk.c
@@ -754,7 +754,7 @@ skip:
next_dd = next_dd + tx_thresh;
if (next_dd >= desc_cnt)
next_dd = tx_thresh - 1;
- } while (budget--);
+ } while (--budget);
xdp_ring->next_dd = next_dd;