From patchwork Mon Mar 4 12:29:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Brandes, Shai" X-Patchwork-Id: 137888 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 C936A43B9B; Mon, 4 Mar 2024 13:31:08 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 81647410EE; Mon, 4 Mar 2024 13:30:16 +0100 (CET) Received: from smtp-fw-9102.amazon.com (smtp-fw-9102.amazon.com [207.171.184.29]) by mails.dpdk.org (Postfix) with ESMTP id 2296F410EE for ; Mon, 4 Mar 2024 13:30:14 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1709555415; x=1741091415; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=2vVSjWSRvxszLqtLMVmYotpoM0VZkDq60QhuYD8vM90=; b=jBHvX4Zy1rQOL8/C4/QuamvSX3AevBeXFHWdz0IjiIyapjeC8IfI27wg 3HLOFQ1l8piQJDLY73cy8Y/4NCXufodoSYkjP1onEwwroYG9uLI7qir5z dSgKkUGHpr6Zc94LD0wOpZahEYffG2hMPtrFNfmUNoO9lsDM+/M5a5LaD Q=; X-IronPort-AV: E=Sophos;i="6.06,203,1705363200"; d="scan'208";a="401329641" 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-9102.sea19.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Mar 2024 12:30:14 +0000 Received: from EX19MTAEUC001.ant.amazon.com [10.0.43.254:36828] by smtpin.naws.eu-west-1.prod.farcaster.email.amazon.dev [10.0.0.36:2525] with esmtp (Farcaster) id 657f7086-5d53-4737-9f4e-0bb966534fcb; Mon, 4 Mar 2024 12:30:12 +0000 (UTC) X-Farcaster-Flow-ID: 657f7086-5d53-4737-9f4e-0bb966534fcb Received: from EX19D007EUB003.ant.amazon.com (10.252.51.43) by EX19MTAEUC001.ant.amazon.com (10.252.51.155) 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:12 +0000 Received: from EX19MTAUWA001.ant.amazon.com (10.250.64.204) by EX19D007EUB003.ant.amazon.com (10.252.51.43) 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:11 +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:10 +0000 From: To: CC: , Shai Brandes Subject: [PATCH v2 10/33] net/ena/hal: added a bus parameter to ena memcpy macro Date: Mon, 4 Mar 2024 14:29:19 +0200 Message-ID: <20240304122942.3496-11-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 ENA_MEMCPY_TO_DEVICE_64 macro needs pci bus id in order to write to the device memory when using llq. Signed-off-by: Shai Brandes Reviewed-by: Amit Bernstein --- drivers/net/ena/hal/ena_eth_com.c | 3 ++- drivers/net/ena/hal/ena_plat_dpdk.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/ena/hal/ena_eth_com.c b/drivers/net/ena/hal/ena_eth_com.c index 32090259cd..d6811c7b48 100644 --- a/drivers/net/ena/hal/ena_eth_com.c +++ b/drivers/net/ena/hal/ena_eth_com.c @@ -74,7 +74,8 @@ static int ena_com_write_bounce_buffer_to_dev(struct ena_com_io_sq *io_sq, wmb(); /* The line is completed. Copy it to dev */ - ENA_MEMCPY_TO_DEVICE_64(io_sq->desc_addr.pbuf_dev_addr + dst_offset, + ENA_MEMCPY_TO_DEVICE_64(io_sq->bus, + io_sq->desc_addr.pbuf_dev_addr + dst_offset, bounce_buffer, llq_info->desc_list_entry_size); diff --git a/drivers/net/ena/hal/ena_plat_dpdk.h b/drivers/net/ena/hal/ena_plat_dpdk.h index 14bf582a45..5f7cbd1ee7 100644 --- a/drivers/net/ena/hal/ena_plat_dpdk.h +++ b/drivers/net/ena/hal/ena_plat_dpdk.h @@ -301,11 +301,12 @@ ena_mem_alloc_coherent(struct rte_eth_dev_data *data, size_t size, #define ENA_WAIT_EVENTS_DESTROY(admin_queue) ((void)(admin_queue)) /* The size must be 8 byte align */ -#define ENA_MEMCPY_TO_DEVICE_64(dst, src, size) \ +#define ENA_MEMCPY_TO_DEVICE_64(bus, dst, src, size) \ do { \ int count, i; \ uint64_t *to = (uint64_t *)(dst); \ const uint64_t *from = (const uint64_t *)(src); \ + (void)(bus); \ count = (size) / 8; \ for (i = 0; i < count; i++, from++, to++) \ rte_write64_relaxed(*from, to); \