* [PATCH rdma-rc 1/2] RDMA/irdma: Set VLAN in UD work completion correctly
@ 2021-10-19 15:16 Shiraz Saleem
2021-10-19 15:16 ` [PATCH rdma-rc 2/2] RDMA/irdma: Do not hold qos mutex twice on QP resume Shiraz Saleem
2021-10-19 23:28 ` [PATCH rdma-rc 1/2] RDMA/irdma: Set VLAN in UD work completion correctly Jason Gunthorpe
0 siblings, 2 replies; 3+ messages in thread
From: Shiraz Saleem @ 2021-10-19 15:16 UTC (permalink / raw)
To: dledford, jgg; +Cc: linux-rdma, Mustafa Ismail, Shiraz Saleem
From: Mustafa Ismail <mustafa.ismail@intel.com>
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")
Signed-off-by: Mustafa Ismail <mustafa.ismail@intel.com>
Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
---
drivers/infiniband/hw/irdma/verbs.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/infiniband/hw/irdma/verbs.c b/drivers/infiniband/hw/irdma/verbs.c
index 7110ebf..102dc93 100644
--- a/drivers/infiniband/hw/irdma/verbs.c
+++ b/drivers/infiniband/hw/irdma/verbs.c
@@ -3399,9 +3399,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;
}
--
1.8.3.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH rdma-rc 2/2] RDMA/irdma: Do not hold qos mutex twice on QP resume
2021-10-19 15:16 [PATCH rdma-rc 1/2] RDMA/irdma: Set VLAN in UD work completion correctly Shiraz Saleem
@ 2021-10-19 15:16 ` Shiraz Saleem
2021-10-19 23:28 ` [PATCH rdma-rc 1/2] RDMA/irdma: Set VLAN in UD work completion correctly Jason Gunthorpe
1 sibling, 0 replies; 3+ messages in thread
From: Shiraz Saleem @ 2021-10-19 15:16 UTC (permalink / raw)
To: dledford, jgg; +Cc: linux-rdma, Mustafa Ismail, Shiraz Saleem
From: Mustafa Ismail <mustafa.ismail@intel.com>
When irdma_ws_add fails, irdma_ws_remove is used to cleanup the leaf node.
This lead to holding the qos mutex twice in the QP resume path. Fix this
by avoiding the call to irdma_ws_remove and unwinding the error in
irdma_ws_add. This skips the call to irdma_tc_in_use function which is not
needed in the error unwind cases.
Fixes: 3ae331c75128 ("RDMA/irdma: Add QoS definitions")
Signed-off-by: Mustafa Ismail <mustafa.ismail@intel.com>
Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
---
drivers/infiniband/hw/irdma/ws.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/drivers/infiniband/hw/irdma/ws.c b/drivers/infiniband/hw/irdma/ws.c
index b68c575..b0d6ee0 100644
--- a/drivers/infiniband/hw/irdma/ws.c
+++ b/drivers/infiniband/hw/irdma/ws.c
@@ -330,8 +330,10 @@ enum irdma_status_code irdma_ws_add(struct irdma_sc_vsi *vsi, u8 user_pri)
tc_node->enable = true;
ret = irdma_ws_cqp_cmd(vsi, tc_node, IRDMA_OP_WS_MODIFY_NODE);
- if (ret)
+ if (ret) {
+ vsi->unregister_qset(vsi, tc_node);
goto reg_err;
+ }
}
ibdev_dbg(to_ibdev(vsi->dev),
"WS: Using node %d which represents VSI %d TC %d\n",
@@ -350,6 +352,10 @@ enum irdma_status_code irdma_ws_add(struct irdma_sc_vsi *vsi, u8 user_pri)
}
goto exit;
+reg_err:
+ irdma_ws_cqp_cmd(vsi, tc_node, IRDMA_OP_WS_DELETE_NODE);
+ list_del(&tc_node->siblings);
+ irdma_free_node(vsi, tc_node);
leaf_add_err:
if (list_empty(&vsi_node->child_list_head)) {
if (irdma_ws_cqp_cmd(vsi, vsi_node, IRDMA_OP_WS_DELETE_NODE))
@@ -369,11 +375,6 @@ enum irdma_status_code irdma_ws_add(struct irdma_sc_vsi *vsi, u8 user_pri)
exit:
mutex_unlock(&vsi->dev->ws_mutex);
return ret;
-
-reg_err:
- mutex_unlock(&vsi->dev->ws_mutex);
- irdma_ws_remove(vsi, user_pri);
- return ret;
}
/**
--
1.8.3.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH rdma-rc 1/2] RDMA/irdma: Set VLAN in UD work completion correctly
2021-10-19 15:16 [PATCH rdma-rc 1/2] RDMA/irdma: Set VLAN in UD work completion correctly Shiraz Saleem
2021-10-19 15:16 ` [PATCH rdma-rc 2/2] RDMA/irdma: Do not hold qos mutex twice on QP resume Shiraz Saleem
@ 2021-10-19 23:28 ` Jason Gunthorpe
1 sibling, 0 replies; 3+ messages in thread
From: Jason Gunthorpe @ 2021-10-19 23:28 UTC (permalink / raw)
To: Shiraz Saleem; +Cc: dledford, linux-rdma, Mustafa Ismail
On Tue, Oct 19, 2021 at 10:16:53AM -0500, Shiraz Saleem wrote:
> From: Mustafa Ismail <mustafa.ismail@intel.com>
>
> 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")
> Signed-off-by: Mustafa Ismail <mustafa.ismail@intel.com>
> Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
> ---
> drivers/infiniband/hw/irdma/verbs.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
These two patches applied to for-rc, thanks
Jason
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-10-19 23:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-19 15:16 [PATCH rdma-rc 1/2] RDMA/irdma: Set VLAN in UD work completion correctly Shiraz Saleem
2021-10-19 15:16 ` [PATCH rdma-rc 2/2] RDMA/irdma: Do not hold qos mutex twice on QP resume Shiraz Saleem
2021-10-19 23:28 ` [PATCH rdma-rc 1/2] RDMA/irdma: Set VLAN in UD work completion correctly Jason Gunthorpe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).