mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Eelco Chaudron" <echaudro@redhat.com>
To: "Ilya Maximets" <i.maximets@samsung.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	bpf@vger.kernel.org, "David S. Miller" <davem@davemloft.net>,
	"Björn Töpel" <bjorn.topel@intel.com>,
	"Magnus Karlsson" <magnus.karlsson@intel.com>,
	"Jakub Kicinski" <jakub.kicinski@netronome.com>,
	"Alexei Starovoitov" <ast@kernel.org>,
	"Daniel Borkmann" <daniel@iogearbox.net>,
	"Jeff Kirsher" <jeffrey.t.kirsher@intel.com>,
	intel-wired-lan@lists.osuosl.org,
	"William Tu" <u9012063@gmail.com>,
	"Alexander Duyck" <alexander.duyck@gmail.com>
Subject: Re: [PATCH net v3] ixgbe: fix double clean of tx descriptors with xdp
Date: Fri, 23 Aug 2019 14:10:45 +0200	[thread overview]
Message-ID: <660415CE-6748-4749-84D6-7007F69D8EFB@redhat.com> (raw)
In-Reply-To: <20190822171237.20798-1-i.maximets@samsung.com>



On 22 Aug 2019, at 19:12, Ilya Maximets wrote:

> Tx code doesn't clear the descriptors' status after cleaning.
> So, if the budget is larger than number of used elems in a ring, some
> descriptors will be accounted twice and xsk_umem_complete_tx will move
> prod_tail far beyond the prod_head breaking the completion queue ring.
>
> Fix that by limiting the number of descriptors to clean by the number
> of used descriptors in the tx ring.
>
> 'ixgbe_clean_xdp_tx_irq()' function refactored to look more like
> 'ixgbe_xsk_clean_tx_ring()' since we're allowed to directly use
> 'next_to_clean' and 'next_to_use' indexes.
>
> Fixes: 8221c5eba8c1 ("ixgbe: add AF_XDP zero-copy Tx support")
> Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
> ---
>
> Version 3:
>   * Reverted some refactoring made for v2.
>   * Eliminated 'budget' for tx clean.
>   * prefetch returned.
>
> Version 2:
>   * 'ixgbe_clean_xdp_tx_irq()' refactored to look more like
>     'ixgbe_xsk_clean_tx_ring()'.
>
>  drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c | 29 
> ++++++++------------
>  1 file changed, 11 insertions(+), 18 deletions(-)
>

Did some test with and without the fix applied. For PVP the results are 
a little different depending on the packet size (note this is a single 
run, no deviation).
For the same physical port in and out it’s faster! Note this was OVS 
AF_XDP using a XENA tester at 10G wire speed.


+--------------------------------------------------------------------------------+
| Physical to Virtual to Physical test, L3 flows[port redirect]          
         |
+-----------------+--------------------------------------------------------------+
|                 | Packet size                                          
         |
+-----------------+--------+--------+--------+--------+--------+--------+--------+
| Number of flows |   64   |  128   |  256   |  512   |  768   |  1024  
|  1514  |
+-----------------+--------+--------+--------+--------+--------+--------+--------+
| [NO FIX]   1000 | 739161 | 700091 | 690034 | 659894 | 618128 | 594223 
| 537504 |
+-----------------+--------+--------+--------+--------+--------+--------+--------+
| [FIX]      1000 | 742317 | 708391 | 689952 | 658034 | 626056 | 587653 
| 530885 |
+-----------------+--------+--------+--------+--------+--------+--------+--------+

+--------------------------------------------------------------------------------------+
| Physical loopback test, L3 flows[port redirect]                        
               |
+-----------------+--------------------------------------------------------------------+
|                 | Packet size                                          
               |
+-----------------+---------+---------+---------+---------+---------+---------+--------+
| Number of flows |   64    |   128   |   256   |   512   |   768   |  
1024   |  1514  |
+-----------------+---------+---------+---------+---------+---------+---------+--------+
| [NO FIX]   1000 | 2573298 | 2227578 | 2514318 | 2298204 | 1081861 | 
1015173 | 788081 |
+-----------------+---------+---------+---------+---------+---------+---------+--------+
| [FIX]      1000 | 3343188 | 3234993 | 3151833 | 2349597 | 1586276 | 
1197304 | 814854 |
+-----------------+---------+---------+---------+---------+---------+---------+--------+


Tested-by: Eelco Chaudron <echaudro@redhat.com>

  parent reply	other threads:[~2019-08-23 12:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20190822171243eucas1p12213f2239d6c36be515dade41ed7470b@eucas1p1.samsung.com>
2019-08-22 17:12 ` Ilya Maximets
2019-08-22 17:21   ` Alexander Duyck
2019-08-22 17:32     ` William Tu
2019-08-23  6:10       ` Björn Töpel
2019-08-23 13:19         ` William Tu
2019-08-23 12:10   ` Eelco Chaudron [this message]
2019-08-26 13:40   ` Maciej Fijalkowski
2019-08-27 11:00     ` Ilya Maximets

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=660415CE-6748-4749-84D6-7007F69D8EFB@redhat.com \
    --to=echaudro@redhat.com \
    --cc=alexander.duyck@gmail.com \
    --cc=ast@kernel.org \
    --cc=bjorn.topel@intel.com \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=i.maximets@samsung.com \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=jakub.kicinski@netronome.com \
    --cc=jeffrey.t.kirsher@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=magnus.karlsson@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=u9012063@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®