Skip to content

Commit 12c8a8c

Browse files
Zhang Changzhongborkmann
authored andcommitted
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: 921b686 ("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
1 parent 3413f04 commit 12c8a8c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

net/xdp/xsk_buff_pool.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ static int __xp_assign_dev(struct xsk_buff_pool *pool,
175175

176176
if (!pool->dma_pages) {
177177
WARN(1, "Driver did not DMA map zero-copy buffers");
178+
err = -EINVAL;
178179
goto err_unreg_xsk;
179180
}
180181
pool->umem->zc = true;

0 commit comments

Comments
 (0)