[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1362503593.2791.36.camel@bwh-desktop.uk.solarflarecom.com>
Date: Tue, 5 Mar 2013 17:13:13 +0000
From: Ben Hutchings <bhutchings@...arflare.com>
To: Eliezer Tamir <eliezer.tamir@...ux.jf.intel.com>
CC: <linux-kernel@...r.kernel.org>, <netdev@...r.kernel.org>,
Dave Miller <davem@...emloft.net>,
Jesse Brandeburg <jesse.brandeburg@...el.com>,
<e1000-devel@...ts.sourceforge.net>,
Willem de Bruijn <willemb@...gle.com>,
Andi Kleen <andi@...stfloor.org>, HPA <hpa@...or.com>,
Eliezer Tamir <eliezer@...ir.org.il>
Subject: Re: [RFC PATCH 2/5] tcp: add TCP support for low latency receive
poll.
On Wed, 2013-02-27 at 09:56 -0800, Eliezer Tamir wrote:
> an example of how one could add support for ndo_ll_poll to TCP.
[...]
> --- 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;
>
> @@ -1475,6 +1476,17 @@ int tcp_read_sock(struct sock *sk, read_descriptor_t *desc,
>
> if (sk->sk_state == TCP_LISTEN)
> return -ENOTCONN;
> +
> +#ifdef CONFIG_INET_LL_TCP_POLL
> +/* TODO: what do we do if the state changes after sk_poll_ll()? */
Maybe this bit should be a separate function that the callers can use
(or not) before calling tcp_read_sock(). Then they must take care of
re-locking and revalidating if it decides to poll.
Ben.
> + if (sk_valid_ll(sk) && skb_queue_empty(&sk->sk_receive_queue)
> + && (sk->sk_state == TCP_ESTABLISHED)) {
> +
> + release_sock(sk);
> + sk_poll_ll(sk);
> + lock_sock(sk);
> + }
> +#endif
> while ((skb = tcp_recv_skb(sk, seq, &offset)) != NULL) {
> if (offset < skb->len) {
> int used;
[...]
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists