patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: wangyunjian <wangyunjian@huawei.com>
Cc: stable@dpdk.org, dpdk-dev <dev@dpdk.org>,
	Ferruh Yigit <ferruh.yigit@intel.com>,
	gowrishankar.m@linux.vnet.ibm.com, dingxiaoxiong@huawei.com,
	dpdk stable <stable@dpdk.org>, Cheng Liu <liucheng11@huawei.com>,
	Ajit Khaparde <ajit.khaparde@broadcom.com>
Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH v3] kni: fix mbuf allocation for alloc FIFO
Date: Thu, 24 Jun 2021 09:43:09 +0200	[thread overview]
Message-ID: <7665074.qKJ98HmJnh@thomas> (raw)
In-Reply-To: <CACZ4nhtHgmLPa0MBwHS+TO4u1C9153OKQ2khoVUmy7=9hy47AA@mail.gmail.com>

24/06/2021 03:55, Ajit Khaparde:
> On Tue, Jun 22, 2021 at 5:44 AM wangyunjian <wangyunjian@huawei.com> wrote:
> >
> > From: Yunjian Wang <wangyunjian@huawei.com>
> >
> > In kni_allocate_mbufs(), we alloc mbuf for alloc_q as this code.
> > allocq_free = (kni->alloc_q->read - kni->alloc_q->write - 1) \
> >                 & (MAX_MBUF_BURST_NUM - 1);
> > The value of allocq_free maybe zero, for example :
> > The ring size is 1024. After init, write = read = 0. Then we fill
> > kni->alloc_q to full. At this time, write = 1023, read = 0.
> >
> > Then the kernel send 32 packets to userspace. At this time, write
> > = 1023, read = 32. And then the userspace receive this 32 packets.
> > Then fill the kni->alloc_q, (32 - 1023 - 1) & 31 = 0, fill nothing.
> > ...
> > Then the kernel send 32 packets to userspace. At this time, write
> > = 1023, read = 992. And then the userspace receive this 32 packets.
> > Then fill the kni->alloc_q, (992 - 1023 - 1) & 31 = 0, fill nothing.
> >
> > Then the kernel send 32 packets to userspace. The kni->alloc_q only
> > has 31 mbufs and will drop one packet.
> >
> > Absolutely, this is a special scene. Normally, it will fill some
> > mbufs everytime, but may not enough for the kernel to use.
> >
> > In this patch, we always keep the kni->alloc_q to full for the kernel
> > to use.
> >
> > Fixes: 49da4e82cf94 ("kni: allocate no more mbuf than empty slots in queue")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Cheng Liu <liucheng11@huawei.com>
> > Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
> > Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
> Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>

Applied, thanks





      reply	other threads:[~2021-06-24  7:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4ebfe0d38b335a437edc9c58368153d005f562ce.1622460655.git.wangyunjian@huawei.com>
2021-06-22 10:57 ` [dpdk-stable] [PATCH v2] kni: fix wrong mbuf alloc count in kni_allocate_mbufs wangyunjian
2021-06-22 12:27   ` Ferruh Yigit
2021-06-22 12:32     ` wangyunjian
2021-06-22 12:44   ` [dpdk-stable] [dpdk-dev] [PATCH v3] kni: fix mbuf allocation for alloc FIFO wangyunjian
2021-06-22 20:46     ` Thomas Monjalon
2021-06-23 12:16       ` wangyunjian
2021-06-23 14:11         ` Ferruh Yigit
2021-06-23 14:41           ` Thomas Monjalon
2021-06-24  1:55     ` Ajit Khaparde
2021-06-24  7:43       ` Thomas Monjalon [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=7665074.qKJ98HmJnh@thomas \
    --to=thomas@monjalon.net \
    --cc=ajit.khaparde@broadcom.com \
    --cc=dev@dpdk.org \
    --cc=dingxiaoxiong@huawei.com \
    --cc=ferruh.yigit@intel.com \
    --cc=gowrishankar.m@linux.vnet.ibm.com \
    --cc=liucheng11@huawei.com \
    --cc=stable@dpdk.org \
    --cc=wangyunjian@huawei.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 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).