All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ryan Goodfellow <rgoodfel@isi.edu>
To: Maxim Mikityanskiy <maximmi@mellanox.com>
Cc: Magnus Karlsson <magnus.karlsson@gmail.com>,
	"xdp-newbies@vger.kernel.org" <xdp-newbies@vger.kernel.org>,
	Tariq Toukan <tariqt@mellanox.com>,
	Saeed Mahameed <saeedm@mellanox.com>,
	Moshe Shemesh <moshe@mellanox.com>
Subject: Re: zero-copy between interfaces
Date: Thu, 23 Jan 2020 05:43:55 +0800	[thread overview]
Message-ID: <20200122214352.GA13201@smtp.ads.isi.edu> (raw)
In-Reply-To: <4c03813d-5edf-7e9e-8905-31902b5acb71@mellanox.com>

On Tue, Jan 21, 2020 at 01:40:50PM +0000, Maxim Mikityanskiy wrote:
> >> I've posted output from the program in debugging mode here
> >>
> >> - https://gitlab.com/mergetb/tech/network-emulation/kernel/snippets/1930375
> >>
> >> Yes, you are correct in that forwarding works for a brief period and then stops.
> >> I've noticed that the number of packets that are forwarded is equal to the size
> >> of the producer/consumer descriptor rings. I've posted two ping traces from a
> >> client ping that shows this.
> >>
> >> - https://gitlab.com/mergetb/tech/network-emulation/kernel/snippets/1930376
> >> - https://gitlab.com/mergetb/tech/network-emulation/kernel/snippets/1930377
> 
> These snippets are not available.

Apologies, I had the wrong permissions set. They should be available now.

> 
> >>
> >> I've also noticed that when the forwarding stops, the CPU usage for the proc
> >> running the program is pegged, which is not the norm for this program as it uses
> >> a poll call with a timeout on the xsk fd.
> 
> This information led me to a guess what may be happening. On the RX 
> side, mlx5e allocates pages in bulks for performance reasons and to 
> leverage hardware features targeted to performance. In AF_XDP mode, 
> bulking of frames is also used (on x86, the bulk size is 64 with 
> striding RQ enabled, and 8 otherwise, however, it's implementation 
> details that might change later). If you don't put enough frames to XSK 
> Fill Ring, the driver will be demanding more frames and return from 
> poll() immediately. Basically, in the application, you should put as 
> many frames to the Fill Ring as you can. Please check if that could be 
> the root cause of your issue.

The code in this application makes an effort to relenish the fill ring as fast
as possible. The basic loop of the application is to first check if there are
any descriptors to be consumed from the completion queue or any descriptors that
can be added to the fill queue, and only then to move on to moving packets
through the rx and tx rings.

https://gitlab.com/mergetb/tech/network-emulation/kernel/blob/v5.5-moa/samples/bpf/xdpsock_multidev.c#L452-474

> 
> I tracked this issue in our internal bug tracker in case we need to 
> perform actual debugging of mlx5e. I'm looking forward to your feedback 
> on my assumption above.
> 
> >> The hardware I am using is a Mellanox ConnectX4 2x100G card (MCX416A-CCAT)
> >> running the mlx5 driver.
> 
> This one should run without striding RQ, please verify it with ethtool 
> --show-priv-flags (the flag name is rx_striding_rq).

I do not remember changing this option, so whatever the default is, is what it
was running with. I am traveling this week and do not have access to these
systems, but will ensure that this flag is set properly when I get back.

-- 
~ ry

  reply	other threads:[~2020-01-22 21:44 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-13  0:18 zero-copy between interfaces Ryan Goodfellow
2020-01-13  9:16 ` Magnus Karlsson
2020-01-13 10:43   ` Toke Høiland-Jørgensen
2020-01-13 15:25     ` Ryan Goodfellow
2020-01-13 17:09       ` Toke Høiland-Jørgensen
2020-01-14  7:47         ` Magnus Karlsson
2020-01-14  8:11           ` Toke Høiland-Jørgensen
2020-01-13 15:11   ` Ryan Goodfellow
2020-01-14  9:59     ` Magnus Karlsson
2020-01-14 20:52       ` Ryan Goodfellow
2020-01-15  1:41         ` Ryan Goodfellow
2020-01-15  7:40           ` Magnus Karlsson
2020-01-15  8:20             ` Magnus Karlsson
2020-01-16  2:04               ` Ryan Goodfellow
2020-01-16 14:32                 ` Magnus Karlsson
2020-01-17  9:45                   ` Magnus Karlsson
2020-01-17 17:05                     ` Ryan Goodfellow
2020-01-21  7:34                 ` Magnus Karlsson
2020-01-21 13:40                   ` Maxim Mikityanskiy
2020-01-22 21:43                     ` Ryan Goodfellow [this message]
2020-01-27 14:01                       ` Maxim Mikityanskiy
2020-01-27 15:54                         ` Magnus Karlsson
2020-01-30  9:37                           ` Maxim Mikityanskiy
2020-01-30  9:59                             ` Magnus Karlsson
2020-01-30 11:40                               ` Magnus Karlsson
2020-02-04 16:10                                 ` Magnus Karlsson
2020-02-05 13:31                                   ` Magnus Karlsson
2020-02-06 14:56                                     ` Maxim Mikityanskiy
2020-02-07  9:01                                       ` Magnus Karlsson
2020-01-17 17:40         ` William Tu
2020-01-13 11:41 ` Jesper Dangaard Brouer
2020-01-13 15:28   ` Ryan Goodfellow
2020-01-13 17:04     ` Jesper Dangaard Brouer
2020-01-17 17:54       ` Ryan Goodfellow
2020-01-18 10:14         ` Jesper Dangaard Brouer
2020-01-18 14:08           ` Ryan Goodfellow
2020-01-26  4:53             ` Dan Siemon
2020-01-17 12:32 ` Björn Töpel
2020-01-17 12:32   ` [Intel-wired-lan] " =?unknown-8bit?q?Bj=C3=B6rn_T=C3=B6pel?=
2020-01-17 17:16   ` Ryan Goodfellow
2020-01-17 17:16     ` [Intel-wired-lan] " Ryan Goodfellow
2020-01-17 18:10     ` Ryan Goodfellow
2020-01-17 18:10       ` [Intel-wired-lan] " Ryan Goodfellow
2020-01-20  8:24     ` Magnus Karlsson
2020-01-20  8:24       ` [Intel-wired-lan] " Magnus Karlsson
2020-01-20 18:33       ` Ryan Goodfellow
2020-01-20 18:33         ` [Intel-wired-lan] " Ryan Goodfellow
2020-01-20 17:04     ` Björn Töpel
2020-01-20 17:04       ` [Intel-wired-lan] " =?unknown-8bit?q?Bj=C3=B6rn_T=C3=B6pel?=

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=20200122214352.GA13201@smtp.ads.isi.edu \
    --to=rgoodfel@isi.edu \
    --cc=magnus.karlsson@gmail.com \
    --cc=maximmi@mellanox.com \
    --cc=moshe@mellanox.com \
    --cc=saeedm@mellanox.com \
    --cc=tariqt@mellanox.com \
    --cc=xdp-newbies@vger.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.