[07/17] net/bnxt: use mac index, while checking for default mac

Message ID 20191024074432.30705-8-somnath.kotur@broadcom.com (mailing list archive)
State Accepted, archived
Delegated to: Ajit Khaparde
Headers
Series bnxt patchset with bug fixes |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Somnath Kotur Oct. 24, 2019, 7:44 a.m. UTC
  From: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>

bnxt_set_hwrm_vnic_filters programs default mac addr and the
same default mac is added by mac_add_addr_op routine as well.
This redundant mac add is avoided by checking if the default
mac is already added.

However, that check is wrong. The check should consider the
mac index as well to determine the default mac. This patch
fixes it by using mac index to determine the default mac.

Fixes: d42878f5fa17 ("net/bnxt: fix vlan filtering code path")
Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
---
 drivers/net/bnxt/bnxt_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Patch

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index ce3a03a..820005c 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -1023,7 +1023,7 @@  static int bnxt_add_mac_filter(struct bnxt *bp, struct bnxt_vnic_info *vnic,
 	 * hw-vlan-filter is turned OFF from ON, default
 	 * MAC filter should be restored
 	 */
-	if (filter->dflt)
+	if (index == 0 && filter->dflt)
 		return 0;
 
 	filter = bnxt_alloc_filter(bp);