Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6327cb09 authored by Shiraz Saleem's avatar Shiraz Saleem Committed by Doug Ledford
Browse files

i40iw: Release cm_id ref on PCI function reset



On PCI function reset, cm_id reference is not released
which causes an application hang, as it waits on the
cm_id to be released on rdma_destroy.

To fix this, call i40iw_cm_disconn during a PCI function
reset to clean-up resources and release cm_id reference.

Signed-off-by: default avatarShiraz Saleem <shiraz.saleem@intel.com>
Signed-off-by: default avatarHenry Orosco <henry.orosco@intel.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent 6c1d94de
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
@@ -3487,7 +3487,8 @@ static void i40iw_cm_disconn_true(struct i40iw_qp *iwqp)
	if (((original_hw_tcp_state == I40IW_TCP_STATE_CLOSED) ||
	if (((original_hw_tcp_state == I40IW_TCP_STATE_CLOSED) ||
	     (original_hw_tcp_state == I40IW_TCP_STATE_TIME_WAIT) ||
	     (original_hw_tcp_state == I40IW_TCP_STATE_TIME_WAIT) ||
	     (last_ae == I40IW_AE_RDMAP_ROE_BAD_LLP_CLOSE) ||
	     (last_ae == I40IW_AE_RDMAP_ROE_BAD_LLP_CLOSE) ||
	     (last_ae == I40IW_AE_LLP_CONNECTION_RESET))) {
	     (last_ae == I40IW_AE_LLP_CONNECTION_RESET) ||
	      iwdev->reset)) {
		issue_close = 1;
		issue_close = 1;
		iwqp->cm_id = NULL;
		iwqp->cm_id = NULL;
		if (!iwqp->flush_issued) {
		if (!iwqp->flush_issued) {
@@ -4265,6 +4266,8 @@ void i40iw_cm_disconnect_all(struct i40iw_device *iwdev)
		cm_node = container_of(list_node, struct i40iw_cm_node, connected_entry);
		cm_node = container_of(list_node, struct i40iw_cm_node, connected_entry);
		attr.qp_state = IB_QPS_ERR;
		attr.qp_state = IB_QPS_ERR;
		i40iw_modify_qp(&cm_node->iwqp->ibqp, &attr, IB_QP_STATE, NULL);
		i40iw_modify_qp(&cm_node->iwqp->ibqp, &attr, IB_QP_STATE, NULL);
		if (iwdev->reset)
			i40iw_cm_disconn(cm_node->iwqp);
		i40iw_rem_ref_cm_node(cm_node);
		i40iw_rem_ref_cm_node(cm_node);
	}
	}
}
}