From patchwork Wed May 7 08:14:00 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Byungho An X-Patchwork-Id: 29748 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f198.google.com (mail-ie0-f198.google.com [209.85.223.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0C1B520534 for ; Wed, 7 May 2014 08:14:09 +0000 (UTC) Received: by mail-ie0-f198.google.com with SMTP id rp18sf3280127iec.9 for ; Wed, 07 May 2014 01:14:09 -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=9ZoLGplBAgU/CFWFhXOnjwpgZokjCtWuCAB4egXMvIc=; b=NBQt+sq5MhqlWu6SW3wgwyWvd7+RHNB+nVeSiYLsTIIJGGwSmfq3edW18EkvBjeeo4 nYgX7lEP01MCdUEnY1oZt1t9puLHCzbwPooX/6cyRB8n8M71CaR/VbBs0bzlmG6ovj6f h5hAetLW4u+9y5vnp8fBZvBbYbcKR7lTjfLiRoWj0WlAVPAcaMEXbZZa4AkQfR1XCXJ4 jdELHEm56XtqDMgdqjpHEcZCIezUGLk0Tb3iJu9W4CpK6S1D9TH29zBrkD5vLdaXVlHk E2++4VUqquyr3LoopceQHLrMJ56FLMONWGfda1kiikoWszfC+B+O/xUYPcBv41qgUXqm n0mA== X-Gm-Message-State: ALoCoQnfVbs23lOA/kU3VtoydFGPfAW+YM8umZC5nvtBB5CBhNXsM1vDsTKiodDncCCuj7eCvj6S X-Received: by 10.182.121.232 with SMTP id ln8mr3758913obb.11.1399450449416; Wed, 07 May 2014 01:14:09 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.42.20 with SMTP id b20ls3221949qga.5.gmail; Wed, 07 May 2014 01:14:09 -0700 (PDT) X-Received: by 10.220.81.194 with SMTP id y2mr6310104vck.29.1399450449313; Wed, 07 May 2014 01:14:09 -0700 (PDT) Received: from mail-ve0-f174.google.com (mail-ve0-f174.google.com [209.85.128.174]) by mx.google.com with ESMTPS id g10si2776049vcj.37.2014.05.07.01.14.09 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 07 May 2014 01:14:09 -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.174; Received: by mail-ve0-f174.google.com with SMTP id jw12so801827veb.33 for ; Wed, 07 May 2014 01:14:09 -0700 (PDT) X-Received: by 10.52.185.105 with SMTP id fb9mr5411082vdc.12.1399450449004; Wed, 07 May 2014 01:14:09 -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 ib8csp288569vcb; Wed, 7 May 2014 01:14:08 -0700 (PDT) X-Received: by 10.66.197.201 with SMTP id iw9mr16220304pac.151.1399450448260; Wed, 07 May 2014 01:14:08 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id hs1si1452199pbc.177.2014.05.07.01.14.07; Wed, 07 May 2014 01:14:07 -0700 (PDT) Received-SPF: none (google.com: linux-samsung-soc-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 S1753928AbaEGIOG (ORCPT + 9 others); Wed, 7 May 2014 04:14:06 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:59404 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752675AbaEGIOC (ORCPT ); Wed, 7 May 2014 04:14:02 -0400 Received: from epcpsbgr1.samsung.com (u141.gpu120.samsung.co.kr [203.254.230.141]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N57009SM2VDM2D0@mailout3.samsung.com>; Wed, 07 May 2014 17:14:01 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [203.254.230.49]) by epcpsbgr1.samsung.com (EPCPMTA) with SMTP id 12.1D.18501.94BE9635; Wed, 07 May 2014 17:14:01 +0900 (KST) X-AuditID: cbfee68d-b7f4e6d000004845-59-5369eb49882f Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id AA.3E.27725.84BE9635; Wed, 07 May 2014 17:14:01 +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 <0N57000ZW2VCYT50@mmp1.samsung.com>; Wed, 07 May 2014 17:14:00 +0900 (KST) From: Byungho An To: netdev@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: davem@davemloft.net, ks.giri@samsung.com, vipul.pandya@samsung.com Subject: [PATCH] net: sxgbe: Added tail point update Date: Wed, 07 May 2014 17:14:00 +0900 Message-id: <008b01cf69cc$4d304e50$e790eaf0$%an@samsung.com> MIME-version: 1.0 X-Mailer: Microsoft Office Outlook 12.0 Thread-index: Ac9pzE0XSfLYvJBMQH+/Z23wToIh9A== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrKIsWRmVeSWpSXmKPExsVy+t8zQ13P15nBBv/vcVnMOd/CYjH/6A4m ixnn9zFZHFsgZrFtwQVmB1aPLStvMnn0bVnF6PF5k1wAcxSXTUpqTmZZapG+XQJXxp2pfWwF J2QqLm/fwtLA+ES8i5GTQ0LARKL11FZmCFtM4sK99WxdjFwcQgLLGCXOLVvBCFO06NQNFojE IkaJ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yypG0dSC5ILipPRc Q73ixNzi0rx0veT83E2M4Bh+JrWDcWWDxSFGAQ5GJR5ei7cZwUKsiWXFlbmHGCU4mJVEeHdd zAwW4k1JrKxKLcqPLyrNSS0+xJgM9OhEZinR5HxgeskriTc0NjEzsjQyszAyMTcnTVhJnPdA q3WgkEB6YklqdmpqQWoRzBYmDk6pBsaYnruNj9k0BFhP1cz91VV+Xj1JXFVgou3D662x0gz/ YmO2GponFTxN3KV0aft+/Z8FxTmMM1kdhR7LPT2wk3/S8QqTVzfuKv2bEfO04+qC639Zu54l eu9j3SSn/f7Myrl5863OHAkq3///vpJV0YY7FW/vPOlUefWj+qimqaXutuj49g8Z5i1KLMUZ iYZazEXFiQAAQEnGJQMAAA== DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-samsung-soc@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 indicates tail point for 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; }