netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Santosh Shilimkar <santosh.shilimkar@oracle.com>
To: Sowmini Varadhan <sowmini.varadhan@oracle.com>, netdev@vger.kernel.org
Cc: davem@davemloft.net, rds-devel@oss.oracle.com,
	ajaykumar.hotchandani@oracle.com
Subject: Re: [PATCH net 1/2] RDS: TCP: rds_tcp_accept_worker() must exit gracefully when terminating rds-tcp
Date: Wed, 18 May 2016 11:33:19 -0700	[thread overview]
Message-ID: <1b519ce2-89f2-3b98-e00b-73d453e1e53e@oracle.com> (raw)
In-Reply-To: <73ccad462f8f54dfa9c71576c3f5d48ea2b1dc12.1463579486.git.sowmini.varadhan@oracle.com>

On 5/18/2016 10:06 AM, Sowmini Varadhan wrote:
> There are two instances where we want to terminate RDS-TCP: when
> exiting the netns or during module unload. In either case, the
> termination sequence is to stop the listen socket, mark the
> rtn->rds_tcp_listen_sock as null, and flush any accept workqs.
> Thus any workqs that get flushed at this point will encounter a
> null rds_tcp_listen_sock, and must exit gracefully to allow
> the RDS-TCP termination to complete successfully.
>
> Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
> ---
>  net/rds/tcp_listen.c |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/net/rds/tcp_listen.c b/net/rds/tcp_listen.c
> index be263cd..e10b422 100644
> --- a/net/rds/tcp_listen.c
> +++ b/net/rds/tcp_listen.c
> @@ -80,6 +80,9 @@ int rds_tcp_accept_one(struct socket *sock)
>  	int conn_state;
>  	struct sock *nsk;
>
> +	if (!sock) /* module unload or netns delete in progress */
> +		return -ENETUNREACH;
> +
New error code type in RDS but seems appropriate :-)
Patch looks good to me.
Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>

  reply	other threads:[~2016-05-18 18:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-18 17:06 [PATCH net 0/2] RDS: TCP: connection spamming fixes Sowmini Varadhan
2016-05-18 17:06 ` [PATCH net 1/2] RDS: TCP: rds_tcp_accept_worker() must exit gracefully when terminating rds-tcp Sowmini Varadhan
2016-05-18 18:33   ` Santosh Shilimkar [this message]
2016-05-18 17:06 ` [PATCH net 2/2] RDS: TCP: Avoid rds connection churn from rogue SYNs Sowmini Varadhan
2016-05-18 18:33   ` Santosh Shilimkar
2016-05-20 23:20 ` [PATCH net 0/2] RDS: TCP: connection spamming fixes David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1b519ce2-89f2-3b98-e00b-73d453e1e53e@oracle.com \
    --to=santosh.shilimkar@oracle.com \
    --cc=ajaykumar.hotchandani@oracle.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=rds-devel@oss.oracle.com \
    --cc=sowmini.varadhan@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).