From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefano Brivio Subject: Re: [PATCH RFC net-next] openvswitch: Queue upcalls to userspace in per-port round-robin order Date: Tue, 14 Aug 2018 17:25:16 +0200 Message-ID: <20180814172516.14ec4d5e@epycfail> References: <20180704142342.21740-1-mcroce@redhat.com> <20180731220657.GC29662@ovn.org> <20180803185241.4ac0d1e5@epycfail> <20180803230108.GU29662@ovn.org> <20180804024324.4d900b5e@epycfail> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Ben Pfaff , Matteo Croce , Pravin B Shelar , Justin Pettit , Greg Rose , netdev , "" , Jiri Benc , Aaron Conole , Joe Stringer To: William Tu Return-path: Received: from mx3-rdu2.redhat.com ([66.187.233.73]:50860 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730759AbeHNSNC (ORCPT ); Tue, 14 Aug 2018 14:13:02 -0400 In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: Hi William, On Fri, 10 Aug 2018 07:11:01 -0700 William Tu wrote: > > int rr_select_srcport(struct dp_upcall_info *upcall) > > { > > /* look up source port from upcall->skb... */ > > } > > > > And we could then easily extend this to use BPF with maps one day. > > > > > Hi Stefano, > > If you want to experiment with BPF, Joe and I have some prototype. > We implemented the upcall mechanism using BPF perf event helper function > https://github.com/williamtu/ovs-ebpf/blob/master/bpf/datapath.c#L62 > > And there are threads polling the perf ring buffer to receive packets from > BPF. > https://github.com/williamtu/ovs-ebpf/blob/master/lib/perf-event.c#L232 Interesting, thanks for the pointers! > If I follow the discussion correctly, before upcall, you need to queue > packets based on different configurations (vport/hash/vni/5-tuple/...) > and queue to different buckets when congestion happens. Yes, correct. > In this case, you > probably needs a BPF map to enqueue/dequeue the packet.BPF queue map is > not supported yet, but there is patch available: > [iovisor-dev] [RFC PATCH 1/3] bpf: add bpf queue map > > So how to enqueue and dequeue packets depends on user's BPF implementation. > This allows fairness scheme to be extensible. For the moment being we'll try to ensure that BPF can be plugged there rather easily. I see the advantage, but I'd rather do this as a second step. -- Stefano