From nobody Mon Feb 9 16:19:24 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=1614798773; cv=none; d=zohomail.com; s=zohoarc; b=AMFjf1qCzFNKZz7dIpguCzWKG+RDg2E6xxr9YfrYJkjWrcoK3efYr7WOBJWQBAMJDiIRlvpQNytn/uowT/VMstawZ8vvONIXbEom/Pz+tRArEa5v+0Kcu0hf37Rw7EEYkRGh9PliOaKueWfj6OBxBSNnYUxmtd7zM5PEqx743oE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614798773; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=oQ53tkWrp+KNAV5jr5E0Yd+AAzWqxTKyNH3MXsvMcQY=; b=DNd5NFA6VlkhrK9T3v3qqz/atmSID3m/TpYXZxg0sfx8/wPPBTQo4knJTQKUhAANXaJ9uq8eKn2yIOCIt5UVbM1X+JkRzRREVE9cMKDAL0NY7TcrGiHtKvOjkJ5d+0FdqaBB/fab5QUCI9hmyHFBxu6LT3wB2/iikSwhAKihG6g= 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 1614798773053971.0967864249718; Wed, 3 Mar 2021 11:12:53 -0800 (PST) Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-430-cKKtimf5MEKWRkgoiFgYgA-1; Wed, 03 Mar 2021 14:12:50 -0500 Received: by mail-wr1-f70.google.com with SMTP id h5so4811762wrr.17 for ; Wed, 03 Mar 2021 11:12:49 -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 w16sm20019656wrk.41.2021.03.03.11.12.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Mar 2021 11:12:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614798772; 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=oQ53tkWrp+KNAV5jr5E0Yd+AAzWqxTKyNH3MXsvMcQY=; b=LmEsp2RvhV1S7jXt9EbRyQXwBu+q7S96RYArIDknEnr8thHPHXKWU8XWDiAJriucs576OG QoXmLjuO2iTWxwj0j4QwIpBOnr/RDwM67v3dyJM9XhNa0h8EaBwNwYHqWbi5Zs8o7y4rz3 6j3czl9jhCAUAe2m6LED+5G1TqxW+90= X-MC-Unique: cKKtimf5MEKWRkgoiFgYgA-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=oQ53tkWrp+KNAV5jr5E0Yd+AAzWqxTKyNH3MXsvMcQY=; b=nObw+EgQCCU8zGk0N76sRytggN+g6LJG52KFAwHqJo0pKyJJ5ZyW+BekboFYXhjV9L JMHPJ4zJoxp/7EorhKLWbPLwbEnrzKf7yV8Zw3hxpvPJY+bmJaeEjlgnYF4q4JejOJNg Rl+ieomF7rkmfJSRbD4ZypG8eSj38mAOIApXqugXV+9TJetQ1lYLjHl+eK/Ud6I2Rz4z 5WmwCfisy71C3z5zQb7pBr5vkJ8ORodcOnkQLlcHOUuHURQN2/5LUs83NJIjiAWsbGFa pL3U88UXB77AqkLvfkJQbQx18uY33/UmfrCc4PMBUsYyxQPO8pMkZEGm6PCcAuaYUPGt SBQQ== X-Gm-Message-State: AOAM531Zdb3q4ZHkwqPrGnbVpv+04wTuCV90cleLfDCYuc7R6asdFA0Y R9tZdsNkuy6wE4LLs69cNZKqxjbTJ8XVtETDLlc57sObMSQKFAXjNt/hSY37NUF+ymOLloSMJNk yekVjkkdm298W2Q== X-Received: by 2002:a5d:4441:: with SMTP id x1mr237385wrr.56.1614798768571; Wed, 03 Mar 2021 11:12:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJwHTDhfewwPm3ptxhLftX31Jg88sQIBIyES19/h2UGeP8kX83MU0iK2F7p74uwCS+h7MR0X6g== X-Received: by 2002:a5d:4441:: with SMTP id x1mr237359wrr.56.1614798768412; Wed, 03 Mar 2021 11:12:48 -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 08/10] hw/net: rtl8139: Remove the logic of padding short frames in the receive path Date: Wed, 3 Mar 2021 20:12:03 +0100 Message-Id: <20210303191205.1656980-9-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-8-git-send-email-bmeng.cn@gmail.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/net/rtl8139.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c index 4675ac878e9..cbfe29a2867 100644 --- a/hw/net/rtl8139.c +++ b/hw/net/rtl8139.c @@ -827,7 +827,6 @@ static ssize_t rtl8139_do_receive(NetClientState *nc, c= onst uint8_t *buf, size_t =20 uint32_t packet_header =3D 0; =20 - uint8_t buf1[MIN_BUF_SIZE + VLAN_HLEN]; static const uint8_t broadcast_macaddr[6] =3D { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; =20 @@ -939,17 +938,6 @@ static ssize_t rtl8139_do_receive(NetClientState *nc, = const uint8_t *buf, size_t } } =20 - /* if too small buffer, then expand it - * Include some tailroom in case a vlan tag is later removed. */ - if (size < MIN_BUF_SIZE + VLAN_HLEN) { - memcpy(buf1, buf, size); - memset(buf1 + size, 0, MIN_BUF_SIZE + VLAN_HLEN - size); - buf =3D buf1; - if (size < MIN_BUF_SIZE) { - size =3D MIN_BUF_SIZE; - } - } - if (rtl8139_cp_receiver_enabled(s)) { if (!rtl8139_cp_rx_valid(s)) { --=20 2.26.2