Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2445541pxb; Fri, 5 Feb 2021 19:29:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJwnI7DSUN0CHD2336EKJujNbnCjeoZKJYZxu69MsT1nyqLitOFnF0CJaumo9/5/QMI6FBbA X-Received: by 2002:a17:906:1d0f:: with SMTP id n15mr6723264ejh.26.1612582186390; Fri, 05 Feb 2021 19:29:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612582186; cv=none; d=google.com; s=arc-20160816; b=C0I27df+U6OAoM4r4KJGPsUsNEvMfPvG3SWOIHje2u4zjomJnCULJImu7E/Az3r7RQ uQLYo42NR9t6GOcUNrHQZTd8Bz1/uCxqh87AounPDzWDuLjFtl7ewPKKXlv1quNVRxgF O1CT6VYNsGzJF92HVctoW+mKyC3jNXYrP1OjIE5tteNaXjfcoxmuGam5g3GrYe/hd7uM qIbSWxy9Jh8DVWPYpw5Oiu9+/vzNBueFtdj85jwdEvOItQzo4SzA8igFnCeI3GIrZ5nQ mpT90fMi9MNhCzYtMNZXCKthCPmO5+BH0QUvMc2KKPjCyvf3j5KORwrvrsw34EXnAljF JZKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=FwjcqJWWNcSXw2VIILl7w2i/g+DKyP5+Y7qQ/2dsy3Y=; b=BjAIfeMgc0K1StjSA7BG/ZpUhzLcFtChECxa36CwxsZGZgxqE2cqJKJV3/pxQowlWz BRyTOaLF+jZ/dVZ4EbZfdatfK6pv1N7XH33CwF+C0/vw/k7u+f+F3NxWyIxPa7u+pyVC Rn08BtyxQ5szJ2mxiubR4paoqNihqq1ch8DgT2F12i+keL/+G7j/U75T8gERX3XCF8Ll 1J/AuquQH2pnPwbtZaogBdMIVsjpMIk8HDMG5RTFqQowtltuWcw3fDHV3UkSnZaHUX4y 5xBvqVW70CFWCTewFoxmRmGg1zDI+WspfnpQbfH84mbGf/s/o8SCwW/M6Eu8nf4DNG+2 Nuew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="C5k/72Va"; 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 l23si6081959ejx.701.2021.02.05.19.29.21; Fri, 05 Feb 2021 19:29:46 -0800 (PST) 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="C5k/72Va"; 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 S232571AbhBFD0Q (ORCPT + 99 others); Fri, 5 Feb 2021 22:26:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231492AbhBFCnX (ORCPT ); Fri, 5 Feb 2021 21:43:23 -0500 Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com [IPv6:2607:f8b0:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 61103C0698CE; Fri, 5 Feb 2021 14:42:09 -0800 (PST) Received: by mail-pf1-x42a.google.com with SMTP id 18so3138186pfz.3; Fri, 05 Feb 2021 14:42:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=FwjcqJWWNcSXw2VIILl7w2i/g+DKyP5+Y7qQ/2dsy3Y=; b=C5k/72VaWxTYXyZABzbANvSq7XAPEorMLLNUKVWpBjewJ0/nNvm+LWaLOiohGp0ovm ydq/loPXlxbvHTL1shzzb08YlKvgpXHwTWOwbNvY9ea9Lz5aWjWVGhPe5YDV/Rds/lju cI2J85gWqlV8tlSZ73j/V3ulnwzlup5MdQG/QCYwzhdNdJDBwLOigLPH/tXOtcg0zbwR /ZXynTDDFBhICZr8++j9brg05NXzWmiegj9La0PuQ83gwZPzK8O8vsjAsp1+/XFgHuDa eEzttF2NnvzLPXLesD0FhxHGBRsh9LbT95mgvJFPWZZlkOvauqvq7kefG/HC5J0bNpUt oM/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=FwjcqJWWNcSXw2VIILl7w2i/g+DKyP5+Y7qQ/2dsy3Y=; b=phzt6x4qM4BMQ5gzigrhkLs2x1kKnFrls/ln86453N7KGYndUQRoNwj7upoP8BGW2Q LwbU+Mtx3q8TXM3t3wWjBlWJwFr1Ebqv2bTqeSz1PrJxUUMAdcXf9iZb1T/qufhA9V+8 wNwWVmEcPc59oz7uSShRr7WgzpvYOdNFho/vRir75ukPwkBk7IVnHiTsB+f6G97WDlnE jaY9sR9SZvTp1ZXS3uz5WE1fV56GZvxWDR623MaSNpdbeRLiV2PpUVE68mwSd8CIasZD G1IFhCIApY8DKlBMU4h6nttU4BgSi5+h9L2lCu1LI5SJi8115jJ0FMhd2gbiJFBXA9ZK 1BtA== X-Gm-Message-State: AOAM5338iNal9yj2gla3uMAjbG9l0azJfKXyWlDgJg23YkMrFKE+tozD DUoax7SRyJ7Gf16x154IqnASR7RS9E8= X-Received: by 2002:a63:c54c:: with SMTP id g12mr6230188pgd.449.1612564929004; Fri, 05 Feb 2021 14:42:09 -0800 (PST) Received: from shane-XPS-13-9380.hsd1.ca.comcast.net ([2601:646:8800:1c00:b867:f7ba:cb49:e834]) by smtp.gmail.com with ESMTPSA id j9sm9194982pjn.32.2021.02.05.14.42.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 14:42:08 -0800 (PST) From: Xie He To: "David S. Miller" , Jakub Kicinski , Willem de Bruijn , Eric Dumazet , John Ogness , Tanner Love , Eyal Birger , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Xie He Subject: [PATCH net-next] net/packet: Improve the comment about LL header visibility criteria Date: Fri, 5 Feb 2021 14:41:24 -0800 Message-Id: <20210205224124.21345-1-xie.he.0141@gmail.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- net/packet/af_packet.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index 6bbc7a448593..e24b2841c643 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c @@ -132,17 +132,17 @@ Resume because it is invisible to us. On transmit: ------------ -dev->header_ops != NULL +dev_has_header(dev) == true mac_header -> ll header data -> ll header -dev->header_ops == NULL (ll header is invisible to us) +dev_has_header(dev) == false (ll header is invisible to us) mac_header -> data data -> data We should set network_header on output to the correct position, packet classifier depends on it. */ -- 2.27.0