@@ -415,6 +415,11 @@ enum skb_drop_reason {
* failed (maybe an eBPF program
* is tricking?)
*/
+ SKB_DROP_REASON_PTYPE_ABSENT, /* no packet_type found to handle
+ * the skb. For an etner packet,
+ * this means that L3 protocol is
+ * not supported
+ */
SKB_DROP_REASON_MAX,
};
@@ -48,6 +48,7 @@
EM(SKB_DROP_REASON_CPU_BACKLOG, CPU_BACKLOG) \
EM(SKB_DROP_REASON_XDP, XDP) \
EM(SKB_DROP_REASON_QDISC_INGRESS, QDISC_INGRESS) \
+ EM(SKB_DROP_REASON_PTYPE_ABSENT, PTYPE_ABSENT) \
EMe(SKB_DROP_REASON_MAX, MAX)
#undef EM
@@ -5323,11 +5323,13 @@ static int __netif_receive_skb_core(struct sk_buff **pskb, bool pfmemalloc,
*ppt_prev = pt_prev;
} else {
drop:
- if (!deliver_exact)
+ if (!deliver_exact) {
atomic_long_inc(&skb->dev->rx_dropped);
- else
+ kfree_skb_reason(skb, SKB_DROP_REASON_PTYPE_ABSENT);
+ } else {
atomic_long_inc(&skb->dev->rx_nohandler);
- kfree_skb(skb);
+ kfree_skb(skb);
+ }
/* Jamal, now you will not able to escape explaining
* me how you were going to use this. :-)
*/