lkml.org 
[lkml]   [2022]   [Feb]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
SubjectRe: [PATCH net-next 2/3] net: neigh: use kfree_skb_reason() for __neigh_event_send()
From
On 2/20/22 8:57 AM, menglong8.dong@gmail.com wrote:
> diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
> index c310a4a8fc86..206b66f5ce6b 100644
> --- a/include/linux/skbuff.h
> +++ b/include/linux/skbuff.h
> @@ -393,6 +393,15 @@ enum skb_drop_reason {
> * see the doc for disable_ipv6
> * in ip-sysctl.rst for detail
> */
> + SKB_DROP_REASON_NEIGH_FAILED, /* dropped as the state of
> + * neighbour is NUD_FAILED
> + */

/* neigh entry in failed state */

> + SKB_DROP_REASON_NEIGH_QUEUEFULL, /* the skbs that waiting
> + * for sending on the queue
> + * of neigh->arp_queue is
> + * full, and the skbs on the
> + * tail will be dropped
> + */

/* arp_queue for neigh entry is full */


> diff --git a/net/core/neighbour.c b/net/core/neighbour.c
> index ec0bf737b076..c353834e8fa9 100644
> --- a/net/core/neighbour.c
> +++ b/net/core/neighbour.c
> @@ -1171,7 +1171,7 @@ int __neigh_event_send(struct neighbour *neigh, struct sk_buff *skb,
> neigh->updated = jiffies;
> write_unlock_bh(&neigh->lock);
>
> - kfree_skb(skb);
> + kfree_skb_reason(skb, SKB_DROP_REASON_NEIGH_FAILED);
> return 1;
> }
> } else if (neigh->nud_state & NUD_STALE) {
> @@ -1193,7 +1193,7 @@ int __neigh_event_send(struct neighbour *neigh, struct sk_buff *skb,
> if (!buff)
> break;
> neigh->arp_queue_len_bytes -= buff->truesize;
> - kfree_skb(buff);
> + kfree_skb_reason(buff, SKB_DROP_REASON_NEIGH_QUEUEFULL);
> NEIGH_CACHE_STAT_INC(neigh->tbl, unres_discards);
> }
> skb_dst_force(skb);

what about out_dead: path? the tracepoint there shows that path is of
interest.

\
 
 \ /
  Last update: 2022-02-22 04:19    [W:0.123 / U:2.132 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site