All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yuri Benditovich <yuri.benditovich@daynix.com>
To: "Toke Høiland-Jørgensen" <toke@redhat.com>
Cc: qemu-devel@nongnu.org, Yan Vugenfirer <yan@daynix.com>,
	Jason Wang <jasowang@redhat.com>,
	Andrew Melnychenko <andrew@daynix.com>,
	"Michael S . Tsirkin" <mst@redhat.com>
Subject: Re: [RFC PATCH v2 0/5] eBPF RSS support for virtio-net
Date: Fri, 4 Dec 2020 09:42:22 +0200	[thread overview]
Message-ID: <CAOEp5Oe0AzZ40RK9EjNx0d2RVbteq_cR8zVhQH+_8Wm9x_TQgA@mail.gmail.com> (raw)
In-Reply-To: <87h7p4cmva.fsf@toke.dk>

[-- Attachment #1: Type: text/plain, Size: 3868 bytes --]

On Wed, Dec 2, 2020 at 4:18 PM Toke Høiland-Jørgensen <toke@redhat.com>
wrote:

> Jason Wang <jasowang@redhat.com> writes:
>
> > On 2020/11/19 下午7:13, Andrew Melnychenko wrote:
> >> This set of patches introduces the usage of eBPF for packet steering
> >> and RSS hash calculation:
> >> * RSS(Receive Side Scaling) is used to distribute network packets to
> >> guest virtqueues by calculating packet hash
> >> * Additionally adding support for the usage of RSS with vhost
> >>
> >> The eBPF works on kernels 5.8+
> >> On earlier kerneld it fails to load and the RSS feature is reported
> >> only without vhost and implemented in 'in-qemu' software.
> >>
> >> Implementation notes:
> >> Linux TAP TUNSETSTEERINGEBPF ioctl was used to set the eBPF program.
> >> Added libbpf dependency and eBPF support.
> >> The eBPF program is part of the qemu and presented as an array
> >> of BPF ELF file data.
> >> The compilation of eBPF is not part of QEMU build and can be done
> >> using provided Makefile.ebpf(need to adjust 'linuxhdrs').
> >> Added changes to virtio-net and vhost, primary eBPF RSS is used.
> >> 'in-qemu' RSS used in the case of hash population and as a fallback
> option.
> >> For vhost, the hash population feature is not reported to the guest.
> >>
> >> Please also see the documentation in PATCH 5/5.
> >>
> >> I am sending those patches as RFC to initiate the discussions and get
> >> feedback on the following points:
> >> * Fallback when eBPF is not supported by the kernel
> >> * Live migration to the kernel that doesn't have eBPF support
> >> * Integration with current QEMU build
> >> * Additional usage for eBPF for packet filtering
> >>
> >> Known issues:
> >> * hash population not supported by eBPF RSS: 'in-qemu' RSS used
> >> as a fallback, also, hash population feature is not reported to guests
> >> with vhost.
> >> * big-endian BPF support: for now, eBPF isn't supported on
> >> big-endian systems. Can be added in future if required.
> >> * huge .h file with eBPF binary. The size of .h file containing
> >> eBPF binary is currently ~5K lines, because the binary is built with
> debug information.
> >> The binary without debug/BTF info can't be loaded by libbpf.
> >> We're looking for possibilities to reduce the size of the .h files.
> >
> >
> > Adding Toke for sharing more idea from eBPF side.
> >
> > We had some discussion on the eBPF issues:
> >
> > 1) Whether or not to use libbpf. Toke strongly suggest to use libbpf
> > 2) Whether or not to use BTF. Toke confirmed that if we don't access any
> > skb metadata, BTF is not strictly required for CO-RE. But it might still
> > useful for e.g debugging.
> > 3) About the huge (5K lines, see patch #2 Toke). Toke confirmed that we
> > can strip debug symbols, but Yuri found some sections can't be stripped,
> > we can keep discussing here.
>
> I just tried simply running 'strip' on a sample trivial XDP program,
> which brought its size down from ~5k to ~1k and preserved the BTF
> information without me having to do anything.
>

With our eBPF code the numbers are slightly different:
The code size without BTF: 7.5K (built without '-g')
Built with '-g': 45K
Stripped: 19K
The difference between 7.5 and 19K still seems significant, especially when
we do not use any kernel structures and do not need these BTF sections
This is only reason to prefer non-libbpf option for this specific eBPF



>
> As a side note, though, instead of embedding the BPF program into a .h,
> you could simply ship it as a .o and load it from the file system. We do
> that with xdp-tools and install the bpf object files into /usr/$LIB/bpf/.
>

Yes, we've discussed this option and decided to go with embedding the BPF
https://lists.gnu.org/archive/html/qemu-devel/2020-11/msg02157.html


> -Toke
>
>

[-- Attachment #2: Type: text/html, Size: 5215 bytes --]

  reply	other threads:[~2020-12-04  7:44 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-19 11:13 [RFC PATCH v2 0/5] eBPF RSS support for virtio-net Andrew Melnychenko
2020-11-19 11:13 ` [RFC PATCH v2 1/5] net: Added SetSteeringEBPF method for NetClientState Andrew Melnychenko
2020-11-23  6:10   ` Jason Wang
2020-11-19 11:13 ` [RFC PATCH v2 2/5] ebpf: Added eBPF RSS program Andrew Melnychenko
2020-11-24  8:14   ` Jason Wang
2020-11-19 11:13 ` [RFC PATCH v2 3/5] ebpf: Added eBPF RSS loader Andrew Melnychenko
2020-11-24  8:33   ` Jason Wang
2020-11-19 11:13 ` [RFC PATCH v2 4/5] virtio-net: Added eBPF RSS to virtio-net Andrew Melnychenko
2020-11-24  8:48   ` Jason Wang
2020-12-01  7:40     ` Yuri Benditovich
2020-12-02  4:05       ` Jason Wang
2020-12-02  7:16         ` Yuri Benditovich
2020-12-02  8:06           ` Jason Wang
2020-11-19 11:13 ` [RFC PATCH v2 5/5] docs: Added eBPF documentation Andrew Melnychenko
2020-11-24  8:54   ` Jason Wang
2020-11-26 13:00     ` Yuri Benditovich
2020-11-27  4:36       ` Jason Wang
2020-11-23  6:08 ` [RFC PATCH v2 0/5] eBPF RSS support for virtio-net Jason Wang
2020-11-26 12:52   ` Yuri Benditovich
2020-11-27  4:35     ` Jason Wang
2020-11-27  6:06       ` Yuri Benditovich
2020-11-30  2:54         ` Jason Wang
2020-12-02 13:55 ` Jason Wang
2020-12-02 14:18   ` Toke Høiland-Jørgensen
2020-12-04  7:42     ` Yuri Benditovich [this message]
2020-12-04 10:09       ` Toke Høiland-Jørgensen
2020-12-04 12:31         ` Yuri Benditovich
2020-12-04 13:57           ` Toke Høiland-Jørgensen
2020-12-06 18:44             ` Yuri Benditovich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAOEp5Oe0AzZ40RK9EjNx0d2RVbteq_cR8zVhQH+_8Wm9x_TQgA@mail.gmail.com \
    --to=yuri.benditovich@daynix.com \
    --cc=andrew@daynix.com \
    --cc=jasowang@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=toke@redhat.com \
    --cc=yan@daynix.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.