DPDK patches and discussions
 help / color / mirror / Atom feed
From: Yongseok Koh <yskoh@mellanox.com>
To: Amedeo Sapio <amedeo.sapio@gmail.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] MLX5 driver - number of descriptors overflow
Date: Sun, 25 Nov 2018 23:40:29 +0000	[thread overview]
Message-ID: <9BCD342E-D258-4D6E-B80A-E990574437B7@mellanox.com> (raw)
In-Reply-To: <CAMkTTJPkjXtctwm9JhgbmBFVDNMr15pwg4WkS9qHy68KDGk+UQ@mail.gmail.com>

> On Nov 21, 2018, at 1:01 AM, Amedeo Sapio <amedeo.sapio@gmail.com> wrote:
> 
> Hello,
> 
> I experienced a problem with the MLX5 driver running a code that is working
> fine with an Intel card. I have found that the reason of this error is an
> overflow of the uint16_t number of descriptors in the mlx driver.
> 
> Here the details:
> 
> - The NIC is a Mellanox ConnectX-5 100G.
> 
> - This is a summary code that I run to initialize the port:
> 
>        ret = rte_eth_dev_configure(dpdk_par.portid, 1, 1, &port_conf);
> 
>        dpdk_par.port_rx_ring_size = dev_info.rx_desc_lim.nb_max;
>        dpdk_par.port_tx_ring_size = dev_info.tx_desc_lim.nb_max;
> 
>        ret = rte_eth_dev_adjust_nb_rx_tx_desc(dpdk_par.portid,
> &dpdk_par.port_rx_ring_size, &dpdk_par.port_tx_ring_size);
> 
>        ret = rte_eth_rx_queue_setup(dpdk_par.portid, 0,
> dpdk_par.port_rx_ring_size, rte_eth_dev_socket_id(dpdk_par.portid),
> &rx_conf, dpdk_data.pool);
>        ret = rte_eth_tx_queue_setup(dpdk_par.portid, 0,
> dpdk_par.port_tx_ring_size, rte_eth_dev_socket_id(dpdk_par.portid),
> &tx_conf);
> 
>        ret = rte_eth_dev_start(dpdk_par.portid);
> 
> - The "rte_eth_dev_start" function returns  -ENOMEM  =  -12 (Out of memory)
> 
> - I see that "dev_info.rx_desc_lim.nb_max" is 65535.  This value is rounded
> to the next power of 2 in "mlx5_rx_queue_setup",  which overflows and
> becomes 0.
> 
> I thought that  "rte_eth_dev_adjust_nb_rx_tx_desc" should have adjusted the
> value, but clearly it has not.

Nice catch! You are right. We should've set it appropriately.
Will come up with a patch. Meanwhile, can you please use a workaround?, e.g.,

rte_log2_u32(rte_align32prevpow2(dev_info.rx_desc_lim.nb_max));

Will let you know when we push a patch.

Thanks,
Yongseok

      reply	other threads:[~2018-11-25 23:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-21  9:01 Amedeo Sapio
2018-11-25 23:40 ` Yongseok Koh [this message]

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=9BCD342E-D258-4D6E-B80A-E990574437B7@mellanox.com \
    --to=yskoh@mellanox.com \
    --cc=amedeo.sapio@gmail.com \
    --cc=dev@dpdk.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 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).