[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <4ae7be9a32d3cd277f2b4a64211b51a3509da6f7.camel@gmail.com>
Date: Sat, 29 Dec 2018 13:26:34 -0500
From: Radu Rendec <radu.rendec@...il.com>
To: netdev@...r.kernel.org
Subject: skb_cow() vs skb_cow_head() - what exactly is "header"?
Hello,
I'm working on some application-specific NIC driver. On the TX path, it
must remove a custom tag that sits between the Ethernet type field and
the actual Ethernet payload; then it must add a different tag in front
of the Ethernet header (the MAC DA field) before it hands over the frame
to the hardware for delivery.
I'm wondering if skb_cow_head() is enough to safely modify the skb as
described above, or I should use skb_cow() instead. I've been going
through the skbuff code and I still can't figure out the difference.
Comment blocks around the definitions of skb_cow(), skb_cow_head() and
SKB_DATAREF_SHIFT mention a "header" part and a "payload" part of the
skb, but it's still unclear to me which is what. As far as I understand,
there is only "data" and it sits between the headroom and tailroom. If
the skb is fragmented, additional data is stored in separate pages (in
frags[]) or skbs (in frag_list).
Last but not least, is there any *recent* documentation that explains
the subtleties of skbs? Most of the documentation I could find is very
old and/or covers only the basic concepts, such as head/data/tail/end.
Thank you in advance,
Radu Rendec
Powered by blists - more mailing lists