netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* NET_DMA: where do we ever call dma_skb_copy_datagram_iovec() with NULL pinned_list?
@ 2007-07-21  3:48 Al Viro
  2007-07-24 17:24 ` Andrew Grover
  2007-07-24 18:14 ` Nelson, Shannon
  0 siblings, 2 replies; 3+ messages in thread
From: Al Viro @ 2007-07-21  3:48 UTC (permalink / raw)
  To: netdev; +Cc: christopher.leech

	AFAICS, all callers of dma_skb_copy_datagram_iovec()
are either
	* recursive for fragments, pass pinned_list unchanged or
	* called from tcp, with pinned_list coming from
tp->ucopy.pinned_list and only when tp->ucopy.dma_chan is non-NULL.

Now, all non-NULL assignments to ->dma_chan have the same form:
	if (!tp->ucopy.dma_chan && tp->ucopy.pinned_list)
		tp->ucopy.dma_chan = get_softnet_dma();
IOW, if ->ucopy.pinned_list stays NULL, ->ucopy.dma_chan will do the same.

Moreover, any place that resets ->ucopy.pinned_list will also reset
->ucopy.dma_chan.

IOW, we can't ever get non-NULL tp->ucopy.dma_chan while tp->ucopy.pinned_list
is NULL.  So how can we ever get to the dma_memcpy_to_kernel_iovec()?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: NET_DMA: where do we ever call dma_skb_copy_datagram_iovec() with NULL pinned_list?
  2007-07-21  3:48 NET_DMA: where do we ever call dma_skb_copy_datagram_iovec() with NULL pinned_list? Al Viro
@ 2007-07-24 17:24 ` Andrew Grover
  2007-07-24 18:14 ` Nelson, Shannon
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Grover @ 2007-07-24 17:24 UTC (permalink / raw)
  To: Al Viro, shannon.nelson; +Cc: netdev, christopher.leech

On 7/20/07, Al Viro <viro@ftp.linux.org.uk> wrote:
>         AFAICS, all callers of dma_skb_copy_datagram_iovec()
> are either
>         * recursive for fragments, pass pinned_list unchanged or
>         * called from tcp, with pinned_list coming from
> tp->ucopy.pinned_list and only when tp->ucopy.dma_chan is non-NULL.
>
> Now, all non-NULL assignments to ->dma_chan have the same form:
>         if (!tp->ucopy.dma_chan && tp->ucopy.pinned_list)
>                 tp->ucopy.dma_chan = get_softnet_dma();
> IOW, if ->ucopy.pinned_list stays NULL, ->ucopy.dma_chan will do the same.
>
> Moreover, any place that resets ->ucopy.pinned_list will also reset
> ->ucopy.dma_chan.
>
> IOW, we can't ever get non-NULL tp->ucopy.dma_chan while tp->ucopy.pinned_list
> is NULL.  So how can we ever get to the dma_memcpy_to_kernel_iovec()?

Shannon what do you think? Is this a bug, or does it no longer support
non-userspace iovecs?

Thanks -- Andy

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: NET_DMA: where do we ever call dma_skb_copy_datagram_iovec() with NULL pinned_list?
  2007-07-21  3:48 NET_DMA: where do we ever call dma_skb_copy_datagram_iovec() with NULL pinned_list? Al Viro
  2007-07-24 17:24 ` Andrew Grover
@ 2007-07-24 18:14 ` Nelson, Shannon
  1 sibling, 0 replies; 3+ messages in thread
From: Nelson, Shannon @ 2007-07-24 18:14 UTC (permalink / raw)
  To: Al Viro, netdev; +Cc: Leech, Christopher, Andrew Grover

Al Viro:
>
>	AFAICS, all callers of dma_skb_copy_datagram_iovec()
>are either
>	* recursive for fragments, pass pinned_list unchanged or
>	* called from tcp, with pinned_list coming from
>tp->ucopy.pinned_list and only when tp->ucopy.dma_chan is non-NULL.
>
>Now, all non-NULL assignments to ->dma_chan have the same form:
>	if (!tp->ucopy.dma_chan && tp->ucopy.pinned_list)
>		tp->ucopy.dma_chan = get_softnet_dma();
>IOW, if ->ucopy.pinned_list stays NULL, ->ucopy.dma_chan will 
>do the same.
>
>Moreover, any place that resets ->ucopy.pinned_list will also reset
>->ucopy.dma_chan.
>
>IOW, we can't ever get non-NULL tp->ucopy.dma_chan while 
>tp->ucopy.pinned_list
>is NULL.  So how can we ever get to the dma_memcpy_to_kernel_iovec()?

It looks like this is "extra" code.  The history seems to be that it was
thought to be useful for internal copying, perhaps for smbfs or iSCSI,
as the comment suggests.  However, since no one is using it, it can
probably come out.  If there is no argument, I'll post a patch to remove
it.

sln
--
======================================================================
Mr. Shannon Nelson                 LAN Access Division, Intel Corp.
Shannon.Nelson@intel.com                I don't speak for Intel
(503) 712-7659                    Parents can't afford to be squeamish.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-07-24 18:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-21  3:48 NET_DMA: where do we ever call dma_skb_copy_datagram_iovec() with NULL pinned_list? Al Viro
2007-07-24 17:24 ` Andrew Grover
2007-07-24 18:14 ` Nelson, Shannon

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).