public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Krishna Kumar <krkumar2@in•ibm.com>
To: davem@davemloft•net
Cc: netdev@vger•kernel.org, Krishna Kumar <krkumar2@in•ibm.com>
Subject: [PATCH 2/3] tcp: Remove unrequired operations in tcp_push()
Date: Wed, 09 Dec 2009 13:56:19 +0530	[thread overview]
Message-ID: <20091209082619.19055.10563.sendpatchset@localhost.localdomain> (raw)
In-Reply-To: <20091209082613.19055.58864.sendpatchset@localhost.localdomain>

From: Krishna Kumar <krkumar2@in•ibm.com>

Remove unrequired operations in tcp_push()

Signed-off-by: Krishna Kumar <krkumar2@in•ibm.com>
---
 net/ipv4/tcp.c |   15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff -ruNp org/net/ipv4/tcp.c new/net/ipv4/tcp.c
--- org/net/ipv4/tcp.c	2009-12-04 18:16:10.000000000 +0530
+++ new/net/ipv4/tcp.c	2009-12-09 10:01:35.000000000 +0530
@@ -536,8 +536,7 @@ static inline void skb_entail(struct soc
 		tp->nonagle &= ~TCP_NAGLE_PUSH;
 }
 
-static inline void tcp_mark_urg(struct tcp_sock *tp, int flags,
-				struct sk_buff *skb)
+static inline void tcp_mark_urg(struct tcp_sock *tp, int flags)
 {
 	if (flags & MSG_OOB)
 		tp->snd_up = tp->write_seq;
@@ -546,13 +545,15 @@ static inline void tcp_mark_urg(struct t
 static inline void tcp_push(struct sock *sk, int flags, int mss_now,
 			    int nonagle)
 {
-	struct tcp_sock *tp = tcp_sk(sk);
-
 	if (tcp_send_head(sk)) {
-		struct sk_buff *skb = tcp_write_queue_tail(sk);
-		if (!(flags & MSG_MORE) || forced_push(tp))
+		struct tcp_sock *tp = tcp_sk(sk);
+
+		if (!(flags & MSG_MORE) || forced_push(tp)) {
+			struct sk_buff *skb = tcp_write_queue_tail(sk);
+
 			tcp_mark_push(tp, skb);
-		tcp_mark_urg(tp, flags, skb);
+		}
+		tcp_mark_urg(tp, flags);
 		__tcp_push_pending_frames(sk, mss_now,
 					  (flags & MSG_MORE) ? TCP_NAGLE_CORK : nonagle);
 	}

  reply	other threads:[~2009-12-09  8:26 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-09  8:26 [PATCH 1/3] tcp: Remove check in __tcp_push_pending_frames Krishna Kumar
2009-12-09  8:26 ` Krishna Kumar [this message]
2009-12-10  8:10   ` [PATCH 2/3] tcp: Remove unrequired operations in tcp_push() Ilpo Järvinen
2009-12-10  9:06     ` Krishna Kumar2
2009-12-10 10:26       ` Ilpo Järvinen
2009-12-10 11:59         ` Krishna Kumar2
2009-12-10 12:03           ` Ilpo Järvinen
2009-12-09  8:26 ` [PATCH 3/3] tcp: Slightly optimize tcp_sendmsg Krishna Kumar
2009-12-10  8:17   ` Ilpo Järvinen
2009-12-10 10:29     ` Krishna Kumar2
2009-12-10 10:42       ` Ilpo Järvinen
2009-12-10  8:05 ` [PATCH 1/3] tcp: Remove check in __tcp_push_pending_frames Ilpo Järvinen
2009-12-23 22:15 ` 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=20091209082619.19055.10563.sendpatchset@localhost.localdomain \
    --to=krkumar2@in$(echo .)ibm.com \
    --cc=davem@davemloft$(echo .)net \
    --cc=netdev@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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