DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v1] net/ice: align with MAC address length definition
@ 2020-01-02  7:14 Haiyue Wang
  2020-01-02 14:01 ` Zhang, Qi Z
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Haiyue Wang @ 2020-01-02  7:14 UTC (permalink / raw)
  To: dev, xiaolong.ye; +Cc: Haiyue Wang

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);
 	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);
-- 
2.17.1


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

* Re: [dpdk-dev] [PATCH v1] net/ice: align with MAC address length definition
  2020-01-02  7:14 [dpdk-dev] [PATCH v1] net/ice: align with MAC address length definition Haiyue Wang
@ 2020-01-02 14:01 ` Zhang, Qi Z
  2020-01-02 17:36 ` Stephen Hemminger
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 13+ messages in thread
From: Zhang, Qi Z @ 2020-01-02 14:01 UTC (permalink / raw)
  To: Wang, Haiyue, dev, Ye, Xiaolong; +Cc: Wang, Haiyue



> -----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>


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

* Re: [dpdk-dev] [PATCH v1] net/ice: align with MAC address length definition
  2020-01-02  7:14 [dpdk-dev] [PATCH v1] net/ice: align with MAC address length definition Haiyue Wang
  2020-01-02 14:01 ` Zhang, Qi Z
@ 2020-01-02 17:36 ` Stephen Hemminger
  2020-01-03  1:15   ` Wang, Haiyue
  2020-01-03  2:02 ` [dpdk-dev] [PATCH v2] net/ice: use the copy API to do MAC assignment Haiyue Wang
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 13+ messages in thread
From: Stephen Hemminger @ 2020-01-02 17:36 UTC (permalink / raw)
  To: Haiyue Wang; +Cc: dev, xiaolong.ye

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.

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

* Re: [dpdk-dev] [PATCH v1] net/ice: align with MAC address length definition
  2020-01-02 17:36 ` Stephen Hemminger
@ 2020-01-03  1:15   ` Wang, Haiyue
  0 siblings, 0 replies; 13+ messages in thread
From: Wang, Haiyue @ 2020-01-03  1:15 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: dev, Ye, Xiaolong

> -----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.

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

* [dpdk-dev] [PATCH v2] net/ice: use the copy API to do MAC assignment
  2020-01-02  7:14 [dpdk-dev] [PATCH v1] net/ice: align with MAC address length definition Haiyue Wang
  2020-01-02 14:01 ` Zhang, Qi Z
  2020-01-02 17:36 ` Stephen Hemminger
@ 2020-01-03  2:02 ` Haiyue Wang
  2020-01-03  2:23   ` Yang, Qiming
  2020-01-03  2:58 ` [dpdk-dev] [PATCH v3] " Haiyue Wang
  2020-01-13  8:22 ` [dpdk-dev] [PATCH v4] " Haiyue Wang
  4 siblings, 1 reply; 13+ messages in thread
From: Haiyue Wang @ 2020-01-03  2:02 UTC (permalink / raw)
  To: dev, stephen, qi.z.zhang, xiaolong.ye; +Cc: Haiyue Wang

Use the fast copy an Ethernet address API to do MAC assignment, instead
of calling rte_memcpy function.

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
---
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 2cbd82c94..d104df26f 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_ether_addr_copy(mac_addr, &f->mac_info.mac_addr);
 	TAILQ_INSERT_TAIL(&vsi->mac_list, f, next);
 	vsi->mac_num++;
 
@@ -1660,16 +1660,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");
@@ -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_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] 13+ messages in thread

* Re: [dpdk-dev] [PATCH v2] net/ice: use the copy API to do MAC assignment
  2020-01-03  2:02 ` [dpdk-dev] [PATCH v2] net/ice: use the copy API to do MAC assignment Haiyue Wang
@ 2020-01-03  2:23   ` Yang, Qiming
  2020-01-03  2:59     ` Wang, Haiyue
  0 siblings, 1 reply; 13+ messages in thread
From: Yang, Qiming @ 2020-01-03  2:23 UTC (permalink / raw)
  To: Wang, Haiyue, dev, stephen, Zhang, Qi Z, Ye, Xiaolong; +Cc: Wang, Haiyue


> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Haiyue Wang
> Sent: Friday, January 3, 2020 10:02 AM
> To: dev@dpdk.org; stephen@networkplumber.org; Zhang, Qi Z
> <qi.z.zhang@intel.com>; Ye, Xiaolong <xiaolong.ye@intel.com>
> Cc: Wang, Haiyue <haiyue.wang@intel.com>
> Subject: [dpdk-dev] [PATCH v2] net/ice: use the copy API to do MAC
> assignment
> 
> Use the fast copy an Ethernet address API to do MAC assignment, instead of

I think the grammar is not right. Do you want to say 'Use rte_ether_addr_copy API to copy an Ethernet address'?

> calling rte_memcpy function.
> 
> Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
> ---
> 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
> 2cbd82c94..d104df26f 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_ether_addr_copy(mac_addr, &f->mac_info.mac_addr);
>  	TAILQ_INSERT_TAIL(&vsi->mac_list, f, next);
>  	vsi->mac_num++;
> 
> @@ -1660,16 +1660,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"); @@
> -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_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] 13+ messages in thread

* [dpdk-dev] [PATCH v3] net/ice: use the copy API to do MAC assignment
  2020-01-02  7:14 [dpdk-dev] [PATCH v1] net/ice: align with MAC address length definition Haiyue Wang
                   ` (2 preceding siblings ...)
  2020-01-03  2:02 ` [dpdk-dev] [PATCH v2] net/ice: use the copy API to do MAC assignment Haiyue Wang
@ 2020-01-03  2:58 ` Haiyue Wang
  2020-01-06  2:45   ` Yang, Qiming
  2020-01-13  8:05   ` Ye Xiaolong
  2020-01-13  8:22 ` [dpdk-dev] [PATCH v4] " Haiyue Wang
  4 siblings, 2 replies; 13+ messages in thread
From: Haiyue Wang @ 2020-01-03  2:58 UTC (permalink / raw)
  To: dev, stephen, qi.z.zhang, qiming.yang, xiaolong.ye; +Cc: Haiyue Wang

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

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
---
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 2cbd82c94..d104df26f 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_ether_addr_copy(mac_addr, &f->mac_info.mac_addr);
 	TAILQ_INSERT_TAIL(&vsi->mac_list, f, next);
 	vsi->mac_num++;
 
@@ -1660,16 +1660,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");
@@ -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_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] 13+ messages in thread

* Re: [dpdk-dev] [PATCH v2] net/ice: use the copy API to do MAC assignment
  2020-01-03  2:23   ` Yang, Qiming
@ 2020-01-03  2:59     ` Wang, Haiyue
  0 siblings, 0 replies; 13+ messages in thread
From: Wang, Haiyue @ 2020-01-03  2:59 UTC (permalink / raw)
  To: Yang, Qiming, dev, stephen, Zhang, Qi Z, Ye, Xiaolong

> -----Original Message-----
> From: Yang, Qiming <qiming.yang@intel.com>
> Sent: Friday, January 3, 2020 10:23
> To: Wang, Haiyue <haiyue.wang@intel.com>; dev@dpdk.org; stephen@networkplumber.org; Zhang, Qi Z
> <qi.z.zhang@intel.com>; Ye, Xiaolong <xiaolong.ye@intel.com>
> Cc: Wang, Haiyue <haiyue.wang@intel.com>
> Subject: RE: [dpdk-dev] [PATCH v2] net/ice: use the copy API to do MAC assignment
> 
> 
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Haiyue Wang
> > Sent: Friday, January 3, 2020 10:02 AM
> > To: dev@dpdk.org; stephen@networkplumber.org; Zhang, Qi Z
> > <qi.z.zhang@intel.com>; Ye, Xiaolong <xiaolong.ye@intel.com>
> > Cc: Wang, Haiyue <haiyue.wang@intel.com>
> > Subject: [dpdk-dev] [PATCH v2] net/ice: use the copy API to do MAC
> > assignment
> >
> > Use the fast copy an Ethernet address API to do MAC assignment, instead of
> 
> I think the grammar is not right. Do you want to say 'Use rte_ether_addr_copy API to copy an Ethernet
> address'?

Yes, I copied the rte_ether_addr_copy's comment 'Fast copy an Ethernet address. ' ;-)
> 
> > calling rte_memcpy function.
> >
> > Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
> > ---
> > 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
> > 2cbd82c94..d104df26f 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_ether_addr_copy(mac_addr, &f->mac_info.mac_addr);
> >  	TAILQ_INSERT_TAIL(&vsi->mac_list, f, next);
> >  	vsi->mac_num++;
> >
> > @@ -1660,16 +1660,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"); @@
> > -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_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] 13+ messages in thread

* Re: [dpdk-dev] [PATCH v3] net/ice: use the copy API to do MAC assignment
  2020-01-03  2:58 ` [dpdk-dev] [PATCH v3] " Haiyue Wang
@ 2020-01-06  2:45   ` Yang, Qiming
  2020-01-13  8:05   ` Ye Xiaolong
  1 sibling, 0 replies; 13+ messages in thread
From: Yang, Qiming @ 2020-01-06  2:45 UTC (permalink / raw)
  To: Wang, Haiyue, dev, stephen, Zhang, Qi Z, Ye, Xiaolong


> -----Original Message-----
> From: Wang, Haiyue
> Sent: Friday, January 3, 2020 10:59 AM
> To: dev@dpdk.org; stephen@networkplumber.org; Zhang, Qi Z
> <qi.z.zhang@intel.com>; Yang, Qiming <qiming.yang@intel.com>; Ye,
> Xiaolong <xiaolong.ye@intel.com>
> Cc: Wang, Haiyue <haiyue.wang@intel.com>
> Subject: [PATCH v3] net/ice: use the copy API to do MAC assignment
> 
> Use the API rte_ether_addr_copy to do MAC assignment, instead of calling
> rte_memcpy function directly.
> 
> Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
> ---
> 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
> 2cbd82c94..d104df26f 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_ether_addr_copy(mac_addr, &f->mac_info.mac_addr);
>  	TAILQ_INSERT_TAIL(&vsi->mac_list, f, next);
>  	vsi->mac_num++;
> 
> @@ -1660,16 +1660,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"); @@
> -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_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: Qiming Yang <qiming.yang@intel.com>

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

* Re: [dpdk-dev] [PATCH v3] net/ice: use the copy API to do MAC assignment
  2020-01-03  2:58 ` [dpdk-dev] [PATCH v3] " Haiyue Wang
  2020-01-06  2:45   ` Yang, Qiming
@ 2020-01-13  8:05   ` Ye Xiaolong
  2020-01-13  8:29     ` Wang, Haiyue
  1 sibling, 1 reply; 13+ messages in thread
From: Ye Xiaolong @ 2020-01-13  8:05 UTC (permalink / raw)
  To: Haiyue Wang; +Cc: dev, stephen, qi.z.zhang, qiming.yang

Hi, haiyue

On 01/03, Haiyue Wang wrote:
>Use the API rte_ether_addr_copy to do MAC assignment, instead of
>calling rte_memcpy function directly.

Please add Fix tags and cc stable.

Thanks,
Xiaolong
>
>Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
>---
>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 2cbd82c94..d104df26f 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_ether_addr_copy(mac_addr, &f->mac_info.mac_addr);
> 	TAILQ_INSERT_TAIL(&vsi->mac_list, f, next);
> 	vsi->mac_num++;
> 
>@@ -1660,16 +1660,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");
>@@ -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_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] 13+ messages in thread

* [dpdk-dev] [PATCH v4] net/ice: use the copy API to do MAC assignment
  2020-01-02  7:14 [dpdk-dev] [PATCH v1] net/ice: align with MAC address length definition Haiyue Wang
                   ` (3 preceding siblings ...)
  2020-01-03  2:58 ` [dpdk-dev] [PATCH v3] " Haiyue Wang
@ 2020-01-13  8:22 ` Haiyue Wang
  2020-01-13  8:32   ` Ye Xiaolong
  4 siblings, 1 reply; 13+ 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] 13+ messages in thread

* Re: [dpdk-dev] [PATCH v3] net/ice: use the copy API to do MAC assignment
  2020-01-13  8:05   ` Ye Xiaolong
@ 2020-01-13  8:29     ` Wang, Haiyue
  0 siblings, 0 replies; 13+ messages in thread
From: Wang, Haiyue @ 2020-01-13  8:29 UTC (permalink / raw)
  To: Ye, Xiaolong; +Cc: dev, stephen, Zhang, Qi Z, Yang, Qiming

> -----Original Message-----
> From: Ye, Xiaolong <xiaolong.ye@intel.com>
> Sent: Monday, January 13, 2020 16:06
> To: Wang, Haiyue <haiyue.wang@intel.com>
> Cc: dev@dpdk.org; stephen@networkplumber.org; Zhang, Qi Z <qi.z.zhang@intel.com>; Yang, Qiming
> <qiming.yang@intel.com>
> Subject: Re: [PATCH v3] net/ice: use the copy API to do MAC assignment
> 
> Hi, haiyue
> 
> On 01/03, Haiyue Wang wrote:
> >Use the API rte_ether_addr_copy to do MAC assignment, instead of
> >calling rte_memcpy function directly.
> 
> Please add Fix tags and cc stable.
> 

Done in v4.

> Thanks,
> Xiaolong
> >
> >Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
> >---
> >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 2cbd82c94..d104df26f 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_ether_addr_copy(mac_addr, &f->mac_info.mac_addr);
> > 	TAILQ_INSERT_TAIL(&vsi->mac_list, f, next);
> > 	vsi->mac_num++;
> >
> >@@ -1660,16 +1660,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");
> >@@ -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_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] 13+ messages in thread

* Re: [dpdk-dev] [PATCH v4] net/ice: use the copy API to do MAC assignment
  2020-01-13  8:22 ` [dpdk-dev] [PATCH v4] " Haiyue Wang
@ 2020-01-13  8:32   ` Ye Xiaolong
  0 siblings, 0 replies; 13+ 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] 13+ messages in thread

end of thread, other threads:[~2020-01-13  8:32 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-02  7:14 [dpdk-dev] [PATCH v1] net/ice: align with MAC address length definition Haiyue Wang
2020-01-02 14:01 ` Zhang, Qi Z
2020-01-02 17:36 ` Stephen Hemminger
2020-01-03  1:15   ` Wang, Haiyue
2020-01-03  2:02 ` [dpdk-dev] [PATCH v2] net/ice: use the copy API to do MAC assignment Haiyue Wang
2020-01-03  2:23   ` Yang, Qiming
2020-01-03  2:59     ` Wang, Haiyue
2020-01-03  2:58 ` [dpdk-dev] [PATCH v3] " Haiyue Wang
2020-01-06  2:45   ` Yang, Qiming
2020-01-13  8:05   ` Ye Xiaolong
2020-01-13  8:29     ` Wang, Haiyue
2020-01-13  8:22 ` [dpdk-dev] [PATCH v4] " Haiyue Wang
2020-01-13  8:32   ` Ye Xiaolong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).