# Re: \[PATCH v3 17/18\] vhost: don't bother copying iovecs in handle\_rx(), kill memcpy\_toiovecend()

- From: Michael S. Tsirkin \<mst@redhat.com\>
- Date: 2015-02-04 09:02:27 
- List: netdev
- Page: https://ratatoskr.run/netdev/2015/02/10977194
- Thread: https://ratatoskr.run/netdev/2015/01/10976815/t.md

```text
>  		if (likely(mergeable) &&
> -		    memcpy_toiovecend(nvq->hdr, (unsigned char *)&headcount,
> -				      offsetof(typeof(hdr), num_buffers),
> -				      sizeof hdr.num_buffers)) {
> +		    copy_to_iter(&headcount, 2, &fixup) != 2) {
>  			vq_err(vq, "Failed num_buffers write");
>  			vhost_discard_vq_desc(vq, headcount);
>  			break;

BTW this will have to be re-based on top of
http://mid.gmane.org/1422896842-19186-1-git-send-email-mst@redhat.com
taking byte-swap into account.
```
