From patchwork Thu Dec 10 17:16:52 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Krishna Kumar X-Patchwork-Id: 40835 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id 597FAB6EDD for ; Fri, 11 Dec 2009 04:17:10 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761224AbZLJRQu (ORCPT ); Thu, 10 Dec 2009 12:16:50 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1761223AbZLJRQt (ORCPT ); Thu, 10 Dec 2009 12:16:49 -0500 Received: from e23smtp05.au.ibm.com ([202.81.31.147]:38126 "EHLO e23smtp05.au.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761065AbZLJRQt (ORCPT ); Thu, 10 Dec 2009 12:16:49 -0500 Received: from d23relay03.au.ibm.com (d23relay03.au.ibm.com [202.81.31.245]) by e23smtp05.au.ibm.com (8.14.3/8.13.1) with ESMTP id nBAHDoPV024170 for ; Fri, 11 Dec 2009 04:13:50 +1100 Received: from d23av02.au.ibm.com (d23av02.au.ibm.com [9.190.235.138]) by d23relay03.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id nBAHGsNd1753284 for ; Fri, 11 Dec 2009 04:16:54 +1100 Received: from d23av02.au.ibm.com (loopback [127.0.0.1]) by d23av02.au.ibm.com (8.14.3/8.13.1/NCO v10.0 AVout) with ESMTP id nBAHGrBn005225 for ; Fri, 11 Dec 2009 04:16:54 +1100 Received: from localhost.localdomain ([9.77.198.224]) by d23av02.au.ibm.com (8.14.3/8.13.1/NCO v10.0 AVin) with ESMTP id nBAHGqgD005221; Fri, 11 Dec 2009 04:16:53 +1100 From: Krishna Kumar To: davem@davemloft.net Cc: netdev@vger.kernel.org, Krishna Kumar Date: Thu, 10 Dec 2009 22:46:52 +0530 Message-Id: <20091210171652.20777.79982.sendpatchset@localhost.localdomain> Subject: [PATCH 2/3 Ver2] tcp: Remove unrequired operations in tcp_push() Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Krishna Kumar Remove unrequired operations in tcp_push() Changelog: Removed a temporary skb variable from tcp_push() Signed-off-by: Krishna Kumar Acked-by: Ilpo Järvinen --- 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 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); }