From patchwork Thu Apr 20 22:55:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 13219263 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2C5EEC7618E for ; Thu, 20 Apr 2023 22:56:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232842AbjDTW4S (ORCPT ); Thu, 20 Apr 2023 18:56:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39280 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232762AbjDTW4R (ORCPT ); Thu, 20 Apr 2023 18:56:17 -0400 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2063.outbound.protection.outlook.com [40.107.21.63]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0847A3C3A; Thu, 20 Apr 2023 15:56:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kOQpLtZynJDPy1WCdGkRiowHi05ap6q6YQCk7wTdBCOSZPrziwEaDxOVj08qv3DDyNX8MFRW52hMC2EhiBirAEg6BjobaCuSDEBdPACHPq1EJ6W3NzGxQg83kfzaCFSs1Uf3GCYgnYdzCdxSfSaiSRHbGlkhpabpDsVr0Va1r43VVKt0OQ0Wf0LtD+5kZhu209TYgPczxuSsy47cKm3JY7TJhcqn+1WI9aOmEFYdXo++ecyciyv7tf6yRq5GTd0Dg8WDzGjfNTmV0iM8Wml3GIVbmyJMtjd5vufl96iUJYuoLSicoij1zSKeOam+QrtXBHF/ydnU20WYQtftlZlLBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=4DwvKhPtyrnRR8jBdwjW0fZZSak3WUxISQHdv84nq1U=; b=fjov1F46DwHR+1gstS3H0IjAHDS19MP/eOs8xm0Q05fGiEoLCsLeubYBDAqEI+kZbJ/U7/SV9+kyhgV4l1rLk0CPiQfIS0aE6yOpl0PBRUrqNA4pFUl4KjC+L+rctoNFYowQsIfppLvWqDq/ZlX70icPTYyZaMdX3vwXI92p3QagFjjvX42qwxQT3szHXtrqaiKnWJRV4XULxJvvRXtQJ2gJvZg+5ON0SRiDUJmLAX7KtTMC6WIz/pBe72QqOd+GsETb6jFJ6nN3fyhColEC5o1vvnejs+Kp7o8//aXQwKB6kGiwBsrV70uVuAxX6/p6LH/YW76hsmzSGVFpxXhX/w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4DwvKhPtyrnRR8jBdwjW0fZZSak3WUxISQHdv84nq1U=; b=XRJhc8CdT2eu5oNAQJWsWII3t+xC+ZP1e98xlZv7DSNV2IsptLBB894JarWRHkYoqSMC6qKFR5wYXrUPCJq5NlcjbJxA7YvbyaGmgNAPMfz+bKXHJws9USC1CEviWlPMeDsEU6PGECqPsyG5/i7W5NC4bEDbcF8Gbl7tVNR3qkY= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) by GV1PR04MB9213.eurprd04.prod.outlook.com (2603:10a6:150:28::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.22; Thu, 20 Apr 2023 22:56:12 +0000 Received: from AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::245a:9272:b30a:a21c]) by AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::245a:9272:b30a:a21c%3]) with mapi id 15.20.6319.022; Thu, 20 Apr 2023 22:56:12 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Andrew Lunn , Florian Fainelli , linux-kernel@vger.kernel.org, Madalin Bucur Subject: [PATCH v2 net-next 0/9] Remove skb_mac_header() dependency in DSA xmit path Date: Fri, 21 Apr 2023 01:55:52 +0300 Message-Id: <20230420225601.2358327-1-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: AM0PR03CA0088.eurprd03.prod.outlook.com (2603:10a6:208:69::29) To AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0PR04MB6452:EE_|GV1PR04MB9213:EE_ X-MS-Office365-Filtering-Correlation-Id: 9bb9aceb-f42b-42d1-36fc-08db41f2700f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nB51siPNo4Vo93ZkLNr1cC4WhCMBHEuS5tiSkdym0lryQ1nuKv1hFVlY4IvnuZ5AsyEbTqysR6ftvmziBKZ/+9N0wbopTFEEZRf60H9su9a9ViExi5QG/CHeVwYs2l2VHROaF7fFrKlonqxIBdTfrxENAmFRh2fERxg4sFtFo+folfseo+a0JZv7ElQkY+limTnS/WEj0YzjaDNPJDhS/+DdAjl2B48e2lspYWrNwQzLTKqsp5F7bTKpKhdfaOcEu1Gv99s+zIKYq+3sKaPX5p9fEsY8BiSeb0w8fAfMxnwpc7kVLbRtZbMg+rBvTL/Rw7O8Sw1uscIvmg9m34KtAaH27i1t6yUMo86THRtx1aX8PQv+hB72E3qElcU94sWUpysD0liwAFjE9tcnYZ/mchWTZFfiPqk9JJT+BQSt/rgYUnf9ufVgAOPu95NNO4jvug4v21VRXDvm1X8VAe4h/0hsNilFo/r1+gmTmsp/6EaEoUQQqn0lEIdHccvtxRGJfDdvpHErCAxovH3YgAY6/jzLZHq6hEBmI/MSNtL9V8VviuXJXJ5O0LxsR1j9SJ9/94FMtngO4AqqzhtT8I126QtSatiDwT6/YDhjnFK03y/gTNSRVC5bJ3L1IlvXYWqilVo1KVO1nqEYpVVCzeK8MA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR04MB6452.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(346002)(396003)(366004)(136003)(39860400002)(451199021)(2906002)(38350700002)(38100700002)(86362001)(66899021)(478600001)(54906003)(316002)(41300700001)(66476007)(66946007)(66556008)(6916009)(4326008)(26005)(1076003)(6506007)(6512007)(966005)(6666004)(6486002)(52116002)(186003)(36756003)(8936002)(8676002)(83380400001)(5660300002)(2616005)(44832011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ve94UxeB0xCY0yfWC5jK8T8QmLhhMPzx+29QUk9jNUyVfAL+Waox9Naz4e1Nd0n7xbWeltLWwDj80wGqyAwtcrMwkM+1zy9rGMJAD8nCJliWEEHsDz5reLrB+U0wJecYSUw5lNHVmsagcLpEsbuKkefFLV2U4JHdMMcgkgsHjTotylZMsOFfBKsWzBsZsqUee42Vo5gx0sNzKRs1zVQ7sfT9khcnjt8D/F4ebTMM9AQMSZZMJ0Ri7BAk4WauDFTKm1o5q+YvLw8Cz7vQeDBCfI2wxJmR4v+Wf9VSP9Qup4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LrOH6OqecXCt30xsWLhK0D3FwNhKmXDlsMQvMNg3JFZIqu47mranwc6geS7GSQPSoaT9yRhKHAcbYDofaGQVCcYvOopHo1sUn6f9jxP2G5dkWSPuC2iXH+MEn8mlUrY0VobsKqe+s0+lONqyxQVIkWZpNGuF+0fs7mNSBrknoNJ5JMCkvDsqriwokuHOMb5CNeXLkCrzssxY9ZSkoFUlI9idATr/QZcdsHKKNMuw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9bb9aceb-f42b-42d1-36fc-08db41f2700f X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB6452.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Apr 2023 22:56:12.2606 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 1CMJXnxAnMlzZtLUhxzJZauSTAQsw5uO1+z2MaiqEpSfy92zAosX913gYg6aRKpe06s4pKx5UBGk3+JTPaFPWQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR04MB9213 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Eric started working on removing skb_mac_header() assumptions from the networking xmit path, and I offered to help for DSA: https://lore.kernel.org/netdev/20230321164519.1286357-1-edumazet@google.com/ The majority of this patch set is a straightforward replacement of skb_mac_header() with skb->data (hidden either behind skb_eth_hdr(), or behind skb_vlan_eth_hdr()). The only patch which is more "interesting" is 9/9. Another potential caller of __skb_vlan_pop() on xmit (and therefore also of skb_mac_header()) is tcf_vlan_act(), but I haven't had the time to investigate that (enough to submit changes other than what's here). v1->v2: - 09/09: document the vlan_tci argument of vlan_remove_tag() in the kdoc v1 at: https://lore.kernel.org/netdev/20230322233823.1806736-1-vladimir.oltean@nxp.com/ Cc: Madalin Bucur Vladimir Oltean (9): net: vlan: don't adjust MAC header in __vlan_insert_inner_tag() unless set net: vlan: introduce skb_vlan_eth_hdr() net: dpaa: avoid one skb_reset_mac_header() in dpaa_enable_tx_csum() net: dsa: tag_ocelot: do not rely on skb_mac_header() for VLAN xmit net: dsa: tag_ksz: do not rely on skb_mac_header() in TX paths net: dsa: tag_sja1105: don't rely on skb_mac_header() in TX paths net: dsa: tag_sja1105: replace skb_mac_header() with vlan_eth_hdr() net: dsa: update TX path comments to not mention skb_mac_header() net: dsa: tag_ocelot: call only the relevant portion of __skb_vlan_pop() on TX .../net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 3 +- drivers/net/ethernet/emulex/benet/be_main.c | 2 +- .../net/ethernet/freescale/dpaa/dpaa_eth.c | 9 ++--- .../net/ethernet/hisilicon/hns3/hns3_enet.c | 2 +- drivers/net/ethernet/intel/i40e/i40e_txrx.c | 2 +- drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 2 +- .../ethernet/qlogic/netxen/netxen_nic_main.c | 2 +- .../net/ethernet/qlogic/qlcnic/qlcnic_io.c | 4 +-- drivers/net/ethernet/sfc/tx_tso.c | 2 +- .../net/ethernet/stmicro/stmmac/stmmac_main.c | 7 ++-- drivers/staging/gdm724x/gdm_lte.c | 4 +-- include/linux/if_vlan.h | 36 +++++++++++++++++-- net/batman-adv/soft-interface.c | 2 +- net/core/skbuff.c | 8 +---- net/dsa/tag.h | 2 +- net/dsa/tag_8021q.c | 4 +-- net/dsa/tag_ksz.c | 18 +++++----- net/dsa/tag_ocelot.c | 4 +-- net/dsa/tag_sja1105.c | 4 +-- 19 files changed, 66 insertions(+), 51 deletions(-)