From nobody Tue Feb 10 02:48:49 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1614798769; cv=none; d=zohomail.com; s=zohoarc; b=PjXcOKYStcNAcWg8TZusL0OEkfyWp0PMrDvY12xZaEAmGz1NQzmlOhjz/j05yUoeEZUagkQdjnSUPD70fIXuVlRgN/U2KnuNBW4TD6eG7JkxKajSEy7TxpFsshv6jBKh+L1ko57bJtmwACWICuBGhfpL6rgDqzVhCOPRYpydpFU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614798769; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=CouKFTwLkgo/uu4gqqm3VLXBNVa87X4zwN26JBMF5/w=; b=b7RQE8jaYmHNmxz/oBDCj55w1YnamvuI/kdi4T/8Zi6VyJs1sskvNUAB8j/mJpSBn6PHAPCFJ9kYGM62avdMM1VoSEr7xxt19EfZGI21Yc2Mrj5DwjfSNUDnRPcudq6VTeawblya1prPIVl/BrAd5Wc2vKZvAEjGT2AgG9OBdpg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1614798769739426.711213646915; Wed, 3 Mar 2021 11:12:49 -0800 (PST) Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-166-oU_v5LSxPP2s1bzLJ4tJKA-1; Wed, 03 Mar 2021 14:12:45 -0500 Received: by mail-wm1-f72.google.com with SMTP id p8so3433678wmq.7 for ; Wed, 03 Mar 2021 11:12:44 -0800 (PST) Return-Path: Return-Path: Received: from x1w.redhat.com (68.red-83-57-175.dynamicip.rima-tde.net. [83.57.175.68]) by smtp.gmail.com with ESMTPSA id c184sm5706813wmf.28.2021.03.03.11.12.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Mar 2021 11:12:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614798768; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CouKFTwLkgo/uu4gqqm3VLXBNVa87X4zwN26JBMF5/w=; b=iE/iJHEsrrr87QYik3pen14Begh76ECjQNafc0KWyGRCv++JFSj6XUk4QUiYos8pFWu2uV YrXJCOj4XOKXf/OdLOSJ1ftVLjfjZFjqSBKrkoXPPRBZ7bJBD3Iw38z3Mrr5zttf3pZJ2T 0Gjbt0vbNuJnQPbQPT5Wug50vfCoCV0= X-MC-Unique: oU_v5LSxPP2s1bzLJ4tJKA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=CouKFTwLkgo/uu4gqqm3VLXBNVa87X4zwN26JBMF5/w=; b=s55Dt5Q2f6mVw9Fs4HhpAeU0MKnaEQmE7hp9K+DvOCtOTWvKPMrV3Q3QUCXYgXdD5J gS9SH9QWvajshTfnpd0ZO0R62y2+YjXpoEpfNFOGvbY6NEr5M1eaa7LtfF/6RAqVE3Jk Xcd5dCvP24QKqmPmBj5K69EXVtmHUbCPst8jw79IAwReLo6QR5Mo+OGD5ADfOBav8/eJ UusL7VEVgACtT44JEH7ZySI5+f0k+I3qIfGKnkzmrgbSRkCJOEYwyYSuPy14B/HvxgKe mdAtx94K1gxocW6lR2ImJPW6BDdJvzGT2GV759VcRBIit059ea/cwZAZAX7hTp7Rb/5Z u3jA== X-Gm-Message-State: AOAM530CjuZBjp6a814HCI6o7HuIDRclabqifFqFqcjA2+immr29WCfM pDSOirEQldmOYzLNGJ41GPnyxPQIe8kyZLRr87vRdC69xpPMAzDPms5MLB/wE6BNuwldHRqYeda OEymstX7NwXzPIQ== X-Received: by 2002:a05:600c:190a:: with SMTP id j10mr434489wmq.140.1614798763735; Wed, 03 Mar 2021 11:12:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJx7KjNPYS7LmJ1FqpfG69PqrQf7LLPtRfa5i5RiOdU8sfsXXZsOLrYJYu5YQg7rrpKBCWEYcQ== X-Received: by 2002:a05:600c:190a:: with SMTP id j10mr434483wmq.140.1614798763615; Wed, 03 Mar 2021 11:12:43 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jason Wang , Bin Meng , Dmitry Fleytman , Peter Maydell , Richard Henderson , Bin Meng , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [RFC PATCH v3 07/10] hw/net: pcnet: Remove the logic of padding short frames in the receive path Date: Wed, 3 Mar 2021 20:12:02 +0100 Message-Id: <20210303191205.1656980-8-philmd@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210303191205.1656980-1-philmd@redhat.com> References: <20210303191205.1656980-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) From: Bin Meng 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 Message-Id: <1614763306-18026-7-git-send-email-bmeng.cn@gmail.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/net/pcnet.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/hw/net/pcnet.c b/hw/net/pcnet.c index f3f18d8598c..16330335cd2 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.26.2