Back to home page

OSCL-LXR

 
 

    


0001 .. SPDX-License-Identifier: GPL-2.0
0002 
0003 ================================
0004 TC Actions - Environmental Rules
0005 ================================
0006 
0007 
0008 The "environmental" rules for authors of any new tc actions are:
0009 
0010 1) If you stealeth or borroweth any packet thou shalt be branching
0011    from the righteous path and thou shalt cloneth.
0012 
0013    For example if your action queues a packet to be processed later,
0014    or intentionally branches by redirecting a packet, then you need to
0015    clone the packet.
0016 
0017 2) If you munge any packet thou shalt call pskb_expand_head in the case
0018    someone else is referencing the skb. After that you "own" the skb.
0019 
0020 3) Dropping packets you don't own is a no-no. You simply return
0021    TC_ACT_SHOT to the caller and they will drop it.
0022 
0023 The "environmental" rules for callers of actions (qdiscs etc) are:
0024 
0025 #) Thou art responsible for freeing anything returned as being
0026    TC_ACT_SHOT/STOLEN/QUEUED. If none of TC_ACT_SHOT/STOLEN/QUEUED is
0027    returned, then all is great and you don't need to do anything.
0028 
0029 Post on netdev if something is unclear.