blob: f37814693ad31e381fc01d4a1878ba3490cb6d57 [file] [log] [blame]
Jamal Hadi Salimd892afe2007-10-26 02:49:09 -07001
Lucas De Marchi25985ed2011-03-30 22:57:33 -03002The "environmental" rules for authors of any new tc actions are:
Jamal Hadi Salimd892afe2007-10-26 02:49:09 -07003
41) If you stealeth or borroweth any packet thou shalt be branching
5from the righteous path and thou shalt cloneth.
6
Matt LaPlanted9195882008-07-25 19:45:33 -07007For example if your action queues a packet to be processed later,
8or intentionally branches by redirecting a packet, then you need to
Jamal Hadi Salimd892afe2007-10-26 02:49:09 -07009clone the packet.
Matt LaPlanted9195882008-07-25 19:45:33 -070010
Jamal Hadi Salimd892afe2007-10-26 02:49:09 -0700112) If you munge any packet thou shalt call pskb_expand_head in the case
12someone else is referencing the skb. After that you "own" the skb.
Jamal Hadi Salimd892afe2007-10-26 02:49:09 -070013
Matt LaPlanted9195882008-07-25 19:45:33 -0700143) Dropping packets you don't own is a no-no. You simply return
Jamal Hadi Salimd892afe2007-10-26 02:49:09 -070015TC_ACT_SHOT to the caller and they will drop it.
16
Lucas De Marchi25985ed2011-03-30 22:57:33 -030017The "environmental" rules for callers of actions (qdiscs etc) are:
Jamal Hadi Salimd892afe2007-10-26 02:49:09 -070018
Matt LaPlanted9195882008-07-25 19:45:33 -070019*) Thou art responsible for freeing anything returned as being
Jamal Hadi Salimd892afe2007-10-26 02:49:09 -070020TC_ACT_SHOT/STOLEN/QUEUED. If none of TC_ACT_SHOT/STOLEN/QUEUED is
Matt LaPlanted9195882008-07-25 19:45:33 -070021returned, then all is great and you don't need to do anything.
Jamal Hadi Salimd892afe2007-10-26 02:49:09 -070022
23Post on netdev if something is unclear.
24