[net-next,3/9] net: dpaa: avoid one skb_reset_mac_header() in dpaa_enable_tx_csum()
Message ID | 20230322233823.1806736-4-vladimir.oltean@nxp.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp2635015wrt; Wed, 22 Mar 2023 17:00:35 -0700 (PDT) X-Google-Smtp-Source: AK7set8k8N3Pw/1vCwLvq3wQIsT7SVlYq81fQv3eoj1IIHGEaU7HY3k2MzyhiW0kNQrbtPh4+s9x X-Received: by 2002:a17:90a:e7c3:b0:23d:1e5f:eea6 with SMTP id kb3-20020a17090ae7c300b0023d1e5feea6mr6092433pjb.24.1679529635240; Wed, 22 Mar 2023 17:00:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1679529635; cv=pass; d=google.com; s=arc-20160816; b=ubUyIjDwHDuNHnwH63pWZ1iqiRxNOxjd7LNz/x1fHodWsk7QydO+uhEO22Rh3lxTzx QbintQY6AEI3ZGCh1MLu5iTe0z0uCUjdiCpCXTnAdDJVqKK0WCMIq5sHEmVcKhhdjJtU vB1gRJPNgNDi4H7WGOstWWlB3g5YD0Dyx/Up7o0OXGTR8WS+bnv4giFP+d0gGBPzyn4p 2iKEqcPicTVVaVjqdbpyKT77tU4b01ViwZZdz6NRs+nWujsVFZhvJzIkG2LFk65X4FGg 1Qt415jXDtGu3t5ETTPYfLe6wvqw7LCNXJ+a9TIICO7T5/XCvK3LYYaRqRio3vHQ7s+k ZwTQ== 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=sWoNA2qGlTD0NuWmXD6qB3Ml+r6i7UOgwiv8FaImTM8=; b=q23y13v0f1zPhktEY5rKIEoxEpIRepJkCEijmR8TBpn8XNFgvZMTTerfc4+LCRGqfT x8WxKOuZKzaCHGh0LKFO4hkSysxh8iAUGB9+qV+RhmDIXsLsQj2ynansgWzZytG6s/z4 FoRZUjjX/mrCWd8Bu/3IB8/RfRwBXtun7if5KGjfZY+4dOxj4pptfhp7bUrEONJ0DJyp ldY8WdLbMkH/OwSQA6ncvaQJoT/+UEHoNycIJmj7tTBvzJkjCSMlWYTodMhP/YkeeCO8 NUzUTPZCTfurYmT0/AKeY7OUEcAEvrKEI5OrQRiPzOltLgr2R2sQEHHSf+nQs2PNK/Am qCJQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=U1Jgs9ch; 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 mi14-20020a17090b4b4e00b00230cc557396si266244pjb.73.2023.03.22.17.00.17; Wed, 22 Mar 2023 17:00:35 -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=U1Jgs9ch; 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 S230103AbjCVXjE (ORCPT <rfc822;ezelljr.billy@gmail.com> + 99 others); Wed, 22 Mar 2023 19:39:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230119AbjCVXit (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 22 Mar 2023 19:38:49 -0400 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04on2048.outbound.protection.outlook.com [40.107.8.48]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F23223A41; Wed, 22 Mar 2023 16:38:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KoQBd+W2fkNBvHJWgkx7y1/LtGiTKXi79xhpdnbrlVy5082jVZhyVKu2VQLXPQS64VN8U3eY0lUiMhAppb3qa4ynTgcPbS5szP15xhGSss2cNBkuhIQbSmjvwno7qia06d0syJQeiOoD19MMEoCeemKG6C2Tk0uCAbqPZmB1FsYfH+/ad/skNkqdYj245b9UVzvjTbAjGAZryx3WT/eAPBXoZoIvk8DoFuaxmbRZJaiyWxKZ3oDc4lwjNmr9xNm9602LQxxACaNSarFmMWkhDscf4HXtMUPCGF8hFPhJdtqBXcrT2GsjTbW7JuN233lDoleJq31REIGPNuy7U7si+A== 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=sWoNA2qGlTD0NuWmXD6qB3Ml+r6i7UOgwiv8FaImTM8=; b=AVP7OChsL+YwSaeAVgtyEm1+lUZGdfEm2OR/cI2cAyKz2UbkWp+asbZLiW7gHajA1pOdGhiMNfzcLRDllaB4mcDfJEfrN4tXEvwkgiMKHSA051nRjHgbu84MRv0FZnp7RV/tOXp9CR+R6BqkyOS/NmMUvFWXBtd5awQ8HJbonQkY6E8e6UeSE2h/6kHWxzmoIcL/7BwtS0MS9okHIV5JgmOxiIPNO/BtAD/hDLgkidxhevPegjNBx9h4hyKrtSjZXOP4E5fDHj6E1CeZX2O/BJY7O+WlZ/gXV+UD0tf4roJL/sJ99yDXCTUPMMNygJfSnNSMuJDLzVt+DvOAgVFcTQ== 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=sWoNA2qGlTD0NuWmXD6qB3Ml+r6i7UOgwiv8FaImTM8=; b=U1Jgs9chbODeZsWgwdMMGaFADzDUJ5Q8+l2zBi6rjvo9o+70vdLNW6liUxClWMcgDnr03ngjmAWntdwnRAhD3YIkc2/CUkWfqa+q8WaaeeDe0J3cGefQGljUEGDMIuCkw9y9tXtUpe4h2kYgbzvJxhZHXtRBofahM4fpC5R7J0I= 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 VE1PR04MB7263.eurprd04.prod.outlook.com (2603:10a6:800:1af::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.37; Wed, 22 Mar 2023 23:38:38 +0000 Received: from AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::29a3:120c:7d42:3ca8]) by AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::29a3:120c:7d42:3ca8%7]) with mapi id 15.20.6178.038; Wed, 22 Mar 2023 23:38:38 +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 Subject: [PATCH net-next 3/9] net: dpaa: avoid one skb_reset_mac_header() in dpaa_enable_tx_csum() Date: Thu, 23 Mar 2023 01:38:17 +0200 Message-Id: <20230322233823.1806736-4-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230322233823.1806736-1-vladimir.oltean@nxp.com> References: <20230322233823.1806736-1-vladimir.oltean@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: FR2P281CA0081.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:9a::8) To AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0PR04MB6452:EE_|VE1PR04MB7263:EE_ X-MS-Office365-Filtering-Correlation-Id: e153b579-4170-429d-6cc3-08db2b2e8fb6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 12qFDzNXxBtwnMzMx9dqUAQs3yzfb9dPTSTiPgxVM+R6d2yVnGz+Bq3aYmvrTzFZug8UKiIAbPIRYkn9vR7e9TXqvxvVK0CvGKsCGCJqY3QP10gZrp/lKWAfqisUTuwDYwvHpbeuLH2XMtHNyggT0wQLU1Qj+BdMa4JmipMNX4Y9dgoyCSepUyK9S3elHv8Ixqvs3A/kqjOxxuO+xGvn1GHkagjYQMCt1gavc0lqLgwHYZ6v7EGWVgzGXqKDO1993vbJb+getRGrS74Bwrb/M7D26aZxgxrzMpiQYicV/061KTPK0v/xjEhYTYfcilyqVVhfRqdXK0aGzprjodVbN9PXysHOC9y9D0nyI9aH3eUTwwOIA9J/eZf88vr+xEHddybm5uWxMuwPV4wt66dHjOVfA8IRwd+dnMO55fIDPf1JIUrSu8ejlm4imBGLKLDkd2on1wbzdnB1K2LsKA3342CZxOTjhizsKofIC9wAryEEVrqEtLNyDPJiyy8EphOHTkfZchwn2lljjLm/MEWvGypkHSkhgSvUPoj8buHAzTQAE7qMP6BR/UMds5GHx5+mr12BASewZuWWiM+fjEf/VC9hEid1Mg75hL+07O/LkXZEaLSeIzqxTTfTyjS5/6WBJgESzuOGreH2y9KuXW/5aHvfI92R1oEB2GDbFpGTSH8T3gfp3SV8VIb+/o7U5yJXcR1JsONGF6G+GNqAAUiqif2CYrPS86wDd5WKeo0xFArdoREzr++vx2C3caukQqMW 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:(13230025)(4636009)(346002)(376002)(39860400002)(136003)(366004)(396003)(451199018)(54906003)(66556008)(6486002)(6916009)(316002)(66476007)(8676002)(66946007)(478600001)(6666004)(4326008)(52116002)(41300700001)(6506007)(1076003)(6512007)(26005)(66899018)(8936002)(186003)(44832011)(5660300002)(2906002)(2616005)(36756003)(83380400001)(38100700002)(38350700002)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: HdXlWNh62kuoPvEAEOxZc+vAqB5IVImmyiZXHWXdRjOqGVprjoOKB+hb7TjQ6B+d3gdNH/kJ1zCP4s+Qc//3V1cT2mBYnecetQD8nGGfbKPhuEg1Rhl/x5ZgUAyBqjQA+v1CLfZX9FIfuJ39iwQbtNcg1OUokWVqtNn3ZDzGHnGtg8tATEn6r8ZH7o+Oyqb3eVWCyvkuy3OEC/xyAYmdNEe95kxePJhVQjhJAViTJrLjrEOeVlmb+3mkZTtDohmOb00JhkgxldiwMqxq3io4sqNrR8crKv4a3PNYixamlg30Lk1+TPbxXpoN7pBoeNaiWnEhNT9hj9YKJjML1d0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pjYFli2fRV1nWb8B/gz2Bz2PFip5i4mLAUPObvzKShf4O3kpX1nybNwJZY6u4KF/13kGHZM+o1cNT8b90wAbX3PbdhpAqwKxeM2uAYH1nd0HjdijsYcMg/TE64AQLChfw3VfMeCDHGc3wsCq/g5WJvXYM9GF01w/Aep0wxmiHdM7vRgKNsKh/rxzTUiw+zRe4H04UFupk7geMoogWmDgb92DJoQcw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e153b579-4170-429d-6cc3-08db2b2e8fb6 X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB6452.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Mar 2023 23:38:38.4050 (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: FNPfb0VGiv0Kh2RkZXC+eBSwgmb3aP6dl7z2irn7+s9JBzVMdW7mzhGUr4bv1IB5/nCRrIPiUcm4PEX97JjJjg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB7263 X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_PASS,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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?1761114466570778853?= X-GMAIL-MSGID: =?utf-8?q?1761114466570778853?= |
Series |
Remove skb_mac_header() dependency in DSA xmit path
|
|
Commit Message
Vladimir Oltean
March 22, 2023, 11:38 p.m. UTC
It appears that dpaa_enable_tx_csum() only calls skb_reset_mac_header()
to get to the VLAN header using skb_mac_header().
We can use skb_vlan_eth_hdr() to get to the VLAN header based on
skb->data directly. This avoids spending a few cycles to set
skb->mac_header.
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
Comments
On Thu, Mar 23, 2023 at 01:38:17AM +0200, Vladimir Oltean wrote: > It appears that dpaa_enable_tx_csum() only calls skb_reset_mac_header() > to get to the VLAN header using skb_mac_header(). > > We can use skb_vlan_eth_hdr() to get to the VLAN header based on > skb->data directly. This avoids spending a few cycles to set > skb->mac_header. > > Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Reviewed-by: Simon Horman <simon.horman@corigine.com>
On 3/22/23 16:38, Vladimir Oltean wrote: > It appears that dpaa_enable_tx_csum() only calls skb_reset_mac_header() > to get to the VLAN header using skb_mac_header(). > > We can use skb_vlan_eth_hdr() to get to the VLAN header based on > skb->data directly. This avoids spending a few cycles to set > skb->mac_header. > > Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c index 9318a2554056..1fa676308c5e 100644 --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c @@ -1482,13 +1482,8 @@ static int dpaa_enable_tx_csum(struct dpaa_priv *priv, parse_result = (struct fman_prs_result *)parse_results; /* If we're dealing with VLAN, get the real Ethernet type */ - if (ethertype == ETH_P_8021Q) { - /* We can't always assume the MAC header is set correctly - * by the stack, so reset to beginning of skb->data - */ - skb_reset_mac_header(skb); - ethertype = ntohs(vlan_eth_hdr(skb)->h_vlan_encapsulated_proto); - } + if (ethertype == ETH_P_8021Q) + ethertype = ntohs(skb_vlan_eth_hdr(skb)->h_vlan_encapsulated_proto); /* Fill in the relevant L3 parse result fields * and read the L4 protocol type