From nobody Mon Feb 9 23:40:43 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 16876584015531001.5713166419806; Sat, 24 Jun 2023 19:00:01 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qDF18-0001TT-Ve; Sat, 24 Jun 2023 21:58:18 -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 1qDF16-0001S3-ST for qemu-devel@nongnu.org; Sat, 24 Jun 2023 21:58:16 -0400 Received: from bg4.exmail.qq.com ([43.155.67.158]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qDF11-0002eu-Sx for qemu-devel@nongnu.org; Sat, 24 Jun 2023 21:58:16 -0400 Received: from ubuntu.. ( [111.196.130.174]) by bizesmtp.qq.com (ESMTP) with id ; Sun, 25 Jun 2023 09:53:36 +0800 (CST) X-QQ-mid: bizesmtp75t1687658016tv6qv425 X-QQ-SSF: 01200000000000E0G000000A0000000 X-QQ-FEAT: rZJGTgY0+YMqQUDvx2osxm4ozrjEuxxlQuvPjXf5FFA4zL0zuHpEK/l/Ogepg I3xFr6nDCKhzL3LZOE2xmCQmElKgj0WzIj29w7ETkhJX3zf6jtJ6Zn+t1ptyPSrKZmgwMeh VG2+G43jAThWzZS/pJOWIRZHKBqZZQV3wXuJP6yqpyCUMTZM6CMtUMhTpW41hhz38JEnuJ3 /YyUxnvYAkxTUJcL65pOHwZVmo1plRhT0gA0z+HqOg1bn3CIn+XM5MkMrNhPJaRXTRS6QiO slH1rYSsQ52BWVBa9pQ7jhgw9pI857J/0wjXqANP0VtgOJlLcB/VKwHTYsvxcL2+PUpdLvd V+Etz5iiY/0I+maUcnsc3FbjIN6v87HBNYjKKPI X-QQ-GoodBg: 0 X-BIZMAIL-ID: 7637265680048268552 From: Bin Meng To: Jason Wang , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Maydell , qemu-devel@nongnu.org Subject: [PATCH v7 4/9] hw/net: ne2000: Remove the logic of padding short frames in the receive path Date: Sun, 25 Jun 2023 09:53:16 +0800 Message-Id: <20230625015321.77987-5-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.155.67.158; 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: 1687658403584100007 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. Signed-off-by: Bin Meng --- (no changes since v1) hw/net/ne2000.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/hw/net/ne2000.c b/hw/net/ne2000.c index 3f31d04efb..d79c884d50 100644 --- a/hw/net/ne2000.c +++ b/hw/net/ne2000.c @@ -167,15 +167,12 @@ static int ne2000_buffer_full(NE2000State *s) return 0; } =20 -#define MIN_BUF_SIZE 60 - ssize_t ne2000_receive(NetClientState *nc, const uint8_t *buf, size_t size= _) { NE2000State *s =3D qemu_get_nic_opaque(nc); size_t size =3D size_; uint8_t *p; unsigned int total_len, next, avail, len, index, mcast_idx; - uint8_t buf1[60]; static const uint8_t broadcast_macaddr[6] =3D { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; =20 @@ -213,15 +210,6 @@ ssize_t ne2000_receive(NetClientState *nc, const uint8= _t *buf, size_t size_) } } =20 - - /* if too small buffer, then expand it */ - if (size < MIN_BUF_SIZE) { - memcpy(buf1, buf, size); - memset(buf1 + size, 0, MIN_BUF_SIZE - size); - buf =3D buf1; - size =3D MIN_BUF_SIZE; - } - index =3D s->curpag << 8; if (index >=3D NE2000_PMEM_END) { index =3D s->start; --=20 2.34.1