DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Min Hu (Connor)" <humin29@huawei.com>
To: "Sanford, Robert" <rsanford@akamai.com>,
	Robert Sanford <rsanford2@gmail.com>,
	"dev@dpdk.org" <dev@dpdk.org>
Cc: "chas3@att.com" <chas3@att.com>
Subject: Re: [PATCH 3/7] net/bonding: change mbuf pool and ring allocation
Date: Wed, 22 Dec 2021 11:25:41 +0800	[thread overview]
Message-ID: <da28bf35-35b7-8fd4-1a66-8d2747d75e93@huawei.com> (raw)
In-Reply-To: <0E88B690-87AD-44A6-BCFA-22F342911E03@akamai.com>



在 2021/12/21 23:31, Sanford, Robert 写道:
> Hi Connor,
> 
> On 12/20/21, 9:03 PM, "Min Hu (Connor)" <humin29@huawei.com> wrote:
> 
>> Hi, Sanford,
> 
>>> There is *NO* benefit for the consumer thread (interrupt thread
>>> executing tx_machine()) to have caches on per-slave LACPDU pools.
>>> The interrupt thread is a control thread, i.e., a non-EAL thread.
>>> Its lcore_id is LCORE_ID_ANY, so it has no "default cache" in any
>>> mempool.
>> Well, sorry, I forgot that interrupt thread is non-EAL thread.
> 
> No problem. (I added a temporary rte_log statement in tx_machine
> to make sure lcore_id == LCORE_ID_ANY.)
> 
>>> There is little or no benefit for active data-plane threads to have
>>> caches on per-slave LACPDU pools, because on each pool, the producer
>>> thread puts back, at most, one mbuf per second. There is not much
>>> contention with the consumer (interrupt thread).
>>>
>>> I contend that caches are not necessary for these private LACPDU
>> I agree with you.
> 
> Thanks.
> 
>>> I believe there is a mistake in the ring comments (in 3 places).
>>> It would be better if they replace "free" with "full":
>>> "... to differentiate a *full* ring from an empty ring."
>>>
>> Well, I still can not understand it. I think the ring size is N, it
>> should store N items, why "N - 1" items.?
>> Hope for your description, thanks.
> 
> Here is an excellent article that describes ring buffers, empty vs full, N-1, etc.
> https://embedjournal.com/implementing-circular-buffer-embedded-c/#the-full-vs-empty-problem
> 
Thanks Sanford, I see. It is characteristics of ring queues which is
different with common queue, like buffers.
> 
>>>> To fix the bug, how about just setting the flags "RING_F_EXACT_SZ"
>>>
>>> Yes, this is a good idea. I will look for examples or test code that
>>> use this flag.
>> Yes, if fixed, ILGM.
> 
> I will use RING_F_EXACT_SZ flag in the next version of the patchset. I did not know about that flag.
> 	rte_ring_create(... N_PKTS ... RING_F_EXACT_SZ)
> ... is equivalent to, and looks cleaner than ...
> 	rte_ring_create(... rte_align32pow2(N_PKTS + 1) ... 0)
> 
> I plan to create a separate patchset to update the comments in rte_ring.h,
> re RING_F_EXACT_SZ and "free" vs "full".
> 
> --
> Regards,
> Robert Sanford
> 
> 

  reply	other threads:[~2021-12-22  3:25 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-15 18:19 [PATCH 0/7] net/bonding: fixes and LACP short timeout Robert Sanford
2021-12-15 18:19 ` [PATCH 1/7] net/bonding: fix typos and whitespace Robert Sanford
2021-12-21 19:57   ` [PATCH v2 0/8] net/bonding: fixes and LACP short timeout Robert Sanford
2021-12-21 19:57     ` [PATCH v2 1/8] net/bonding: fix typos and whitespace Robert Sanford
2022-02-04 15:06       ` Ferruh Yigit
2021-12-21 19:57     ` [PATCH v2 2/8] net/bonding: fix bonded dev configuring slave dev Robert Sanford
2021-12-21 19:57     ` [PATCH v2 3/8] net/bonding: change mbuf pool and ring creation Robert Sanford
2021-12-21 19:57     ` [PATCH v2 4/8] net/bonding: support enabling LACP short timeout Robert Sanford
2022-02-04 14:46       ` Ferruh Yigit
2021-12-21 19:57     ` [PATCH v2 5/8] net/bonding: add bond_8023ad and bond_alb to doc Robert Sanford
2022-02-04 14:48       ` Ferruh Yigit
2021-12-21 19:57     ` [PATCH v2 6/8] remove self from timers maintainers Robert Sanford
2022-03-08 23:26       ` Thomas Monjalon
2021-12-21 19:57     ` [PATCH v2 7/8] net/ring: add promisc and all-MC stubs Robert Sanford
2022-02-04 14:36       ` Ferruh Yigit
2022-02-04 14:49         ` Bruce Richardson
2022-02-11 19:57           ` Ferruh Yigit
2021-12-21 19:57     ` [PATCH v2 8/8] net/bonding: add LACP short timeout tests Robert Sanford
2022-02-04 14:49       ` Ferruh Yigit
2021-12-22  3:27     ` [PATCH v2 0/8] net/bonding: fixes and LACP short timeout Min Hu (Connor)
2022-01-11 16:41     ` Kevin Traynor
2022-02-04 15:09     ` Ferruh Yigit
2021-12-15 18:19 ` [PATCH 2/7] net/bonding: fix bonded dev configuring slave dev Robert Sanford
2021-12-15 18:19 ` [PATCH 3/7] net/bonding: change mbuf pool and ring allocation Robert Sanford
2021-12-16  8:59   ` Min Hu (Connor)
2021-12-17 19:49     ` Sanford, Robert
2021-12-18  3:44       ` Min Hu (Connor)
2021-12-20 16:47         ` Sanford, Robert
2021-12-21  2:01           ` Min Hu (Connor)
2021-12-21 15:31             ` Sanford, Robert
2021-12-22  3:25               ` Min Hu (Connor) [this message]
2021-12-15 18:19 ` [PATCH 4/7] net/bonding: support enabling LACP short timeout Robert Sanford
2021-12-15 18:19 ` [PATCH 5/7] net/bonding: add LACP short timeout to tests Robert Sanford
2021-12-15 18:20 ` [PATCH 6/7] net/bonding: add bond_8023ad and bond_alb to doc Robert Sanford
2021-12-15 18:20 ` [PATCH 7/7] Remove self from Timers maintainers Robert Sanford

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=da28bf35-35b7-8fd4-1a66-8d2747d75e93@huawei.com \
    --to=humin29@huawei.com \
    --cc=chas3@att.com \
    --cc=dev@dpdk.org \
    --cc=rsanford2@gmail.com \
    --cc=rsanford@akamai.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).