mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/
synced 2026-04-17 22:23:45 -04:00
net: remove enum skb_free_reason
enum skb_drop_reason is more generic, we can adopt it instead. Provide dev_kfree_skb_irq_reason() and dev_kfree_skb_any_reason(). This means drivers can use more precise drop reasons if they want to. Signed-off-by: Eric Dumazet <edumazet@google.com> Reviewed-by: Simon Horman <simon.horman@corigine.com> Reviewed-by: Yunsheng Lin <linyunsheng@huawei.com> Link: https://lore.kernel.org/r/20230306204313.10492-1-edumazet@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
committed by
Jakub Kicinski
parent
0194b64578
commit
40bbae583e
@@ -52,6 +52,7 @@
|
||||
#include <linux/rbtree.h>
|
||||
#include <net/net_trackers.h>
|
||||
#include <net/net_debug.h>
|
||||
#include <net/dropreason.h>
|
||||
|
||||
struct netpoll_info;
|
||||
struct device;
|
||||
@@ -3804,13 +3805,8 @@ static inline unsigned int get_netdev_rx_queue_index(
|
||||
|
||||
int netif_get_num_default_rss_queues(void);
|
||||
|
||||
enum skb_free_reason {
|
||||
SKB_REASON_CONSUMED,
|
||||
SKB_REASON_DROPPED,
|
||||
};
|
||||
|
||||
void __dev_kfree_skb_irq(struct sk_buff *skb, enum skb_free_reason reason);
|
||||
void __dev_kfree_skb_any(struct sk_buff *skb, enum skb_free_reason reason);
|
||||
void dev_kfree_skb_irq_reason(struct sk_buff *skb, enum skb_drop_reason reason);
|
||||
void dev_kfree_skb_any_reason(struct sk_buff *skb, enum skb_drop_reason reason);
|
||||
|
||||
/*
|
||||
* It is not allowed to call kfree_skb() or consume_skb() from hardware
|
||||
@@ -3833,22 +3829,22 @@ void __dev_kfree_skb_any(struct sk_buff *skb, enum skb_free_reason reason);
|
||||
*/
|
||||
static inline void dev_kfree_skb_irq(struct sk_buff *skb)
|
||||
{
|
||||
__dev_kfree_skb_irq(skb, SKB_REASON_DROPPED);
|
||||
dev_kfree_skb_irq_reason(skb, SKB_DROP_REASON_NOT_SPECIFIED);
|
||||
}
|
||||
|
||||
static inline void dev_consume_skb_irq(struct sk_buff *skb)
|
||||
{
|
||||
__dev_kfree_skb_irq(skb, SKB_REASON_CONSUMED);
|
||||
dev_kfree_skb_irq_reason(skb, SKB_CONSUMED);
|
||||
}
|
||||
|
||||
static inline void dev_kfree_skb_any(struct sk_buff *skb)
|
||||
{
|
||||
__dev_kfree_skb_any(skb, SKB_REASON_DROPPED);
|
||||
dev_kfree_skb_any_reason(skb, SKB_DROP_REASON_NOT_SPECIFIED);
|
||||
}
|
||||
|
||||
static inline void dev_consume_skb_any(struct sk_buff *skb)
|
||||
{
|
||||
__dev_kfree_skb_any(skb, SKB_REASON_CONSUMED);
|
||||
dev_kfree_skb_any_reason(skb, SKB_CONSUMED);
|
||||
}
|
||||
|
||||
u32 bpf_prog_run_generic_xdp(struct sk_buff *skb, struct xdp_buff *xdp,
|
||||
|
||||
Reference in New Issue
Block a user