[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 04/11] net: TAP uses NetClientInfo offloading callbac
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] [PULL 04/11] net: TAP uses NetClientInfo offloading callbacks |
Date: |
Tue, 25 Feb 2014 14:33:42 +0100 |
From: Vincenzo Maffione <address@hidden>
The TAP NetClientInfo structure is inizialized with the TAP-specific
functions that manipulates offloading features.
Signed-off-by: Vincenzo Maffione <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
---
net/tap-win32.c | 92 ++++++++++++++++++++++++++++++---------------------------
net/tap.c | 6 ++++
2 files changed, 55 insertions(+), 43 deletions(-)
diff --git a/net/tap-win32.c b/net/tap-win32.c
index edf26c4..924ca55 100644
--- a/net/tap-win32.c
+++ b/net/tap-win32.c
@@ -669,11 +669,60 @@ static void tap_win32_send(void *opaque)
}
}
+bool tap_has_ufo(NetClientState *nc)
+{
+ return false;
+}
+
+bool tap_has_vnet_hdr(NetClientState *nc)
+{
+ return false;
+}
+
+int tap_probe_vnet_hdr_len(int fd, int len)
+{
+ return 0;
+}
+
+void tap_fd_set_vnet_hdr_len(int fd, int len)
+{
+}
+
+void tap_using_vnet_hdr(NetClientState *nc, bool using_vnet_hdr)
+{
+}
+
+void tap_set_offload(NetClientState *nc, int csum, int tso4,
+ int tso6, int ecn, int ufo)
+{
+}
+
+struct vhost_net *tap_get_vhost_net(NetClientState *nc)
+{
+ return NULL;
+}
+
+bool tap_has_vnet_hdr_len(NetClientState *nc, int len)
+{
+ return false;
+}
+
+void tap_set_vnet_hdr_len(NetClientState *nc, int len)
+{
+ abort();
+}
+
static NetClientInfo net_tap_win32_info = {
.type = NET_CLIENT_OPTIONS_KIND_TAP,
.size = sizeof(TAPState),
.receive = tap_receive,
.cleanup = tap_cleanup,
+ .has_ufo = tap_has_ufo,
+ .has_vnet_hdr = tap_has_vnet_hdr,
+ .has_vnet_hdr_len = tap_has_vnet_hdr_len,
+ .using_vnet_hdr = tap_using_vnet_hdr,
+ .set_offload = tap_set_offload,
+ .set_vnet_hdr_len = tap_set_vnet_hdr_len,
};
static int tap_win32_init(NetClientState *peer, const char *model,
@@ -722,49 +771,6 @@ int net_init_tap(const NetClientOptions *opts, const char
*name,
return 0;
}
-bool tap_has_ufo(NetClientState *nc)
-{
- return false;
-}
-
-bool tap_has_vnet_hdr(NetClientState *nc)
-{
- return false;
-}
-
-int tap_probe_vnet_hdr_len(int fd, int len)
-{
- return 0;
-}
-
-void tap_fd_set_vnet_hdr_len(int fd, int len)
-{
-}
-
-void tap_using_vnet_hdr(NetClientState *nc, bool using_vnet_hdr)
-{
-}
-
-void tap_set_offload(NetClientState *nc, int csum, int tso4,
- int tso6, int ecn, int ufo)
-{
-}
-
-struct vhost_net *tap_get_vhost_net(NetClientState *nc)
-{
- return NULL;
-}
-
-bool tap_has_vnet_hdr_len(NetClientState *nc, int len)
-{
- return false;
-}
-
-void tap_set_vnet_hdr_len(NetClientState *nc, int len)
-{
- abort();
-}
-
int tap_enable(NetClientState *nc)
{
abort();
diff --git a/net/tap.c b/net/tap.c
index c805f3c..d34ec88 100644
--- a/net/tap.c
+++ b/net/tap.c
@@ -314,6 +314,12 @@ static NetClientInfo net_tap_info = {
.receive_iov = tap_receive_iov,
.poll = tap_poll,
.cleanup = tap_cleanup,
+ .has_ufo = tap_has_ufo,
+ .has_vnet_hdr = tap_has_vnet_hdr,
+ .has_vnet_hdr_len = tap_has_vnet_hdr_len,
+ .using_vnet_hdr = tap_using_vnet_hdr,
+ .set_offload = tap_set_offload,
+ .set_vnet_hdr_len = tap_set_vnet_hdr_len,
};
static TAPState *net_tap_fd_init(NetClientState *peer,
--
1.8.5.3
- [Qemu-devel] [PULL 00/11] Net patches, Stefan Hajnoczi, 2014/02/25
- [Qemu-devel] [PULL 01/11] opencores_eth: flush queue whenever can_receive can go from false to true, Stefan Hajnoczi, 2014/02/25
- [Qemu-devel] [PULL 02/11] net: change vnet-hdr TAP prototypes, Stefan Hajnoczi, 2014/02/25
- [Qemu-devel] [PULL 03/11] net: extend NetClientInfo for offloading, Stefan Hajnoczi, 2014/02/25
- [Qemu-devel] [PULL 04/11] net: TAP uses NetClientInfo offloading callbacks,
Stefan Hajnoczi <=
- [Qemu-devel] [PULL 05/11] net: virtio-net and vmxnet3 use offloading API, Stefan Hajnoczi, 2014/02/25
- [Qemu-devel] [PULL 06/11] net: make tap offloading callbacks static, Stefan Hajnoczi, 2014/02/25
- [Qemu-devel] [PULL 07/11] net: add offloading support to netmap backend, Stefan Hajnoczi, 2014/02/25
- [Qemu-devel] [PULL 08/11] net: Disable netmap backend when not supported, Stefan Hajnoczi, 2014/02/25
- [Qemu-devel] [PULL 09/11] net: remove implicit peer from offload API, Stefan Hajnoczi, 2014/02/25
- [Qemu-devel] [PULL 10/11] vhost_net: use offload API instead of bypassing it, Stefan Hajnoczi, 2014/02/25
- [Qemu-devel] [PULL 11/11] virtio-net: use qemu_get_queue() where possible, Stefan Hajnoczi, 2014/02/25
- Re: [Qemu-devel] [PULL 00/11] Net patches, Peter Maydell, 2014/02/26