DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [Bug 55] I40E PMD driver in vector mode implicitly requires number of RX descriptors in a ring to be power of two
@ 2018-05-30 10:50 bugzilla
  0 siblings, 0 replies; only message in thread
From: bugzilla @ 2018-05-30 10:50 UTC (permalink / raw)
  To: dev

https://dpdk.org/tracker/show_bug.cgi?id=55

            Bug ID: 55
           Summary: I40E PMD driver in vector mode implicitly requires
                    number of RX descriptors in a ring to be power of two
           Product: DPDK
           Version: 17.11
          Hardware: x86
                OS: Linux
            Status: CONFIRMED
          Severity: major
          Priority: Normal
         Component: ethdev
          Assignee: dev@dpdk.org
          Reporter: kjeld.mortensen@tieto.com
  Target Milestone: ---

We have experienced instability of the I40E PMD in case it is compiled in
vector mode (CONFIG_RTE_LIBRTE_I40E_INC_VECTOR).

General observation:

We see instability in case we set the number of RX descriptors in a ring buffer
to something which is NOT the power of two.

Debugging was done on 17.11, but code inspection was performed on latest
master.

---
Observation 1, process hang (infinite loop?):

Debugging points to:
_i40e_rx_queue_release_mbufs_vec
http://dpdk.org/browse/dpdk/tree/drivers/net/i40e/i40e_rxtx_vec_common.h#n144

Here the else-part contains a loop which iterates over:
 i = (i + 1) & mask;
The mask is:
 const unsigned mask = rxq->nb_rx_desc - 1;

This suggests that nb_rx_desc assumes a power of two.

---
Observation 2, some RX packets are unexpectedly empty (but we do not have in
depth view in this case):

A more general (quick and incomplete) code inspection of the RX vector part of
the I40E driver source code gave the following finding:

In the procedure _recv_raw_pkts_vec,
http://dpdk.org/browse/dpdk/tree/drivers/net/i40e/i40e_rxtx_vec_sse.c#n453
we have:
  rxq->rx_tail = (uint16_t)(rxq->rx_tail & (rxq->nb_rx_desc - 1));

Again this suggests to me that it is assumed that nb_rx_desc should be a power
of two in the vector case.

---

We certainly understand that one can optimize performance using a power-of-two
assumption about the RX ring buffer size. For example, this seems what the
FM10K driver does:
  15.2.1.1. Prerequisites and Pre-conditions
  http://dpdk.org/doc/guides/nics/fm10k.html
In this case FM10K has documented the "limitation" and also has an explicit
check using the rte_is_power_of_2 procedure in case of vectorization.

Should we have something similar for I40E in vector mode? 

--
Kjeld Mortensen
Tieto

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-05-30 10:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-30 10:50 [dpdk-dev] [Bug 55] I40E PMD driver in vector mode implicitly requires number of RX descriptors in a ring to be power of two bugzilla

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).