From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Dumazet Subject: Re: [RFC PATCH 3/4] udp: implement GRO plain UDP sockets. Date: Fri, 14 Sep 2018 09:48:11 -0700 Message-ID: <1e140072-15f6-755c-28be-61534b243d62@gmail.com> References: <027ebc7d404af07b70f8f9816512b2a485e8f420.1536939423.git.pabeni@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: "David S. Miller" , Willem de Bruijn , Steffen Klassert To: Paolo Abeni , netdev@vger.kernel.org Return-path: Received: from mail-pg1-f194.google.com ([209.85.215.194]:43531 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726900AbeINWDd (ORCPT ); Fri, 14 Sep 2018 18:03:33 -0400 Received: by mail-pg1-f194.google.com with SMTP id v66-v6so4651356pgb.10 for ; Fri, 14 Sep 2018 09:48:15 -0700 (PDT) In-Reply-To: <027ebc7d404af07b70f8f9816512b2a485e8f420.1536939423.git.pabeni@redhat.com> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 09/14/2018 08:43 AM, Paolo Abeni wrote: > This is the RX counter part of commit bec1f6f69736 ("udp: generate gso > with UDP_SEGMENT"). When UDP_SEGMENT is enabled, such socket is also > eligible for GRO in the rx path: UDP segments directed to such socket > are assembled into a larger GSO_UDP_L4 packet. > > The core UDP GRO support is enabled/updated on setsockopt(UDP_SEGMENT) and > disabled, if needed at socket destruction time. > > Initial benchmark numbers: > > Before: > udp rx: 1079 MB/s 769065 calls/s > > After: > udp rx: 1466 MB/s 24877 calls/s Are you sure the data is actually fully copied to user space ? tools/testing/selftests/net/udpgso_bench_rx.c uses : static char rbuf[ETH_DATA_LEN]; /* MSG_TRUNC will make return value full datagram length */ ret = recv(fd, rbuf, len, MSG_TRUNC | MSG_DONTWAIT); So you need to change this program. Also, GRO reception would mean that userspace can retrieve, not only full bytes of X datagrams, but also the gso_size (or length of individual datagrams) You can not know the size of the packets in advance, the sender will decide.