Re: [PATCH v5] virtio-net: clarify coalescing parameters settings

Heng Qi
2024-06-08T02:42:04Z

On Fri, 7 Jun 2024 22:02:46 +0200, Halil Pasic <pasic@linux.ibm.com> wrote:
> On Tue, 28 May 2024 12:47:02 +0800
> Heng Qi <hengqi@linux.alibaba.com> wrote:
>
> > The device can set any initial coalescing parameters (0 or non-zero)
> > for the receive/send queue before the setting command is executed,
> > not just 0, enhancing device performance even without DIM enabled.
> >
> > So we need to clarify descriptions that don't fit the behavior.
>
> Sorry I'm late to the party -- again! Just for my understanding: how/why
> is this a clarification and not just a (basically incompatible) change?

In my opinion, "clarification" means that something may have been described
incorrectly before, and we now need to discuss, explain clearly, and correct
the possibly incorrect description.

>
> I mean if I read this correctly, before the driver had the guaranty
> that if the parameters are not set by the driver, negotiating the
> feature does not introduce any coalescing. After this in theory
> the device could just pick some max value and potentially introduce
> maximal latency in certain scenarios.

"maximum latency" also means "throughput improvement".

>
> I understand that it is probably in the best interest of the devices to
> not pick stupid defaults. But it is also probably in the best interest
> of the driver to set those params, and if the driver is going to set its
> values, the devices defaults are moot unless we assume that those may end
> up being used by the driver as a hint when deciding which parameter
> values to choose.

"Any values" is compatible with "0 for max-usecs and max-frames", and the device
can choose "no coalescing".

"No coalescing" means "latency friendly", but it also means "a lot of
interruptions and throughput unfriendly". If the device chooses a stupid
maximum value, it is his choice (spec should give more devices choices instead of
forcing them to choose "0" which is not the best practice). We can't talk about
performance for drivers when the devices tend to choose any "stupid" designs.

We need relaxe the restrictions and makes the spec more reasonable.

Thanks.

> What am I missing here?
>
> Regards,
> Halil