Skip to content

Commit 2d0e60e

Browse files
selvintxavierjgunthorpe
authored andcommitted
RDMA/bnxt_re: Do not report transparent vlan from QP1
QP1 Rx CQE reports transparent VLAN ID in the completion and this is used while reporting the completion for received MAD packet. Check if the vlan id is configured before reporting it in the work completion. Fixes: 8451145 ("RDMA/bnxt_re: report vlan_id and sl in qp1 recv completion") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Selvin Xavier <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent ec78b3b commit 2d0e60e

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

drivers/infiniband/hw/bnxt_re/ib_verbs.c

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3264,6 +3264,19 @@ static void bnxt_re_process_res_rawqp1_wc(struct ib_wc *wc,
32643264
wc->wc_flags |= IB_WC_GRH;
32653265
}
32663266

3267+
static bool bnxt_re_check_if_vlan_valid(struct bnxt_re_dev *rdev,
3268+
u16 vlan_id)
3269+
{
3270+
/*
3271+
* Check if the vlan is configured in the host. If not configured, it
3272+
* can be a transparent VLAN. So dont report the vlan id.
3273+
*/
3274+
if (!__vlan_find_dev_deep_rcu(rdev->netdev,
3275+
htons(ETH_P_8021Q), vlan_id))
3276+
return false;
3277+
return true;
3278+
}
3279+
32673280
static bool bnxt_re_is_vlan_pkt(struct bnxt_qplib_cqe *orig_cqe,
32683281
u16 *vid, u8 *sl)
32693282
{
@@ -3332,9 +3345,11 @@ static void bnxt_re_process_res_shadow_qp_wc(struct bnxt_re_qp *gsi_sqp,
33323345
wc->src_qp = orig_cqe->src_qp;
33333346
memcpy(wc->smac, orig_cqe->smac, ETH_ALEN);
33343347
if (bnxt_re_is_vlan_pkt(orig_cqe, &vlan_id, &sl)) {
3335-
wc->vlan_id = vlan_id;
3336-
wc->sl = sl;
3337-
wc->wc_flags |= IB_WC_WITH_VLAN;
3348+
if (bnxt_re_check_if_vlan_valid(rdev, vlan_id)) {
3349+
wc->vlan_id = vlan_id;
3350+
wc->sl = sl;
3351+
wc->wc_flags |= IB_WC_WITH_VLAN;
3352+
}
33383353
}
33393354
wc->port_num = 1;
33403355
wc->vendor_err = orig_cqe->status;

0 commit comments

Comments
 (0)