From: Willem de Bruijn <willemdebruijn.kernel@gmail•com>
To: Kshitiz Bartariya <kshitiz.bartariya@zohomail•in>,
netdev@vger•kernel.org
Cc: Willem de Bruijn <willemdebruijn.kernel@gmail•com>,
"David S . Miller" <davem@davemloft•net>,
David Ahern <dsahern@kernel•org>,
Eric Dumazet <edumazet@google•com>,
Jakub Kicinski <kuba@kernel•org>,
Paolo Abeni <pabeni@redhat•com>,
Simon Horman <horms@kernel•org>,
Kshitiz Bartariya <kshitiz.bartariya@zohomail•in>,
mahdifrmx@gmail•com
Subject: Re: [PATCH net-next] __udp_enqueue_schedule_skb() drops packets when there is no buffer space available, but currently does not update UDP SNMP counters.
Date: Wed, 07 Jan 2026 10:44:00 -0500 [thread overview]
Message-ID: <willemdebruijn.kernel.368719d33bc5@gmail.com> (raw)
In-Reply-To: <20260107141541.1985-1-kshitiz.bartariya@zohomail.in>
Kshitiz Bartariya wrote:
> Update UDP_MIB_MEMERRORS and UDP_MIB_INERRORS when packets are dropped
> due to memory pressure, for both UDP and UDPLite sockets.
>
> This removes a long-standing TODO and makes UDP statistics consistent
> with actual drop behavior.
>
> Signed-off-by: Kshitiz Bartariya <kshitiz.bartariya@zohomail•in>
This is addressing the same open TODO as the patch under review
https://lore.kernel.org/netdev/20260105114732.140719-1-mahdifrmx@gmail.com/
It does so in the single basic block, as suggested here
https://lore.kernel.org/netdev/willemdebruijn.kernel.21c4d3b7b8f9d@gmail.com/
But these updates are expensive, so better to batch them as in the
other patch.
> ---
> net/ipv4/udp.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
> index 9c87067c74bc..66c06f468240 100644
> --- a/net/ipv4/udp.c
> +++ b/net/ipv4/udp.c
> @@ -1794,11 +1794,16 @@ int __udp_enqueue_schedule_skb(struct sock *sk, struct sk_buff *skb)
> }
>
> if (unlikely(to_drop)) {
> + const bool is_udplite = IS_UDPLITE(sk);
> +
> for (nb = 0; to_drop != NULL; nb++) {
> skb = to_drop;
> to_drop = skb->next;
> skb_mark_not_on_list(skb);
> - /* TODO: update SNMP values. */
> +
> + UDP_INC_STATS(sock_net(sk), UDP_MIB_MEMERRORS, is_udplite);
> + UDP_INC_STATS(sock_net(sk), UDP_MIB_INERRORS, is_udplite);
> +
> sk_skb_reason_drop(sk, skb, SKB_DROP_REASON_PROTO_MEM);
> }
> numa_drop_add(&udp_sk(sk)->drop_counters, nb);
> --
> 2.50.1 (Apple Git-155)
>
prev parent reply other threads:[~2026-01-07 15:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-07 14:15 [PATCH net-next] __udp_enqueue_schedule_skb() drops packets when there is no buffer space available, but currently does not update UDP SNMP counters Kshitiz Bartariya
2026-01-07 15:44 ` Willem de Bruijn [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=willemdebruijn.kernel.368719d33bc5@gmail.com \
--to=willemdebruijn.kernel@gmail$(echo .)com \
--cc=davem@davemloft$(echo .)net \
--cc=dsahern@kernel$(echo .)org \
--cc=edumazet@google$(echo .)com \
--cc=horms@kernel$(echo .)org \
--cc=kshitiz.bartariya@zohomail$(echo .)in \
--cc=kuba@kernel$(echo .)org \
--cc=mahdifrmx@gmail$(echo .)com \
--cc=netdev@vger$(echo .)kernel.org \
--cc=pabeni@redhat$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox