From nobody Mon Feb 9 11:29:37 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1487248384109751.3011584991032; Thu, 16 Feb 2017 04:33:04 -0800 (PST) Received: from localhost ([::1]:46126 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ceLF6-0005by-LG for importer@patchew.org; Thu, 16 Feb 2017 07:33:00 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47791) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ceLCz-0003gZ-J1 for qemu-devel@nongnu.org; Thu, 16 Feb 2017 07:30:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ceLCw-00087C-FS for qemu-devel@nongnu.org; Thu, 16 Feb 2017 07:30:49 -0500 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]:34561) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ceLCw-00086u-5E for qemu-devel@nongnu.org; Thu, 16 Feb 2017 07:30:46 -0500 Received: by mail-wm0-x241.google.com with SMTP id c85so2903898wmi.1 for ; Thu, 16 Feb 2017 04:30:46 -0800 (PST) Received: from bark.daynix ([141.226.163.173]) by smtp.gmail.com with ESMTPSA id b51sm8827365wrd.39.2017.02.16.04.30.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Feb 2017 04:30:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=NoWow3BvTiyTYA7PFStHxrLDWH5TGgkUiy92tWtujkU=; b=fjLF7U6G+VpL5mvGgljCz1IlFAL630FTKFUPc9vNemAwIVc2wzsH0WFjBlIrwAMrTn RP00oY3IdsDmhyC22AUxeo0yC2V8bKw5Y2ZJ8ZkhFB5YvyvZrwIph8XwTqYS1rfIrwyp imZS1jJx4qS4GvKCdkhUnFNs/TwpWSnZ6FyFbIJq3t638pUuF5oA1fhgzapVw5/5GLb+ 98A3CjQS5sF44vfw9Q95kVTRrpMfJBabshWeYFGfCqOUREszM6NTs1j2IBGFUEg+Jf/z K9JnGMzUMoXDS5t5aUP5dx3qU+4oZTpycJj4VxiCvQ8xz6gBwKbeVCHPCpiIVanaRY4U Fu6g== 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; bh=NoWow3BvTiyTYA7PFStHxrLDWH5TGgkUiy92tWtujkU=; b=Bn593alnf9zALuD02toEfpDXH2i6RfuvuQRU1Lf7Igfsq8x2T68VOAwI5a/EqH17x3 1GXJDmkrbVAxNWloJKCVH9IEv56sDfikZFbyQq+FWvd6IYYkf4fE/HGUxsYiN/PDJ4ru mrMAZBRGkZpOQ1JqToD5c71qvybM9JaqTpy7DQtrSOtLYgviStuk7YaQh00cdJuJ/OGa vWlkc6ELqpYtToha93pAodSOMpgVN3BNvR5PoS1ohrNEUbATDvBv1+4AAdnuIzYEu9uN yS8AehS2CYz52TlSKKNKhndXNNlPl3k5FVfi05maZao8w+N+gXrMcydOQ+VQjc7jbd0a 2fiw== X-Gm-Message-State: AMke39n2Q3qjBDfL/N+KhtmuMzBozCLGrCtdDJRORosQUxfIj7qva63pIIfhq3EpI72iBw== X-Received: by 10.28.230.91 with SMTP id d88mr12008752wmh.129.1487248245237; Thu, 16 Feb 2017 04:30:45 -0800 (PST) From: Dmitry Fleytman To: qemu-devel@nongnu.org Date: Thu, 16 Feb 2017 14:29:35 +0200 Message-Id: <1487248176-29602-5-git-send-email-dmitry@daynix.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1487248176-29602-1-git-send-email-dmitry@daynix.com> References: <1487248176-29602-1-git-send-email-dmitry@daynix.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::241 Subject: [Qemu-devel] [PATCH 4/5] NetRxPkt: Account buffer with ETH header in IOV length X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Yan Vugenfirer , Dmitry Fleytman , Jason Wang , P J P Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" In case of VLAN stripping ETH header is stored in a separate chunk and length of IOV should take this into account. This patch fixes checksum validation for RX packets with VLAN header. Devices affected by this problem: e1000e and vmxnet3. Signed-off-by: Dmitry Fleytman --- hw/net/net_rx_pkt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/net/net_rx_pkt.c b/hw/net/net_rx_pkt.c index d38babe..c7ae33d 100644 --- a/hw/net/net_rx_pkt.c +++ b/hw/net/net_rx_pkt.c @@ -97,7 +97,7 @@ net_rx_pkt_pull_data(struct NetRxPkt *pkt, pkt->tot_len =3D iov_size(iov, iovcnt) - ploff + pkt->ehdr_buf_len; pkt->vec_len =3D iov_copy(pkt->vec + 1, pkt->vec_len_total - 1, iov, iovcnt, ploff, - pkt->tot_len - pkt->ehdr_buf_len); + pkt->tot_len - pkt->ehdr_buf_len) + 1; } else { net_rx_pkt_iovec_realloc(pkt, iovcnt); =20 --=20 2.7.4