[PATCH 19.11 1/2] net/ena: check memory BAR before initializing LLQ

Dawid Górecki dgr at semihalf.com
Tue Mar 22 13:22:52 CET 2022


Hi,

On Mon, Mar 14, 2022 at 03:42:34PM +0100, Dawid Gorecki wrote:
> [ upstream commit 9ae7a13f8247319f63402107c8304ba57c3f4308 ]
>
> The ena_com_config_dev_mode() performs many calculations related to LLQ
> and then performs an admin queue call to configure LLQ in the device.
>
> All of the operations performed by ena_com_config_dev_mode() are
> unnecessary if membar hasn't been found. Move the dev_mem_base check
> before ena_com_config_dev_mode() call. This prevents the unnecessary
> operations from being performed.
>
> Fixes: 2fca2a98c0d1 ("net/ena: support LLQv2")
> Cc: stable at dpdk.org
>
> Signed-off-by: Dawid Gorecki <dgr at semihalf.com>
> Reviewed-by: Michal Krawczyk <mk at semihalf.com>
> Reviewed-by: Shai Brandes <shaibran at amazon.com>
> ---
>  drivers/net/ena/ena_ethdev.c | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c
> index 7601d2fa25..dc30370a8f 100644
> --- a/drivers/net/ena/ena_ethdev.c
> +++ b/drivers/net/ena/ena_ethdev.c
> @@ -1637,6 +1637,13 @@ ena_set_queues_placement_policy(struct ena_adapter *adapter,
>               return 0;
>       }
>
> +     if (adapter->dev_mem_base == NULL) {
> +             PMD_DRV_LOG(ERR,
> +                     "LLQ is advertised as supported, but device doesn't expose mem bar\n");
> +             ena_dev->tx_mem_queue_type = ENA_ADMIN_PLACEMENT_POLICY_HOST;
> +             return 0;
> +     }
> +
>       rc = ena_com_config_dev_mode(ena_dev, llq, llq_default_configurations);
>       if (unlikely(rc)) {
>               PMD_INIT_LOG(WARNING, "Failed to config dev mode. "
> @@ -1649,13 +1656,6 @@ ena_set_queues_placement_policy(struct ena_adapter *adapter,
>       if (ena_dev->tx_mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_HOST)
>               return 0;
>
> -     if (!adapter->dev_mem_base) {
> -             PMD_DRV_LOG(ERR, "Unable to access LLQ bar resource. "
> -                     "Fallback to host mode policy.\n.");
> -             ena_dev->tx_mem_queue_type = ENA_ADMIN_PLACEMENT_POLICY_HOST;
> -             return 0;
> -     }
> -
>       ena_dev->mem_bar = adapter->dev_mem_base;
>
>       return 0;
> --
> 2.35.1
>

I sent the patches last Monday but they didn't make it into the 19.11
branch. I didn't get any response but looking at the mailing list
archive it seems that the messages made it to the list. Were there any
issues with the patches or were they overlooked?

Best regards,
Dawid


More information about the stable mailing list