From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Dumazet Subject: Re: [PATCH net 2/2] rxrpc: Fix the data_ready handler Date: Fri, 5 Oct 2018 06:52:17 -0700 Message-ID: References: <153874697684.18195.15264114363303320691.stgit@warthog.procyon.org.uk> <153874699086.18195.6819270943388841145.stgit@warthog.procyon.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: linux-afs@lists.infradead.org, linux-kernel@vger.kernel.org To: David Howells , netdev@vger.kernel.org Return-path: In-Reply-To: <153874699086.18195.6819270943388841145.stgit@warthog.procyon.org.uk> Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org On 10/05/2018 06:43 AM, David Howells wrote: > Fix the rxrpc_data_ready() function to pick up all packets and to not miss > any. There are two problems: > > + for (;;) { > + skb = skb_recv_udp(udp_sk, 0, 1, &ret); > + if (!skb) { > + if (ret == -EAGAIN) > + return; > + > + /* If there was a transmission failure, we get an error > + * here that we need to ignore. > + */ > + _debug("UDP socket error %d", ret); > + continue; > + } > + > + rxrpc_new_skb(skb, rxrpc_skb_rx_received); > + > + /* we'll probably need to checksum it (didn't call sock_recvmsg) */ > + if (skb_checksum_complete(skb)) { > + rxrpc_free_skb(skb, rxrpc_skb_rx_freed); > + __UDP_INC_STATS(sock_net(udp_sk), UDP_MIB_INERRORS, 0); > + _debug("csum failed"); > + continue; > + } > + > + __UDP_INC_STATS(sock_net(udp_sk), UDP_MIB_INDATAGRAMS, 0); > + > + rxrpc_input_packet(udp_sk, skb); > + } > +} This looks a potential infinite loop to me ? If not, please add a comment explaining why there is no apparent limit.