Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 01 Nov 2023 18:08:31 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 269133] bnxt(4):  BCM57416 - HWRM_CFA_L2_SET_RX_MASK command returned RESOURCE_ALLOC_ERROR error
Message-ID:  <bug-269133-227-fLNmCR5gW2@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-269133-227@https.bugs.freebsd.org/bugzilla/>
References:  <bug-269133-227@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D269133

--- Comment #50 from Chandrakanth Patil <chandrakanth.patil@broadcom.com> -=
--
(In reply to Kevin Bowling from comment #49)

Hi Kevin, Warner,=20

An issue is with the below code execution that leads to VLAN failure.
this problem is due to the driver is attempting to allocate an already
allocated
VLAN tag in the bnxt_hwrm_l2_filter_alloc function. Specifically, the code
snippet
below checks for a previously allocated filter ID:

        if (*filter_id !=3D -1) {
                device_printf(softc->dev, "Attempt to re-allocate l2 ctx "
                    "filter (fid: 0x%jx)\n", (uintmax_t)*filter_id);
                return EDOOFUS;
        }=20=20=20=20

Here's the sequence of events:

1. When the first VLAN is created (vlan1), the correct filter ID (other than
-1) is fetched from the firmware.
2. During the creation of the second VLAN (vlan2), the driver attempts to
allocate vlan1. The target_id of vlan1
   is a valid value, causing the above if condition to be true. Consequentl=
y,
it returns after throwing the error
   "Attempt to re-allocate l2 ctx" without allocating vlan2.

To resolve this issue, I suggest the following fix:

Assign -1 to the target_id of all VLAN tags in the list in the bnxt_init
function. Here's the relevant code snippet:

        if (!BNXT_CHIP_P5(softc)) {
                rc =3D bnxt_hwrm_func_reset(softc);
                if (rc)=20
                        return;
                SLIST_FOREACH (tag, &vnic->vlan_tags, next)
                {=20=20=20=20
                        tag->filter_id =3D -1;
                }=20=20=20=20
        } else if (softc->is_dev_init) {
                bnxt_stop(ctx);
        }=20=20=20=20

I have applied this fix on BCM57416, and it has resolved the issue for me. I
had provided this patch earlier(debug_patch_01), and I am
surprised it did not fix the problem earlier.

Could you please confirm if this patch resolves the issue?

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-269133-227-fLNmCR5gW2>