From nobody Tue Feb 10 00:00: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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1688720902; cv=none; d=zohomail.com; s=zohoarc; b=NIFH+gKMZcprNFy0TfZX+RoCUf94kDWh/j9rKv0i4xn1wzloh+YHbfK/CYXxre61M6CkakiXkvZHLoEQ7CR7dHncyD29/mzdVTue64kivcGxt/Ge2c05nQ14/uBXHZmL1zZZnUAZ36Q7W936S00lhyvesysoX73TqXLpumyOu8c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1688720902; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=dsTRxnZLeEzlIQUh5QSCFuJ8O6YZUv7LXUQmAjXBlrU=; b=C59dJn9rnnD69XYJx61EaKhuLraEsiqcpBywcHm7oP9e9Lj/Q6mhjP+4lWwx83R1fROY2W/qHu+RSKSKvUZOasL3Zq6a/GBf7ntbnxWX3i/1cGSFZUW8/G+/chL5LGOcVjxCJQ1EPLZmcy5rvASMWuVm/+oZbuvRhnSRaUWjMQA= 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) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1688720902378433.0315833690188; Fri, 7 Jul 2023 02:08:22 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qHhQa-0003Bg-IH; Fri, 07 Jul 2023 05:07:00 -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 1qHhQY-0003BL-F2 for qemu-devel@nongnu.org; Fri, 07 Jul 2023 05:06:58 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qHhQW-0006dn-WC for qemu-devel@nongnu.org; Fri, 07 Jul 2023 05:06:58 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-657-qml3DxZpMNS7_EyzW3gttg-1; Fri, 07 Jul 2023 05:06:53 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id DFEEE1C4FD82; Fri, 7 Jul 2023 09:06:52 +0000 (UTC) Received: from hp-dl380pg8-01.lab.eng.pek2.redhat.com (hp-dl380pg8-01.lab.eng.pek2.redhat.com [10.73.8.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id B6D011121331; Fri, 7 Jul 2023 09:06:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1688720816; 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: in-reply-to:in-reply-to:references:references; bh=dsTRxnZLeEzlIQUh5QSCFuJ8O6YZUv7LXUQmAjXBlrU=; b=GqQ1hF0Mb4rQD4DJ9xts6xVbtp1vaJLLkkqA5GG2nWvo62OKVJQTlJNoezGSxPSgHY92rK BWPGRXyOPoNAXqyKzrkB0jSchOSK/FV0UAA8G3cTdKx8rbzMWNJa6MDT+pl08Q7ZluAHQw ILYqvJXd4C3nreC5bSw/yVDlhnwyIak= X-MC-Unique: qml3DxZpMNS7_EyzW3gttg-1 From: Jason Wang To: qemu-devel@nongnu.org, richard.henderson@linaro.org, peter.maydell@linaro.org Cc: Bin Meng , Jason Wang Subject: [PULL 07/15] hw/net: rtl8139: Remove the logic of padding short frames in the receive path Date: Fri, 7 Jul 2023 05:06:20 -0400 Message-Id: <20230707090628.2210346-8-jasowang@redhat.com> In-Reply-To: <20230707090628.2210346-1-jasowang@redhat.com> References: <20230707090628.2210346-1-jasowang@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 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=170.10.129.124; envelope-from=jasowang@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1688720904180100005 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 Signed-off-by: Jason Wang --- hw/net/rtl8139.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c index 5f1a4d3..b4df75b 100644 --- a/hw/net/rtl8139.c +++ b/hw/net/rtl8139.c @@ -826,7 +826,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 @@ -938,17 +937,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.7.4