@@ -979,6 +979,7 @@ struct netdev_bpf {
struct {
struct xsk_buff_pool *pool;
u16 queue_id;
+ bool check_dma;
} xsk;
};
};
@@ -166,12 +166,13 @@ int xp_assign_dev(struct xsk_buff_pool *pool,
bpf.command = XDP_SETUP_XSK_POOL;
bpf.xsk.pool = pool;
bpf.xsk.queue_id = queue_id;
+ bpf.xsk.check_dma = true;
err = netdev->netdev_ops->ndo_bpf(netdev, &bpf);
if (err)
goto err_unreg_pool;
- if (!pool->dma_pages) {
+ if (bpf.xsk.check_dma && !pool->dma_pages) {
WARN(1, "Driver did not DMA map zero-copy buffers");
err = -EINVAL;
goto err_unreg_xsk;