From nobody Mon Nov 23 04:31:57 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 ARC-Seal: i=1; a=rsa-sha256; t=1794880220; cv=none; d=zohomail.com; s=zohoarc; b=IHQ4jrlCRavCXc8o44d6ikNrUvlakCEb8OMY4YQhDkbHHy22F1Z7RvujsJmY3XIgtMdIQcLm53RJ38jHuzmrxcBXWgTFCMPYQ+Z6lCD10/MtbYKOF5Wm+bx5xohJZdTH7xucTJpyIUpeRkba8YsTuWmMruaXRceWgGvG7yjJ5E4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794880220; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=h6ofA8JUec8qMFJVW6h5bRC1GcQsQ4BdCmXle6c4ShU=; b=P4QXQhW0jPzODwu/bk7K7ymBNy1jhXGiEKe9Y9nO3wZlynod5ix822s1vHRbMRwdRCNCiD18Nx7kbAejyVMpmg0/2d0O3PRqq9ptv2azra66tgOr5fh8g/SQlWXsKZmjik7xwa4d6M54QTT7eHZu29ZInXgHBMlWYEIopwmSaFo= 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 Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1794880219470166.4516225820048; Mon, 16 Nov 2026 17:50:19 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xT8KG-0002q4-F6; Mon, 16 Nov 2026 20:49:36 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xT8K6-0002pP-3p for qemu-devel@nongnu.org; Mon, 16 Nov 2026 20:49:26 -0500 Received: from [115.124.28.134] (helo=out28-134.mail.aliyun.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xT8Jz-0001uY-IS for qemu-devel@nongnu.org; Mon, 16 Nov 2026 20:49:24 -0500 Received: from ubuntu-Precision-3680..(mailfrom:gaochengbo@bosc.ac.cn fp:SMTPD_---.k3S66sB_1794879698 cluster:ay29) by smtp.aliyun-inc.com; Tue, 17 Nov 2026 09:41:44 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bosc.ac.cn; s=default; t=1794880023; h=From:To:Subject:Date:Message-ID:MIME-Version; bh=h6ofA8JUec8qMFJVW6h5bRC1GcQsQ4BdCmXle6c4ShU=; b=WnUJO7U0J8rDfioW/9nKrJdX9rJDDkdE8N6jcUJUq+NOWQeFqdhOYdE1Hf8uze2p1yabnKHBaJ1zE0Iurtk6PXdjx4DVzL8twgaAtATQtv1q6bWN/vOemNcmgq3hHahSlGIeKJJrasIQtPGndaogyhQnP/8aPaa2Ebd7R1g/PT5WtznTe75aMpux5Myfu2fX+UosjaRlc1Neb5GKC8LuLa9vpMxQ2zVkDoLmYpoDoGu/dp8j8K9q516CkqRSfwAbJ/+kFjO319DYiv4CMKNEtqkcyAcsIBtMaC0tO2GLyvS+9iKiM1iOUsDotM9sSYFc4cXgTeE6zEeYt8Jzu073LA== X-Alimail-AntiSpam: AC=CONTINUE; BC=0.07685246|-1; BR=01201311R451S51rulernew998_84748_2000303; CH=blue; DM=|CONTINUE|false|; DS=CONTINUE|ham_system_inform|0.0171391-5.84713e-05-0.982802; FP=13178133005994650843|0|0|0|0|-1|-1|-1; HT=maildocker-contentspam033045166233; MF=gaochengbo@bosc.ac.cn; NM=1; PH=DS; RN=8; RT=8; SR=0; TI=SMTPD_---.k3S66sB_1794879698; From: Chengbo Gao To: dmitry.fleytman@gmail.com Cc: odaki@rsg.ci.i.u-tokyo.ac.jp, jasowangio@gmail.com, qemu-devel@nongnu.org, guoyaxing@bosc.ac.cn, wangran@bosc.ac.cn, majiuyue@bosc.ac.cn, Chengbo Gao Subject: [PATCH v1] hw/net/e1000e: Account for current descriptor data when appending FCS Date: Tue, 17 Nov 2026 09:41:28 +0800 Message-ID: <20261117014128.600675-1-gaochengbo@bosc.ac.cn> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 115.124.28.134 (deferred) 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=lists1p.gnu.org; Received-SPF: pass client-ip=115.124.28.134; envelope-from=gaochengbo@bosc.ac.cn; helo=out28-134.mail.aliyun.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, 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, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, UNPARSEABLE_RELAY=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development 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 @bosc.ac.cn) X-ZM-MESSAGEID: 1794880226165158500 Content-Type: text/plain; charset="utf-8" The FCS append condition checks desc_offset before it is updated with the payload copied into the current descriptor. This causes FCS bytes to be placed in a separate descriptor even when the current buffer has enough space. With KEEP_CRC enabled, the DPDK em non-scattered receive path subtracts four bytes from the first descriptor's length, truncating a 98-byte ICMP frame to 94 bytes. Include desc_size in both the FCS append condition and the remaining length calculation so that FCS is appended to the current descriptor when space permits. Signed-off-by: Chengbo Gao --- hw/net/e1000e_core.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/net/e1000e_core.c b/hw/net/e1000e_core.c index b87a9f167a..6a01481e22 100644 --- a/hw/net/e1000e_core.c +++ b/hw/net/e1000e_core.c @@ -1601,7 +1601,8 @@ e1000e_write_packet_to_guest(E1000ECore *core, struct= NetRxPkt *pkt, } =20 if (rx_desc_buf_size && - desc_offset >=3D size && desc_offset < total_size) { + desc_offset + desc_size >=3D size && + desc_offset + desc_size < total_size) { /* * We are in the last 4 bytes corresponding to the FCS che= cksum. * We only ever write zeroes here (unlike the hardware). @@ -1609,7 +1610,7 @@ e1000e_write_packet_to_guest(E1000ECore *core, struct= NetRxPkt *pkt, static const uint32_t fcs_pad; /* Amount of space for the trailing checksum */ size_t fcs_len =3D MIN(rx_desc_buf_size, - total_size - desc_offset); + total_size - (desc_offset + desc_size)= ); e1000e_write_payload_frag_to_rx_buffers(core, ba, &bastate, (const char *)&fcs= _pad, fcs_len); --=20 2.43.0