From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpcmd01217.aruba.it (smtpcmd01217.aruba.it [62.149.158.217]) by dpdk.org (Postfix) with ESMTP id 152A82661 for ; Mon, 13 Aug 2018 15:20:51 +0200 (CEST) Received: from LANZUISI-NBK ([93.146.250.196]) by smtpcmd01.ad.aruba.it with bizsmtp id NdLk1y00j4EznjR01dLpn0; Mon, 13 Aug 2018 15:20:50 +0200 Received: from [172.16.9.22] by LANZUISI-NBK (PGP Universal service); Mon, 13 Aug 2018 15:20:49 +0100 X-PGP-Universal: processed; by LANZUISI-NBK on Mon, 13 Aug 2018 15:20:49 +0100 From: Matteo Lanzuisi To: dev@dpdk.org References: Message-ID: Date: Mon, 13 Aug 2018 15:20:44 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Language: it DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aruba.it; s=a1; t=1534166450; bh=Cbed114WtyLgeghqGJswZdk/5OlI/SgfehF15TyNjWE=; h=Subject:From:To:Date:MIME-Version:Content-Type; b=PYErGhb+L7SlGuMgq+8N3vCQTKeG3p9FMIGAzCJHU1rnN6OIqRJlfYna9Yx27LaJd /vIQOxGAulv8Y96+ayqrq4PTxY5U4ClNywpR/6/wmf4j59klj+Ohwod9KgEZkJDFXB EkvFm9YeKRX3KMmD7f06xOAJqlrlOnh7QI1qqnLo8DCqarSZSKBAElGpa6j5aQnjiI lmsX2xttbkXYDovL+gp/OpiElgQuS6lp5qvNc/074GdnEX0aMu4sZ+e/o8oorTXGOD BZsAn375W2qhPxRtlZQS/K/bkWthLaQ7BhAdd1dB7jcsZHcWIExYLWLXGfYpNxPn3V cLLxDk9jCAI2g== Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] Multi-thread mempool usage 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: , X-List-Received-Date: Mon, 13 Aug 2018 13:20:51 -0000 Any suggestion? any idea about this behaviour? Il 08/08/2018 11:56, Matteo Lanzuisi ha scritto: > Hi all, > > recently I began using "dpdk-17.11-11.el7.x86_64" rpm (RedHat rpm) on > RedHat 7.5 kernel 3.10.0-862.6.3.el7.x86_64 as a porting of an > application from RH6 to RH7. On RH6 I used dpdk-2.2.0. > > This application is made up by one or more threads (each one on a > different logical core) reading packets from i40e interfaces. > > Each thread can call the following code lines when receiving a > specific packet: > > RTE_LCORE_FOREACH(lcore_id) > { >         result = > rte_mempool_get(cea_main_lcore_conf[lcore_id].de_conf.cmd_pool, > (VOID_P *) &new_work);        // mempools are created one for each > logical core >         if (((uint64_t)(new_work)) < 0x7f0000000000) >             printf("Result %d, lcore di partenza %u, lcore di > ricezione %u, pointer %p\n", result, rte_lcore_id(), lcore_id, > new_work);    // debug print, on my server it should never happen but > with multi-thread happens always on the last logical core!!!! >         if (result == 0) >         { >             new_work->command = command; // usage of the memory gotten > from the mempool... <<<<<- here is where the application crashes!!!! >             result = > rte_ring_enqueue(cea_main_lcore_conf[lcore_id].de_conf.cmd_ring, > (VOID_P) new_work);    // enqueues the gotten buffer on the rings of > all lcores >             // check on result value ... >         } >         else >         { >             // do something if result != 0 ... >         } > } > > This code worked perfectly (never had an issue) on dpdk-2.2.0, while > if I use more than 1 thread doing these operations on dpdk-17.11 it > happens that after some times the "new_work" pointer is not a good > one, and the application crashes when using that pointer. > > It seems that these lines cannot be used by more than one thread > simultaneously. I also used many 2017 and 2018 dpdk versions without > success. > > Is this code possible on the new dpdk versions? Or have I to change my > application so that this code is called just by one lcore at a time? > > Matteo > > > -- Descrizione: resi.gif *Matteo Lanzuisi* /Business Unit ICT/ / /RESI Informatica S.p.A. Via Pontina Km 44,044 04011 Aprilia (LT) - Italy *Tel:*+39 06 92710339 *Mobile:*+39 3355686712 *Fax:*+39 06 92710208 *Email:*m.lanzuisi@resi.it *Web:*www.resi.it ** Descrizione: resi-group.gif width= _ _ _ _ _ _ _ _ _ _ _ _ *Nota di riservatezza:*Ai sensi del Decreto Legislativo n. 196/2003, "Codice in materia di Protezione dei dati personali", si precisa che le informazioni contenute in questo messaggio e negli eventuali allegati sono riservate e per uso esclusivo del destinatario. Persone diverse dallo stesso non possono copiare o distribuire il messaggio a terzi. Chiunque riceva questo messaggio per errore è pregato di distruggerlo e di informare immediatamente il mittente. Grazie. *Confidentiality Notice:* Accordingly to Italian legislative decree n. 196/2003 concerning privacy, the information contained in this e-mail is intended for the named recipients only. It may contain privileged and confidential information and if you are not an intended recipient, you must not copy, distribute or take any action in reliance on it. If you have received this e-mail in error, please notify the sender by e-mail and delete the e-mail and any copies of it. Thank you. *P*****Please consider the environment before printing this mail. Rispettate l’ambiente e stampate questa email solo in caso di reale necessità