DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [Bug 213] Fix the problem of KNI device (Net Stack kthread) keeps dropping packets (stats.tx_dropped++) and TX thread logs "KNI: Out of memory"
@ 2019-02-25  3:02 bugzilla
  0 siblings, 0 replies; only message in thread
From: bugzilla @ 2019-02-25  3:02 UTC (permalink / raw)
  To: dev

https://bugs.dpdk.org/show_bug.cgi?id=213

            Bug ID: 213
           Summary: Fix the problem of KNI device (Net Stack kthread)
                    keeps dropping packets (stats.tx_dropped++) and TX
                    thread logs "KNI: Out of memory"
           Product: DPDK
           Version: unspecified
          Hardware: All
                OS: All
            Status: CONFIRMED
          Severity: normal
          Priority: Normal
         Component: core
          Assignee: dev@dpdk.org
          Reporter: willkozheng@tencent.com
  Target Milestone: ---

When the number of concurrent packets is greater than the size of
rte_kni::pktmbuf_pool, it may fall into a situation that both fifo->alloc_q and
fifo->tx_q are empty, in which there is no condition to trigger kni_fifo_put
for fifo->alloc_q, resulting in no available mbuf for KNI device and dropping
packets, which is unrecoverable.
---------------------------------------------------------------
中文版:
修复KNI虚拟网卡(Net Stack kthread)一直发包丢失(stats.tx_dropped++)且TX Thread输出Log "KNI: Out
of memory"的问题
当KNI并发包量大于rte_kni::pktmbuf_pool的大小时,可能出现fifo->alloc_q和fifo->tx_q同时为空,这时由于没有条件触发fifo->alloc_q的kni_fifo_put方法,导致虚拟网卡没有可用的mbuf,从而出现一直丢包,并且该状态不可恢复.

lib/librte_kni/rte_kni_fifo.h 增加函数
static inline bool
kni_fifo_empty(struct rte_kni_fifo *fifo)
{
        return fifo->write == fifo->read;
}

lib/librte_kni/rte_kni.c 修改函数
unsigned
rte_kni_rx_burst(struct rte_kni *kni, struct rte_mbuf **mbufs, unsigned num)
{
        unsigned ret = kni_fifo_get(kni->tx_q, (void **)mbufs, num);

        /* If buffers removed, allocate mbufs and then put them into alloc_q */
        if (ret)
                kni_allocate_mbufs(kni);
        else if (unlikely(kni_fifo_empty(kni->alloc_q))) { //add by Willko, on
alloc_q is empty, try allocate mbuf
                kni_allocate_mbufs(kni);
        }

        return ret;
}

-- 
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:[~2019-02-25  3:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-25  3:02 [dpdk-dev] [Bug 213] Fix the problem of KNI device (Net Stack kthread) keeps dropping packets (stats.tx_dropped++) and TX thread logs "KNI: Out of memory" 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).