From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 41B65A0613 for ; Wed, 28 Aug 2019 13:50:48 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6B2901C1AA; Wed, 28 Aug 2019 13:50:46 +0200 (CEST) Received: from mail-qt1-f177.google.com (mail-qt1-f177.google.com [209.85.160.177]) by dpdk.org (Postfix) with ESMTP id 3CB2E1C1A5 for ; Wed, 28 Aug 2019 13:50:45 +0200 (CEST) Received: by mail-qt1-f177.google.com with SMTP id q64so2613817qtd.5 for ; Wed, 28 Aug 2019 04:50:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=lRDyqL1Esxss5BSEeukrmm/5vN85dqS7jIvXBYl+5AU=; b=wABNg8sSHOoxhRd/oluPKgNKcP2eMnx/NehBP3N306o+ho9WXnxEcAzfQaLBxg8wH5 Cgq1E8eFpEZiK1BdwdcIPbjCI4jb78OiivmugI73fvHP5Y5ZU8WpUf0vz6Q2/1htUAzd TD2LIOvM2y5zmljpUU5daAvpAC+tY2PVpn9B4cXWx63WrkaA607xLVaLpSkbGGChJP2V utlp9LItnlpvvymvlBM8ZGiXyn2Exdx7+DigmmVkR4wbHUYEwomOz0rrQPPqJHVtCS0z gwfQQ2xBGcxXiCeIlHm8r0fuuOR17ls/Fz2iaCBHpo5KcjQ4+pxpWF7i34g/ErvuaKsq kM/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=lRDyqL1Esxss5BSEeukrmm/5vN85dqS7jIvXBYl+5AU=; b=Lj6MmWmUyZH2mQwH6Rjwlq4gTCyP2IfIA3mkSRbgmmH4v9cB7OPhDg27jkdBnqQH/H TkjalBUEDwke1a5r5LznMsJDzQWgIB5aIvdoqDHSzBnQVmwpfYMP9fuGZip0FcK1cSCw 6eWiPmMAA6TrBGltAbQpKcvdmGPhDrSMhcR5TC9DvhwAg1nv5129g0pis88oEkW73+h4 MlQD4F3VkOGO99nLb/86LrikoL8dI8dPrKcddVq3Pcp7p456RivYVm/n8GLTEB3mkMp1 xdWMPHhzlcGESAAkUl1wVWJLnGosqBNNBB1pvPdClzEUGe5eXxuIPdd6/40N+QmMfjbR wLAg== X-Gm-Message-State: APjAAAXDPYfpnnWjo/oZtuPCzjZAReEsx3jLlaQ++KVNuxK0wjSZT60+ jTr1saCSQPFA1jGWYVSKR5v6RQ== X-Google-Smtp-Source: APXvYqwMq6IIEGsDyUmC3luaKmd90WdoDfSC26+YHKCws9etY64HY3EqYEaPgOkLZcCzQXC/GPladQ== X-Received: by 2002:aed:2348:: with SMTP id i8mr3855231qtc.350.1566993044557; Wed, 28 Aug 2019 04:50:44 -0700 (PDT) Received: from xps13 (pool-96-233-168-28.spfdma.east.verizon.net. [96.233.168.28]) by smtp.gmail.com with ESMTPSA id a23sm987796qtj.5.2019.08.28.04.50.43 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 28 Aug 2019 04:50:44 -0700 (PDT) Date: Wed, 28 Aug 2019 07:50:36 -0400 From: Stephen Hemminger To: Bing Zhao Cc: yipeng1.wang@intel.com, sameh.gobriel@intel.com, bruce.richardson@intel.com, pablo.de.lara.guarch@intel.com, dev@dpdk.org Message-ID: <20190828075036.7af36efe@xps13> In-Reply-To: <1566975109-318949-2-git-send-email-bingz@mellanox.com> References: <1566975109-318949-1-git-send-email-bingz@mellanox.com> <1566975109-318949-2-git-send-email-bingz@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [RFC] rte_hash: introduce hash list into hash lib 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Wed, 28 Aug 2019 14:51:49 +0800 Bing Zhao wrote: > + > +/* To enable the deletion when iterating the list */ > +#ifndef LIST_FOREACH_SAFE > +#define LIST_FOREACH_SAFE(var, head, field, tvar) \ > + for ((var) = ((head)->lh_first); \ > + (var) && ((tvar) = ((var)->field.le_next), 1); \ > + (var) = (tvar)) > +#endif > + > +/* To move the whole list from one head to another */ > +#define LIST_MOVE_TO_NEW_HEAD(new, old, field) do { \ > + (new)->lh_first = (old)->lh_first; \ > + if (((new)->lh_first) != NULL) \ > + (new)->lh_first->field.le_prev = &(new)->lh_first; \ > +} while (/*CONSTCOND*/0) > + Why not use BSD style lists, rather than reinventing it here.