[v3,12/18] net/bnxt: set allmulti mode if multicast filter fails
Checks
Commit Message
Fallback to all multicast mode if FW rejects multicast filter
programming.
The firmware can reject the MC filter programming request if
it is running low in resources when there is a large number of functions.
The driver must be prepared to fallback to the all-multicast mode
if the original MC filter programming request is rejected.
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Damodharam Ammepalli <damodharam.ammepalli@broadcom.com>
---
drivers/net/bnxt/bnxt_ethdev.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
@@ -2947,7 +2947,17 @@ bnxt_dev_set_mc_addr_list_op(struct rte_eth_dev *eth_dev,
vnic->flags &= ~BNXT_VNIC_INFO_MCAST;
allmulti:
- return bnxt_hwrm_cfa_l2_set_rx_mask(bp, vnic, 0, NULL);
+ rc = bnxt_hwrm_cfa_l2_set_rx_mask(bp, vnic, 0, NULL);
+ if (rc == -ENOSPC && (vnic->flags & BNXT_VNIC_INFO_MCAST)) {
+ /* If MCAST addition failed because FW ran out of
+ * multicast filters, enable all multicast mode.
+ */
+ vnic->flags &= ~BNXT_VNIC_INFO_MCAST;
+ vnic->flags |= BNXT_VNIC_INFO_ALLMULTI;
+ goto allmulti;
+ }
+
+ return rc;
}
static int