[v1] net/ice: align with MAC address length definition
diff mbox series

Message ID 20200102071457.106137-1-haiyue.wang@intel.com
State Superseded
Delegated to: xiaolong ye
Headers show
Series
  • [v1] net/ice: align with MAC address length definition
Related show

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/travis-robot success Travis build: passed
ci/iol-nxp-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/checkpatch success coding style OK

Commit Message

Haiyue Wang Jan. 2, 2020, 7:14 a.m. UTC
Use the standand MAC address length definition in PMD's scope.

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
---
 drivers/net/ice/ice_ethdev.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Zhang, Qi Z Jan. 2, 2020, 2:01 p.m. UTC | #1
> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Haiyue Wang
> Sent: Thursday, January 2, 2020 3:15 PM
> To: dev@dpdk.org; Ye, Xiaolong <xiaolong.ye@intel.com>
> Cc: Wang, Haiyue <haiyue.wang@intel.com>
> Subject: [dpdk-dev] [PATCH v1] net/ice: align with MAC address length
> definition
> 
> Use the standand MAC address length definition in PMD's scope.

Standard
 
> 
> Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>

Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Stephen Hemminger Jan. 2, 2020, 5:36 p.m. UTC | #2
On Thu,  2 Jan 2020 15:14:57 +0800
Haiyue Wang <haiyue.wang@intel.com> wrote:

> Use the standand MAC address length definition in PMD's scope.
> 
> Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
> ---
>  drivers/net/ice/ice_ethdev.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
> index 2cbd82c94..80b422a27 100644
> --- a/drivers/net/ice/ice_ethdev.c
> +++ b/drivers/net/ice/ice_ethdev.c
> @@ -873,7 +873,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_memcpy(&f->mac_info.mac_addr, mac_addr, RTE_ETHER_ADDR_LEN);

Please use rte_ether_addr_copy instead.
Haiyue Wang Jan. 3, 2020, 1:15 a.m. UTC | #3
> -----Original Message-----
> From: Stephen Hemminger <stephen@networkplumber.org>
> Sent: Friday, January 3, 2020 01:37
> To: Wang, Haiyue <haiyue.wang@intel.com>
> Cc: dev@dpdk.org; Ye, Xiaolong <xiaolong.ye@intel.com>
> Subject: Re: [dpdk-dev] [PATCH v1] net/ice: align with MAC address length definition
> 
> On Thu,  2 Jan 2020 15:14:57 +0800
> Haiyue Wang <haiyue.wang@intel.com> wrote:
> 
> > Use the standand MAC address length definition in PMD's scope.
> >
> > Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
> > ---
> >  drivers/net/ice/ice_ethdev.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
> > index 2cbd82c94..80b422a27 100644
> > --- a/drivers/net/ice/ice_ethdev.c
> > +++ b/drivers/net/ice/ice_ethdev.c
> > @@ -873,7 +873,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_memcpy(&f->mac_info.mac_addr, mac_addr, RTE_ETHER_ADDR_LEN);
> 
> Please use rte_ether_addr_copy instead.
Will be update patch v2.

Patch
diff mbox series

diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
index 2cbd82c94..80b422a27 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -873,7 +873,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_memcpy(&f->mac_info.mac_addr, mac_addr, RTE_ETHER_ADDR_LEN);
 	TAILQ_INSERT_TAIL(&vsi->mac_list, f, next);
 	vsi->mac_num++;
 
@@ -1662,7 +1662,7 @@  ice_setup_vsi(struct ice_pf *pf, enum ice_vsi_type type)
 		/* MAC configuration */
 		rte_memcpy(pf->dev_addr.addr_bytes,
 			   hw->port_info->mac.perm_addr,
-			   ETH_ADDR_LEN);
+			   RTE_ETHER_ADDR_LEN);
 
 		rte_memcpy(&mac_addr, &pf->dev_addr, RTE_ETHER_ADDR_LEN);
 		ret = ice_add_mac_filter(vsi, &mac_addr);
@@ -3267,7 +3267,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_memcpy(&pf->dev_addr, mac_addr, RTE_ETHER_ADDR_LEN);
 
 	flags = ICE_AQC_MAN_MAC_UPDATE_LAA_WOL;
 	ret = ice_aq_manage_mac_write(hw, mac_addr->addr_bytes, flags, NULL);