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 60BE8A034E for ; Tue, 22 Feb 2022 19:12:45 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4C583426DF; Tue, 22 Feb 2022 19:12:41 +0100 (CET) Received: from mail-ej1-f54.google.com (mail-ej1-f54.google.com [209.85.218.54]) by mails.dpdk.org (Postfix) with ESMTP id 971B541C2E for ; Tue, 22 Feb 2022 19:12:38 +0100 (CET) Received: by mail-ej1-f54.google.com with SMTP id d10so45436213eje.10 for ; Tue, 22 Feb 2022 10:12:38 -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=qAM+RIHIyXixGvh+lV41guPyDGREiuynnAuUCUGfLJKr2Obwzco85navkHlde1VVc8 1KLJrcjNKcGpJQcEtN+ElMEUa6WqJ4cnO3LmkLrblIXB4lu/KOzMcrLB9OyWxleEQacE Om7X3f87tsiUlyCBXNXH6WU1tDynKK3DpbGltPWAw9yhTHiWJ2TM8uBROzk2W0keR09E Wwe2sRvY45253p3butj4epPDRGejOdLmEMc0FaBvN3H5SlZadVBOfdZ/4OXqUZIDmW0L cXejDdLwC+CFL+NhSAiRy+WeZrWl97neCRREHq/7WV3iNVXgnen87gH02ELQcXUb7OdS U14A== 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=kNZWwQSgbu/hSyBBw/CWGjmaVh+r1EbbG5O+vvdGWzwA3x1e3mLzHwM1Z2V3U8syEb jP/15iSBtK/mc1YsUqAyGT+SbQpzc6K7VdlNfvhHWL/UE0eAVvfQIJZJKXG/6O/w5FrT xv2k/+5CoaqgeAgoNlkLUbX3/0Z35ufxf8j/+VFi5G+j0xgCInZuKJ+WtW9vkFHza6TM m6N2P+6KGRf9GlU2E8MC0Vr7LDL0pNg0KD7gYNVetCPM6scwT6/2lnG5s/lEL2WQPm2x 3izkGL/gtKhdsas4i/tXpaTJV6muGV9lQL9Jvn1rxSSLTv6D9AKXXCgurfy2MY0ci7o9 IDag== X-Gm-Message-State: AOAM5321BW/Rns1/9nIlgoNTCcnGZkf9uZ8HZnqaVXGN9NbBGGFKG+uu w6nXjcFr3ja6ppk0WHXTpQ7pEg== X-Google-Smtp-Source: ABdhPJy30WRq0Dx/nlBoCfDwqJh0DmijzbidT2pp8Y81EX3Q/ktp994nJPsSzydwl+L80yhlQMFGlQ== X-Received: by 2002:a17:906:58b:b0:6cf:65f5:de28 with SMTP id 11-20020a170906058b00b006cf65f5de28mr19728380ejn.614.1645553558327; Tue, 22 Feb 2022 10:12:38 -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 y21sm10610153eda.38.2022.02.22.10.12.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Feb 2022 10:12:37 -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 v2 19/21] net/ena: don't initialize LLQ when membar isn't exposed Date: Tue, 22 Feb 2022 19:11:44 +0100 Message-Id: <20220222181146.28882-20-mk@semihalf.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220222181146.28882-1-mk@semihalf.com> References: <20220222160634.24489-1-mk@semihalf.com> <20220222181146.28882-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