From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by dpdk.org (Postfix) with ESMTP id 9A9BF235; Thu, 21 Feb 2019 19:58:14 +0100 (CET) Received: by mail-wm1-f68.google.com with SMTP id y15so10337961wma.0; Thu, 21 Feb 2019 10:58:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=+fOK66eV83dgfKKtp/p32VodUxiiDs0RJl3gQlzkTJg=; b=HJj9t2ffasjPItmwi6JX7XNzBWktcf5zj614bZFpDWFUKcN0VKvoOV5WGa8MIv9i+6 AYG8Ge80kGinp29KFJudi1pr/7YnvuYDK7ov2vsRoiMKCKyO4EpRRu2YUCjD6NOfv6oJ ADjALiOVIp7GubBUllpazoG5W+0uPVhiErAynIbD65tmzgn+9hbpnKM3nYRPRhKZgEIL TPPjX6oqp+lGOU0bugxzOjwL1lbXnER2NnZw6lxdt4ICISQ1E58v6jHqzXBcVW17aePA u9Z92+0yx4HMdcUdnmD00ai5oA8uSHS+4bkDo8VLdLvVtpZ3r5kFmNQvsApvKYzwid32 PEOA== 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=+fOK66eV83dgfKKtp/p32VodUxiiDs0RJl3gQlzkTJg=; b=biOgwdrLWJjeVjplF6SxZ86q7RrV6xSqtyGsRfthhtBz1QgFzI+6AqGTsJO+EckuzF QcX7JbcmyYt2S6faRNsrUuIibj5f1kbptQ5YgA7LKloUrUTggityCP6wlhINRbLY2RoE M1I1XJFvUqDSZEjRQ7EVZNW5imaVmQjvdANyPrJuxtoSgNBYvbGDjajg3jHlQMe0mn9O SxhSbapBWppla24w1DCu/XC/6pIETyambOVYmybQACCBZv9+JMrD11mbgrJyQwDkg+Qm qufDBmbFnBw7PPiCmnQUYLShlWcVC2pus14qmkWaGgm21nwUagM/9Ec2AB1Lbh/oxk8r mfQw== X-Gm-Message-State: AHQUAuaIUSxkNQH35AZvFpyRFPRDrgnX+zqkhcnZDRGECj2G4KinWs9e NHfU1N61H4Jl4/sl8QwWN7mVWgU1R/BBBOoHpes= X-Google-Smtp-Source: AHgI3IZtVJZSjpxESWFBMLUuDIud99NBERwgAmszeBgw6/RyY/VXG0IQGTdtfmCuPSpMb7tvQOSEP3syJ6jQxByZVzM= X-Received: by 2002:a1c:14:: with SMTP id 20mr10948890wma.91.1550775494053; Thu, 21 Feb 2019 10:58:14 -0800 (PST) MIME-Version: 1.0 References: <1550150874-9535-1-git-send-email-david.marchand@redhat.com> <1550608693-12882-1-git-send-email-david.marchand@redhat.com> In-Reply-To: <1550608693-12882-1-git-send-email-david.marchand@redhat.com> From: Rami Rosen Date: Thu, 21 Feb 2019 20:58:05 +0200 Message-ID: To: David Marchand Cc: dev@dpdk.org, anatoly.burakov@intel.com, stable@dpdk.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH v2] eal: fix check when retrieving current cpu affinity X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Feb 2019 18:58:14 -0000 Reviewed-by: Rami Rosen =D7=91=D7=AA=D7=90=D7=A8=D7=99=D7=9A =D7=99=D7=95=D7=9D =D7=92=D7=B3, 19 = =D7=91=D7=A4=D7=91=D7=A8=D7=B3 2019, 22:38, =D7=9E=D7=90=D7=AA David Marcha= nd =E2=80=8F< david.marchand@redhat.com>: > pthread_getaffinity_np returns a >0 value when failing. > > This is mainly for the sake of correctness. > The only case where it could fail is when passing an incorrect cpuset > size wrt to the kernel. > > Fixes: 2eba8d21f3c9 ("eal: restrict cores auto detection") > Cc: stable@dpdk.org > Signed-off-by: David Marchand > --- > Changelog since v1: > - added missing Cc: stable@dpdk.org > > --- > lib/librte_eal/common/eal_common_options.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/lib/librte_eal/common/eal_common_options.c > b/lib/librte_eal/common/eal_common_options.c > index 6c96f45..1f45f82 100644 > --- a/lib/librte_eal/common/eal_common_options.c > +++ b/lib/librte_eal/common/eal_common_options.c > @@ -1343,10 +1343,9 @@ static int xdigit2val(unsigned char c) > unsigned int lcore_id; > unsigned int removed =3D 0; > rte_cpuset_t affinity_set; > - pthread_t tid =3D pthread_self(); > > - if (pthread_getaffinity_np(tid, sizeof(rte_cpuset_t), > - &affinity_set) < 0) > + if (pthread_getaffinity_np(pthread_self(), sizeof(rte_cpuset_t), > + &affinity_set)) > CPU_ZERO(&affinity_set); > > for (lcore_id =3D 0; lcore_id < RTE_MAX_LCORE; lcore_id++) { > -- > 1.8.3.1 > >