From patchwork Fri Oct 23 21:46:40 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 7478691 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A80249F302 for ; Fri, 23 Oct 2015 21:46:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D586920A31 for ; Fri, 23 Oct 2015 21:46:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EA7D320A2D for ; Fri, 23 Oct 2015 21:46:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752085AbbJWVqo (ORCPT ); Fri, 23 Oct 2015 17:46:44 -0400 Received: from mail-lf0-f46.google.com ([209.85.215.46]:36037 "EHLO mail-lf0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751989AbbJWVqn (ORCPT ); Fri, 23 Oct 2015 17:46:43 -0400 Received: by lffz202 with SMTP id z202so97726752lff.3 for ; Fri, 23 Oct 2015 14:46:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cogentembedded_com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:organization:user-agent :in-reply-to:references:mime-version:content-transfer-encoding :content-type; bh=796IYIoelTWTnCwn6vWHyh0zcn2O76ckj0z0vr6hyYI=; b=LE6i1Jdy8Q0NFGSJkkNhT5ktkaMOEKC09hI4QOoYm7RZrhZCZUF9tk/g6KMfTru45O mdSSQCdQmX+YEQ3/t/HPVuT8hsTP49dpEvrbTrjFrq8dzdWqr3QXGEjUCUdnbNuScMP3 KBH2qq1rGQbx+8+C/J3lH2Gd7TwIn6UAR0hYn4IivTsz5LKz2QyVUd7C8yK4OxRCWbcL P/09nwLO4qu8Shpo85vRVHqKLkOa3RAl2durEACbn2kMjW1o1n3y1jLzedtHSPZcT7Dz OILo5ldAsMlS7zPnlrEmpzXE/MTxD3W9JNvOtW4pP5GVTUMpTFuba4JpgcV7geJmh2q9 pDkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=796IYIoelTWTnCwn6vWHyh0zcn2O76ckj0z0vr6hyYI=; b=IR9MFuzP29aYCEfOTpfj6DaO6AXL3I5E082/uWYQdtgHToNiDTw4X9lhyWvlMmTiZY mT9r9Nol6+S7es4AIEpBuZiIF1uw3uP0XqCxn7nt3AOoIYWNuDhu2I7yNeVxfikORS52 cmZxf5zsnsheu14uYZ7vCdYIxlVTk4V+OeAzI8iMnpeLmSC3tnrkDJ3oBgx3Oc0X//k/ cEGYn/ojVDmsV82CE26xEOMxcEstk1rsRECzdCdEsBhDR+Wpg6oiFfaWS3sJlk6x0hLU pQWadIu6iSVdyTnt8ikG8a71SukuIizcZgZ+OSAbDBrn6iZ2PB9oVxb8+OZc3mf2TTrT 4rGg== X-Gm-Message-State: ALoCoQmmld8cxfsblOSooTc5g/EYRv+pLj0FEgiEzygAy++dfWKo8X2jM3DzploLS99rm9bTpHzm X-Received: by 10.25.138.133 with SMTP id m127mr1855571lfd.97.1445636802017; Fri, 23 Oct 2015 14:46:42 -0700 (PDT) Received: from wasted.cogentembedded.com ([83.149.8.130]) by smtp.gmail.com with ESMTPSA id y204sm3669557lfd.6.2015.10.23.14.46.41 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Oct 2015 14:46:41 -0700 (PDT) From: Sergei Shtylyov To: netdev@vger.kernel.org Cc: linux-sh@vger.kernel.org Subject: [PATCH 2/2] sh_eth: fix RX buffer size calculation Date: Sat, 24 Oct 2015 00:46:40 +0300 Message-ID: <1571476.HbCo5gVB8j@wasted.cogentembedded.com> Organization: Cogent Embedded Inc. User-Agent: KMail/4.14.9 (Linux/4.1.8-100.fc21.x86_64; KDE/4.14.9; x86_64; ; ) In-Reply-To: <2249923.hKhT9K6gME@wasted.cogentembedded.com> References: <2249923.hKhT9K6gME@wasted.cogentembedded.com> MIME-Version: 1.0 Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-6.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RCVD_IN_SORBS_WEB,RP_MATCHES_RCVD,T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The RX buffer size calulation failed to account for the length granularity (which is now 32 bytes)... Signed-off-by: Sergei Shtylyov --- drivers/net/ethernet/renesas/sh_eth.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: net/drivers/net/ethernet/renesas/sh_eth.c =================================================================== --- net.orig/drivers/net/ethernet/renesas/sh_eth.c +++ net/drivers/net/ethernet/renesas/sh_eth.c @@ -1127,7 +1127,7 @@ static void sh_eth_ring_format(struct ne struct sh_eth_txdesc *txdesc = NULL; int rx_ringsize = sizeof(*rxdesc) * mdp->num_rx_ring; int tx_ringsize = sizeof(*txdesc) * mdp->num_tx_ring; - int skbuff_size = mdp->rx_buf_sz + SH_ETH_RX_ALIGN - 1; + int skbuff_size = mdp->rx_buf_sz + SH_ETH_RX_ALIGN + 32 - 1; dma_addr_t dma_addr; mdp->cur_rx = 0; @@ -1450,7 +1450,7 @@ static int sh_eth_rx(struct net_device * struct sk_buff *skb; u16 pkt_len = 0; u32 desc_status; - int skbuff_size = mdp->rx_buf_sz + SH_ETH_RX_ALIGN - 1; + int skbuff_size = mdp->rx_buf_sz + SH_ETH_RX_ALIGN + 32 - 1; dma_addr_t dma_addr; boguscnt = min(boguscnt, *quota);