Skip to content

Commit

Permalink
veth: Store queue_mapping independently of XDP prog presence
Browse files Browse the repository at this point in the history
Currently, veth_xmit() would call the skb_record_rx_queue() only when
there is XDP program loaded on peer interface in native mode.

If peer has XDP prog in generic mode, then netif_receive_generic_xdp()
has a call to netif_get_rxqueue(skb), so for multi-queue veth it will
not be possible to grab a correct rxq.

To fix that, store queue_mapping independently of XDP prog presence on
peer interface.

Fixes: 638264d ("veth: Support per queue XDP ring")
Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Toshiaki Makita <toshiaki.makita1@gmail.com>
Link: https://lore.kernel.org/bpf/20210303152903.11172-1-maciej.fijalkowski@intel.com
  • Loading branch information
mfijalko authored and borkmann committed Mar 5, 2021
1 parent d8861ba commit edbea92
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/net/veth.c
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,7 @@ static netdev_tx_t veth_xmit(struct sk_buff *skb, struct net_device *dev)
if (rxq < rcv->real_num_rx_queues) {
rq = &rcv_priv->rq[rxq];
rcv_xdp = rcu_access_pointer(rq->xdp_prog);
if (rcv_xdp)
skb_record_rx_queue(skb, rxq);
skb_record_rx_queue(skb, rxq);
}

skb_tx_timestamp(skb);
Expand Down

0 comments on commit edbea92

Please sign in to comment.