21/07/2025 13:51, Sunyang Wu:
> The values of the promiscuous and allmulticast variables
> are set after calling the driver, according to the return value.
> 
> Fixes: 400d75818266 ("ethdev: check device promiscuous state")
> de5ccf0775ae ("ethdev:do nothing if all-multicast mode is applied
> again")
> Cc: sta...@dpdk.org
> 
> Signed-off-by: Sunyang Wu <sunyang...@jaguarmicro.com>
[...]
>       diag = dev->dev_ops->promiscuous_enable(dev);
> -     dev->data->promiscuous = (diag == 0) ? 1 : 0;
> +     if (diag == 0)
> +             dev->data->promiscuous = 1;

I remember seeing this strange behavior of resetting the value if failed.
And it is done differently in the "disable" functions.

But it is not so wrong, because if it was enabled, the function returns early.
So the value changes only if it is successful.

What is the issue you observe?
Is it a rework to make the code easier to understand?


Reply via email to