aboutsummaryrefslogtreecommitdiff
path: root/hw/net/vhost_net.c
diff options
context:
space:
mode:
authorVincenzo Maffione <v.maffione@gmail.com>2014-02-06 17:02:18 +0100
committerStefan Hajnoczi <stefanha@redhat.com>2014-02-25 11:50:17 +0100
commitcf528b89580797050b8cf60fee6247f35531a675 (patch)
treebaf6fa678ed7fa12edc3ea94cd3fed8b257d5934 /hw/net/vhost_net.c
parent2e753bcc7db1a7d2af0d47c0ae7e82a04ce69d63 (diff)
net: virtio-net and vmxnet3 use offloading API
With this patch, virtio-net and vmxnet3 frontends make use of the qemu_peer_* API for backend offloadings manipulations, instead of calling TAP-specific functions directly. We also remove the existing checks which prevent those frontends from using offloadings with backends different from TAP (e.g. netmap). Signed-off-by: Vincenzo Maffione <v.maffione@gmail.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'hw/net/vhost_net.c')
-rw-r--r--hw/net/vhost_net.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c
index 854997d9ba..c90b9ec9ab 100644
--- a/hw/net/vhost_net.c
+++ b/hw/net/vhost_net.c
@@ -106,7 +106,7 @@ struct vhost_net *vhost_net_init(NetClientState *backend, int devfd,
goto fail;
}
net->nc = backend;
- net->dev.backend_features = tap_has_vnet_hdr(backend) ? 0 :
+ net->dev.backend_features = backend->info->has_vnet_hdr(backend) ? 0 :
(1 << VHOST_NET_F_VIRTIO_NET_HDR);
net->backend = r;
@@ -117,7 +117,7 @@ struct vhost_net *vhost_net_init(NetClientState *backend, int devfd,
if (r < 0) {
goto fail;
}
- if (!tap_has_vnet_hdr_len(backend,
+ if (!backend->info->has_vnet_hdr_len(backend,
sizeof(struct virtio_net_hdr_mrg_rxbuf))) {
net->dev.features &= ~(1 << VIRTIO_NET_F_MRG_RXBUF);
}