From nobody Wed Nov 27 07:53:47 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1700299766; cv=none; d=zohomail.com; s=zohoarc; b=lkhfDtvqhHPY3Z1Jj4/KJ05jpl55PAu5IzlfI4u8OKxcCwCpeaVpsjpYire+0oTo0/+todrlpDillM8p/oTjbjSh1lNzBc2I+/oD19O11GFxlwWw04dhNu/i3rYQ4A+SDSr/8faa7iiL3O35hVQtLvHcGRdVnFk2q4bXQCVqLzo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1700299766; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:Message-Id:Reply-To:To; bh=jDHUkFeUiZ95sNfG9WI8P/VDBC1XV4qMk7GmcffU3mw=; b=nb7fmaf/vEt6kTv/mL/HZFzlUAZ4cA1ERsiD62tN4Ir776y9Kaz4HpNXw++AcVGexBbfgN+iHA0/MOBi/jzQ5vQ9BJFKOygVJsR/89PqpAi52z0wKkIuCqIFnbejfn6L3WKnqFB5ZUuW0Dd2QP4XqUTsWHNptySYfUD9gK2lqZE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1700299766441556.9811122095496; Sat, 18 Nov 2023 01:29:26 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r4Hb5-0006Di-NT; Sat, 18 Nov 2023 04:26:39 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r4Hb4-0006DX-Tn for qemu-devel@nongnu.org; Sat, 18 Nov 2023 04:26:38 -0500 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r4Hb3-0003ig-HJ for qemu-devel@nongnu.org; Sat, 18 Nov 2023 04:26:38 -0500 Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-6c4cf0aea06so2756730b3a.0 for ; Sat, 18 Nov 2023 01:26:36 -0800 (PST) Received: from localhost ([157.82.205.15]) by smtp.gmail.com with UTF8SMTPSA id y10-20020a62f24a000000b006c69851c7c9sm2607398pfl.181.2023.11.18.01.26.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 18 Nov 2023 01:26:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1700299595; x=1700904395; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=jDHUkFeUiZ95sNfG9WI8P/VDBC1XV4qMk7GmcffU3mw=; b=H09KqmrVXlyUrfVcZ05XFqu5lAiEkwvTQHK4DyI16b7AFZJkmFGnmqhN+OqZf1x9Cw 4NbEdujl07PiKvR5KOL1phBAuKS4g/mtAUg9csR22wI3oAQboOz5R3LCval47M+reA9E NsCCXzoVuZkLiZJkhEzz3Gz/1oC0J67qwib9qZ/Fh7T+jfQxFY2jWwDQ+88aDgwIbWEy t+tRuCP+mS6PECwLiNWvR9Gj+hcesVUN5KVU/gHqj07sJyDH+uxVq6JZxVKNnox6fEei 1hPz4nzZHfo5D/Cexa8pDIfGEzO6bta9KTQSFpYPtoh4U+Ht8bGzC1aYU8ROkzu9Fk2o dCPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700299595; x=1700904395; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jDHUkFeUiZ95sNfG9WI8P/VDBC1XV4qMk7GmcffU3mw=; b=us/uyerMNlgVoBhKcXu/S+VFizpsnwfI+Ihcjlfs+p0z0QwOlQz5FZAP/D/Qh1Qsaz S8TkhRum/6qGJTaQ+GiSA3d3/hZwnwcfCW9Nm8sojDfM/0ob1lvy0/ZtZCasbw0Krza+ wP4E0In7wkBfQanQ1FQS8Wo2ObFy7zB8bHH+semnO3yDcEhCCoDmM38qRuV/MH82ikWZ Tc5emP/iW67up2QTUBr8h5YZs4aZkL2SUR4XFQhv3ZvMoVz63X1NROsbw2e1Bvrcit15 ZXADnKxK9GsOafb43tUSfiyFRgoXgyGte5VempbXGKWJFdA0ZKmAurgEXgVe/hojuTBf suOg== X-Gm-Message-State: AOJu0YynOEF/ZjayUcgBhyAZrBTMdBwHoqpwjhWKILIyjwB3cehx43B7 fh5Irvou9CZIyuzYm4RgrFJZ+JJTyCiqqkQNTPo= X-Google-Smtp-Source: AGHT+IEGYXUch+ckHJLagcaFiOarK2Uu7xlFqNKyIwqAFiFSW4Y3mCSnvCteY5sVWDMmg904mcaRbg== X-Received: by 2002:a05:6a00:1951:b0:6c2:c8d2:94de with SMTP id s17-20020a056a00195100b006c2c8d294demr2659461pfk.3.1700299595586; Sat, 18 Nov 2023 01:26:35 -0800 (PST) From: Akihiko Odaki To: Cc: qemu-devel@nongnu.org, Yuri Benditovich , Andrew Melnychenko , "Michael S . Tsirkin" , Jason Wang , "Zhang, Chen" , Akihiko Odaki Subject: [PATCH RESEND v7 06/19] tap: Shrink zeroed virtio-net header Date: Sat, 18 Nov 2023 18:25:46 +0900 Message-ID: <20231118092601.7132-7-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.42.1 In-Reply-To: <20231118092601.7132-1-akihiko.odaki@daynix.com> References: <20231118092601.7132-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: none client-ip=2607:f8b0:4864:20::42d; envelope-from=akihiko.odaki@daynix.com; helo=mail-pf1-x42d.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20230601.gappssmtp.com) X-ZM-MESSAGEID: 1700299767928100011 Content-Type: text/plain; charset="utf-8" tap prepends a zeroed virtio-net header when writing a packet to a tap with virtio-net header enabled but not in use. This only happens when s->host_vnet_hdr_len =3D=3D sizeof(struct virtio_net_hdr). Signed-off-by: Akihiko Odaki --- net/tap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/tap.c b/net/tap.c index 4d450d2972..7666ada8d9 100644 --- a/net/tap.c +++ b/net/tap.c @@ -119,7 +119,7 @@ static ssize_t tap_receive_iov(NetClientState *nc, cons= t struct iovec *iov, TAPState *s =3D DO_UPCAST(TAPState, nc, nc); const struct iovec *iovp =3D iov; g_autofree struct iovec *iov_copy =3D NULL; - struct virtio_net_hdr_mrg_rxbuf hdr =3D { }; + struct virtio_net_hdr hdr =3D { }; =20 if (s->host_vnet_hdr_len && !s->using_vnet_hdr) { iov_copy =3D g_new(struct iovec, iovcnt + 1); --=20 2.42.1