I have a BCM57416 (bnxt0 and bnxt1) in a lagg(4) with a few VLANs on
top of it. After an ifconfig down/up of the lagg, both ports stayed
down (OACTIVE set, not RUNNING) and dmesg showed:
bnxt0: Attempt to re-allocate l2 ctx filter (fid: 0x...)
As far as I can tell, bnxt_clear_ids() resets vnic_info.filter_id but
not the filter_id on each VLAN tag, which was added in 91fcacc35597.
On this chip the function reset in bnxt_init_hw()/bnxt_stop() frees
the filters in the firmware, but the tags keep their old IDs, so on
the next init bnxt_hwrm_l2_filter_alloc() refuses to allocate and the
init fails. It then keeps failing until the VLANs are removed.
This patch resets the per-tag filter_id in bnxt_clear_ids() as well.
I'm not very familiar with this driver, so I'm not sure this is the
right place for the fix. I could only test a pre-P5 chip. From
reading the code, P5 and later chips free the filters one at a time
and reset the IDs, so I don't think they normally hit this (maybe
after a firmware reset?).
Proposed commit message:
bnxt: reset VLAN filter IDs in bnxt_clear_ids()
bnxt_clear_ids() resets the firmware IDs the driver caches, including
vnic_info.filter_id, but not the per-VLAN filter IDs added in
91fcacc35597. On pre-P5 chips, bnxt_init_hw() and bnxt_stop() free
the filters in firmware with HWRM_FUNC_RESET and leave tag->filter_id
set. Once the VLAN filters have been allocated, the next init (for
example from ifconfig down/up or an MTU change) fails in
bnxt_hwrm_set_filter() with "Attempt to re-allocate l2 ctx filter",
and the port stays down until its VLANs are removed.
Reset tag->filter_id along with vnic_info.filter_id.
Fixes: 91fcacc35597 ("if_bnxt: Add support for VLAN on Thor")
MFC after: 2 weeks
Sponsored by: Klara, Inc.