From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 471F2A0352 for ; Tue, 22 Feb 2022 17:07:34 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1C37441C3B; Tue, 22 Feb 2022 17:07:22 +0100 (CET) Received: from mail-ej1-f42.google.com (mail-ej1-f42.google.com [209.85.218.42]) by mails.dpdk.org (Postfix) with ESMTP id 5EC12411FB for ; Tue, 22 Feb 2022 17:07:16 +0100 (CET) Received: by mail-ej1-f42.google.com with SMTP id a23so44239364eju.3 for ; Tue, 22 Feb 2022 08:07:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=OKB/CU445X5X42Y+zx85f36U5ryCc+4ZUCXLwigi7Dg=; b=o5WgD2jAiDr1mozW7godLhBk4CAMlf9cjajwGwUnkL6wn6aILv5L3gsNG5oIqphnx/ sWZi4bqU2XyPgv0sXtrdEJW6n1fey65RHHzHETCor0ZYhP30RgjeMKHw9MicoKxDFieQ mTb6e8r/Ck1v96bHyGAwUxu/t3DtGj81tDqq98wxNzIMUDHhthEyUy0teLzsbf8mtVhN vHVsPvt1blpGukpPgRkwDT29qFJWCOUIBCNwqEhthMnYOP4SPDWO8oN5dyaqDggNFHs0 O0fPUdrotgetpmYGAtLX5648U3ZRuucU7Wks1K3td1AwvgK/eoqZRHH6RLreub+HHOKp fyDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=OKB/CU445X5X42Y+zx85f36U5ryCc+4ZUCXLwigi7Dg=; b=adYrdmLpZTN+6KpNgFTsPT5LCvt7Z9mFbPtW1hXvKwI67bGxIe1gxRQweOLd7JdV8s UxuQg7SQlLPIG4LNGGZnq6C+jrhKUcta3vCQU9O3EuIWYM8BOWrEF+qYtHifuU8Ac3Jk jZjIemYCgKo5pEB5c0Zkc4vADJdP3ov+uDkk3PVLMVG8WiFEW8dXKLQW+MEHggfDerIU 6aoPYSy/RG6O2BZhBm9NDxbeXs162sQ4ZOPhD652vaflb+vi9PXWnTpV3W1ANja6WjMc Eccxga3GmysUV+apL5+J8LLbR+aap5XgvQZeHksZOia71fY/iFMWT/J7bxZa5LWaem6n 7Lbg== X-Gm-Message-State: AOAM530QUYiLZDcz8Lsb9QFGymUY8tbYa1rvbztWx+52reqVyHYcJbN0 xkjjAJkrVNpoTqxA/OsYMTMVIC9pWLOPkg== X-Google-Smtp-Source: ABdhPJwKd12bPcJQCTcntuqyZ6VmKr8/zJjswDQMWpEgXER0zlMFzUKbDP1EELKeKsOjgnpTsbUU9w== X-Received: by 2002:a17:906:130a:b0:6b7:5e48:350a with SMTP id w10-20020a170906130a00b006b75e48350amr19583574ejb.184.1645546036111; Tue, 22 Feb 2022 08:07:16 -0800 (PST) Received: from DESKTOP-U5LNN3J.localdomain (89-79-181-52.dynamic.chello.pl. [89.79.181.52]) by smtp.gmail.com with ESMTPSA id x6sm10013477edv.109.2022.02.22.08.07.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Feb 2022 08:07:15 -0800 (PST) From: Michal Krawczyk To: dev@dpdk.org Cc: shaibran@amazon.com, upstream@semihalf.com, Dawid Gorecki , stable@dpdk.org, Michal Krawczyk Subject: [PATCH 19/21] net/ena: don't initialize LLQ when membar isn't exposed Date: Tue, 22 Feb 2022 17:06:32 +0100 Message-Id: <20220222160634.24489-20-mk@semihalf.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220222160634.24489-1-mk@semihalf.com> References: <20220222160634.24489-1-mk@semihalf.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org From: Dawid Gorecki 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@dpdk.org Signed-off-by: Dawid Gorecki Reviewed-by: Michal Krawczyk Reviewed-by: Shai Brandes --- 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 f4be79d240..9f29cf04ac 100644 --- a/drivers/net/ena/ena_ethdev.c +++ b/drivers/net/ena/ena_ethdev.c @@ -1953,6 +1953,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, @@ -1965,13 +1972,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.25.1