net/virtio: set offload flag for jumbo frames
authorJens Freimann <jfreimann@redhat.com>
Tue, 5 Feb 2019 11:17:02 +0000 (12:17 +0100)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 8 Feb 2019 18:27:07 +0000 (19:27 +0100)
commit8b90e4358112b9e41f8eaa1ba14c783570307fea
treec3af071c744b3ba23595fb2af8bd05ed4920263d
parent4b058fdd27ceac277aa715df6f6bb0f7b37b150b
net/virtio: set offload flag for jumbo frames

Port configuration fails because offload flags don't match the expected
value when max-pkt-len is set to a value that should enable receive port
offloading but doesn't.

The .dev_infos_get callback can be called before the configure callback.
At that time we don't know the maximum packet size yet because it is
only set up when ports are started. So in virtio_dev_info_get() just
always set the jumbo packet offload flag.

Check the maximum packet length at device configure time, because then we
have access to the max-pkt-len value provided by the user. If the
max-pkt-len exceeds the maximum MTU supported by the device we remove
the VIRTIO_NET_F_MTU flag from requested features.

Fixes: a4996bd89c42 ("ethdev: new Rx/Tx offloads API")
Cc: stable@dpdk.org
Signed-off-by: Jens Freimann <jfreimann@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
drivers/net/virtio/virtio_ethdev.c