net/virtio: fix advertised Rx offload capabilities
authorOlivier Matz <olivier.matz@6wind.com>
Tue, 17 Jan 2017 10:35:53 +0000 (11:35 +0100)
committerYuanhan Liu <yuanhan.liu@linux.intel.com>
Tue, 17 Jan 2017 11:06:24 +0000 (12:06 +0100)
commitc1e55ed3f7735dcb64cc4530bb94dd2a7c3c0a82
treec2a16b17708fafad66854c0ae997f95822bc8dfc
parentfaf08c8b0f4a28bcbee6d7701acb010250ee2ff7
net/virtio: fix advertised Rx offload capabilities

When the virtio PMD is used on top of a vhost that does not support
offloads, Rx offload capabilities are still advertised by
virtio_dev_info_get(). But if an application tries to start the PMD with
Rx offloads enabled (rxmode.hw_ip_checksum = 1), the initialization of
the device will fail with -ENOTSUP and the following log:

  rx ip checksum not available on this host

This patch fixes the Rx offload capabilities returned by
virtio_dev_info_get() to be consistent with features advertised by the
host.

Fixes: 96cb6711939e ("net/virtio: support Rx checksum offload")
Fixes: 86d59b21468a ("net/virtio: support LRO")
Cc: stable@dpdk.org
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
drivers/net/virtio/virtio_ethdev.c