]> git.baikalelectronics.ru Git - kernel.git/commit
skb: add some helpers for skb drop reasons
authorMenglong Dong <imagedong@tencent.com>
Wed, 13 Apr 2022 08:15:52 +0000 (16:15 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 13 Apr 2022 12:09:56 +0000 (13:09 +0100)
commit1aa6c9aae6d1c43382521489231403b49e872393
tree4ece9be47269f6bc07b86282f4a82e82c21703b2
parentb8a9e0f95a90f7b8c49521d2d6fe335e54d7d875
skb: add some helpers for skb drop reasons

In order to simply the definition and assignment for
'enum skb_drop_reason', introduce some helpers.

SKB_DR() is used to define a variable of type 'enum skb_drop_reason'
with the 'SKB_DROP_REASON_NOT_SPECIFIED' initial value.

SKB_DR_SET() is used to set the value of the variable. Seems it is
a little useless? But it makes the code shorter.

SKB_DR_OR() is used to set the value of the variable if it is not set
yet, which means its value is SKB_DROP_REASON_NOT_SPECIFIED.

Signed-off-by: Menglong Dong <imagedong@tencent.com>
Reviewed-by: Jiang Biao <benbjiang@tencent.com>
Reviewed-by: Hao Peng <flyingpeng@tencent.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/skbuff.h