Skip to content

Commit cc07b73

Browse files
mustafakismailjgunthorpe
authored andcommitted
RDMA/irdma: Set VLAN in UD work completion correctly
Currently VLAN is reported in UD work completion when VLAN id is zero, i.e. no VLAN case. Report VLAN in UD work completion only when VLAN id is non-zero. Fixes: b48c24c ("RDMA/irdma: Implement device supported verb APIs") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mustafa Ismail <[email protected]> Signed-off-by: Shiraz Saleem <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent 5508546 commit cc07b73

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

drivers/infiniband/hw/irdma/verbs.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3399,9 +3399,13 @@ static void irdma_process_cqe(struct ib_wc *entry,
33993399
}
34003400

34013401
if (cq_poll_info->ud_vlan_valid) {
3402-
entry->vlan_id = cq_poll_info->ud_vlan & VLAN_VID_MASK;
3403-
entry->wc_flags |= IB_WC_WITH_VLAN;
3402+
u16 vlan = cq_poll_info->ud_vlan & VLAN_VID_MASK;
3403+
34043404
entry->sl = cq_poll_info->ud_vlan >> VLAN_PRIO_SHIFT;
3405+
if (vlan) {
3406+
entry->vlan_id = vlan;
3407+
entry->wc_flags |= IB_WC_WITH_VLAN;
3408+
}
34053409
} else {
34063410
entry->sl = 0;
34073411
}

0 commit comments

Comments
 (0)