veth: Support per queue XDP ring
authorToshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
Fri, 3 Aug 2018 07:58:18 +0000 (16:58 +0900)
committerDaniel Borkmann <daniel@iogearbox.net>
Fri, 10 Aug 2018 14:12:21 +0000 (16:12 +0200)
commit638264dc90227cca00d20c26680171addce18e51
treee3ab1b8331d9f20766f6747eac42928f6b13d911
parentd1396004dd868642ea2596abe058d96dcf97990f
veth: Support per queue XDP ring

Move XDP and napi related fields from veth_priv to newly created veth_rq
structure.

When xdp_frames are enqueued from ndo_xdp_xmit and XDP_TX, rxq is
selected by current cpu.

When skbs are enqueued from the peer device, rxq is one to one mapping
of its peer txq. This way we have a restriction that the number of rxqs
must not less than the number of peer txqs, but leave the possibility to
achieve bulk skb xmit in the future because txq lock would make it
possible to remove rxq ptr_ring lock.

v3:
- Add extack messages.
- Fix array overrun in veth_xmit.

Signed-off-by: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
drivers/net/veth.c