All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] rds: Cancel pending connections on connection request
@ 2019-10-31 13:35 Dag Moxnes
  2019-10-31 15:09 ` Dag Moxnes
  0 siblings, 1 reply; 2+ messages in thread
From: Dag Moxnes @ 2019-10-31 13:35 UTC (permalink / raw)
  To: santosh.shilimkar, netdev, linux-rdma, rds-devel
  Cc: davem, dag.moxnes, haakon.bugge

RDS connections can enter the RDS_CONN_CONNECTING state in two ways:
1. It can be started using the connection workqueue (this can happen
both on queue_reconnect and upon send if the workqueue is not up)
2. It can enter the RDS_CONN_CONNECTING state due to an incoming
connection request

In case RDS connections enter RDS_CONN_CONNECTION state due to an incoming
connection request, the connection workqueue might already be scheduled. In
this case the connection workqueue needs to be cancelled.

Signed-off-by: Dag Moxnes <dag.moxnes@oracle.com>
---
 net/rds/ib_cm.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/net/rds/ib_cm.c b/net/rds/ib_cm.c
index 6b345c858d..1fdd76f70d 100644
--- a/net/rds/ib_cm.c
+++ b/net/rds/ib_cm.c
@@ -880,6 +880,12 @@ int rds_ib_cm_handle_connect(struct rdma_cm_id *cm_id,
 			rds_ib_stats_inc(s_ib_connect_raced);
 		}
 		goto out;
+	} else {
+		/* Cancel any pending reconnect */
+		struct rds_conn_path *cp = &conn->c_path[0];
+
+		cancel_delayed_work_sync(&cp->cp_conn_w);
+		rds_clear_reconnect_pending_work_bit(cp);
 	}
 
 	ic = conn->c_transport_data;
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] rds: Cancel pending connections on connection request
  2019-10-31 13:35 [PATCH net-next] rds: Cancel pending connections on connection request Dag Moxnes
@ 2019-10-31 15:09 ` Dag Moxnes
  0 siblings, 0 replies; 2+ messages in thread
From: Dag Moxnes @ 2019-10-31 15:09 UTC (permalink / raw)
  To: santosh.shilimkar, netdev, linux-rdma, rds-devel; +Cc: davem, haakon.bugge

This one should be for net instead of net-next.
Also it is not correct.
I will send a new patch for net.

-Dag

On 10/31/19 2:35 PM, Dag Moxnes wrote:
> RDS connections can enter the RDS_CONN_CONNECTING state in two ways:
> 1. It can be started using the connection workqueue (this can happen
> both on queue_reconnect and upon send if the workqueue is not up)
> 2. It can enter the RDS_CONN_CONNECTING state due to an incoming
> connection request
>
> In case RDS connections enter RDS_CONN_CONNECTION state due to an incoming
> connection request, the connection workqueue might already be scheduled. In
> this case the connection workqueue needs to be cancelled.
>
> Signed-off-by: Dag Moxnes <dag.moxnes@oracle.com>
> ---
>   net/rds/ib_cm.c | 6 ++++++
>   1 file changed, 6 insertions(+)
>
> diff --git a/net/rds/ib_cm.c b/net/rds/ib_cm.c
> index 6b345c858d..1fdd76f70d 100644
> --- a/net/rds/ib_cm.c
> +++ b/net/rds/ib_cm.c
> @@ -880,6 +880,12 @@ int rds_ib_cm_handle_connect(struct rdma_cm_id *cm_id,
>   			rds_ib_stats_inc(s_ib_connect_raced);
>   		}
>   		goto out;
> +	} else {
> +		/* Cancel any pending reconnect */
> +		struct rds_conn_path *cp = &conn->c_path[0];
> +
> +		cancel_delayed_work_sync(&cp->cp_conn_w);
> +		rds_clear_reconnect_pending_work_bit(cp);
>   	}
>   
>   	ic = conn->c_transport_data;


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-10-31 15:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-31 13:35 [PATCH net-next] rds: Cancel pending connections on connection request Dag Moxnes
2019-10-31 15:09 ` Dag Moxnes

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.