From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [PATCH net] udp: fix rx queue len reported by diag and proc interface Date: Fri, 08 Jun 2018 19:56:12 -0400 (EDT) Message-ID: <20180608.195612.853677913346832499.davem@davemloft.net> References: <6189b60449cb3ab524db8e91acd6be8d01ba887c.1528450183.git.pabeni@redhat.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, edumazet@google.com, trevor.francis@46labs.com To: pabeni@redhat.com Return-path: Received: from shards.monkeyblade.net ([184.105.139.130]:49970 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752624AbeFHX4N (ORCPT ); Fri, 8 Jun 2018 19:56:13 -0400 In-Reply-To: <6189b60449cb3ab524db8e91acd6be8d01ba887c.1528450183.git.pabeni@redhat.com> Sender: netdev-owner@vger.kernel.org List-ID: From: Paolo Abeni Date: Fri, 8 Jun 2018 11:35:40 +0200 > After commit 6b229cf77d68 ("udp: add batching to udp_rmem_release()") > the sk_rmem_alloc field does not measure exactly anymore the > receive queue length, because we batch the rmem release. The issue > is really apparent only after commit 0d4a6608f68c ("udp: do rmem bulk > free even if the rx sk queue is empty"): the user space can easily > check for an empty socket with not-0 queue length reported by the 'ss' > tool or the procfs interface. > > We need to use a custom UDP helper to report the correct queue length, > taking into account the forward allocation deficit. > > Reported-by: trevor.francis@46labs.com > Fixes: 6b229cf77d68 ("UDP: add batching to udp_rmem_release()") > Signed-off-by: Paolo Abeni Applied and queued up for -stable, thanks.