From patchwork Tue May 13 15:31:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 30075 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f198.google.com (mail-vc0-f198.google.com [209.85.220.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id F279820369 for ; Tue, 13 May 2014 15:39:36 +0000 (UTC) Received: by mail-vc0-f198.google.com with SMTP id ij19sf1479515vcb.1 for ; Tue, 13 May 2014 08:39:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:in-reply-to:references:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=iMN1xY3IP0ZGihfRAP8++fx1Y6rpvp0RjzEVR0p87Ss=; b=kLe9a6AA82VyRDG23Ej/UwMVVZiPiodFs+aLYbKSdIrsvCWIjxQoUc3uGkFT+B9wnS bSYE2FUY7HUOvveeVhXDFVMsvQsrb6416m2183caaTBU4vuKSE3kNBXTLka8gvrtomnA b7VAZe7Z5VPzw7fpwJc5pmiTs08f2LbdQhpTdYvMkqXNJ3ef1KMN82CWTTseMH5vlfdW SQfyzStbxtIatjX/Imoxrpc+0/jDqdHAwNdeNqt5tlDKpXpYGUw9ZyVXBzjWYNNCcSQ7 6R2yg3htrS9oIi0F5doixyaX/aekS7PQNPGX73BhJ3zne3Zx9vPqEVljVYtxMMnJW3ZI XEvA== X-Gm-Message-State: ALoCoQkR/DyuB4/nK7NJ72OBnmrxkyUUHhFMTyBDbvx6WVn/uNeCosgPxMB00ekdOV8Ikppyb0rg X-Received: by 10.236.125.6 with SMTP id y6mr14886346yhh.3.1399995576609; Tue, 13 May 2014 08:39:36 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.42.163 with SMTP id c32ls1873213qga.49.gmail; Tue, 13 May 2014 08:39:36 -0700 (PDT) X-Received: by 10.220.163.201 with SMTP id b9mr428085vcy.79.1399995576490; Tue, 13 May 2014 08:39:36 -0700 (PDT) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx.google.com with ESMTPS id xv9si2712027vcb.188.2014.05.13.08.39.36 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 13 May 2014 08:39:36 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.182 as permitted sender) client-ip=209.85.220.182; Received: by mail-vc0-f182.google.com with SMTP id la4so703770vcb.27 for ; Tue, 13 May 2014 08:39:36 -0700 (PDT) X-Received: by 10.221.26.10 with SMTP id rk10mr29728707vcb.0.1399995576392; Tue, 13 May 2014 08:39:36 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp160996vcb; Tue, 13 May 2014 08:39:35 -0700 (PDT) X-Received: by 10.180.211.116 with SMTP id nb20mr21675584wic.5.1399995575438; Tue, 13 May 2014 08:39:35 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id v4si3980753wiw.80.2014.05.13.08.39.34 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 13 May 2014 08:39:35 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:45935 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WkEnl-0001HZ-Ro for patch@linaro.org; Tue, 13 May 2014 11:39:33 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42287) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WkEgO-00088A-PU for qemu-devel@nongnu.org; Tue, 13 May 2014 11:32:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WkEgK-0006Bf-PW for qemu-devel@nongnu.org; Tue, 13 May 2014 11:31:56 -0400 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:48125) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WkEgK-00066p-JD for qemu-devel@nongnu.org; Tue, 13 May 2014 11:31:52 -0400 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1WkEg7-0006wJ-At; Tue, 13 May 2014 16:31:39 +0100 From: Peter Maydell To: Anthony Liguori Date: Tue, 13 May 2014 16:31:26 +0100 Message-Id: <1399995099-26635-5-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1399995099-26635-1-git-send-email-peter.maydell@linaro.org> References: <1399995099-26635-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:8b0:1d0::1 Cc: qemu-devel@nongnu.org Subject: [Qemu-devel] [PULL 04/17] hw/net/stellaris_enet: Correct handling of packet padding X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.182 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 The PADEN bit in the transmit control register enables padding of short data packets out to the required minimum length. However a typo here meant we were adjusting tx_fifo_len rather than tx_frame_len, so the padding didn't actually happen. Fix this bug. Signed-off-by: Peter Maydell Reviewed-by: Dr. David Alan Gilbert Cc: qemu-stable@nongnu.org --- hw/net/stellaris_enet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/net/stellaris_enet.c b/hw/net/stellaris_enet.c index bd844cd..d0da819 100644 --- a/hw/net/stellaris_enet.c +++ b/hw/net/stellaris_enet.c @@ -265,7 +265,7 @@ static void stellaris_enet_write(void *opaque, hwaddr offset, s->tx_frame_len -= 4; if ((s->tctl & SE_TCTL_PADEN) && s->tx_frame_len < 60) { memset(&s->tx_fifo[s->tx_frame_len], 0, 60 - s->tx_frame_len); - s->tx_fifo_len = 60; + s->tx_frame_len = 60; } qemu_send_packet(qemu_get_queue(s->nic), s->tx_fifo, s->tx_frame_len);