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 4EAB845501; Wed, 26 Jun 2024 14:01:06 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9E43043401; Wed, 26 Jun 2024 13:56:03 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) by mails.dpdk.org (Postfix) with ESMTP id 2A63C42E95 for ; Wed, 26 Jun 2024 13:44:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1719402271; x=1750938271; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=engrZwEb5X+A/FORa+0i8hrCYDVMZdLP6hz03qA08to=; b=Z5IoHX5gX0p6gaYYy6mWg5y/QTSEQmgoP1YpwyfFMz0o9hs24jB9yjRQ 5ZsTmbtYGfQyQxDIX8bd0f24GlcQK6/3HYWqC4VM9/zvnyf6z079NrRQo ZpNyanweexS7IFOFL2OsYlaszu2mz4PpoQ8db2KQYkY5iiuYVwzu3fj01 OjXOUlFDesp9wV9hjFk5scrLTSEPKxIzJ5avhTqhAdwMFI8j0HFns6Kh3 sFA5n1moN5pnO5+dLP2qzCamJxHw89fywv3Ix2hV2aik6TZQDv2Pv4x19 muqhNNTH6twYNswk7PxEiG5OFQv0h3VGHOGQ5n6tccsahPP8Vpld9Sq4J Q==; X-CSE-ConnectionGUID: Rqiq1TUBSKuzo1gtoKizrw== X-CSE-MsgGUID: JR3yrLKBQy2EDefi6nD2Tw== X-IronPort-AV: E=McAfee;i="6700,10204,11114"; a="38979445" X-IronPort-AV: E=Sophos;i="6.08,266,1712646000"; d="scan'208";a="38979445" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jun 2024 04:44:30 -0700 X-CSE-ConnectionGUID: 8Ix4uF2KRFmEHWJlPenR0A== X-CSE-MsgGUID: iRM7LkSaS0GDz6rRG6N9pQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,266,1712646000"; d="scan'208";a="43873984" Received: from unknown (HELO silpixa00401119.ir.intel.com) ([10.55.129.167]) by orviesa010.jf.intel.com with ESMTP; 26 Jun 2024 04:44:30 -0700 From: Anatoly Burakov To: dev@dpdk.org Cc: Stefan Wegrzyn , ian.stokes@intel.com, bruce.richardson@intel.com Subject: [PATCH v4 054/103] net/ice/base: adjust ice_memcpy type specifiers Date: Wed, 26 Jun 2024 12:41:42 +0100 Message-ID: <84113f6b1348b748a4ac54a32af62513ded5c32e.1719401848.git.anatoly.burakov@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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: Stefan Wegrzyn Wrong type specifiers were used in ice_write_*(), ice_read_*(), ice_sched_add_root_node(), and ice_aq_manage_mac_read() functions. When using silicon validation tools, those functions are operating on user space buffers and therefore the ice_memcpy type has to be set to ICE_NONDMA_TO_NONDMA. Signed-off-by: Stefan Wegrzyn Signed-off-by: Ian Stokes --- drivers/net/ice/base/ice_common.c | 36 +++++++++++++++---------------- drivers/net/ice/base/ice_sched.c | 2 +- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/drivers/net/ice/base/ice_common.c b/drivers/net/ice/base/ice_common.c index 950163510e..76688d8062 100644 --- a/drivers/net/ice/base/ice_common.c +++ b/drivers/net/ice/base/ice_common.c @@ -377,10 +377,10 @@ ice_aq_manage_mac_read(struct ice_hw *hw, void *buf, u16 buf_size, if (resp[i].addr_type == ICE_AQC_MAN_MAC_ADDR_TYPE_LAN) { ice_memcpy(hw->port_info->mac.lan_addr, resp[i].mac_addr, ETH_ALEN, - ICE_DMA_TO_NONDMA); + ICE_NONDMA_TO_NONDMA); ice_memcpy(hw->port_info->mac.perm_addr, resp[i].mac_addr, - ETH_ALEN, ICE_DMA_TO_NONDMA); + ETH_ALEN, ICE_NONDMA_TO_NONDMA); break; } return 0; @@ -4661,13 +4661,13 @@ ice_write_byte(u8 *src_ctx, u8 *dest_ctx, const struct ice_ctx_ele *ce_info) /* get the current bits from the target bit string */ dest = dest_ctx + (ce_info->lsb / 8); - ice_memcpy(&dest_byte, dest, sizeof(dest_byte), ICE_DMA_TO_NONDMA); + ice_memcpy(&dest_byte, dest, sizeof(dest_byte), ICE_NONDMA_TO_NONDMA); dest_byte &= ~mask; /* get the bits not changing */ dest_byte |= src_byte; /* add in the new bits */ /* put it all back */ - ice_memcpy(dest, &dest_byte, sizeof(dest_byte), ICE_NONDMA_TO_DMA); + ice_memcpy(dest, &dest_byte, sizeof(dest_byte), ICE_NONDMA_TO_NONDMA); } /** @@ -4704,13 +4704,13 @@ ice_write_word(u8 *src_ctx, u8 *dest_ctx, const struct ice_ctx_ele *ce_info) /* get the current bits from the target bit string */ dest = dest_ctx + (ce_info->lsb / 8); - ice_memcpy(&dest_word, dest, sizeof(dest_word), ICE_DMA_TO_NONDMA); + ice_memcpy(&dest_word, dest, sizeof(dest_word), ICE_NONDMA_TO_NONDMA); dest_word &= ~(CPU_TO_LE16(mask)); /* get the bits not changing */ dest_word |= CPU_TO_LE16(src_word); /* add in the new bits */ /* put it all back */ - ice_memcpy(dest, &dest_word, sizeof(dest_word), ICE_NONDMA_TO_DMA); + ice_memcpy(dest, &dest_word, sizeof(dest_word), ICE_NONDMA_TO_NONDMA); } /** @@ -4755,13 +4755,13 @@ ice_write_dword(u8 *src_ctx, u8 *dest_ctx, const struct ice_ctx_ele *ce_info) /* get the current bits from the target bit string */ dest = dest_ctx + (ce_info->lsb / 8); - ice_memcpy(&dest_dword, dest, sizeof(dest_dword), ICE_DMA_TO_NONDMA); + ice_memcpy(&dest_dword, dest, sizeof(dest_dword), ICE_NONDMA_TO_NONDMA); dest_dword &= ~(CPU_TO_LE32(mask)); /* get the bits not changing */ dest_dword |= CPU_TO_LE32(src_dword); /* add in the new bits */ /* put it all back */ - ice_memcpy(dest, &dest_dword, sizeof(dest_dword), ICE_NONDMA_TO_DMA); + ice_memcpy(dest, &dest_dword, sizeof(dest_dword), ICE_NONDMA_TO_NONDMA); } /** @@ -4806,13 +4806,13 @@ ice_write_qword(u8 *src_ctx, u8 *dest_ctx, const struct ice_ctx_ele *ce_info) /* get the current bits from the target bit string */ dest = dest_ctx + (ce_info->lsb / 8); - ice_memcpy(&dest_qword, dest, sizeof(dest_qword), ICE_DMA_TO_NONDMA); + ice_memcpy(&dest_qword, dest, sizeof(dest_qword), ICE_NONDMA_TO_NONDMA); dest_qword &= ~(CPU_TO_LE64(mask)); /* get the bits not changing */ dest_qword |= CPU_TO_LE64(src_qword); /* add in the new bits */ /* put it all back */ - ice_memcpy(dest, &dest_qword, sizeof(dest_qword), ICE_NONDMA_TO_DMA); + ice_memcpy(dest, &dest_qword, sizeof(dest_qword), ICE_NONDMA_TO_NONDMA); } /** @@ -4935,7 +4935,7 @@ ice_read_byte(u8 *src_ctx, u8 *dest_ctx, const struct ice_ctx_ele *ce_info) /* get the current bits from the src bit string */ src = src_ctx + (ce_info->lsb / 8); - ice_memcpy(&dest_byte, src, sizeof(dest_byte), ICE_DMA_TO_NONDMA); + ice_memcpy(&dest_byte, src, sizeof(dest_byte), ICE_NONDMA_TO_NONDMA); dest_byte &= ~(mask); @@ -4945,7 +4945,7 @@ ice_read_byte(u8 *src_ctx, u8 *dest_ctx, const struct ice_ctx_ele *ce_info) target = dest_ctx + ce_info->offset; /* put it back in the struct */ - ice_memcpy(target, &dest_byte, sizeof(dest_byte), ICE_NONDMA_TO_DMA); + ice_memcpy(target, &dest_byte, sizeof(dest_byte), ICE_NONDMA_TO_NONDMA); } /** @@ -4972,7 +4972,7 @@ ice_read_word(u8 *src_ctx, u8 *dest_ctx, const struct ice_ctx_ele *ce_info) /* get the current bits from the src bit string */ src = src_ctx + (ce_info->lsb / 8); - ice_memcpy(&src_word, src, sizeof(src_word), ICE_DMA_TO_NONDMA); + ice_memcpy(&src_word, src, sizeof(src_word), ICE_NONDMA_TO_NONDMA); /* the data in the memory is stored as little endian so mask it * correctly @@ -4988,7 +4988,7 @@ ice_read_word(u8 *src_ctx, u8 *dest_ctx, const struct ice_ctx_ele *ce_info) target = dest_ctx + ce_info->offset; /* put it back in the struct */ - ice_memcpy(target, &dest_word, sizeof(dest_word), ICE_NONDMA_TO_DMA); + ice_memcpy(target, &dest_word, sizeof(dest_word), ICE_NONDMA_TO_NONDMA); } /** @@ -5023,7 +5023,7 @@ ice_read_dword(u8 *src_ctx, u8 *dest_ctx, const struct ice_ctx_ele *ce_info) /* get the current bits from the src bit string */ src = src_ctx + (ce_info->lsb / 8); - ice_memcpy(&src_dword, src, sizeof(src_dword), ICE_DMA_TO_NONDMA); + ice_memcpy(&src_dword, src, sizeof(src_dword), ICE_NONDMA_TO_NONDMA); /* the data in the memory is stored as little endian so mask it * correctly @@ -5039,7 +5039,7 @@ ice_read_dword(u8 *src_ctx, u8 *dest_ctx, const struct ice_ctx_ele *ce_info) target = dest_ctx + ce_info->offset; /* put it back in the struct */ - ice_memcpy(target, &dest_dword, sizeof(dest_dword), ICE_NONDMA_TO_DMA); + ice_memcpy(target, &dest_dword, sizeof(dest_dword), ICE_NONDMA_TO_NONDMA); } /** @@ -5074,7 +5074,7 @@ ice_read_qword(u8 *src_ctx, u8 *dest_ctx, const struct ice_ctx_ele *ce_info) /* get the current bits from the src bit string */ src = src_ctx + (ce_info->lsb / 8); - ice_memcpy(&src_qword, src, sizeof(src_qword), ICE_DMA_TO_NONDMA); + ice_memcpy(&src_qword, src, sizeof(src_qword), ICE_NONDMA_TO_NONDMA); /* the data in the memory is stored as little endian so mask it * correctly @@ -5090,7 +5090,7 @@ ice_read_qword(u8 *src_ctx, u8 *dest_ctx, const struct ice_ctx_ele *ce_info) target = dest_ctx + ce_info->offset; /* put it back in the struct */ - ice_memcpy(target, &dest_qword, sizeof(dest_qword), ICE_NONDMA_TO_DMA); + ice_memcpy(target, &dest_qword, sizeof(dest_qword), ICE_NONDMA_TO_NONDMA); } /** diff --git a/drivers/net/ice/base/ice_sched.c b/drivers/net/ice/base/ice_sched.c index cb6131f69d..478260c28d 100644 --- a/drivers/net/ice/base/ice_sched.c +++ b/drivers/net/ice/base/ice_sched.c @@ -35,7 +35,7 @@ ice_sched_add_root_node(struct ice_port_info *pi, return ICE_ERR_NO_MEMORY; } - ice_memcpy(&root->info, info, sizeof(*info), ICE_DMA_TO_NONDMA); + ice_memcpy(&root->info, info, sizeof(*info), ICE_NONDMA_TO_NONDMA); pi->root = root; return 0; } -- 2.43.0