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 <hulkci@huawei.com> Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Magnus Karlsson <magnus.karlsson@intel.com> Link: https://lore.kernel.org/bpf/1607077277-41995-1-git-send-email-zhangchangzhong@huawei.com
This commit is contained in:
parent
3413f04141
commit
12c8a8ca11
@ -175,6 +175,7 @@ static int __xp_assign_dev(struct xsk_buff_pool *pool,
|
|||||||
|
|
||||||
if (!pool->dma_pages) {
|
if (!pool->dma_pages) {
|
||||||
WARN(1, "Driver did not DMA map zero-copy buffers");
|
WARN(1, "Driver did not DMA map zero-copy buffers");
|
||||||
|
err = -EINVAL;
|
||||||
goto err_unreg_xsk;
|
goto err_unreg_xsk;
|
||||||
}
|
}
|
||||||
pool->umem->zc = true;
|
pool->umem->zc = true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user