Re: Impact of hardware offloads on network stack performance

Mikkel Fahnøe Jørgensen <mikkelfj@gmail.com> Thu, 10 May 2018 13:31 UTC

Return-Path: <mikkelfj@gmail.com>
X-Original-To: quic@ietfa.amsl.com
Delivered-To: quic@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 25F3312D969 for <quic@ietfa.amsl.com>; Thu, 10 May 2018 06:31:02 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.697
X-Spam-Level:
X-Spam-Status: No, score=-2.697 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001, UNPARSEABLE_RELAY=0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UdhhDC432Yhp for <quic@ietfa.amsl.com>; Thu, 10 May 2018 06:30:59 -0700 (PDT)
Received: from mail-io0-x233.google.com (mail-io0-x233.google.com [IPv6:2607:f8b0:4001:c06::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id E34F812DA19 for <quic@ietf.org>; Thu, 10 May 2018 06:30:57 -0700 (PDT)
Received: by mail-io0-x233.google.com with SMTP id t23-v6so2980085ioc.10 for <quic@ietf.org>; Thu, 10 May 2018 06:30:57 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:in-reply-to:references:mime-version:date:message-id:subject:to :cc; bh=kJU9Iej97Itqjb3+nUwU/OCR0ZTdISGuNND0WVECUHo=; b=pao5+ZYsHG7BaXf2LLtrJ7YatClL1zwNTe4QR2KlbDPK95VbWTwkej74xKiJXBH+7I yfH2/xuQVj6mxxFz5caWjnw+SbC5Vf3DPRWkIMzyVV9DgLksIJ9AnK8nutj70jOqDPFE bVhbLTeRJicUX6ka3w7DX5gadsOdxu/tcjuVqX5wy4aT05YPMvpyxhdo+eVl2hWze+uv FCjIqlAyj+xooDhfK6KLOIuzodbsMW7df2aIYHLuLvj+bx92tLFPgOV77u/Q8VYMTWkt GNZ2nlO1L6FOPRGm3h/ohd72HP6Td8qacumgZ67nQk5K2o/ZI0cC2W4PGgjeuiwFUZm8 yYXw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:in-reply-to:references:mime-version:date :message-id:subject:to:cc; bh=kJU9Iej97Itqjb3+nUwU/OCR0ZTdISGuNND0WVECUHo=; b=Xt4gVI9bS/nSiuJIjToOjhw1XzCF4AGjAmEaOg9SekXRPB1FtegF7kpJ2RC+WuIRrY rgwVKhavLcD8Zj/Sv7YBoYJFdlxpJRyTc5l1lDYYKcK/mib2yCHST1JqbH7gNw+/SQsa Zpb8SFHZNccfyNNHY7E3CKGlErcGBrCaj6Ypz72hGY6ZSQQNps1gIzpxu4QA3ddqdOh3 Jcew+3tzqYerkUO0ddmCvsP/wGU3g1B/NvPilE5sEqHKQ0JTvPh6w19JAgsLd+YuO2GA cbm32/jMMJ9KXEDt2Op6ES8NLU5WHc2XEW6p52p6gMRCG62RbFAWU0s0wnLVhIwn1BHR +70Q==
X-Gm-Message-State: ALKqPwc5+OyJnZXdZxmlFeLYjrk9KUbmy7uv7KWbb0+nO8ZBLq0UGGuu G+S+634nxky/BWSYVkPovmi11sl9NgMzXN+mJMg=
X-Google-Smtp-Source: AB8JxZo9k3V5JZIbnEpen5rR8ohU0jfNPz66Dp8AhRp7KBUbj3INzOwZvMUIYfS4o7sc/bVsAowEE1TryNsStSZcP5o=
X-Received: by 2002:a6b:39d4:: with SMTP id g203-v6mr1548325ioa.165.1525959057186; Thu, 10 May 2018 06:30:57 -0700 (PDT)
Received: from 1058052472880 named unknown by gmailapi.google.com with HTTPREST; Thu, 10 May 2018 06:30:56 -0700
From: Mikkel Fahnøe Jørgensen <mikkelfj@gmail.com>
In-Reply-To: <CAK-1kemWAW+2Sk5aKJ+RXKUAyjFii4MRH=xK7SE0mr=tbCiRfw@mail.gmail.com>
References: <CY4PR21MB0630CE4DE6BA4EDF54A1FEB1B6A40@CY4PR21MB0630.namprd21.prod.outlook.com> <CAN1APde93+S8CP-KcZmqPKCCvsGRiq6ECPUoh_Qk0j9hqs8h0Q@mail.gmail.com> <SN1PR08MB1854E64D7C370BF0A7456977DABB0@SN1PR08MB1854.namprd08.prod.outlook.com> <CAKcm_gNhsHxXM77FjRj-Wh4JxA21NAWKXX3KBT=eZJsCdacM7Q@mail.gmail.com> <DB6PR10MB1766789B25E31EBE70564BD3ACBA0@DB6PR10MB1766.EURPRD10.PROD.OUTLOOK.COM> <SN1PR08MB18548155722C665FFD45CC4DDABA0@SN1PR08MB1854.namprd08.prod.outlook.com> <CAKcm_gMYf6AbHgvg+WKv-woQCtzz9WztiEDf-iRUjKw63Qx=9Q@mail.gmail.com> <1F436ED13A22A246A59CA374CBC543998B60C7AD@ORSMSX111.amr.corp.intel.com> <CAN1APdc3y0EwFqeYVvZs7MtBHhS_9CzwGmcwRqi_6GHWzF3_2Q@mail.gmail.com> <1F436ED13A22A246A59CA374CBC543998B60C851@ORSMSX111.amr.corp.intel.com> <CAN1APdcPkO-HfXqqvjeee6K8U8KSZQdtx=6fW1vZo+H6pKfzzQ@mail.gmail.com> <CAKcm_gP8TRPT7yi1y=mU5Fvq7xB5-1ieyKFLQMPomfabYbkcxA@mail.gmail.com> <bf540ec1f6f045aca1cf2379380630b5@usma1ex-dag1mb5.msg.corp.akamai.com> <SN1PR08MB185446750FCDA2B58C9833C8DA890@SN1PR08MB1854.namprd08.prod.outlook.com> <CACsn0cmJcAxORo4Cd-qyGJL3ZOT5Yz0WgdMqv_AGi4DjedyzFA@mail.gmail.com> <A6F55755-D7E1-40E4-8EC3-D5FE77A2EDBE@fb.com> <CAK-1kemWAW+2Sk5aKJ+RXKUAyjFii4MRH=xK7SE0mr=tbCiRfw@mail.gmail.com>
X-Mailer: Airmail (420)
MIME-Version: 1.0
Date: Thu, 10 May 2018 06:30:56 -0700
Message-ID: <CAN1APddgX6=CxKdUA718=95EeCUPS60vVxbGFDHa7-eRjw7BxA@mail.gmail.com>
Subject: Re: Impact of hardware offloads on network stack performance
To: craigt <c@gryning.com>, Roberto Peon <fenix@fb.com>
Cc: IETF QUIC WG <quic@ietf.org>, Mike Bishop <mbishop@evequefou.be>, Ian Swett <ianswett=40google.com@dmarc.ietf.org>, "Deval, Manasi" <manasi.deval@intel.com>, Watson Ladd <watsonbladd@gmail.com>, "Lubashev, Igor" <ilubashe@akamai.com>, Praveen Balasubramanian <pravb@microsoft.com>
Content-Type: multipart/alternative; boundary="0000000000008ba6e8056bda07e1"
Archived-At: <https://mailarchive.ietf.org/arch/msg/quic/sKVpvo3WFdGB9hYKqVxrm-Anppg>
X-BeenThere: quic@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: Main mailing list of the IETF QUIC working group <quic.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/quic>, <mailto:quic-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/quic/>
List-Post: <mailto:quic@ietf.org>
List-Help: <mailto:quic-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/quic>, <mailto:quic-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 10 May 2018 13:31:02 -0000

Thanks for the pointer.

I doubt you will see similar gains (92%) in UDP because there is going to
be a lot of kernel context switches, one for each packet vis sendmsg.
Copying is probably not the dominating factor here.

I do wish there was an easier way to use the netmap interface without
kernel patches and without taking over the entire network card, e.g. by
binding netmap to a single UDP port.

https://www.unix.com/man-page/freebsd/4/netmap/

Mikkel

On 10 May 2018 at 14.50.13, craigt (c@gryning.com) wrote:

Has anyone experimented with the zerocopy socket interfaces for exactly
this use case?
  https://netdevconf.org/2.1/papers/netdev.pdf

It would seem that is a more natural fit to the assertions made by several
of the authors surrounding packetisation.
I'm unaware if Windows/BSD have similar interfaces/implementations.

c


On 30 April 2018 at 21:37, Roberto Peon <fenix@fb.com> wrote:

> QUIC (mostly) doesn’t do that (rexmit a packet verbatim)—you’d need a new
> packet# for the rexmitted packet.
>
> -=R
>
>
>
> *From:* QUIC <quic-bounces@ietf.org> on behalf of Watson Ladd <
> watsonbladd@gmail.com>
> *Date:* Monday, April 23, 2018 at 1:56 PM
> *To:* Mike Bishop <mbishop@evequefou.be>
> *Cc:* Praveen Balasubramanian <pravb@microsoft.com>, "Lubashev, Igor" <
> ilubashe@akamai.com>, Ian Swett <ianswett=40google.com@dmarc.ietf.org>,
> Mikkel Fahnøe Jørgensen <mikkelfj@gmail.com>, IETF QUIC WG <quic@ietf.org>,
> "Deval, Manasi" <manasi.deval@intel.com>
> *Subject:* Re: Impact of hardware offloads on network stack performance
>
>
>
>
>
>
>
> On Mon, Apr 23, 2018 at 1:06 PM, Mike Bishop <mbishop@evequefou.be> wrote:
>
> I agree – the point of offloading the crypto is not only to spare that
> cost on the CPU, though that can be useful, it’s to enable further offloads
> that can’t be done on the encrypted packet.
>
>
>
> LRO that could simply group packets by CID and deliver a single batch of
> packets from a single CID in a single invocation seems like a great first
> step, and doesn’t even require crypto offload.  Once you have crypto
> offload, of course those packets per CID could be delivered already
> decrypted.  I’d want to see data on whether there’s value in making the
> received data look like one huge packet when there’s not a single
> bytestream, but that’s not something we need to specify here.
>
>
>
> LSO is more interesting, and the challenge there is that the transport
> stack still needs to know what data was in which packet so that it can do
> loss recovery properly.  QUIC explicitly disallows fragmentation of the UDP
> datagram, for the “painful and potentially non-deterministic” reasons you
> referenced.
>
>
>
> Forgive my complete ignorance, but doesn't it just need to know what
> packet it sent?
>
> More explicitly the sender would maintain a queue of sendable packets, and
> mark which have been sent. Acknowledged packets are removed from the queue.
> In event of loss, they simply retransmit the same packet. It's up to higher
> layers to pick the right size of packet and take data from the individual
> QUIC streams. If you wanted to expose the stream structure, that sounds a
> lot more complicated.
>
>
> Sincerely,
>
> Watson
>
>
>
>
>