From patchwork Mon Mar 4 12:29:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Brandes, Shai" X-Patchwork-Id: 137890 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 323B643B9B; Mon, 4 Mar 2024 13:31:21 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B495B42D66; Mon, 4 Mar 2024 13:30:19 +0100 (CET) Received: from smtp-fw-80006.amazon.com (smtp-fw-80006.amazon.com [99.78.197.217]) by mails.dpdk.org (Postfix) with ESMTP id AFCA841153 for ; Mon, 4 Mar 2024 13:30:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1709555418; x=1741091418; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=esilZkeoYx3BW4n7Z8Lk/G/rK4AxwqZp+CW/Ijc+K9g=; b=eMfZfe71KRPRItSrTlrPVYi0qY1K+rIkYB/NMfRultR19x82nAKHR8+j oPqF4xT0VWNp7AeIMQkLi6+HMx8CXa8ay6hEAiKerRQ3DXtkVewnSskCE SIRSbzg2NbyRVF6rQq31RBU+4bHuW2yElMqtxC8S7sIKjVNXzGLJph2DQ U=; X-IronPort-AV: E=Sophos;i="6.06,203,1705363200"; d="scan'208";a="277505251" Received: from pdx4-co-svc-p1-lb2-vlan3.amazon.com (HELO smtpout.prod.us-west-2.prod.farcaster.email.amazon.dev) ([10.25.36.214]) by smtp-border-fw-80006.pdx80.corp.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Mar 2024 12:30:15 +0000 Received: from EX19MTAEUA002.ant.amazon.com [10.0.10.100:53671] by smtpin.naws.eu-west-1.prod.farcaster.email.amazon.dev [10.0.16.96:2525] with esmtp (Farcaster) id 0d23ea51-4cb9-42b4-afff-3f895a50016c; Mon, 4 Mar 2024 12:30:14 +0000 (UTC) X-Farcaster-Flow-ID: 0d23ea51-4cb9-42b4-afff-3f895a50016c Received: from EX19D007EUA003.ant.amazon.com (10.252.50.8) by EX19MTAEUA002.ant.amazon.com (10.252.50.126) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.28; Mon, 4 Mar 2024 12:30:14 +0000 Received: from EX19MTAUWA001.ant.amazon.com (10.250.64.204) by EX19D007EUA003.ant.amazon.com (10.252.50.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.28; Mon, 4 Mar 2024 12:30:13 +0000 Received: from HFA15-CG15235BS.amazon.com (10.1.212.49) by mail-relay.amazon.com (10.250.64.204) with Microsoft SMTP Server id 15.2.1258.28 via Frontend Transport; Mon, 4 Mar 2024 12:30:12 +0000 From: To: CC: , Shai Brandes Subject: [PATCH v2 11/33] net/ena/hal: optimize Rx ring submission queue Date: Mon, 4 Mar 2024 14:29:20 +0200 Message-ID: <20240304122942.3496-12-shaibran@amazon.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240304122942.3496-1-shaibran@amazon.com> References: <20240304122942.3496-1-shaibran@amazon.com> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Shai Brandes RX ring submission queue descriptors are always located in host memory This optimization replaces the generic descriptor retrieval method with a tailored method for host memory type descriptors to avoid unnecessary if statement. Signed-off-by: Shai Brandes Reviewed-by: Amit Bernstein --- drivers/net/ena/hal/ena_eth_com.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/net/ena/hal/ena_eth_com.c b/drivers/net/ena/hal/ena_eth_com.c index d6811c7b48..dc2935a53e 100644 --- a/drivers/net/ena/hal/ena_eth_com.c +++ b/drivers/net/ena/hal/ena_eth_com.c @@ -631,9 +631,8 @@ int ena_com_add_single_rx_desc(struct ena_com_io_sq *io_sq, if (unlikely(!ena_com_sq_have_enough_space(io_sq, 1))) return ENA_COM_NO_SPACE; - desc = get_sq_desc(io_sq); - if (unlikely(!desc)) - return ENA_COM_FAULT; + /* virt_addr allocation success is checked before calling this function */ + desc = get_sq_desc_regular_queue(io_sq); memset(desc, 0x0, sizeof(struct ena_eth_io_rx_desc));