From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54862) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WBRT6-0000Up-DE for qemu-devel@nongnu.org; Thu, 06 Feb 2014 11:06:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WBRSv-0004OH-Sx for qemu-devel@nongnu.org; Thu, 06 Feb 2014 11:06:24 -0500 Received: from mail-ea0-x234.google.com ([2a00:1450:4013:c01::234]:57581) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WBRSv-0004O2-NC for qemu-devel@nongnu.org; Thu, 06 Feb 2014 11:06:13 -0500 Received: by mail-ea0-f180.google.com with SMTP id o10so1010856eaj.39 for ; Thu, 06 Feb 2014 08:06:13 -0800 (PST) From: Vincenzo Maffione Date: Thu, 6 Feb 2014 17:02:17 +0100 Message-Id: <1391702540-1760-4-git-send-email-v.maffione@gmail.com> In-Reply-To: <1391702540-1760-1-git-send-email-v.maffione@gmail.com> References: <1391702540-1760-1-git-send-email-v.maffione@gmail.com> Subject: [Qemu-devel] [PATCH v4 3/6] net: TAP uses NetClientInfo offloading callbacks List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aliguori@amazon.com, marcel.a@redhat.com, jasowang@redhat.com, mst@redhat.com, Vincenzo Maffione , lcapitulino@redhat.com, stefanha@redhat.com, dmitry@daynix.com, pbonzini@redhat.com, g.lettieri@iet.unipi.it, rizzo@iet.unipi.it The TAP NetClientInfo structure is inizialized with the TAP-specific functions that manipulates offloading features. Signed-off-by: Vincenzo Maffione --- 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