From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 80302C2D0CE for ; Mon, 30 Dec 2019 14:31:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 53A5C206DB for ; Mon, 30 Dec 2019 14:31:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=dlink.ru header.i=@dlink.ru header.b="AfD3z3gG" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727512AbfL3Ob1 (ORCPT ); Mon, 30 Dec 2019 09:31:27 -0500 Received: from mail.dlink.ru ([178.170.168.18]:39334 "EHLO fd.dlink.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727397AbfL3Ob1 (ORCPT ); Mon, 30 Dec 2019 09:31:27 -0500 Received: by fd.dlink.ru (Postfix, from userid 5000) id 07A8D1B205E4; Mon, 30 Dec 2019 17:31:22 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 fd.dlink.ru 07A8D1B205E4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dlink.ru; s=mail; t=1577716283; bh=RwOI8oAxd+fijp+Xuc6Oa+5EbKzjW8W4KCZUcnbzQOs=; h=From:To:Cc:Subject:Date; b=AfD3z3gGGkGDyB8iUL7HkxTbdGP3pnAL7i9Q9EwC2vC5GbqRF7bSN/0kB1+VO2nRB JFg2AVQi0ZN9KLo4p2hwxgiIybR7VJR9YeSXtMtnGJC8Y7XUFG0qAKmAMKrSGeA0PY /987XTEF+cxaPYxezYI+xaoBmTqXEKpVYb43fgO8= Received: from mail.rzn.dlink.ru (mail.rzn.dlink.ru [178.170.168.13]) by fd.dlink.ru (Postfix) with ESMTP id C75FB1B205E4; Mon, 30 Dec 2019 17:31:03 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 fd.dlink.ru C75FB1B205E4 Received: from mail.rzn.dlink.ru (localhost [127.0.0.1]) by mail.rzn.dlink.ru (Postfix) with ESMTP id CA84D1B229CB; Mon, 30 Dec 2019 17:31:01 +0300 (MSK) Received: from localhost.localdomain (unknown [196.196.203.126]) by mail.rzn.dlink.ru (Postfix) with ESMTPA; Mon, 30 Dec 2019 17:31:01 +0300 (MSK) From: Alexander Lobakin To: "David S. Miller" Cc: Edward Cree , Andrew Lunn , Vivien Didelot , Florian Fainelli , Hauke Mehrtens , Sean Wang , Matthias Brugger , Jiri Pirko , Eric Dumazet , Paolo Abeni , Jakub Kicinski , Alexander Lobakin , Taehee Yoo , Stephen Hemminger , Stanislav Fomichev , Daniel Borkmann , Song Liu , Matteo Croce , Jakub Sitnicki , Paul Blakey , Yoshiki Komachi , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH RFC net-next 00/20] net: dsa: add GRO support Date: Mon, 30 Dec 2019 17:30:08 +0300 Message-Id: <20191230143028.27313-1-alobakin@dlink.ru> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org As of now, napi_gro_receive() in cases where the corresponding device is installed as CPU port of DSA-driven switch is in fact an overheaded version of netif_receive_skb{,_list}() with no advantages over: - dev_gro_receive() can't find packet_offload for ETH_P_XDSA type; - so it immediately returns GRO_NORMAL; - napi_skb_finish() passes skb to gro_normal_one() -> netstack. This series adds a basic infrastructure to allow DSA taggers to implement GRO callbacks and adds GRO support for 5 tagger drivers: * tag_ar9331 * tag_gswip * tag_lan9303 * tag_mtk * tag_qca I didn't make it for the rest because they are in fact way more complicated (e.g. combined DSA + 802.1q tag etc.) and require more familiarity with them and tests on the real hardware, which is inaccesible for me at the moment. This series also includes a bunch of random fixes in several tagger drivers and some cleanup. I left them all in one place as they depend on each other, but there's no problem for me to split this into different series. I mark this as RFC, and there are the key questions for maintainers, developers, users etc.: - Do we need GRO support for DSA at all? - Which tagger protocols really need it and which don't? - Are the actual changes correct in every single tagger code? - Does this series bring any performance improvements on the affected systems? - Would anybody mind if we'd add DSA support to napi_gro_frags()? - Any code/other comments/notes. I also would like to see more taggers with GRO callbacks, such as DSA and EDSA, and the results of their addition. Alexander Lobakin (20): net: dsa: make .flow_dissect() callback returning void net: dsa: add GRO support infrastructure net: dsa: tag_ar9331: add .flow_dissect() callback net: dsa: tag_ar9331: split out common tag accessors net: dsa: tag_ar9331: add GRO callbacks net: dsa: tag_gswip: fix typo in tag name net: dsa: tag_gswip: switch to bitfield helpers net: dsa: tag_gswip: add .flow_dissect() callback net: dsa: tag_gswip: split out common tag accessors net: dsa: tag_gswip: add GRO callbacks net: dsa: tag_lan9303: add .flow_dissect() callback net: dsa: tag_lan9303: split out common tag accessors net: dsa: tag_lan9303: add GRO callbacks net: dsa: tag_mtk: split out common tag accessors net: dsa: tag_mtk: add GRO callbacks net: dsa: tag_qca: fix doubled Tx statistics net: dsa: tag_qca: switch to bitfield helpers net: dsa: tag_qca: split out common tag accessors net: dsa: tag_qca: add GRO callbacks net: core: add (unlikely) DSA support in napi_gro_frags() include/net/dsa.h | 10 ++- net/core/dev.c | 11 ++- net/core/flow_dissector.c | 8 +- net/dsa/dsa.c | 43 +++++++++- net/dsa/dsa2.c | 1 + net/dsa/tag_ar9331.c | 139 ++++++++++++++++++++++++++----- net/dsa/tag_dsa.c | 5 +- net/dsa/tag_edsa.c | 5 +- net/dsa/tag_gswip.c | 126 +++++++++++++++++++++++----- net/dsa/tag_lan9303.c | 139 ++++++++++++++++++++++++++----- net/dsa/tag_mtk.c | 115 +++++++++++++++++++++----- net/dsa/tag_qca.c | 167 ++++++++++++++++++++++++++++---------- 12 files changed, 629 insertions(+), 140 deletions(-) -- 2.24.1