From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-f68.google.com (mail-ed1-f68.google.com [209.85.208.68]) by dpdk.org (Postfix) with ESMTP id EBB164CA0 for ; Tue, 30 Oct 2018 11:23:42 +0100 (CET) Received: by mail-ed1-f68.google.com with SMTP id x31-v6so9967983edd.8 for ; Tue, 30 Oct 2018 03:23:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netronome-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=OHe3MNxbEyBbxIPpnrxFcBWVNt2/XaShtnCp1FCgL20=; b=QRYaS6vfGJv+hLM18XHsfAvyQfj9PdF6xzIb2gFqbbeL7UBBD+sQUzliPxEF9MdN10 AI142GK1ztK3e7k/X/JDyuXaFctaVV8LahM/9SqvNybTw9p6XYv6yKeQizTrzxytVFbU C+6mZWEVGZgYNbAUzs9WHEZ5Cokcp5G6VtkQ1vWu3XDxYBSJyPLZ32SbTr9Wc21pTgLL Hq8OwRPsYU7ASOvMjDOYZry9jjbL6cFaVUNUWuV8GOx3bHIKOKgJ/29wJQCApzVNEmFn 19FfAi5nV403NykTzajH2I/2M6z/HV1hlrThZXKOnNGLlgNhO7UBuQJnfXETY3Ro+OJG LDXQ== 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; bh=OHe3MNxbEyBbxIPpnrxFcBWVNt2/XaShtnCp1FCgL20=; b=VDu+p3mYadysd0BRB3CamTFWMif3bTxPE1BwpTc4NWWEnjFriqDpxWHq7ItJTJWqrO cuKOQgZC73Na/8x9nEvSWjkfS1tcTzzU/xOmVE+G8+hRZiZMp/IU7V+PPVjLJ4yHX9F8 kzGsn2NP4/K8ZtOAneu+kH/ShosnjoyX1iDHKx6Kqwd2qlitndwLgJrg3NnmEuSXHgHd YTn6lJPFlgchudoPqQEB5WFy5LCsd/HS6LxHpzV66tiYTwMxYzOsVI1nUGZ9S/XHhYt7 cfaKoR1mhLHPgtUUlq/3FlPUxkNWqnqnd32Qf3hIHrjRnrv7Mu0OSttsqggNPL9i1Ko6 VU9Q== X-Gm-Message-State: AGRZ1gIana8tsrlK5V7T9fnmUv98w7HPD83b8dFckAE179U5Xh+AuzEG dbDXLI5/Uw6y4daLhCuutPQT7B6Ch5rHQMrSsoNqRA== X-Google-Smtp-Source: AJdET5f55mokFd2uUDqX/qdQHlpN60IyX60YeSEj+gXZLsz2dZvq//fuH92WRJl79pj/a1w28yM7mveZfHfg+Fi2a0Y= X-Received: by 2002:a50:b704:: with SMTP id g4-v6mr16459469ede.139.1540895022616; Tue, 30 Oct 2018 03:23:42 -0700 (PDT) MIME-Version: 1.0 References: <1538743527-8285-1-git-send-email-alejandro.lucero@netronome.com> <1593678.TTmrtHRuFR@xps> <2DBBFF226F7CF64BAFCA79B681719D954502B7E1@shsmsx102.ccr.corp.intel.com> <1651382.pnTT7vZl36@xps> In-Reply-To: From: Alejandro Lucero Date: Tue, 30 Oct 2018 10:23:31 +0000 Message-ID: To: "Burakov, Anatoly" Cc: Thomas Monjalon , lei.a.yao@intel.com, dev , "Xu, Qian Q" , xueqin.lin@intel.com, Ferruh Yigit Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH v3 0/6] use IOVAs check based on DMA mask 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: Tue, 30 Oct 2018 10:23:43 -0000 On Tue, Oct 30, 2018 at 10:19 AM Burakov, Anatoly wrote: > On 29-Oct-18 11:39 AM, Alejandro Lucero wrote: > > 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. > > > > 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: > > > > *diff --git a/lib/librte_eal/common/eal_common_memory.c > > b/lib/librte_eal/common/eal_common_memory.c* > > > > *index 12dcedf5c..69b26e464 100644* > > > > *--- a/lib/librte_eal/common/eal_common_memory.c* > > > > *+++ b/lib/librte_eal/common/eal_common_memory.c* > > > > @@ -462,7 +462,7 @@rte_eal_check_dma_mask(uint8_t maskbits) > > > > /* create dma mask */ > > > > mask = ~((1ULL << maskbits) - 1); > > > > - if (rte_memseg_walk(check_iova, &mask)) > > > > +if (!rte_memseg_walk(check_iova, &mask)) > > > > /* > > > > * Dma mask precludes hugepage usage. > > > > * This device can not be used and we do not need to keep > > > > > > 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. > > > > > > Anatoly, maybe you can see something I can not. > > > > memseg walk will return 0 only when each callback returned 0 and there > were no more segments left to call callbacks on. If your code always > returns 0, then return value of memseg_walk will always be zero. > > If your code returns 1 or -1 in some cases, then this error condition > will trigger. If it doesn't, then your condition by which you decide to > return 1 or 0, is incorrect :) I couldn't spot any obvious issues there, > but i'll recheck. > > Thanks for looking at this, but I was wrong. The return code changes everything so it does not make sense to compare both. -- > Thanks, > Anatoly >