Re: [PATCH net 2/2] rxrpc: Fix the data_ready handler
From: Eric Dumazet
Date: Fri Oct 05 2018 - 09:52:23 EST
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.