net/virtio: rationalize setting of Rx/Tx handlers
authorOlivier Matz <olivier.matz@6wind.com>
Thu, 7 Sep 2017 12:13:44 +0000 (14:13 +0200)
committerYuanhan Liu <yliu@fridaylinux.org>
Tue, 10 Oct 2017 13:51:04 +0000 (15:51 +0200)
commit4819eae8d94b363bdf19bb098ebd7a0940e4501f
tree142a52c22c9f3939df98735910ecda00a9282b00
parentefc83a1e7fc319876835738871bf968e7ed5c935
net/virtio: rationalize setting of Rx/Tx handlers

The selection of Rx/Tx handlers is done at several places,
group them in one function set_rxtx_funcs().

The update of hw->use_simple_rxtx is also rationalized:
- initialized to 1 (prefer simple path)
- in dev configure or rx/tx queue setup, if something prevents from
  using the simple path, change it to 0.
- in dev start, set the handlers according to hw->use_simple_rxtx.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Yuanhan Liu <yliu@fridaylinux.org>
drivers/net/virtio/virtio_ethdev.c
drivers/net/virtio/virtio_rxtx.c