From nobody Tue Feb 10 01:34:46 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 1687658414957945.4646451049149; Sat, 24 Jun 2023 19:00:14 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qDF1A-0001Ty-4S; Sat, 24 Jun 2023 21:58:20 -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 1qDF17-0001T0-Ua for qemu-devel@nongnu.org; Sat, 24 Jun 2023 21:58:17 -0400 Received: from bg4.exmail.qq.com ([43.154.221.58]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qDF13-0002gb-LF for qemu-devel@nongnu.org; Sat, 24 Jun 2023 21:58:17 -0400 Received: from ubuntu.. ( [111.196.130.174]) by bizesmtp.qq.com (ESMTP) with id ; Sun, 25 Jun 2023 09:53:26 +0800 (CST) X-QQ-mid: bizesmtp75t1687658007tv6bb3zl X-QQ-SSF: 01200000000000E0G000000A0000000 X-QQ-FEAT: I8hG9CuxGDLj7f4kG+0v55Try3Xz/Qm/c1u8+oSHIswUBrydTMnbZ17wA27ZD kXXaYhJrDDLADbVlx2wAQcA/j5FaOyZcNR1azOy+Ao3Ot8TUWYTf0P8v6/Oku+cJFkHyyJG CuWDd5k3yX7o0oJxZ3KzFNunKR9gaPmK3f2ZyaXGRabuYpyt6CJTySLy2ub9UmS0FWT+C8p uMhgTnsi+mI5mzrWMuMuabqVVHDvLoLMJGN7QA4lRWk5bwUQxm4ULVonp8bS8202fKWaeET OB7K78pmCAblrBbewb8dpPkUz9swPaTldKrEbBQ9UWx78Me8LnZYeTtl452fBnXj6umE7x0 WIMnpuNX0P9F1ksWMAR8rzCx4MGErI+E1blveML X-QQ-GoodBg: 0 X-BIZMAIL-ID: 3478616648788255297 From: Bin Meng To: Jason Wang , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Maydell , qemu-devel@nongnu.org Subject: [PATCH v7 1/9] hw/net: e1000: Remove the logic of padding short frames in the receive path Date: Sun, 25 Jun 2023 09:53:13 +0800 Message-Id: <20230625015321.77987-2-bmeng@tinylab.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230625015321.77987-1-bmeng@tinylab.org> References: <20230625015321.77987-1-bmeng@tinylab.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrgz:qybglogicsvrgz7a-0 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=43.154.221.58; envelope-from=bmeng@tinylab.org; helo=bg4.exmail.qq.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL=0.141, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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-ZM-MESSAGEID: 1687658415354100001 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 aae5f0bdc0..093c2d4531 100644 --- a/hw/net/e1000.c +++ b/hw/net/e1000.c @@ -888,7 +888,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[ETH_ZLEN]; - 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; @@ -905,15 +904,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.34.1