From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6FDF2C432C0 for ; Wed, 27 Nov 2019 20:32:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3A0C320863 for ; Wed, 27 Nov 2019 20:32:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="QI6P18/0" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727031AbfK0Uc3 (ORCPT ); Wed, 27 Nov 2019 15:32:29 -0500 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:41014 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726716AbfK0Uc3 (ORCPT ); Wed, 27 Nov 2019 15:32:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574886747; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zH/T5jU4tH/8Gb+1qmuFB+rSdeHGBSoJ0BA6rM2mcnc=; b=QI6P18/0EFlhmIfxZ1f28+WFDxYoza2zUMV6uIAKu7T51E2q7GTghZrrmt4JC53A4zRnCV rCu99afZRm+Y/FXl3lVeinV7jp3xNNiZzvUiTJg8avfEZDOJevuEmMp3VaemLXIwJ7SJUx gJd2+NjonuRUbYP37aHW9Sa4UKRbaQ4= Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-316-yEoK46rZPvauW_h7hCor1Q-1; Wed, 27 Nov 2019 15:32:25 -0500 Received: by mail-qv1-f69.google.com with SMTP id a4so9437938qvn.14 for ; Wed, 27 Nov 2019 12:32:25 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=7MY+sx+Nuv189evu6jc/7Ff6+j+qSUxD3qsuDjudl3E=; b=HxOqDBzuR2o1N0K8tyqEOnEXPO32LK7a/l9+jrIJp0zfd/O/Whc1JuPSSlk4H4iPmD qHUQ+KvGBb2wkT/YUZTzp4ks3tQzi2s0E6Y4GubHA8pvIN1O4KJjFQQsAn6VtCQAh4q/ qkw+6QLz9RrcHhz72I6kihkpltGMvgZ+4wBEIAyvQWfaIeG99KjU+e4tFHs6d0rx0US6 mnf0qdqzO8P9amBa3TT3fj2ryJXNPFsklp2JVDhME408778grFYzZ0AJq0dLeIlA0WzE SKUlTWoJ2QFrLUJjK+Ryms7IIEIsL/8ZbKWDXv1vUFxi9wmUSo9osoQ2sLEdatjF3UIl Q88w== X-Gm-Message-State: APjAAAWeB1eXGDw6w41g+ytdawmwAJojtS+gAttL486bTqoO4adTVRnI hZ7IEN2aOwDEuWa3nnAz5R0RqFWKC7UI7Cx2/U9zV4NEARVvdZDbEFyVTvN9rJQrWBiZqkykLYf P1EwHYyUDC15p X-Received: by 2002:ad4:55e8:: with SMTP id bu8mr3198579qvb.61.1574886745491; Wed, 27 Nov 2019 12:32:25 -0800 (PST) X-Google-Smtp-Source: APXvYqzOaXOFxvrAACGTJt/FeYHy85AqcOBKnTlQND1DqS/Jm+RE0uTl1tA+4+iDEbGw4t6w2fwm7A== X-Received: by 2002:ad4:55e8:: with SMTP id bu8mr3198538qvb.61.1574886745141; Wed, 27 Nov 2019 12:32:25 -0800 (PST) Received: from redhat.com (bzq-79-181-48-215.red.bezeqint.net. [79.181.48.215]) by smtp.gmail.com with ESMTPSA id o70sm7418083qke.47.2019.11.27.12.32.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Nov 2019 12:32:24 -0800 (PST) Date: Wed, 27 Nov 2019 15:32:17 -0500 From: "Michael S. Tsirkin" To: Jakub Kicinski Cc: Prashant Bhole , "David S . Miller" , Jason Wang , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , Martin KaFai Lau , Song Liu , Yonghong Song , Andrii Nakryiko , netdev@vger.kernel.org, qemu-devel@nongnu.org, kvm@vger.kernel.org Subject: Re: [RFC net-next 00/18] virtio_net XDP offload Message-ID: <20191127152653-mutt-send-email-mst@kernel.org> References: <20191126100744.5083-1-prashantbhole.linux@gmail.com> <20191126123514.3bdf6d6f@cakuba.netronome.com> MIME-Version: 1.0 In-Reply-To: <20191126123514.3bdf6d6f@cakuba.netronome.com> X-MC-Unique: yEoK46rZPvauW_h7hCor1Q-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Tue, Nov 26, 2019 at 12:35:14PM -0800, Jakub Kicinski wrote: > On Tue, 26 Nov 2019 19:07:26 +0900, Prashant Bhole wrote: > > Note: This RFC has been sent to netdev as well as qemu-devel lists > >=20 > > This series introduces XDP offloading from virtio_net. It is based on > > the following work by Jason Wang: > > https://netdevconf.info/0x13/session.html?xdp-offload-with-virtio-net > >=20 > > Current XDP performance in virtio-net is far from what we can achieve > > on host. Several major factors cause the difference: > > - Cost of virtualization > > - Cost of virtio (populating virtqueue and context switching) > > - Cost of vhost, it needs more optimization > > - Cost of data copy > > Because of above reasons there is a need of offloading XDP program to > > host. This set is an attempt to implement XDP offload from the guest. >=20 > This turns the guest kernel into a uAPI proxy. >=20 > BPF uAPI calls related to the "offloaded" BPF objects are forwarded=20 > to the hypervisor, they pop up in QEMU which makes the requested call > to the hypervisor kernel. Today it's the Linux kernel tomorrow it may=20 > be someone's proprietary "SmartNIC" implementation. >=20 > Why can't those calls be forwarded at the higher layer? Why do they > have to go through the guest kernel? Well everyone is writing these programs and attaching them to NICs. For better or worse that's how userspace is written. Yes, in the simple case where everything is passed through, it could instead be passed through some other channel just as well, but then userspace would need significant changes just to make it work with virtio. > If kernel performs no significant work (or "adds value", pardon the > expression), and problem can easily be solved otherwise we shouldn't=20 > do the work of maintaining the mechanism. >=20 > The approach of kernel generating actual machine code which is then > loaded into a sandbox on the hypervisor/SmartNIC is another story. But that's transparent to guest userspace. Making userspace care whether it's a SmartNIC or a software device breaks part of virtualization's appeal, which is that it looks like a hardware box to the guest. > I'd appreciate if others could chime in.