bnxt_en: Improve multicast address setup logic. [Linux 5.1]

bnxt_en: Improve multicast address setup logic. [Linux 5.1]

This Linux kernel change "bnxt_en: Improve multicast address setup logic" is included in the Linux 5.1 release. This change is authored by Michael Chan <michael.chan [at]> on Thu Apr 25 22:31:50 2019 -0400. The commit for this change in Linux stable tree is b4e30e8 (patch).

bnxt_en: Improve multicast address setup logic.

The driver builds a list of multicast addresses and sends it to the
firmware when the driver's ndo_set_rx_mode() is called.  In rare
cases, the firmware can fail this call if internal resources to
add multicast addresses are exhausted.  In that case, we should
try the call again by setting the ALL_MCAST flag which is more
guaranteed to succeed.

Fixes: c0c050c58d84 ("bnxt_en: New Broadcom ethernet driver.")
Signed-off-by: Michael Chan <>
Signed-off-by: David S. Miller <>

There are 9 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 4c586ba..42fd273 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -8961,8 +8961,15 @@ static int bnxt_cfg_rx_mode(struct bnxt *bp)

    rc = bnxt_hwrm_cfa_l2_set_rx_mask(bp, 0);
+   if (rc && vnic->mc_list_count) {
+       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_ALL_MCAST;
+       vnic->mc_list_count = 0;
+       rc = bnxt_hwrm_cfa_l2_set_rx_mask(bp, 0);
+   }
    if (rc)
-       netdev_err(bp->dev, "HWRM cfa l2 rx mask failure rc: %x\n",
+       netdev_err(bp->dev, "HWRM cfa l2 rx mask failure rc: %d\n",

    return rc;

Leave a Reply

Your email address will not be published. Required fields are marked *