DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Michel Machado <michel@digirati.com.br>
Cc: "Wang, Yipeng1" <yipeng1.wang@intel.com>,
	"Wiles, Keith" <keith.wiles@intel.com>,
	"Fu, Qiaobin" <qiaobinf@bu.edu>,
	"Richardson, Bruce" <bruce.richardson@intel.com>,
	"De Lara Guarch, Pablo" <pablo.de.lara.guarch@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>,
	"Doucette, Cody, Joseph" <doucette@bu.edu>,
	"Gobriel, Sameh" <sameh.gobriel@intel.com>,
	"Tai, Charlie" <charlie.tai@intel.com>
Subject: Re: [dpdk-dev] [PATCH] hash table: add a bucket iterator function
Date: Fri, 3 Aug 2018 08:24:10 -0700	[thread overview]
Message-ID: <20180803082410.53078d0a@xeon-e3> (raw)
In-Reply-To: <76a8c325-2fc0-b805-015c-97d6cba83a58@digirati.com.br>

On Wed, 1 Aug 2018 08:57:39 -0400
Michel Machado <michel@digirati.com.br> wrote:

> On 07/31/2018 09:40 PM, Wang, Yipeng1 wrote:
> > How about an API that is more universal? For example, an API such as "rte_iterate_conflict_entries".  After an insertion failure, this function will iterate all entries that may conflict with the newly inserted key and you could decide which entry to evict?  
> 
>     Fine. We'll rewrite the patch to do so.
> 
>     Thank you for the feedback.
> 
> [ ]'s
> Michel Machado

Often for time based cleanup it is better to have a second linked list that is ordered
by time value. Then the cleanup code can start at the oldest stop when it reaches
the last item that could expire.

That does mean having some form of lock and doing delete/insert on every usage.

i.e	
	spinlock(&timer_lock);
	TAILQ_REMOVE(&timer_list, entry, timer_list);
	entry->expiration = new time;
	TAILQ_INSERT_TAIL(&timer_list, entry, timer_list);
	spinunlock(&timer_unlock);

  reply	other threads:[~2018-08-03 15:24 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-28 17:48 Qiaobin Fu
2018-07-29 13:17 ` Wiles, Keith
     [not found]   ` <D2C4A16CA39F7F4E8E384D204491D7A66148250A@ORSMSX105.amr.corp.intel.com>
2018-07-31  6:09     ` Fu, Qiaobin
2018-07-31 14:57       ` Wiles, Keith
2018-07-31 15:32         ` Michel Machado
2018-08-01  1:40           ` Wang, Yipeng1
2018-08-01 12:57             ` Michel Machado
2018-08-03 15:24               ` Stephen Hemminger [this message]
2018-08-07 13:24                 ` Michel Machado
  -- strict thread matches above, loose matches on Subject: below --
2018-07-15 17:15 Qiaobin Fu

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=20180803082410.53078d0a@xeon-e3 \
    --to=stephen@networkplumber.org \
    --cc=bruce.richardson@intel.com \
    --cc=charlie.tai@intel.com \
    --cc=dev@dpdk.org \
    --cc=doucette@bu.edu \
    --cc=keith.wiles@intel.com \
    --cc=michel@digirati.com.br \
    --cc=pablo.de.lara.guarch@intel.com \
    --cc=qiaobinf@bu.edu \
    --cc=sameh.gobriel@intel.com \
    --cc=yipeng1.wang@intel.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).