From patchwork Mon Sep 18 19:50:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Smirnov X-Patchwork-Id: 9957555 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DA66060568 for ; Mon, 18 Sep 2017 19:53:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CCF2328D3B for ; Mon, 18 Sep 2017 19:53:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C1E7828D67; Mon, 18 Sep 2017 19:53:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 74ED928D57 for ; Mon, 18 Sep 2017 19:53:12 +0000 (UTC) Received: from localhost ([::1]:38616 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1du26R-0007FX-JN for patchwork-qemu-devel@patchwork.kernel.org; Mon, 18 Sep 2017 15:53:11 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37450) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1du24x-0006tL-BH for qemu-devel@nongnu.org; Mon, 18 Sep 2017 15:51:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1du24u-0006Jn-MG for qemu-devel@nongnu.org; Mon, 18 Sep 2017 15:51:39 -0400 Received: from mail-pg0-x243.google.com ([2607:f8b0:400e:c05::243]:33827) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1du24s-0006IF-PC; Mon, 18 Sep 2017 15:51:34 -0400 Received: by mail-pg0-x243.google.com with SMTP id u18so658701pgo.1; Mon, 18 Sep 2017 12:51:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=piLssSvPtzQ8bolhFAIMo3F7SGGBlrixXybpM9zgRDw=; b=LR2HksjqiA+GytS7SV93rglZHPE97FI/u98yIdPpc+rSoGRgSTVEfzLvaK4OpBgFn4 tW7fh7OvZLSYScqX8jiOdwe7G6qONtVjb66Qvd8JY4su2o+IXJu/7/DQlRLXe0iCBh6k snIHKAoCSPz3xQ+/sXJBgIRjiTiBi4Lld2KFbsj712I2oY/9P7O3Po70W6doAEbYXjpe JuzJBL3DfpjrSq7Jv89dHy0vG8gRiKcQMxivctgt/CyLD0H1avKhURDhHDve0uqTIOQL hWxz6oLI3W+BLNgHJOLIaPht64HjvlvhOiwRe79o4Un6uYRcdwCW9nD0452iFZ6oRajd aZdQ== 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=piLssSvPtzQ8bolhFAIMo3F7SGGBlrixXybpM9zgRDw=; b=l7A80Yw2C3ZCqTKu449wE48A0Ry3NXQ7RNvJkUSqQ2mUgWLrSGxMxzVqxxhWAxP30q lGt9+KQgkUmAHTn+8LhgXNpWVRkumdlECxkEk5UBoEYVwfUyuUwReE4wMB0w0s/8ifHV nq4NGdMTvezULepa+bfYX7mo+K7zitB9vgZZnRAVgLcMAiTM7jL1GkZp4GITWy3SO2xS 3fKWjXMYG8pnRlBs8TXMqNabxVPmeo/2G93dcCfXLIHX8+D4lcp3+bAuivTbeeF43d7Y D+rh5sg7ccIMUcVcK+Tw7E3a9kdnmdDJbbYMIeTyMWE95n468Qnox9Yx0ZgUHtTmIV6R lRNA== X-Gm-Message-State: AHPjjUiBzpqmDbC0KKKJAw0C1wo/g7jGYFRHAQ8G8EOEaqN4KPB5mcCb oMm4HRqTpE81w38EE1c= X-Google-Smtp-Source: ADKCNb7HBghnFQd+UlZFxqdTHWYiNpYmoMug6oNqpI/LxWgAGqj+51vptJkj6q1N+vjQ/X21SSOkKA== X-Received: by 10.84.148.203 with SMTP id y11mr37186828plg.277.1505764293526; Mon, 18 Sep 2017 12:51:33 -0700 (PDT) Received: from squirtle.westlake.spaceflightindustries.com ([173.226.206.194]) by smtp.gmail.com with ESMTPSA id d186sm200791pfd.117.2017.09.18.12.51.32 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 18 Sep 2017 12:51:32 -0700 (PDT) From: Andrey Smirnov To: qemu-arm@nongnu.org Date: Mon, 18 Sep 2017 12:50:52 -0700 Message-Id: <20170918195100.17593-10-andrew.smirnov@gmail.com> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20170918195100.17593-1-andrew.smirnov@gmail.com> References: <20170918195100.17593-1-andrew.smirnov@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c05::243 Subject: [Qemu-devel] [PATCH 09/17] imx_fec: Use correct length for packet size 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: Andrey Smirnov , Peter Maydell , Jason Wang , qemu-devel@nongnu.org, yurovsky@gmail.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Use 'frame_size' instead of 'len' when calling qemu_send_packet(), failing to do so results in malformed packets send in case when that packed is fragmented into multiple DMA transactions. Cc: Peter Maydell Cc: Jason Wang Cc: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org Cc: yurovsky@gmail.com Signed-off-by: Andrey Smirnov Reviewed-by: Peter Maydell --- hw/net/imx_fec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/net/imx_fec.c b/hw/net/imx_fec.c index 6045ffe673..c45b9648d9 100644 --- a/hw/net/imx_fec.c +++ b/hw/net/imx_fec.c @@ -532,7 +532,7 @@ static void imx_enet_do_tx(IMXFECState *s, uint32_t index) } } /* Last buffer in frame. */ - qemu_send_packet(qemu_get_queue(s->nic), frame, len); + qemu_send_packet(qemu_get_queue(s->nic), frame, frame_size); ptr = frame; frame_size = 0; if (bd.option & ENET_BD_TX_INT) {