From patchwork Tue Jan 7 00:12:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rosen Penev X-Patchwork-Id: 1218524 X-Patchwork-Delegate: gch981213@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="QB1bZvW3"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="bw9lgyHd"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47sCVn54xSz9sPJ for ; Tue, 7 Jan 2020 11:12:16 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:MIME-Version:Message-Id:Date:To :From:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=+dbbhbC4HzW11DKtDruC8aNAJkVVUeAFzuPPljQ+lh0=; b=QB1bZvW3zyNCje aFJMLhOWwF7U8qh674N8Rv8d0O8AmrKaN+xPZjYIXBVqZE0fhxX0YHVdUW+5A6wG0kh1lapDy299g kq6rahHvv8VgB3J9eUdhRLOKTqFOV2l94DLePKVbUBmFQf6+HPwYE6u9L7JeXB+KGisd/Bqe/JHP9 jf8EFvv5CiO1xTre5TVGtRJ5ng+pDSxn72pYbAKNMMr4em9QhR82oS3GcmhcOcqfJP2Y5Cn/Pzc/c LCtyCq7HFJ4b2XHkMppg24g448lXAYFGpLA6FByzeVBYJYTIGnvSNTUwl1aJqDJgf1EVaXdIzxKn8 kTZt3LqtHFXmqUJQrQNQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iocTh-0007ij-Ri; Tue, 07 Jan 2020 00:12:09 +0000 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iocTf-0007iQ-0a for openwrt-devel@lists.openwrt.org; Tue, 07 Jan 2020 00:12:08 +0000 Received: by mail-pf1-x441.google.com with SMTP id p14so27679031pfn.4 for ; Mon, 06 Jan 2020 16:12:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=5SWgIZrY276J5XZXc8l1iNViGzCqI4HJbsg6CQo2rx4=; b=bw9lgyHdwGWev99nCRGMmfBqaowj8pAc+CQYz7Jehcu4yi9eyklPp+cQ0glyfmtb3k iHyEcAuDuy8YzfVRKRpYz+4+Zp75DsdAMXJoYhUhiH4YSUaBg519c1l1hoE4HNZ7FiOu HDX9rbuhDDkknyrkZycakGbiiXUeLezRKtWaAecA9CL/dU2KcNFOacw+8ltJsWTRUoK8 TXT8vbyFWeXuocbH2XbvN4j6XKuWloZnCP5ju0JOsX7qTmrtAjkC4DTTfusHA0tYkiVf 4Q82v/lyZeNj9Y7/zhNgR4XScFjD9B0bhaTqJRpjpqEQ8pPAqWh4sC+9CyuH0JQs5pgl UKRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=5SWgIZrY276J5XZXc8l1iNViGzCqI4HJbsg6CQo2rx4=; b=igPQkxc9O/lNbJOoT2f9rtog40NwZOJJnqh3GADmWtPXMbGfSrfm8gIz/N7voWdOvA g4QyIODQjVoGwfUnTslzxmbki14t7HXAxuoMFQ3Be0yBDgmaZED67S0C0MPGQvTTipoA A0qDyADOJ2BoGp5MndAlI6EuvrZXmY9U5DegDm4VVFw5Kz+bnSopAXXR0DpGlQTHCPZe 0JlYjsOTvu19FQ8/XToa4U3/8WQAr1wtG4cshWnyZ8n/iy3F/rD1ogbmrpbU88JRWC78 rc3ejG2NBLDf6sNVA+wjxdErk+xI3XSVRjISrINEuHl3qDxA/y8JdXiBx7JLziS+9W2N BEBA== X-Gm-Message-State: APjAAAX5WInWyfAFvHFclK+cZMtHjq5gfiFtQ5Vczb7Z5c+CWCcrPhKK twLWfJ2IwBmDmoxJb+DkmobUCqU5lRI= X-Google-Smtp-Source: APXvYqxjdlmN+VopGtb1Kqc338v/GneuqGqaRNPPeqj2tKI33H1DMcj/TU49v9OERMo3U0qT/rr0wA== X-Received: by 2002:a63:770c:: with SMTP id s12mr117612821pgc.25.1578355925736; Mon, 06 Jan 2020 16:12:05 -0800 (PST) Received: from localhost.localdomain ([69.42.0.214]) by smtp.gmail.com with ESMTPSA id u3sm75900279pga.72.2020.01.06.16.12.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 16:12:04 -0800 (PST) From: Rosen Penev To: openwrt-devel@lists.openwrt.org Date: Mon, 6 Jan 2020 16:12:03 -0800 Message-Id: <20200107001203.22342-1-rosenp@gmail.com> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200106_161207_053991_2137D15B X-CRM114-Status: UNSURE ( 8.69 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:441 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (rosenp[at]gmail.com) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain Subject: [OpenWrt-Devel] [PATCH] ath79: ag71xx: use netif_receive_skb_list on 4.19 X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org From: Chuanhong Guo This new function make batch processing of network packets possible, which slightly improves performance. Signed-off-by: Chuanhong Guo Tested-by: Rosen Penev --- around a 20mbps improvement is measured on a TP-LINK Archer C7v2 .../net/ethernet/atheros/ag71xx/ag71xx_main.c | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c b/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c index 0924b81b92..8831a51acc 100644 --- a/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c +++ b/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c @@ -1106,14 +1106,22 @@ static int ag71xx_rx_packets(struct ag71xx *ag, int limit) unsigned int offset = ag->rx_buf_offset; int ring_mask = BIT(ring->order) - 1; int ring_size = BIT(ring->order); +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0)) + struct list_head rx_list; + struct sk_buff *next; +#else struct sk_buff_head queue; +#endif struct sk_buff *skb; int done = 0; DBG("%s: rx packets, limit=%d, curr=%u, dirty=%u\n", dev->name, limit, ring->curr, ring->dirty); - +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0)) + INIT_LIST_HEAD(&rx_list); +#else skb_queue_head_init(&queue); +#endif while (done < limit) { unsigned int i = ring->curr & ring_mask; @@ -1155,7 +1163,11 @@ static int ag71xx_rx_packets(struct ag71xx *ag, int limit) } else { skb->dev = dev; skb->ip_summed = CHECKSUM_NONE; +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0)) + list_add_tail(&skb->list, &rx_list); +#else __skb_queue_tail(&queue, skb); +#endif } next: @@ -1167,10 +1179,16 @@ next: ag71xx_ring_rx_refill(ag); +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0)) + list_for_each_entry_safe(skb, next, &rx_list, list) + skb->protocol = eth_type_trans(skb, dev); + netif_receive_skb_list(&rx_list); +#else while ((skb = __skb_dequeue(&queue)) != NULL) { skb->protocol = eth_type_trans(skb, dev); netif_receive_skb(skb); } +#endif DBG("%s: rx finish, curr=%u, dirty=%u, done=%d\n", dev->name, ring->curr, ring->dirty, done);