提交 30d19d57 编写于 作者: M Magnus Karlsson 提交者: Alexei Starovoitov

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: 126cdfe1 ("ice: xsk: Improve AF_XDP ZC Tx and use batching API")
Signed-off-by: NMagnus Karlsson <magnus.karlsson@intel.com>
Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20220328142123.170157-3-maciej.fijalkowski@intel.com
上级 a95a4d9b
...@@ -754,7 +754,7 @@ static u16 ice_clean_xdp_irq_zc(struct ice_tx_ring *xdp_ring, int napi_budget) ...@@ -754,7 +754,7 @@ static u16 ice_clean_xdp_irq_zc(struct ice_tx_ring *xdp_ring, int napi_budget)
next_dd = next_dd + tx_thresh; next_dd = next_dd + tx_thresh;
if (next_dd >= desc_cnt) if (next_dd >= desc_cnt)
next_dd = tx_thresh - 1; next_dd = tx_thresh - 1;
} while (budget--); } while (--budget);
xdp_ring->next_dd = next_dd; xdp_ring->next_dd = next_dd;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册