From mboxrd@z Thu Jan 1 00:00:00 1970
From: bugzilla@dpdk.org
Subject: [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"
Date: Mon, 25 Feb 2019 03:02:51 +0000
Message-ID:
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
To: dev@dpdk.org
Return-path:
List-Id: DPDK patches and discussions
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
Errors-To: dev-bounces@dpdk.org
Sender: "dev"
https://bugs.dpdk.org/show_bug.cgi?id=3D213
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 droppi=
ng
packets, which is unrecoverable.
---------------------------------------------------------------
=E4=B8=AD=E6=96=87=E7=89=88=EF=BC=9A
=E4=BF=AE=E5=A4=8DKNI=E8=99=9A=E6=8B=9F=E7=BD=91=E5=8D=A1(Net Stack kthread=
)=E4=B8=80=E7=9B=B4=E5=8F=91=E5=8C=85=E4=B8=A2=E5=A4=B1(stats.tx_dropped++)=
=E4=B8=94TX Thread=E8=BE=93=E5=87=BALog "KNI: Out
of memory"=E7=9A=84=E9=97=AE=E9=A2=98
=E5=BD=93KNI=E5=B9=B6=E5=8F=91=E5=8C=85=E9=87=8F=E5=A4=A7=E4=BA=8Erte_kni::=
pktmbuf_pool=E7=9A=84=E5=A4=A7=E5=B0=8F=E6=97=B6=EF=BC=8C=E5=8F=AF=E8=83=BD=
=E5=87=BA=E7=8E=B0fifo->alloc_q=E5=92=8Cfifo->tx_q=E5=90=8C=E6=97=B6=E4=B8=
=BA=E7=A9=BA=EF=BC=8C=E8=BF=99=E6=97=B6=E7=94=B1=E4=BA=8E=E6=B2=A1=E6=9C=89=
=E6=9D=A1=E4=BB=B6=E8=A7=A6=E5=8F=91fifo->alloc_q=E7=9A=84kni_fifo_put=E6=
=96=B9=E6=B3=95=EF=BC=8C=E5=AF=BC=E8=87=B4=E8=99=9A=E6=8B=9F=E7=BD=91=E5=8D=
=A1=E6=B2=A1=E6=9C=89=E5=8F=AF=E7=94=A8=E7=9A=84mbuf=EF=BC=8C=E4=BB=8E=E8=
=80=8C=E5=87=BA=E7=8E=B0=E4=B8=80=E7=9B=B4=E4=B8=A2=E5=8C=85=EF=BC=8C=E5=B9=
=B6=E4=B8=94=E8=AF=A5=E7=8A=B6=E6=80=81=E4=B8=8D=E5=8F=AF=E6=81=A2=E5=A4=8D.
lib/librte_kni/rte_kni_fifo.h =E5=A2=9E=E5=8A=A0=E5=87=BD=E6=95=B0
static inline bool
kni_fifo_empty(struct rte_kni_fifo *fifo)
{
return fifo->write =3D=3D fifo->read;
}
lib/librte_kni/rte_kni.c =E4=BF=AE=E6=94=B9=E5=87=BD=E6=95=B0
unsigned
rte_kni_rx_burst(struct rte_kni *kni, struct rte_mbuf **mbufs, unsigned num)
{
unsigned ret =3D 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;
}
--=20
You are receiving this mail because:
You are the assignee for the bug.=