net/iavf: fix primary MAC type when starting port
authorRobin Zhang <robinx.zhang@intel.com>
Wed, 28 Apr 2021 08:04:51 +0000 (08:04 +0000)
committerQi Zhang <qi.z.zhang@intel.com>
Thu, 29 Apr 2021 08:37:00 +0000 (10:37 +0200)
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")
Cc: stable@dpdk.org
Signed-off-by: Robin Zhang <robinx.zhang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
drivers/net/iavf/iavf_vchnl.c

index 0026120..5d57e8b 100644 (file)
@@ -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],