Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp1775043pxu; Sat, 17 Oct 2020 00:17:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwQl/v5Ky5JJbA86hsDJD+XG7/C8cmqm2UfD+KvSTdYBVL1wGScugvN32W0oa/UIR1Qrt81 X-Received: by 2002:a17:906:354e:: with SMTP id s14mr7509032eja.192.1602919062513; Sat, 17 Oct 2020 00:17:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602919062; cv=none; d=google.com; s=arc-20160816; b=qoVDrxfRa4Xfgtv19ZnrKw1Z0CtiT5V/i85yqnvEZdsLwzZaTF6yUvBEzYdH1spyaR NA9MBwtX+jCFYvgFpIRPolmZ93nlgFJNDtVH7ehj0ji5+pUlkdQzQyoc55yN5NDANE2Q 9bZiUq30/pOKt/SW/EDvH2Au0pe6mDf1/PDbBqED22oORfw8cS14PvXB848Ikd3XJX2t RC9AyJA2bkOzPQUJbOE4FcJcuGxYizFwBI+zuKkwr+/8h11HZUeUhyZh2QfnUNbFRiKB Jd4nrXWcDhWLja0V33nu/GxknAv9ys2u54j6iwUdCKHVOVGEx6ITq/6lnoVlTLosn92v gagA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Ua2AZ2Oeg9ewqA0Si3AkIz4WRNl/Q2mfMB0KJrjvhWY=; b=rulel3iaqn77Rcd+i41735cM1PynBv8wPGuhYuYFDwUTGfZUFYENvAiq1+YmNQwNta 7Mtzq2J9xAbyphrrnZ4pCtJ8ghMQEdr/sley1N3teyDrIAbls6V7vPhmc9+7uqfI3G9Z 9HRc8blUVaMAUDgYXefYm9EwxDwSEbrIkpIlijbay6lxtxhu3H3lv+oU6Su89SbqyWsH OcQaEkQP3Lk/cscojAUvPyZuqE22Epf5ZFPFuYoAC3RXd19CUiu0U8TfT1zxK2d1R6sk sBjWdSBdT3y/D+7+pG/vCXiG6TQ9rca77DQeApxKN2SMW45kF9Vp3zdJCjoz87kUULq7 m8hw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=uUqHvywJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r26si3734074ejb.114.2020.10.17.00.17.20; Sat, 17 Oct 2020 00:17:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=uUqHvywJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2411796AbgJQFfB (ORCPT + 99 others); Sat, 17 Oct 2020 01:35:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2411748AbgJQFen (ORCPT ); Sat, 17 Oct 2020 01:34:43 -0400 Received: from mail-ej1-x643.google.com (mail-ej1-x643.google.com [IPv6:2a00:1450:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1EBDDC0613A7; Fri, 16 Oct 2020 17:48:20 -0700 (PDT) Received: by mail-ej1-x643.google.com with SMTP id x7so5847846eje.8; Fri, 16 Oct 2020 17:48:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=Ua2AZ2Oeg9ewqA0Si3AkIz4WRNl/Q2mfMB0KJrjvhWY=; b=uUqHvywJ4GS5x9oDzvgNuIg90FGhdNqaQgCMHgxjpw45tpi34MNDwt4s22Pxeay58Y ujr4iqHG6RbIXO+2EZqSWTzH3aEpz0Mgj4cnakrg0lFeDXs+Xu5Zt05zoJdANtopnbxF tCBBVD3+0CLMQMTsYUMegL844PryMkQ1229MKI+1MMq4vg39zbGA1Nv9jkr2l74gfWMz VMLpnROG2RhB4Ql8m/yZ9BW+I8oDO5v7leu7r5x/1y0Iq53NEyHwgaEhK/5IyZB6Ch8b GhiQ33U3GMiqBMdiQCnen1aPahXyFCv6zyJoc7OjbcsXlQcPiE0q3Jy0vgQj7I34eYFs 5bSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Ua2AZ2Oeg9ewqA0Si3AkIz4WRNl/Q2mfMB0KJrjvhWY=; b=uAlV+uik/qawGdNa/4aQn+Gx4Io9fdtlXUZcUKB6TAh3mFjKHhiSNZfcbBU1HZPNfy +MRSNmJaSpqPF8X9Lgyx+2UzESY0atNvuEf+UdiVz0UdpFEf544g2FrqYT3itOEhFPcQ H0VYRgmhMQt7tnHXTHCijJA6e95tYfkkY7aNVqlkYpI7lEp+86sRLU+rg8l5E7VU5Opb blTfNc1jkXutFTft8z+XvSkMqetSje4lcSiqrzwmVBDgfotnZgUGU6N0IonVtEGvRkrz Ajv+flI04b9426ztcVsl/Ntt8XoeSf2a3Y6ngDh1cx5bKNXysWNukSTYeH/v088gadLp VgnA== X-Gm-Message-State: AOAM530jJN+H1FzUzpNtTrJS+aEFkLNE1LN4UnP98BJv9rA8xbwEdKiv EOThw3XChWgFlvkAiLOlH3I= X-Received: by 2002:a17:906:1a11:: with SMTP id i17mr6338496ejf.381.1602895698730; Fri, 16 Oct 2020 17:48:18 -0700 (PDT) Received: from skbuf ([188.26.174.215]) by smtp.gmail.com with ESMTPSA id si13sm3326957ejb.49.2020.10.16.17.48.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Oct 2020 17:48:18 -0700 (PDT) Date: Sat, 17 Oct 2020 03:48:16 +0300 From: Vladimir Oltean To: Christian Eggers Cc: Andrew Lunn , Vivien Didelot , Florian Fainelli , Jakub Kicinski , Kurt Kanzenbach , "David S . Miller" , Woojung Huh , Microchip Linux Driver Support , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next 1/3] net: dsa: don't pass cloned skb's to drivers xmit function Message-ID: <20201017004816.q4l6cypw4fd4vu5f@skbuf> References: <20201016200226.23994-1-ceggers@arri.de> <20201016200226.23994-2-ceggers@arri.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201016200226.23994-2-ceggers@arri.de> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 16, 2020 at 10:02:24PM +0200, Christian Eggers wrote: > Ensure that the skb is not cloned and has enough tail room for the tail > tag. This code will be removed from the drivers in the next commits. > > Signed-off-by: Christian Eggers > --- Does 1588 work for you using this change, or you haven't finished implementing it yet? If you haven't, I would suggest finishing that part first. The post-reallocation skb looks nothing like the one before. Before: skb len=68 headroom=2 headlen=68 tailroom=186 mac=(2,14) net=(16,-1) trans=-1 shinfo(txflags=1 nr_frags=0 gso(size=0 type=0 segs=0)) csum(0x0 ip_summed=0 complete_sw=0 valid=0 level=0) hash(0x9d6927ec sw=1 l4=0) proto=0x88f7 pkttype=0 iif=0 dev name=swp2 feat=0x0x0002000000005020 sk family=17 type=3 proto=0 After: skb len=68 headroom=2 headlen=68 tailroom=186 mac=(2,16) net=(18,-17) trans=1 shinfo(txflags=0 nr_frags=0 gso(size=0 type=0 segs=0)) csum(0x0 ip_summed=0 complete_sw=0 valid=0 level=0) hash(0x0 sw=0 l4=0) proto=0x0000 pkttype=0 iif=0 Notice how you've changed shinfo(txflags), among other things. Which proves that you can't just copy&paste whatever you found in tag_trailer.c. I am not yet sure whether there is any helper that can be used instead of this crazy open-coding. Right now, not having tested anything yet, my candidates of choice would be pskb_expand_head or __pskb_pull_tail. You should probably also try to cater here for the potential reallocation done in the skb_cow_head() of non-tail taggers. Which would lean the balance towards pskb_expand_head(), I believe. Also, if the result is going to be longer than ~20 lines of code, I strongly suggest moving the reallocation to a separate function so you don't clutter dsa_slave_xmit. Also, please don't redeclare struct sk_buff *nskb, you don't need to.