mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 19:08:57 +09:00
bnxt_en: Fix incorrect multicast rx mask setting when not requested
commit8cdb159242upstream. We should setup multicast only when net_device flags explicitly has IFF_MULTICAST set. Otherwise we will incorrectly turn it on even when not asked. Fix it by only passing the multicast table to the firmware if IFF_MULTICAST is set. Fixes:7d2837dd7a("bnxt_en: Setup multicast properly after resetting device.") Signed-off-by: Pavan Chebbi <pavan.chebbi@broadcom.com> Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
24931b4d19
commit
86da2e4a12
@@ -4757,8 +4757,10 @@ static int bnxt_hwrm_cfa_l2_set_rx_mask(struct bnxt *bp, u16 vnic_id)
|
||||
return rc;
|
||||
|
||||
req->vnic_id = cpu_to_le32(vnic->fw_vnic_id);
|
||||
req->num_mc_entries = cpu_to_le32(vnic->mc_list_count);
|
||||
req->mc_tbl_addr = cpu_to_le64(vnic->mc_list_mapping);
|
||||
if (vnic->rx_mask & CFA_L2_SET_RX_MASK_REQ_MASK_MCAST) {
|
||||
req->num_mc_entries = cpu_to_le32(vnic->mc_list_count);
|
||||
req->mc_tbl_addr = cpu_to_le64(vnic->mc_list_mapping);
|
||||
}
|
||||
req->mask = cpu_to_le32(vnic->rx_mask);
|
||||
return hwrm_req_send_silent(bp, req);
|
||||
}
|
||||
@@ -8624,7 +8626,7 @@ static int bnxt_init_chip(struct bnxt *bp, bool irq_re_init)
|
||||
if (bp->dev->flags & IFF_ALLMULTI) {
|
||||
vnic->rx_mask |= CFA_L2_SET_RX_MASK_REQ_MASK_ALL_MCAST;
|
||||
vnic->mc_list_count = 0;
|
||||
} else {
|
||||
} else if (bp->dev->flags & IFF_MULTICAST) {
|
||||
u32 mask = 0;
|
||||
|
||||
bnxt_mc_list_updated(bp, &mask);
|
||||
@@ -10737,7 +10739,7 @@ static void bnxt_set_rx_mode(struct net_device *dev)
|
||||
if (dev->flags & IFF_ALLMULTI) {
|
||||
mask |= CFA_L2_SET_RX_MASK_REQ_MASK_ALL_MCAST;
|
||||
vnic->mc_list_count = 0;
|
||||
} else {
|
||||
} else if (dev->flags & IFF_MULTICAST) {
|
||||
mc_update = bnxt_mc_list_updated(bp, &mask);
|
||||
}
|
||||
|
||||
@@ -10805,9 +10807,10 @@ skip_uc:
|
||||
!bnxt_promisc_ok(bp))
|
||||
vnic->rx_mask &= ~CFA_L2_SET_RX_MASK_REQ_MASK_PROMISCUOUS;
|
||||
rc = bnxt_hwrm_cfa_l2_set_rx_mask(bp, 0);
|
||||
if (rc && vnic->mc_list_count) {
|
||||
if (rc && (vnic->rx_mask & CFA_L2_SET_RX_MASK_REQ_MASK_MCAST)) {
|
||||
netdev_info(bp->dev, "Failed setting MC filters rc: %d, turning on ALL_MCAST mode\n",
|
||||
rc);
|
||||
vnic->rx_mask &= ~CFA_L2_SET_RX_MASK_REQ_MASK_MCAST;
|
||||
vnic->rx_mask |= CFA_L2_SET_RX_MASK_REQ_MASK_ALL_MCAST;
|
||||
vnic->mc_list_count = 0;
|
||||
rc = bnxt_hwrm_cfa_l2_set_rx_mask(bp, 0);
|
||||
|
||||
Reference in New Issue
Block a user