On Thu, Jul 20, 2017 at 07:34:04PM +0300, Sagi Grimberg wrote: > > > mlx5_tx_complete() polls completion queue multiple times until it > > encounters an invalid entry. As Tx completions are suppressed by > > MLX5_TX_COMP_THRESH, it is waste of cycles to expect multiple completions > > in a poll. And freeing too many buffers in a call can cause high jitter. > > This patch improves throughput a little. > > What if the device generates burst of completions? mlx5 PMD suppresses completions anyway. It requests a completion per every MLX5_TX_COMP_THRESH Tx mbufs, not every single mbuf. So, the size of completion queue is even much small.
> Holding these completions un-reaped can theoretically cause resource stress on > the corresponding mempool(s). Can you make your point clearer? Do you think the "stress" can impact performance? I think stress doesn't matter unless it is depleted. And app is responsible for supplying enough mbufs considering the depth of all queues (max # of outstanding mbufs). > I totally get the need for a stopping condition, but is "loop once" > the best stop condition? Best for what? > Perhaps an adaptive budget (based on online stats) perform better? Please bring up any suggestion or submit a patch if any. Does "budget" mean the threshold? If so, calculation of stats for adaptive threshold can impact single core performance. With multiple cores, adjusting threshold doesn't affect much. Thanks, Yongseok