summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorKalesh AP <kalesh-anakkur.purayil@broadcom.com>2019-10-02 16:25:50 -0700
committerFerruh Yigit <ferruh.yigit@intel.com>2019-10-08 12:14:31 +0200
commit988562f0b7a6085fa9fa1b8c68efacd722c60c31 (patch)
treebe31c772b0ea0176bb93a2b9005a5350e39f0467 /drivers/net
parent8d0a244b40b2ccaa5e286bb332c0bdc73a90fd96 (diff)
downloaddpdk-988562f0b7a6085fa9fa1b8c68efacd722c60c31.zip
dpdk-988562f0b7a6085fa9fa1b8c68efacd722c60c31.tar.gz
dpdk-988562f0b7a6085fa9fa1b8c68efacd722c60c31.tar.xz
net/bnxt: fix setting default MAC address
Driver was incorrectly programming the MAC with the already configured one instead of the newly requested MAC by user. Also, fix to restore the old mac address back to the default vnic filter if the mac update operation fails. Fixes: 68f589f2c728 ("net/bnxt: fix setting primary MAC address") Cc: stable@dpdk.org Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com> Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com> Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/bnxt/bnxt_ethdev.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 7cd3213..2c9eaaa 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -1904,7 +1904,7 @@ bnxt_set_default_mac_addr_op(struct rte_eth_dev *dev,
if (filter->mac_index != 0)
continue;
- memcpy(filter->l2_addr, bp->mac_addr, RTE_ETHER_ADDR_LEN);
+ memcpy(filter->l2_addr, addr, RTE_ETHER_ADDR_LEN);
memset(filter->l2_addr_mask, 0xff, RTE_ETHER_ADDR_LEN);
filter->flags |= HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_RX |
HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_OUTERMOST;
@@ -1913,8 +1913,11 @@ bnxt_set_default_mac_addr_op(struct rte_eth_dev *dev,
HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR_MASK;
rc = bnxt_hwrm_set_l2_filter(bp, vnic->fw_vnic_id, filter);
- if (rc)
+ if (rc) {
+ memcpy(filter->l2_addr, bp->mac_addr,
+ RTE_ETHER_ADDR_LEN);
return rc;
+ }
memcpy(bp->mac_addr, addr, RTE_ETHER_ADDR_LEN);
PMD_DRV_LOG(DEBUG, "Set MAC addr\n");