From nobody Sat May 4 13:48:07 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1550253223874497.7723060097501; Fri, 15 Feb 2019 09:53:43 -0800 (PST) Received: from localhost ([127.0.0.1]:44110 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guhg2-0002Cy-BJ for importer@patchew.org; Fri, 15 Feb 2019 12:53:30 -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) 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) 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) 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 Content-Transfer-Encoding: quoted-printable 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" 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 =3D DO_UPCAST(TAPState, nc, nc); =20 assert(nc->info->type =3D=3D NET_CLIENT_DRIVER_TAP); - assert(!!s->host_vnet_hdr_len =3D=3D using_vnet_hdr); =20 s->using_vnet_hdr =3D using_vnet_hdr; } --=20 2.20.1