From patchwork Sun Nov 1 19:16:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 11872431 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 X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A3FE8C4741F for ; Sun, 1 Nov 2020 19:17:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6283E2068D for ; Sun, 1 Nov 2020 19:17:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="A3ETfi4j" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727049AbgKATRE (ORCPT ); Sun, 1 Nov 2020 14:17:04 -0500 Received: from mail-eopbgr130045.outbound.protection.outlook.com ([40.107.13.45]:31354 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726790AbgKATRD (ORCPT ); Sun, 1 Nov 2020 14:17:03 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WqMxCWss/X5xw/SmkJMtQZLhTdItysO0T0jP4jgItfislJUmAOjpI+UHejelBvZl+5QsBkNju3X91wOkGA1H0CXDOo4BsF8lHtOmNgZOv/GndC4UV5WA9CT+6tZ1WRGrwG3iunGo+qupFGhMhqVQ+9pGf/2yGtybluKSJrQoVdFtmrPgOYgfiaoCbLw9JlKAaguwwlypuYxwuMd+KJ7bl0aJg7LHVIq0AzJMyFl2mExgX+VDnXlyJHUbibDHARVZXEFkDIiKVAgPijH5RhpJeloyDgkMJ0hbgHf595m8aZv3DUvhknLYeWqOKxBmgIIFc3tWE6tFWo2DS8uZkXgecg== 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-SenderADCheck; bh=4bU5m3RSw3i4Y6qEcui+Wv19KyDV70q3zFtJKz8nJ8U=; b=Isw0AjE850SOnr90AlD264sX7EemESYAH22RzMLHKnaHNWvjocGWlyC5FlHnKDhmTfxdKNs1H4zrr/xfUTCkJBTJ4y7fHI979WWPOd+ivZboIMwi2i6vvCwYJNuFV1EYlzSv+twKBO6RrrDisyl+pRlW6kOuK3uCDGzOnkHOAtRSLjiRrY80aKBycvmZFuxCyfs+fzMkFRq2w6ML/EKPWnobXFni+Rlvvd6Xm9b/DVD9aP3V9st8/BRhM1koSKYxNtd/yAPBWILRFwOu6nu5FbA7BTDai9PLdE9/jFwqC/XncFnCKGohWytY9wLYM0uZa2XmP2iHhN/GNCkDKaik6w== 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=4bU5m3RSw3i4Y6qEcui+Wv19KyDV70q3zFtJKz8nJ8U=; b=A3ETfi4jd+t9171lmRvcUXCuSMoEQ8ds0GTBjGU9OenFmMPMdrJuT10t0/pZElok5G6Hs6yOJfK5Px7kv9YzevVxY/oqtM3HvYua+cwVLDe5h54V70A8rC7fHScbP58Txfm4I/W0XjzWNQC+X8H3XnzOtKTmYMJgH2fV2vNmuUI= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB5696.eurprd04.prod.outlook.com (2603:10a6:803:e7::13) by VI1PR0402MB2861.eurprd04.prod.outlook.com (2603:10a6:800:b5::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.27; Sun, 1 Nov 2020 19:16:53 +0000 Received: from VI1PR04MB5696.eurprd04.prod.outlook.com ([fe80::983b:73a7:cc93:e63d]) by VI1PR04MB5696.eurprd04.prod.outlook.com ([fe80::983b:73a7:cc93:e63d%3]) with mapi id 15.20.3499.029; Sun, 1 Nov 2020 19:16:53 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: andrew@lunn.ch, f.fainelli@gmail.com, vivien.didelot@gmail.com, kuba@kernel.org, Christian Eggers , Kurt Kanzenbach Subject: [PATCH v3 net-next 01/12] net: dsa: implement a central TX reallocation procedure Date: Sun, 1 Nov 2020 21:16:09 +0200 Message-Id: <20201101191620.589272-2-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201101191620.589272-1-vladimir.oltean@nxp.com> References: <20201101191620.589272-1-vladimir.oltean@nxp.com> X-Originating-IP: [188.25.2.177] X-ClientProxiedBy: VI1PR0401CA0001.eurprd04.prod.outlook.com (2603:10a6:800:4a::11) To VI1PR04MB5696.eurprd04.prod.outlook.com (2603:10a6:803:e7::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (188.25.2.177) by VI1PR0401CA0001.eurprd04.prod.outlook.com (2603:10a6:800:4a::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18 via Frontend Transport; Sun, 1 Nov 2020 19:16:52 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: ec46672b-20b8-44bf-7eed-08d87e9ab0cc X-MS-TrafficTypeDiagnostic: VI1PR0402MB2861: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AUCmkw9I9LNXupB1S7gzu88B4MvTYbv2XpOvdlC+8rdh8t+6fg4+aFKgYVB05ZkHlxnxjU/VMESWcZWxdvL/JxaDnRNRRy1id5YBHtc9R4VUi4n5dzOgfbxr1UpIQjJ15uJsQlouI+Zp4k/SKSIgoTJMkWdzRltCSjVzkZgyG2VjjZDcBSWvo+b0wFQrlJIYUsubv2Vr5W0OpYP9GR0NDXqmYD08mngKjQudug1xl8tb7giqLJw0/80gqi28g5q+DGged7zZN8Ap75KI1uPF3FN8VcCYa7qdf9rXP48xT/2a5txUu4hLqoTPbMkS+JduRO6ETJgYlJcg/ruOm0ODOe1Dls9vP1zOTO2cpCn3CQqKHefs9/YXKubmFz5V1bY3 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5696.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(136003)(376002)(346002)(39850400004)(396003)(366004)(2906002)(8936002)(16526019)(6916009)(186003)(6506007)(86362001)(2616005)(8676002)(26005)(36756003)(66556008)(956004)(66946007)(5660300002)(478600001)(66476007)(6486002)(6666004)(52116002)(6512007)(4326008)(1076003)(83380400001)(44832011)(69590400008)(54906003)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 16RKIGsh7TMLct9ESfxDQonBYqgHBe3rYpM85JPQhaBVrOq4/HqJ0j8y3alligYyzaNd0KUH4yJcF/MkZEKJNPI30VI8Q7PqtjVt3TnQ2krlTX4HbncNVuLBhOPzn/RXJGpY0Qkybg4StpOXdgqqk9e/vQwWxcfomGMaq1PWYNBSAix3xYlfb7RkSwLgvcYztdxtRaF4ZbGDvAXyKXzUIIraI1wk2+yjMOONU1jNoa2p4Ovu4XcOYLtP9Owg1h8Qx2rBIwjdyqzGOATycEebF2vlUQR9+NIlrchZHPlqcqdqHTM9WLwg5J/MFdJQ7nzELhSnW0k/NBdQJThIMxVN8Sgd9ZQjj3AnvgMzroQT39StJrMlzKyqur/iXdaoZA09eulmHdvCN/L1/T+ObTv7K6gELYt82oHRMg0b3ZM/S6ppDydLeBdroY7t9C7+Bgfd83O2MqrlGhoCVUAPDe01Sb58LQdHfCTheVmD3bHdw+S+7SHgHNc2tuLXGb2Dh8E3KW5w/vBaYAiTfit9tTGeg0wVLKSleoNg0FuFth184p9Kf8m4Q313Tx5UFqzC+k9zFxFn+X1l1XVKhKw58O6vEcdALJZVS75oAvHM/rykoaDqWG1a7nkLs1bcaVUyK6XFaLhXTpLLVrsw05zh/+83GA== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ec46672b-20b8-44bf-7eed-08d87e9ab0cc X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5696.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Nov 2020 19:16:53.0859 (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: yXSLW/oc2nqS4HgZv1Od57gQhdhKbJ/sxq8CCasd4aoDC4IJOVBWlIgVLHQOiPoxiVWId1e1IqY6HCwRX62Pww== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0402MB2861 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org At the moment, taggers are left with the task of ensuring that the skb headers are writable (which they aren't, if the frames were cloned for TX timestamping, for flooding by the bridge, etc), and that there is enough space in the skb data area for the DSA tag to be pushed. Moreover, the life of tail taggers is even harder, because they need to ensure that short frames have enough padding, a problem that normal taggers don't have. The principle of the DSA framework is that everything except for the most intimate hardware specifics (like in this case, the actual packing of the DSA tag bits) should be done inside the core, to avoid having code paths that are very rarely tested. So provide a TX reallocation procedure that should cover the known needs of DSA today. Note that this patch also gives the network stack a good hint about the headroom/tailroom it's going to need. Up till now it wasn't doing that. So the reallocation procedure should really be there only for the exceptional cases, and for cloned packets which need to be unshared. Signed-off-by: Vladimir Oltean Tested-by: Christian Eggers # For tail taggers only Tested-by: Kurt Kanzenbach Reviewed-by: Florian Fainelli --- Changes in v3: - Use dev_kfree_skb_any due to potential hardirq context in xmit path. Changes in v2: - Dropped the tx_realloc counters for now, since the patch was pretty controversial and I lack the time at the moment to introduce new UAPI for that. - Do padding for tail taggers irrespective of whether they need to reallocate the skb or not. net/dsa/slave.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/net/dsa/slave.c b/net/dsa/slave.c index 3bc5ca40c9fb..c6806eef906f 100644 --- a/net/dsa/slave.c +++ b/net/dsa/slave.c @@ -548,6 +548,30 @@ netdev_tx_t dsa_enqueue_skb(struct sk_buff *skb, struct net_device *dev) } EXPORT_SYMBOL_GPL(dsa_enqueue_skb); +static int dsa_realloc_skb(struct sk_buff *skb, struct net_device *dev) +{ + int needed_headroom = dev->needed_headroom; + int needed_tailroom = dev->needed_tailroom; + + /* For tail taggers, we need to pad short frames ourselves, to ensure + * that the tail tag does not fail at its role of being at the end of + * the packet, once the master interface pads the frame. Account for + * that pad length here, and pad later. + */ + if (unlikely(needed_tailroom && skb->len < ETH_ZLEN)) + needed_tailroom += ETH_ZLEN - skb->len; + /* skb_headroom() returns unsigned int... */ + needed_headroom = max_t(int, needed_headroom - skb_headroom(skb), 0); + needed_tailroom = max_t(int, needed_tailroom - skb_tailroom(skb), 0); + + if (likely(!needed_headroom && !needed_tailroom && !skb_cloned(skb))) + /* No reallocation needed, yay! */ + return 0; + + return pskb_expand_head(skb, needed_headroom, needed_tailroom, + GFP_ATOMIC); +} + static netdev_tx_t dsa_slave_xmit(struct sk_buff *skb, struct net_device *dev) { struct dsa_slave_priv *p = netdev_priv(dev); @@ -567,6 +591,17 @@ static netdev_tx_t dsa_slave_xmit(struct sk_buff *skb, struct net_device *dev) */ dsa_skb_tx_timestamp(p, skb); + if (dsa_realloc_skb(skb, dev)) { + dev_kfree_skb_any(skb); + return NETDEV_TX_OK; + } + + /* needed_tailroom should still be 'warm' in the cache line from + * dsa_realloc_skb(), which has also ensured that padding is safe. + */ + if (dev->needed_tailroom) + eth_skb_pad(skb); + /* Transmit function may have to reallocate the original SKB, * in which case it must have freed it. Only free it here on error. */ @@ -1791,6 +1826,16 @@ int dsa_slave_create(struct dsa_port *port) slave_dev->netdev_ops = &dsa_slave_netdev_ops; if (ds->ops->port_max_mtu) slave_dev->max_mtu = ds->ops->port_max_mtu(ds, port->index); + if (cpu_dp->tag_ops->tail_tag) + slave_dev->needed_tailroom = cpu_dp->tag_ops->overhead; + else + slave_dev->needed_headroom = cpu_dp->tag_ops->overhead; + /* Try to save one extra realloc later in the TX path (in the master) + * by also inheriting the master's needed headroom and tailroom. + * The 8021q driver also does this. + */ + slave_dev->needed_headroom += master->needed_headroom; + slave_dev->needed_tailroom += master->needed_tailroom; SET_NETDEV_DEVTYPE(slave_dev, &dsa_type); netdev_for_each_tx_queue(slave_dev, dsa_slave_set_lockdep_class_one, From patchwork Sun Nov 1 19:16:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 11872429 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 X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DCFFFC4742C for ; Sun, 1 Nov 2020 19:17:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8766E206BE for ; Sun, 1 Nov 2020 19:17:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="ehmD8Edd" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727066AbgKATRE (ORCPT ); Sun, 1 Nov 2020 14:17:04 -0500 Received: from mail-eopbgr130047.outbound.protection.outlook.com ([40.107.13.47]:47874 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727009AbgKATRE (ORCPT ); Sun, 1 Nov 2020 14:17:04 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kkz0NoSV084XtkNmGTISewLIUFeHg6C1KozUx5rQBliMxtwCellZMzdIe/jRgUhPcATMZDNbFA5Ti3T/rnJmD6HnKWCH0Dp2WFseO5Gwtjv5lsNv+BvUenKA6sSx0+gon2abYHUli7EJaFftYAEOIjAYrqQVWY7JWGwYuEX7WqL7nnrkaUhOBZ46DUY1xnPnTIZaW8Q1s+6YoQEWSXJPMxe1b/epT/2IhHRTd2yenrDb7jEUKACpsHwS/JL+Zrqq9z1faJ9T+TP0mVCWN+fnv4rKbWig2oXsifOLBFoI85Qy+v526OcD0DwlUk3SWDAqIsjy8pL7oJ9kK3xuNButOw== 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-SenderADCheck; bh=IdpjpowCtzYIgkTzKwF0wGOrCcKWxHeVfMzB0k2jGGk=; b=Cn2FqN/ul8X+cXRMlWVMsIEypbEllnSqWtJDvwyKPuAbIiJpKiKz+CKegyxvS5kGhGxnjxAd33EOIc9TgMRGzKGVhlg67j8dpxx1CITKIQHgLsSIlH8esX4TsRpZwbc1wla3DJEHw7UaorIRg6q+uTC8nDMzUgiVLNtiDkzv1LNp4qjVpCEcHmbnW65NHFCqEiU3zu9HNOLwFSt+AJNgi1X+zdiFIwLMOXsnhTqtuy+zv0/PpJfdvw/JSJXu3f9nug0Ob/mNdUSMVqn9oP7sHC9bJ28x+7+fo7J0MlR4HU831MpKOS39yFtaKaKeMgL4pfbPUfqCsJ8rsoZ7FoIg8Q== 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=IdpjpowCtzYIgkTzKwF0wGOrCcKWxHeVfMzB0k2jGGk=; b=ehmD8EddYLbwM8b0BvsP03I8fjYhfhncIHfdLolAZquWtBnUIar/g5v+NCxB3x35EYYOl10rog0I9ebGGMcsEcsgDpel20e32GHQD8+1ViQRhNl0C+sEpMKz1iWyofZEphNP9DWo/v4y8n/+nWelZNvQcZUkdBhX5zRHxYeDuTc= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB5696.eurprd04.prod.outlook.com (2603:10a6:803:e7::13) by VI1PR0402MB2861.eurprd04.prod.outlook.com (2603:10a6:800:b5::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.27; Sun, 1 Nov 2020 19:16:54 +0000 Received: from VI1PR04MB5696.eurprd04.prod.outlook.com ([fe80::983b:73a7:cc93:e63d]) by VI1PR04MB5696.eurprd04.prod.outlook.com ([fe80::983b:73a7:cc93:e63d%3]) with mapi id 15.20.3499.029; Sun, 1 Nov 2020 19:16:54 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: andrew@lunn.ch, f.fainelli@gmail.com, vivien.didelot@gmail.com, kuba@kernel.org, Christian Eggers , Kurt Kanzenbach Subject: [PATCH v3 net-next 03/12] net: dsa: trailer: don't allocate additional memory for padding/tagging Date: Sun, 1 Nov 2020 21:16:11 +0200 Message-Id: <20201101191620.589272-4-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201101191620.589272-1-vladimir.oltean@nxp.com> References: <20201101191620.589272-1-vladimir.oltean@nxp.com> X-Originating-IP: [188.25.2.177] X-ClientProxiedBy: VI1PR0401CA0001.eurprd04.prod.outlook.com (2603:10a6:800:4a::11) To VI1PR04MB5696.eurprd04.prod.outlook.com (2603:10a6:803:e7::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (188.25.2.177) by VI1PR0401CA0001.eurprd04.prod.outlook.com (2603:10a6:800:4a::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18 via Frontend Transport; Sun, 1 Nov 2020 19:16:53 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: fe80f3f5-8cab-444e-3e98-08d87e9ab186 X-MS-TrafficTypeDiagnostic: VI1PR0402MB2861: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6108; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Ez3+oYwDF01DY37emPh1Nb8RqcSoDt7p/L7fuiWECREOfjpf8gzdZ9qgQOqn1OTUICSzJK80aI5G9C/QvSbVx7yZl3N9Oqx95UdCOjYvGc264Y42fvDLha4BbomqPijIqhGz+Hf3OtZacr5bfxgHz68x1gwB4LG3m1yfINAfj47d6vGLNYxbgUNFu6WjJ3LZ2sk2G3VkoVLMPDyt6J6EH18KXI3w5bW52Q44y36rCSVElnsHDDmMbXZUESxVWaNS2XETuj9/0959g+n6CyOWn5xhgYiiZdsAdtLDqKPqx4BxUMlHp6io5tL0+iKmgG1mF5XzndTv2henLVkiKEzyZuWI0G/NvwL7KrEMvHFE/9PfZPhZjxqPVXEcZGPPvFut X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5696.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(136003)(376002)(346002)(39850400004)(396003)(366004)(2906002)(8936002)(16526019)(6916009)(186003)(6506007)(86362001)(2616005)(8676002)(26005)(36756003)(66556008)(956004)(66946007)(5660300002)(478600001)(66476007)(6486002)(6666004)(52116002)(6512007)(4326008)(1076003)(83380400001)(44832011)(69590400008)(54906003)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: phzYSl54WTn9HDaO6v6QWYOJJ6961yqy2Wv3XOPJVvy/q4vRdTzznScHILl3Ve3QNQGXN96yWLG+vygu6gexKiUiZTjM3sD7cIQQdbPCh+p62+Hkqo2FyWCVmYFTaWTUrIT9UC9g25zae1UIJwnPfeKGFCBXP7vTJGO7FHtfpDFklr3ljlITPN+7qNZ+yxMeV5xdbgrAUrO7GO1mlba4QBjtRf7K4YXsCujbO2Wcd349C30kccd3l3hq8uleIuG4UQNwfwUUEbEU91weDw6Mcvip7UL6+RrMII1QlmokZsAMa+j4iy9T2JKekxv3XuqO6xwGvPQ4LGgKhnFnzFRlZ4sLH/FjM5SY5WaaMAJ8II+5WHwZKaRjoE2LtPd+RDbteI8BHO5kUviPPjLxCm8uRuh0odBC79uI0iRzd3hpIlO7c/nBki+55EcjvVYpIJGmjvP9VFg0/JFNfiCD+8MIL83VxZ0y1ovgKW3Omfljjyo9OKgXRjnBZU6VNnPv7/t5wucFxQ8Q6NvWH0x60K+gWU4aHEs2HUMR3xgU+HZcreqTvC2Zz3DaNZM6nCjSGnD95WGhy10Jd2/wP+aF5WKWGX/rtpzQC58XQRl8msE3DEaOEqkM+TjmSwwylhiAbzgVR13rguXwhjluLqZM8ckCiA== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: fe80f3f5-8cab-444e-3e98-08d87e9ab186 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5696.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Nov 2020 19:16:54.3742 (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: FXGBQLTT/i0cgBQe6efDMl0zKAkL/djNrjIPCBK4jh6ac7lOFtEZX1WmKUvjchC7+cKz7Wb+960G6bdYzG8BYQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0402MB2861 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Christian Eggers The caller (dsa_slave_xmit) guarantees that the frame length is at least ETH_ZLEN and that enough memory for tail tagging is available. Signed-off-by: Christian Eggers Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli --- Changes in v3: None. Changes in v2: None. net/dsa/tag_trailer.c | 31 ++----------------------------- 1 file changed, 2 insertions(+), 29 deletions(-) diff --git a/net/dsa/tag_trailer.c b/net/dsa/tag_trailer.c index 3a1cc24a4f0a..5b97ede56a0f 100644 --- a/net/dsa/tag_trailer.c +++ b/net/dsa/tag_trailer.c @@ -13,42 +13,15 @@ static struct sk_buff *trailer_xmit(struct sk_buff *skb, struct net_device *dev) { struct dsa_port *dp = dsa_slave_to_port(dev); - struct sk_buff *nskb; - int padlen; u8 *trailer; - /* - * We have to make sure that the trailer ends up as the very - * last 4 bytes of the packet. This means that we have to pad - * the packet to the minimum ethernet frame size, if necessary, - * before adding the trailer. - */ - padlen = 0; - if (skb->len < 60) - padlen = 60 - skb->len; - - nskb = alloc_skb(NET_IP_ALIGN + skb->len + padlen + 4, GFP_ATOMIC); - if (!nskb) - return NULL; - skb_reserve(nskb, NET_IP_ALIGN); - - skb_reset_mac_header(nskb); - skb_set_network_header(nskb, skb_network_header(skb) - skb->head); - skb_set_transport_header(nskb, skb_transport_header(skb) - skb->head); - skb_copy_and_csum_dev(skb, skb_put(nskb, skb->len)); - consume_skb(skb); - - if (padlen) { - skb_put_zero(nskb, padlen); - } - - trailer = skb_put(nskb, 4); + trailer = skb_put(skb, 4); trailer[0] = 0x80; trailer[1] = 1 << dp->index; trailer[2] = 0x10; trailer[3] = 0x00; - return nskb; + return skb; } static struct sk_buff *trailer_rcv(struct sk_buff *skb, struct net_device *dev, From patchwork Sun Nov 1 19:16:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 11872433 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 X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F06E1C55178 for ; Sun, 1 Nov 2020 19:17:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B70F82068D for ; Sun, 1 Nov 2020 19:17:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="KQvvatP8" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727097AbgKATRH (ORCPT ); Sun, 1 Nov 2020 14:17:07 -0500 Received: from mail-eopbgr130045.outbound.protection.outlook.com ([40.107.13.45]:31354 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726873AbgKATRF (ORCPT ); Sun, 1 Nov 2020 14:17:05 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IhmAMxDtKCazLSMnRmZGhlddMn7lhxxtUkGnYlMkTPDhSSmawMQdKjoWH2wWxH7G/2pHfOg5IRrYZ5yhwfTAufg2ZnfIB5aJK3UpQatHNuFLpfZ5OzxqYco2lDguueInURmgrlqqUqfRh76MGGcdiWyYBwpWNqlcHumlzCI5UIjar0q4uVLsTvzyapZNfu4XN2jff2l+3jGxLsXRw7/UoiOITxFfltRkw0SmZwOMs8yf+V3QbvrDoePWLQKjCeX0X/oyCJge7aX+hlGtSPC/aTDknEIk/vcMA8b8wglA5dyHu6T3g0N1BbwIlOZmqE+GAtQXv5WRomT0yv+vEaxOVg== 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-SenderADCheck; bh=j4TtjDkCNleuJKf1wCx8b2YnhlMCZogSbiK0KoyWD+Q=; b=BZed/2iu+JGljAasjOj3D700P6SKgJUzzZ8zGUCLlQMmPhMY4xKVemHBdooG+sKf5q52d04+t8mz1m06Biftn/kk7QMKfVJqbZGkkxTBITavHpggFAjF/FMUS+HstnSLP5lXnw15556gJa3VYJ0aly0vNR8uzRydeN8N8KU7FLhJxr4t1MZMcEo1ezDMqhbWOT9vyjUYkW+2iW17xwPD/T1W0lWKKNbKAaHJPdlpJtvWc2EOsSosOD8lS+7ajE3GHNOtcOCUQ+0sCmpPJzgc6uMs6SanNjPbGe3B0LOB05FZj6o3x9pzS+EmVIn2qeVlZpoAYJOHF3zTeOpYybJUWg== 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=j4TtjDkCNleuJKf1wCx8b2YnhlMCZogSbiK0KoyWD+Q=; b=KQvvatP8RGRQr4PfSpHGvXDySKctyUs0Y6E2x+3uQcC1KCuYLYf4PlN3kWxX//AsQtpJ7ORzbIrRNgfW3HTBjseNtGhNhz/UnoxIiq0ENZwrFxcAU48QMfooxnGG3WAT628ibTTUKSO6PulXEK7WekA2lpYvzquw9AkX4yoAhnM= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB5696.eurprd04.prod.outlook.com (2603:10a6:803:e7::13) by VI1PR0402MB2861.eurprd04.prod.outlook.com (2603:10a6:800:b5::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.27; Sun, 1 Nov 2020 19:16:55 +0000 Received: from VI1PR04MB5696.eurprd04.prod.outlook.com ([fe80::983b:73a7:cc93:e63d]) by VI1PR04MB5696.eurprd04.prod.outlook.com ([fe80::983b:73a7:cc93:e63d%3]) with mapi id 15.20.3499.029; Sun, 1 Nov 2020 19:16:55 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: andrew@lunn.ch, f.fainelli@gmail.com, vivien.didelot@gmail.com, kuba@kernel.org, Christian Eggers , Kurt Kanzenbach , John Crispin , Alexander Lobakin Subject: [PATCH v3 net-next 04/12] net: dsa: tag_qca: let DSA core deal with TX reallocation Date: Sun, 1 Nov 2020 21:16:12 +0200 Message-Id: <20201101191620.589272-5-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201101191620.589272-1-vladimir.oltean@nxp.com> References: <20201101191620.589272-1-vladimir.oltean@nxp.com> X-Originating-IP: [188.25.2.177] X-ClientProxiedBy: VI1PR0401CA0001.eurprd04.prod.outlook.com (2603:10a6:800:4a::11) To VI1PR04MB5696.eurprd04.prod.outlook.com (2603:10a6:803:e7::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (188.25.2.177) by VI1PR0401CA0001.eurprd04.prod.outlook.com (2603:10a6:800:4a::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18 via Frontend Transport; Sun, 1 Nov 2020 19:16:54 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: f26335d5-6f92-4453-48c7-08d87e9ab1f3 X-MS-TrafficTypeDiagnostic: VI1PR0402MB2861: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2887; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: iC0Qse8aBXQd0NgPYYZJubHamA93JZDuwaYSHpdChXGsMEOTBHM9BfvrKNop2c90WY9ImxRRARh5FW0ywEWyb+3MR7VZUp3L1ttYWFxhx3RloMX5/qHrrbIFFfvdjDNxeTLDz22NX1EeQFQxRmk6PcwJASauIGLWa2KibjrxuPub1Qd+/ed0vFW2+wnbzrxCGsw33qTlZ7jANIPBzGSzfGOTIfNAl5a0H02CfVwVjSXMMVm7ud6ZjA65+mltI4au0WeEcsl7ywXY4sDQaeEnQCxu5hp779ervEdyhM6cIeQ/RipKS5Xvo8hM74IN65SADWpNZWmOqzrnMpJILbvXgp5J15p3RZ/ibfSMu3dH7yg3vZmtuQ6sT5A68ZBhchsV X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5696.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(136003)(376002)(346002)(39850400004)(396003)(366004)(2906002)(8936002)(16526019)(6916009)(186003)(6506007)(86362001)(2616005)(4744005)(8676002)(26005)(36756003)(66556008)(956004)(66946007)(5660300002)(478600001)(66476007)(6486002)(6666004)(52116002)(6512007)(4326008)(1076003)(83380400001)(44832011)(69590400008)(54906003)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: R93HeKygCKwtIQ5JwZj211cGE3VvRSAf9lajyac7PHTk4rxld9XOI7v/mTfBp9gPjsA+iUjbh0kCU+P5xwBWX9AwlgnifW5KLnBfi3ieOGiCLrktUeftH3DBk2nMoq62BxdOxr0+kgaf9oirtm0Nn6/4iqcM2nguLIBwTQp3gT96HJApYTxw5rLkrHyDCiWliVmhq9pQ7n7fF/czsoZCvxRjStdD7zZtT7fcWFerAnsSdfyO3JqpRwoyfR7AfiVxWefb5IdkbeM0lt3rij12EBrnZjT7zyDNyN0Z+a67vgC2nYGzuCUzxyIIgoIqpbDVnKBwQl43lGs0vFNGwouBwg4cxFTkUSHwzB+2HR6peuqrqHeq3jxbybiLgxbT0d74wzjV6vTxUZON7iBn5aOBmJ2pYxzmYVqqxxNnNN2cNdDfENXDxjbTMw00oGEgErIDj6htiLix+R1FftvrPFspN53GfdOSo1rxzbfpY3eh77llocz2HUfSiOxa7G7SwTtKYsU3XjsgfYvp6tgfpgkc1+ZKgiB4a7CfrPfaKjbf4gz+5/LhkkVdY+jAiUjq4iY8u5KuShtWUMA1kfnovvAzbYnJ6Xr5G+Z0+ptPJ895hqIPCyrKgjMPqlAspcHrxZsfSk2fd7Kp7a+kIqiMThlB8w== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: f26335d5-6f92-4453-48c7-08d87e9ab1f3 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5696.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Nov 2020 19:16:55.1308 (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: uXfFNiLe7YBKAq0diNDhQ2yYL5jZyO0JrEB95brq/bV7uFRZja+GDAj2AhaFvnhbN7iJQKWwp2gsixVh+1nXHg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0402MB2861 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Now that we have a central TX reallocation procedure that accounts for the tagger's needed headroom in a generic way, we can remove the skb_cow_head call. Cc: John Crispin Cc: Alexander Lobakin Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli --- Changes in v3: None. Changes in v2: None. net/dsa/tag_qca.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/net/dsa/tag_qca.c b/net/dsa/tag_qca.c index 1b9e8507112b..88181b52f480 100644 --- a/net/dsa/tag_qca.c +++ b/net/dsa/tag_qca.c @@ -34,9 +34,6 @@ static struct sk_buff *qca_tag_xmit(struct sk_buff *skb, struct net_device *dev) __be16 *phdr; u16 hdr; - if (skb_cow_head(skb, QCA_HDR_LEN) < 0) - return NULL; - skb_push(skb, QCA_HDR_LEN); memmove(skb->data, skb->data + QCA_HDR_LEN, 2 * ETH_ALEN); From patchwork Sun Nov 1 19:16:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 11872435 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 X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 35053C5517A for ; Sun, 1 Nov 2020 19:17:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EE134206BE for ; Sun, 1 Nov 2020 19:17:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="rk9q07gR" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727124AbgKATRJ (ORCPT ); Sun, 1 Nov 2020 14:17:09 -0500 Received: from mail-eopbgr130047.outbound.protection.outlook.com ([40.107.13.47]:47874 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726790AbgKATRG (ORCPT ); Sun, 1 Nov 2020 14:17:06 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eBurz5peJFLSdqoJOFnzaEIpDfUkKdGTencuQlBKHUrAHv0tJ8ny2cGCx3eg9rHXCfw777duzUy2ZKyo0CSX/+P8ytc2Nuy3Ut1Z9ZakYK9Ux7CzUoVa9q8e1hG5OEv3hIkCjfudwUkaZfE3jj3k6wR8xjTEaXpxrtadpWWlZG40GXIXscFBfXLkWGqIF/+uoLqGLwNNT5ZWeOcEl8KdcxVq0hqa0w0FWHxqeglZ6NpKptMIJRkumcp6GsRJg6Pgw0xWGMweV+GUssKRbaIP/2i0Rej+5T8UBSHdNxWG8KB1ww9N4bW9e6LjIbmAMRevTNAbIGRX9Wdt4U0tBr6ToQ== 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-SenderADCheck; bh=1np9QKJfTh/Mo6c3ThjKuVrhfSQqsYmPFnHOOZHEGSo=; b=GNBj2+ZwyGMzXs/duSnWo3/qfYozD9uYSJRk2qorkXMvPhA/vOghwFFch1WAi2q0p9v5naM1RoRbAExkAFNDEHmOgLdB4lnLDoR4HfLEarUfmaet/r6/lqgkZ3cIfGBpFdmGRVrlpHQ9h6EC4qgmIXQcAn+C4MFsN/kjP6Stpebr4OU3rbAmgDvAOkO9qE/FPlbfWJ3oTfp7ihJqmXpuJQszBEfv6JJbvRbz9XOFZ3si/+SG8Z54dTm95GAIanOB82Qk93thNjVKRDP8EaOQlcmryyY7q4bNngVODHTzBsm0fNCL/lAbeCs6iwtQB/EJ4jIVDaWrgrAQ9R2OWHA9lg== 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=1np9QKJfTh/Mo6c3ThjKuVrhfSQqsYmPFnHOOZHEGSo=; b=rk9q07gRo9NcNkiwSa0pU3kV6QzBgZqKGFAWki/y7nOkx/ooGTDImXAbyiT8hpqE8fiUhin1c1QA69+6rwWH2hl0SR86/kAC3gw08GPC9OodQTB39ubVH3/BtzqpxmbZi/ys+TwldiB7LkfDlJKCgRiUNGm5nhQK7/PJwr0mALc= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB5696.eurprd04.prod.outlook.com (2603:10a6:803:e7::13) by VI1PR0402MB2861.eurprd04.prod.outlook.com (2603:10a6:800:b5::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.27; Sun, 1 Nov 2020 19:16:55 +0000 Received: from VI1PR04MB5696.eurprd04.prod.outlook.com ([fe80::983b:73a7:cc93:e63d]) by VI1PR04MB5696.eurprd04.prod.outlook.com ([fe80::983b:73a7:cc93:e63d%3]) with mapi id 15.20.3499.029; Sun, 1 Nov 2020 19:16:55 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: andrew@lunn.ch, f.fainelli@gmail.com, vivien.didelot@gmail.com, kuba@kernel.org, Christian Eggers , Kurt Kanzenbach Subject: [PATCH v3 net-next 05/12] net: dsa: tag_ocelot: let DSA core deal with TX reallocation Date: Sun, 1 Nov 2020 21:16:13 +0200 Message-Id: <20201101191620.589272-6-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201101191620.589272-1-vladimir.oltean@nxp.com> References: <20201101191620.589272-1-vladimir.oltean@nxp.com> X-Originating-IP: [188.25.2.177] X-ClientProxiedBy: VI1PR0401CA0001.eurprd04.prod.outlook.com (2603:10a6:800:4a::11) To VI1PR04MB5696.eurprd04.prod.outlook.com (2603:10a6:803:e7::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (188.25.2.177) by VI1PR0401CA0001.eurprd04.prod.outlook.com (2603:10a6:800:4a::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18 via Frontend Transport; Sun, 1 Nov 2020 19:16:55 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 03084932-36ab-43d9-bfb4-08d87e9ab25b X-MS-TrafficTypeDiagnostic: VI1PR0402MB2861: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3383; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ky5UZiZAQwyovIUldEQVyin+K/17EkJnpF/ZaM3XkeYu7O8eKtQxkGNsgzbKQbnSMxfeZtMJ5vOwhVDQvJ5KSpH3rPIkrBYovZtXiwEs1kdjMBTHHb1/EFbv2ocfeQXe+1UTZQCyXk+6nfMLpmtlZ7w9FidLGcsTztN53OT3ONKeJ8lbwDxRuJvBKpCi1lHjSmLE10m5jRn8sef4XzEtIKGYUUarQ+LtA4+WYzUbZt3wl+soHGZRjrvJxCpfo6fuJe7jqeFVNTPdOp/sTMcJtIRWIa9UhYhoRCa2fvn5mIudKL3rUBVw5MS1P2AZxTYF2XesBrubie5qz40uc2yRuYyPvnRBuT62MAJLvdvWPJ0ppUZ4ynzPscvx35HcPINF X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5696.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(136003)(376002)(346002)(39850400004)(396003)(366004)(2906002)(8936002)(16526019)(6916009)(186003)(6506007)(86362001)(2616005)(4744005)(8676002)(26005)(36756003)(66556008)(956004)(66946007)(5660300002)(478600001)(66476007)(6486002)(6666004)(52116002)(6512007)(4326008)(1076003)(83380400001)(44832011)(69590400008)(54906003)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: Q6TCmVxNu6ScuN3+x7h5ewxBtQzfREdgrnMZSXFNgIILzl+cT0MfH+u39fJ5recwHd74tdS3VDumj5IQ5nXEAIEmgP+bUrLX9h/GMY0JbMcpYLYZ2VniKHvvnlBkLrAPJUY4C37W865Ur1ee31jqyJA3gGIWGSzS6peXPqD9+t6tewkBqxu6i8LnHY8B0GKxx57NBxfBMMKxRslzLedlxm3O66IErqyah08kp4hFVbVBT/DPn4J8dRddJlLjoBBsruUCGO1SdonXacPNagnLxMLevvrWNYfz5ur7exSZ23EecRHbCx7pmTkJzKMCvudhzVzp6rTnoG/6w/sS+psSPAGvt+p9oMsNE7OxKRwAmP7R9E1nwxWEQ6VLl1baCGxc1lOBVoW0QT2WIhl8lFs07B0RED4umxbvD4hHfg7dJOA9jZd98O37DIS7cCG4cjj52DNqiUvuM0vnCvinFRCVzW6cx3/x1CGXLMk1uSRyiYXUJjfhYrIuXjphDKT4lkN10jwq8lAwvXW8DJvzaOvaA7Y+pIiMAFI0yFTlAfK7Q3QjOCLtp4vmV+z6t1Iprp+lCkAh4eSlXb04X+KIu/j8/uY/K+2/ZsmujpihyFE76mhj428dY7T9GTKZqtTY5hk0Rtas4lo/8HmJzfR7ZwCJYQ== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 03084932-36ab-43d9-bfb4-08d87e9ab25b X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5696.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Nov 2020 19:16:55.6874 (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: y1JUg+P8Or9551mcNt7N4Bcm5rc6m5BPLz744t8q8Vi0PUvEmL5lmTxV7sv3L1Lvby60imFkbVAuhWWRiJhSBg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0402MB2861 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Now that we have a central TX reallocation procedure that accounts for the tagger's needed headroom in a generic way, we can remove the skb_cow_head call. Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli --- Changes in v3: None. Changes in v2: None. net/dsa/tag_ocelot.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/net/dsa/tag_ocelot.c b/net/dsa/tag_ocelot.c index 3b468aca5c53..16a1afd5b8e1 100644 --- a/net/dsa/tag_ocelot.c +++ b/net/dsa/tag_ocelot.c @@ -143,13 +143,6 @@ static struct sk_buff *ocelot_xmit(struct sk_buff *skb, struct ocelot_port *ocelot_port; u8 *prefix, *injection; u64 qos_class, rew_op; - int err; - - err = skb_cow_head(skb, OCELOT_TOTAL_TAG_LEN); - if (unlikely(err < 0)) { - netdev_err(netdev, "Cannot make room for tag.\n"); - return NULL; - } ocelot_port = ocelot->ports[dp->index]; From patchwork Sun Nov 1 19:16:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 11872427 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 X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6D949C2D0A3 for ; Sun, 1 Nov 2020 19:17:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2F3372068D for ; Sun, 1 Nov 2020 19:17:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="kbG2pNCT" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727151AbgKATRM (ORCPT ); Sun, 1 Nov 2020 14:17:12 -0500 Received: from mail-eopbgr130045.outbound.protection.outlook.com ([40.107.13.45]:31354 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727009AbgKATRI (ORCPT ); Sun, 1 Nov 2020 14:17:08 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RG1P2zblI6rp5A5BrlwxZenmG38pFsB3imfJwaEwvPyJUvCwBYi8/H0+WGYiIfOYfnKVs6GA9fJQLqt6VACNmfQLj5x4grQWHPS1iuMTjfUtFSESPzuwYKqWDZPDpOT28PZGDkJ/fhAySU/NR7BCQRxSbOObWKOSD96ho4flRyUW13H5GJzWl/atTcfe7qCctcaGwFDO/cL4OQVm+vbLTybDX3sOqpf7Fuah9L85T4niL3mvT5gXMJpJO9mBz4TGNd9myVJtRSqXYXhcTdRqgkfKqUGvE3Xp8oQ+7SkEz4NPVuGdQ5o0fqkGbxXnP+uanezjjjn5FJrdKJH+liIA7w== 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-SenderADCheck; bh=Uq76J4iwFrbsdrG/Sl3aIpnc377zqZmLrNAAr3jkjo8=; b=b1hhv/YQo8TrbDsp/wEfYu6N0n87DCmsgEGI77mqN+BbPrfnCGAf++xbzbZSRcWGEJZ9gjRx0fuUM3LPRizj/sEwv1c2bDBfBeDprJomLQqRtF8NvNP0ZxBE/17Gc+YmFud4UzRkvsstzEr0Yf0Nraz6K55WOJyb50IzEOP5LX+qLeYTmbqlc+wEgHOMYtBe0yE4EI7m2bWYdSvqVLJJ9RqZ87hNGvRe0P8q2tJ1eVfmSo5FgtfM743YwUFyhzOYZ2excK/1Iwz3lmP5QCu9iiQ7uon0qJmhL52yVdqeplq7FTAeunoWPKp65lng1jNqt12ffXDjROQOYL0bTzH0fA== 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=Uq76J4iwFrbsdrG/Sl3aIpnc377zqZmLrNAAr3jkjo8=; b=kbG2pNCTg/6M3Rvr6tSiDsAMpQA1OFeQCbD/6hfzALOnHYlPfEMbD07d9YNElgKWxcV9S9N0pBrkFWou3Tw/iRkSL3P28oOQoaz73zmhx2hSCE/wQ0+Rdkj+v3YCISCVKdOR5DHh9knoIMxe1GycbobtOaAUmrBfvDuFTDbmcbY= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB5696.eurprd04.prod.outlook.com (2603:10a6:803:e7::13) by VI1PR0402MB2861.eurprd04.prod.outlook.com (2603:10a6:800:b5::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.27; Sun, 1 Nov 2020 19:16:56 +0000 Received: from VI1PR04MB5696.eurprd04.prod.outlook.com ([fe80::983b:73a7:cc93:e63d]) by VI1PR04MB5696.eurprd04.prod.outlook.com ([fe80::983b:73a7:cc93:e63d%3]) with mapi id 15.20.3499.029; Sun, 1 Nov 2020 19:16:56 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: andrew@lunn.ch, f.fainelli@gmail.com, vivien.didelot@gmail.com, kuba@kernel.org, Christian Eggers , Kurt Kanzenbach , DENG Qingfang , Sean Wang , John Crispin Subject: [PATCH v3 net-next 06/12] net: dsa: tag_mtk: let DSA core deal with TX reallocation Date: Sun, 1 Nov 2020 21:16:14 +0200 Message-Id: <20201101191620.589272-7-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201101191620.589272-1-vladimir.oltean@nxp.com> References: <20201101191620.589272-1-vladimir.oltean@nxp.com> X-Originating-IP: [188.25.2.177] X-ClientProxiedBy: VI1PR0401CA0001.eurprd04.prod.outlook.com (2603:10a6:800:4a::11) To VI1PR04MB5696.eurprd04.prod.outlook.com (2603:10a6:803:e7::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (188.25.2.177) by VI1PR0401CA0001.eurprd04.prod.outlook.com (2603:10a6:800:4a::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18 via Frontend Transport; Sun, 1 Nov 2020 19:16:55 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 60630fc6-8ea7-4ec4-6bb2-08d87e9ab2b5 X-MS-TrafficTypeDiagnostic: VI1PR0402MB2861: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3383; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GvR4Fs4DqAxasBkDoBQm2psjL8BSI1RTnRsYu+hHApFFWJMjqU7Uk0CJqgPzFTeGs5nc6Pr7bdV2bQyoBvKj9DkvjcbcTNEYiX99vbgpi3THVmrFe7lBWAQMb3wkWKfG0snBPPyP340LH8pYNKHakgHa8JOwLhb7L2NBYAtftdEAcDcg2HnHg/bSFHRp2kwUGK4yHVpUql67UPQCet2WSDZMiDuxInjY3RiKIdKlTkZB0oy8Y16YQ1CEeM66qoNz/47Av7WZidOnvdCtBe1wLIcaMT2YKmD6JMIa8quATGXwVGlT4WPx/b6r8OyNHL+mu8QjLrA2o5icYt4P2YMltPJ8ybBpjAUXqGqcOJM7j1ICUcDjWEmiGAi4Hlu84zv2 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5696.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(136003)(376002)(346002)(39850400004)(396003)(366004)(2906002)(8936002)(16526019)(6916009)(186003)(6506007)(86362001)(2616005)(4744005)(8676002)(26005)(36756003)(66556008)(956004)(66946007)(5660300002)(478600001)(66476007)(6486002)(6666004)(52116002)(6512007)(4326008)(1076003)(83380400001)(44832011)(69590400008)(54906003)(316002)(7416002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: IYMTDXqrqO6QjmhbhFlvYUbGvirO0zPCB9FFyYDQVWteBCHV/FQsGCtteY8YkT22mrD+WpvSyjIozFL4QRXi8K2Zkmkol+kAufkp36DOSY8Mtblqtg+3nEhe1GBSlHMxu30KGU7+JcyIp51Bt8Vpq0kawXGszLl7yt//fHuw8v2ICXvMHtOJo7bbO3dF2Qv6d+pb2jrkI8farxKm+uHJFAX1lpGvTSzDU5AZpEg/3SfG9xJuOynUzmgfg/VzuZa6Zh8wQ4w4VuA9/lwFHq13M1Wtb4xRZX+4nlW14ojNUAtXU6r1LmZdZRq5gahya5xxqu+5sZ3IYEQ2B92lbJpDdEg8dpjc6RTXvJjs0ZYO349jY2Vx+gnX160tr1f6xfwXeuFanakRPeZJd/euCjBkMKQvyjr4hFDeJG3iczdLjS2p+njPIGDmh2gfUX1V99MaPS2n2RXGX5y7AEhbWNhHelsemCIaWb58UnHRCxrHXkB1d7+TlPd95qRlDj2uMwSUNFi0NXzLxNOfzEXFiPpUCIxiD+VkrSkmydMDAaxzjl1lBxuXpjZ7+Gt9OVyUyWGQj8GOHPz8f+jNpFAWjyNhFSXuvST9taFWBszAOUbCGYOY0uvfdUof2l6wmJvB/DgpCkHH3mmzn+3HJMJovfjdIg== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 60630fc6-8ea7-4ec4-6bb2-08d87e9ab2b5 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5696.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Nov 2020 19:16:56.3501 (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: UGke3k86yaAxkmwFH1YqOtMGRAdTCZNxkrB9xj1TX6CppyG4dZtyqRFQy4oHhZCizA+6XWiEAMl02ja66B1Wow== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0402MB2861 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Now that we have a central TX reallocation procedure that accounts for the tagger's needed headroom in a generic way, we can remove the skb_cow_head call. Cc: DENG Qingfang Cc: Sean Wang Cc: John Crispin Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli --- Changes in v3: None. Changes in v2: None. net/dsa/tag_mtk.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/net/dsa/tag_mtk.c b/net/dsa/tag_mtk.c index 4cdd9cf428fb..38dcdded74c0 100644 --- a/net/dsa/tag_mtk.c +++ b/net/dsa/tag_mtk.c @@ -34,9 +34,6 @@ static struct sk_buff *mtk_tag_xmit(struct sk_buff *skb, * table with VID. */ if (!skb_vlan_tagged(skb)) { - if (skb_cow_head(skb, MTK_HDR_LEN) < 0) - return NULL; - skb_push(skb, MTK_HDR_LEN); memmove(skb->data, skb->data + MTK_HDR_LEN, 2 * ETH_ALEN); is_vlan_skb = false; From patchwork Sun Nov 1 19:16:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 11872443 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 X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3F8D0C2D0A3 for ; Sun, 1 Nov 2020 19:17:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0C0BF206BE for ; Sun, 1 Nov 2020 19:17:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="qXPOMEg3" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727270AbgKATRZ (ORCPT ); Sun, 1 Nov 2020 14:17:25 -0500 Received: from mail-eopbgr130047.outbound.protection.outlook.com ([40.107.13.47]:47874 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726873AbgKATRJ (ORCPT ); Sun, 1 Nov 2020 14:17:09 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hcT4zcKmhWZX7TUIgGQctIrBrBiikPpbGURkJiw7mR5GGXNgJCy9CksP/QZ2cd5oN28PcmvBhLRP+UP/4E9HgStb0vern30ACwV6pOd5hH4cLvYLhVwkb9OvbX3qi6Em/9dbZEgXATnpnpDN55swmqMpwVxTlIeYi2e/ChIZNIZYt6fjC5N3ewD9WnQ/WcFgwkW2M8NmwQjVp6routts8lNdwu9DJqhjl8IWBeo4ctrK1XhFRCxDcSSC1S3h2ZRMRL+RtYrtyB1dH7ahCPV+Qofo2oXIaxWlzKvzFPENsw9JyvMA0EKBoDNIdD4XhehxpWa+Rqh825V3OxpT9Shz/Q== 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-SenderADCheck; bh=53ikwTOkoJAQO6kguBUsngROYQBBXDh++goawHjdc8c=; b=aPCYjE25+4PsRU4YbnGidSVXl7AADaUcQXz2CVjjafKgdqwo9V/aTmN3eUimlVnT+U/TNr+3mhjmJ5aZ1s1CW+LWZ9ky2oe/0Ca4q7IVnLRALJ6vwpe/7TSy81HIDY4S3VR+M0PfzCbm90ZiNu11Z3LZlA4pz7UOJU/S1oBLITo0BEh3Nb8EJARp7c7ygK9zwpvCmDrH9CH8p0zfmKEA5LW9BMkjhV52EbvPLQzOufQ4YsrU2TOsy0nVcB6o2ENKwAgPEzi0bMeWQ1ghquGMj5F/+AikDTCdJcIzxkNqVeNPJTDCC3plgb79DZdj5+f4Ex1sCgK42d233CiPGr2F7g== 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=53ikwTOkoJAQO6kguBUsngROYQBBXDh++goawHjdc8c=; b=qXPOMEg3ee4rma/jz/54ox+usCYoinZ4eStCbLyBaLRBv09Hl2rNw+Z0dONORPG0+/yrsnMLv1x/IGndU+S2MFRZnN7IA9TdfVoM0ovMUpqMNEAIEPqBAfI9vM/l8f6zC3n4SZYyBQzvaubG0KW4qFZEWEwmViJJuTTBNnKtcog= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB5696.eurprd04.prod.outlook.com (2603:10a6:803:e7::13) by VI1PR0402MB2861.eurprd04.prod.outlook.com (2603:10a6:800:b5::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.27; Sun, 1 Nov 2020 19:16:56 +0000 Received: from VI1PR04MB5696.eurprd04.prod.outlook.com ([fe80::983b:73a7:cc93:e63d]) by VI1PR04MB5696.eurprd04.prod.outlook.com ([fe80::983b:73a7:cc93:e63d%3]) with mapi id 15.20.3499.029; Sun, 1 Nov 2020 19:16:56 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: andrew@lunn.ch, f.fainelli@gmail.com, vivien.didelot@gmail.com, kuba@kernel.org, Christian Eggers , Kurt Kanzenbach Subject: [PATCH v3 net-next 07/12] net: dsa: tag_lan9303: let DSA core deal with TX reallocation Date: Sun, 1 Nov 2020 21:16:15 +0200 Message-Id: <20201101191620.589272-8-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201101191620.589272-1-vladimir.oltean@nxp.com> References: <20201101191620.589272-1-vladimir.oltean@nxp.com> X-Originating-IP: [188.25.2.177] X-ClientProxiedBy: VI1PR0401CA0001.eurprd04.prod.outlook.com (2603:10a6:800:4a::11) To VI1PR04MB5696.eurprd04.prod.outlook.com (2603:10a6:803:e7::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (188.25.2.177) by VI1PR0401CA0001.eurprd04.prod.outlook.com (2603:10a6:800:4a::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18 via Frontend Transport; Sun, 1 Nov 2020 19:16:56 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 107067d7-3d0e-4810-af67-08d87e9ab311 X-MS-TrafficTypeDiagnostic: VI1PR0402MB2861: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3383; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Q+O8kBkJXnzwaXMeQBVooIkcQn/r6jNjPISxJX//Fu/pglwLLzuJKI3mlR5TrSCz/hK93fXlQIQ3JiVO4oFFalVcs/xDmXgxivKvRr8Mrc2Gqt1r1Osg+i42JyLBRaj5ZdeFBMafhTiFje6tNitIzvYp+jgo6kFuXnS4w77Bch1TfzoiF5cAomC/2vCT+QZxom3e0dF1/FuDOK4ecU58Q8txfPz0nnrfBEXVuoYhbRP5wL+FuEjhgpyjKv/Yjrhc8u/H7rejlmLValvA2Oy3TdQCYf9/+jlzh/QNlvN7bagH7jDqZKuUtM+5EoHgVhzV/KreEkB4Jf3Qu88YjrxwJDCwyjrgTpLuCH8YgZUKhJj7UCHJz+zdnjJOoBJ6/gbN X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5696.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(136003)(376002)(346002)(39850400004)(396003)(366004)(2906002)(8936002)(16526019)(6916009)(186003)(6506007)(86362001)(2616005)(4744005)(8676002)(26005)(36756003)(66556008)(956004)(66946007)(5660300002)(478600001)(66476007)(6486002)(6666004)(52116002)(6512007)(4326008)(1076003)(83380400001)(44832011)(69590400008)(54906003)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: ji3agr65LPL00iesfQyUfTZTyuNOE98Vw7h9QuoGeJTgJ4O9oPdYhD9RxGY/oJ2eWnQjDSoYsSZ/GcIHb1pNTNVNz5rlK8jC/t4i4fiSLRdTMBMO4TsISv4qhPZziD+THQohtdiyzPjHqvGSLhCB0Mf9csKpHsGqavBMO5pySS3iQ550kYK1YZmHmy69E1gYYNnjFigmCDT+RGZvhOcYTckWvvHyL+Et1h+w9NoiranBZ2TeB9XgjY+D5J/Vw9wpvtJ1Rads1Rxm1fXDs7rTsVTQCUWWJC/U8QW6cv77VeiXQhBSw42yJo+dPpW/PnUvaC4f4Z3EfgY7lx2dDZkrbPO5Pr90qPCOqY7h7j4/XQXcRhnR+RrGLC6Wpg34+cMRgk+SE0hr5mU8s9CP2byQ8N+UckiWXFpLANhtARH6fP7Tj/UE2/pR9UXZCMoPKkoTVnaSlyMhAuA/84Sn9OKbBqacU1PDFLZ/z1HlFwhUEnCpLl8ZPii58qsxIU56vhxWjBft9Pu3VXOO3EsWjuhPfR48Qd+qeMIB45SMa2VKiGxLrZ7PMT7+6jyIB7tdxGR/DxTMNBS/7ONQCnefnJXlb17SL5YldBiFh05DQ9fjk4IQ6KNMoPn/dmKOP020UVtrrHi9F0xqsLcZsqeroIiD9A== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 107067d7-3d0e-4810-af67-08d87e9ab311 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5696.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Nov 2020 19:16:56.8978 (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: gHLh6KAhfHig+g2AmQhvy3fNfAqkKWn5WOa0dRYjjdj7WwzNAQE/qWpEcr//GqRcgp1SVqrZkLqBcLHKYgA0Dg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0402MB2861 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Now that we have a central TX reallocation procedure that accounts for the tagger's needed headroom in a generic way, we can remove the skb_cow_head call. Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli --- Changes in v3: None. Changes in v2: None. net/dsa/tag_lan9303.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/net/dsa/tag_lan9303.c b/net/dsa/tag_lan9303.c index ccfb6f641bbf..aa1318dccaf0 100644 --- a/net/dsa/tag_lan9303.c +++ b/net/dsa/tag_lan9303.c @@ -58,15 +58,6 @@ static struct sk_buff *lan9303_xmit(struct sk_buff *skb, struct net_device *dev) __be16 *lan9303_tag; u16 tag; - /* insert a special VLAN tag between the MAC addresses - * and the current ethertype field. - */ - if (skb_cow_head(skb, LAN9303_TAG_LEN) < 0) { - dev_dbg(&dev->dev, - "Cannot make room for the special tag. Dropping packet\n"); - return NULL; - } - /* provide 'LAN9303_TAG_LEN' bytes additional space */ skb_push(skb, LAN9303_TAG_LEN); From patchwork Sun Nov 1 19:16:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 11872425 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 X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D4258C4742C for ; Sun, 1 Nov 2020 19:17:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 94C7B206BE for ; Sun, 1 Nov 2020 19:17:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="cHVTITNi" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727181AbgKATRQ (ORCPT ); Sun, 1 Nov 2020 14:17:16 -0500 Received: from mail-eopbgr130045.outbound.protection.outlook.com ([40.107.13.45]:31354 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727122AbgKATRM (ORCPT ); Sun, 1 Nov 2020 14:17:12 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nAlDWEcuX3hWVM5z/Ulcb2P04+PuNQje97tWW1g14EJAGoC/Yx2YJoqbSce3kk2phQ4b34FNuqXrBYqoRheO1kbRGpdaMqfr2y5szctXSTyUZFp1FhU0EVQJ3I7LtzHZpYxAMyUU131KP76pJlZYryU3tdrdaWi0lfsqI2StHGjCROY5ebmQso71tVWd9sHGDyz7xjlX2JGkvIjRuvh8Dlf3NEgqOQ25t4eDX0dYe1aovdoO/6TP0nII996OQ+26TYRk49wUb88P7z81CSGAvctvi1BbdeGZCrmJxTh1m79OVH4HCCUMtR6kHqFm+ey7n3PX5aR1DTsKHGErE5emKA== 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-SenderADCheck; bh=5qQIoxg5hGG2+wN4AQkHdfQVPeMMmIIneiWkK+8CqBI=; b=WIxiJfoKZBsrjZlNc596WvbZSJyPk/Q78rMYw7VQ59TfeiV+Wc//N6A1uGvYMujLwG+XdunbFepxvMSOv/YLLJx6UKo5OQY7zK0QP83FZAGKkmzCq+uvD4jUyBVKRsDkNWkcRPbhBg0JArIJJW8OV8hPtX8oxR7ilZd35P1COfTBKQMfnmDV1IfHNHNbkbsNf1iD+YCj286yzqxsv7NMuD/Yw58XVF4mt4Gj2l+kQy9bZxAQy9ryc7Y15tvcZDFv172gePzAAnTCEQJeUvtvwMiJa3yu9s6BCYLbjVlYqhoWegooO9SYqgeqQIMDbq12yPajWxJUa+en9ELTpI/3hA== 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=5qQIoxg5hGG2+wN4AQkHdfQVPeMMmIIneiWkK+8CqBI=; b=cHVTITNiFHUeRyUT7gefOB97fhkeCpl9Vh+qIxYMNHd9CPqh+si7ptjwkyVkxFVsriF1Xmhovx9mjcQM7DoU8ez9G00kKIH6dxwGtIlJm/rHD0UqKqkBX+QeuGYTGm8Hq6AMv8ZJaCnHhkQ/D2OE5gp6Jbb4PG6Zod+ydbpBvKA= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB5696.eurprd04.prod.outlook.com (2603:10a6:803:e7::13) by VI1PR0402MB2861.eurprd04.prod.outlook.com (2603:10a6:800:b5::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.27; Sun, 1 Nov 2020 19:16:57 +0000 Received: from VI1PR04MB5696.eurprd04.prod.outlook.com ([fe80::983b:73a7:cc93:e63d]) by VI1PR04MB5696.eurprd04.prod.outlook.com ([fe80::983b:73a7:cc93:e63d%3]) with mapi id 15.20.3499.029; Sun, 1 Nov 2020 19:16:57 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: andrew@lunn.ch, f.fainelli@gmail.com, vivien.didelot@gmail.com, kuba@kernel.org, Christian Eggers , Kurt Kanzenbach Subject: [PATCH v3 net-next 08/12] net: dsa: tag_edsa: let DSA core deal with TX reallocation Date: Sun, 1 Nov 2020 21:16:16 +0200 Message-Id: <20201101191620.589272-9-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201101191620.589272-1-vladimir.oltean@nxp.com> References: <20201101191620.589272-1-vladimir.oltean@nxp.com> X-Originating-IP: [188.25.2.177] X-ClientProxiedBy: VI1PR0401CA0001.eurprd04.prod.outlook.com (2603:10a6:800:4a::11) To VI1PR04MB5696.eurprd04.prod.outlook.com (2603:10a6:803:e7::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (188.25.2.177) by VI1PR0401CA0001.eurprd04.prod.outlook.com (2603:10a6:800:4a::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18 via Frontend Transport; Sun, 1 Nov 2020 19:16:57 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 80008fe4-62d0-496e-bf2d-08d87e9ab36a X-MS-TrafficTypeDiagnostic: VI1PR0402MB2861: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4502; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: yWopS4vRpz4mZ0VfmZuQbY5jro6ru3T6G8/tRJ6SOXVRwSCiAj95yEG0QCEwrirQVlaQt0LexoY9VKudOKZpSdcn5CJ95xxo2CPgNUMzqYIfyr1qNKCJfQXgJUnVZWCQ2baAmi7k4AyG88P89OfXaSpnTJ6mRuI8H95o5UQmHkipGsBHFGPKwI0DGMP+tir3O+8ZmM54SuDedjQZTzxq+BwEYyGxCev5X7CSPWw4ogTrgoeiQHRuG4kC4Febba8C2zKqStfwjInVHGXxgn4+FPaEHyMJ6ScLMV9kz4eFPmqE1qobq/bt65gPrnlPN/J/uZ0iKSB1v6FWvahnYtZA9/sybdEU7ympAzIogxqMEFNpM5Unz9DfIK/YX8rB32+Q X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5696.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(136003)(376002)(346002)(39850400004)(396003)(366004)(2906002)(8936002)(16526019)(6916009)(186003)(6506007)(86362001)(2616005)(8676002)(26005)(36756003)(66556008)(956004)(66946007)(5660300002)(478600001)(66476007)(6486002)(6666004)(52116002)(6512007)(4326008)(1076003)(83380400001)(44832011)(69590400008)(54906003)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: AHofs/gNuBt0EqMIOF4izFSuslmd4IY938YhRwwVlR+cHNFpWoOQcdQCmxG1zPRJRtZUhik+OeeL7CO/V3bPNL9wUvh3VySfIDXciHxfKFSko7PuRH97Z5JjIIcpBU17oSs3qJwxLkKfouVe+lVykXn2QzL46+ox60l4jos2KMm0GLiKgYzFVwNG/3ZsRtzFM6SNYwYa/89f3JpA36zvkMkjCrYlmrnn3hVzWWDD21EGnc4nk8ZxfJzjUTvhfaxnU2EhdC9jdUrkTafT8+VP7hVAVKjyval919qh8lpJf4g82ej1AW3jfZYO9vETznYFggakRu8JNE00Rg1ATnPMnQTSLT6sjSJ96uiU0ZGfM7ebNviOSGnni5nkAQk0qO94NJVfnKXEXDlEivYDXOpgDDqe9rQ9nSfchGdYIl48nzWSgRIyt34ZPiC2tM/Y9uGxi4ZYZonLngnwQ1yC6T4lq7GfTn7Fwq1cZoYl38Gbtmg8otPQrbY9w2vspkTZlxc/n7I2vf9uOka3Hy7ffFqsOFTCO4grvcC5+Uex6Plyc86uuufYZJaPIVHA+z0K0wO0blZ0pRWAqPWdefEKQI51MomLFTGiid1hpBYKhEORLFS9w5alSOlvR/RbBow9DMbutbW03l5nVeb6TuCEEmUBnw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 80008fe4-62d0-496e-bf2d-08d87e9ab36a X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5696.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Nov 2020 19:16:57.4755 (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: 2iRAGyDpfr2AUtTkgRYo0rh6g5HddAUeq9Zm3Mvv1tgOGXkTYg9LfmjJZxywNQZ+GJB9L7OUi2iLAhQ7LAYErA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0402MB2861 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Now that we have a central TX reallocation procedure that accounts for the tagger's needed headroom in a generic way, we can remove the skb_cow_head call. Note that the VLAN code path needs a smaller extra headroom than the regular EtherType DSA path. That isn't a problem, because this tagger declares the larger tag length (8 bytes vs 4) as the protocol overhead, so we are covered in both cases. Cc: Andrew Lunn Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli --- Changes in v3: None. Changes in v2: None. net/dsa/tag_edsa.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/net/dsa/tag_edsa.c b/net/dsa/tag_edsa.c index 120614240319..abf70a29deb4 100644 --- a/net/dsa/tag_edsa.c +++ b/net/dsa/tag_edsa.c @@ -35,8 +35,6 @@ static struct sk_buff *edsa_xmit(struct sk_buff *skb, struct net_device *dev) * current ethertype field if the packet is untagged. */ if (skb->protocol == htons(ETH_P_8021Q)) { - if (skb_cow_head(skb, DSA_HLEN) < 0) - return NULL; skb_push(skb, DSA_HLEN); memmove(skb->data, skb->data + DSA_HLEN, 2 * ETH_ALEN); @@ -60,8 +58,6 @@ static struct sk_buff *edsa_xmit(struct sk_buff *skb, struct net_device *dev) edsa_header[6] &= ~0x10; } } else { - if (skb_cow_head(skb, EDSA_HLEN) < 0) - return NULL; skb_push(skb, EDSA_HLEN); memmove(skb->data, skb->data + EDSA_HLEN, 2 * ETH_ALEN); From patchwork Sun Nov 1 19:16:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 11872441 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 X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BB671C388F9 for ; Sun, 1 Nov 2020 19:17:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 74A67206BE for ; Sun, 1 Nov 2020 19:17:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="H6BYgJU0" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727193AbgKATRT (ORCPT ); Sun, 1 Nov 2020 14:17:19 -0500 Received: from mail-eopbgr130047.outbound.protection.outlook.com ([40.107.13.47]:47874 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727129AbgKATRN (ORCPT ); Sun, 1 Nov 2020 14:17:13 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VV4kmNXZKCj/yauIvk1gAr13bnSmFJF+NwSEc6oHd6JrNSfr4VnbFthsML4YgdYttPz78cNj10xX0cTSd/SCPe09m/YFCi5z0DHs379YBHuUApqgbFALlxdF4U9hc92LbvmKG+2a1aLgBTL9bwFYDE1upEE8A/c2FwHrzvny9+xG2QTkwHVvuela3p6QN+8Xc+S4YXH/6S7R3kpccRbpdSnBWtZVeJcZYI/4nT0kqT9FR1/rTSF4RO5hzBFUOswmUd5r3OVYPKB1fH3VWFr3NwQZV7vVK/+E2FFupN/ElzTW8dOQUfOIkFJVbcvag1FDcvaN8rpme/0ydlpLrCB6Hw== 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-SenderADCheck; bh=TutlZQUGln3FF2yuycC/Z0uMOMQCO3tpJeH09+x0xTg=; b=UI/SS+GHnqEDqBYQ9VUhC6HVvaj3/3iK75Ala21qlM0EJzy5/XXerfPoEUsgbxjCxsCc7LO+HBpQI5qg0u80tlwdUM6wv0zfmm4pJezeQSRQx+P1+Q+aNwuYxPKomUGUw366rTaILVPzCC+qAtlvv+97YU9dkrHomqIJy29KO5u+JpNKgXORzjCuLjaOu+dW0BT08JSdjG/YDISb0DOcke2w0uVlxMcjJsft8zIlepsOgwWxvD5lFeSAPkJFV4T5JCN+8+//DPDUC6ReupN8VLRCm54L03OcmLM26XNFMihOGOVqLA1+j0KKfVXzt7SdEESsBgUkF7T5D5TNsrGEtg== 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=TutlZQUGln3FF2yuycC/Z0uMOMQCO3tpJeH09+x0xTg=; b=H6BYgJU0Y6Ej0XYjkQ9iGKmnCphdEDY1yc4KqUmpBFZiPJIf/cYuvwS9tzDCVgrsSgK0FCTff6Q/CQgRjwCo+mSBZzZVEXCptjF3fdtH/OPru3ts3Rxhtm7VIl0ardvxeaZRKnuwLlWe4/1QizFn2Fm1Z7cMi2q3xxXy0YQlMA4= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB5696.eurprd04.prod.outlook.com (2603:10a6:803:e7::13) by VI1PR0402MB2861.eurprd04.prod.outlook.com (2603:10a6:800:b5::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.27; Sun, 1 Nov 2020 19:16:58 +0000 Received: from VI1PR04MB5696.eurprd04.prod.outlook.com ([fe80::983b:73a7:cc93:e63d]) by VI1PR04MB5696.eurprd04.prod.outlook.com ([fe80::983b:73a7:cc93:e63d%3]) with mapi id 15.20.3499.029; Sun, 1 Nov 2020 19:16:58 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: andrew@lunn.ch, f.fainelli@gmail.com, vivien.didelot@gmail.com, kuba@kernel.org, Christian Eggers , Kurt Kanzenbach Subject: [PATCH v3 net-next 09/12] net: dsa: tag_brcm: let DSA core deal with TX reallocation Date: Sun, 1 Nov 2020 21:16:17 +0200 Message-Id: <20201101191620.589272-10-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201101191620.589272-1-vladimir.oltean@nxp.com> References: <20201101191620.589272-1-vladimir.oltean@nxp.com> X-Originating-IP: [188.25.2.177] X-ClientProxiedBy: VI1PR0401CA0001.eurprd04.prod.outlook.com (2603:10a6:800:4a::11) To VI1PR04MB5696.eurprd04.prod.outlook.com (2603:10a6:803:e7::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (188.25.2.177) by VI1PR0401CA0001.eurprd04.prod.outlook.com (2603:10a6:800:4a::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18 via Frontend Transport; Sun, 1 Nov 2020 19:16:57 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: a6b95685-4b58-4afe-edb0-08d87e9ab3be X-MS-TrafficTypeDiagnostic: VI1PR0402MB2861: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5516; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Uv7PFiOwCJfCepvw76g35OHDczLPbq/rldlBGCHROJO0Xp/mDKfcq6AloQl3+6NrJy0ftY7LCWBTqGg0tw3Ut67RBWrh5My19sJeA32vk9Ikc3l2p0pfJbMNC5c4u1PVv5R7+WQxJLwCcTROPy4V5qp+fafltO4fV3XFSkX4hB/EKBNNl4M7XvQLLd7/IzdykzYWYhoUqMRdSNuxJ4g/6WVY4fZwqOGbBoCylBa9THl2LRDAbHs6SONJNVepzIqUCkr62Rko0nW03sGL/hlm6eiU4Lt82wnT0A1zicAwyUmJoHusdAKBEeO4eB+eU6cEbT6lkd8IDQHNvP2r8QHe7mxcrsFwevRZPb6biLQRZrKAEpXEIvyNOX4PBUCmsSqZ X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5696.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(136003)(376002)(346002)(39850400004)(396003)(366004)(2906002)(8936002)(16526019)(6916009)(186003)(6506007)(86362001)(2616005)(4744005)(8676002)(26005)(36756003)(66556008)(956004)(66946007)(5660300002)(478600001)(66476007)(6486002)(6666004)(52116002)(6512007)(4326008)(1076003)(83380400001)(44832011)(69590400008)(54906003)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: GZwUI+TY0L+/1exlnWlOAFfHP3pnoRsNubPoN/DgaEyU8D/pzdx9mtgvTDxNTD4RZEpD+L17WcT6SovgYxhWMOY2UwvVvUMbQT1yNU5ijvkqhul2Aj7+FjLu+OK3otCdwrGWz7K7Ru07eFIRCCTy62MPCWjXaDyXrupF/QOwOHQz3mZLS6emKDv/2SIIf9cJa/tgAEQtzWvucIfs7QshTb7UYmfUJSioeUao9u4ArB9viadGCmHn81lkN92orNU6ds1Y+geTndrX/Z6Xp0mwxAdjMNcn5dds4rndijjJ99FptB1mQAOOcj6kvBXgNHJcxFxqIB+wGQbqSLvpxgNjhTdZao6szK1iDoB1mqCyQV5UFRTdJJsmIOQEbjOfkuU81G2tAmQgG6DuWgHtQoE2ov7qiKAHfwEHaJtN6vqrppjMSl/+oh303/DdCdKiVsqYm0fnLoo0UdPTWVthL4cDqGgiyJ4f29PGrO1ZhJmnyd8auEA0WiRkif9wEtmMmImTDUfKzvNsWiCfPF7FcXIGmMWP5q6vfJPMnHo60MiJ5MpvUnKgVTK8zUOMxQOyEq1hZ1LE7jwGUHc/2zplo6w75TfV90trLH7qwqQqR5fK4ttSft+auiusmsq2Hu8vBao/fryLUlP0NdhfQUnzDUxYhA== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: a6b95685-4b58-4afe-edb0-08d87e9ab3be X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5696.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Nov 2020 19:16:58.0841 (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: g6KLEqqmSN+yfNdrbeqlSgHF1/CVQNfcRlwkhrHgMIwZJUxhgcoZqV+DvxqqxhdGKMVGBNKBRO3FKmmnuvWCHA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0402MB2861 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Now that we have a central TX reallocation procedure that accounts for the tagger's needed headroom in a generic way, we can remove the skb_cow_head call. Cc: Florian Fainelli Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli --- Changes in v3: None. Changes in v2: None. net/dsa/tag_brcm.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/net/dsa/tag_brcm.c b/net/dsa/tag_brcm.c index ad72dff8d524..e934dace3922 100644 --- a/net/dsa/tag_brcm.c +++ b/net/dsa/tag_brcm.c @@ -66,9 +66,6 @@ static struct sk_buff *brcm_tag_xmit_ll(struct sk_buff *skb, u16 queue = skb_get_queue_mapping(skb); u8 *brcm_tag; - if (skb_cow_head(skb, BRCM_TAG_LEN) < 0) - return NULL; - /* The Ethernet switch we are interfaced with needs packets to be at * least 64 bytes (including FCS) otherwise they will be discarded when * they enter the switch port logic. When Broadcom tags are enabled, we From patchwork Sun Nov 1 19:16:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 11872439 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 X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D38AEC388F9 for ; Sun, 1 Nov 2020 19:17:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9B913206BE for ; Sun, 1 Nov 2020 19:17:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="YylGV2P5" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727234AbgKATRV (ORCPT ); Sun, 1 Nov 2020 14:17:21 -0500 Received: from mail-eopbgr130045.outbound.protection.outlook.com ([40.107.13.45]:31354 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727179AbgKATRR (ORCPT ); Sun, 1 Nov 2020 14:17:17 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FHgtYtFrEF7R+GzVapw8ywV+HnAEnocOOJgWVObPeI41wJX7dwzeNB2/CAmB4y/pTR9zdpZcZ6+zXcLvaXrDlVaIm/dUstcd9LnuAubahmCsjVQd1wVMs7SGcydKZF8C6SIY7t9OdxnKQv+I0agsH7Cb29AEAJWiraMqdrBemrxHF68r6J5TaDF1OQtmIwrnQeilvSFtNgcN8AL/XrAhx+momWa9SGS4Sfc+pAaXIZoJf5/1Y+MM2Rp0pKhCAHM/6twFodPm9SE0/HjMJNHxMcVFx67wGOXWx7MmYNT9BfF6qkjja1T6F3x+96hOz7FiuYiqzzjnyZbc+QNTcfigWA== 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-SenderADCheck; bh=XdX+8sQW9Uy0GBCZojAxdGwCrv9hS+ImDf0XljF4k5M=; b=Q7QnAzXGRoCKQOoxvUWTvrgf4UrqFmdGMyn6TmoQ6EZF1ghawu+Cx0MnTw0zsatuz8i+8t0YwkIzue/1XFG5Vydq0Xw0ADNlMkUioD9TlYta7PcCb8hb5PDoms6IanINl58EHp7sMUwPdl2C9FZ+p2/rMDjBxzdIOR2Wah8cmWkUEduECY+YmvDm9FsCdE/im6aya3ifLI+zucJxlXFtwEOve7UtgXh2fq/1/ksatR0CJ+9QcJpjSS6m0vljsJ9WqxBtvbuU2Sqseukps0Gvqugwe/qHZAiuyPDFy+rPC4Swb7fZ2AaTf1O+ZKUXByD5sF/pkMdbwnKf4Vel+crqBg== 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=XdX+8sQW9Uy0GBCZojAxdGwCrv9hS+ImDf0XljF4k5M=; b=YylGV2P5IRQLDYDaq3xok3246uSBtXyfh+xJJf+x7dESiYrtc31Kr4pPRdyIXdoRcGeUzSGp0+o5opTnTLUgIT5GCGVna+Mj+yhBIWhvzl3RV1oPhIcHTN3MfjpmdMJQUUTNWkFC04BevV2OrHnc/8U63/IzKGFnyxvbMQc2ido= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB5696.eurprd04.prod.outlook.com (2603:10a6:803:e7::13) by VI1PR0402MB2861.eurprd04.prod.outlook.com (2603:10a6:800:b5::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.27; Sun, 1 Nov 2020 19:16:58 +0000 Received: from VI1PR04MB5696.eurprd04.prod.outlook.com ([fe80::983b:73a7:cc93:e63d]) by VI1PR04MB5696.eurprd04.prod.outlook.com ([fe80::983b:73a7:cc93:e63d%3]) with mapi id 15.20.3499.029; Sun, 1 Nov 2020 19:16:58 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: andrew@lunn.ch, f.fainelli@gmail.com, vivien.didelot@gmail.com, kuba@kernel.org, Christian Eggers , Kurt Kanzenbach Subject: [PATCH v3 net-next 10/12] net: dsa: tag_dsa: let DSA core deal with TX reallocation Date: Sun, 1 Nov 2020 21:16:18 +0200 Message-Id: <20201101191620.589272-11-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201101191620.589272-1-vladimir.oltean@nxp.com> References: <20201101191620.589272-1-vladimir.oltean@nxp.com> X-Originating-IP: [188.25.2.177] X-ClientProxiedBy: VI1PR0401CA0001.eurprd04.prod.outlook.com (2603:10a6:800:4a::11) To VI1PR04MB5696.eurprd04.prod.outlook.com (2603:10a6:803:e7::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (188.25.2.177) by VI1PR0401CA0001.eurprd04.prod.outlook.com (2603:10a6:800:4a::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18 via Frontend Transport; Sun, 1 Nov 2020 19:16:58 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: b6385dbf-0093-491f-1346-08d87e9ab417 X-MS-TrafficTypeDiagnostic: VI1PR0402MB2861: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2D8NQhBuk3eqNF6/GNJCGSxsZEMBrJaqk9s4WHFseUtGE0dKlr05pjVhvZ7ER/gj8PJyH9RLNCfCDFj1boMwVKudYxBzWze9GllrdoVjKzvSIlqRLqYT3EFxh9u72p6d+YvuJ995ooeoMc/oG4T9UyM82zgnSuf6/+4pvr+k/h6gmpkdy7FnzWEOaBc6fsEmOI1uK5IhQRnKPgvGiow7ORVR/tBH62yGJSwx+26FZ0Lo+TN5KQsQQcGudwEGlnsMK6IsW7ApUcEHAzV8BHjtPKTYCh898e5vFY8vGdP2aycZFT7/6fUyvazvkVMR62jXJfZgHEipyWAkm5m7A32NsdQnFqnq9b87p0f19PlBMevt6QWKo8EYcqkazXSB3Qih X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5696.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(136003)(376002)(346002)(39850400004)(396003)(366004)(2906002)(8936002)(16526019)(6916009)(186003)(6506007)(86362001)(2616005)(8676002)(26005)(36756003)(66556008)(956004)(66946007)(5660300002)(478600001)(66476007)(6486002)(6666004)(52116002)(6512007)(4326008)(1076003)(83380400001)(44832011)(69590400008)(54906003)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: PkT4DCv3ieFUk1zjkbl+RqkkHHvnl1vLHjfT7xjt940HWl1eDIpz4ne9gRnnzQ6gDDU8UoYB+s9r9Jn+SIrIFR44adC1Lw6IoPWCe4OfdjM1AB7QsI38tGhwYzlT6r/hZgrv0yhzs7BNmNmv/gLvGqHdVOh6UemPWmOfct9BflOTRgIb9SeuysmUGipB8gDhWg6JLF9VsYVfOIk7HkJ1S8axn+6vBZnAvwZhBhhsHROramQGdOBdZYTY84doyKq4egF5HX5kwZ0XNKrNmPM/bO4tcOJCD4fBEuJCyyNuJC6spP9QqTvKKyB8gAsRMCCtuXQxuDyjuYdzNTHakjTWz7dDmsd2fYNDVQO3coTJgdHV4X7mkQPSRUvqNX40dTUAxFIFGjDNJy4VLTF076t2XI9pqlHWjnYOi1uI9X2gB63Qi0lz2PUsg/4r9b3ffO7AWcl289swc1vEGSQdyXMJYQuAWp26na7j899lvjng5t1Yp/AzuwjLLsMHm137WswxRNZ2rfWQzgDO1+5T8BQ7WL9vlPNndULpLBsxxkces8nCRE4FYVg8yNKIZp5v9R8M3D7FkXWImyCdWtSoCa8Lv/hMYBKcnwBkWevH1MGcRBT60cmDhaaJbeGhR8Uw6BVBeD8CSSOFXOBdShfyZQqHtA== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b6385dbf-0093-491f-1346-08d87e9ab417 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5696.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Nov 2020 19:16:58.6428 (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: Z0EzNNgPHCjHZTFaU453bLJcLDamZtHEAp/Giw7s+0CSz80JhaAMiQDu+ciwkDkUJhslu8iWZKvBJV+0qFlIyA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0402MB2861 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Now that we have a central TX reallocation procedure that accounts for the tagger's needed headroom in a generic way, we can remove the skb_cow_head call. Similar to the EtherType DSA tagger, the old Marvell tagger can transform an 802.1Q header if present into a DSA tag, so there is no headroom required in that case. But we are ensuring that it exists, regardless (practically speaking, the headroom must be 4 bytes larger than it needs to be). Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli --- Changes in v3: None. Changes in v2: None. net/dsa/tag_dsa.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/net/dsa/tag_dsa.c b/net/dsa/tag_dsa.c index 0b756fae68a5..63d690a0fca6 100644 --- a/net/dsa/tag_dsa.c +++ b/net/dsa/tag_dsa.c @@ -23,9 +23,6 @@ static struct sk_buff *dsa_xmit(struct sk_buff *skb, struct net_device *dev) * the ethertype field for untagged packets. */ if (skb->protocol == htons(ETH_P_8021Q)) { - if (skb_cow_head(skb, 0) < 0) - return NULL; - /* * Construct tagged FROM_CPU DSA tag from 802.1q tag. */ @@ -41,8 +38,6 @@ static struct sk_buff *dsa_xmit(struct sk_buff *skb, struct net_device *dev) dsa_header[2] &= ~0x10; } } else { - if (skb_cow_head(skb, DSA_HLEN) < 0) - return NULL; skb_push(skb, DSA_HLEN); memmove(skb->data, skb->data + DSA_HLEN, 2 * ETH_ALEN); From patchwork Sun Nov 1 19:16:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 11872437 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 X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 491A0C4741F for ; Sun, 1 Nov 2020 19:17:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0400C206BE for ; Sun, 1 Nov 2020 19:17:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="ZYuxfBtJ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727254AbgKATRY (ORCPT ); Sun, 1 Nov 2020 14:17:24 -0500 Received: from mail-eopbgr130047.outbound.protection.outlook.com ([40.107.13.47]:47874 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727009AbgKATRR (ORCPT ); Sun, 1 Nov 2020 14:17:17 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y0WquFRY/DtLFFu5zGFGJQUjjmamapg3RJJ2Dh1mjN+lWmQPIIsA0m+DAr8HXiuu/ahRKhb/wc2dT+cmnYkfvokgQXwCEOw/ggRPYJxIPG2mfpCVCHTgpir9eNCSoYeWqIXZ6eVA7MZGPKIc2aqH8wsbYqirGrf2s8z3T4cScC1mm+RuD9sr2MhDzWcajwnWEiSpT+ZmPI2LscQxy+jABdFRuBsqJpAqHi9yFlBDcCRE+4HtFuNx91Nvbk4D9CnrPO27PpwEjP0OQmEncDsa8r5zdEaM5s/61x4NxlGfYiUvPbO0HPqkVQU2VT7O2Omb1t3c9Unf6i+eUEJkmnQ74w== 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-SenderADCheck; bh=/CkLLcr1IE0AEyDhYiBHH5b18feuGU0ovuoU9ApuDSI=; b=AqzxwEMIOr3TAcT+qGXfsfuUGxlSLUJDiYUGOslxeyDcfgo3SqAUoSVo6NtpzcdInlEb++lYIFjvN/cm54feYD69BSH43FtHBYF3c+BOv1xTRPscHQEDWRCFNA0NtJpI5/bhLXm6zBpA7GLN6S9nka2vqdAYhNn/4i+JTlciKmBEL9so6M1tcgRfFCtcygKcl61nbz9cqALpl8e+U/GWNZQY+KucRO8sK5sgZTQUglXCeHaRDscP93bhOPGtEYfdgro1hIuquPzkC4n67Rxl6GzJo2FjibuiSBmEnouqQ8wgPkrHuph9VPGouBx/VrWJF+yhelYvkrxFGiwvz6X91g== 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=/CkLLcr1IE0AEyDhYiBHH5b18feuGU0ovuoU9ApuDSI=; b=ZYuxfBtJ9C62FOFNNb8KT+YGywOQoFPM0Fai8rDKAPljvOOH1iZnk6/lT5n5oOPXfRok4U4mxdFWiA3sGWJSs9u2eIX4wQkW5j1RKgSDZr23jaYXmM2wBDLoOXN8rnylt09Zv71TPrVnOceB03reTB5hiXgpKWT2UkvlQPjd3XM= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB5696.eurprd04.prod.outlook.com (2603:10a6:803:e7::13) by VI1PR0402MB2861.eurprd04.prod.outlook.com (2603:10a6:800:b5::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.27; Sun, 1 Nov 2020 19:16:59 +0000 Received: from VI1PR04MB5696.eurprd04.prod.outlook.com ([fe80::983b:73a7:cc93:e63d]) by VI1PR04MB5696.eurprd04.prod.outlook.com ([fe80::983b:73a7:cc93:e63d%3]) with mapi id 15.20.3499.029; Sun, 1 Nov 2020 19:16:59 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: andrew@lunn.ch, f.fainelli@gmail.com, vivien.didelot@gmail.com, kuba@kernel.org, Christian Eggers , Kurt Kanzenbach , Hauke Mehrtens Subject: [PATCH v3 net-next 11/12] net: dsa: tag_gswip: let DSA core deal with TX reallocation Date: Sun, 1 Nov 2020 21:16:19 +0200 Message-Id: <20201101191620.589272-12-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201101191620.589272-1-vladimir.oltean@nxp.com> References: <20201101191620.589272-1-vladimir.oltean@nxp.com> X-Originating-IP: [188.25.2.177] X-ClientProxiedBy: VI1PR0401CA0001.eurprd04.prod.outlook.com (2603:10a6:800:4a::11) To VI1PR04MB5696.eurprd04.prod.outlook.com (2603:10a6:803:e7::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (188.25.2.177) by VI1PR0401CA0001.eurprd04.prod.outlook.com (2603:10a6:800:4a::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18 via Frontend Transport; Sun, 1 Nov 2020 19:16:58 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: f3f7eb0f-15a4-4347-e5ae-08d87e9ab479 X-MS-TrafficTypeDiagnostic: VI1PR0402MB2861: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: m+ghVOCQQr+68WNwD0HCakoMPxp0hI+EBBkQz7lM49qGB8zoodvRAYmfkCHnwEPLRJQCNRxoTUMXr3SPegvW7KOLRcNoDwggLK33UhPR35itZpXalBOLBIowG//CD8DW/wiwqpOoHNEfjwmGdYagPPO3yXDrQe+xJJkmcV7rI4rJwE9fb1HjOZTsvTXDGkCVK9AlpOwyh7fjf5kKdcT+f/b8IoEmmdajUe75VlcRnp5bhZJMiH+yp2kDv8JrzEveryFe9p7F3Q76O+qgTx1dpb9XBRsovrUaKwtujD1wHmzKnxtnQPj4PEuHFodAMrxYWYFvpyBaSNNMMFSJWqC2XhZcnMrr3mbLjliT6MSyBlJe7QL2pUlDN3wXGgobP35O X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5696.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(136003)(376002)(346002)(39850400004)(396003)(366004)(2906002)(8936002)(16526019)(6916009)(186003)(6506007)(86362001)(2616005)(8676002)(26005)(36756003)(66556008)(956004)(66946007)(5660300002)(478600001)(66476007)(6486002)(6666004)(52116002)(6512007)(4326008)(1076003)(83380400001)(44832011)(69590400008)(54906003)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: H4589yJcJZSVCm4UY3FQyQlmlrELbCpWbGgGIRfQZrK1pAVFrEmsEP/NoYfqbnaaRlp/vJoEyB6kgbEk/blDqdtj3py2Ml+9xyI8vi3hSFeVailvs798bZnju5W23PywLjeGPbnPowNHqUBYVJMNRgLPYYKJaD8KtWP6LuaURbuWKXB8Z4EOLu3VuXjC+iGfsd3elj1Bz/vGtRDnQG4kuz328+YR+7n7ePnzv7wo7CQaJzJV65bRKYbfuPn1DhIvVtIlbL/dvV0X7EyPTIi/03tstH1f+XR2y1mIfJ9SiKTahJ+dWRzvZ1hZCnAvMHs1tqYwSYQUXU/hS9kMVd7Zree95Nb1EcjB8kjEO/urnK3Gas+e1I7BRxs5TMxHke7ITFU0Tz2bbLNrkzmOFb+5XglQkT69+J+XbnzHvYL3qPyjS5b7fqjM5w90uHiA8rQ/M8ycVL5189/UuSkPYrLokThdO3Q48aQOlvGjkVcaoKtbdUBydhmVTR4Ks3T/6+Bo/WJRtqy3o3dMb4cx1Ze3qIv1JG3lD5D1c7mAbzXLtwlHI6QE8I88S0WtKbPoTdxY8/BYYGeftLxEhUVg6B2ZE0Y5U6e/rPhzQsDYdx4noyRKqmaOGzMRu8rNR9xk23WL0j38u/anO/Aw6yc06us4gg== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: f3f7eb0f-15a4-4347-e5ae-08d87e9ab479 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5696.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Nov 2020 19:16:59.2645 (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: qfxf14n7tRKRdhXClvYRVFMMdiIXl04adwf3DiqVZj8Ht3RDLsgPTf5Dsagaob6swrmVAbHCh3MenVa3MYtQPw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0402MB2861 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Now that we have a central TX reallocation procedure that accounts for the tagger's needed headroom in a generic way, we can remove the skb_cow_head call. This one is interesting, the DSA tag is 8 bytes on RX and 4 bytes on TX. Because DSA is unaware of asymmetrical tag lengths, the overhead/needed headroom is declared as 8 bytes and therefore 4 bytes larger than it needs to be. If this becomes a problem, and the GSWIP driver can't be converted to a uniform header length, we might need to make DSA aware of separate RX/TX overhead values. Cc: Hauke Mehrtens Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli --- Changes in v3: None. Changes in v2: None. net/dsa/tag_gswip.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/net/dsa/tag_gswip.c b/net/dsa/tag_gswip.c index 408d4af390a0..2f5bd5e338ab 100644 --- a/net/dsa/tag_gswip.c +++ b/net/dsa/tag_gswip.c @@ -60,13 +60,8 @@ static struct sk_buff *gswip_tag_xmit(struct sk_buff *skb, struct net_device *dev) { struct dsa_port *dp = dsa_slave_to_port(dev); - int err; u8 *gswip_tag; - err = skb_cow_head(skb, GSWIP_TX_HEADER_LEN); - if (err) - return NULL; - skb_push(skb, GSWIP_TX_HEADER_LEN); gswip_tag = skb->data; From patchwork Sun Nov 1 19:16:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 11872445 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 X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6B555C2D0A3 for ; Sun, 1 Nov 2020 19:17:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3A0842068D for ; Sun, 1 Nov 2020 19:17:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="NilnH51E" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727276AbgKATR2 (ORCPT ); Sun, 1 Nov 2020 14:17:28 -0500 Received: from mail-eopbgr130045.outbound.protection.outlook.com ([40.107.13.45]:31354 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727153AbgKATRV (ORCPT ); Sun, 1 Nov 2020 14:17:21 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jTehu5b9+Lg0sqYVt4Tlk1qSdLtqqPHkSaZ/Nvm4xXZ1sthu4bZPYpLAn+ilCNF3te/kOiJu7iozc7caAo4pTWM5gva5qudjhQAwnmFSTHc0Va8oJx/+2aMvoRPGmyg0IylHMPV+bz5AsOxAaTc8skA0sDclycS6JkIj3/7x1HwYbsPaE3qyRqrkp3Qn6qXzT15J/zzEi7t804FtT3K3RbzSA4nFFTyaYm8ACLCi80gBqKW6EU8UKavIQWAa9MpyQJGemXiCaZKobdhrvs7Oc/HZqimNbKM0LNuXGV4Ho6kFY3IJMf16jzMG5UQpv2n6fLbQ4gCLF/275cCl+Qkc1Q== 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-SenderADCheck; bh=2lMXv/JySk41a0EdK6MbX7MsMtOw0nuUEKX98T0E0fc=; b=eesUU25wIDZQG4G+nT50SMoB9D2wYbFq0CRdevtDGHe/kygNkhOoQTc4Qpm0svPDXrbNDKWK5nx3UOfJvXsuyxnWcBJtGcegC6b5wIP9ToXfxPd9sKS0VxsV4Azu2rfyN8mbRpsynImNRz2Lfbu5M5QqeA33SFrVVkKcKa1+bdQJWy7XUOShySZ2kwYdMPS53r9VQrrq3OobDEs4cmKrZHSDnIeoHjblpBd3EFMtB9UfuLLJdoaGOK3/VboIMuKu9Ehb0+y7ipYs/NDgKaO+AOir0NXrjPswpN9UIlX9Dcja/KDeQ6/1mxheSTxtK760KGmdey49n9kHCWNJ0+5tYw== 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=2lMXv/JySk41a0EdK6MbX7MsMtOw0nuUEKX98T0E0fc=; b=NilnH51EyGmOuknlxIGADx92w44cTHtDOBtbOm+qjeT7hNGlJJuGMFo8SRLXjCoX+0wol6xHzExod4viT4wfflH0xJxTaLZpo6Z8CE3jv8uG9sVwyuNz4HLWbOQFwUx9U4ptTXHjob9TV7AA5c0eZPUryR8w9xnzTFgC1IXiTLg= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB5696.eurprd04.prod.outlook.com (2603:10a6:803:e7::13) by VI1PR0402MB2861.eurprd04.prod.outlook.com (2603:10a6:800:b5::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.27; Sun, 1 Nov 2020 19:17:00 +0000 Received: from VI1PR04MB5696.eurprd04.prod.outlook.com ([fe80::983b:73a7:cc93:e63d]) by VI1PR04MB5696.eurprd04.prod.outlook.com ([fe80::983b:73a7:cc93:e63d%3]) with mapi id 15.20.3499.029; Sun, 1 Nov 2020 19:16:59 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: andrew@lunn.ch, f.fainelli@gmail.com, vivien.didelot@gmail.com, kuba@kernel.org, Christian Eggers , Kurt Kanzenbach , Per Forlin , Oleksij Rempel Subject: [PATCH v3 net-next 12/12] net: dsa: tag_ar9331: let DSA core deal with TX reallocation Date: Sun, 1 Nov 2020 21:16:20 +0200 Message-Id: <20201101191620.589272-13-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201101191620.589272-1-vladimir.oltean@nxp.com> References: <20201101191620.589272-1-vladimir.oltean@nxp.com> X-Originating-IP: [188.25.2.177] X-ClientProxiedBy: VI1PR0401CA0001.eurprd04.prod.outlook.com (2603:10a6:800:4a::11) To VI1PR04MB5696.eurprd04.prod.outlook.com (2603:10a6:803:e7::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (188.25.2.177) by VI1PR0401CA0001.eurprd04.prod.outlook.com (2603:10a6:800:4a::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18 via Frontend Transport; Sun, 1 Nov 2020 19:16:59 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: f3f64b6b-f892-4b4a-daaf-08d87e9ab4de X-MS-TrafficTypeDiagnostic: VI1PR0402MB2861: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3383; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: euG6Nsfa+/uf+j5MYhCa3D4J82UWYFqOsJIRzpeC4VP2PoMJw8BjSrrxtw/BY6S2qYwwnnPgwJKBIiIbjyjlEss44M0q/Ew8ETM4z7kFkNJxh912BO9eqPJ2PBspzg+94mGmcT0Mxe4v3xDpnEM3JytnusYbw36pReHgJluDaZxvLmyloP9MvtTc7KnClcc0PQQmrD3HOYdUcb9j1/TJ6rlz4UMcTscZovZl6wUHXpsaFT7xztUCvSi9jBNG43a3DJvG3zbW0nvIs7ArzFjrPw+mRZrCW0NGzAfk1jLT1nxg/lKcY+cF5jLcvgsVKM6HPVCn1be6bHIpL3uegIGvDADiD15N7vQ/ddv2IiH2swM8dgrKESCg9P5dpcdjnE2D X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5696.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(136003)(376002)(346002)(39850400004)(396003)(366004)(2906002)(8936002)(16526019)(6916009)(186003)(6506007)(86362001)(2616005)(4744005)(8676002)(26005)(36756003)(66556008)(956004)(66946007)(5660300002)(478600001)(66476007)(6486002)(6666004)(52116002)(6512007)(4326008)(1076003)(83380400001)(44832011)(69590400008)(54906003)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: S6QIvhe/uKWkrS7piHV8y4/b7s8V5RsjQMdvkoYRgmHRbMu1XHyAs496B1OWS/c9V3wENNJ2r1rYjhMco017rUYm7qecAAOeWpr4JX4z3WwWWsAXrBGpF0C/3qmPUTEZUgh7430i3+ZlreojYWu/4tjt6CXMw9Wzw8wq6bOeG10dfrx4KfYBMFG7pG4qKo3RhdDZAeBQsF96nEdlbhoesZD54kZrGi0nhAIudMb2rh7UD2VrbSA00PcSb+E8wZZon3Wc0QZ9SyvUW+Qo2ESP4HvraIMpQYdAAGr03oPzKWO50OMMP3e2ZQGV2pdrhMM5asuuruzCGn83VHQYjpEzmsJbPqgPA0dhFhCgXUZARehCHZF8XesnS82ADEEIpeDdwOJesqfA8LoDxrYjibJ2FPqCfaph5Be9Qv4ajy5SflZL5ODkXgSgJOPChOR6dt4UY1Tsd/QlwpwXg7mTPN++FeW6ob0yv5FOzfMuZhzJ2lcplXuCwEb8uYoxozvcRS0MtV3dTCEDn6qEjC39t4TuK85erPQdUiHxAz7mRAZVFTxd0+H8j7m24LYHeXt4FMME302dgzrpzE4jcI+dpVQKld0ReYuRiUx1j2AfA36LBEFlvkXjMgw6Vot/0OcMs95Ha7nYIxmE1zmG8xusfrI28g== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: f3f64b6b-f892-4b4a-daaf-08d87e9ab4de X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5696.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Nov 2020 19:16:59.9571 (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: VBSsguxdva5/7GTJoI6Dsrz0e30Wa72vDTRoTpAIMFuAX0Q4S6t8gyFvK6sOQyO8hwRIHIKnByxjtydOCT+vjQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0402MB2861 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Now that we have a central TX reallocation procedure that accounts for the tagger's needed headroom in a generic way, we can remove the skb_cow_head call. Cc: Per Forlin Cc: Oleksij Rempel Signed-off-by: Vladimir Oltean Tested-by: Oleksij Rempel Reviewed-by: Florian Fainelli --- Changes in v3: None. Changes in v2: None. net/dsa/tag_ar9331.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/net/dsa/tag_ar9331.c b/net/dsa/tag_ar9331.c index 55b00694cdba..002cf7f952e2 100644 --- a/net/dsa/tag_ar9331.c +++ b/net/dsa/tag_ar9331.c @@ -31,9 +31,6 @@ static struct sk_buff *ar9331_tag_xmit(struct sk_buff *skb, __le16 *phdr; u16 hdr; - if (skb_cow_head(skb, AR9331_HDR_LEN) < 0) - return NULL; - phdr = skb_push(skb, AR9331_HDR_LEN); hdr = FIELD_PREP(AR9331_HDR_VERSION_MASK, AR9331_HDR_VERSION);