linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net/packet: Improve the comment about LL header visibility criteria
@ 2021-02-05 22:41 Xie He
  2021-02-06  2:51 ` Willem de Bruijn
  0 siblings, 1 reply; 5+ messages in thread
From: Xie He @ 2021-02-05 22:41 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski, Willem de Bruijn, Eric Dumazet,
	John Ogness, Tanner Love, Eyal Birger, netdev, linux-kernel
  Cc: Xie He

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 <xie.he.0141@gmail.com>
---
 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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-02-07  0:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-05 22:41 [PATCH net-next] net/packet: Improve the comment about LL header visibility criteria Xie He
2021-02-06  2:51 ` Willem de Bruijn
2021-02-06 15:42   ` Eyal Birger
2021-02-06 19:29     ` Xie He
2021-02-07  0:57   ` Jakub Kicinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).