diff options
author | Mustafa Ismail <mustafa.ismail@intel.com> | 2021-10-19 10:16:53 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-11-02 19:50:59 +0100 |
commit | 6392f26fbe9290c7abf1ba9aaa19ac9390cbf192 (patch) | |
tree | 1c276d7c08a8df7ce1c35df50c9e424ffb0962e9 | |
parent | 7762917173cccb13e23068b302d027285ba3f9db (diff) | |
download | linux-stable-6392f26fbe9290c7abf1ba9aaa19ac9390cbf192.tar.gz linux-stable-6392f26fbe9290c7abf1ba9aaa19ac9390cbf192.tar.bz2 linux-stable-6392f26fbe9290c7abf1ba9aaa19ac9390cbf192.zip |
RDMA/irdma: Set VLAN in UD work completion correctly
[ Upstream commit cc07b73ef11d11d4359fb104d0199b22451dd3d8 ]
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: b48c24c2d710 ("RDMA/irdma: Implement device supported verb APIs")
Link: https://lore.kernel.org/r/20211019151654.1943-1-shiraz.saleem@intel.com
Signed-off-by: Mustafa Ismail <mustafa.ismail@intel.com>
Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r-- | drivers/infiniband/hw/irdma/verbs.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/irdma/verbs.c b/drivers/infiniband/hw/irdma/verbs.c index fa393c5ea397..4261705fa19d 100644 --- a/drivers/infiniband/hw/irdma/verbs.c +++ b/drivers/infiniband/hw/irdma/verbs.c @@ -3405,9 +3405,13 @@ static void irdma_process_cqe(struct ib_wc *entry, } if (cq_poll_info->ud_vlan_valid) { - entry->vlan_id = cq_poll_info->ud_vlan & VLAN_VID_MASK; - entry->wc_flags |= IB_WC_WITH_VLAN; + u16 vlan = cq_poll_info->ud_vlan & VLAN_VID_MASK; + entry->sl = cq_poll_info->ud_vlan >> VLAN_PRIO_SHIFT; + if (vlan) { + entry->vlan_id = vlan; + entry->wc_flags |= IB_WC_WITH_VLAN; + } } else { entry->sl = 0; } |