Change the xsk_rcv_check test for inbound packets to use the xs->pool->netdev and xs->pool->queue_id of the bound socket rather than xs->dev and xs->queue_id since the latter could point to a virtual device with mapped rxq rather than the physical backing device of the pool. Signed-off-by: Daniel Borkmann Co-developed-by: David Wei Signed-off-by: David Wei --- net/xdp/xsk.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/net/xdp/xsk.c b/net/xdp/xsk.c index 82ad89f6ba35..cf40c70ee59f 100644 --- a/net/xdp/xsk.c +++ b/net/xdp/xsk.c @@ -340,15 +340,13 @@ static int xsk_rcv_check(struct xdp_sock *xs, struct xdp_buff *xdp, u32 len) { if (!xsk_is_bound(xs)) return -ENXIO; - - if (xs->dev != xdp->rxq->dev || xs->queue_id != xdp->rxq->queue_index) + if (xs->pool->netdev != xdp->rxq->dev || + xs->pool->queue_id != xdp->rxq->queue_index) return -EINVAL; - if (len > xsk_pool_get_rx_frame_size(xs->pool) && !xs->sg) { xs->rx_dropped++; return -ENOSPC; } - return 0; } -- 2.43.0