All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jesper Dangaard Brouer <brouer@redhat.com>
To: Saeed Mahameed <saeedm@mellanox.com>
Cc: "dsahern@gmail.com" <dsahern@gmail.com>,
	"pstaszewski@itcare.pl" <pstaszewski@itcare.pl>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"yoel@kviknet.dk" <yoel@kviknet.dk>,
	brouer@redhat.com, "John Fastabend" <john.fastabend@gmail.com>,
	"Tariq Toukan" <tariqt@mellanox.com>,
	"Toke Høiland-Jørgensen" <toke@toke.dk>
Subject: Re: Kernel 4.19 network performance - forwarding/routing normal users traffic
Date: Fri, 9 Nov 2018 08:52:49 +0100	[thread overview]
Message-ID: <20181109085249.462d8ce7@redhat.com> (raw)
In-Reply-To: <13d8e510ec3287ac0680dfaa311b10d79353c5e7.camel@mellanox.com>

On Fri, 9 Nov 2018 04:52:01 +0000
Saeed Mahameed <saeedm@mellanox.com> wrote:

> On Thu, 2018-11-08 at 17:42 -0700, David Ahern wrote:
> > On 11/8/18 5:40 PM, Paweł Staszewski wrote:  
> > > 
> > > W dniu 08.11.2018 o 17:32, David Ahern pisze:  
> > > > On 11/8/18 9:27 AM, Paweł Staszewski wrote:  
> > > > > > > What hardware is this?
> > > > > > >   
> > > > > mellanox connectx 4
> > > > > ethtool -i enp175s0f0
> > > > > driver: mlx5_core
> > > > > version: 5.0-0
> > > > > firmware-version: 12.21.1000 (SM_2001000001033)
> > > > > expansion-rom-version:
> > > > > bus-info: 0000:af:00.0
> > > > > supports-statistics: yes
> > > > > supports-test: yes
> > > > > supports-eeprom-access: no
> > > > > supports-register-dump: no
> > > > > supports-priv-flags: yes
> > > > > 
> > > > > ethtool -i enp175s0f1
> > > > > driver: mlx5_core
> > > > > version: 5.0-0
> > > > > firmware-version: 12.21.1000 (SM_2001000001033)
> > > > > expansion-rom-version:
> > > > > bus-info: 0000:af:00.1
> > > > > supports-statistics: yes
> > > > > supports-test: yes
> > > > > supports-eeprom-access: no
> > > > > supports-register-dump: no
> > > > > supports-priv-flags: yes
> > > > >   
> > > > > > > Start with:
> > > > > > > 
> > > > > > > echo 1 > /sys/kernel/debug/tracing/events/xdp/enable
> > > > > > > cat /sys/kernel/debug/tracing/trace_pipe  
> > > > > >   cat /sys/kernel/debug/tracing/trace_pipe
> > > > > >           <idle>-0     [045] ..s. 68469.467752:
> > > > > > xdp_devmap_xmit:
> > > > > > ndo_xdp_xmit map_id=32 map_index=5 action=REDIRECT sent=0
> > > > > > drops=1
> > > > > > from_ifindex=4 to_ifindex=5 err=-6  
> > > > FIB lookup is good, the redirect is happening, but the mlx5
> > > > driver does
> > > > not like it.
> > > > 
> > > > I think the -6 is coming from the mlx5 driver and the packet is
> > > > getting
> > > > dropped. Perhaps this check in mlx5e_xdp_xmit:
> > > > 
> > > >         if (unlikely(sq_num >= priv->channels.num))
> > > >                  return -ENXIO;  
> > > I removed that part and recompiled - but after running now xdp_fwd
> > > i
> > > have kernel pamic :)  
> >   
> 
> hh, no please don't do such thing :)
> 
> It must be because the tx netdev has less tx queues than the rx netdev.
> or the rx netdev rings are bound to a high cpu indexes.
> 
> anyway, best practice is to open #cores RX/TX netdev on both sides
> 
> ethtool -L enp175s0f0  combined $(nproc) 
> ethtool -L enp175s0f1  combined $(nproc)
> 
> > Jesper or one of the Mellanox folks needs to respond about the config
> > needed to run XDP with this NIC. I don't have a 40G or 100G card to
> > play with.  

Saeed already answered with a solution... you need to increase the
number of RX/TX queues to be equal to the number of CPUs.

IHMO this again shows that the resource allocations around ndo_xdp_xmit
needs a better API.  The implicit requirement is that once ndo_xdp_xmit
is enabled the driver MUST allocate for each CPU a dedicated TX for
XDP. It seems for mlx5 that this is a manual process.  And as Pawel
discovered it is hard to troubleshoot and only via tracepoints.

I think we need to do better in this area, both regarding usability and
more graceful handling when the HW doesn't have the resources.  The
original requirement for a XDP-TX queue per CPU was necessary because
the ndo_xdp_xmit was only sending 1-packet at the time.  After my
recent changes, the ndo_xdp_xmit can now send in bulks. Thus,
performance wise it is feasible to use an (array of) locks, if e.g. the
HW cannot allocated more TX-HW queues, or e.g. allow sysadm to set the
mode of operation (if the system as a hole have issues allocating TX
completion IRQs for all these queues).

-- 
Best regards,
  Jesper Dangaard Brouer
  MSc.CS, Principal Kernel Engineer at Red Hat
  LinkedIn: http://www.linkedin.com/in/brouer

  reply	other threads:[~2018-11-09 17:32 UTC|newest]

Thread overview: 77+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-31 21:57 Kernel 4.19 network performance - forwarding/routing normal users traffic Paweł Staszewski
2018-10-31 22:09 ` Eric Dumazet
2018-10-31 22:20   ` Paweł Staszewski
2018-10-31 22:45     ` Paweł Staszewski
2018-11-01  9:22     ` Jesper Dangaard Brouer
2018-11-01 10:34       ` Paweł Staszewski
2018-11-01 15:27       ` Aaron Lu
2018-11-01 20:23         ` Saeed Mahameed
2018-11-02  5:23           ` Aaron Lu
2018-11-02 11:40             ` Jesper Dangaard Brouer
2018-11-02 14:20               ` Aaron Lu
2018-11-02 19:02                 ` Paweł Staszewski
2018-11-03  0:16                   ` Paweł Staszewski
2018-11-03 12:01                     ` Paweł Staszewski
2018-11-03 12:58                     ` Jesper Dangaard Brouer
2018-11-03 15:23                       ` Paweł Staszewski
2018-11-03 15:43                         ` Paweł Staszewski
2018-11-03 12:53                 ` Jesper Dangaard Brouer
2018-11-05  6:28                   ` Aaron Lu
2018-11-05  9:10                     ` Jesper Dangaard Brouer
2018-11-05  8:42                   ` Tariq Toukan
2018-11-05  8:48                     ` Aaron Lu
2018-11-01  3:37 ` David Ahern
2018-11-01 10:55   ` Jesper Dangaard Brouer
2018-11-01 13:52     ` Paweł Staszewski
2018-11-01 17:23       ` David Ahern
2018-11-01 17:30         ` Paweł Staszewski
2018-11-03 17:32           ` David Ahern
2018-11-04  0:24             ` Paweł Staszewski
2018-11-05 20:17               ` Jesper Dangaard Brouer
2018-11-08  0:59                 ` Paweł Staszewski
2018-11-08  1:13                   ` Paweł Staszewski
2018-11-08 14:43                   ` Paweł Staszewski
2018-11-07 21:06               ` David Ahern
2018-11-08 13:33                 ` Paweł Staszewski
2018-11-08 16:06                   ` David Ahern
2018-11-08 16:25                     ` Paweł Staszewski
2018-11-08 16:27                       ` Paweł Staszewski
2018-11-08 16:32                         ` David Ahern
2018-11-08 17:30                           ` Paweł Staszewski
2018-11-08 18:05                             ` David Ahern
2018-11-09  0:40                           ` Paweł Staszewski
2018-11-09  0:42                             ` David Ahern
2018-11-09  4:52                               ` Saeed Mahameed
2018-11-09  7:52                                 ` Jesper Dangaard Brouer [this message]
2018-11-09  9:56                                 ` Paweł Staszewski
2018-11-09 10:20                     ` Paweł Staszewski
2018-11-09 16:21                       ` David Ahern
2018-11-09 19:59                         ` Paweł Staszewski
2018-11-10  0:06                         ` David Ahern
2018-11-10 13:18                           ` Paweł Staszewski
2018-11-10 14:56                             ` David Ahern
2018-11-19 21:59                           ` David Ahern
2018-11-20 23:00                             ` Paweł Staszewski
2018-11-01  9:50 ` Saeed Mahameed
2018-11-01 11:09   ` Paweł Staszewski
2018-11-01 16:49     ` Paweł Staszewski
2018-11-01 20:37     ` Saeed Mahameed
2018-11-01 21:18       ` Paweł Staszewski
2018-11-01 21:24         ` Paweł Staszewski
2018-11-01 21:34           ` Paweł Staszewski
2018-11-03  0:18       ` Paweł Staszewski
2018-11-08 19:12         ` Paweł Staszewski
2018-11-09 22:20           ` Paweł Staszewski
2018-11-10 19:34             ` Jesper Dangaard Brouer
2018-11-10 19:49               ` Paweł Staszewski
2018-11-10 19:56                 ` Paweł Staszewski
2018-11-10 22:06                   ` Jesper Dangaard Brouer
2018-11-10 22:19                     ` Paweł Staszewski
2018-11-11  8:03                       ` Jesper Dangaard Brouer
2018-11-11 10:26                         ` Paweł Staszewski
2018-11-10 20:02               ` Paweł Staszewski
2018-11-10 21:01                 ` Jesper Dangaard Brouer
2018-11-10 21:53                   ` Paweł Staszewski
2018-11-10 22:04                     ` Paweł Staszewski
2018-11-11  8:56                     ` Jesper Dangaard Brouer
2018-11-12 19:19                       ` Paweł Staszewski

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=20181109085249.462d8ce7@redhat.com \
    --to=brouer@redhat.com \
    --cc=dsahern@gmail.com \
    --cc=john.fastabend@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pstaszewski@itcare.pl \
    --cc=saeedm@mellanox.com \
    --cc=tariqt@mellanox.com \
    --cc=toke@toke.dk \
    --cc=yoel@kviknet.dk \
    /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.