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 5BF11A0559; Mon, 16 Mar 2020 08:44:19 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 613631BF98; Mon, 16 Mar 2020 08:44:18 +0100 (CET) Received: from mail-qv1-f68.google.com (mail-qv1-f68.google.com [209.85.219.68]) by dpdk.org (Postfix) with ESMTP id 2E3F525D9 for ; Mon, 16 Mar 2020 08:44:17 +0100 (CET) Received: by mail-qv1-f68.google.com with SMTP id cz10so8296477qvb.0 for ; Mon, 16 Mar 2020 00:44:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=7oQizJQw3Cz9lvAOT4+cBj4LdsHwp2xj/qR7dtCvLPk=; b=OZSIB6QKhNKgeICp/PW0r/eksXWAQOp2NqwPoCQETys/gTh0YzHATT+8shy/khaPjn JScp9BRWULeu0l9dUmzvN7pawPsVSHjzXI7sShgTAQFau1t+JvyrrNYJQgWXS21UlIGV Qd7o1GJ4EBdrnptnWxBqWfejt4zIE1hqAFSFRUiIUQI7j36fSyqSSMhYXVQmbFEvU1nM ccgV6J77JRhIRH7G4wCI6pU3c08Z7VKCGgPT7O1y+BlxbV5xB3S7/Qfwtpo1lpO9CD+T iPkLIr/REFVIa/GogtltbitbG3W6Yu9YGpnm7QV7uCKdo8K9kmdMc4LAGKG0alo4vQjK oT8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=7oQizJQw3Cz9lvAOT4+cBj4LdsHwp2xj/qR7dtCvLPk=; b=s75V1fO1empuFeLuAkliSsPxl9OgEl+aQ+HlG21aqa+Li1hnKv/19FjvN0WxOX57+5 yLiRQjjKnWBVThgqfK3ZBLTucTHYgamVWBj5QsTG+OeaCK/QBKJiMDIeWYuYv4Ocpohv axvf7lwBppWr02bvY3TOcjHc6XdmSiQkwoE0LhUx7kRo3HMyFVqYB/ZgGFN1T7xuyt4f 5wzbcOdsb0mLtLIZS8yUL8Y/yrTB5eBv2n66DFOsmjH0fhtZso9XKreMXf55Eh2zrtcb sFyXs3pSR4YT70VMA9F5KopUf04b/RU1i1OrwGpGFu6w7Lui2aGzlBcCD2NYQfW4WDuo uOLA== X-Gm-Message-State: ANhLgQ1IrS8n3GVXZOw7Q60yGjlwNTWH8H7xnKCVsB0MZ0Z66V2OhNpt bkWQtg/4ddfkiLufhGl//ZX8NXu42Y7yqJ5hCt4= X-Google-Smtp-Source: ADFU+vsTt3eJdI0y6JcQJ/S/csb+PRyVyCsEQ4X7T7VJdbm97XU2K1YFYfHIYFzHzBJGjb/pYlFAwmMIV2CDutV71lE= X-Received: by 2002:ad4:4829:: with SMTP id h9mr20919183qvy.135.1584344656496; Mon, 16 Mar 2020 00:44:16 -0700 (PDT) MIME-Version: 1.0 References: <1583114253-15345-1-git-send-email-xiangxia.m.yue@gmail.com> <1583501776-9958-1-git-send-email-xiangxia.m.yue@gmail.com> <7420c590-4906-34e2-b0b8-d412df9005c8@solarflare.com> <20200309082705.GM13822@platinum> In-Reply-To: From: Tonghao Zhang Date: Mon, 16 Mar 2020 15:43:40 +0800 Message-ID: To: David Marchand Cc: Olivier Matz , Andrew Rybchenko , Jerin Jacob , dpdk-dev , Gage Eads , "Artem V. Andreev" , Jerin Jacob , Nithin Dabilpuram , Vamsi Attunuru , Hemant Agrawal , "Burakov, Anatoly" , Bruce Richardson Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [dpdk-dev] [PATCH dpdk-dev v3] mempool: sort the rte_mempool_ops by name 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 Mon, Mar 9, 2020 at 9:15 PM David Marchand w= rote: > > On Mon, Mar 9, 2020 at 9:56 AM Tonghao Zhang w= rote: > > On Mon, Mar 9, 2020 at 4:27 PM Olivier Matz wr= ote: > > > The fact that the ops index changes during mempool driver lifetime is > > > indeed frightening, especially knowning that this is a dynamic > > > registration that could happen at any moment in the life of the > > > application. Also, breaking the ABI is not desirable. > > That solution is better. > > > > > Let me try to propose something else to solve your issue: > > > > > > 1/ At init, the primary process allocates a struct in shared memory > > > (named memzone): > > > > > > struct rte_mempool_shared_ops { > > > size_t num_mempool_ops; > > > struct { > > > char name[RTE_MEMPOOL_OPS_NAMESIZE]; > > > } mempool_ops[RTE_MEMPOOL_MAX_OPS_IDX]; > > > char *mempool_ops_name[RTE_MEMPOOL_MAX_OPS_IDX]; > > > rte_spinlock_t mempool; > > > } > > > > > > 2/ When we register a mempool ops, we first get a name and id from th= e > > > shared struct: with the lock held, lookup for the registered name = and > > > return its index, else get the last id and copy the name in the st= ruct. > > > > > > 3/ Then do as before (in the per-process global table), except that w= e > > > reuse the registered id. > > > > > > We can remove the num_ops field from rte_mempool_ops_table. > > > > > > Thoughts? > > It seems better, just adding Anatoly and Bruce who know more about multip= rocess. > > Tonghao, could you add a unit test to exhibit the issue as part of this w= ork? > > Thanks. Hi Olivier any progress=EF=BC=9Fwill apply this patch or wait your patch? > > -- > David Marchand > --=20 Thanks, Tonghao