public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Eliezer Tamir <eliezer.tamir@linux•intel.com>
To: David Miller <davem@davemloft•net>
Cc: Willem de Bruijn <willemb@google•com>,
	Or Gerlitz <or.gerlitz@gmail•com>,
	e1000-devel@lists•sourceforge.net, netdev@vger•kernel.org,
	HPA <hpa@zytor•com>,
	linux-kernel@vger•kernel.org, Alex Rosenbaum <alexr@mellanox•com>,
	Jesse Brandeburg <jesse.brandeburg@intel•com>,
	Eliezer Tamir <eliezer@tamir•org.il>,
	Andi Kleen <andi@firstfloor•org>,
	Eric Dumazet <erdnetdev@gmail•com>,
	Eilon Greenstien <eilong@broadcom•com>
Subject: [PATCH v6 net-next 3/5] tcp: add TCP support for low latency receive poll.
Date: Wed, 29 May 2013 09:39:45 +0300	[thread overview]
Message-ID: <20130529063945.27486.61442.stgit@ladj378.jer.intel.com> (raw)
In-Reply-To: <20130529063916.27486.3841.stgit@ladj378.jer.intel.com>

Adds busy-poll support for TCP.
Copy the napi_id from an incomming skb to the sk in tcp_v[46]_rcv().
when there is no data in the socket we busy-poll in tcp_recvmsg().
This is a good example of how to add busy-poll support to new protocols.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel•com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel•com>
Tested-by: Willem de Bruijn <willemb@google•com>
Signed-off-by: Eliezer Tamir <eliezer.tamir@linux•intel.com>
---

 net/ipv4/tcp.c      |    5 +++++
 net/ipv4/tcp_ipv4.c |    2 ++
 net/ipv6/tcp_ipv6.c |    2 ++
 3 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index ba4186e..becd105 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -279,6 +279,7 @@
 
 #include <asm/uaccess.h>
 #include <asm/ioctls.h>
+#include <net/ll_poll.h>
 
 int sysctl_tcp_fin_timeout __read_mostly = TCP_FIN_TIMEOUT;
 
@@ -1551,6 +1552,10 @@ int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
 	struct sk_buff *skb;
 	u32 urg_hole = 0;
 
+	if (sk_valid_ll(sk) && skb_queue_empty(&sk->sk_receive_queue)
+	    && (sk->sk_state == TCP_ESTABLISHED))
+		sk_poll_ll(sk, nonblock);
+
 	lock_sock(sk);
 
 	err = -ENOTCONN;
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index d20ede0..35fd8bc 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -75,6 +75,7 @@
 #include <net/netdma.h>
 #include <net/secure_seq.h>
 #include <net/tcp_memcontrol.h>
+#include <net/ll_poll.h>
 
 #include <linux/inet.h>
 #include <linux/ipv6.h>
@@ -2011,6 +2012,7 @@ process:
 	if (sk_filter(sk, skb))
 		goto discard_and_relse;
 
+	sk_mark_ll(sk, skb);
 	skb->dev = NULL;
 
 	bh_lock_sock_nested(sk);
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 0a17ed9..5cffa5c 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -63,6 +63,7 @@
 #include <net/inet_common.h>
 #include <net/secure_seq.h>
 #include <net/tcp_memcontrol.h>
+#include <net/ll_poll.h>
 
 #include <asm/uaccess.h>
 
@@ -1498,6 +1499,7 @@ process:
 	if (sk_filter(sk, skb))
 		goto discard_and_relse;
 
+	sk_mark_ll(sk, skb);
 	skb->dev = NULL;
 
 	bh_lock_sock_nested(sk);


------------------------------------------------------------------------------
Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET
Get 100% visibility into your production application - at no cost.
Code-level diagnostics for performance bottlenecks with <2% overhead
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap1
_______________________________________________
E1000-devel mailing list
E1000-devel@lists•sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel&#174; Ethernet, visit http://communities.intel.com/community/wired

  parent reply	other threads:[~2013-05-29  6:39 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-29  6:39 [PATCH v6 net-next 0/5] net: low latency Ethernet device polling Eliezer Tamir
2013-05-29  6:39 ` [PATCH v6 net-next 1/5] net: add napi_id and hash Eliezer Tamir
2013-05-29 12:56   ` Eric Dumazet
2013-05-29 13:09     ` David Laight
2013-05-29 13:43       ` Eric Dumazet
2013-05-29 15:04     ` Eliezer Tamir
2013-05-29 20:09   ` Ben Hutchings
2013-05-30  6:51     ` Eliezer Tamir
2013-05-29  6:39 ` [PATCH v6 net-next 2/5] net: implement support for low latency socket polling Eliezer Tamir
2013-05-29 13:37   ` Eric Dumazet
2013-05-29 13:42     ` David Laight
2013-05-29 13:48       ` Eric Dumazet
2013-05-29 14:01     ` Eliezer Tamir
2013-05-29 14:20       ` yaniv saar
2013-05-29 15:01         ` Eliezer Tamir
2013-05-29 14:14   ` Or Gerlitz
2013-05-29 14:40     ` yaniv saar
2013-05-29 14:59     ` Eliezer Tamir
2013-05-29 18:52       ` Or Gerlitz
2013-05-29 19:08         ` Eric Dumazet
2013-05-30  5:58           ` Eliezer Tamir
2013-05-30  6:04         ` Eliezer Tamir
2013-05-29 20:20     ` Ben Hutchings
2013-05-29  6:39 ` Eliezer Tamir [this message]
2013-05-29 13:38   ` [PATCH v6 net-next 3/5] tcp: add TCP support for low latency receive poll Eric Dumazet
2013-05-29  6:39 ` [PATCH v6 net-next 4/5] ixgbe: Add support for ndo_ll_poll Eliezer Tamir
2013-05-29  6:40 ` [PATCH v6 net-next 5/5] ixgbe: add extra stats " Eliezer Tamir

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=20130529063945.27486.61442.stgit@ladj378.jer.intel.com \
    --to=eliezer.tamir@linux$(echo .)intel.com \
    --cc=alexr@mellanox$(echo .)com \
    --cc=andi@firstfloor$(echo .)org \
    --cc=davem@davemloft$(echo .)net \
    --cc=e1000-devel@lists$(echo .)sourceforge.net \
    --cc=eilong@broadcom$(echo .)com \
    --cc=eliezer@tamir$(echo .)org.il \
    --cc=erdnetdev@gmail$(echo .)com \
    --cc=hpa@zytor$(echo .)com \
    --cc=jesse.brandeburg@intel$(echo .)com \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=or.gerlitz@gmail$(echo .)com \
    --cc=willemb@google$(echo .)com \
    /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