All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jürgen Groß" <jgross@suse.com>
To: Denis Kirjanov <kda@linux-powerpc.org>, paul@xen.org
Cc: netdev@vger.kernel.org, brouer@redhat.com, wei.liu@kernel.org,
	ilias.apalodimas@linaro.org
Subject: Re: [PATCH net-next v9 1/2] xen networking: add basic XDP support for xen-netfront
Date: Tue, 12 May 2020 06:22:20 +0200	[thread overview]
Message-ID: <62f29aba-93d5-9a7d-a4ac-7fae1ac46f22@suse.com> (raw)
In-Reply-To: <CAOJe8K29vn6TK8t7g7j387F41ig-9yY-jT-k=mVpDQW3xmDPSg@mail.gmail.com>

On 11.05.20 19:27, Denis Kirjanov wrote:
> On 5/11/20, Jürgen Groß <jgross@suse.com> wrote:
>> On 11.05.20 12:22, Denis Kirjanov wrote:
>>> The patch adds a basic XDP processing to xen-netfront driver.
>>>
>>> We ran an XDP program for an RX response received from netback
>>> driver. Also we request xen-netback to adjust data offset for
>>> bpf_xdp_adjust_head() header space for custom headers.
>>>
>>> synchronization between frontend and backend parts is done
>>> by using xenbus state switching:
>>> Reconfiguring -> Reconfigured- > Connected
>>>
>>> UDP packets drop rate using xdp program is around 310 kpps
>>> using ./pktgen_sample04_many_flows.sh and 160 kpps without the patch.
>>
>> I'm still not seeing proper synchronization between frontend and
>> backend when an XDP program is activated.
>>
>> Consider the following:
>>
>> 1. XDP program is not active, so RX responses have no XDP headroom
>> 2. netback has pushed one (or more) RX responses to the ring page
>> 3. XDP program is being activated -> Reconfiguring
>> 4. netback acknowledges, will add XDP headroom for following RX
>>      responses
>> 5. netfront reads RX response (2.) without XDP headroom from ring page
>> 6. boom!
> 
> One thing that could be easily done is to set the offset on  xen-netback side
> in  xenvif_rx_data_slot().  Are you okay with that?

How does this help in above case?

I think you haven't understood the problem I'm seeing.

There can be many RX responses in the ring page which haven't been
consumed by the frontend yet. You are doing the switch to XDP via a
different communication channel (Xenstore), so you need some way to
synchronize both communication channels.

Either you make sure you have read all RX responses before doing the
switch (this requires stopping netback to push out more RX responses),
or you need to have a flag in the RX responses indicating whether XDP
headroom is provided or not (requires an addition to the Xen netif
protocol). Or I'm completely wrong and this can not happen due to the
way XDP programs work, but you didn't provide any clear statement this
being the case.


Juergen

  reply	other threads:[~2020-05-12  4:22 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-11 10:22 [PATCH net-next v9 0/2] xen networking: add XDP support to xen-netfront Denis Kirjanov
2020-05-11 10:22 ` [PATCH net-next v9 1/2] xen networking: add basic XDP support for xen-netfront Denis Kirjanov
2020-05-11 12:05   ` Jürgen Groß
2020-05-11 17:27     ` Denis Kirjanov
2020-05-12  4:22       ` Jürgen Groß [this message]
2020-05-12 12:27         ` Denis Kirjanov
2020-05-12 12:41           ` Jürgen Groß
2020-05-12 13:21             ` Denis Kirjanov
2020-05-12 13:38               ` Jürgen Groß
2020-05-11 20:27   ` David Miller
2020-05-11 10:22 ` [PATCH net-next v9 2/2] xen networking: add XDP offset adjustment to xen-netback Denis Kirjanov
2020-05-11 11:33   ` Paul Durrant
2020-05-11 12:11     ` Denis Kirjanov
2020-05-11 12:14       ` Paul Durrant
2020-05-11 17:21         ` Denis Kirjanov
2020-05-12  7:26           ` Paul Durrant
2020-05-12 12:20             ` Denis Kirjanov

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=62f29aba-93d5-9a7d-a4ac-7fae1ac46f22@suse.com \
    --to=jgross@suse.com \
    --cc=brouer@redhat.com \
    --cc=ilias.apalodimas@linaro.org \
    --cc=kda@linux-powerpc.org \
    --cc=netdev@vger.kernel.org \
    --cc=paul@xen.org \
    --cc=wei.liu@kernel.org \
    /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.