From nobody Mon Feb 9 09:34:40 2026 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; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1615882710; cv=none; d=zohomail.com; s=zohoarc; b=BQC7J7k0uO00o1wMd1pGB4t3Mra29FjVRCLHr0XuLmS9CIq8A5YVhngJKMqZo1atnksfdVyS45kCoT6dtn2qTqnGK5S1N3e7j5r4KzrbnfDjIkE2spAiFDf8SfJ+CMLRUFPsP2XiJmPwCntPbYHGoLrZer524Qb8EI31Eef5rkw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1615882710; h=Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=1LO77muo6uGLWBQ/Q1tDDogiUiNfdS9t/fgLwmMmfXA=; b=iiOY6NRetLizp2EfT+1a/NHX8aovFtnetmnMBsOqFr6cg1zbIIpqwG7vvXlBI2jImMKVVwnZeQORIfNo+yt+DpXuiAjFyqhckSVFN/N7wHjO0Pl+h45xtaX7FzjdDFVEXtagaIaigb4bKcI/+mMUyL5hVj6CX6LWhpI4fyqOhJ0= 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; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1615882710106783.9780395664673; Tue, 16 Mar 2021 01:18:30 -0700 (PDT) Received: from localhost ([::1]:57450 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lM4uH-0002Ak-VS for importer@patchew.org; Tue, 16 Mar 2021 04:18:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39550) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lM4pW-0002NH-EH for qemu-devel@nongnu.org; Tue, 16 Mar 2021 04:13:30 -0400 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]:40715) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lM4pT-0007qZ-If for qemu-devel@nongnu.org; Tue, 16 Mar 2021 04:13:30 -0400 Received: by mail-ej1-x636.google.com with SMTP id ci14so70454805ejc.7 for ; Tue, 16 Mar 2021 01:13:27 -0700 (PDT) Received: from pek-vx-bsp9.wrs.com (ec2-44-242-66-180.us-west-2.compute.amazonaws.com. [44.242.66.180]) by smtp.gmail.com with ESMTPSA id a17sm5620333ejf.20.2021.03.16.01.13.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Mar 2021 01:13:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=1LO77muo6uGLWBQ/Q1tDDogiUiNfdS9t/fgLwmMmfXA=; b=bDdORKXo13XUbF+z//V7tp0ep5qiMpooFaIhljlbb1LCJJICEJYSiHddR8xQID5uc4 TFAl3SSsJLtvVBRyPQC6AaMFAcFpkgGUzTkaiMZKqKeDsvoVnY9PdTTQNoP8j4qS5qEx N0X2AsG7Hh/ieaM/veepI03TLi+AWEDwO6TJFgcaKI8eNjMEJ2rG0YFqj1XixNx1Wt/C XmYLUOtQJ/P+gT//Jr55HxWC7aWV2MArYgacWjvKmykTWI1cJ0spQdiNXTsurGGliV3T eXgoq9pNH+ZqJgPEoQajhKM1XHBEhYjau80ZvbMq6UARnrz6D82tppYo5byTN5smTyZG oaKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=1LO77muo6uGLWBQ/Q1tDDogiUiNfdS9t/fgLwmMmfXA=; b=D9C3IA5L8MeoTYXAaniqLygF7EWY+zKKShqwoId+XrMJPHnjHSAz9LBotuQ9prMIlg NcuOZD6Mce7heL+d7P82wKuOlYJ+YXAU3uv+Uv028uacluN8K1ohbBg2FugBhDepuceU TMsMbocVMI9sK0lupK7k0hR+9RXbex2S9Z2/LazuSIk26NM9z3nirkdYBN0aJcUUJeyM RoG3aml/8nwjGPcstWV59XyotiPr6W/n12qqkOwyZg3BQKb/Pv31VLxswSEk3jBWzNbg t5DW/pV4JJgvfg8cWVzZSe7iOpBY8Od+irlxdkJzxPoVQuFxwdd/5UffBpYw/caAKIy4 FDkQ== X-Gm-Message-State: AOAM533HMT3wh+RPCBx95XEP2mG8cUqOPb69ieNZOQbPiOvTE84hImai oeH5+lygqb57YCDY4QL0bBw= X-Google-Smtp-Source: ABdhPJyOVGYZNZNr5nOuPCqmuVNDC46BS9+QFEzk5W1+84YKG03vz525PZto3BJzUIXYCxtMm5lctQ== X-Received: by 2002:a17:907:76bb:: with SMTP id jw27mr28079290ejc.366.1615882406305; Tue, 16 Mar 2021 01:13:26 -0700 (PDT) From: Bin Meng To: Jason Wang , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Maydell , qemu-devel@nongnu.org Subject: [PATCH v3 06/13] hw/net: e1000: Remove the logic of padding short frames in the receive path Date: Tue, 16 Mar 2021 16:12:47 +0800 Message-Id: <20210316081254.72684-7-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210316081254.72684-1-bmeng.cn@gmail.com> References: <20210316081254.72684-1-bmeng.cn@gmail.com> 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: pass client-ip=2a00:1450:4864:20::636; envelope-from=bmeng.cn@gmail.com; helo=mail-ej1-x636.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 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" X-ZohoMail-DKIM: pass (identity @gmail.com) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Now that we have implemented unified short frames padding in the QEMU networking codes, remove the same logic in the NIC codes. This actually reverts commit 78aeb23eded2d0b765bf9145c71f80025b568acd. Signed-off-by: Bin Meng --- (no changes since v1) hw/net/e1000.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/hw/net/e1000.c b/hw/net/e1000.c index d8da2f6528..a53ba9052b 100644 --- a/hw/net/e1000.c +++ b/hw/net/e1000.c @@ -882,7 +882,6 @@ e1000_receive_iov(NetClientState *nc, const struct iove= c *iov, int iovcnt) uint16_t vlan_special =3D 0; uint8_t vlan_status =3D 0; uint8_t min_buf[MIN_BUF_SIZE]; - struct iovec min_iov; uint8_t *filter_buf =3D iov->iov_base; size_t size =3D iov_size(iov, iovcnt); size_t iov_ofs =3D 0; @@ -898,15 +897,7 @@ e1000_receive_iov(NetClientState *nc, const struct iov= ec *iov, int iovcnt) return 0; } =20 - /* Pad to minimum Ethernet frame length */ - if (size < sizeof(min_buf)) { - iov_to_buf(iov, iovcnt, 0, min_buf, size); - memset(&min_buf[size], 0, sizeof(min_buf) - size); - min_iov.iov_base =3D filter_buf =3D min_buf; - min_iov.iov_len =3D size =3D sizeof(min_buf); - iovcnt =3D 1; - iov =3D &min_iov; - } else if (iov->iov_len < MAXIMUM_ETHERNET_HDR_LEN) { + if (iov->iov_len < MAXIMUM_ETHERNET_HDR_LEN) { /* This is very unlikely, but may happen. */ iov_to_buf(iov, iovcnt, 0, min_buf, MAXIMUM_ETHERNET_HDR_LEN); filter_buf =3D min_buf; --=20 2.17.1