From: pravin <pravin.shelar@gmail.com>
To: "David Miller" <davem@davemloft.net>
Cc: shannon.nelson@intel.com, netdev@vger.kernel.org,
viro@ftp.linux.org.uk, christopher.leech@intel.com,
andy.grover@gmail.com
Subject: Re: [PATCH] NET_DMA: remove unused dma_memcpy_to_kernel_iovec
Date: Mon, 30 Jul 2007 20:09:53 +0530 [thread overview]
Message-ID: <bab433300707300739s283bf15fp9d00235cf39fa08b@mail.gmail.com> (raw)
In-Reply-To: <20070726.000607.18303016.davem@davemloft.net>
On 7/26/07, David Miller <davem@davemloft.net> wrote:
> From: Shannon Nelson <shannon.nelson@intel.com>
> Date: Tue, 24 Jul 2007 17:36:06 -0700
>
> > (repost - original eaten by vger?)
> >
> > Al Viro pointed out that dma_memcpy_to_kernel_iovec() really was
> > unreachable and thus unused. The code originally was there to support
> > in-kernel dma needs, but since it remains unused, we'll pull it out.
> >
> > Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
>
> Applied, thanks Shannon.
NET_DMA on kernel buffer is pretty useful in ndb, iSCSI target and
initiators which uses kernel buffer to receive data. Are there any
other issues with dma-memcpy on kernel buffers, if not then following
patch makes dma_memcpy_to_kernel_iovec() reachable from tcp_recvmsg.
I tested this patch and it work fine with unh iSCSI target.
comments?
--pravin.
Index: linux-2.6.23-rc1/net/ipv4/tcp.c
===================================================================
--- linux-2.6.23-rc1.orig/net/ipv4/tcp.c 2007-07-23 02:11:00.000000000 +0530
+++ linux-2.6.23-rc1/net/ipv4/tcp.c 2007-07-30 17:43:51.000000000 +0530
@@ -1115,7 +1115,7 @@
int target; /* Read at least this many bytes */
long timeo;
struct task_struct *user_recv = NULL;
- int copied_early = 0;
+ int copied_early = 0, kernel_dma = 0;
struct sk_buff *skb;
lock_sock(sk);
@@ -1154,6 +1154,9 @@
!sysctl_tcp_low_latency &&
__get_cpu_var(softnet_data).net_dma) {
preempt_enable_no_resched();
+ if (segment_eq(get_fs(), KERNEL_DS))
+ kernel_dma = 1;
+ else
tp->ucopy.pinned_list =
dma_pin_iovec_pages(msg->msg_iov, len);
} else {
@@ -1362,7 +1365,7 @@
if (!(flags & MSG_TRUNC)) {
#ifdef CONFIG_NET_DMA
- if (!tp->ucopy.dma_chan && tp->ucopy.pinned_list)
+ if (!tp->ucopy.dma_chan && (kernel_dma || tp->ucopy.pinned_list))
tp->ucopy.dma_chan = get_softnet_dma();
if (tp->ucopy.dma_chan) {
> -
> 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
>
next prev parent reply other threads:[~2007-07-30 14:39 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-25 0:36 [PATCH] NET_DMA: remove unused dma_memcpy_to_kernel_iovec Shannon Nelson
2007-07-25 0:37 ` David Miller
2007-07-26 7:06 ` David Miller
2007-07-30 14:39 ` pravin [this message]
2007-07-30 18:14 ` Christoph Hellwig
2007-07-30 20:47 ` Waskiewicz Jr, Peter P
-- strict thread matches above, loose matches on Subject: below --
2007-07-24 20:45 Shannon Nelson
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=bab433300707300739s283bf15fp9d00235cf39fa08b@mail.gmail.com \
--to=pravin.shelar@gmail.com \
--cc=andy.grover@gmail.com \
--cc=christopher.leech@intel.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=shannon.nelson@intel.com \
--cc=viro@ftp.linux.org.uk \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).