Date: Sun, 14 Jun 2020 22:39:34 +0000 (UTC) From: Jessica Clarke <jrtc27@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362186 - head/sys/dev/virtio/network Message-ID: <202006142239.05EMdYHb004627@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jrtc27 Date: Sun Jun 14 22:39:34 2020 New Revision: 362186 URL: https://svnweb.freebsd.org/changeset/base/362186 Log: vtnet: Fix regression introduced in r361944 For legacy devices that don't support MrgRxBuf (such as bhyve pre-r358180), r361944 failed to update the receive handler to account for the additional padding introduced by the unused num_buffers field that is now always present in struct vtnet_rx_header. Thus, calculate the padding dynamically based on vtnet_hdr_size. PR: 247242 Reported by: thj Tested by: thj Modified: head/sys/dev/virtio/network/if_vtnet.c Modified: head/sys/dev/virtio/network/if_vtnet.c ============================================================================== --- head/sys/dev/virtio/network/if_vtnet.c Sun Jun 14 21:07:12 2020 (r362185) +++ head/sys/dev/virtio/network/if_vtnet.c Sun Jun 14 22:39:34 2020 (r362186) @@ -1819,9 +1819,10 @@ vtnet_rxq_eof(struct vtnet_rxq *rxq) adjsz = sizeof(struct vtnet_rx_header); /* * Account for our pad inserted between the header - * and the actual start of the frame. + * and the actual start of the frame. This includes + * the unused num_buffers when using a legacy device. */ - len += VTNET_RX_HEADER_PAD; + len += adjsz - sc->vtnet_hdr_size; } else { mhdr = mtod(m, struct virtio_net_hdr_mrg_rxbuf *); nbufs = mhdr->num_buffers;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202006142239.05EMdYHb004627>