From patchwork Thu Apr 20 22:55:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 13219269 X-Patchwork-Delegate: kuba@kernel.org 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 0EA3AC77B73 for ; Thu, 20 Apr 2023 22:56:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231636AbjDTW4g (ORCPT ); Thu, 20 Apr 2023 18:56:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233163AbjDTW4X (ORCPT ); Thu, 20 Apr 2023 18:56:23 -0400 Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on2070.outbound.protection.outlook.com [40.107.14.70]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 45A046196; Thu, 20 Apr 2023 15:56:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=A45W4X6H05vlFst4oWKrYZUTguwqd/Wq62k4R9+Y1ZLFprTD+7+jpvM+a2xpGjzJHO6pudDigFdfKS0urhkV+2nZQ6WJdasifF94d4ulFhJX8xDTQAJLe9LmwlMwNh195dKG7Pd/SyPfuCzsPDrSL4Tz7iv9dpjxUszx3NaFDYMEe4PjNO1CidzkaepRkgXUBxwYbHNmVQWh8zw6Vk/k91OWqyC1uP9HCfGHqW/uJkUYllsjVm5e+E0NKAUR7EYq9l3kX2Tw58Ww1NRm+SMv0OToa5YCVsZO7I3STxCFBGiP/V7T9CaG7TwUICjereaS5thfL8pTyHjs6cd8tZ0tLQ== 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=c0t9cQiyv9+2haPB/Rp5vs/Y5Bt5Q7jRQTlXdtGEWms=; b=h8Urt9erexpEyeFXRLfbI2dFGDAXa0KxsLW/dLLYFz26wRrwAsRV97IdieGLJCLbAVYF4bxn/9x88QgedZLXLgtX9JzeCTrKYbPoWQS0/QJi9/elw8qnT4XkJ6nf2CHsKpr5M9cnJvqbD/+TNo++Ae0PNo7ZOLyg3fSRgqM0eZqXgph0saxurt93+TuJMSwlA0xvOvkVb0NwJJmZlFfMIPnG3MaocZNbLkFR3qT0XkIuyt62gXXzedAXC8wW8Meg6bDpJja6M8mD6MvhgCc2whGBZ/N9tLjVMrcj9U3sJQCv2OrEv0Rhba+WSICDvpeWcJyqzxFMwSvDOv8rQpgfxg== 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=c0t9cQiyv9+2haPB/Rp5vs/Y5Bt5Q7jRQTlXdtGEWms=; b=U4orHWsDJHen7pcmx+A+SGKCW0gnJ1E959Sh/H05nMa4efxejpn9ms7pYVU7H2lQNY3vTtW2v0H3045VnJHkDxq5Eub5OYtqF+lL+SbWLtKuvwKblbFksOQUMXY14CvG/AC2y3pym9NqRAI+hOgoNTeGpu7dJZqhqZ/bkpi6uE4= 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:16 +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:16 +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, Simon Horman Subject: [PATCH v2 net-next 6/9] net: dsa: tag_sja1105: don't rely on skb_mac_header() in TX paths Date: Fri, 21 Apr 2023 01:55:58 +0300 Message-Id: <20230420225601.2358327-7-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230420225601.2358327-1-vladimir.oltean@nxp.com> References: <20230420225601.2358327-1-vladimir.oltean@nxp.com> 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: ef59bcb2-7054-40f1-4a96-08db41f272b4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BtYZigeyuZHT5KDr5PRB7gCl7+e/iLpovsaGl3LeMzVcVrxwmEco0yBd2HhVPP+QW4oe+99fLuSE592Sju/Fq1lEJ/P+D9iwR4AcfXIHLlAMXTlVzQaaRxk+7l+hcgk/ZMolUr7ED1b5xH+QAfXP1UOZbLB2jAB73VInktiR9D0vjwNdhqdIYS3bfAgI7ycu6UP9M2e/z9/1NeZ360XftPXBSOTx0WEt1CRD1QFJfj2lmvEGX+rcjYnmwLTtfRCPqN3f9Lk1Y9i1N2koSrvLv735eu0sTmiep3dxtdRG3PNbF6YyrVmV3sjor3j+97BdVwIaswgxnbuZK+Vv6prEABUmpJxAPmPrVb5/MBwM1nrhrMyXrgvtHIstnnEE8zFl6QlliuT2ytdzo6m9UVasiSqsNriOJez75XcIY6oftxP8+3CFNZCrADTdh9zCEl027QPCWCBXzRWyqg2XMKM3P2l4Lgf1quT/h6KvQYp3ddCtOrrNk9f1dLTBsc9tL8dAhgxUDQUWYe2ehwR231aeoawoMNqmS0QdCXrRehzy3rkEMIRESYYLj25gk85PbSxSfgpI7v0f8Zu9w5x5IaBFgMJtQZoGqKQSMf9Q3yyNDUxMeENkvngfyujzqopAkMvr 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)(478600001)(54906003)(316002)(41300700001)(66476007)(66946007)(66556008)(6916009)(4326008)(26005)(1076003)(6506007)(6512007)(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: ZTEYxNjFY12egojz2UCm9Jx/r02oa4gy812gN4PHwqkvVsu4I4WQcuU4kY0IIpJgCazThml2bYgqHBwL+7zX1zvu6zHa2I3f3EFDMC6XdeMryaXSh1FRJQi2H2lQLMAdgAv6SviIapkNGzbs4FjqcJ3LiHcuS6C+iskCedWiaX0Q1X/3irxqBRUN9OKKqugdvKFA6x6OcEaFoZ7WjZuBudKm9eNqUR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owOAKrQ+ftDXlBqLaXlW4PkrrrC6NDMV8RgY6LnmSzTuCpwliqGR3JYVwkpqvjgz4FfZvA+PjzT0h0CBQY9B/9hq4aV5EIpPdtKgWb1P+YZIG+vdPKRcu6bWifqhCGOsiRbe+Z/WGux7LaYC3A0X+vW2xbAeuIsq9LUdjSKSWd8baPZqzHBCMOM3cklk3rPugs5blCSPlLghopAbra9oxjai2zHkah1sTdGy136g4URYZDdViY5B2c08o0Kyk1O/rvaZE+NabDEW+5cbThbW6srSHjp+XJDbPWaYz2iRqZ6jojS8UjqXsIsTbYVtg== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ef59bcb2-7054-40f1-4a96-08db41f272b4 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:16.6735 (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: R36w6X+fGlhtpxxktOB3Ap+z0p2ZBRVhRnRjC4kJqQIzOFrGUafgLq0pWMRvR1uq29d3cp2pJElwY7EAUvI7fg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR04MB9213 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org skb_mac_header() will no longer be available in the TX path when reverting commit 6d1ccff62780 ("net: reset mac header in dev_start_xmit()"). As preparation for that, let's use skb_vlan_eth_hdr() to get to the VLAN header instead, which assumes it's located at skb->data (assumption which holds true here). Signed-off-by: Vladimir Oltean Reviewed-by: Eric Dumazet Reviewed-by: Simon Horman Reviewed-by: Florian Fainelli --- net/dsa/tag_sja1105.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/dsa/tag_sja1105.c b/net/dsa/tag_sja1105.c index 1c2ceba4771b..a7ca97b7ac9e 100644 --- a/net/dsa/tag_sja1105.c +++ b/net/dsa/tag_sja1105.c @@ -256,7 +256,7 @@ static struct sk_buff *sja1105_pvid_tag_control_pkt(struct dsa_port *dp, return NULL; } - hdr = (struct vlan_ethhdr *)skb_mac_header(skb); + hdr = skb_vlan_eth_hdr(skb); /* If skb is already VLAN-tagged, leave that VLAN ID in place */ if (hdr->h_vlan_proto == xmit_tpid)