From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id DA75AA0096 for ; Fri, 10 May 2019 00:19:58 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9FED94CA0; Fri, 10 May 2019 00:19:58 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 9E60B4C8D for ; Fri, 10 May 2019 00:19:57 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 May 2019 15:19:56 -0700 X-ExtLoop1: 1 Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga001.fm.intel.com with ESMTP; 09 May 2019 15:19:56 -0700 Received: from fmsmsx124.amr.corp.intel.com (10.18.125.39) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 9 May 2019 15:19:56 -0700 Received: from fmsmsx101.amr.corp.intel.com ([169.254.1.245]) by fmsmsx124.amr.corp.intel.com ([169.254.8.175]) with mapi id 14.03.0415.000; Thu, 9 May 2019 15:19:56 -0700 From: "Eads, Gage" To: "dev@dpdk.org" CC: "olivier.matz@6wind.com" , "arybchenko@solarflare.com" Thread-Topic: Mempool handler ops index allocation issue Thread-Index: AdUGdVWkZXymmQYITy6QKI4fWmaFpg== Date: Thu, 9 May 2019 22:19:55 +0000 Message-ID: <9184057F7FC11744A2107296B6B8EB1E68CB4370@fmsmsx101.amr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNTAxZTM0MjAtYzJhYS00MDg3LThhY2QtNGI5MDMzMWM1NjU4IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiWUpRWkhQNXhkNFhTejE2YmFPenJiclc1a1NRWFwvVUlZYWd5dkFHQVZ3YkZwblpxc2VQUnBtTFQ4NWRINndNeVMifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.600.7 dlp-reaction: no-action x-originating-ip: [10.1.200.107] MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: [dpdk-dev] Mempool handler ops index allocation issue 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" Message-ID: <20190509221955.2mIOX8dIvqYebPPLd6qlhp_LkUIAsXc2VoxqduyYVq0@z> Hi all, I ran into a problem with a multi-process application, in which two process= es assigned the same mempool handler ops index to *different* handlers. Thi= s happened because the two processes supplied the -d EAL arguments in diffe= rent order, e.g.: sudo ./appA -dlibrte_mempool_bucket.so -dlibrte_mempool_ring.so --proc-type= primary & sudo ./appB -dlibrte_mempool_ring.so -dlibrte_mempool_bucket.so --proc-type= secondary & The dynamic load order matters because the ops indexes are assigned in the = order the library ctors are run. This can result in the different processes= trying to use different handlers for the same mempool. I'm not aware of any requirement that the EAL argument order should match a= cross processes, so I don't think this is a user error. This could also hap= pen in static libraries if they linked the libraries in a different order -= but that shouldn't occur if both applications are following the rules for = building an external application (https://doc.dpdk.org/guides/prog_guide/de= v_kit_build_system.html#building-external-applications). If you agree that this is an issue, I see a couple possible resolutions: 1. Add a note/warning to the mempool handlers section of the user gui= de (https://doc.dpdk.org/guides/prog_guide/mempool_lib.html#mempool-handler= s) 2. Modify rte_mempool_register_ops() so that built-in handlers (ring,= stack, etc.) have fixed IDs. E.g. ring is always 0, stack is always 1, etc= . These handlers could be identified by their name string. User-registered = mempools would still be susceptible to this problem, though. Thoughts? Alternatives? Thanks, Gage