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


Reply via email to