From nobody Mon Feb 9 20:10:51 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=1614798808; cv=none; d=zohomail.com; s=zohoarc; b=A1qQyM2ahqKY5mqjhqSWU2vrooF7EYfaddk2QezIcK2cnFXgaQAPHfdMtTAzeWMPJ2Zf/eWutEmhHH+eAjueHpn0LSEBMJw3FsY3N1LaSm84ylfr+hdSPOlE7usmC5k1gfalzs3Aq0jfvQJO7Am2Szqvyu3aBr2gD297UuwWBmo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614798808; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=A+1d1LK3/7O/279IVj+Ph/XHu1RN+wl0D3hJoCw8j8k=; b=H2b0NnToNmbkTUOFAcK57wV8hVUYfS1vwmfUH/LB/bSWpMr1zbKwN0hYINsa0sf+zdYHVMof6A85tum3KIxgcxeQVz5RFB94J7L9qY+8jzanQ57S8jwAv5PmVaz7C5gYLgQmTpgptM7p2HctgbpOSvJ+GktL4k/UQclph50qgZc= 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 1614798808374459.51057777724327; Wed, 3 Mar 2021 11:13:28 -0800 (PST) Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-566-cC4giK5kN7mFmonrqL62pg-1; Wed, 03 Mar 2021 14:12:55 -0500 Received: by mail-wm1-f71.google.com with SMTP id q24so3445973wmc.1 for ; Wed, 03 Mar 2021 11:12:55 -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 f16sm32286601wrt.21.2021.03.03.11.12.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Mar 2021 11:12:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614798807; 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=A+1d1LK3/7O/279IVj+Ph/XHu1RN+wl0D3hJoCw8j8k=; b=USDhtXk/bB0Z0KYBeYEy/d7C8W2H7RXv5JMARAqXsYGMAIV8W/5zhQAaUDaHodQZevvdJ+ JegssX5dC6FqtIG/qQ4tdkgQdT89V+d90Zbe0IC+UkUfIxW+wpTSaGLJSvmwnblNSGLQoR 91XTJCHpqed3sI4difki0tKCOclTeDg= X-MC-Unique: cC4giK5kN7mFmonrqL62pg-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=A+1d1LK3/7O/279IVj+Ph/XHu1RN+wl0D3hJoCw8j8k=; b=ahoS+Hr97SP1FzsHOVLfFnB2eMq9/w5FAG/iTGik8rB3VBXMjideU8fM3iwbwARUeE lpCHLDOBecdLP6T4w1s1ObeYVlIVUUPrdRQV/lHupxJSugBmbemkcpK4PRGvwHZ/pnnb UtONBLsWAgETc7oOxptKzZNIN3X73o2HTbLd64jHchqf87EN5J9CDevJ9FgnjOVLWynp axj2Wl5GIGJZqXidnA5K54x6icMaxCeE2AScgsGVR967VQjg+QZ43vNXpiroHLOqfIuy 9NIovREWLWjWHKMZU44Lsino1CLEIyIvXhjH4HMYcNIV+NKLnAlOLW9mifUB3iftogjy 3AZg== X-Gm-Message-State: AOAM5321htkBpKn/x5/YvG3d6UczW48wI8tsMFjrwR6R2qUFLEgrySOs fu1C4G/UPe8rj1wQLlNKzYf86EFpU2DoyDIPs2iKQUXxNEbyIuElDMfSNmPeGMHfUUXabwdL1Ho Tinbz9smMDsjaUQ== X-Received: by 2002:adf:a3d3:: with SMTP id m19mr243072wrb.24.1614798774332; Wed, 03 Mar 2021 11:12:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJwDgbCUusOf8YtEWk8TzhlZX/nvR+AqM92YsE96kKHqIJ7afW6SvKWRzcLx5UhuRTsivyFi0Q== X-Received: by 2002:adf:a3d3:: with SMTP id m19mr243062wrb.24.1614798774227; Wed, 03 Mar 2021 11:12:54 -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 09/10] hw/net: sungem: Remove the logic of padding short frames in the receive path Date: Wed, 3 Mar 2021 20:12:04 +0100 Message-Id: <20210303191205.1656980-10-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-9-git-send-email-bmeng.cn@gmail.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/net/sungem.c | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/hw/net/sungem.c b/hw/net/sungem.c index 33c3722df6f..3fa83168db0 100644 --- a/hw/net/sungem.c +++ b/hw/net/sungem.c @@ -550,7 +550,6 @@ static ssize_t sungem_receive(NetClientState *nc, const= uint8_t *buf, PCIDevice *d =3D PCI_DEVICE(s); uint32_t mac_crc, done, kick, max_fsize; uint32_t fcs_size, ints, rxdma_cfg, rxmac_cfg, csum, coff; - uint8_t smallbuf[60]; struct gem_rxd desc; uint64_t dbase, baddr; unsigned int rx_cond; @@ -584,19 +583,6 @@ static ssize_t sungem_receive(NetClientState *nc, cons= t uint8_t *buf, return size; } =20 - /* We don't drop too small frames since we get them in qemu, we pad - * them instead. We should probably use the min frame size register - * but I don't want to use a variable size staging buffer and I - * know both MacOS and Linux use the default 64 anyway. We use 60 - * here to account for the non-existent FCS. - */ - if (size < 60) { - memcpy(smallbuf, buf, size); - memset(&smallbuf[size], 0, 60 - size); - buf =3D smallbuf; - size =3D 60; - } - /* Get MAC crc */ mac_crc =3D net_crc32_le(buf, ETH_ALEN); =20 --=20 2.26.2