summaryrefslogtreecommitdiff
path: root/drivers/net/veth.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/veth.c')
-rw-r--r--drivers/net/veth.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/net/veth.c b/drivers/net/veth.c
index 643b97dc5245..6205742f88d9 100644
--- a/drivers/net/veth.c
+++ b/drivers/net/veth.c
@@ -377,6 +377,9 @@ static netdev_tx_t veth_xmit(struct sk_buff *skb, struct net_device *dev)
skb_tx_timestamp(skb);
+ /* tx queue index of this device, meaningless as rx queue of the peer */
+ skb_set_queue_mapping(skb, 0);
+
ret = veth_forward_skb(rcv, skb, rq, use_napi);
switch (ret) {
case NET_RX_SUCCESS: /* same as NETDEV_TX_OK */
@@ -397,6 +400,8 @@ static netdev_tx_t veth_xmit(struct sk_buff *skb, struct net_device *dev)
}
/* Restore Eth hdr pulled by dev_forward_skb/eth_type_trans */
__skb_push(skb, ETH_HLEN);
+ /* qdisc requeues the skb on the txq it points to */
+ skb_set_queue_mapping(skb, rxq);
netif_tx_stop_queue(txq);
/* Makes sure NAPI peer consumer runs. Consumer is responsible
* for starting txq again, until then ndo_start_xmit (this
@@ -612,7 +617,7 @@ static void veth_xdp_flush(struct veth_rq *rq, struct veth_xdp_tx_bq *bq)
rcv_priv = netdev_priv(rcv);
rcv_rq = &rcv_priv->rq[veth_select_rxq(rcv)];
/* xdp_ring is initialized on receive side? */
- if (unlikely(!rcu_access_pointer(rcv_rq->xdp_prog)))
+ if (unlikely(!rcu_access_pointer(rcv_rq->napi)))
goto out;
__veth_xdp_flush(rcv_rq);
@@ -746,7 +751,7 @@ static void veth_xdp_get(struct xdp_buff *xdp)
return;
for (i = 0; i < sinfo->nr_frags; i++)
- __skb_frag_ref(&sinfo->frags[i]);
+ netmem_inc_ref(skb_frag_netmem(&sinfo->frags[i]));
}
static int veth_convert_skb_to_xdp_buff(struct veth_rq *rq,
@@ -1919,7 +1924,7 @@ static int veth_newlink(struct net_device *dev,
priv = netdev_priv(peer);
rcu_assign_pointer(priv->peer, dev);
netdev_hold(dev, &priv->peer_tracker, GFP_KERNEL);
- err = veth_init_queues(peer, tb);
+ err = veth_init_queues(peer, tbp);
if (err)
goto err_peer_queues;