diff mbox

[2/3,Ver2] tcp: Remove unrequired operations in tcp_push()

Message ID 20091210171652.20777.79982.sendpatchset@localhost.localdomain
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Krishna Kumar Dec. 10, 2009, 5:16 p.m. UTC
From: Krishna Kumar <krkumar2@in.ibm.com>

Remove unrequired operations in tcp_push()

Changelog:
	Removed a temporary skb variable from tcp_push()

Signed-off-by: Krishna Kumar <krkumar2@in.ibm.com>
Acked-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
---
 net/ipv4/tcp.c |   13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

David Miller Dec. 23, 2009, 10:15 p.m. UTC | #1
From: Krishna Kumar <krkumar2@in.ibm.com>
Date: Thu, 10 Dec 2009 22:46:52 +0530

> From: Krishna Kumar <krkumar2@in.ibm.com>
> 
> Remove unrequired operations in tcp_push()
> 
> Changelog:
> 	Removed a temporary skb variable from tcp_push()
> 
> Signed-off-by: Krishna Kumar <krkumar2@in.ibm.com>
> Acked-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff -ruNp org/net/ipv4/tcp.c new/net/ipv4/tcp.c
--- org/net/ipv4/tcp.c	2009-12-10 21:12:15.000000000 +0530
+++ new/net/ipv4/tcp.c	2009-12-10 21:22:41.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,13 @@  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);
+		struct tcp_sock *tp = tcp_sk(sk);
+
 		if (!(flags & MSG_MORE) || forced_push(tp))
-			tcp_mark_push(tp, skb);
-		tcp_mark_urg(tp, flags, skb);
+			tcp_mark_push(tp, tcp_write_queue_tail(sk));
+
+		tcp_mark_urg(tp, flags);
 		__tcp_push_pending_frames(sk, mss_now,
 					  (flags & MSG_MORE) ? TCP_NAGLE_CORK : nonagle);
 	}