From: Chris Leech <christopher.leech@intel.com>
To: linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: [PATCH 3/7] [I/OAT] Don't offload copies for loopback traffic
Date: Tue, 15 Aug 2006 17:53:41 -0700 [thread overview]
Message-ID: <20060816005341.8634.10380.stgit@gitlost.site> (raw)
In-Reply-To: <20060816005337.8634.70033.stgit@gitlost.site>
Local traffic (loopback) is generally in cache anyway, and the overhead
cost of offloading the copy is worse than just doing it with the CPU.
Signed-off-by: Chris Leech <christopher.leech@intel.com>
---
net/ipv4/tcp.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 36f6b64..7971e73 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -1107,6 +1107,7 @@ int tcp_recvmsg(struct kiocb *iocb, stru
int copied_early = 0;
int available = 0;
struct sk_buff *skb;
+ struct dst_entry *dst;
lock_sock(sk);
@@ -1136,7 +1137,8 @@ int tcp_recvmsg(struct kiocb *iocb, stru
skb = skb_peek_tail(&sk->sk_receive_queue);
if (skb)
available = TCP_SKB_CB(skb)->seq + skb->len - (*seq);
- if ((available < target) &&
+ dst = __sk_dst_get(sk);
+ if ((available < target) && (!dst || (dst->dev != &loopback_dev)) &&
(len > sysctl_tcp_dma_copybreak) && !(flags & MSG_PEEK) &&
!sysctl_tcp_low_latency && __get_cpu_var(softnet_data).net_dma) {
preempt_enable_no_resched();
next prev parent reply other threads:[~2006-08-16 0:45 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-16 0:53 [PATCH 1/7] [I/OAT] Push pending transactions to hardware more frequently Chris Leech
2006-08-16 0:53 ` [PATCH 2/7] [I/OAT] Only offload copies for TCP when there will be a context switch Chris Leech
2006-08-16 0:53 ` Chris Leech [this message]
2006-08-18 18:17 ` [PATCH 3/7] [I/OAT] Don't offload copies for loopback traffic Andi Kleen
2006-08-18 21:23 ` David Miller
2006-08-16 0:53 ` [PATCH 4/7] [I/OAT] Remove the wrappers around read(bwl)/write(bwl) in ioatdma Chris Leech
2006-08-18 0:05 ` I/OAT configuration ? Ravinandan Arakali
2006-08-16 0:53 ` [PATCH 5/7] [I/OAT] Remove the use of writeq from the ioatdma driver Chris Leech
2006-08-16 0:53 ` [PATCH 6/7] [I/OAT] Add documentation for the tcp_dma_copybreak sysctl Chris Leech
2006-08-16 0:53 ` [PATCH 7/7] [I/OAT] Add entries to MAINTAINERS for the DMA memcpy subsystem and ioatdma Chris Leech
2006-08-16 4:52 ` Randy.Dunlap
2006-08-16 16:57 ` [PATCH 7/7 v2] " Chris Leech
2006-08-18 7:11 ` [PATCH 1/7] [I/OAT] Push pending transactions to hardware more frequently Pavel Machek
2006-08-18 15:11 ` Chris Leech
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=20060816005341.8634.10380.stgit@gitlost.site \
--to=christopher.leech@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.