From patchwork Fri May 9 02:03:47 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Byungho An X-Patchwork-Id: 29877 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f198.google.com (mail-ob0-f198.google.com [209.85.214.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B4512202DD for ; Fri, 9 May 2014 02:04:21 +0000 (UTC) Received: by mail-ob0-f198.google.com with SMTP id va2sf16735237obc.9 for ; Thu, 08 May 2014 19:04:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :mime-version:thread-index:dlp-filter:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type :content-transfer-encoding:content-language; bh=5/srodLRr1jqaP7YvEUW5scs4fAkii8zL4jrljnnRgg=; b=Pv/38HaHvOIwNZSGhVQYFaUgcfEN9lXPVZqh65wMun27a4ALv5MO3jce+exhGfKuai 8hE/SWcQIzLmoGTWPS97aATRDPri+USlVuLFWVVTJP+gVE4hVwhZiV5JQoT3k1yzgafQ DYnCm/yYSgcISWkBy9c1Qu2j34FfSI99l0Mc9Lk0VYfPjWu19Lx0Ip9s+DLNqWrODWfI OKxu5E3kLeqV6UnDCMrTv/yeh9/oMc9Qepb8XMFzL5s+FBA1koROSrs7rOooCs/31TAl g01YmsRMyJew2YL0GvwRZL4+ATVXa1Mf2K13ninNfU1Q7UnIbbckekmL7ckGJNxbsYLg o4uA== X-Gm-Message-State: ALoCoQkw0HFI7vgUnAgVMD899GKayylzz799fky9d/0G++FDqMi1y5BAV66y2CqxQ9I6Cr3tOFif X-Received: by 10.182.120.129 with SMTP id lc1mr3714349obb.21.1399601061254; Thu, 08 May 2014 19:04:21 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.48.112 with SMTP id n103ls101187qga.86.gmail; Thu, 08 May 2014 19:04:21 -0700 (PDT) X-Received: by 10.58.122.164 with SMTP id lt4mr5859650veb.2.1399601061120; Thu, 08 May 2014 19:04:21 -0700 (PDT) Received: from mail-vc0-f172.google.com (mail-vc0-f172.google.com [209.85.220.172]) by mx.google.com with ESMTPS id ec1si469694veb.182.2014.05.08.19.04.21 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 08 May 2014 19:04:21 -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.172; Received: by mail-vc0-f172.google.com with SMTP id hr9so4408556vcb.17 for ; Thu, 08 May 2014 19:04:21 -0700 (PDT) X-Received: by 10.58.211.229 with SMTP id nf5mr4097364vec.19.1399601060993; Thu, 08 May 2014 19:04:20 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp40155vcb; Thu, 8 May 2014 19:04:20 -0700 (PDT) X-Received: by 10.66.240.4 with SMTP id vw4mr14635747pac.26.1399601060190; Thu, 08 May 2014 19:04:20 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id iu4si1431795pbc.301.2014.05.08.19.04.19; Thu, 08 May 2014 19:04:19 -0700 (PDT) Received-SPF: none (google.com: netdev-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932117AbaEICDw (ORCPT + 3 others); Thu, 8 May 2014 22:03:52 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:25241 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754355AbaEICDt (ORCPT ); Thu, 8 May 2014 22:03:49 -0400 Received: from epcpsbgr4.samsung.com (u144.gpu120.samsung.co.kr [203.254.230.144]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N5A00LZIB2B5520@mailout1.samsung.com>; Fri, 09 May 2014 11:03:47 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [203.254.230.49]) by epcpsbgr4.samsung.com (EPCPMTA) with SMTP id 7E.00.09952.3873C635; Fri, 09 May 2014 11:03:47 +0900 (KST) X-AuditID: cbfee690-b7fcd6d0000026e0-70-536c3783b849 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 88.40.27725.3873C635; Fri, 09 May 2014 11:03:47 +0900 (KST) Received: from DObh74an01 ([12.36.166.149]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N5A00E3RB27TW20@mmp1.samsung.com>; Fri, 09 May 2014 11:03:47 +0900 (KST) From: Byungho An To: 'netdev' , linux-samsung-soc@vger.kernel.org Cc: davem@davemloft.net, "'ks.giri'" , "'vipul.pandya'" Subject: [PATCH 2/3] net: sxgbe: Added tail point update Date: Fri, 09 May 2014 11:03:47 +0900 Message-id: <003c01cf6b2a$e9dac1e0$bd9045a0$%an@samsung.com> MIME-version: 1.0 X-Mailer: Microsoft Office Outlook 12.0 Thread-index: Ac9rKunL1hiu1308SYucg424IBqTLw== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrCIsWRmVeSWpSXmKPExsVy+t8zQ91m85xgg/U7FSzmnG9hsZh/dAeT xYzz+5gsji0Qs9i24AKzA6vHlpU3mTz6tqxi9Pi8SS6AOYrLJiU1J7MstUjfLoErY9a002wF x2Uqfv/pYm1gfCTexcjJISFgIrHm3B4WCFtM4sK99WxdjFwcQgLLGCXap15lhym6vvo8VGIR o8T9U6+YIJzfjBJP7z0Ha2cTUJNonnmZDcQWE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YgRH8DOpHYwrGywOMQpwMCrx8L6Ykh0sxJpYVlyZe4hRgoNZSYT3 jn5OsBBvSmJlVWpRfnxRaU5q8SHGZKA/JzJLiSbnA5NLXkm8obGJmZGlkZmFkYm5OWnCSuK8 B1qtA4UE0hNLUrNTUwtSi2C2MHFwSjUwqspsYEjrf9z3ySvdZ/Wn6VOv6ueEXt20nFVDuD1o bo3u0n9T59zuYZu3IZFphm7pgS+/Dtk6cilHaTnZXKxce23WQoVDDhf3P7nSs/He3XPLT988 eKPgvVOZ60U2Q0WG0x+vbrePVHnHOk2sMPpoj3b9V5kdW9xvsE895vH0tWDqk125EXsyXyix FGckGmoxFxUnAgAIOYzvJAMAAA== DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: netdev-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: netdev@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: bh74.an@samsung.com 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 Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit Content-language: ko This patch adds tail point update function for rx path after rx_refill function. It indicate tail point to rx dma. Signed-off-by: Byungho An --- drivers/net/ethernet/samsung/sxgbe/sxgbe_dma.c | 14 +++++++++++++- drivers/net/ethernet/samsung/sxgbe/sxgbe_dma.h | 4 ++++ drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c | 5 +++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/samsung/sxgbe/sxgbe_dma.c b/drivers/net/ethernet/samsung/sxgbe/sxgbe_dma.c index 49240c9..249b0e0 100644 --- a/drivers/net/ethernet/samsung/sxgbe/sxgbe_dma.c +++ b/drivers/net/ethernet/samsung/sxgbe/sxgbe_dma.c @@ -112,7 +112,7 @@ static void sxgbe_dma_channel_init(void __iomem *ioaddr, int cha_num, dma_addr = dma_rx + ((r_rsize - 1) * SXGBE_DESC_SIZE_BYTES); writel(lower_32_bits(dma_addr), - ioaddr + SXGBE_DMA_CHA_RXDESC_LADD_REG(cha_num)); + ioaddr + SXGBE_DMA_CHA_RXDESC_TAILPTR_REG(cha_num)); /* program the ring sizes */ writel(t_rsize - 1, ioaddr + SXGBE_DMA_CHA_TXDESC_RINGLEN_REG(cha_num)); writel(r_rsize - 1, ioaddr + SXGBE_DMA_CHA_RXDESC_RINGLEN_REG(cha_num)); @@ -370,6 +370,17 @@ static void sxgbe_enable_tso(void __iomem *ioaddr, u8 chan_num) writel(ctrl, ioaddr + SXGBE_DMA_CHA_TXCTL_REG(chan_num)); } +static void sxgbe_dma_update_rxdesc_tail_ptr(void __iomem *ioaddr, u8 chan_num, + dma_addr_t dma_rx_phy, int cur_rx, + int rxsize) +{ + u32 reg_val; + + reg_val = (dma_rx_phy & 0xFFFFFFFF) + ((cur_rx % rxsize) * + SXGBE_DESC_SIZE_BYTES); + writel(reg_val, ioaddr + SXGBE_DMA_CHA_RXDESC_TAILPTR_REG(chan_num)); +} + static const struct sxgbe_dma_ops sxgbe_dma_ops = { .init = sxgbe_dma_init, .cha_init = sxgbe_dma_channel_init, @@ -386,6 +397,7 @@ static const struct sxgbe_dma_ops sxgbe_dma_ops = { .rx_dma_int_status = sxgbe_rx_dma_int_status, .rx_watchdog = sxgbe_dma_rx_watchdog, .enable_tso = sxgbe_enable_tso, + .update_rxdesc_tail_ptr = sxgbe_dma_update_rxdesc_tail_ptr, }; const struct sxgbe_dma_ops *sxgbe_get_dma_ops(void) diff --git a/drivers/net/ethernet/samsung/sxgbe/sxgbe_dma.h b/drivers/net/ethernet/samsung/sxgbe/sxgbe_dma.h index 843fa9b..a06e01e 100644 --- a/drivers/net/ethernet/samsung/sxgbe/sxgbe_dma.h +++ b/drivers/net/ethernet/samsung/sxgbe/sxgbe_dma.h @@ -43,6 +43,10 @@ struct sxgbe_dma_ops { void (*rx_watchdog)(void __iomem *ioaddr, u32 riwt); /* Enable TSO for each DMA channel */ void (*enable_tso)(void __iomem *ioaddr, u8 chan_num); + void (*update_rxdesc_tail_ptr)(void __iomem *ioaddr, u8 chan_num, + dma_addr_t dma_rx, int r_rentry, + int r_rsize); + }; const struct sxgbe_dma_ops *sxgbe_get_dma_ops(void); diff --git a/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c b/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c index 93bf151..7dc3449 100644 --- a/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c +++ b/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c @@ -1521,6 +1521,7 @@ static int sxgbe_rx(struct sxgbe_priv_data *priv, int limit) skb_put(skb, frame_len); skb->ip_summed = checksum; + skb->protocol = eth_type_trans(skb, priv->dev); if (checksum == CHECKSUM_NONE) netif_receive_skb(skb); else @@ -1530,6 +1531,10 @@ static int sxgbe_rx(struct sxgbe_priv_data *priv, int limit) } sxgbe_rx_refill(priv); + priv->hw->dma->update_rxdesc_tail_ptr(priv->ioaddr, qnum, + priv->rxq[qnum]->dma_rx_phy, + priv->rxq[qnum]->cur_rx, + priv->dma_rx_size); return count; }