All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Zhang, Helin" <helin.zhang@intel.com>
To: yingzhi <kaitoy@qq.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: rte_kni_tx_burst() hangs because of no free descriptors
Date: Mon, 24 Oct 2016 03:33:16 +0000	[thread overview]
Message-ID: <F35DEAC7BCE34641BA9FAC6BCA4A12E717F2B137@SHSMSX103.ccr.corp.intel.com> (raw)
In-Reply-To: <tencent_7A3B21E976B640D577D77530@qq.com>

Hi Yingzhi

Thank you for the reporting! The description is not so clear at least for me.
Please help to narrown down the issue by youself.
How many packets would it have for calling TX function?
Why it would return 0 after calling TX function? No memory? Or return from else? Have you found anything?

Regards,
Helin

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of yingzhi
> Sent: Sunday, October 23, 2016 9:30 PM
> To: users; dev@dpdk.org
> Subject: [dpdk-dev] rte_kni_tx_burst() hangs because of no free descriptors
> 
> -
> Hi Experts,
> 
> Background:
> 
> We are using DPDK to develop a LoadBalancer following below logic: When
> a new packet is received:
>  1. if the dst_addr is management IP, forward to KNI. 2. if the dst_addr is in
> VIP list, select backend and forward(modify dst mac address). 3. otherwise
> drop the packet.
> 
> At this stage, we use one single thread for KNI forwarding and another for
> VIP forwarding(forward to eth).
> 
> DPDK version: 16.07
>  NIC: 82599ES 10-Gigabit SFI/SFP+ Network Connection
>  Linux: 14.04.1-Ubuntu x64
> 
> Promblem description:
> 
> The program runs correctly for sometime(around 2 hours for 400Mb traffic).
> But it it will hang. When problem happens, rte_eth_tx_burst() will not able to
> send out any packets(always returns 0). We tracked into that function and
> noticed it is actually calling ixgbe driver's ixgbe_xmit_pkts_vec() function in
> our environment, because we use default tx queue configuration, after
> printing some info, we found if the free function works fine:
>  tx_rs_thresh: 32, tx_free_thresh: 32, nb_tx_free: 31
> 
> it will trigger free and make 32 more free descriptors:
>  tx_rs_thresh: 32, tx_free_thresh: 32, nb_tx_free: 62
> 
> but when something going wrong, it will no longer free anything:
>  tx_rs_thresh: 32, tx_free_thresh: 32, nb_tx_free: 0 tx_rs_thresh: 32,
> tx_free_thresh: 32, nb_tx_free: 0
> 
> It may related with the DD flag of the descriptor but we are not quite sure.
> 
> Our program logic:
> 
> create two mbuf pools on socket 0, one for rx_queue and one for kni. (all
> lcore threads runs on socket0)
> 
> init kni interface with rte_kni_alloc()
> 
> 
> init one NIC interface with
>  rte_eth_dev_configure(); rte_eth_rx_queue_setup();
> rte_eth_tx_queue_setup(); rte_eth_dev_start();
> 
> 
> 
> in the eth main loop: (code is simplified)
>  while(1) {     n = rte_eth_rx_burst(packets);     for (i = 0; i < n; ++i)      {         if
> (SEND_TO_KNI) {             m = rte_kni_tx_burst(packets[i]);             if (m != 1))
> {                 rte_pktmbuf_free(packets[i]);             }         }         if (SEND_TO_ETH)
> {             // after modify the packet             m = rte_eth_tx_burst(packets[i]);
> if (m != 1)) {                 rte_pktmbuf_free(packets[i]);             }         }         //
> otherwise drop the packet         rte_pktmbuf_free(packets[i]);     } }
> 
> 
> Please advise if I'm using DPDK in a wrong way. Sorry if I missed something
> basic, I'm new to DPDK.
> 
> Thanks in advance
>  Best regards

  reply	other threads:[~2016-10-24  3:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-23 13:29 rte_kni_tx_burst() hangs because of no free descriptors =?gb18030?B?eWluZ3poaQ==?=
2016-10-24  3:33 ` Zhang, Helin [this message]
2016-10-24 10:38   ` rte_kni_tx_burst() hangs because of no freedescriptors yingzhi
2016-10-25  1:05     ` Zhang, Helin
2016-10-25  9:20       ` Ananyev, Konstantin

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=F35DEAC7BCE34641BA9FAC6BCA4A12E717F2B137@SHSMSX103.ccr.corp.intel.com \
    --to=helin.zhang@intel.com \
    --cc=dev@dpdk.org \
    --cc=kaitoy@qq.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 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.