From patchwork Tue Apr 1 16:53:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 27558 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f200.google.com (mail-ie0-f200.google.com [209.85.223.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1646620553 for ; Tue, 1 Apr 2014 16:53:18 +0000 (UTC) Received: by mail-ie0-f200.google.com with SMTP id lx4sf35832220iec.7 for ; Tue, 01 Apr 2014 09:53:18 -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:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=HkrA67CWkPXqiACcaGuH+Pnf1/2TrOj6hGsdIGiNTKM=; b=A2cLllwdTZ5t5r/ZZRe3seKUYmcnf1mnYc3qGfmOZxZ+GCn784CtTFCz/E005ViHUo Sv1j30s6VuT2CZBmGeHCyLDOU/iButem831uOhFwQGzBg4uwGjUOY55OT+sbaoaAvFUM RHQegeOtagSJl0tQXcQmY/w1GIKajRPmtnYQzIntY3vr6RMy1rIw3lYEgIz/b2sszVmw SjyVPRzloA4b4VngOqB/N4SEGupX584qNocGbc5VkFpCnqchgsP+AoQKjdnyco/n/1w8 WSGYORpVhlcyzB9+JTm/t5GGpz9MAGWLf7/pZX5tZVYSOk/1cR9Q39G2izna0VGPjJa5 9kUg== X-Gm-Message-State: ALoCoQnLH+ACqdGrSqqRGB5OY8b5ImVCLqB/NmI1ghNgPzIeQ/E/Tu+WOkgB6Lr0lGxPtihsgb7k X-Received: by 10.182.230.132 with SMTP id sy4mr4491169obc.48.1396371198554; Tue, 01 Apr 2014 09:53:18 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.21.213 with SMTP id 79ls60748qgl.35.gmail; Tue, 01 Apr 2014 09:53:18 -0700 (PDT) X-Received: by 10.52.108.228 with SMTP id hn4mr1142399vdb.43.1396371198476; Tue, 01 Apr 2014 09:53:18 -0700 (PDT) Received: from mail-vc0-f180.google.com (mail-vc0-f180.google.com [209.85.220.180]) by mx.google.com with ESMTPS id x18si3662968vcf.207.2014.04.01.09.53.18 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 01 Apr 2014 09:53:18 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.180 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.180; Received: by mail-vc0-f180.google.com with SMTP id lf12so9844433vcb.25 for ; Tue, 01 Apr 2014 09:53:18 -0700 (PDT) X-Received: by 10.220.167.2 with SMTP id o2mr29224332vcy.8.1396371198249; Tue, 01 Apr 2014 09:53:18 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.12.8 with SMTP id v8csp253299vcv; Tue, 1 Apr 2014 09:53:17 -0700 (PDT) X-Received: by 10.180.205.204 with SMTP id li12mr21430569wic.34.1396371197426; Tue, 01 Apr 2014 09:53:17 -0700 (PDT) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id fb6si10168905wic.38.2014.04.01.09.53.16 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 01 Apr 2014 09:53:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::1 as permitted sender) client-ip=2001:8b0:1d0::1; Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1WV1vv-0002El-Ik; Tue, 01 Apr 2014 17:53:07 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, "Michael S. Tsirkin" , "Dr. David Alan Gilbert" Subject: [PATCH 2/5] hw/net/stellaris_enet: Correct handling of packet padding Date: Tue, 1 Apr 2014 17:53:04 +0100 Message-Id: <1396371187-8567-3-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1396371187-8567-1-git-send-email-peter.maydell@linaro.org> References: <1396371187-8567-1-git-send-email-peter.maydell@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.180 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 --- 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);