From nobody Mon Feb 9 21:21:45 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1614798748; cv=none; d=zohomail.com; s=zohoarc; b=VhSusGdlcNUsupSo8twbAQQ3Fg7NfWaSrP9IYJRjRO0f18rN249+Nd4s6GHZ50JRWzSDjJfOUdKuUlWgAowiOXpRquGjutcJ3Ln6gI7uzVbHGttGcbzk7tmx4COtBBm6pLwdYEbBV+EoQVnWAC55lej453R4yp/wFlHBX+vB3Nk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614798748; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=rkUBN+Qyzi1lTxDF0XgYdWokUl6SLdP1HYpG3c36ims=; b=evFKFPI2CZl9BxPcLZIdELDN5MWrLrZnR/30CsWE/Yk+XyWmdivrdObzRfrzBCO9Q61v/GrO4yd1fJGve0wrzdrj62Oeh1Dogudya63v1F4MjbuPizJr/K37bbYhsOEhQScRJ6YWxMEhIo+n+qFrk8ndjvJaGIYlfoS1wg5dz08= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1614798748848661.3594843475037; Wed, 3 Mar 2021 11:12:28 -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-529-6fsF8Y1VPGyXqAVm2F-RFw-1; Wed, 03 Mar 2021 14:12:24 -0500 Received: by mail-wm1-f72.google.com with SMTP id z26so3435346wml.4 for ; Wed, 03 Mar 2021 11:12:23 -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 a6sm8828062wmm.0.2021.03.03.11.12.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Mar 2021 11:12:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614798745; 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=rkUBN+Qyzi1lTxDF0XgYdWokUl6SLdP1HYpG3c36ims=; b=IfrY/C6kHmjT8jg5Sp30GA8xwOL+lGMu/8SHCKIzw7zk/91CbTJFICHRzqdcBnBsAZJA4L vHl7zzkRQvWIQfA2kID0JO6zkSR7jp2+GK8SmYWWdSdl6t1CT+7IDXjktciCICMCFl0A/l AKTaqAF2m+QfrJyXwAG43Z8whp4A7g0= X-MC-Unique: 6fsF8Y1VPGyXqAVm2F-RFw-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=rkUBN+Qyzi1lTxDF0XgYdWokUl6SLdP1HYpG3c36ims=; b=BpkpMFOs7xOqGRvJzbK71MokYnXbkcZBltVAqh3q7onLsgCYmEit7+2SZtNa7Gv6+k bN+lH8Jv4ACihfsz9sG/KW4Oz556sBFl/cy6we//aoZFY2l1oTC+Qh6EY8AkBMvSnwsh LaBF3lGOUBxlGgoPpHSWDRsVD/f3YcrcK2niHPs0H2jWU6CGPoPns+NsBSmWM4zCddZJ 8KcZ8nb9CQG1u8X0W94b0qL61k8nOOm1yDabFqhi9cU4rj8LlzoIFBKwfVtHpnlSbl+Y YI9SLuAEkk0v4sKhd1uk4T6cNfgyxmrA1g6CR2OU5udKJJ65AOAwONEi4ETMRRTBKSPl mHuQ== X-Gm-Message-State: AOAM533RsEX2mDG02ogTcZ67G45OnYSqQV233Us4HtrJoisXFdHJKOWr MPhnCEehYiD1HkeVcEHBI9mHgEFBCVarqVxsYkuqihGo59h3Y4cxhjYEUGOonvruH5SiERo57VB qxs+Pb76xuKe5cg== X-Received: by 2002:adf:d20b:: with SMTP id j11mr81821wrh.397.1614798743053; Wed, 03 Mar 2021 11:12:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJw0fJ17F+T3MrMvg9kX4RG2hRdOq/LhhlY/5lxP/sftpW0dnnGIGnU6W8QkUAppqHhWrlBO1w== X-Received: by 2002:adf:d20b:: with SMTP id j11mr81811wrh.397.1614798742947; Wed, 03 Mar 2021 11:12:22 -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 03/10] hw/net: e1000: Remove the logic of padding short frames in the receive path Date: Wed, 3 Mar 2021 20:11:58 +0100 Message-Id: <20210303191205.1656980-4-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. This actually reverts commit 78aeb23eded2d0b765bf9145c71f80025b568acd. Signed-off-by: Bin Meng Message-Id: <1614763306-18026-3-git-send-email-bmeng.cn@gmail.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/net/e1000.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/hw/net/e1000.c b/hw/net/e1000.c index d8da2f6528b..a53ba9052b4 100644 --- a/hw/net/e1000.c +++ b/hw/net/e1000.c @@ -882,7 +882,6 @@ e1000_receive_iov(NetClientState *nc, const struct iove= c *iov, int iovcnt) uint16_t vlan_special =3D 0; uint8_t vlan_status =3D 0; uint8_t min_buf[MIN_BUF_SIZE]; - struct iovec min_iov; uint8_t *filter_buf =3D iov->iov_base; size_t size =3D iov_size(iov, iovcnt); size_t iov_ofs =3D 0; @@ -898,15 +897,7 @@ e1000_receive_iov(NetClientState *nc, const struct iov= ec *iov, int iovcnt) return 0; } =20 - /* Pad to minimum Ethernet frame length */ - if (size < sizeof(min_buf)) { - iov_to_buf(iov, iovcnt, 0, min_buf, size); - memset(&min_buf[size], 0, sizeof(min_buf) - size); - min_iov.iov_base =3D filter_buf =3D min_buf; - min_iov.iov_len =3D size =3D sizeof(min_buf); - iovcnt =3D 1; - iov =3D &min_iov; - } else if (iov->iov_len < MAXIMUM_ETHERNET_HDR_LEN) { + if (iov->iov_len < MAXIMUM_ETHERNET_HDR_LEN) { /* This is very unlikely, but may happen. */ iov_to_buf(iov, iovcnt, 0, min_buf, MAXIMUM_ETHERNET_HDR_LEN); filter_buf =3D min_buf; --=20 2.26.2