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 BEF64A034C for ; Wed, 23 Feb 2022 13:21:03 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D935C42746; Wed, 23 Feb 2022 13:20:56 +0100 (CET) Received: from mail-ed1-f50.google.com (mail-ed1-f50.google.com [209.85.208.50]) by mails.dpdk.org (Postfix) with ESMTP id 5675E4272C for ; Wed, 23 Feb 2022 13:20:53 +0100 (CET) Received: by mail-ed1-f50.google.com with SMTP id z22so43841520edd.1 for ; Wed, 23 Feb 2022 04:20:53 -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=sYF9oKYnjBsRPnacHorjguRyi3Iq8jyPaApiXFQLrw0=; b=oI+sohUX70i8VhYbwxqB9mTW+NqyevyYgfldDXISjJSKuF2DVpYfXlrTy4gRsmyzWT +9OGruC+Oi6w4SjYVkEDjHhTewQzGdTl8vJlrfmCCNub60pqULrwfs0DILVBagAeSZxk IlcycI0joPcBs5an4x1viHlO5NV4AuRc9U6/Coiqs7tz0VfaW3aBt8rIIbA8QKe65RSU YrXW+1D6dZMwVBm44WXFOrnyA9VHJjN6Apx29VgLwC2Tb4yVRUYhzCXIbniZaPmEZ6WC kYJtXoH4mtrTEszYoc2TmwFRgL2MRCU+MU97XYamaiNU/TVc7dhEOrvsRA9R0aaX5ayL Iq3A== 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=sYF9oKYnjBsRPnacHorjguRyi3Iq8jyPaApiXFQLrw0=; b=ZmfYKLDMxHHrEMWrWEArNorVOeG3sVf9Owh94COLan5mb459tbLyjymlKJJaI75NVo qOT/Z7hUxlY1lplEc9Rd5RERl24pmpEXfAPe+l+IpOWPNBMfYibO3qO0KBys2Iu2lCdc q3LzOIC527Jf5PjEUAZ+45ZxgCqStLp5NjgpFeQzGa5n94tnvha3Oude2Y9XGx2+GSp+ L41JMym9FzWphhDnrwKbmPDPMJSqF4Mg2e4zIfwIokoRxB830BQ+sts+wbumDuSGiEK0 8KkRolHj7VOFFzVnNscCh8szAlwJMiDtcNWPJKxv2Yqpe829k/yijp2lYef2QhuS5zp4 iQGQ== X-Gm-Message-State: AOAM532HPaCewhtleK2JlfmVHI2Ob/A8PzmVjwlOFlh+Lg9addYgRyOS w50Hx+qLDvZJ7Xvra2ymVx5kzw== X-Google-Smtp-Source: ABdhPJwxppp44C468ka+fxQiHJtBZQYxx0CpQ3urjlZXAPDzZjHW16jGb9vOn+y9mx7hCeJa7ym1Dw== X-Received: by 2002:a50:d086:0:b0:413:38a6:24a7 with SMTP id v6-20020a50d086000000b0041338a624a7mr2399426edd.183.1645618853142; Wed, 23 Feb 2022 04:20:53 -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 v12sm11629224edr.8.2022.02.23.04.20.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Feb 2022 04:20:52 -0800 (PST) From: Michal Krawczyk To: dev@dpdk.org Cc: ferruh.yigit@intel.com, shaibran@amazon.com, upstream@semihalf.com, Dawid Gorecki , stable@dpdk.org, Michal Krawczyk Subject: [PATCH v3 19/21] net/ena: don't initialize LLQ when membar isn't exposed Date: Wed, 23 Feb 2022 13:19:42 +0100 Message-Id: <20220223121944.24156-20-mk@semihalf.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220223121944.24156-1-mk@semihalf.com> References: <20220222181146.28882-1-mk@semihalf.com> <20220223121944.24156-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 b471102ea9..151c688eec 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