patches for DPDK stable branches
 help / color / Atom feed
* [dpdk-stable] [PATCH v4] net/ice: use the copy API to do MAC assignment
       [not found] <20200102071457.106137-1-haiyue.wang@intel.com>
@ 2020-01-13  8:22 ` Haiyue Wang
  2020-01-13  8:32   ` Ye Xiaolong
  0 siblings, 1 reply; 2+ messages in thread
From: Haiyue Wang @ 2020-01-13  8:22 UTC (permalink / raw)
  To: dev, stephen, qi.z.zhang, qiming.yang, xiaolong.ye; +Cc: Haiyue Wang, stable

Use the API rte_ether_addr_copy to do MAC assignment, instead of
calling rte_memcpy function directly.

Fixes: 84dc7a95a2d3 ("net/ice: enable flow director engine")
Cc: stable@dpdk.org

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
---
v4: update the fix tags

v3: Update the commit message

v2: Update the commit title and message, use the rte_ether_addr_copy API
    instead of just changing the length definition to make code style clean.

 drivers/net/ice/ice_ethdev.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
index 88cd90660..6b344cb6e 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -875,7 +875,7 @@ ice_add_mac_filter(struct ice_vsi *vsi, struct rte_ether_addr *mac_addr)
 		ret = -ENOMEM;
 		goto DONE;
 	}
-	rte_memcpy(&f->mac_info.mac_addr, mac_addr, ETH_ADDR_LEN);
+	rte_ether_addr_copy(mac_addr, &f->mac_info.mac_addr);
 	TAILQ_INSERT_TAIL(&vsi->mac_list, f, next);
 	vsi->mac_num++;
 
@@ -1663,16 +1663,16 @@ ice_setup_vsi(struct ice_pf *pf, enum ice_vsi_type type)
 
 	if (type == ICE_VSI_PF) {
 		/* MAC configuration */
-		rte_memcpy(pf->dev_addr.addr_bytes,
-			   hw->port_info->mac.perm_addr,
-			   ETH_ADDR_LEN);
+		rte_ether_addr_copy((struct rte_ether_addr *)
+					hw->port_info->mac.perm_addr,
+				    &pf->dev_addr);
 
-		rte_memcpy(&mac_addr, &pf->dev_addr, RTE_ETHER_ADDR_LEN);
+		rte_ether_addr_copy(&pf->dev_addr, &mac_addr);
 		ret = ice_add_mac_filter(vsi, &mac_addr);
 		if (ret != ICE_SUCCESS)
 			PMD_INIT_LOG(ERR, "Failed to add dflt MAC filter");
 
-		rte_memcpy(&mac_addr, &broadcast, RTE_ETHER_ADDR_LEN);
+		rte_ether_addr_copy(&broadcast, &mac_addr);
 		ret = ice_add_mac_filter(vsi, &mac_addr);
 		if (ret != ICE_SUCCESS)
 			PMD_INIT_LOG(ERR, "Failed to add MAC filter");
@@ -3270,7 +3270,7 @@ static int ice_macaddr_set(struct rte_eth_dev *dev,
 		PMD_DRV_LOG(ERR, "Failed to add mac filter");
 		return -EIO;
 	}
-	memcpy(&pf->dev_addr, mac_addr, ETH_ADDR_LEN);
+	rte_ether_addr_copy(mac_addr, &pf->dev_addr);
 
 	flags = ICE_AQC_MAN_MAC_UPDATE_LAA_WOL;
 	ret = ice_aq_manage_mac_write(hw, mac_addr->addr_bytes, flags, NULL);
-- 
2.17.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-stable] [PATCH v4] net/ice: use the copy API to do MAC assignment
  2020-01-13  8:22 ` [dpdk-stable] [PATCH v4] net/ice: use the copy API to do MAC assignment Haiyue Wang
@ 2020-01-13  8:32   ` Ye Xiaolong
  0 siblings, 0 replies; 2+ messages in thread
From: Ye Xiaolong @ 2020-01-13  8:32 UTC (permalink / raw)
  To: Haiyue Wang; +Cc: dev, stephen, qi.z.zhang, qiming.yang, stable

On 01/13, Haiyue Wang wrote:
>Use the API rte_ether_addr_copy to do MAC assignment, instead of
>calling rte_memcpy function directly.
>
>Fixes: 84dc7a95a2d3 ("net/ice: enable flow director engine")
>Cc: stable@dpdk.org
>
>Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
>Acked-by: Qiming Yang <qiming.yang@intel.com>
>---
>v4: update the fix tags
>
>v3: Update the commit message
>
>v2: Update the commit title and message, use the rte_ether_addr_copy API
>    instead of just changing the length definition to make code style clean.
>
> drivers/net/ice/ice_ethdev.c | 14 +++++++-------
> 1 file changed, 7 insertions(+), 7 deletions(-)
>
>diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
>index 88cd90660..6b344cb6e 100644
>--- a/drivers/net/ice/ice_ethdev.c
>+++ b/drivers/net/ice/ice_ethdev.c
>@@ -875,7 +875,7 @@ ice_add_mac_filter(struct ice_vsi *vsi, struct rte_ether_addr *mac_addr)
> 		ret = -ENOMEM;
> 		goto DONE;
> 	}
>-	rte_memcpy(&f->mac_info.mac_addr, mac_addr, ETH_ADDR_LEN);
>+	rte_ether_addr_copy(mac_addr, &f->mac_info.mac_addr);
> 	TAILQ_INSERT_TAIL(&vsi->mac_list, f, next);
> 	vsi->mac_num++;
> 
>@@ -1663,16 +1663,16 @@ ice_setup_vsi(struct ice_pf *pf, enum ice_vsi_type type)
> 
> 	if (type == ICE_VSI_PF) {
> 		/* MAC configuration */
>-		rte_memcpy(pf->dev_addr.addr_bytes,
>-			   hw->port_info->mac.perm_addr,
>-			   ETH_ADDR_LEN);
>+		rte_ether_addr_copy((struct rte_ether_addr *)
>+					hw->port_info->mac.perm_addr,
>+				    &pf->dev_addr);
> 
>-		rte_memcpy(&mac_addr, &pf->dev_addr, RTE_ETHER_ADDR_LEN);
>+		rte_ether_addr_copy(&pf->dev_addr, &mac_addr);
> 		ret = ice_add_mac_filter(vsi, &mac_addr);
> 		if (ret != ICE_SUCCESS)
> 			PMD_INIT_LOG(ERR, "Failed to add dflt MAC filter");
> 
>-		rte_memcpy(&mac_addr, &broadcast, RTE_ETHER_ADDR_LEN);
>+		rte_ether_addr_copy(&broadcast, &mac_addr);
> 		ret = ice_add_mac_filter(vsi, &mac_addr);
> 		if (ret != ICE_SUCCESS)
> 			PMD_INIT_LOG(ERR, "Failed to add MAC filter");
>@@ -3270,7 +3270,7 @@ static int ice_macaddr_set(struct rte_eth_dev *dev,
> 		PMD_DRV_LOG(ERR, "Failed to add mac filter");
> 		return -EIO;
> 	}
>-	memcpy(&pf->dev_addr, mac_addr, ETH_ADDR_LEN);
>+	rte_ether_addr_copy(mac_addr, &pf->dev_addr);
> 
> 	flags = ICE_AQC_MAN_MAC_UPDATE_LAA_WOL;
> 	ret = ice_aq_manage_mac_write(hw, mac_addr->addr_bytes, flags, NULL);
>-- 
>2.17.1
>

Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>

Applied to dpdk-next-net-intel, Thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20200102071457.106137-1-haiyue.wang@intel.com>
2020-01-13  8:22 ` [dpdk-stable] [PATCH v4] net/ice: use the copy API to do MAC assignment Haiyue Wang
2020-01-13  8:32   ` Ye Xiaolong

patches for DPDK stable branches

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ http://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/ public-inbox