提交 e3e48565 编写于 作者: S Stefan Hajnoczi

vhost_net: use offload API instead of bypassing it

There is no need to access backend->info->has_vnet_hdr() and friends
anymore.  Use the qemu_has_vnet_hdr() API instead.
Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
上级 d6085e3a
...@@ -106,7 +106,7 @@ struct vhost_net *vhost_net_init(NetClientState *backend, int devfd, ...@@ -106,7 +106,7 @@ struct vhost_net *vhost_net_init(NetClientState *backend, int devfd,
goto fail; goto fail;
} }
net->nc = backend; net->nc = backend;
net->dev.backend_features = backend->info->has_vnet_hdr(backend) ? 0 : net->dev.backend_features = qemu_has_vnet_hdr(backend) ? 0 :
(1 << VHOST_NET_F_VIRTIO_NET_HDR); (1 << VHOST_NET_F_VIRTIO_NET_HDR);
net->backend = r; net->backend = r;
...@@ -117,8 +117,8 @@ struct vhost_net *vhost_net_init(NetClientState *backend, int devfd, ...@@ -117,8 +117,8 @@ struct vhost_net *vhost_net_init(NetClientState *backend, int devfd,
if (r < 0) { if (r < 0) {
goto fail; goto fail;
} }
if (!backend->info->has_vnet_hdr_len(backend, if (!qemu_has_vnet_hdr_len(backend,
sizeof(struct virtio_net_hdr_mrg_rxbuf))) { sizeof(struct virtio_net_hdr_mrg_rxbuf))) {
net->dev.features &= ~(1 << VIRTIO_NET_F_MRG_RXBUF); net->dev.features &= ~(1 << VIRTIO_NET_F_MRG_RXBUF);
} }
if (~net->dev.features & net->dev.backend_features) { if (~net->dev.features & net->dev.backend_features) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册