Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2492086ybl; Thu, 29 Aug 2019 08:54:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqybiOVrVEq167cxsAg3Yx3vTESy7+ON+3pSkWoopaP9FIiMeO8C+ihZxX2njjAHrpUiU+nj X-Received: by 2002:a62:144f:: with SMTP id 76mr12383584pfu.62.1567094091899; Thu, 29 Aug 2019 08:54:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567094091; cv=none; d=google.com; s=arc-20160816; b=UM5X6v/jG5Wiy9WcB7YroaurStU0gZVZLkeOcgFuSNR42Vd3Wjj+5/bJ8MFk8uEYnC pRRP1LorlMAD3FlVoWEzvt9BT7qCXIR8555w6MUUigOeveYOcefXGznq4JAm7EFbBsWF xAaPoV+WoHznxtjED3kUZO4zps309MmDJDnXtnAWC9j/SOP++bExrFeJSMCFC38kaSns 3v1L4p0inS7FfIkn4vKG0BWrQIFcVMw1sSIVd2iBd8zg7EG8jPudYjOj2rUSu2cqZnHW 2mAts6ufKrT6jDcghUKt0Kx1nIXkE11tvzxvkSC1756n1eKvWsUCxFmVCVpOlDIVE54r Bd5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:to:from; bh=OU1V//gc+CxEVF6k4y4qVxLPJva2gIy7mnbhpb0ZuXY=; b=ZoOvtIOaZyYUaD81yjx3y8kjKCN5jtwQq/RCFzpbJlwbwBxzWtrSzCtHarxUB8j8Tb IhFafUxDGlVxzcYu3Dnhkr4Zzo8AUkiPv87GahUmExTQGX/LJRMW6xDl4UjcQQNXNPxa e24QwYtrBstX1kzAPygW4kCLPEDyTE8YYmSrmw7jeG7sgSp7AK58LAdxXJz4aTQHC4+5 SgOxe9UcrYYMCY6QqN4PHeBUw+5Ai1Aw23C8IWnao+Il/0KvP5ScJcSHlJ4A4seaYz23 MXB6kMqrXYkcPn+bDLd6ub1zHsIxxZ5huoEbDo7po5f3GhgkY2e41IQmrImlgzBPqRK2 J6eg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v189si2190314pgd.289.2019.08.29.08.54.36; Thu, 29 Aug 2019 08:54:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728744AbfH2PwC (ORCPT + 99 others); Thu, 29 Aug 2019 11:52:02 -0400 Received: from mx2.suse.de ([195.135.220.15]:32846 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728250AbfH2Pug (ORCPT ); Thu, 29 Aug 2019 11:50:36 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id C4CC4B69F; Thu, 29 Aug 2019 15:50:34 +0000 (UTC) From: Thomas Bogendoerfer To: Ralf Baechle , Paul Burton , James Hogan , "David S. Miller" , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH v2 net-next 06/15] net: sgi: ioc3-eth: get rid of ioc3_clean_rx_ring() Date: Thu, 29 Aug 2019 17:50:04 +0200 Message-Id: <20190829155014.9229-7-tbogendoerfer@suse.de> X-Mailer: git-send-email 2.13.7 In-Reply-To: <20190829155014.9229-1-tbogendoerfer@suse.de> References: <20190829155014.9229-1-tbogendoerfer@suse.de> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Move clearing of the descriptor valid bit into ioc3_alloc_rings. This makes ioc3_clean_rx_ring obsolete. Signed-off-by: Thomas Bogendoerfer --- drivers/net/ethernet/sgi/ioc3-eth.c | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/drivers/net/ethernet/sgi/ioc3-eth.c b/drivers/net/ethernet/sgi/ioc3-eth.c index d9d94a55ac34..e3867ea9abb7 100644 --- a/drivers/net/ethernet/sgi/ioc3-eth.c +++ b/drivers/net/ethernet/sgi/ioc3-eth.c @@ -761,26 +761,6 @@ static void ioc3_mii_start(struct ioc3_private *ip) add_timer(&ip->ioc3_timer); } -static inline void ioc3_clean_rx_ring(struct ioc3_private *ip) -{ - struct ioc3_erxbuf *rxb; - struct sk_buff *skb; - int i; - - for (i = ip->rx_ci; i & 15; i++) { - ip->rx_skbs[ip->rx_pi] = ip->rx_skbs[ip->rx_ci]; - ip->rxr[ip->rx_pi++] = ip->rxr[ip->rx_ci++]; - } - ip->rx_pi &= RX_RING_MASK; - ip->rx_ci &= RX_RING_MASK; - - for (i = ip->rx_ci; i != ip->rx_pi; i = (i + 1) & RX_RING_MASK) { - skb = ip->rx_skbs[i]; - rxb = (struct ioc3_erxbuf *)(skb->data - RX_OFFSET); - rxb->w0 = 0; - } -} - static inline void ioc3_clean_tx_ring(struct ioc3_private *ip) { struct sk_buff *skb; @@ -841,6 +821,7 @@ static void ioc3_alloc_rings(struct net_device *dev) /* Because we reserve afterwards. */ skb_put(skb, (1664 + RX_OFFSET)); rxb = (struct ioc3_erxbuf *)skb->data; + rxb->w0 = 0; /* Clear valid flag */ ip->rxr[i] = cpu_to_be64(ioc3_map(rxb, 1)); skb_reserve(skb, RX_OFFSET); } @@ -860,7 +841,6 @@ static void ioc3_init_rings(struct net_device *dev) ioc3_free_rings(ip); ioc3_alloc_rings(dev); - ioc3_clean_rx_ring(ip); ioc3_clean_tx_ring(ip); /* Now the rx ring base, consume & produce registers. */ -- 2.13.7