netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ursula Braun <ursula.braun@de.ibm.com>
To: davem@davemloft.net, netdev@vger.kernel.org, linux-s390@vger.kernel.org
Cc: schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com,
	Hendrik Brueckner <brueckner@linux.vnet.ibm.com>,
	Ursula Braun <ursula.braun@de.ibm.com>
Subject: [patch 2/8] [PATCH] af_iucv: sync sk shutdown flag if iucv path is quiesced
Date: Wed, 22 Apr 2009 11:26:21 +0200	[thread overview]
Message-ID: <20090422093429.939908000@linux.vnet.ibm.com> (raw)
In-Reply-To: 20090422092619.451973000@linux.vnet.ibm.com

[-- Attachment #1: 605-af_iucv-sync-shutdown.diff --]
[-- Type: text/plain, Size: 2081 bytes --]

From: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>

If the af_iucv communication partner quiesces the path to shutdown its
receive direction, provide a quiesce callback implementation to shutdown
the (local) send direction. This ensures that both sides are synchronized.

Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com>
---

 net/iucv/af_iucv.c |   19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

Index: net-next-2.6-uschi/net/iucv/af_iucv.c
===================================================================
--- net-next-2.6-uschi.orig/net/iucv/af_iucv.c
+++ net-next-2.6-uschi/net/iucv/af_iucv.c
@@ -54,6 +54,7 @@ static void iucv_callback_connack(struct
 static int iucv_callback_connreq(struct iucv_path *, u8 ipvmid[8],
 				 u8 ipuser[16]);
 static void iucv_callback_connrej(struct iucv_path *, u8 ipuser[16]);
+static void iucv_callback_shutdown(struct iucv_path *, u8 ipuser[16]);
 
 static struct iucv_sock_list iucv_sk_list = {
 	.lock = __RW_LOCK_UNLOCKED(iucv_sk_list.lock),
@@ -65,7 +66,8 @@ static struct iucv_handler af_iucv_handl
 	.path_complete	  = iucv_callback_connack,
 	.path_severed	  = iucv_callback_connrej,
 	.message_pending  = iucv_callback_rx,
-	.message_complete = iucv_callback_txdone
+	.message_complete = iucv_callback_txdone,
+	.path_quiesced	  = iucv_callback_shutdown,
 };
 
 static inline void high_nmcpy(unsigned char *dst, char *src)
@@ -1196,6 +1198,21 @@ static void iucv_callback_connrej(struct
 	sk->sk_state_change(sk);
 }
 
+/* called if the other communication side shuts down its RECV direction;
+ * in turn, the callback sets SEND_SHUTDOWN to disable sending of data.
+ */
+static void iucv_callback_shutdown(struct iucv_path *path, u8 ipuser[16])
+{
+	struct sock *sk = path->private;
+
+	bh_lock_sock(sk);
+	if (sk->sk_state != IUCV_CLOSED) {
+		sk->sk_shutdown |= SEND_SHUTDOWN;
+		sk->sk_state_change(sk);
+	}
+	bh_unlock_sock(sk);
+}
+
 static struct proto_ops iucv_sock_ops = {
 	.family		= PF_IUCV,
 	.owner		= THIS_MODULE,


  parent reply	other threads:[~2009-04-22  9:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-22  9:26 [patch 0/8] iucv / af_iucv patches for net-next-2.6.30-rc1 Ursula Braun
2009-04-22  9:26 ` [patch 1/8] [PATCH] iucv: provide second per-cpu IUCV command parameter block Ursula Braun
2009-04-22  9:26 ` Ursula Braun [this message]
2009-04-22  9:26 ` [patch 3/8] [PATCH] af_iucv: add sockopt() to enable/disable use of IPRM_DATA msgs Ursula Braun
2009-04-22  9:26 ` [patch 4/8] [PATCH] af_iucv: Support data in IUCV msg parameter lists (IPRMDATA) Ursula Braun
2009-04-22  9:26 ` [patch 5/8] [PATCH] af_iucv: Modify iucv msg target class using control msghdr Ursula Braun
2009-04-22  9:26 ` [patch 6/8] [PATCH] af_iucv: Provide new socket type SOCK_SEQPACKET Ursula Braun
2009-04-22  9:26 ` [patch 7/8] [PATCH] af_iucv: cleanup and refactor recvmsg() EFAULT handling Ursula Braun
2009-04-22  9:26 ` [patch 8/8] [PATCH] af_iucv: New socket option for setting IUCV MSGLIMITs Ursula Braun
2009-04-22  9:48 ` [patch 0/8] iucv / af_iucv patches for net-next-2.6.30-rc1 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=20090422093429.939908000@linux.vnet.ibm.com \
    --to=ursula.braun@de.ibm.com \
    --cc=brueckner@linux.vnet.ibm.com \
    --cc=davem@davemloft.net \
    --cc=heiko.carstens@de.ibm.com \
    --cc=linux-s390@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=schwidefsky@de.ibm.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).