NET_DMA: where do we ever call dma_skb_copy_datagram_iovec() with NULL pinned_list?
Subsystems (2)
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 fromtp->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()?
Quoted 9 lines · Al Viro
AFAICS, all callers of
dma_skb_copy_datagram_iovec()
are either
* recursive for fragments, passpinned_listunchanged or
* called from tcp, withpinned_listcoming fromtp->ucopy.pinned_listand only whentp->ucopy.dma_chanis 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();
Quoted 7 lines
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_chanwhiletp->ucopy.pinned_listis NULL. So how can we ever get to thedma_memcpy_to_kernel_iovec()?
Shannon what do you think? Is this a bug, or does it no longer support non-userspace iovecs?
Thanks -- Andy
Al Viro:
Quoted 13 lines
AFAICS, all callers of
dma_skb_copy_datagram_iovec()
are either
* recursive for fragments, passpinned_listunchanged or
* called from tcp, withpinned_listcoming fromtp->ucopy.pinned_listand only whentp->ucopy.dma_chanis 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.
Quoted 6 lines
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_chanwhiletp->ucopy.pinned_list
is NULL. So how can we ever get to thedma_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.
[email protected] I don't speak for Intel
(503) 712-7659 Parents can't afford to be squeamish.