From nobody Wed Nov 27 20:38:44 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=1697378698; cv=none; d=zohomail.com; s=zohoarc; b=VAaBrowzKH7DeN2lyunf20VOnY/ANXcvCG/XBaSd4OQP0Vdw7QMyPEXMwJ/yHaVb1ekiZ69e8K2QVeok3diui0gTFIUeXtC9sOpPh5GsJhhmZDflMQyWdk/FlIgekoOGekVAcTXplvHl8c+NkjMnEctQ1sB/7RD3w0YCLk++/6g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697378698; 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=hdRn3xY+r+zZRoAOUO1YfZyC5ZVoV18TeJ1QBbbHIlQ=; b=aNX7EPG6tQ+JP1BGM0z3e7pc6c+6g39Op+VKvH48aYJU/gcjB4f8cU7hPF45uulseu75XR9o2bK5ZAfouZUrDrE9EgssS84DXxmqOZ5dMxo7TjBMSi1NAObNyDk26/Tlqs6FeaOAgs5I8ap80wgf/O/ANQ9GNz0dqrepYoZBzF4= 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 1697378698553141.64760250306438; Sun, 15 Oct 2023 07:04:58 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qs1iS-0001Rx-I7; Sun, 15 Oct 2023 10:03:36 -0400 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 1qs1iQ-0001RL-No for qemu-devel@nongnu.org; Sun, 15 Oct 2023 10:03:34 -0400 Received: from mail-oo1-xc29.google.com ([2607:f8b0:4864:20::c29]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qs1iP-0007kT-Az for qemu-devel@nongnu.org; Sun, 15 Oct 2023 10:03:34 -0400 Received: by mail-oo1-xc29.google.com with SMTP id 006d021491bc7-57b8cebf57dso1973782eaf.0 for ; Sun, 15 Oct 2023 07:03:33 -0700 (PDT) Received: from localhost ([2400:4050:a840:1e00:78d2:b862:10a7:d486]) by smtp.gmail.com with UTF8SMTPSA id f15-20020aa782cf000000b0069102aa1918sm16416405pfn.48.2023.10.15.07.03.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 15 Oct 2023 07:03:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1697378612; x=1697983412; 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=hdRn3xY+r+zZRoAOUO1YfZyC5ZVoV18TeJ1QBbbHIlQ=; b=uy3JE+Alu+/Lnx86CTO/o2EWQeeCYpMYwMpKRq2mpQegZqdigqhE0VzZ24GdcRHxC8 jCixxU7llg/Wachu6D6rumZpyIy04Hcjt6jGTtJv/7l29VLmu8hnFOOlJ5lHJJER2Gaz 4lKyCvLPoQelRyqnjkgVeBn0HbfTJ4VulwtkC/gPzfX6ILEJFs3c5Db87CX/EKF0UBNg lkL9gLqYBGtwG1Ea9o+8BGqveTkF0n5TQsdKmwFPGQE7Z27kpfuXLQdbe+2ivqB1OGfO Hww23epMyKyghnNF+YQNme5z3PTgjJiylFTZ2syl+2aPHv+9IA/PDeyCRO+5d3Em7Gjc l+LQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697378612; x=1697983412; 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=hdRn3xY+r+zZRoAOUO1YfZyC5ZVoV18TeJ1QBbbHIlQ=; b=JHR+6HlRmUE3LJANLRCMvnSpTJw8G1wXmBulUgbOPKouUWYn6YMluQwD212VLXlP6W PTNQ4AmPnGnW+JrYOlFl/LrvkSGAJO7+b2IPxAbTF9rDw7W/YqVFOr0pT0kQYzTwMt5y BcT+ArZRN0JfPmNCFlcLB/uwXjFb5aVNFzc4KJPH47dyvZGpppRT/6DkAZVYAI7U1Epk mOqJjBexMMw0d/U/r1j2bvLmzD1rvypvDkHRHEQ1vPd8ac3SVSpz5zgAsyfGCdRGpkES 63PfYKR+QyTnz7Ugbq/HXbf/4OAFCm7aeSVdEvXqJEIQpK14+jasr+f5Ee9Gnx83TduW wckQ== X-Gm-Message-State: AOJu0YwDXpdrtcf4XnpAJmDiIzDXyQlqmcTJKjlOXOcjCuo3KwhaWxUg r+ntjSasJKh5/3zkcYZF8zlOCVI2SGnq+MadXaK93Q== X-Google-Smtp-Source: AGHT+IEKYAyYuFMC6/Ir2UJ4kE1LWPm/EqfAwxvdRlP76WZg4D/GXHZkzpnJs6fJsjMpbNG6Z9zxKQ== X-Received: by 2002:a05:6358:590a:b0:14c:92ea:b4ff with SMTP id g10-20020a056358590a00b0014c92eab4ffmr35963426rwf.6.1697378612265; Sun, 15 Oct 2023 07:03:32 -0700 (PDT) From: Akihiko Odaki To: Cc: qemu-devel@nongnu.org, Yuri Benditovich , Andrew Melnychenko , "Michael S . Tsirkin" , Jason Wang , Akihiko Odaki Subject: [PATCH v4 07/20] tap: Shrink zeroed virtio-net header Date: Sun, 15 Oct 2023 23:02:39 +0900 Message-ID: <20231015140259.259434-8-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231015140259.259434-1-akihiko.odaki@daynix.com> References: <20231015140259.259434-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::c29; envelope-from=akihiko.odaki@daynix.com; helo=mail-oo1-xc29.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 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: 1697378700163100003 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 668d69c0de..4c1eb92076 100644 --- a/net/tap.c +++ b/net/tap.c @@ -118,7 +118,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; struct iovec iov_copy[iovcnt + 1]; - 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[0].iov_base =3D &hdr; --=20 2.42.0