From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v3 0/6] use IOVAs check based on DMA mask Date: Mon, 29 Oct 2018 12:46:45 +0100 Message-ID: <2737161.TvyDVilZt4@xps> References: <1538743527-8285-1-git-send-email-alejandro.lucero@netronome.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: lei.a.yao@intel.com, dev , "Xu, Qian Q" , xueqin.lin@intel.com, "Burakov, Anatoly" , Ferruh Yigit To: Alejandro Lucero Return-path: Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id 1F1B610A3 for ; Mon, 29 Oct 2018 12:46:41 +0100 (CET) In-Reply-To: List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 29/10/2018 12:39, Alejandro Lucero: > I got a patch that solves a bug when calling rte_eal_dma_mask using the > mask instead of the maskbits. However, this does not solves the deadlock. The deadlock is a bigger concern I think. > Interestingly, the problem looks like a compiler one. Calling > rte_memseg_walk does not return when calling inside rt_eal_dma_mask, but if > you modify the call like this: > > - if (rte_memseg_walk(check_iova, &mask)) > + if (!rte_memseg_walk(check_iova, &mask)) > > it works, although the value returned to the invoker changes, of course. > But the point here is it should be the same behaviour when calling > rte_memseg_walk than before and it is not. Anyway, the coding style requires to save the return value in a variable, instead of nesting the call in an "if" condition. And the "if" check should be explicitly != 0 because it is not a real boolean. PS: please do not top post and avoid HTML emails, thanks