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 C83E143C94; Tue, 12 Mar 2024 19:08:24 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E8DDA42E2C; Tue, 12 Mar 2024 19:07:52 +0100 (CET) Received: from smtp-fw-80007.amazon.com (smtp-fw-80007.amazon.com [99.78.197.218]) by mails.dpdk.org (Postfix) with ESMTP id 87A8242E2A for ; Tue, 12 Mar 2024 19:07:51 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1710266872; x=1741802872; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=GY09+eVby4XPIgZl5q0nIseqwj43z6xDCKNJNH+zbWU=; b=krDLMJxMXqRisRjZHAmSCYa/n+GtXwYzoPk7kI7TpkT6goomfA7kgC+i q0uEH8WotsUW4KrQCwXSl6toLN1StAhq/mL3q1nEpdLBLBbimn/9XBQ8m teqROfS5/m7SvbWWfKFaidkZqG1Jq8mi8Bw4rm2Xmyl6DIgYkp60kGIRj A=; X-IronPort-AV: E=Sophos;i="6.07,119,1708387200"; d="scan'208";a="280481575" Received: from pdx4-co-svc-p1-lb2-vlan2.amazon.com (HELO smtpout.prod.us-east-1.prod.farcaster.email.amazon.dev) ([10.25.36.210]) by smtp-border-fw-80007.pdx80.corp.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Mar 2024 18:07:50 +0000 Received: from EX19MTAEUA001.ant.amazon.com [10.0.17.79:47481] by smtpin.naws.eu-west-1.prod.farcaster.email.amazon.dev [10.0.19.132:2525] with esmtp (Farcaster) id 9040ccfe-aad2-43b4-9cfe-1cc828ad0bed; Tue, 12 Mar 2024 18:07:49 +0000 (UTC) X-Farcaster-Flow-ID: 9040ccfe-aad2-43b4-9cfe-1cc828ad0bed Received: from EX19D007EUB002.ant.amazon.com (10.252.51.117) by EX19MTAEUA001.ant.amazon.com (10.252.50.192) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.28; Tue, 12 Mar 2024 18:07:44 +0000 Received: from EX19MTAUWA001.ant.amazon.com (10.250.64.204) by EX19D007EUB002.ant.amazon.com (10.252.51.117) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.28; Tue, 12 Mar 2024 18:07:44 +0000 Received: from HFA15-CG15235BS.amazon.com (10.85.143.174) by mail-relay.amazon.com (10.250.64.204) with Microsoft SMTP Server id 15.2.1258.28 via Frontend Transport; Tue, 12 Mar 2024 18:07:42 +0000 From: To: CC: , Shai Brandes Subject: [PATCH v4 09/31] net/ena/base: optimize Rx ring submission queue Date: Tue, 12 Mar 2024 20:06:54 +0200 Message-ID: <20240312180716.8515-10-shaibran@amazon.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240312180716.8515-1-shaibran@amazon.com> References: <20240312180716.8515-1-shaibran@amazon.com> MIME-Version: 1.0 Content-Type: text/plain 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/base/ena_eth_com.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/net/ena/base/ena_eth_com.c b/drivers/net/ena/base/ena_eth_com.c index 32090259cd..875d55b00d 100644 --- a/drivers/net/ena/base/ena_eth_com.c +++ b/drivers/net/ena/base/ena_eth_com.c @@ -630,9 +630,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)); -- 2.17.1