[v2,net-next,6/9] net: dsa: tag_sja1105: don't rely on skb_mac_header() in TX paths
Message ID | 20230420225601.2358327-7-vladimir.oltean@nxp.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp674058vqo; Thu, 20 Apr 2023 16:05:21 -0700 (PDT) X-Google-Smtp-Source: AKy350bWNdEpV3HKKkewmBsAwwLTPgP+84P7KBq0/SMkgYJPYYWv9430+t6CXaHgAO6Me38pyxGj X-Received: by 2002:a05:6a20:3942:b0:e3:763e:555 with SMTP id r2-20020a056a20394200b000e3763e0555mr4316363pzg.57.1682031921002; Thu, 20 Apr 2023 16:05:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1682031920; cv=pass; d=google.com; s=arc-20160816; b=GFeI0fTS3BmJdS69mRnAjYc+9VZNZ3UrFCygs6TfwWLsOCnKiBRIVngzwHSUpm+8gc 3jLq17cPpnsMWV4vaALST1bxWhK+JnpKuyHuNdmyKQk8HulmMpoAYfyTUDMO5yUmP/LX 0qJgHOuhIOxgbCkqVBXabkEo2qZg6XTtlYSMZpQ7FZtWKlTa9U5J47cByXpJZXGjOg+A F3yh0liV3m31Ls//S0YMOh98O2/XmOj4Att6xqZrt2PldOxOeEBWbYUHdD1IjBAxZ1H+ sIHbdEFRaKRnPUsU3mVwTCMAMYte1hsmvbcQDeeaO70ZpZ+b/smG9Tzm1zksYUUj0e6p EFTw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=c0t9cQiyv9+2haPB/Rp5vs/Y5Bt5Q7jRQTlXdtGEWms=; b=pK410YIoW/b/avTuZ3BliFqsr7YHHc+HJy+gIlChExP3VcGBK+3FfXbSd9F4UGsTAA TbwBetB7tN6GJNbvB5WE0P9OKOirMaKQDJ+IxnIL6D+jdDkUD76ycUS8UFFhbtlHkAvd jkqH4sO3L56cy21jm5Pfp+jaKVf87YxMhpdr7KJ+iME39BIHwbMSFC46c/hqMoFwR9Rc VRch+B0TqaIFofNrvqFpqC5UluhjVNrT5x+/qJ4wBidYSOsEtFmX57ivGH1+5thxA5Gz 9AIRSnU0X8HNE+wRrPzn03t6WbhshN3vAsyEWEAm3n0+C+KNyLIaoS2JLHWndKSXn0Hn e/Ug== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=U4orHWsD; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q5-20020a632a05000000b0050af2178284si2979068pgq.819.2023.04.20.16.05.06; Thu, 20 Apr 2023 16:05:20 -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=U4orHWsD; 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 S233227AbjDTW4p (ORCPT <rfc822;cjcooper78@gmail.com> + 99 others); Thu, 20 Apr 2023 18:56:45 -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 <rfc822;linux-kernel@vger.kernel.org>); 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 <vladimir.oltean@nxp.com> To: netdev@vger.kernel.org Cc: "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Andrew Lunn <andrew@lunn.ch>, Florian Fainelli <f.fainelli@gmail.com>, linux-kernel@vger.kernel.org, Simon Horman <simon.horman@corigine.com> 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> 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: 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/3irxqBRUN9OKKqugdvKFA6x6OcEaFoZ7WjZuBudKm9eNqURGeiFu6EhenyG7NJMqp5C+p7ymw70TuSljGkis172zBJbiR0cpg6ARkCwBm4XGefw8BZ/gtBpRchCuGV9W/2dkYDlJiX3OL/n/+MjkT1qtvCabhV5euuDqdM5WFPVkkUqgnX4hp9+qV+nm2y3e9+CilLVHiKfz/ulvDxqnVnysQvsB82P+aff7ygSKyiDrzkh9C6SXnOIe/JHIniQpZNlgoxlhDphZ80RqCXKuc7XneuTnJWL2CKVQ+TlVIUHtdcHq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vaZE+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 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763738303471828253?= X-GMAIL-MSGID: =?utf-8?q?1763738303471828253?= |
Series |
Remove skb_mac_header() dependency in DSA xmit path
|
|
Commit Message
Vladimir Oltean
April 20, 2023, 10:55 p.m. UTC
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 <vladimir.oltean@nxp.com> Reviewed-by: Eric Dumazet <edumazet@google.com> Reviewed-by: Simon Horman <simon.horman@corigine.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> --- 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)