[Differential] D20276: [bhyve][virtio-net] Allow guest VM's to set JUMBO MTU in case of using the VALE switch.

v.maffione_gmail.com (Vincenzo Maffione) phabric-noreply at FreeBSD.org
Mon Jun 10 19:44:44 UTC 2019


v.maffione_gmail.com added a comment.


  This looks better, but the problem is that I was refactoring this file to separate virtio specific code from the backends (netmap, tap), and add
  support for offloads (including TSO); this patch creates many conflicts with my pending work, and IMHO it should be rebased after my work to prevent a total mess.

INLINE COMMENTS

> pci_virtio_net.c:547
>  	struct iovec iov[VTNET_MAXSEGS], *riov;
> +	struct virtio_used used[VTNET_MAXSEGS];
> +	struct virtio_net_rxhdr *vrxh;

Why are you using this temporary array instead of writing directly to the used ring?
Used entries are only exposed to the guest when vu_idx is incremented, so you would not have race conditions.
This would also greatly simplify your vq_relbufs_mrgrx below.

> virtio.c:412
> +
> +		iov_len = count_iov(&iov[i], n);
> +		i += n;

The name of 'iov_len' variable is really confusing, as struct iovec.iov_len refers to the length of a single slot, while your variable refers to the sum of the lengths of possibly many slots...
It's better to use something like 'chain_len'

CHANGES SINCE LAST ACTION
  https://reviews.freebsd.org/D20276/new/

REVISION DETAIL
  https://reviews.freebsd.org/D20276

EMAIL PREFERENCES
  https://reviews.freebsd.org/settings/panel/emailpreferences/

To: aleksandr.fedorov_itglobal.com, #bhyve, jhb, rgrimes, krion, v.maffione_gmail.com
Cc: mgrooms_shrew.net, mizhka_gmail.com, novel, olevole_olevole.ru, freebsd-virtualization-list, evgueni.gavrilov_itglobal.com, bcran


More information about the freebsd-virtualization mailing list