Message ID | 20190215174659.4007-2-v.maffione@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 06FDC1575 for <patchwork-qemu-devel@patchwork.kernel.org>; Fri, 15 Feb 2019 17:53:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E9D6F2FB77 for <patchwork-qemu-devel@patchwork.kernel.org>; Fri, 15 Feb 2019 17:53:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DD9012FD1C; Fri, 15 Feb 2019 17:53:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9422D2FB77 for <patchwork-qemu-devel@patchwork.kernel.org>; Fri, 15 Feb 2019 17:53:18 +0000 (UTC) Received: from localhost ([127.0.0.1]:44110 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org>) id 1guhfp-0002Cy-OF for patchwork-qemu-devel@patchwork.kernel.org; Fri, 15 Feb 2019 12:53:17 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44197) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <v.maffione@gmail.com>) id 1guhZv-0006hl-5D for qemu-devel@nongnu.org; Fri, 15 Feb 2019 12:47:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <v.maffione@gmail.com>) id 1guhZu-0002uA-DV for qemu-devel@nongnu.org; Fri, 15 Feb 2019 12:47:11 -0500 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]:45723) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from <v.maffione@gmail.com>) id 1guhZu-0002sf-7V for qemu-devel@nongnu.org; Fri, 15 Feb 2019 12:47:10 -0500 Received: by mail-wr1-x443.google.com with SMTP id w17so11184192wrn.12 for <qemu-devel@nongnu.org>; Fri, 15 Feb 2019 09:47:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=E6w1UuRc1nDFqKZp7Jyo0wqqSK3RTymZqveCq3myMpE=; b=dOEx+jCbUDK09T+dz3cc/CqrLbO5fvb/piAaBmtzwXvP9IgTYZnzaZXVHQ+acUliTb G0lySEf/k0ERLI1fMuXNjwG3d0fHPieRfn0D8FmLkW3w067N/MKy+Acsx384VK5fFuGF 0bkB7aY4mXK8JRx/BhbivJ+O4GIpp7a09Y0DjQFF/EtlZGLNa2R0ajfjf53P/KqM2IE1 6174SKF3ritaw2KnjRHjGDS/HP95yqSfm/+I2xt1SYwoxPSkDRicaj/ju2AM28ZzvSl8 1xfctgcLw40fgfchmxiqjjmvioxcmqom0m2KFfQl403pBta4a8Smu+IuojcLaKPPmyhX Olmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=E6w1UuRc1nDFqKZp7Jyo0wqqSK3RTymZqveCq3myMpE=; b=QQQ8XWrc/2bWcjvD/74ElArPiV27pr33i0u+pHMC++IknMY5lxpNoYns3U6aDhtUxF o7tdDn+OVCkbABtXBoS4N6C86u6TqTV0WljEQWbDEXflrcD9VCZ9yxT2yRa8gcm43VW8 gZBMxzVROPTDC9JJZfFQOGiahmj9VnpcV98yPo12eXJfREZ2ztgjXenQVGY6XqOOoQJU 3JfJ4lEoWzO5aWtN1NVZixa5GFKQyCeskKV3QAAcfxtfaSi0Q9fO/G5+CPWd4HiBZOAr lJfqJVrYe9KplVRECDQXxwK8thu1UWegt2PyioY/cAwhys1MHhTmQBkulzEd+9+FI+0p odpg== X-Gm-Message-State: AHQUAuYjWvqTtdOPhGrAycCgVcAK7ppfjg2oMY0qjken5nLv0G3pYNgN Yz1crdWS2x1wiQw8g5xHjhPUvm+CD5I= X-Google-Smtp-Source: AHgI3IYsvQ65f2fi224Cju8k6a/z6VW/HiuGl4cXKqIZ6+V5LXPJJGTU0fkjs2vUmkF/ev8lAgZPyg== X-Received: by 2002:adf:f388:: with SMTP id m8mr8191555wro.133.1550252828674; Fri, 15 Feb 2019 09:47:08 -0800 (PST) Received: from localhost.localdomain (prova.iet.unipi.it. [131.114.58.86]) by smtp.gmail.com with ESMTPSA id f2sm7526191wmb.19.2019.02.15.09.47.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Feb 2019 09:47:08 -0800 (PST) From: Vincenzo Maffione <v.maffione@gmail.com> To: qemu-devel@nongnu.org Date: Fri, 15 Feb 2019 18:46:59 +0100 Message-Id: <20190215174659.4007-2-v.maffione@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190215174659.4007-1-v.maffione@gmail.com> References: <20190215174659.4007-1-v.maffione@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::443 Subject: [Qemu-devel] [PATCH v1 1/1] net: tap: allow net frontends to un-negotiate virtio-net header X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <http://lists.nongnu.org/archive/html/qemu-devel/> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Cc: jasowang@redhat.com, Vincenzo Maffione <v.maffione@gmail.com> Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org> X-Virus-Scanned: ClamAV using ClamSMTP |
Series |
Allow TAP to unnegotiate virtio-net header
|
expand
|
diff --git a/net/tap.c b/net/tap.c index cc8525f154..6f2aca0396 100644 --- a/net/tap.c +++ b/net/tap.c @@ -264,7 +264,6 @@ static void tap_using_vnet_hdr(NetClientState *nc, bool using_vnet_hdr) TAPState *s = DO_UPCAST(TAPState, nc, nc); assert(nc->info->type == NET_CLIENT_DRIVER_TAP); - assert(!!s->host_vnet_hdr_len == using_vnet_hdr); s->using_vnet_hdr = using_vnet_hdr; }
The implementation of the TAP net backend already supports the case (s->host_vnet_hdr_len && !s->using_vnet_hdr), which means that the TAP device is expecting the header, while the net frontend (emulated device) is not aware of it. This case is handled by stripping or prepending the (zeroed) header on the fly. However, the function tap_using_vnet_hdr() has an assert() that explicitly prevents this situation to happen. This patch removes the assert(), so that net frontends are free to un-negotiate the header. Signed-off-by: Vincenzo Maffione <v.maffione@gmail.com> --- net/tap.c | 1 - 1 file changed, 1 deletion(-)