mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 22:21:40 +00:00
net: page pool: allow to pass zero flags to page_pool_init()
page pool API can be useful for non-DMA cases like xen-netfront driver so let's allow to pass zero flags to page pool flags. v2: check DMA direction only if PP_FLAG_DMA_MAP is set Signed-off-by: Denis Kirjanov <kda@linux-powerpc.org> Acked-by: Jesper Dangaard Brouer <brouer@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
5ef5c90e3c
commit
798dda818a
@ -43,9 +43,11 @@ static int page_pool_init(struct page_pool *pool,
|
||||
* DMA_BIDIRECTIONAL is for allowing page used for DMA sending,
|
||||
* which is the XDP_TX use-case.
|
||||
*/
|
||||
if ((pool->p.dma_dir != DMA_FROM_DEVICE) &&
|
||||
(pool->p.dma_dir != DMA_BIDIRECTIONAL))
|
||||
return -EINVAL;
|
||||
if (pool->p.flags & PP_FLAG_DMA_MAP) {
|
||||
if ((pool->p.dma_dir != DMA_FROM_DEVICE) &&
|
||||
(pool->p.dma_dir != DMA_BIDIRECTIONAL))
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (pool->p.flags & PP_FLAG_DMA_SYNC_DEV) {
|
||||
/* In order to request DMA-sync-for-device the page
|
||||
|
Loading…
Reference in New Issue
Block a user