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 678334404F; Wed, 12 Jun 2024 17:18:32 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3F37942F0C; Wed, 12 Jun 2024 17:05:54 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) by mails.dpdk.org (Postfix) with ESMTP id 80BEE42EF4 for ; Wed, 12 Jun 2024 17:05:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1718204749; x=1749740749; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=YbygLXLKp0HmoIKbw1bY7J30RGIq8SF9UU+49Y4k1OQ=; b=CU1AFtyZW30lpcgzlgQ+d+CeFplzSf3XTY7RRIXyyve/8G9Qn4pAt/wF xT6mWAOk6bNmJmZXy8uwsleYrZ/NDgM3l19fO539bg6kXoc3R+X4xHjqA Mre44Lzz2He3E7eKxZLHzh0AFw/wPsM9cwa8+SOF8+D87/zK81bpMSUMb kwlp7+DCVqQSoXzK75Th/HoK2P7uMV1ak2m8qXHGGMN3o/Vd2oRyVNL15 NHbXNO5+Y716ljIyMBYoTVNJEAK12VMGEQrblVJTOpeRvuBdjguhZ2o8u 14Bl/V409/DZ5vRUuAleKYFYLeY6myhuabRi1Zv3yV57Sb9N4MSsYN9Ee A==; X-CSE-ConnectionGUID: hdpn30rKQ4+V5zx3NUHSAw== X-CSE-MsgGUID: Ag5Ds2wUQKmiQwke7rEXoQ== X-IronPort-AV: E=McAfee;i="6700,10204,11101"; a="32459792" X-IronPort-AV: E=Sophos;i="6.08,233,1712646000"; d="scan'208";a="32459792" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jun 2024 08:05:48 -0700 X-CSE-ConnectionGUID: dkCE/+uKTveqt0pBMxK3nQ== X-CSE-MsgGUID: 8HS6jCJ2TJqspMld/wsL0g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,233,1712646000"; d="scan'208";a="39925656" Received: from silpixa00401119.ir.intel.com ([10.55.129.167]) by orviesa009.jf.intel.com with ESMTP; 12 Jun 2024 08:05:47 -0700 From: Anatoly Burakov To: dev@dpdk.org Cc: Ian Stokes , bruce.richardson@intel.com, Stefan Wegrzyn Subject: [PATCH v2 092/148] net/ice/base: fix ice_memcpy type specifiers Date: Wed, 12 Jun 2024 16:01:26 +0100 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: <20240430154014.1026-1-ian.stokes@intel.com> 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: Ian Stokes Wrong type specifiers were used in ice_write_*(), ice_read_*() and ice_sched_add_root_node() functions. In QV 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 | 32 +++++++++++++++---------------- drivers/net/ice/base/ice_sched.c | 2 +- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/drivers/net/ice/base/ice_common.c b/drivers/net/ice/base/ice_common.c index 3847d2d3fb..3fa46ea494 100644 --- a/drivers/net/ice/base/ice_common.c +++ b/drivers/net/ice/base/ice_common.c @@ -4692,13 +4692,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); } /** @@ -4735,13 +4735,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); } /** @@ -4786,13 +4786,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); } /** @@ -4837,13 +4837,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); } /** @@ -4966,7 +4966,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); @@ -4976,7 +4976,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); } /** @@ -5003,7 +5003,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 @@ -5019,7 +5019,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); } /** @@ -5054,7 +5054,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 @@ -5070,7 +5070,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); } /** @@ -5105,7 +5105,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 @@ -5121,7 +5121,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