From patchwork Mon Apr 28 12:39:25 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 29229 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qg0-f70.google.com (mail-qg0-f70.google.com [209.85.192.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4ED5320B8D for ; Mon, 28 Apr 2014 12:39:35 +0000 (UTC) Received: by mail-qg0-f70.google.com with SMTP id i50sf14669232qgf.1 for ; Mon, 28 Apr 2014 05:39:34 -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=J8D+IP6EnTOIGvF0hchbL3SEWurCmOwnTIec9wwXEjUe09urTmn0N0Y6b8i/PEbTXs j0NNqx31VEU64bRqz4xmZ18If1RCS+xSyqb7/Xvc/WcavpsJfAJoTbJziMNR4L8AdCVf cFVwjVgzDYcz/VabBkEyaryABvpzJZXwoee+P3kfeMeZI0DCwxYN4aHU4ZMUt3AbluuP 34SMZqksA2O7VYCIWhF+If+EOkwx/YzUjuXeskMvgOUo4x+uEAQmxZzgnxJsbWVLGek9 C9z6HBSILNG6EXopYQNo1whOxHBPk5mNHzUGLGwbZHpqh243xNDrb+QI3YVZ+SRJOr8y gJGQ== X-Gm-Message-State: ALoCoQkEc6jWfAy8e9q43iVUNLBSXtTIfWSerBdHe5hiqtV/cXvDxxbpEs9O2X0F5pd1BcoY5CFY X-Received: by 10.236.126.72 with SMTP id a48mr10043906yhi.49.1398688774944; Mon, 28 Apr 2014 05:39:34 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.94.118 with SMTP id f109ls2443012qge.8.gmail; Mon, 28 Apr 2014 05:39:34 -0700 (PDT) X-Received: by 10.52.231.72 with SMTP id te8mr123215vdc.54.1398688774843; Mon, 28 Apr 2014 05:39:34 -0700 (PDT) Received: from mail-vc0-f177.google.com (mail-vc0-f177.google.com [209.85.220.177]) by mx.google.com with ESMTPS id cm9si3587463vcb.46.2014.04.28.05.39.34 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 28 Apr 2014 05:39:34 -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.220.177; Received: by mail-vc0-f177.google.com with SMTP id if17so7915018vcb.22 for ; Mon, 28 Apr 2014 05:39:34 -0700 (PDT) X-Received: by 10.52.95.135 with SMTP id dk7mr1409190vdb.32.1398688774755; Mon, 28 Apr 2014 05:39:34 -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 ib8csp114309vcb; Mon, 28 Apr 2014 05:39:34 -0700 (PDT) X-Received: by 10.152.120.168 with SMTP id ld8mr19328126lab.12.1398688773224; Mon, 28 Apr 2014 05:39:33 -0700 (PDT) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id tv3si7316842lbb.91.2014.04.28.05.39.32 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 28 Apr 2014 05:39:33 -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 1WekqI-0006Cu-NO; Mon, 28 Apr 2014 13:39:30 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, "Michael S. Tsirkin" , "Dr. David Alan Gilbert" Subject: [PATCH v3 2/7] hw/net/stellaris_enet: Correct handling of packet padding Date: Mon, 28 Apr 2014 13:39:25 +0100 Message-Id: <1398688770-23828-3-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1398688770-23828-1-git-send-email-peter.maydell@linaro.org> References: <1398688770-23828-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);