From patchwork Fri Feb 15 17:46:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincenzo Maffione X-Patchwork-Id: 1043109 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="dOEx+jCb"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 441LTH53nMz9s5c for ; Sat, 16 Feb 2019 04:53:07 +1100 (AEDT) Received: from localhost ([127.0.0.1]:44104 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guhfd-0001uB-OV for incoming@patchwork.ozlabs.org; Fri, 15 Feb 2019 12:53:05 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44197) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) 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 ) 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 ) 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 ; 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 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 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jasowang@redhat.com, Vincenzo Maffione Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 --- net/tap.c | 1 - 1 file changed, 1 deletion(-) 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; }