From patchwork Wed Sep 14 01:29:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Chubb, Peter (Data61, Eveleigh)" X-Patchwork-Id: 669676 X-Patchwork-Delegate: joe.hershberger@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 3sYkm36pXwz9s9N for ; Wed, 14 Sep 2016 11:41:23 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=data61.csiro.au header.i=@data61.csiro.au header.b=pUmlF4/1; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8B232A7527; Wed, 14 Sep 2016 03:41:21 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Q_5MliyecABC; Wed, 14 Sep 2016 03:41:21 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id BB94E4B9F9; Wed, 14 Sep 2016 03:41:20 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2E1954B9F9 for ; Wed, 14 Sep 2016 03:41:17 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fWlNLULnGYi4 for ; Wed, 14 Sep 2016 03:41:17 +0200 (CEST) X-Greylist: delayed 726 seconds by postgrey-1.34 at theia; Wed, 14 Sep 2016 03:41:13 CEST X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from act-MTAout1.csiro.au (act-MTAout1.csiro.au [150.229.7.37]) by theia.denx.de (Postfix) with ESMTPS id 105764B9CB for ; Wed, 14 Sep 2016 03:41:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=data61.csiro.au; i=@data61.csiro.au; q=dns/txt; s=dkim; t=1473817276; x=1505353276; h=from:to:cc:subject:date:message-id: content-transfer-encoding:mime-version; bh=lZI1CsQjlSJGgZqM2PowZqVn9A8ASTWO/EtFeJY320Q=; b=pUmlF4/1jpbIu9z6t0fj+PtfVqruS8sswyg4ZiRV4ghEEfOflcwu1r5r Yrp1yDnCmsW7+5rarAb0GAVtkLhyLzpLRZAKmAY/a0Qx8eNQl5aob2dTI Don2V2ZfkHc7U3OIgPAasUa/Ing+3BcL+MwRBOHow5QtzfM6S4+rv6FOz c=; X-SBRS: None X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A+EECQBCp9hX/wCwBSSwhIATAJKcgDRdG?= =?us-ascii?q?wEBAQMBAQEJAQEBgycBEQEBAQEBHkmBCqYckCeEEoRXgUeBUDsRAQIBAQEBAQE?= =?us-ascii?q?BA1snhGgnUhIBgQAnBAENBYhLvBcBAQEHAQEBAQEBASCIMYZehgwFjmeKfgGPS?= =?us-ascii?q?AqPYpBTNCCEXnABhR6CLgEBAQ?= X-IPAS-Result: =?us-ascii?q?A+EECQBCp9hX/wCwBSSwhIATAJKcgDRdGwEBAQMBAQEJAQE?= =?us-ascii?q?BgycBEQEBAQEBHkmBCqYckCeEEoRXgUeBUDsRAQIBAQEBAQEBA1snhGgnUhIBg?= =?us-ascii?q?QAnBAENBYhLvBcBAQEHAQEBAQEBASCIMYZehgwFjmeKfgGPSAqPYpBTNCCEXnA?= =?us-ascii?q?BhR6CLgEBAQ?= X-IronPort-AV: E=Sophos;i="5.30,331,1470664800"; d="scan'208";a="140447503" Received: from exch4-cdc.nexus.csiro.au ([IPv6:2405:b000:601:13::247:34]) by act-ironport-int.csiro.au with ESMTP/TLS/AES256-SHA; 14 Sep 2016 11:29:03 +1000 Received: from exch4-cdc.nexus.csiro.au (2405:b000:601:13::247:34) by exch4-cdc.nexus.csiro.au (2405:b000:601:13::247:34) with Microsoft SMTP Server (TLS) id 15.0.1178.4; Wed, 14 Sep 2016 11:29:03 +1000 Received: from exch4-cdc.nexus.csiro.au ([fe80::b154:e7a4:5bb7:991]) by exch4-cdc.nexus.csiro.au ([fe80::b154:e7a4:5bb7:991%17]) with mapi id 15.00.1178.000; Wed, 14 Sep 2016 11:29:03 +1000 From: To: , , Thread-Topic: [PATCH v2] rtl8169: fix cache misalignment message on transmit. Thread-Index: AQHSDidgNcYOfqvtS0yWMuwy9A6StQ== Date: Wed, 14 Sep 2016 01:29:03 +0000 Message-ID: <20160914012849.18763-1-Peter.Chubb@data61.csiro.au> Accept-Language: en-AU, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.9.3 x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [2405:b000:601:170::2:4] MIME-Version: 1.0 Subject: [U-Boot] [PATCH v2] rtl8169: fix cache misalignment message on transmit. X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" The call to flush cache on the transmit buffer was misplaced (for very short packets) and asked to flush less than a cacheline. Move the flush cache call to after a short packet has been padded to minimum length (so the padding is flushed too), and round the size up to a cacheline. Signed-off-by: Peter Chubb Acked-by: Joe Hershberger --- drivers/net/rtl8169.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/rtl8169.c b/drivers/net/rtl8169.c index 1cc0b40..a3f4423 100644 --- a/drivers/net/rtl8169.c +++ b/drivers/net/rtl8169.c @@ -629,11 +629,12 @@ static int rtl_send_common(pci_dev_t dev, unsigned long dev_iobase, /* point to the current txb incase multiple tx_rings are used */ ptxb = tpc->Tx_skbuff[entry * MAX_ETH_FRAME_SIZE]; memcpy(ptxb, (char *)packet, (int)length); - rtl_flush_buffer(ptxb, length); while (len < ETH_ZLEN) ptxb[len++] = '\0'; + rtl_flush_buffer(ptxb, ALIGN(len, RTL8169_ALIGN)); + tpc->TxDescArray[entry].buf_Haddr = 0; #ifdef CONFIG_DM_ETH tpc->TxDescArray[entry].buf_addr = cpu_to_le32(