Netdev List
 help / color / mirror / Atom feed
* [Q] packet truncated after enabling ip_forward for virtio-net in guest
@ 2022-09-13 15:42 Wei Yang
  2022-09-14  3:46 ` Jason Wang
  0 siblings, 1 reply; 3+ messages in thread
From: Wei Yang @ 2022-09-13 15:42 UTC (permalink / raw)
  To: Michael S. Tsirkin, jasowang; +Cc: netdev, virtualization

Hi, I am running a guest with vhost-net as backend. After I enable
ip_forward, the packet received is truncated.

Host runs a 5.10 kernel, while guest kernel is v5.11 which doesn't
include this commit:

  virtio-net: use NETIF_F_GRO_HW instead of NETIF_F_LRO

After applying this commit, the issue is gone. I guess the reason is
this device doesn't have NETIF_F_GRO_HW set, so
virtnet_set_guest_offloads is not called.

I am wondering why packet is truncated without this fix. I follow
virtnet_set_guest_offloads and just see virtio_net_handle_ctrl in qemu
handles VIRTIO_NET_CTRL_GUEST_OFFLOADS. Since we use a tap dev, then I
follow tap_fd_set_offload to ioctl(fd, TUNSETOFFLOAD, offload).

But I am lost here. tap_ioctl -> set_offload(). Since we use a normal
tap device instead of ipvtap/macvtap, update_features is empty. So I
don't get how the device's behavior is changed after set LRO.

Do I follow the wrong path? Any suggestions on investigation?

I'd appreciate it if someone could give a hint :-)

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-09-14 15:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-13 15:42 [Q] packet truncated after enabling ip_forward for virtio-net in guest Wei Yang
2022-09-14  3:46 ` Jason Wang
2022-09-14 15:44   ` Wei Yang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox