From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-f65.google.com (mail-ed1-f65.google.com [209.85.208.65]) by dpdk.org (Postfix) with ESMTP id 57C67FEB for ; Mon, 29 Oct 2018 13:55:48 +0100 (CET) Received: by mail-ed1-f65.google.com with SMTP id b7-v6so7163468edd.9 for ; Mon, 29 Oct 2018 05:55:48 -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=3sCdAJxOLoSSbEhK22bQPLEs8Or2k7io/V8TGplBAOM=; b=g4TD5NuLDJdxCSrvKllSLfNcqJrhO3P49+apZbumt8UnGLOIlg+V5iOb9djXFLE0R9 GOdQ7A2LW6xlwVw2F9Bsry1LtGpWq8ymaA2wSWm7Rz0zyCue8tEvwDp7ygG272Fg4C5R ew5fJVp5IJUOUJCMQoVa2c7BaOJQ+LLJRbT1+X74gPOXa9eH32Ew31zLtChQEwu36h30 sXn7/VaS6hgG2j9nctjjaXkw1KCAaax3GhTcDSkM/H01BHk6y1vOSoJdUCyuR31xsWqY baORIDTxSsG2y03u7mIDK/olcxrUyFgp0srHfc71i1LN2yyWJ+OejGTc7wixTSZ3nAiE QwkA== 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=3sCdAJxOLoSSbEhK22bQPLEs8Or2k7io/V8TGplBAOM=; b=YHD7ZA9RZOcMhUVAY312FY889znGBDYIYIlPeCrBH//y6KDkT+i/radeqqJ4dAoQMS eh45lrkOEEFtY408pKLlUGgbslhqmE5kIFNOf+C1c1XxnS6Sy3TesBHGL27yZJ2FMn4T 7su4eL1m8oMOMAk1+7mpfkh+2FuaPj0OfH2k34gJ2AJvR6IfXslXUJp+9qG+GKBDGhuW mrqp5NdrVCnpU6Lp1M6hSlWVVxGpiQ2OqaxlWb2OHYuluRkUPL5xKPDUK+Og7kq780Ll ZOzBOuwGt61PriFndOeTNmVw2G/TK7GLXnKQgI1PUWaOF5PzsH8GCohLPwM1GuSE3Pe6 e81g== X-Gm-Message-State: AGRZ1gKzkbgFtjL5iPjv9y6RPu3hG/wND36F1LVG/VOcLCjqNMmYYnxP dxoHoZLCqOqeuQG5ABOPYmRWWM+BX3N0uRcQIGBH2w== X-Google-Smtp-Source: AJdET5fc9rhQxPlnYWR3CBAltoGMD41074axZVljbk8Q9nkKVuo4uoR8x2A57Ga5NprfTdu+sgUNYMq3+mqRlN20F84= X-Received: by 2002:a17:906:70c3:: with SMTP id g3-v6mr10391423ejk.194.1540817747980; Mon, 29 Oct 2018 05:55:47 -0700 (PDT) MIME-Version: 1.0 References: <1538743527-8285-1-git-send-email-alejandro.lucero@netronome.com> <2737161.TvyDVilZt4@xps> In-Reply-To: <2737161.TvyDVilZt4@xps> From: Alejandro Lucero Date: Mon, 29 Oct 2018 12:55:34 +0000 Message-ID: To: Thomas Monjalon Cc: lei.a.yao@intel.com, dev , "Xu, Qian Q" , xueqin.lin@intel.com, "Burakov, Anatoly" , 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: Mon, 29 Oct 2018 12:55:48 -0000 On Mon, Oct 29, 2018 at 11:46 AM Thomas Monjalon wrote: > 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. > > I think once the call to rte_eal_check_dma_mask uses the maskbits instead of the mask, calling rte_memseg_walk_thread_unsafe avoids the deadlock. Yao, can you try with the attached patch? > > 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 > > >