Message ID | 20221121112848.51388-2-hengqi@linux.alibaba.com (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | Revert "veth: Avoid drop packets when xdp_redirect performs" and its fix | expand |
diff --git a/drivers/net/veth.c b/drivers/net/veth.c index 2a4592780141..b1ed5a93b6c5 100644 --- a/drivers/net/veth.c +++ b/drivers/net/veth.c @@ -1125,7 +1125,7 @@ static int veth_enable_xdp(struct net_device *dev) int err, i; rq = &priv->rq[0]; - napi_already_on = rcu_access_pointer(rq->napi); + napi_already_on = (dev->flags & IFF_UP) && rcu_access_pointer(rq->napi); if (!xdp_rxq_info_is_reg(&priv->rq[0].xdp_rxq)) { err = veth_enable_xdp_range(dev, 0, dev->real_num_rx_queues, napi_already_on);