Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp368916pxa; Thu, 27 Aug 2020 04:49:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwugNylqG9QEq00euasv4I6f6eNX07VrTt2Nk9ATfCtTwjMnQ+JfhLZFbrTmNWgbjPDlj6j X-Received: by 2002:a50:c8ca:: with SMTP id k10mr18815907edh.255.1598528985747; Thu, 27 Aug 2020 04:49:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598528985; cv=none; d=google.com; s=arc-20160816; b=QHpgIDuiRljeTbKtM+DtaTlTXvDuFaNTFfA0F5mtfrJgy3u1+njfVj0uFdo+gN8Ja+ 0nIzGZAJowISRLp87OHFDPt7m3PpgIoKrn6n1PlZYf8DQr7v+fqaJPkcOtHFtdLHy9cm pwHYEd2Z04harge/XYRS7q85z9T/j9Wis7/7Se+7ZLaoOLb4csGOw/zbmhyjoxf+4nTq umPBb11VKLCRPkS5Sbmi4EVymfwIDrdHib6i4eqdNFHNoTf1FVJ4Vn0pVGNH3obUOiez oiw/R4/WKyhAzYXCtaEjJbSGTJtZLk4kr+VcVgM9wFNCQ0KRfQbntssNOyvx21OiAv1P ea/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=nk3XMsscwoEZw1pfmEYAb8eP1m4cERKtDNn3BOQ6wZo=; b=CSH5n0VZkGGKKFMFdOTYNK6jd6qEUt7iE6d04kaqU5oJkjNhHbhRoM1pt7v7fVX9tw D9n6gdlX5Pv0BFbcROei3yMJmY/gXbuIiBRusTFLmJT49Z947BYARgNDrzII36xjKynJ ed5T93wcJKEupMen4WkI8m08cxiXcIsosRnApYwmb+MncCasHDi5JjjYetiZ+Fwf6yup M5rLs80Lb7u62HNmJ2PYerfO/tXf77I8echJjf26k5H1gYqB5Zj2i7VVafJyP3alGsZa dhIz8mHwy7LNUYu/YU7a9mM6bgNIs9HBYOO84+rH4s8N859NPCFBBmzC1w+ng6pF3mep Zr0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="U/C0BJII"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 34si1478601edi.38.2020.08.27.04.49.21; Thu, 27 Aug 2020 04:49:45 -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=@google.com header.s=20161025 header.b="U/C0BJII"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728837AbgH0Lrp (ORCPT + 99 others); Thu, 27 Aug 2020 07:47:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59000 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728742AbgH0Lfu (ORCPT ); Thu, 27 Aug 2020 07:35:50 -0400 Received: from mail-il1-x143.google.com (mail-il1-x143.google.com [IPv6:2607:f8b0:4864:20::143]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4FA09C06121B for ; Thu, 27 Aug 2020 04:35:45 -0700 (PDT) Received: by mail-il1-x143.google.com with SMTP id q14so4579296ilm.2 for ; Thu, 27 Aug 2020 04:35:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=nk3XMsscwoEZw1pfmEYAb8eP1m4cERKtDNn3BOQ6wZo=; b=U/C0BJIItk4cpBQIKKHprsucVwFzLLWgqyxYVTuviqiRvJjFV00mPKgYgU/U7w4t9Q Y40T9K2BvdJWBQDj0tw6ewwLwDyW1ggK0A40/SxM6ZC0MKMxWAcf8PU1zP7NJ0DL7mwD mabdMS5DBW7DARO/TJRFwzlgPVu8S0VESQgV96hED2alyqd76GfOWzrgDjc3gWEb5N5f ZXoX2eU3bk3e00NNtglqOZOkh7D0oiLs7icsqPvxkUgCc0SrWpmEME3fJ2zGpsL7xeGb Os6qqgp8yE/vPgMSIJW3N5qhxl98XatED8SwbtCvliPqsXhjaCEIi87d3MLFeclXamQ9 +NzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=nk3XMsscwoEZw1pfmEYAb8eP1m4cERKtDNn3BOQ6wZo=; b=aDsLs3zq3KGllS+Urj3pEAQzcdfcDe6J5yVt6F3Fdz+DNa6jXJrNF4X3XpWQzs/9zv aF0g8E247NKcuOC6ahBloYhpNAisL3OkOeJDVDo/fZEIgwYq9BXJ7W4d5xHLWlUGxjvF dnqmTyIOmycj/fHXz8T918dJo3pttfwR3o3I1kjq5y2TFeb/hcJczM4Dw8aTb/dPnTo3 ZhyEmNNmXSwnsj0YvrNkZzxcnP9sE93tgRx533KVm2LDfrVeiXrWSDLQu6LO1n7Yrooq 8xdt5ZC71bFRV01XZS6KlOf8NoZ0/i06mPWOlqG3CqRV8QQ2jB6pTqFVUUSzXVU9GAtn zOSA== X-Gm-Message-State: AOAM530+KC6p6LFKd5X6CH/JMsuQe6Ujig8drnbtUuNSvepAxgS9jMxt h+vK7p1BOmt30gMi3Ok0jYVmCuMPghosFs2ShQwNHw== X-Received: by 2002:a92:bb0e:: with SMTP id w14mr15038915ili.68.1598528144077; Thu, 27 Aug 2020 04:35:44 -0700 (PDT) MIME-Version: 1.0 References: <20200827112922.48889-1-linmiaohe@huawei.com> In-Reply-To: <20200827112922.48889-1-linmiaohe@huawei.com> From: Eric Dumazet Date: Thu, 27 Aug 2020 04:35:32 -0700 Message-ID: Subject: Re: [PATCH] net: Set trailer iff skb1 is the last one To: Miaohe Lin Cc: David Miller , Jakub Kicinski , Pravin B Shelar , Florian Westphal , martin.varghese@nokia.com, Davide Caratti , Steffen Klassert , Paolo Abeni , shmulik@metanetworks.com, kyk.segfault@gmail.com, netdev , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 27, 2020 at 4:31 AM Miaohe Lin wrote: > > Set trailer iff skb1 is the skbuff where the tailbits space begins. > > Signed-off-by: Miaohe Lin > --- > net/core/skbuff.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/net/core/skbuff.c b/net/core/skbuff.c > index 0b24aed04060..18ed56316e56 100644 > --- a/net/core/skbuff.c > +++ b/net/core/skbuff.c > @@ -4488,8 +4488,9 @@ int skb_cow_data(struct sk_buff *skb, int tailbits, struct sk_buff **trailer) > skb1 = skb2; > } > elt++; > - *trailer = skb1; > skb_p = &skb1->next; > + if (!*skb_p) > + *trailer = skb1; > Why is adding a conditional test going to help ? cpu will have hard time predicting this one, I doubt this kind of change is a win.