From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EDB6DC388F7 for ; Thu, 5 Nov 2020 22:16:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7DD1320756 for ; Thu, 5 Nov 2020 22:16:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604614568; bh=imUVBYp5M4wmbLeT+9vciE49oS3Kkp42AlSUoxHmZhk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:List-ID:From; b=bpZszA86W75SC2eoAK5HrGmjOcyIW4yymiz4nbfFwLvkyYo3cehdRn88w+wmTPpRQ jx+GbS4MnH4QsUnKz59Mh5hhRPMfxvQbkdDdknv5804Y6PXmwewiufzr3t5byebtRp 5b5AhGhPkfpHLZsTvxpwDqXDDGWHBUDEAb9Jhe/A= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732643AbgKEWQH (ORCPT ); Thu, 5 Nov 2020 17:16:07 -0500 Received: from mail.kernel.org ([198.145.29.99]:36286 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731508AbgKEWQH (ORCPT ); Thu, 5 Nov 2020 17:16:07 -0500 Received: from kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com (unknown [163.114.132.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1109E20735; Thu, 5 Nov 2020 22:16:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604614566; bh=imUVBYp5M4wmbLeT+9vciE49oS3Kkp42AlSUoxHmZhk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=VaJUVC2N2nUyV5925zEvK9jTWTGCpvlU1B0Vi/qCSuzJGlipDyRr1nXj11CqWWtea JsgkIA+VtMpZOSrKLvXhYoqKYBo3fEBkGTnxvv8tNQ5Rck4+1n6x4tLjCOt5xIemWJ rK25gTTc+/T3jYUPZV4eOobiMOQQh2EaSzL8ndDM= Date: Thu, 5 Nov 2020 14:16:05 -0800 From: Jakub Kicinski To: menglong8.dong@gmail.com Cc: kuznet@ms2.inr.ac.ru, yoshfuji@linux-ipv6.org, davem@davemloft.net, ycheng@google.com, ncardwell@google.com, priyarjha@google.com, edumazet@google.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Menglong Dong Subject: Re: [PATCH net-next] net: udp: introduce UDP_MIB_MEMERRORS for udp_mem Message-ID: <20201105141605.06b936f3@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> In-Reply-To: <1604560572-18582-1-git-send-email-dong.menglong@zte.com.cn> References: <1604560572-18582-1-git-send-email-dong.menglong@zte.com.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 5 Nov 2020 02:16:11 -0500 menglong8.dong@gmail.com wrote: > From: Menglong Dong > > When udp_memory_allocated is at the limit, __udp_enqueue_schedule_skb > will return a -ENOBUFS, and skb will be dropped in __udp_queue_rcv_skb > without any counters being done. It's hard to find out what happened > once this happen. > > So we introduce a UDP_MIB_MEMERRORS to do this job. Well, this change > looks friendly to the existing users, such as netstat: > > $ netstat -u -s > Udp: > 0 packets received > 639 packets to unknown port received. > 158689 packet receive errors > 180022 packets sent > RcvbufErrors: 20930 > MemErrors: 137759 > UdpLite: > IpExt: > InOctets: 257426235 > OutOctets: 257460598 > InNoECTPkts: 181177 > > Signed-off-by: Menglong Dong Please CC Paolo since he have you feedback on v1 and Willem de Bruijn . > diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c > index 09f0a23d1a01..aa1bd53dd9f9 100644 > --- a/net/ipv4/udp.c > +++ b/net/ipv4/udp.c > @@ -2038,6 +2038,9 @@ static int __udp_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) > if (rc == -ENOMEM) > UDP_INC_STATS(sock_net(sk), UDP_MIB_RCVBUFERRORS, > is_udplite); > + else > + UDP_INC_STATS(sock_net(sk), UDP_MIB_MEMERRORS, > + is_udplite); The alignment of the line above is off, just ignore it and align the new code correctly so that checkpatch does not complain.