diff options
author | Zhang Changzhong <[email protected]> | 2020-12-04 18:21:16 +0800 |
---|---|---|
committer | Daniel Borkmann <[email protected]> | 2020-12-04 16:48:31 +0100 |
commit | 12c8a8ca117f3d734babc3fba131fdaa329d2163 (patch) | |
tree | 5db836caee97a915dd8b242c149b59f7b0d2ef40 | |
parent | 3413f04141aa440c71da187755e8e22f5093ce83 (diff) |
xsk: Return error code if force_zc is set
If force_zc is set, we should exit out with an error, not fall back to
copy mode.
Fixes: 921b68692abb ("xsk: Enable sharing of dma mappings")
Reported-by: Hulk Robot <[email protected]>
Signed-off-by: Zhang Changzhong <[email protected]>
Signed-off-by: Daniel Borkmann <[email protected]>
Acked-by: Magnus Karlsson <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
-rw-r--r-- | net/xdp/xsk_buff_pool.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/net/xdp/xsk_buff_pool.c b/net/xdp/xsk_buff_pool.c index 9287eddec52c..d5adeee9d5d9 100644 --- a/net/xdp/xsk_buff_pool.c +++ b/net/xdp/xsk_buff_pool.c @@ -175,6 +175,7 @@ static int __xp_assign_dev(struct xsk_buff_pool *pool, if (!pool->dma_pages) { WARN(1, "Driver did not DMA map zero-copy buffers"); + err = -EINVAL; goto err_unreg_xsk; } pool->umem->zc = true; |