From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AE766C433E6 for ; Sat, 6 Feb 2021 15:44:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8386864EAD for ; Sat, 6 Feb 2021 15:44:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230080AbhBFPnw (ORCPT ); Sat, 6 Feb 2021 10:43:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37496 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229586AbhBFPnr (ORCPT ); Sat, 6 Feb 2021 10:43:47 -0500 Received: from mail-il1-x12f.google.com (mail-il1-x12f.google.com [IPv6:2607:f8b0:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8808BC06174A; Sat, 6 Feb 2021 07:43:06 -0800 (PST) Received: by mail-il1-x12f.google.com with SMTP id e7so8695451ile.7; Sat, 06 Feb 2021 07:43:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=aLDSj186f0bR5X7Y8YAcIhnfvG2HaPYJ7L9LPKrPwA8=; b=pWgHDJ1CWcvw+AZdGCS9agQtQZkHarO5t4EvG6ZiuRTCKMC/hZWM3ZBjXn71tmlUCl njiWna7r5z36slxDTiVoESyGopv9nSRHfk9Gfa6HNGWbI2DJE73XrR5px34p3fGP52IN fVgXslELR5Dj5+uJHPYYqcBt30WMrKAJqskn3uCd7/hy1+Phkrcl32hOmupWBU5q5J5/ 6AepUiLCf7hhiYfN+GJxNVgwiNXtNnhMdAw4vE+J/8P1EXnu6yu5eS/NC3UNsVIm2ZM3 SpDvjwaN9o1n7obSIx1v4fBRSFlAnanvUA0rEZeVVSB2pnxUXlWposd8bA31pBuafNeW 1gsQ== 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=aLDSj186f0bR5X7Y8YAcIhnfvG2HaPYJ7L9LPKrPwA8=; b=cRr+xJtTu6my7OW0FSOfCR4F1TbCu56/GiUuKRpUBpuHwte2QCabnkin4+QA4lgDE7 VpkQoFzTQrlqWVLQNipY2l7imR/sqIPAu9TH2f/vxDmFShW9IQuKV3lAduQBqX8wRGZh 5PmMmsTX6hI9Tp8CgymqZx9qx8qsWnlEtNFRuV9AvO9+bD6wkJLeAolInwT1Es5ceT/P /Hou47hapZ8s6IpG/UwPjgd+YdJBWsaORIOUo2oLqRofJS5wT26/s1njbsHVLncvUHKT tMfQWeK3WQ+Ri7H8eB+S3twBQlOx78rYb/+uKk3NE+D0SExSExD0TN8FmTWmjrD6HuhT PHeQ== X-Gm-Message-State: AOAM5325L5rBF4L311TXYBTyh6ZSjMy6hbS4icabLaThjkz6Db+dnWSD 5VrMhkGyGWW4lfC6WXXQQEcjoyp5bD9ZKe1kqrs= X-Google-Smtp-Source: ABdhPJyyv9u3uNtECdpZl23ih66cCZxfAMNVVrEe0JMbN8NsMQ5Q6rPJ/Hxg27ee8RgHx2/i/90fAbey5Iq87EZlcSw= X-Received: by 2002:a05:6e02:1a29:: with SMTP id g9mr8283633ile.54.1612626185418; Sat, 06 Feb 2021 07:43:05 -0800 (PST) MIME-Version: 1.0 References: <20210205224124.21345-1-xie.he.0141@gmail.com> In-Reply-To: From: Eyal Birger Date: Sat, 6 Feb 2021 17:42:54 +0200 Message-ID: Subject: Re: [PATCH net-next] net/packet: Improve the comment about LL header visibility criteria To: Xie He Cc: "David S. Miller" , Jakub Kicinski , Willem de Bruijn , Eric Dumazet , John Ogness , Tanner Love , Network Development , linux-kernel Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Sat, Feb 6, 2021 at 4:52 AM Willem de Bruijn wrote: > > On Fri, Feb 5, 2021 at 5:42 PM Xie He wrote: > > > > The "dev_has_header" function, recently added in > > commit d549699048b4 ("net/packet: fix packet receive on L3 devices > > without visible hard header"), > > is more accurate as criteria for determining whether a device exposes > > the LL header to upper layers, because in addition to dev->header_ops, > > it also checks for dev->header_ops->create. > > > > When transmitting an skb on a device, dev_hard_header can be called to > > generate an LL header. dev_hard_header will only generate a header if > > dev->header_ops->create is present. > > > > Signed-off-by: Xie He > > Acked-by: Willem de Bruijn > > Indeed, existence of dev->header_ops->create is the deciding factor. Thanks Xie. As such, may I suggest making this explicit by making dev_hard_header() use dev_has_header()? Eyal.