From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by dpdk.org (Postfix, from userid 33) id 695C3292D; Mon, 25 Feb 2019 04:02:51 +0100 (CET) From: bugzilla@dpdk.org To: dev@dpdk.org Date: Mon, 25 Feb 2019 03:02:51 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: DPDK X-Bugzilla-Component: core X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: willkozheng@tencent.com X-Bugzilla-Status: CONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: Normal X-Bugzilla-Assigned-To: dev@dpdk.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.dpdk.org/ Auto-Submitted: auto-generated X-Auto-Response-Suppress: All MIME-Version: 1.0 Subject: [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" X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Feb 2019 03:02:51 -0000 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.=