[1/2] net/iavf: fix missing set primary mac type when start port

Message ID 20210427092243.391908-2-robinx.zhang@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Qi Zhang
Headers
Series fix missing set primary mac type when start port |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Robin Zhang April 27, 2021, 9:22 a.m. UTC
  When start port, all mac addresses will be set. We should set the mac
type of default MAC address as VIRTCHNL_ETHER_ADDR_PRIMARY.

Fixes: b335e7203475 ("net/iavf: fix lack of MAC type when set MAC address")

Signed-off-by: Robin Zhang <robinx.zhang@intel.com>
---
 drivers/net/iavf/iavf_vchnl.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
  

Comments

Qiming Yang April 28, 2021, 7:45 a.m. UTC | #1
Hi, 

> -----Original Message-----
> From: Zhang, RobinX <robinx.zhang@intel.com>
> Sent: Tuesday, April 27, 2021 17:23
> To: dev@dpdk.org
> Cc: Xing, Beilei <beilei.xing@intel.com>; Guo, Jia <jia.guo@intel.com>; Wu,
> Jingjing <jingjing.wu@intel.com>; Yang, Qiming <qiming.yang@intel.com>;
> Yang, SteveX <stevex.yang@intel.com>; Zhang, RobinX
> <robinx.zhang@intel.com>
> Subject: [PATCH 1/2] net/iavf: fix missing set primary mac type when start
> port
> 
> When start port, all mac addresses will be set. We should set the mac type of

Please use MAC.

> default MAC address as VIRTCHNL_ETHER_ADDR_PRIMARY.
> 
> Fixes: b335e7203475 ("net/iavf: fix lack of MAC type when set MAC address")
> 
> Signed-off-by: Robin Zhang <robinx.zhang@intel.com>
> ---
>  drivers/net/iavf/iavf_vchnl.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c index
> 0026120cf4..5d57e8b541 100644
> --- a/drivers/net/iavf/iavf_vchnl.c
> +++ b/drivers/net/iavf/iavf_vchnl.c
> @@ -1172,7 +1172,9 @@ iavf_add_del_all_mac_addr(struct iavf_adapter
> *adapter, bool add)
>  				continue;
>  			rte_memcpy(list->list[j].addr, addr->addr_bytes,
>  				   sizeof(addr->addr_bytes));
> -			list->list[j].type = VIRTCHNL_ETHER_ADDR_EXTRA;
> +			list->list[j].type = (j == 0 ?
> +
> VIRTCHNL_ETHER_ADDR_PRIMARY :
> +					      VIRTCHNL_ETHER_ADDR_EXTRA);
>  			PMD_DRV_LOG(DEBUG, "add/rm
> mac:%x:%x:%x:%x:%x:%x",
>  				    addr->addr_bytes[0], addr-
> >addr_bytes[1],
>  				    addr->addr_bytes[2], addr-
> >addr_bytes[3],
> --
> 2.25.1
  

Patch

diff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c
index 0026120cf4..5d57e8b541 100644
--- a/drivers/net/iavf/iavf_vchnl.c
+++ b/drivers/net/iavf/iavf_vchnl.c
@@ -1172,7 +1172,9 @@  iavf_add_del_all_mac_addr(struct iavf_adapter *adapter, bool add)
 				continue;
 			rte_memcpy(list->list[j].addr, addr->addr_bytes,
 				   sizeof(addr->addr_bytes));
-			list->list[j].type = VIRTCHNL_ETHER_ADDR_EXTRA;
+			list->list[j].type = (j == 0 ?
+					      VIRTCHNL_ETHER_ADDR_PRIMARY :
+					      VIRTCHNL_ETHER_ADDR_EXTRA);
 			PMD_DRV_LOG(DEBUG, "add/rm mac:%x:%x:%x:%x:%x:%x",
 				    addr->addr_bytes[0], addr->addr_bytes[1],
 				    addr->addr_bytes[2], addr->addr_bytes[3],