From: Alexander Duyck <alexanderduyck@fb.com>
The fbnic_bmc_rpc_check function clears FBNIC_FW_CAP_F_BMC_MACDA_SYNC
before it sends the MACDA table to firmware and does not set it again
when the send fails. A transient failure, -ENOMEM on the message page,
-EBUSY from a full mailbox, or a DMA mapping error, leaves firmware with
a stale address list and stale receive flags until some unrelated change
happens to raise the flag again.
Set the flag again on failure so the next service task pass retries, and
rate limit the warning now that it can repeat.
Fixes: cee8d21d8091 ("fbnic: Push local unicast MAC addresses to FW to populate TCAMs")
Signed-off-by: Alexander Duyck <alexanderduyck@fb.com>
---
drivers/net/ethernet/meta/fbnic/fbnic_rpc.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/meta/fbnic/fbnic_rpc.c b/drivers/net/ethernet/meta/fbnic/fbnic_rpc.c
index 0be71e6fd3d4..d69c91066508 100644
--- a/drivers/net/ethernet/meta/fbnic/fbnic_rpc.c
+++ b/drivers/net/ethernet/meta/fbnic/fbnic_rpc.c
@@ -345,9 +345,14 @@ void fbnic_bmc_rpc_check(struct fbnic_dev *fbd)
if (test_and_clear_bit(FBNIC_FW_CAP_F_BMC_MACDA_SYNC,
&fbd->fw_cap.state)) {
err = fbnic_fw_xmit_rpc_macda_sync(fbd);
- if (err)
- dev_warn(fbd->dev,
- "Writing MACDA table to FW failed, err: %d\n", err);
+ if (err) {
+ dev_warn_ratelimited(fbd->dev,
+ "Writing MACDA table to FW failed, err: %d\n",
+ err);
+ /* Leave FW to be synced on the next pass */
+ set_bit(FBNIC_FW_CAP_F_BMC_MACDA_SYNC,
+ &fbd->fw_cap.state);
+ }
}
netdev_unlock(fbd->netdev);