From nobody Mon Feb 9 07:42:06 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=1615372199; cv=none; d=zohomail.com; s=zohoarc; b=NSZ4kKY2uN763vl+b9NVvEzKXgMfNg3U4QNAWNRoGmYGNAFbx18wMTQj13KsQu5+J0E1ffj3yq+LGPlapLEOW+85pcC+HzLfxUgUobwge2m9bsxuCARrbbaPt0oT3/Nh3SLRwrbgUgawORPvKNVnP5HgILPD5oHEEVb3r9xqDP8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1615372199; 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=WWiBc7WA3O2AVkpTLFlp8tq2hPGcdq5p9G8byDecpz8=; b=OcljyznhJI/Wt4r1pnrsWgYWuWfuNHNNqsdMsclGLyvPxht9bRUwJlB6ZOJG+IEPFcB+Jzeleiwvh2rFX+rVrusbZGa+GMvPHFSmIIilMPXgys1MUIqXuYVwVyvcUCMXHIqiX2O4b2Yx/SGb+hhVOe5N8VZOwYJPuv6c0ux1p9Q= 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 1615372199791284.9047700330261; Wed, 10 Mar 2021 02:29:59 -0800 (PST) Received: from localhost ([::1]:35086 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lJw6I-0003g9-IY for importer@patchew.org; Wed, 10 Mar 2021 05:29:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:33702) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lJvpT-0001D7-PI for qemu-devel@nongnu.org; Wed, 10 Mar 2021 05:12:35 -0500 Received: from mail-ej1-x631.google.com ([2a00:1450:4864:20::631]:35148) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lJvpS-0006zz-4l for qemu-devel@nongnu.org; Wed, 10 Mar 2021 05:12:35 -0500 Received: by mail-ej1-x631.google.com with SMTP id dx17so37544996ejb.2 for ; Wed, 10 Mar 2021 02:12:33 -0800 (PST) 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 n26sm5966864eds.22.2021.03.10.02.12.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Mar 2021 02:12:32 -0800 (PST) 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=WWiBc7WA3O2AVkpTLFlp8tq2hPGcdq5p9G8byDecpz8=; b=KFinxy9fkf4RtTGdQqrrmuzJ+5v8L/NxL9Z9YyWsYu4DWA6mpdHA1KUvm/UwCgp5Q7 rvyI0ZaNJv4A5MedHOtdRU28EqdWBJg7lRSEjKzoBHZPWBwbhfgBDGCeMZVjJMpKPNki AawNkmRpRbXxrDxYaPBO7MfD/z4ZTpw6s5e/vwdXKCNQibWiXfr6hnM7GixwnHrTBoUF 1IXFV3j/w5dQIcvvFD0uZc6m0LGExkR+JEBC591z2Q1vuEZmG5RuRL7+VEVdNSrIs8+d uJkFEgOdoySfi+tokTllSYuf5xGASXJoTOK+bR1Y/gKCJKq3DFnc05xiuyFELzDQ7Hu3 SjGQ== 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=WWiBc7WA3O2AVkpTLFlp8tq2hPGcdq5p9G8byDecpz8=; b=J0EUBjHhTS/CSVawtHsyyjE3sIEXu6KrqdvMnLGa8l3Z17teBW9zILuyoMVwnVOpln kW4eyg7pul5WRbF61gIUDcjRO+zuXTVIrL3Tjg8wpqu/7Wg3+O8EF3k8HbuytUyavIDO A/U/vVkjatKammILXL8PhyMhBK/wPHxpJB87tdUxubZEGKCH4DtPhAuPCTSnEvdpSzX2 f1mzFf4uTcK8YQRrD3naM1Y97ahi2rDWjFhB87VxmOTOvmuVDRtmzD8vVW6jlIGhnoWD FwhepWRjC0R74WK6SLygH7O1B4VCO8MV0kCoagcVXC3gQDwzy2VeWfGe3I0KFGkmTL07 6Ihw== X-Gm-Message-State: AOAM533BUxsbYQwcqkQjwumPBKi8gNp6yw83LEL862ac5QoeL8K7JzS1 QEehfllrE31UBKwULfyGIxI= X-Google-Smtp-Source: ABdhPJzRqWoxoEaxPvWiOnnKfuNzIy1Fve2IdZ3ok/+o0JEzjsL+sUpHGAIm3VmEuu7jiqUKUIswIw== X-Received: by 2002:a17:907:162b:: with SMTP id hb43mr2887031ejc.41.1615371152884; Wed, 10 Mar 2021 02:12:32 -0800 (PST) From: Bin Meng To: Jason Wang , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Maydell , qemu-devel@nongnu.org Subject: [PATCH 07/10] hw/net: pcnet: Remove the logic of padding short frames in the receive path Date: Wed, 10 Mar 2021 18:11:54 +0800 Message-Id: <20210310101157.15136-8-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210310101157.15136-1-bmeng.cn@gmail.com> References: <20210310101157.15136-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::631; envelope-from=bmeng.cn@gmail.com; helo=mail-ej1-x631.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. Signed-off-by: Bin Meng --- hw/net/pcnet.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/hw/net/pcnet.c b/hw/net/pcnet.c index f3f18d8598..16330335cd 100644 --- a/hw/net/pcnet.c +++ b/hw/net/pcnet.c @@ -987,7 +987,6 @@ ssize_t pcnet_receive(NetClientState *nc, const uint8_t= *buf, size_t size_) { PCNetState *s =3D qemu_get_nic_opaque(nc); int is_padr =3D 0, is_bcast =3D 0, is_ladr =3D 0; - uint8_t buf1[60]; int remaining; int crc_err =3D 0; size_t size =3D size_; @@ -1000,14 +999,6 @@ ssize_t pcnet_receive(NetClientState *nc, const uint8= _t *buf, size_t size_) printf("pcnet_receive size=3D%zu\n", size); #endif =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; - } - if (CSR_PROM(s) || (is_padr=3Dpadr_match(s, buf, size)) || (is_bcast=3Dpadr_bcast(s, buf, size)) --=20 2.17.1