[v2,133/148] net/ice/base: fix memcpy type

Message ID 500defe440e5659dba20f19896440181d1aed178.1718204529.git.anatoly.burakov@intel.com (mailing list archive)
State Superseded
Delegated to: Bruce Richardson
Headers
Series Update net/ice base driver to latest upstream snapshot |

Checks

Context Check Description
ci/checkpatch warning coding style issues

Commit Message

Anatoly Burakov June 12, 2024, 3:02 p.m. UTC
  From: Ian Stokes <ian.stokes@intel.com>

Modified function ice_aq_manage_mac_read so that ICE_NONDMA_TO_NONDMA memcpy
type is used when copying MAC address value from AQC buffer to hardware
descriptor. Since (in case of tools) both locations are in user space there is
no need to use ICE_DMA_TO_NONDMA memcpy type that was used previously.

Signed-off-by: Stefan Wegrzyn <stefan.wegrzyn@intel.com>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
---
 drivers/net/ice/base/ice_common.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Bruce Richardson June 21, 2024, 2:40 p.m. UTC | #1
On Wed, Jun 12, 2024 at 04:02:07PM +0100, Anatoly Burakov wrote:
> From: Ian Stokes <ian.stokes@intel.com>
> 
> Modified function ice_aq_manage_mac_read so that ICE_NONDMA_TO_NONDMA memcpy
> type is used when copying MAC address value from AQC buffer to hardware
> descriptor. Since (in case of tools) both locations are in user space there is
> no need to use ICE_DMA_TO_NONDMA memcpy type that was used previously.
> 
> Signed-off-by: Stefan Wegrzyn <stefan.wegrzyn@intel.com>
> Signed-off-by: Ian Stokes <ian.stokes@intel.com>
> ---
>  drivers/net/ice/base/ice_common.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ice/base/ice_common.c b/drivers/net/ice/base/ice_common.c
> index 9991be98a4..df827c26e4 100644
> --- a/drivers/net/ice/base/ice_common.c
> +++ b/drivers/net/ice/base/ice_common.c
> @@ -380,10 +380,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;

This change is similar to that in patch 92, consider squashing there.

/Bruce
  

Patch

diff --git a/drivers/net/ice/base/ice_common.c b/drivers/net/ice/base/ice_common.c
index 9991be98a4..df827c26e4 100644
--- a/drivers/net/ice/base/ice_common.c
+++ b/drivers/net/ice/base/ice_common.c
@@ -380,10 +380,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;