From patchwork Fri Oct 30 01:48:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 1390637 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.a=rsa-sha256 header.s=selector2 header.b=oE5ZCJ0y; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4CMlc25x5Vz9sRK for ; Fri, 30 Oct 2020 12:49:38 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726109AbgJ3Btf (ORCPT ); Thu, 29 Oct 2020 21:49:35 -0400 Received: from mail-eopbgr80044.outbound.protection.outlook.com ([40.107.8.44]:45367 "EHLO EUR04-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725781AbgJ3Bte (ORCPT ); Thu, 29 Oct 2020 21:49:34 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jPmlgD4TIuSzBEbhmA4eXORD9Vi5A1Xvur7OWzuTRT3BWxPSW4S7SVUXrc/fTx2kvSfosYfcj5uYDN3hwLlJkkZUOQ4pBC0O2B04pGMsjFAQGKLFtjde4HxHzZlV0palga0GZ/TeOpWQPnoed3wq3UAWYIJsL4pmrEj6ZHw2fPbiJXDLxtSNnjslLUEMv7fdx2QPAAPavD6f3i7SqTL0a1QmFies9XACWWirsBMH0CFm2iNpvilNf2ZycgcMgC3IpTJ6GI1QDQpDfm3dQfjvESNk/1UHpzfN/hJnTO5GVJX7wwKVRzIqfnClmJdzufSBfN58L0oMsJS/aab6Be9byQ== 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=IdrHfXGbcwfCRLw79y5Jk89Kx7qQ494ItfTqZaRWEq8=; b=kkqwAkA52m7rP/dhryhpOlXU4meEr6t9Ng3ndg5LDSZlWXlSNJVhcexn7oVgEq3KBmE2c5SlXTU63FwGGdCXwARz87TIc+vU34TUG4wYsiKF0hcIt9Rbb8YUrVvBt6L+VLWcR2Sw1p/9EIJc7d3h+sAkB6W+tqqTttblCiOZjkKz5ut91Izi575Tqkf/7nzMyOlzRE2Sj5I+pwZaVv4c3C8PmSG0MbTqQcpYQfN3yCQKRNMrF4Z6G1jeSvXnCeKZ5WS84tUTiIUQI5RPlAdKKCxMqnJ+kp2w3ncLQBbcFIhEcdrhbJhOBb93zQnYnSNCFhEDVyKyf9QwGx7KzqOVAA== 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=IdrHfXGbcwfCRLw79y5Jk89Kx7qQ494ItfTqZaRWEq8=; b=oE5ZCJ0yKR7+ywGrNnARRsuDSqzKkydVih2AkT/pF8sN76hVYjHGq79kxbE54mDLG7eS09Qf/hfpzM1dkxPS3b52K5wibeybQb/Yio3UYPZc+ttLPXDxMTrlqXKTquxmllrcMZXjw2OMt5/y0gQAhc2QJ9GObzWkxJkyizeiuI0= 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 VI1PR0401MB2509.eurprd04.prod.outlook.com (2603:10a6:800:56::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18; Fri, 30 Oct 2020 01:49:28 +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.027; Fri, 30 Oct 2020 01:49:28 +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 v2 net-next 01/12] net: dsa: implement a central TX reallocation procedure Date: Fri, 30 Oct 2020 03:48:59 +0200 Message-Id: <20201030014910.2738809-2-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201030014910.2738809-1-vladimir.oltean@nxp.com> References: <20201030014910.2738809-1-vladimir.oltean@nxp.com> X-Originating-IP: [188.25.2.177] X-ClientProxiedBy: AM0PR03CA0096.eurprd03.prod.outlook.com (2603:10a6:208:69::37) 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 AM0PR03CA0096.eurprd03.prod.outlook.com (2603:10a6:208:69::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18 via Frontend Transport; Fri, 30 Oct 2020 01:49:27 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: aa1ad2f4-51d1-4c68-28dd-08d87c7609a9 X-MS-TrafficTypeDiagnostic: VI1PR0401MB2509: 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: 6+HGroyOfWWi0vf03PsWMULT6MVrq4xCPHLOfTyLi1/ZGhXnR61hbLdw76hs7uz6Vz2FRoDgahqdhM4+hfevV/jom2Rw/zWO/1ZJvLxrLXCWAd/akQR/RLA1f5qVgIEnWC/U5Spc6g5M52mijdWMD5rn9bmzUXqqQzB8wsNC37Pyey0JfbwtoMneW9zCb3B4tmGxJfmBW2bObvQur674USrQukuQhEzkLStfKiNWb9QFvAdCznK1kuSP+Gcpb6JJYFZ7ItgAO6Ac6qR33YIH8gO09sdgqqc9pwhwk7n6A8UzgBD+MoCl1bxlrnSgosFrT98DCI77ljBPSCNdjhA1MS2U+IrNf9yHDoCu9j1CIxKPWrKLQ7PRKXbtf1mhOUu6 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)(39850400004)(136003)(396003)(346002)(376002)(366004)(5660300002)(54906003)(16526019)(6506007)(66946007)(66476007)(1076003)(316002)(186003)(8676002)(69590400008)(36756003)(86362001)(44832011)(52116002)(6512007)(6486002)(66556008)(6666004)(956004)(6916009)(8936002)(478600001)(2616005)(26005)(2906002)(4326008)(83380400001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: zP7mXCaGzvqSIV+FcHymc8MG+mExbxyqjgX5pgrYcY7tejvCE+8/RveNSpsHGKGg+Zg3Im0GrBHpVqJ7r6zk50dB/fa4DVuO86MOr5n8aHevQP55cIioilyCdT4nDj796DSRm7jKFRQCTXwVmnLyakEceQKg6jP3dl0+ncijwj/IMCj1B4ETO05bI4xsTwBERfQgkfo0xqn0mMjsRVPfL74cXQKM3WYraceWgvHHajmO/5XoxS+3oXb/jHL6QFhsFuoesutvWZ4+1qY/gJgFjYy1LK6hWvm4uzqKHby4tSHYyrbjzOyAZl9ffTiVbCJaGx4CJU0v+K0TvmNOORIpZ8owSfzjjvSaKcE/wAninZ9jfoYeaopGH5YDvqs+Bo908H3EbvLODd9O3yQ2F9Wk5+RGryKDH6aaT1uV4LzHJdq84vsjEosWgkMWLia51lfXHpKfMpe0C5oGUHiEI65Xffl8VsIlcNHje18ifJmRzDvAaJcIZs0CFU2ad1ba3gVTZg5BSrcl4QntenobuowHwn8Wm1lk/Kq6U/hJWxDYidHaSlMqLnpv0sPLNtBm5K9UUYADt/4VeiQJZ5s8SBNUrpYVisTyEI4iikGKQcTpPDWZ25X/WwlrJOn3yOJaoSS6sC2pF32LzKK3QvrOdt1p1w== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: aa1ad2f4-51d1-4c68-28dd-08d87c7609a9 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5696.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Oct 2020 01:49:28.4950 (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: 03EQ+hCKr1eqFfHMkc3R0tEzPw4vnuV1s6rgwT2FhCoPTI9f0cs3rinSsw19h+bPjaseUK+v0zyUilB/AVacSw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2509 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.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. The tx_reallocs counter should prove that. Signed-off-by: Vladimir Oltean Tested-by: Christian Eggers # For tail taggers only Tested-by: Kurt Kanzenbach --- 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..10be715cf462 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)) { + kfree_skb(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 Fri Oct 30 01:49:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 1390638 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.a=rsa-sha256 header.s=selector2 header.b=W727Zenc; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4CMlc42hGyz9sTD for ; Fri, 30 Oct 2020 12:49:40 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726149AbgJ3Bti (ORCPT ); Thu, 29 Oct 2020 21:49:38 -0400 Received: from mail-eopbgr80044.outbound.protection.outlook.com ([40.107.8.44]:45367 "EHLO EUR04-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725963AbgJ3Bth (ORCPT ); Thu, 29 Oct 2020 21:49:37 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=J3oQW2ChSg6F7HguXXlHZx6O+fv0KF4981UkHxjIec6vHPjmtLCml+dsq+QahnD1Z67o6aPXCUEaOd4ny4PxD+xe/g/iycz3IjLv1Om3heTYL58arODjligjqn4c1LeipICukEU48e8oC2Um+4nRuogUdIcK74i1Nl47JkfavaYx3a5nIwNeGiifVibORZzVsDBJPDCEtW/HPqdyBwjaDVWCrjSoXWh81qBaGza3tjnHNIajWbxzoEn/ojWmyWUoDmEAf8jPEsTDeyaoEl+kF3p4+6SZgiA/GbpZdHOgGUfMy2KnxFAKizQ0+pX6yX+u9dBCSi70d4JPB4jxFLOz3A== 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=+IYiP9UIzXhCl5uXT3kiLvoRmZ8zaQRCeESL57HeSS8=; b=fMg1AReYQDRJoGmrKhZhBWV5w23on+k3n8AEuEBXxV5qXzFF7OeuL9lK2k49ppTZuehrHXGkOoFXNU4wvdcE//pwqILaKVrA+atUgpF5F4JNdXBtTXc/eVIc/kwJwjIEaDkg++wnKUejueD/6REIBHcbIENyZpQJKm+yKHD88DutaLKRt8IMkQEiHTcB7w1NkyzXOd/gnZCtk27INBa6bCDFOo7uYfK/JVc1tSxFNJrnjJG80U/JMqMpiAVnDmwJmx7cQm01rBIanJoLmMY/AcE8uGaG9ZcNW+uWIHQ2WgqhAzrZbm5LcDNFAtaESAWBgR56soS5sTso+kCblXQoYg== 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=+IYiP9UIzXhCl5uXT3kiLvoRmZ8zaQRCeESL57HeSS8=; b=W727ZencIHwIArz5u6ykzZFBX1ukrB4C/KQ0BBoFawes3iE+l2h8z1oqJcs+eMnDzLquGYfIyz01GiCVtw3iaeuVMgYD/dtYCxq+d6Zm8zeIX19sX97urI/gIRml3zAdH5QjLpBO3Tgt87m53Z6odio86QlOiICL66jHriN5+4A= 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 VI1PR0401MB2509.eurprd04.prod.outlook.com (2603:10a6:800:56::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18; Fri, 30 Oct 2020 01:49:29 +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.027; Fri, 30 Oct 2020 01:49:29 +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 v2 net-next 02/12] net: dsa: tag_ksz: don't allocate additional memory for padding/tagging Date: Fri, 30 Oct 2020 03:49:00 +0200 Message-Id: <20201030014910.2738809-3-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201030014910.2738809-1-vladimir.oltean@nxp.com> References: <20201030014910.2738809-1-vladimir.oltean@nxp.com> X-Originating-IP: [188.25.2.177] X-ClientProxiedBy: AM0PR03CA0096.eurprd03.prod.outlook.com (2603:10a6:208:69::37) 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 AM0PR03CA0096.eurprd03.prod.outlook.com (2603:10a6:208:69::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18 via Frontend Transport; Fri, 30 Oct 2020 01:49:28 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 24273a8e-5f2b-450a-acb8-08d87c760a3f X-MS-TrafficTypeDiagnostic: VI1PR0401MB2509: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3044; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hbW+682qBc6VTIcj0qBYVFndlTY6Br9VmPaHx4Dx3AMixA6lDmpN4cFE1dJNGmEtLABPC0MVZgMrs3875FC9DiOZ70vf80MDbeQIs41sNgNuxpGGKP8R8c4ZYstpOMQ7hK7O4NLplOBWIS5H4pkTLQiv65U+yAWpNvfzcq7WJgHq0UJ/rw4+oY/3gME5jfmf7VuLJ+JLkTvnCjfxAJqO5GW1W/7HxqUntqFZJAI/rdas14vo8E6JY2uhvUjAlMOcjo3bVPK9w6j7AaNQL+hB6sL8qQa5s31SJUYvCuVwILCzCVFO45onwxdUqQtqsAoZqmn9sXKSmgRCZYZbuFig4YVtogX1uGaIpAg97Gw8xYXEfetFSZrodOj3oj0qe5JT 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)(39850400004)(136003)(396003)(346002)(376002)(366004)(5660300002)(54906003)(16526019)(6506007)(66946007)(66476007)(1076003)(316002)(186003)(8676002)(69590400008)(36756003)(86362001)(44832011)(52116002)(6512007)(6486002)(66556008)(6666004)(956004)(6916009)(8936002)(478600001)(2616005)(26005)(2906002)(4326008)(83380400001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: PZUZQvZN+VQ9A/pF/wu3bWSTPspLANY/QJ6iZ38RrrBjax53Jtm/NLHt+hP86WDUfBMIu584kv6tt76EYDqfbNATC4flJhimPgwR19z9+IkqCjEkN65VDK1WP22pCApFJc+IN+k8xLSpvfwnu8/XQixExObUByct6h9/zZ+Uqdw6Zc4QEH2Dz1u8/Ly7FBR1LiWanqLftm6cQP9nPWtWT5t1CW+VxN+X0ZVP+D9IMe893IOxP28tAYAIzUvMA9YNVsqsH8vVp7Q7jVmkH70JAET1nfWlj+kVk962wUkdOxiFK12QwAgLvE03hOhKvjYjXJHRdi4K2PQMtiHsb7RgfCrSxNrpKkXjjXwJuxJqhTYd9oH3nh5FaJ88+lHmX/lVYYY5iOqytJHC4Ab24LK1hOwYfwjtf+NBUDD8yGp1HVhV3Okd9UIJEsA24kzKE1moCKJK/4ExC3+V5LOSpRRfTbkL9LjFPKcT14YZpKQHuXGU7ND3oNTEncgmW182gMSCVzuwq4sP8dRzYhKhIAliOAF3L4jDahDZkW92PvCx6D0mrNw16lHEpj+6ekVVzaqnuOpSKKORCUPqwbJYlQgirfUqbdOTVsp8j/P+WQeClEUT+X3qJCjZhMqUHdk4mPwhLyxKembEQJ20E5NlXQ9OhQ== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 24273a8e-5f2b-450a-acb8-08d87c760a3f X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5696.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Oct 2020 01:49:29.4544 (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: gY5ftAgimqHw2mhdE8o/zC6cN9u0E00Mx9jVbiw/CmIpwybc17YN7Ck1oAqnWCKEGnbQQnTSGjKAqV4gSTyGVA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2509 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.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 --- Changes in v2: None. net/dsa/tag_ksz.c | 73 ++++++----------------------------------------- 1 file changed, 9 insertions(+), 64 deletions(-) diff --git a/net/dsa/tag_ksz.c b/net/dsa/tag_ksz.c index 0a5aa982c60d..4820dbcedfa2 100644 --- a/net/dsa/tag_ksz.c +++ b/net/dsa/tag_ksz.c @@ -14,46 +14,6 @@ #define KSZ_EGRESS_TAG_LEN 1 #define KSZ_INGRESS_TAG_LEN 1 -static struct sk_buff *ksz_common_xmit(struct sk_buff *skb, - struct net_device *dev, int len) -{ - struct sk_buff *nskb; - int padlen; - - padlen = (skb->len >= ETH_ZLEN) ? 0 : ETH_ZLEN - skb->len; - - if (skb_tailroom(skb) >= padlen + len) { - /* Let dsa_slave_xmit() free skb */ - if (__skb_put_padto(skb, skb->len + padlen, false)) - return NULL; - - nskb = skb; - } else { - nskb = alloc_skb(NET_IP_ALIGN + skb->len + - padlen + len, 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)); - - /* Let skb_put_padto() free nskb, and let dsa_slave_xmit() free - * skb - */ - if (skb_put_padto(nskb, nskb->len + padlen)) - return NULL; - - consume_skb(skb); - } - - return nskb; -} - static struct sk_buff *ksz_common_rcv(struct sk_buff *skb, struct net_device *dev, unsigned int port, unsigned int len) @@ -90,23 +50,18 @@ static struct sk_buff *ksz_common_rcv(struct sk_buff *skb, static struct sk_buff *ksz8795_xmit(struct sk_buff *skb, struct net_device *dev) { struct dsa_port *dp = dsa_slave_to_port(dev); - struct sk_buff *nskb; u8 *tag; u8 *addr; - nskb = ksz_common_xmit(skb, dev, KSZ_INGRESS_TAG_LEN); - if (!nskb) - return NULL; - /* Tag encoding */ - tag = skb_put(nskb, KSZ_INGRESS_TAG_LEN); - addr = skb_mac_header(nskb); + tag = skb_put(skb, KSZ_INGRESS_TAG_LEN); + addr = skb_mac_header(skb); *tag = 1 << dp->index; if (is_link_local_ether_addr(addr)) *tag |= KSZ8795_TAIL_TAG_OVERRIDE; - return nskb; + return skb; } static struct sk_buff *ksz8795_rcv(struct sk_buff *skb, struct net_device *dev, @@ -156,18 +111,13 @@ static struct sk_buff *ksz9477_xmit(struct sk_buff *skb, struct net_device *dev) { struct dsa_port *dp = dsa_slave_to_port(dev); - struct sk_buff *nskb; __be16 *tag; u8 *addr; u16 val; - nskb = ksz_common_xmit(skb, dev, KSZ9477_INGRESS_TAG_LEN); - if (!nskb) - return NULL; - /* Tag encoding */ - tag = skb_put(nskb, KSZ9477_INGRESS_TAG_LEN); - addr = skb_mac_header(nskb); + tag = skb_put(skb, KSZ9477_INGRESS_TAG_LEN); + addr = skb_mac_header(skb); val = BIT(dp->index); @@ -176,7 +126,7 @@ static struct sk_buff *ksz9477_xmit(struct sk_buff *skb, *tag = cpu_to_be16(val); - return nskb; + return skb; } static struct sk_buff *ksz9477_rcv(struct sk_buff *skb, struct net_device *dev, @@ -213,24 +163,19 @@ static struct sk_buff *ksz9893_xmit(struct sk_buff *skb, struct net_device *dev) { struct dsa_port *dp = dsa_slave_to_port(dev); - struct sk_buff *nskb; u8 *addr; u8 *tag; - nskb = ksz_common_xmit(skb, dev, KSZ_INGRESS_TAG_LEN); - if (!nskb) - return NULL; - /* Tag encoding */ - tag = skb_put(nskb, KSZ_INGRESS_TAG_LEN); - addr = skb_mac_header(nskb); + tag = skb_put(skb, KSZ_INGRESS_TAG_LEN); + addr = skb_mac_header(skb); *tag = BIT(dp->index); if (is_link_local_ether_addr(addr)) *tag |= KSZ9893_TAIL_TAG_OVERRIDE; - return nskb; + return skb; } static const struct dsa_device_ops ksz9893_netdev_ops = { From patchwork Fri Oct 30 01:49:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 1390639 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.a=rsa-sha256 header.s=selector2 header.b=RTtOdV1r; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4CMlc63xTHz9sRK for ; Fri, 30 Oct 2020 12:49:42 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726188AbgJ3Btl (ORCPT ); Thu, 29 Oct 2020 21:49:41 -0400 Received: from mail-eopbgr80089.outbound.protection.outlook.com ([40.107.8.89]:30883 "EHLO EUR04-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726117AbgJ3Btk (ORCPT ); Thu, 29 Oct 2020 21:49:40 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VBRHIgKBV5lDg27Hu1LgqJyEHTFTKr4EFgigCttGooCvGlKcJKMhoy2AcU2/jyA+WgGujp7Wj1Uoyowfhzins2czhmHEe8yBwgetUwqrnwcWsj6LNRGLxbnqpl4At/j2HGDkJV4a3bJss/E6gCa7QpxkdjXuXzdJMsdx8G8WiUGzCtDR3h2v6gYAF2qfiBYGMippiYq/ojG0vWSD6++5/fY5q2PbchfC+C0Hb9i22ZWDIqbCtYxnkjNMlotqg3WfzXnuRBKPspggW544CagjQBAYFPvX+kWD1PPG76iOQeKQamQhVRRyammecgENUxztZlBGGwBBQpqvUKZLM9OsZA== 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=w8Ow8XlFewIzp1wLogHbDgcFyd7uWurfpykhcxpZjJY=; b=hEwPQoBKGYILEDrbbGGPTxV+MSZ+NOkpo/h3N1QnEGEmSIGvxmLFD7q5vk/tRaEaGyA82bwYGqhnTwZ9ZpHt2ABh3NEK3CuE9JBmWPubgNsxmkkuDm/ko37MrWXliWOfRP7uESGsD/X8S5E+hCLT01+8AitNu3Zcam3mzsPCnfppYm7rQqI4O3mWBHpER7UbkqndwZF3nyzwLj9ER3/vjYn9kT0v2a7dsn3y6Q2i/YRvy2DI7MmsaX0Kp9L8WCMhOIMM1gv+UBNUEB7FmXEidk5beT2zfhS7f9JcEJEwfUzOktE2dWxtU2kB1JU/xDQpk2RcFm32eoWgkJkrQVUCLQ== 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=w8Ow8XlFewIzp1wLogHbDgcFyd7uWurfpykhcxpZjJY=; b=RTtOdV1rEwsnJ/dAXghhadc4A/VhzLt9GHnFnofeUyQxGrRNXiL0zahnKqzTXV8pumK7B4etuo0UHoVHFE6hXkX/IDJghP6Z6vrxYiQvSX4MQtdJvC2PfYU2Nq8YYXfcCDWQOy1nADGLLFQNid3KUvCKxOSV8b212Fcm1J+0XHM= 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 VI1PR0401MB2509.eurprd04.prod.outlook.com (2603:10a6:800:56::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18; Fri, 30 Oct 2020 01:49:30 +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.027; Fri, 30 Oct 2020 01:49:30 +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 v2 net-next 03/12] net: dsa: trailer: don't allocate additional memory for padding/tagging Date: Fri, 30 Oct 2020 03:49:01 +0200 Message-Id: <20201030014910.2738809-4-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201030014910.2738809-1-vladimir.oltean@nxp.com> References: <20201030014910.2738809-1-vladimir.oltean@nxp.com> X-Originating-IP: [188.25.2.177] X-ClientProxiedBy: AM0PR03CA0096.eurprd03.prod.outlook.com (2603:10a6:208:69::37) 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 AM0PR03CA0096.eurprd03.prod.outlook.com (2603:10a6:208:69::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18 via Frontend Transport; Fri, 30 Oct 2020 01:49:29 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 9edd79c9-a707-4c6a-3088-08d87c760ad6 X-MS-TrafficTypeDiagnostic: VI1PR0401MB2509: 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: IhTBl0tyioqUt1O118NhWDgQR+XEibVMqwtZR6ceEmh6abjBrBI0wnXeea+ZfUefEpZhK82uIMeo+SP9w966n7nJk8ljaAh5sIgY0+/qlc95WdlCYwuThy3z4T6E1SCyUU7GtjZc5V6VDUFeFZf17hbbKjMwKuhPSgSGxgLn0icC+eqaGGGxw/f8VAa0NO09vgLXIxGiyfwlEhMeWuOhcA9WNhlv+RZkAJr1/X16t6rTv9iwMtWtUT392/hkdfK14JWtmT9eMp1zwS6bfZNw5UQsC0ve4xgD+ttRN98BaFMNBCXBbN1PPOabTpD1UlTd701jvr+bRKx0sWFYhN+eSmuKrrSe8Ztpcd+FTwj7DI9tYxKaBf0V5g7nb7LCBpDD 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)(39850400004)(136003)(396003)(346002)(376002)(366004)(5660300002)(54906003)(16526019)(6506007)(66946007)(66476007)(1076003)(316002)(186003)(8676002)(69590400008)(36756003)(86362001)(44832011)(52116002)(6512007)(6486002)(66556008)(6666004)(956004)(6916009)(8936002)(478600001)(2616005)(26005)(2906002)(4326008)(83380400001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: Cg/HlTMEn1hQz1tJ2XtE62OOsOs/HLJoRLhNEwxAE55StXK/zeo5cUbe5g2S+ZNFyY7ox70TsTMdBSh1IjxGW6gait5Vf1PU4XS4bLek1wkVXjnrbtVdlJeXEWyMV6xBCJTYEDV8pLPWKJ1ylvt7bJTThVBVCnrT8odTZCWme/pyNsDmZ2qWG7Gx+eQ6fvj8I49b3ueznzhEowyEQMjoTGoPIvp1oMbRwhCVlTrCumuENKN4nzJCEdGNEyTaT9BkYMxSGGyXuOYI+fGX5hxpfzEgRkAY4THKqBUqaCqlH16GSKSrEzoj1XHuVuMWYc74ovfsKiJpuqaYGHwePXim/9klU6fB030qnveWynziRklJsXPXQdGSFbo107/R6yx96PKMojY2JqebGo0P8lCATVtmreNwfkdX8urYURf0aKpp1NYAfnO7fTWQRjnUkzfdSa6DYlyEhL3nWT6wZFwMOjigSppLQVnzHA37rInU2ba6qhGNjCO3PzkirfUn2joxHo0HxheZnXIBAtrW+zNjTzevLUC6qtQ1NnRe+y/jtzMA6J8hYNlSqglZWwhoI3RNiFWb91b8FcphDlxsbsgFglQnCry7ZuesR9Oa/uFX+O/kQ9vh9tfT4Z0taUWy6Rv4JhjItT3fibXKZ46jttyERQ== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9edd79c9-a707-4c6a-3088-08d87c760ad6 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5696.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Oct 2020 01:49:30.4638 (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: H+b4jV76Q7n40uiBzP2NE/vWb4MbqX+oGyrWlRIQP7V8ka9yB277eB76WyuEdhI6bYiKhLdHxV7j/8Jx/8tt2w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2509 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.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 --- 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 Fri Oct 30 01:49:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 1390640 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.a=rsa-sha256 header.s=selector2 header.b=nSN4oUfY; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4CMlc74TZ1z9sTD for ; Fri, 30 Oct 2020 12:49:43 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726200AbgJ3Btm (ORCPT ); Thu, 29 Oct 2020 21:49:42 -0400 Received: from mail-eopbgr80044.outbound.protection.outlook.com ([40.107.8.44]:45367 "EHLO EUR04-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725781AbgJ3Btj (ORCPT ); Thu, 29 Oct 2020 21:49:39 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=clsR3CBYaNaFX+vteVtSC3wwLHDlSw+IK00zmoweVKOFaMjFLKbLBmbWW0O+jsbpT9HdpzoIko+79i4xMjVHjcvcB/rqBmRI8gCy5Bg22rnDZu4SDtgB4fKGACXc61/mWk+1MWB6sKg9asiTveSley6TWFkCgzN3f8NOxsr6qfRg4L7L5RMZWpxWKhVn3bl0O1MCubaAnYxZt0TOfPYMhUysAvquc0EkAxPAAYzVaJ7kBeW0pbIaD79iGTpRdd+DuXkWySKhYky7+jJnz5dRgks8tQrQvNiTLRhFJN5AC635DiZ6YW1a1TdEfu4THkCSitBC8b2gs/t4psPFhPgDkw== 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=/5Inlop7MVTtw2qSaH4auIK1dW6ItrO8k2HBPppeiOA=; b=oV3e2KRd6LhlQ23An6HRgAVBOoHlMrqsV5fvj8S4UoYkK8/cetmb605HqB+gIzTQIj2b7Eqf0Mc9SdpQUAOQL0YzzHuUcKDz72t8ZD/oTyG2o5W/FjKK35rwoAxT5aM8HWTin1mg3JKA99yihV0jAfXKX65InMEv1fCMLvDM7ysc9u651g+nK+Y469a9YCrtzN4rllO2b8cGooHAuVMwZFh7LVnwKl3H/Euqf8Y2LZ4cbkTMYdtjLhnRNwtQ2JgTiNhD3//wNG3dDvKICYPrRCvwhV5NqHMhO3OFv+LPQvrlY9yNFEHlyBJcJ0mHgvz70QJw1BUryUd3SLTjDGsO5Q== 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=/5Inlop7MVTtw2qSaH4auIK1dW6ItrO8k2HBPppeiOA=; b=nSN4oUfYZElRjiqm9lxlC1oOpPP6srDAw3nRu37qVRHjh8kNmC/DTTneH4KIoSAu15mTCv2Ew4c6X6lD249GLL2nGKao0qtQfsyUUnS5GBrxbvchumpTbeW9c7UChuVhuniZqNfOSY7xYMtbYEBmvZDlbWkkKjOWbHfrSJFD1QI= 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 VI1PR0401MB2509.eurprd04.prod.outlook.com (2603:10a6:800:56::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18; Fri, 30 Oct 2020 01:49:31 +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.027; Fri, 30 Oct 2020 01:49:31 +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 v2 net-next 04/12] net: dsa: tag_qca: let DSA core deal with TX reallocation Date: Fri, 30 Oct 2020 03:49:02 +0200 Message-Id: <20201030014910.2738809-5-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201030014910.2738809-1-vladimir.oltean@nxp.com> References: <20201030014910.2738809-1-vladimir.oltean@nxp.com> X-Originating-IP: [188.25.2.177] X-ClientProxiedBy: AM0PR03CA0096.eurprd03.prod.outlook.com (2603:10a6:208:69::37) 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 AM0PR03CA0096.eurprd03.prod.outlook.com (2603:10a6:208:69::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18 via Frontend Transport; Fri, 30 Oct 2020 01:49:30 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 201101a5-ca91-4f08-1b55-08d87c760b7c X-MS-TrafficTypeDiagnostic: VI1PR0401MB2509: 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: /jK9xpBTHTwWRmxaWZ0JnMiOhnruOvVgfCQxt2aoDD64FPOywqxoTvm54gXlkZU0wCl0jyEhpJf146fzEwz4yVsJu+Q7nA+3SEXN2oQ/+XJul+8BU8M9kWTA6IdQG2ICt26DLdNb4Asw/uWRdw97YZyvcm74M/w5EiurAv1hNnQPpu6C+Q6lDymaFzD0YB5MUxWAXTFQ1VQynbOLVDbKjuPngusza+Ig+d6/FK4w4gxUzLCVpsmJI3jPelVqoJzya0OpgkorEXl9zy0xTyubwqJiwuhG5YGBiABBrZ5MofR0dkfJlrWkCt/dQhe3Z5rj2FAOX1XJkBvZycV/JHeNvseFuv8hOM7alRaMJYKQLg/Yg7ofq5Aa0zoIWeF7EJ38 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)(39850400004)(136003)(396003)(346002)(376002)(366004)(5660300002)(54906003)(4744005)(16526019)(6506007)(66946007)(66476007)(1076003)(316002)(186003)(8676002)(69590400008)(36756003)(86362001)(44832011)(52116002)(6512007)(6486002)(66556008)(6666004)(956004)(6916009)(8936002)(478600001)(2616005)(26005)(2906002)(4326008)(83380400001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: zsAGRmg8k06RG6Vgx7gzZr5KU60+986KUpsFscrD3XT06TNC1XjerrpWFN6GofXVVfzGBxIwpPHfjRC32hgHmkjW8AOci2F5MlVLgWdhpk+twOvDmmp8UpZYjxZeGNHgzTRgMqq5swIJJXfHls3cOwz+OXl3LqzMEnG2TDD1VmfWILLg0OutuaWJPUiPLHUe/CdFA4Ed9jXJnZOaT6bzXFIAUJswF7xxFdxzdAseRWZO32dvylFnK2L621SIx9hJ8p3ZBN2mLB4wKLBRmkLIbZZS2MHJqEtWgrWapRwAWcsLZNYxtxc0RDEs/IugDq8m/IL3w8YTFoR+MK3LDp6CsVIm96MnWMS/R8DcCqKq2E4jFLs2PP7B4GyJ/Tih+u//esEziltjhT8cUrKJQHpWouXfhC5T42JqRITdrNbO6QWQXaRR3fE0QdhphBsMSYHydaCBH0XyADCzuEywEMZjasdreCuMo6dV/6qRqSudqOKdVWiUpc8/htQkxx5tEvNJV6UMbv4SHcRLkU60JyTYns8tDxA/LuZXibAkYbfArUA2pfNBKGNIp/WgDMRH8ULncOvfDHMUVufl/+JV7omxhZIaWs8PSlDrI4iruVNYEHlMMsP+2AAForCer+BsZOundz5Tys7Mt6/WHGm1gNIQwA== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 201101a5-ca91-4f08-1b55-08d87c760b7c X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5696.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Oct 2020 01:49:31.5472 (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: 9WcTdpLiE0UYvy1DzKQO1+C+lxNEAsUNwyPriGCFzw3sygrJLh0FKWmkzt5Q//4zsFr6C1N6B1OpqhJceAZThQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2509 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.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 --- 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 Fri Oct 30 01:49:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 1390648 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.a=rsa-sha256 header.s=selector2 header.b=CXopOIid; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4CMlcT435bz9sSn for ; Fri, 30 Oct 2020 12:50:01 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726279AbgJ3BuB (ORCPT ); Thu, 29 Oct 2020 21:50:01 -0400 Received: from mail-eopbgr80044.outbound.protection.outlook.com ([40.107.8.44]:45367 "EHLO EUR04-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726152AbgJ3Btl (ORCPT ); Thu, 29 Oct 2020 21:49:41 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HxsIj3PbOgonlYg+axhrqU4glWRAPRjFycxbwi62wHoLObY5HTKt4Q6gmBRhEhKcmjprollT8i6/3rMwUHGXUQwfc1MXsCj8a9EJRzMlRFHrbfq0sZdqtvgB0vEBTn6U036GNassSSxmFKp1kLeJtMUuThezewoiUZ2MWieekqpKzj0M/ELTKpPGTbpLzhyg/86XtqrLUPf+FKpxWvt3Upge638kPpZYV2tGvtwSoOsS3EfX5GaC7kMxxySkcf2BG34bL3WmZa+SV+j3SzhDYBGchNmTSR/f5MGWKUvzA58oUoQ4h/AosMLhjHhllZ9xPtoqFw4QfNulnInnQHS5hA== 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=5duhinMJ8Qh3fGfgzgxY+vqMJL+QuMAb8iX/f2HmP2c=; b=CCIMEPOFaWw/RVaBhNY6HaG8ycqD9h5XQQaqYRioFcv+CQd5A5BF0mAwmxzhR9NTuobhDwXGPsiGTRC4cIW4stIh5a6akVs2uRHOEjxQZAOI44uZwnK2v8lxOJGldl6MJbOHpPSYtT3q8y0cmSqu2F69HOqB2/9UFsZ+V0WlFG1TDHZYC67bsVWoJPBAPeY5wm5+5Ki70EqfVgfY/6Ro4hW+uApj6+uFlyzNLWnZ3niOsV1Q8dJEX4qwIV93Pp1+V4R+QkVi1nmuF9R1CgU43lJJyFl2IxFfKrB4NSmkqyGn9f8FeTvH7fBbF3MtvZqbL5sfByaNMij3jEQ4yuEMEw== 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=5duhinMJ8Qh3fGfgzgxY+vqMJL+QuMAb8iX/f2HmP2c=; b=CXopOIid4Yxsq3KrPfKGziTeslpn5cf4uagB6NEY2k2qccx1LJwvErUSq7tEM/gPdrMzOMVHLeyMAVdNYWMKr61q1bbV3SD1V5lB4u0YTuI5uDV+BiEnacqIOws5jqcw0kDiOBhntBz58YDzg7PEgzZEP7HyuCFz/oXQ/pvqaVk= 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 VI1PR0401MB2509.eurprd04.prod.outlook.com (2603:10a6:800:56::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18; Fri, 30 Oct 2020 01:49:32 +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.027; Fri, 30 Oct 2020 01:49:32 +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 v2 net-next 05/12] net: dsa: tag_ocelot: let DSA core deal with TX reallocation Date: Fri, 30 Oct 2020 03:49:03 +0200 Message-Id: <20201030014910.2738809-6-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201030014910.2738809-1-vladimir.oltean@nxp.com> References: <20201030014910.2738809-1-vladimir.oltean@nxp.com> X-Originating-IP: [188.25.2.177] X-ClientProxiedBy: AM0PR03CA0096.eurprd03.prod.outlook.com (2603:10a6:208:69::37) 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 AM0PR03CA0096.eurprd03.prod.outlook.com (2603:10a6:208:69::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18 via Frontend Transport; Fri, 30 Oct 2020 01:49:31 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: d0823a0a-cd58-464b-b06c-08d87c760c13 X-MS-TrafficTypeDiagnostic: VI1PR0401MB2509: 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: U+sNjRlWHxrHjWNt+z9etPYk09wxKipybEpVyktGE+si6wMw/XCoLYfIwrvuYeTPJPGLAje5xfiuNnR//cg9r5SLFbgjoZGPA/OMl05sr8EO7FJGy5WZjET4m3KOC+XxObptTaNzbiWzAXwXknpBnSdLC73wvnC6Xpm2GELGLr2nFPYP7ywY5g6Nspwfjd545+dsIVUDjDO/NRlVPYZf6pFvr4aWmyG5FSGPpv5rsGULpuOtfiVte32GFW5ABd6ZOrhPF3MnsRkQ/u/ZJ5MW3Ced0znIJjrAuCHIg8U+L6k8yvd7AilZEFY51MpdWgwEp8sQuxHkkuz/DTDWcleqhXSYhs93ZtPgUCv0VVGoICxpOc8SjVHRrpyKj034G/gW 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)(39850400004)(136003)(396003)(346002)(376002)(366004)(5660300002)(54906003)(4744005)(16526019)(6506007)(66946007)(66476007)(1076003)(316002)(186003)(8676002)(69590400008)(36756003)(86362001)(44832011)(52116002)(6512007)(6486002)(66556008)(6666004)(956004)(6916009)(8936002)(478600001)(2616005)(26005)(2906002)(4326008)(83380400001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: JM+o9l/e/9myPBIKGIaZtAragNIPPrWMTu9t05y9B7MdxA5YEZ3CIEZU3mCIn9DU1SP4qXxABnUEBc8VvriRiQDISl8M6Gnc/2MhyqY66thcXwmGT0eVriGGDqFG3UXUMxjKdeKqwJt1V6CdI9s389XpLVmqiavEdjXxoqzbTXTX6C9HfvNqlvmBzwygDTizs4/qdTkkON+TubQ8z5CmTHduM7oTUtxj8VC/YJQUdaDkSx0OPzfYMqZ3M3Wel0GtUWzLfpO0qFyxOGm63sZ73PIGlnWR2uWb72voOzPpF0Io6ZvHoU6wYULVivWnr3/jk5Siy/N3ZyjuotOa4Kigy5SUA/Bi5bTObZmDBwmL/40UNTrpAiwhyZOjzijCTLAoWaOgN2I5gL7he4jo/714iJ8vTitcZNgt/UkSmQ3XWz4zlot8/6lVUzdNHuk+TadOEbJRZZ0j3Sic6gYDizNnwcDyw7UynlV0UGk2EULeQayPCX4WlvHWNlU0LqkLt1ZeGl0cJOe8sa9za5tzCmLbiqxXVq5rFUyg9eul/xlimE/VZ8cPPRwb7VQZGjIyNb79kpLuMwucANnEigUJEueKXq+w9g1YxsN7wfR9wcTZKH2UYaanl1wJoqFZ8cG9lRu9yuH/9LWvwZRw2PoAoXeMaA== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d0823a0a-cd58-464b-b06c-08d87c760c13 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5696.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Oct 2020 01:49:32.5356 (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: v/3THVx4cTfmC5Gro87o+6K1lEcyIC15UN1QhGbGoKV6i3qic9W33f2WnUydSfMAEZin+bv5oubuNSuoZ6BSCw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2509 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.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 --- 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 Fri Oct 30 01:49:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 1390641 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.a=rsa-sha256 header.s=selector2 header.b=hJEM1iV/; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4CMlc94VV4z9sRK for ; Fri, 30 Oct 2020 12:49:45 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726214AbgJ3Bto (ORCPT ); Thu, 29 Oct 2020 21:49:44 -0400 Received: from mail-eopbgr80089.outbound.protection.outlook.com ([40.107.8.89]:30883 "EHLO EUR04-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726156AbgJ3Btm (ORCPT ); Thu, 29 Oct 2020 21:49:42 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=g64s0aLP2ojZ1JllpHJDS1WssNdZdKuhZbxExC2+DRaTb8WSCuAH6bqOWroXpfcQUmeAdwRSMSxb2Z2nL1HzZ3H439JiXQQffwlvPAgJF9eXvMrBh/BHsp4ml0TjbOJjbI2cJlcPLhsjl3yVUlD1BbiTMgjzjL3wZXJOL1/wEzBMQ86WnUuIeJrAC1ndTsTAesSSA0WDbsc0zhhWbuA1+JiQhrt2UmDi8emPlep2wmH38fzwBXlDAkDfSUZmbjAUG6qjsUkAUmyQU2USInJb4JdvsxFYMEBPbrM4hyWcIaEnw7J8fGRrPi/84JrT/46i11U9GooQYv3g/X1SVAmCng== 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=oUh0gmEZrOPV/0lSsvsGYcpJ8nm6HZCED9M4jEADDjc=; b=nR/U2CjVe31S9EBFqh86AkYeMqEQfsCV2YNetB/YJ7gvD3K2z/dHhmatEvvHMl5nSzB+1ehfnAqJQ8g5ZImg3wg8tZJSgaZ4Cj+glreXvPvAnnRCG2g2yyyOqimQaUI7owzqZMgrmmlH8/Wk3rESjvhQbWq7ZfUVGS82JJ88meLSHwHS8gRl6tuJzSIOR7JNip8Z4iPRj5QcSO5+bFpJ0Fcw+6Yt1/9sCMm7KfFtFD9rdBhvTGajs2D8vQGb2SnpE37Tdkw4/ALTI6uhPR4fCRA1XQr6K8fFF2S4jKvXeTYthw/wDR/2SjgiLlQSVulV0eGLYdnfdewdK7dVTbkF+A== 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=oUh0gmEZrOPV/0lSsvsGYcpJ8nm6HZCED9M4jEADDjc=; b=hJEM1iV/9j4xJcCgpBSwYJfuw2s5TZ4W95ogmM0V7mHWRyVtajYlwxPuVe/1qs6D6cVIgwtmNxFMqF3NnFoItlSUj26ue1p15APgjeN62QJDSPSpOQf5NaFd0XETj225umWJHAYp2uuA/lm7N/u2IPHAU5sLdsJgO8AFTf6gJUE= 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 VI1PR0401MB2509.eurprd04.prod.outlook.com (2603:10a6:800:56::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18; Fri, 30 Oct 2020 01:49:33 +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.027; Fri, 30 Oct 2020 01:49:33 +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 v2 net-next 06/12] net: dsa: tag_mtk: let DSA core deal with TX reallocation Date: Fri, 30 Oct 2020 03:49:04 +0200 Message-Id: <20201030014910.2738809-7-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201030014910.2738809-1-vladimir.oltean@nxp.com> References: <20201030014910.2738809-1-vladimir.oltean@nxp.com> X-Originating-IP: [188.25.2.177] X-ClientProxiedBy: AM0PR03CA0096.eurprd03.prod.outlook.com (2603:10a6:208:69::37) 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 AM0PR03CA0096.eurprd03.prod.outlook.com (2603:10a6:208:69::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18 via Frontend Transport; Fri, 30 Oct 2020 01:49:32 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 3f507c96-b515-4ab1-2575-08d87c760cc2 X-MS-TrafficTypeDiagnostic: VI1PR0401MB2509: 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: TMtXYtnXgF4oOtQXjcLbhpuuTvNE0pVQ1g+HycszYYA/B6wcNzL79OqA3aryi+JAQ16SgZVCRZ3DBNdWSormd6/42n98/GnvbeO+Vbf+7ejavm28D+7/jWHCNUVelvHmQ/wo0Tw2yLnrsiYte/JSTElTgY+pnUw1co5+qGXZ+4X9HqWWiuPa8ahJPQOXw2NI/qL24hP/y/sXRzqv2UY0EHPhZfUwCRRZldmfGcF7RduBvsd7pAojlYezwGEPUcP6eyNOWG8SV05eIItOirDSd1Wh1FB+xqVRj6vAqDFIjZw3ZoqyaT0+YIlpDgIW8FdW+0auyURUVVGlD3U0DT5eJs3jpnNOeBDq0bftqobzdXdI5IPMqVMcBCsLrNjB2EBF 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)(39850400004)(136003)(396003)(346002)(376002)(366004)(5660300002)(54906003)(4744005)(16526019)(6506007)(66946007)(66476007)(1076003)(316002)(186003)(8676002)(69590400008)(36756003)(86362001)(44832011)(52116002)(6512007)(6486002)(66556008)(6666004)(956004)(6916009)(8936002)(478600001)(2616005)(7416002)(26005)(2906002)(4326008)(83380400001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: vghsg22Dn5EtRaZzffSJ+I9WRVT+VASj5hCJLTVz0KzWszjTxiYFZ0JEmiPQwhWzCQ+v5M9QuV8Q8+tC751+wkCTR7yJthI59kEDSYvYBJ46zz45M7d+9PCLcA4dAAWT6tkC0CXBURlktdyBodZqDZzKyGMzWiHzF4o5mKm3l38tHpD/IczZ6xr5GbSCPb0uWUXxOReHFEbb/xPH3w6Au31trFcWw+CKJJTPuRJzSx6teIfjB1Qqo0k4GsZ9f8+4UCykyz3hK/o6pGGQe3LLxhqQrEge9e+cxMFxDjs8k/hm+wdcYbE30xGnnE1uZZ75J7KCHmRMUoB6Z4TIIjyaxl9YH+h9glh+037XWFJNM7i3Lj2o9PhxOCybt3DL/ZlFKjcn5NzrMW45I5BOqtbGPf6vlAjdyiCGe+7y5s96wy6ajt+9ia+Etw38b+0PmaEP/Ns/fmUdq5q37qMI0tDdzvp9lkmad2AMdzhnvwuV1oIdWxkEsXMDaDyaSAU3bxusmPbazkOjU9ZhRgit6nTwxNe6ak5Z9dqt3cWWrwrdPJUxmbN33J3yihY/aEhnIfYCsamvKumzKgxcSrTc/sIafsGTmLnIFDbJ9LXopyNQ9LleBsn+CDs1tIjY8fjBXYhrtqJSrRDRnSZDS9l6iQq26A== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3f507c96-b515-4ab1-2575-08d87c760cc2 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5696.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Oct 2020 01:49:33.6959 (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: Lh1JaeE4LaNjrkpxifq0j8wODHXkPT1YSGNhXtfVlcolDu1eNDdPArUXj+DMdzSIT5yn4E6+jM2ZxRax7eFuwQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2509 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.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 --- 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 Fri Oct 30 01:49:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 1390642 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.a=rsa-sha256 header.s=selector2 header.b=sq9hMUlu; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4CMlcB5wmNz9sTR for ; Fri, 30 Oct 2020 12:49:46 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726234AbgJ3Btp (ORCPT ); Thu, 29 Oct 2020 21:49:45 -0400 Received: from mail-eopbgr80044.outbound.protection.outlook.com ([40.107.8.44]:45367 "EHLO EUR04-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726195AbgJ3Btn (ORCPT ); Thu, 29 Oct 2020 21:49:43 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mPYduQyh/JtZJ9wSaJBIz/ok38Sh8c6HGE+m7fZSRlrK1WH/Ve7Z/6/T8vSOfg2Z1N1DegzzqWrPvYVkNVW73Vz0A2kcNtECCGi2bnMqSvLfuWGuFs5uY/meCZgBS6SNsIl3PPaBUTceAxijTB7xdx6J3NXHum7tOp+MmfrORPTQzsiIUoWzlyl7Qqzo5HSui9sKFz61IGQJ5/+PK88fq09mU+GJN47tW0Pi2NcGJmnuTsixB3c0Pf15lkqQj0Wn9Joctg6Qy0cO7G0n3Yd8IouzpuOatncXtfPY4Ck7SDWU6suoTflXlBTK7f0x8BdqeUjuNQA/ArcPLGYHXP9Q1w== 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=B/V2xbcFfO3V9sh2m93gUqyr/97y4+HABLtIc9qKbqg=; b=Atk1s+Pn86jq2gZoCHBLNlaAR1V05En99toJu5+2T79jxfI6a9VVmYxfNPV+/v6ezqpJ57FRS6krtv4yoi2YzACZ7Qz7n2uObKZY/ncajR8klHMjnbh3wCA2Lhv5RjGz6+AwEGRApTGB20jXvDKUSYZl16e/mPhnetWsKYGMeD8kNEBKlGm0njhWrQORVNo/dUNfWFBNlLImHWd+xgv2oITCecLM1jO0Bdp/MDjONhZ5BODmMYpDqP6Am7uXpf2uKlwH3/BKC0qX8KTslNmuCCpj+/K1GFaSbJhtAruqjnCeCumG0hlyG/wx7Nx4izm2uefosFBofBYHNyfwo8xM0Q== 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=B/V2xbcFfO3V9sh2m93gUqyr/97y4+HABLtIc9qKbqg=; b=sq9hMUluwW81Jqd+87mImoAu3jqKLQ3baX6WwiG3NJNplTaiMYs4GpfwSyD/KIzhedi5SFyIgwTaLZTOuoGBPLP9jRw4ARvqOZF4NjF9Q/JvbXt9sCIJXjtePLQiJKzrZAkBhbHcacmcJZjoVp6j41I7pRtZ6DTod4Pgb9crKTk= 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 VI1PR0401MB2509.eurprd04.prod.outlook.com (2603:10a6:800:56::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18; Fri, 30 Oct 2020 01:49:34 +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.027; Fri, 30 Oct 2020 01:49:34 +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 v2 net-next 07/12] net: dsa: tag_lan9303: let DSA core deal with TX reallocation Date: Fri, 30 Oct 2020 03:49:05 +0200 Message-Id: <20201030014910.2738809-8-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201030014910.2738809-1-vladimir.oltean@nxp.com> References: <20201030014910.2738809-1-vladimir.oltean@nxp.com> X-Originating-IP: [188.25.2.177] X-ClientProxiedBy: AM0PR03CA0096.eurprd03.prod.outlook.com (2603:10a6:208:69::37) 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 AM0PR03CA0096.eurprd03.prod.outlook.com (2603:10a6:208:69::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18 via Frontend Transport; Fri, 30 Oct 2020 01:49:33 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: d034e956-fbff-4b1c-49ed-08d87c760d57 X-MS-TrafficTypeDiagnostic: VI1PR0401MB2509: 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: Su4/9Qj5GIwenTCHtRpvUNwNZarjRR+i9jbIsU8tdY4MGbSzA++CPTqIBMTteKO8Mh/UOPONapwlNs+vI9JMvXom73brikDKzWjVcVz5tu2Cftl8YaSPxMpeZhAr36WV7p7xOMKm1pMjsQihRXRr1QAyv5FwTzqNex+YiVqYy6O9H8U3WHbblauCrjPFJlUxO7/iXtYTzy3M0RaRlkqN93GJ6E0LTMl25qvaFFC+A0Zq6loBhpSEw6Sxs0JeOB8M5XJOspVz4Yrp02brP8JehvmiIzABEnpwKtfLodUmmjKRbfT3ThpfNXGxc1k2PBoqqK+z6GzMzyFwOycb+++78phRpbTzhrjj6mKu7Sr/KNwKSWJznDsywL+Vd0mZjtOT 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)(39850400004)(136003)(396003)(346002)(376002)(366004)(5660300002)(54906003)(4744005)(16526019)(6506007)(66946007)(66476007)(1076003)(316002)(186003)(8676002)(69590400008)(36756003)(86362001)(44832011)(52116002)(6512007)(6486002)(66556008)(6666004)(956004)(6916009)(8936002)(478600001)(2616005)(26005)(2906002)(4326008)(83380400001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 4ZytYzDNdv9EszQJKrWG3FV9IkDPxennVxi/OpPENTujF8UxzvH82hV4AWq94f+4QVpcP5fhkvyqMt74bD55F66P0QaPVCBPBLDx0lYDCFTE+KgA5482A/PxvAViQc2su8Te29Ep/8p5HgHYbVVyqNn8ToLBxk9nvLX/iQ37t7BHrw8cfwzT7Vy7i+//rpDcm/7fDKrMwJ3WfE7lrVygfaXfA06h47oih2WBShsxQxPkmR/NwX7spR+4ellCG1SaL/4pMcMo0DA7JLHQvNJP/NdagVBC9osdzLtNulZIAbCYN6RopzgwboZZTeh0Nyz7M9DVEa9SRhPB2qBpvrmya/il0EMCLfY/8UgM6SXaZrUyi2TMzJJh+MMxrE/v4P4W0Ybw/0MJ/5YjN12amOG1z7/SOZa4dNacsfGaCw+AqB6OCwqx5V2jOl/jvnsaHB/h37NrDMvOKvkkdx7l8BvoP8gNZtWqyiBWTARvWp/Iw1KtGIS+K5pxdcxzYN+lIZkyMTZJ3JVnRonFG17MNsUqxYbm15uz/QGcUQPb6zx0xeva0lQPfxloUCp8gmc7vAejQT6DqaKPXpxVASC4fgopA7Hfu8TaNcD/wY59D7m8qSAp7sbQ5DjDWxil+ThLOp5z11hBQlT88tUAT6rqzQnNuA== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d034e956-fbff-4b1c-49ed-08d87c760d57 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5696.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Oct 2020 01:49:34.7003 (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: 14I5+5zkI9qW6qQePh1fmssYyPzlQglVWQAj3op/1pcBLkLKgubLRPdLhL+073NvactilVkM8QY84gfdhI3XZQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2509 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.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 --- 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 Fri Oct 30 01:49:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 1390643 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.a=rsa-sha256 header.s=selector2 header.b=lRelvhzr; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4CMlcD3QLqz9sRK for ; Fri, 30 Oct 2020 12:49:48 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726246AbgJ3Btr (ORCPT ); Thu, 29 Oct 2020 21:49:47 -0400 Received: from mail-eopbgr80089.outbound.protection.outlook.com ([40.107.8.89]:30883 "EHLO EUR04-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725781AbgJ3Btp (ORCPT ); Thu, 29 Oct 2020 21:49:45 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fS9c7ibzV4bNH9EnxQAVcZjvix1XIJClhELC+6j3siGWKFrrkCyTaVsn+75I0MzXcv2QvbQWLBM9iF9RS53HazwEJ+2ltiY2LainZRowSXFsVUPgABhIdpcOGrKt9pSMeaVGL4RluzciLsontUnkCx4dY+39vF016fipTjuuVn7Mi1SL/j/myq+ph/GMf8mx0y4o1xqkKYxQEfGrCZtkDmGykAvSTb+9vNEriaYX1RGiraF+noFL6Trf/sMsjNIpUEl4G0ExG+1+z+LN4ljrzXrXvJXa1Tjbcibsel6OpDO8Pu5FiabX+3uqV5eqM+v0nmypc9Qx9MV2FWhEEOAPqg== 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=y/mXOs0mxLNI46m404FUY63GJePK84OABIvZXygpsZs=; b=AyFFJy/6uWAary21uv25BphPCQvwnksvSd2vFXydf19QwYrIaqrYUUVOXXCez4J8NzAdIO+P26k/44C8f4fQbfTBicyY9hJkzBLhRw/9H5OUbYYFCX7n6LqHGVB1p5AJI42pjruEh/KOkgn8JtJ/l4YEIcX46w/Rc6cQ3z5e94sX0RmVBN1dYuTsZQj4HJKXYlWU7umTGowLVf/vnmCRPGqZw1EuyRSzKb7fmRKeEISFzelqohrbnsnoTuPKO6/WVkFePQhNNql/OtdPjrfXz7Z7u/py9ebldA9kwJ99Rez6D+7KB0RH9mllIG87Mg1j6vbiYpmu77AnAedC1/627Q== 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=y/mXOs0mxLNI46m404FUY63GJePK84OABIvZXygpsZs=; b=lRelvhzr5dbiqipU4FvkwH9/zwOPlfQQ26Kn5oTTz8DRdPFoc4SRd+nXxpYUInHmkg9wT7s/ty52hw+iJHkppD/beSlQ2dmXg1lhijSn+Y3biY2b7zih6Kfu3KInGw/91yUbhvVDuqoqlYcra0HzBmyMMjstkUbiKzyhgF8Y8Lw= 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 VI1PR0401MB2509.eurprd04.prod.outlook.com (2603:10a6:800:56::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18; Fri, 30 Oct 2020 01:49:35 +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.027; Fri, 30 Oct 2020 01:49:35 +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 v2 net-next 08/12] net: dsa: tag_edsa: let DSA core deal with TX reallocation Date: Fri, 30 Oct 2020 03:49:06 +0200 Message-Id: <20201030014910.2738809-9-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201030014910.2738809-1-vladimir.oltean@nxp.com> References: <20201030014910.2738809-1-vladimir.oltean@nxp.com> X-Originating-IP: [188.25.2.177] X-ClientProxiedBy: AM0PR03CA0096.eurprd03.prod.outlook.com (2603:10a6:208:69::37) 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 AM0PR03CA0096.eurprd03.prod.outlook.com (2603:10a6:208:69::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18 via Frontend Transport; Fri, 30 Oct 2020 01:49:34 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 3c186e94-2408-4725-12de-08d87c760df2 X-MS-TrafficTypeDiagnostic: VI1PR0401MB2509: 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: 3oqI0jvMnjoZXBV8EWJ8/UI/Slk+63r37e5IhXYM8pQ0k1XRtOcB3j/AMoqS/208ier3KlGPkLlioBGEY3lG/OBLnWTpV9upGj2BJ7ZzqYfEag+FwycY3YqizH0gfZ1dShd8pJaV7myJAMCfd/Yv3AM3kSQyQi9wL/TthUHLWW9oxEDKqBQmH2m9rDcmnVQdJPA0XQMdxjEI7LNJb324Rn39Tg1zf5oIhg+scs+QR7hUnWvkvoV3T/wrjNGsWbgXuQjU6m2eZTdqso6DcTjxmc+9RanATeAIDXeyzjOJZdpv6YJ6S9CFZFXTI+/eY3zJ8mmMaMfWqpdTPiJDHvqZ+7iby/ieXkMWorQSz6IPjQH1zxoR5HaE2GL7paQ/6b1h 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)(39850400004)(136003)(396003)(346002)(376002)(366004)(5660300002)(54906003)(16526019)(6506007)(66946007)(66476007)(1076003)(316002)(186003)(8676002)(69590400008)(36756003)(86362001)(44832011)(52116002)(6512007)(6486002)(66556008)(6666004)(956004)(6916009)(8936002)(478600001)(2616005)(26005)(2906002)(4326008)(83380400001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: tgTVqUz22fE6Km1eXCO9euZaf6EDaRF+PO/a75H6aJ93I7rz01EpYBBJGi0evJsjSPu/coif0PnsaizEGyXrO+3BxstQS9KV/Kkl1K+1/sqUzItDQya6PSRrhnFx/YWy57DUXqkF5P8IlhSndP1t6wZQ7oq9NkJU4k6e6gTWVjzRvs/M4OgKv1ti/cU5nl+p958eqqKgxHXLoRbeBKyzXnLZIsApg9RVRvkqheS5Q+Lo7ffI0ymDti4n+bmEzXYLVFjQQp7nmyStp+oes2l62bqX3amBgoem8MUvB8ROX3DfmtbqTjH1hUzx1orEnezb+J4QDp5H6ODhgAXH4TbMEfbsgPDo3hdWShfcDQli/ysF5GZWTmlygMGfd6jKFEnOFmQZbkweh3gQFjMOmit9X6rHJSbn8G2LTJFfC8DPedejgOX7l0eqmrKlkt78MzU38RWI5/+M38Iu3G5Tvp3eAq4bksBE9LNnI3lPmbQSNyfEM+I1ZjOtecKOqlbkR+yh6yLxdT4fmhAnhgqps5wiryAexnppNafj4HQjfjwUC2BACH7tMwWoU8Oq7X3rNPkB0gmrOZw2VIzbTPwCbCUCWwvxAjOLUfgYtq5zvrtJTU+md401ri86yLEdjj6kT/K8vNTZUgcBgZsEU7lU5UH7qA== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3c186e94-2408-4725-12de-08d87c760df2 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5696.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Oct 2020 01:49:35.7337 (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: Sxig3gioz9cdVeHMOur3KMh5jDiTVVKxfZX/yWqFzi8tpzOHF8TT8TBFBsEfdx3LdGnyIl+JV1QD4w06b61agA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2509 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.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 --- 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 Fri Oct 30 01:49:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 1390644 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.a=rsa-sha256 header.s=selector2 header.b=Nh6thciu; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4CMlcJ3l9fz9sTD for ; Fri, 30 Oct 2020 12:49:52 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726252AbgJ3Btv (ORCPT ); Thu, 29 Oct 2020 21:49:51 -0400 Received: from mail-eopbgr80044.outbound.protection.outlook.com ([40.107.8.44]:45367 "EHLO EUR04-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726210AbgJ3Btp (ORCPT ); Thu, 29 Oct 2020 21:49:45 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AvGXNyoqGSfXDtWxuDFBbiy3Iqsr7Kbr5U9ijuiZMfp1J3MELpAJqgJV0VWFdT52OvjS/mO8QEnkLVCJc0XieDA55ij796DouHea+CnbzsETM3i/Sjv9+gquSc4GeFi03jQJu5U32q59mwYgqCYYMdR9bfuti6pCv+ZBSkyNiBWzdUnUUbo4O0trKKAS0M2uozxkxQctxpSEJCv7jaq3tE+Kr4MqkxZ3PwSxt/N5NnVhae+lyDfUYYJrJif26Evur1wkkihkU2EBPPphprUg7mov0n3F4JjLyygLnElVZA9Z1qrl+tJFANKC0xIvAvCl11YRfM5JSl9SGOP96VuqPQ== 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=aKoYOwO63hyMyVeGFZxsD3lcZCjBvdDcK/lk+WVGp0o=; b=lKpXHsoWGZDC/oafNj38s2+ls7nsZdTc2+yPxHciy+ktIcuAeWOWKbl4tcDxSd27ziaU/r3csjTaO6wxcdB/IUhE53PuUKK45O8i+2iDHBw9/u9jErg8ELDbU0tMEZhRr6Qn5Cctkj0znbGb2esE5Fs6rOhH8zExxsZJdsE33F+pB3h7zFEAy5XQrONDq+0dvYDzinR0MtC5/umC7g+scAMyJlOxKDKxf9QRFNZgXFOVzWjqS94az6uM6FG423MrkYxPWSYBAYwnFXxGOOTVzxCfJn8L7SrD372AZdttjvKkpYSsMc714qLg/bSrgGNJT26h0B1MnyoLdYSVjI9mSg== 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=aKoYOwO63hyMyVeGFZxsD3lcZCjBvdDcK/lk+WVGp0o=; b=Nh6thciue3H23PYgmF3Dz3ZdUznh3C8FhBLTuZpFqhQkPEP99Q5lkGMbzPU5rE6NkPJxPuidCp0ACWz3VF+4mo6VDVI+BvnKtMfzUL0jDXOGWpw/MtH0lSq5zpzhsdvTnnApq3AjlX27V5qfzKa3p1rIWqQa6R7YmpUecLMq2uo= 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 VI1PR0401MB2509.eurprd04.prod.outlook.com (2603:10a6:800:56::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18; Fri, 30 Oct 2020 01:49:36 +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.027; Fri, 30 Oct 2020 01:49:36 +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 v2 net-next 09/12] net: dsa: tag_brcm: let DSA core deal with TX reallocation Date: Fri, 30 Oct 2020 03:49:07 +0200 Message-Id: <20201030014910.2738809-10-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201030014910.2738809-1-vladimir.oltean@nxp.com> References: <20201030014910.2738809-1-vladimir.oltean@nxp.com> X-Originating-IP: [188.25.2.177] X-ClientProxiedBy: AM0PR03CA0096.eurprd03.prod.outlook.com (2603:10a6:208:69::37) 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 AM0PR03CA0096.eurprd03.prod.outlook.com (2603:10a6:208:69::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18 via Frontend Transport; Fri, 30 Oct 2020 01:49:35 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: aade3a8e-872b-4014-189b-08d87c760e8c X-MS-TrafficTypeDiagnostic: VI1PR0401MB2509: 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: uaq7OXWm531RJ/YF8NZWSkxx8LHCP431WOJF/AxNk6N+YBh93SBwSe4wzWvcdDl2mIPhrrI4rGQmqpGAXvB4h+FJraahi2S114tXdZo75fUg8mcnXbOzIfbbMewXHhKNUW3hh5RXH0Je1uF3gm5+wvdXlfLYPuR8dHPXFB/XN8hpii+/Oc/ZnmLGS69Q1QKpv6aUHKoAOK6h3PQ3ZV9mM13X0ooP8jCwrOfW3RlN75MttPQb3qfwgdVg4VHRM/NUGZI3nexLSGczU+f9K7LFKjc1dyOqeR4FUVvlzrUyVJfckD96sE85587Q+HECIn7IXcL8sPiDY89YOqr7wPBchaM5PGaOpz4JBDARtdQX5l4M4ola10oU6cUFGJTKnTFc 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)(39850400004)(136003)(396003)(346002)(376002)(366004)(5660300002)(54906003)(4744005)(16526019)(6506007)(66946007)(66476007)(1076003)(316002)(186003)(8676002)(69590400008)(36756003)(86362001)(44832011)(52116002)(6512007)(6486002)(66556008)(6666004)(956004)(6916009)(8936002)(478600001)(2616005)(26005)(2906002)(4326008)(83380400001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: X+wNSwV5lge5BXOTvQ0WiBrkP7jYHrZUfMkfyKjVRJHcWi1mukL51uBb2TBk0Ev/exLoMrV3wZV0EK6UIzjZIz75FyzYDfWCV04SscvIjsZZNIRO1DNAXq12le37otsvE1hAL23pLzdSB7MUfVtjl4rQNZOAmvHpvKz4116X7CVDXceCN4DhoGFygRDcTg4as2n7UF9EqQkVXspIr8XOt0hQ1KtQZNhfUPG60LauJgHIledEGNsDWRV92ly6PWUC4pN7MkjTC80qncuRwFMCn/CG7q2fj3bZZei6xxH/ttBgJzvusaAFncXj8E3H4KYsHVeAjfOlxvuvB+CSAhFpE12AtcIiMKyKMyO9Mbj/zMfJMujNanyQVUtdmie8Ormh9KjC77a9WvULdqb7Biph5Er5z5wnYUE4yLWLZnZm9nq7Lx6d7LIKFv3l/BBOrwlUmOxewDpPRH5q0fqOdFzEfqykG+yOCRhyUgyWggVZXuXwjtgnNFsq6h9wUVALYJXErexe2Os9RzGzxKysol5y/cjYcBRbO4QlppsgETRHVEA/FixupR3hm2uLTDCmZbHWALn6wjOxpbNtc2FlltMiUifOJ3NF/JEDxdd8PtZkMfizS4DnUOMd69AvOETiQpjZyobD4oqlIuEum7T/qk7Siw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: aade3a8e-872b-4014-189b-08d87c760e8c X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5696.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Oct 2020 01:49:36.6571 (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: 7WiVvwMBdl89tddyXEx+KlVehjtyFUr4l4rrFUFPPPzRuZcPlKJI6CYNjXbQF0wuLANRlzRPRqValTTw0YelxQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2509 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.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 --- 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 Fri Oct 30 01:49:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 1390646 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.a=rsa-sha256 header.s=selector2 header.b=aPCxNg7N; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4CMlcP3HTPz9sTD for ; Fri, 30 Oct 2020 12:49:57 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726263AbgJ3Bt4 (ORCPT ); Thu, 29 Oct 2020 21:49:56 -0400 Received: from mail-eopbgr80044.outbound.protection.outlook.com ([40.107.8.44]:45367 "EHLO EUR04-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726242AbgJ3Bts (ORCPT ); Thu, 29 Oct 2020 21:49:48 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GEekqgNQttQcsW1+CM9RPjOxg7pzLex4Dapwe5KuTQ5St/PVKB0S4A6Tl/tTUYHa+SRhrwwBYq6IXPEBppFoTzeJos6ejl+HTvZD3AnDubduy/2Q5FdXeNkhtRb9ehoalc9P9IJtarlJxvsRsjfydQ0/jz3yMjyaQPuO2cj5Q6xk4hDJABzB0MZSDzwYTwNCUprGxecTyIv3vqbSe8CgJgag+LSVYXukGMzRijInMlIfZzaAzFAb4e1gLQj7sIJCnDWOBHQDMOhUrxTv24jHliDtZfy5+HGBbiGoCXzmY783kufD/gW+81wXLTf+gEEYna98QAwEBIYg9LisK7lnLg== 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=6IVXjCw9L2tJ1NXFaDmtYENM4MK274hrmlyMCaAk7fI=; b=IWAk5l3vTBTRmMJy9cJcu/mRkF+psDzpV0mN0MOl4WZaiYwPO9skyBmSxncecqR5DjZvSbG8CWpl63qEoZrHYnywgffuM14/10kyWhNhZ94COiEp1uUg1Qr4toYi38Ur9cV1HGDC4GqJBYizYZGPDSuJ2Igpyl+/3jvF4bDJWvbCTiIGDrHkGscovrcZ4AHM3Pip0f9MXQ7t6nrUxtdtHD3D2Jd5ZAigCNUUsEF7hRR2n/V/8EddDn9VqHXT+3kB+4QkWN61n9n1aTeZBW1GQbfpVV7heXS2aTfXM2ueW7KQh/rHrtWNZ1aeNkyOZtajOupPPHEJervBMRmD/aU0EA== 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=6IVXjCw9L2tJ1NXFaDmtYENM4MK274hrmlyMCaAk7fI=; b=aPCxNg7N0BYufDFE7GkBe8cdNtBOz70S5n4416Qu2i9JCcNDuqcOhMsJbQj7f6MQ77zGF2Gy/P8WjwCEHg33gqsiGQdiuX+mLX2An+vEvLwPJ4YOdxBwxJhjZBg3MgWR90hp/m6F6U1WFIEVOhNCSCY1fhg9eLvFby2kWt4oh7M= 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 VI1PR0401MB2509.eurprd04.prod.outlook.com (2603:10a6:800:56::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18; Fri, 30 Oct 2020 01:49:37 +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.027; Fri, 30 Oct 2020 01:49:37 +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 v2 net-next 10/12] net: dsa: tag_dsa: let DSA core deal with TX reallocation Date: Fri, 30 Oct 2020 03:49:08 +0200 Message-Id: <20201030014910.2738809-11-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201030014910.2738809-1-vladimir.oltean@nxp.com> References: <20201030014910.2738809-1-vladimir.oltean@nxp.com> X-Originating-IP: [188.25.2.177] X-ClientProxiedBy: AM0PR03CA0096.eurprd03.prod.outlook.com (2603:10a6:208:69::37) 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 AM0PR03CA0096.eurprd03.prod.outlook.com (2603:10a6:208:69::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18 via Frontend Transport; Fri, 30 Oct 2020 01:49:36 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: eff3ef42-8dce-4834-bfb1-08d87c760f1b X-MS-TrafficTypeDiagnostic: VI1PR0401MB2509: 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: k18vLpctPQxRfzYu/W8Z/ZW9GfpTj5emIFkDYHIUvb6H6R2fZoT3J83G+LY0n1pjvW+ywpfuB5G2zJZwt7DS060GDFmeQBiuMNpnHLU2jPHFXSaqfdf92MJb0YLTDjb76wwOTGZWWexTqI/ax1gpJLbRCdoaWvF1PNU8qcqCLzUEhROZqaNLvRM4UZbEMUxvPQzup1THy5fLH8lB3S04fKEeuKbaa/RkPirDXpw7A9zWhRU2laDVyirfj1YtRGexkgyoAtBZorN9PSbzn8Tuqd1uzwzlzQ6BMNpTAT6QZR3HJ8tT90eZlMiaFJj+R1tgxmZQShVhYAm0SXxsnvl4SJcB5xDblWf0gY6D/anUhNubk+OWOiHaA8BsMQrT8ygB 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)(39850400004)(136003)(396003)(346002)(376002)(366004)(5660300002)(54906003)(16526019)(6506007)(66946007)(66476007)(1076003)(316002)(186003)(8676002)(69590400008)(36756003)(86362001)(44832011)(52116002)(6512007)(6486002)(66556008)(6666004)(956004)(6916009)(8936002)(478600001)(2616005)(26005)(2906002)(4326008)(83380400001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: tSe86Hox/AytdEzVZA5/jmvLo8Qf0D9UO2JdKiOtkGXcY8hAlFJ/k7Yf3NxYcwOrmvfmzS/AmQZyqHRKOdZ9/ycZcun6eqwUUcbD374ZcsEmXtsXzkVkjoijhTf3WVO0pblEdMuxSaO6pjhY/jXzMF8gpcEIYsn1eV0pA0SFYkFM8osDVVRHQynDzB5+pVc1uKbe3IgxQMF9kORdw2cObZMuyaty0ToYwOFXplhWepdDfXTTrV/5Y8yTJX1ustjkiLmEWqyC5lSD2O2+x2wZax0Sefos2mFE7LoeTHOq287lLpCb7yw0PorsB8b7ANEJ0x+22DmVHTY3dEn0Zlhzz2fQj8LUjA9d34YK8Hp6vaf3ILLnYHlgOYM5lHglf1kOb7w2+lTwYL6GVLwmB4w+XCHNzQvwRchr3fXIqG+WpVUfdmdGMS8hSrCP9i5pU9mkMkzBewrqgyxubnvYNaap/9DRnTtzDGlyi2s0mcT9gx2mFqQyZ7V07mU6KjWOXZdMu7wXrUqt+Qnwv700/ut2maq4bhVi7WHZS29MWvWhO/1y2eT84V1y+YM1jVQ8fI0dbjZ/aRCIxE07ugwfOi0uxQMaWlVFZEVtPqEeiPqMNeEfZ/aVKeYbhiDJEYSoCq/3lLPDgaWdD+SzPCl24R6Lsg== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: eff3ef42-8dce-4834-bfb1-08d87c760f1b X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5696.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Oct 2020 01:49:37.6076 (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: c5q4mAsXxyD4/oxyRr1fRnMe2/N3V/d+SvxVvuepUBO3jlogrQSJ0zYznxb3zEQfCJs8J5yDX0cV1h/7hjbDeg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2509 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.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 --- 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 Fri Oct 30 01:49: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: 1390645 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.a=rsa-sha256 header.s=selector2 header.b=eYRvoLbz; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4CMlcN1rCnz9sSn for ; Fri, 30 Oct 2020 12:49:56 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726256AbgJ3Btz (ORCPT ); Thu, 29 Oct 2020 21:49:55 -0400 Received: from mail-eopbgr80089.outbound.protection.outlook.com ([40.107.8.89]:30883 "EHLO EUR04-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726240AbgJ3Bts (ORCPT ); Thu, 29 Oct 2020 21:49:48 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JT7dfv2wvbTXa/N06GMxRUxGY9/+oZlCLskuGZYT8K2RH8ehGG80IUXJrD8DwBhdyIvxNnUVmuNo+ujTnZ7ve9VJPHy9EigpcaH0k2fbvJidEiv0sSRL1u5S8ZMB0jpmnOV/IfNdC0oLnqd0F743hQ5Ol7h88xeBw4LVe6CV6cxD3ZDw/GNQauGhwJpMS1O75WJYFGbhQFriqjq6AQnI+cxyp1ZHfU88BOwe24NvVCUUjOGciJbGTotatoz3Lr7d5Kj70eyvwWxFXvehrqoWAnV6axF3zCbjhSh7QOzMl3qcE9Vwp38Iu3V1gI/E2/iGnpgILJL20aV6PmNZnHwXLA== 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=RG2zHUI+o++jrKpKLID7uzAyKVs2ITTp0Mn/fZ9PHHk=; b=C0/a4NvN8JAqN2sIazNHRZq5etryevpEyBBqjhQp6mcTlC/7yeufrHoE2jl1LeykemMaonClDDFKql2+900+W8CkcFbvozWO6ZgtoT6rgUvNzmZmtiMWhMG9vTuTFibCnO5sCsKlIX0nAa06wNagkNpA77S77Ugw8JJ7J3cnE3oyRWhv3Xswo547OD55Np4mWMtXWTLzeu9MvWU8M8Aa6I51zZfAGhnpoZ24vSdlwPew54Uw0J2e1rxI4hHv09YE1n4lsaxifCjb/ts++pbdPDoWeFlmEY11tCND0GC/x8mhdgK8L0Hsx0e2y9RWlo+AQuB7uUKjkngSkIM6gsmCEw== 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=RG2zHUI+o++jrKpKLID7uzAyKVs2ITTp0Mn/fZ9PHHk=; b=eYRvoLbzQ9kRuleCh9Wi9C6U+Ne2fZ7vgJITMiovqUPIsTSUBsxHataxPHQ3FuI4HXKFMiyKucp11hJjosj5OVgxLi3KgCwtYc/HV7rgcpl+kf2UWCQ1LvD3P8K8zGkacPYor1pEiq7R98TDV6R8Y3mmQZACDI9/p/deOesHVtQ= 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 VI1PR0401MB2509.eurprd04.prod.outlook.com (2603:10a6:800:56::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18; Fri, 30 Oct 2020 01:49:38 +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.027; Fri, 30 Oct 2020 01:49:38 +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 v2 net-next 11/12] net: dsa: tag_gswip: let DSA core deal with TX reallocation Date: Fri, 30 Oct 2020 03:49:09 +0200 Message-Id: <20201030014910.2738809-12-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201030014910.2738809-1-vladimir.oltean@nxp.com> References: <20201030014910.2738809-1-vladimir.oltean@nxp.com> X-Originating-IP: [188.25.2.177] X-ClientProxiedBy: AM0PR03CA0096.eurprd03.prod.outlook.com (2603:10a6:208:69::37) 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 AM0PR03CA0096.eurprd03.prod.outlook.com (2603:10a6:208:69::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18 via Frontend Transport; Fri, 30 Oct 2020 01:49:37 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 4612e883-7160-409f-919f-08d87c760fb2 X-MS-TrafficTypeDiagnostic: VI1PR0401MB2509: 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: 35o1Xkp9x0UHr6MReI9e1Ym4IND2j2u9+JpX03fOC2jee7LOPzT++jGaTA7v5X47Mu+yInoRHhZQ2wZkWB73shGce4c2O+o7VxERAeOcWraf+p8lXsrma/j9zXgfvYDP5a3haJcKE9wUHVGqhlWa0K7ITYoELerH/nDnLfEVj6+dIZ1DwAdAudIhlRBYxi6gqlkaQT0VKHAGLL6ylLyUkEy+8GbmYlaUs6CHm98YVqY22tG1BuAxZzYmCQ1ZpcNPDgczCDuVM81mVg5Ob1AmnTSO1x1iPQtMHghxgkJa2hxSlKqGwh7EG9BVtBee/NqxDfHLSk9JqN69cCit24JsYlmadniCGKXG3cFkzcuA0t942UrpnVC91xCwQ30IeATE 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)(39850400004)(136003)(396003)(346002)(376002)(366004)(5660300002)(54906003)(16526019)(6506007)(66946007)(66476007)(1076003)(316002)(186003)(8676002)(69590400008)(36756003)(86362001)(44832011)(52116002)(6512007)(6486002)(66556008)(6666004)(956004)(6916009)(8936002)(478600001)(2616005)(26005)(2906002)(4326008)(83380400001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: wE8VaFH4HBEG8EOvVaVNi7rlhVJDxlcDxKAd2uCFARwclnAf0Yp+eOt0kc++H/lHnbkC4Ne5zszRbOOXwmQUN2xIphSeql43uuiGdxAvR7eoQlk1M1gxYJuarY2Itq16Fr9lk6dlNEFLhSm/XRzc6lUOxAQAQyUX95QFwDjIwPrNxiqKySibjkLzSRx6+u36HK2f5+Ypv5MXRWmUTjq6cXDxZhJSr489zthntZMDGJcZhEjsSJZ1Cswt/x8vinHizvw3Z8hQP5rZn7XZk5Rl8lst0qEK4hZLgZlFhZloeohPYcptJE9cp7vy1U43msYUHRJyzHce3KHUorlo7Rcn2BldpjC0sWGJlMYkJuMq8V7DpyQiEy8koen+STqGh2yMjLC6Xn0ZCHmvYZ/53tBQUP3cdaWrSaG9LWcH5PGHxuGeemq6bjHkV2P3VJPsaB1FAsgBza0kqBqO71LUlw5N5kMD+ZfTglvJ7u53NHKvQAsozSQe7nZpGo3FR9N76gIblWILvKrPceU2aKQg3oOuIinTZxOhBdIesxfHRGoCpG2q+hl4KpQL6bcsAmueNm9mHrpiy5MLqGt3AxFkAsOe3micsw7DkiPj8I65mZ1QdzaFcKo3Dx27DHjQfdN+H/O6RAy4gqp7EWPgLWJNYSZvXg== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4612e883-7160-409f-919f-08d87c760fb2 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5696.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Oct 2020 01:49:38.5970 (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: xD0jDXfzTMF54whsTkSto71I1nA7uxN/yfLpFcmjVwYFHXCI1zuMNFM56xJ5iEeVzuGyuySgJP0UuTBr92291g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2509 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.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 --- 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 Fri Oct 30 01:49:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 1390647 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.a=rsa-sha256 header.s=selector2 header.b=cMBcJbI6; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4CMlcR69rHz9sTD for ; Fri, 30 Oct 2020 12:49:59 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726274AbgJ3Bt6 (ORCPT ); Thu, 29 Oct 2020 21:49:58 -0400 Received: from mail-eopbgr80089.outbound.protection.outlook.com ([40.107.8.89]:30883 "EHLO EUR04-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726195AbgJ3Btz (ORCPT ); Thu, 29 Oct 2020 21:49:55 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NO9G/YezJzSAoJRKi3ckolNZOokUf6q3ZAkNztSqr3ZW5MRUmGXYzfueHE8IM/LJAZfiFIBxZ9VbFJQJgET1lNbSnoBeKY0Gt2fqWFjh4658CXDZu2HTzttxwrc9azVMsw0msimy5t7J+wMDoTR+t0iv1d/vCMSPg5KuuefQKsT4cR0voURw5ipAbA3SMA/zhFfuzFaTKd8M7cLZH0FR9oO3+g7VjgPLYA6fjweNeNVO+SpKPLrYXlco8Ho5UqmTRZnYpaunkt30SE5yQc9FiE1hx/Rnwn4+tOi4EHkCv6yKh7YgC/U3rs1djc6cz4K54EZj8zCFn/JaLspqXJ2oFA== 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=7kCSsNzUEkBL+c+qQtRHxNY32cQhLeaMAAh6GnFxw+E=; b=msAKwJzO9waip0SVLXpva2v4knO/0bjXBeWkYNFfO53i90g6oB/YnqRyBKBd7g5BSc9JfoY4FoO+qFdtIRQ7c5ZhjVIidlSf8K8GRwpoy1nLdJs6n+tdsVo3fMzJ/ZrjREk3vnBN0wXAqbz5OJeEaQMQu/hMXzXSkUXXJHCn/V7UEH0vrulIkTHyGjCcaKTaPkOsD9Z9uFjv12QbKEHnqCUzUVrCjjDK8dfNKy1oOEdH1H6KKMiJMyta82JtYzzfLTccftmingT+1GkWKLB5J4JplbzZq/isVBrevTFMhrxuhqMQAbrNTAuZGHhM4MYhlxD69RtszVyKlAEig1ghSQ== 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=7kCSsNzUEkBL+c+qQtRHxNY32cQhLeaMAAh6GnFxw+E=; b=cMBcJbI6PNOQaF6DbT0l5wUOQYxQdrkh5RGRJNymjZE5ue+S7zUphRzLKlrxMa+bveWLeibddShWSjebZoDZ1p0otlaN14VQFb4kPU1m9T1ExuHF+g0te9+9+dMAvcdTcbguMHarIBUTbt676+P5c1GsRNh7D13NvaqomQPjfwU= 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 VI1PR0401MB2509.eurprd04.prod.outlook.com (2603:10a6:800:56::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18; Fri, 30 Oct 2020 01:49:39 +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.027; Fri, 30 Oct 2020 01:49:39 +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 v2 net-next 12/12] net: dsa: tag_ar9331: let DSA core deal with TX reallocation Date: Fri, 30 Oct 2020 03:49:10 +0200 Message-Id: <20201030014910.2738809-13-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201030014910.2738809-1-vladimir.oltean@nxp.com> References: <20201030014910.2738809-1-vladimir.oltean@nxp.com> X-Originating-IP: [188.25.2.177] X-ClientProxiedBy: AM0PR03CA0096.eurprd03.prod.outlook.com (2603:10a6:208:69::37) 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 AM0PR03CA0096.eurprd03.prod.outlook.com (2603:10a6:208:69::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18 via Frontend Transport; Fri, 30 Oct 2020 01:49:38 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 5ffaed03-e38d-4192-e4ce-08d87c761055 X-MS-TrafficTypeDiagnostic: VI1PR0401MB2509: 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: mAzyP02EZ16mNRWNaV1YAMQZ6s1aS9IgDkhk/MRgKGAyPO/WoRcHtLgMwFu4T1vHdnDEI8rVul8AfSMn4v0nDbJR9xHDo+Yp+NPdjoZrk/BmiyA5rE4U+K5CiOtyj7s9EgCSxPa9L5QEaj7d66ZteMguwH56eXHM2vRCsjur429iuudDJ2T9wa6rhj8yoHQknM0Hg4Hlt9UsGd1bttEkqt9esGOWkFTIhqvwsrjX6mzuEiggY5qw1A2HujgAIBqULoiYdMTAHkpQzt58cW4aAKYeO+KUFKYjSUrcfPCX6DYjXnjnhCq3zhRAFi9Nj6x970lBcPeb55o7SYVcxjZue7GaIH22qr9kKwA11t8Pgsxv96AH5S/RaztypxfbeUrJ 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)(39850400004)(136003)(396003)(346002)(376002)(366004)(5660300002)(54906003)(4744005)(16526019)(6506007)(66946007)(66476007)(1076003)(316002)(186003)(8676002)(69590400008)(36756003)(86362001)(44832011)(52116002)(6512007)(6486002)(66556008)(6666004)(956004)(6916009)(8936002)(478600001)(2616005)(26005)(2906002)(4326008)(83380400001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: HHRRx/TIB6+jOGLWhO2eRGIvmTSEbTEH3JoFWUt4pudiu68dq9dDhHwLKqUqBdYtliM0Xi8OyvoqgvMNiC0XQQLapr93gN6hxjW/sg//ivzneiulP7dIVo2otE9pWF6A0k2ajRTesvCYZbSZ/UXP6yrsWhghO4WoDJRv0KZhaPPKfBLXcKhxXW8enkxMZyKoO0Eiq1Han1LxXK2yTHHWd1Dx0L9WLA/EELSD4x7JZO6Z4UE7YL00ojOq4liY47JPZ6XlR1/+omOv5lDWrTr/wHPeVs1k0ayVncfvvleOkJ1XCIr49zidQCjLPRVmgSr8AHYIdnKRP2Dj9uJiV4xRLD2UvCoTpCoFzciHDKRRq6yEBRnySdGbhmu793I/kN/KRYvD5eCChijlGqE8LGotjVo9kkIlqL669q8rvMEoteil1CVAJnmS7maBjpJWsUJr6fT/5CVmcRFUMkOa0NgLMYUofgEixP0F/8a5wxGLNSoKKTXODHqm2Zrb2UeExovKpdTLuN2lQ6Yof4eZLbDE3p4CXgCyWuOcu9GV99L4rX1r+eqnvElAVmgMtqs3XfqAHM5z01YQTTtgtDJhPrW+6i9Py/eyo9ft9eFFFieKAn6FTd3ezncfrCkVC5dtilKbYaRREkS3XSDzH6CAWTmt/Q== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5ffaed03-e38d-4192-e4ce-08d87c761055 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5696.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Oct 2020 01:49:39.6903 (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: I1vVMyWjAVORS9HjuSkrhlwMdB0WRA0owb5AgauC/MU9UbaHG6DwEOY5jNaCgKNwkNQr8oPC+xvu51yxpVEMDw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2509 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.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 --- 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);