From patchwork Thu May 8 11:53:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 29830 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f69.google.com (mail-qa0-f69.google.com [209.85.216.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 479CB20534 for ; Thu, 8 May 2014 11:53:15 +0000 (UTC) Received: by mail-qa0-f69.google.com with SMTP id ih12sf6142973qab.0 for ; Thu, 08 May 2014 04:53:15 -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=iMN1xY3IP0ZGihfRAP8++fx1Y6rpvp0RjzEVR0p87Ss=; b=TMl1AXH5PO4/cT1KIvUKeJdYVDvhSsMSEn5sg7pE7uDRpZ+CqkIgXmjEfMakGQrtc5 wDX6oAs3SJ3qQJqxGN4QxCc4KtzQa+2l5mEUo+mOBC4YOgCO634xiy7NQztYnI/1Ljzj LrR4U7Br/lL443kbIIogAH8ejHs05O5JENPaX3bEwi0WdYkAxklrWNb7MMhcxF55VsSf VAYNkljQIR3UyU2xlQcjevwfpMKfJPutQdTpWW8HypzX25gMtY5tWQfKJshZBGp9K86/ jSDbXGHA4pNjhgJlWiC49j9buZCecmsZaTOPSQVCtec/n9YthoLEY1P6pdM3Q+fdHjBZ LVrA== X-Gm-Message-State: ALoCoQm9QUDQIPjgVXgvbnhb+hptHcARpKMftgRpOoLu82i4sYwbJd3kMVbZlGsO6uoLwSch/asL X-Received: by 10.236.149.115 with SMTP id w79mr1206441yhj.41.1399549995091; Thu, 08 May 2014 04:53:15 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.102.87 with SMTP id v81ls4181974qge.0.gmail; Thu, 08 May 2014 04:53:15 -0700 (PDT) X-Received: by 10.58.112.8 with SMTP id im8mr424218veb.35.1399549994984; Thu, 08 May 2014 04:53:14 -0700 (PDT) Received: from mail-ve0-f175.google.com (mail-ve0-f175.google.com [209.85.128.175]) by mx.google.com with ESMTPS id uv3si132094vdc.149.2014.05.08.04.53.14 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 08 May 2014 04:53:14 -0700 (PDT) Received-SPF: none (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) client-ip=209.85.128.175; Received: by mail-ve0-f175.google.com with SMTP id jw12so3065844veb.20 for ; Thu, 08 May 2014 04:53:14 -0700 (PDT) X-Received: by 10.220.5.129 with SMTP id 1mr235830vcv.71.1399549994900; Thu, 08 May 2014 04:53:14 -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.221.72 with SMTP id ib8csp392504vcb; Thu, 8 May 2014 04:53:13 -0700 (PDT) X-Received: by 10.112.150.233 with SMTP id ul9mr4233513lbb.2.1399549991679; Thu, 08 May 2014 04:53:11 -0700 (PDT) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id k3si515975lbv.122.2014.05.08.04.53.10 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 08 May 2014 04:53:11 -0700 (PDT) Received-SPF: none (google.com: pm215@archaic.org.uk does not designate permitted sender hosts) client-ip=2001:8b0:1d0::1; Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1WiMsu-0004sf-1O; Thu, 08 May 2014 12:53:08 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, "Michael S. Tsirkin" , "Dr. David Alan Gilbert" Subject: [PATCH v4 2/7] hw/net/stellaris_enet: Correct handling of packet padding Date: Thu, 8 May 2014 12:53:02 +0100 Message-Id: <1399549987-18729-3-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1399549987-18729-1-git-send-email-peter.maydell@linaro.org> References: <1399549987-18729-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: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) 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 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);