Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp1467913rwr; Thu, 20 Apr 2023 15:57:18 -0700 (PDT) X-Google-Smtp-Source: AKy350YWkfiJGQsm2EB7cJ+OyJ8o9P7ehjNsN9luUSeH2YCVaxeTgz78WyV579R7cwf2qd3KrCVU X-Received: by 2002:a05:6a00:1801:b0:638:edbc:74ca with SMTP id y1-20020a056a00180100b00638edbc74camr4190211pfa.0.1682031438060; Thu, 20 Apr 2023 15:57:18 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1682031438; cv=pass; d=google.com; s=arc-20160816; b=SFxuTu5d+eaKY9isJzMB/3N6f29t0zHQJg8zy0UnqmxaLcHu1QRvaiaXvXQ+8e3rqW OYj4rIeS9ieUlq8MpHccA8nouiBToKEeFLPJaZ5i4Byixq/Xtck6foBlYQE2xqy9hP8E 1svhZBp96DnYQcRpLrcEjxHi/aztXDkEQZKWBMwvyyFB3P65/1Ahlq6bUHQAo3rFK9yT 20gUDx+QQn+QjsNh4+6Uem6lQ091ews8xTqZVwkkHjNlPd61/xSCX3kRFblN1CQl/O/l JVNXu0QEsXpETli2N8YdV2U0MGwNBSMyDBHVkcusRxN4tRKx6CWXLcm3/og8bc4Y/Sxg Nmug== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=4DwvKhPtyrnRR8jBdwjW0fZZSak3WUxISQHdv84nq1U=; b=utw5TSEc7CXps8HE05jWTfvv4VT88qDgewhy8lU5HuCmzCafkdd8G2OsHhtEHWW9us mFg3U0VlbUDSWcHbtcP/nKepi6F4gQ0lA0lrzglw81vdSJPGdGPnolWEYMA2/fMy5BXD kElbwh+q91eYMJwDJ87zTsPAhHdamHyD3vMaUhOx3modIqVMc9w34BFwBPCHdEbca7We h5/sc36sRCY+sLJC1ELBtv1ZHwVW93PHLfZ2QWHVoTb3FRnEklv4GogMQxVJIHa7TGOa SoAxNePikdTGFrcTMl5r0qLjSKMJj0MYO5rJ3FoRmY8F3LrYFFJqezw4IXj6Wcq4vIxO k7FA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=XRJhc8Cd; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f16-20020a63f110000000b0051b4eaac57esi2749020pgi.583.2023.04.20.15.57.06; Thu, 20 Apr 2023 15:57:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=XRJhc8Cd; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232935AbjDTW4S (ORCPT + 99 others); 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 Content-Transfer-Encoding: 8bit Content-Type: text/plain 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: =?us-ascii?Q?ve94UxeB0xCY0yfWC5jK8T8QmLhhMPzx+29QUk9jNUyVfAL+Waox9Naz4e1N?= =?us-ascii?Q?d0n7xbWeltLWwDj80wGqyAwtcrMwkM+1zy9rGMJAD8nCJliWEEHsDz5reLrB?= =?us-ascii?Q?+U0wJecYSUw5lNHVmsagcLpEsbuKkefFLV2U4JHdMMcgkgsHjTotylZMsOFf?= =?us-ascii?Q?BKsWzBsZsqUee42Vo5gx0sNzKRs1zVQ7sfT9khcnjt8D/F4ebTMM9AQMSZZM?= =?us-ascii?Q?J0Ri7BAk4WauDFTKm1o5q+YvLw8Cz7vQeDBCfI2wxJmR4v+Wf9VSP9Qup4jm?= =?us-ascii?Q?vTiP7JaTnIDzPSaL2VkJvppDINFmqGsUue9Dt6tPb5+2RLEAaOCe5HCrshTd?= =?us-ascii?Q?Sfnneox0ZFVdCsNZ2FF5GReMPs6SQaGWDWKCiiL0thBbVdc1NmwMqRUVSDtT?= =?us-ascii?Q?DpwDmLeJC+msZFJf4F6l48Krze1YepESPiizNg7KFdcOzEvG6I7gjfvPRNU6?= =?us-ascii?Q?nbBq45TgitSDUFCn0l7vACnJKp3aqhMHS88XYT+yvuB8jZwhet4SuSIyD3lK?= =?us-ascii?Q?qL/79ssDfxb5QT4kFaZ6jbF+l9G9XMCdMFY6/fHtB+WHnR25A7VhP4ulC6GN?= =?us-ascii?Q?aQpFOYOO4k225v8kqnVHGdZorIsKWLnrGF3e6oXA4EnVeZ9f/obY05urtRL8?= =?us-ascii?Q?DlAadqrb9pSllFffKFT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Q?J5JMCkvDsqriwokuHOMb5CNeXLkCrzssxY9ZSkoFUlI9idATr/QZcdsHKKNM?= =?us-ascii?Q?uw=3D=3D?= 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 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.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(-) -- 2.34.1