From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 968BBA04A3; Tue, 16 Jun 2020 12:10:02 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3F05B1BED2; Tue, 16 Jun 2020 12:10:02 +0200 (CEST) Received: from mail-qk1-f194.google.com (mail-qk1-f194.google.com [209.85.222.194]) by dpdk.org (Postfix) with ESMTP id E20E91B951 for ; Tue, 16 Jun 2020 12:10:00 +0200 (CEST) Received: by mail-qk1-f194.google.com with SMTP id d82so1375851qkc.10 for ; Tue, 16 Jun 2020 03:10:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=vDaIvfAHfBQBxKtGl37uck0V9xJzYTs0QpBXfkf6Wf0=; b=aBnYassM22BGuVd9mKVdSaloV+5+yc7Psw/1ci6a29gj/e/J8JiV40vpYgI5hGi2z9 ODt2Q9hFIlZstRKnVJlCgUf+UeJcmvoKW4YRo2ODrIO1t/ly5q41mNKxZXKw/aFMI3kS 2WPzr1CS6d1ElbPW5sDvBUFUhO4fJekwTfBpTcxbfx6o62i6V2WcCmAsVWaqoTkR+P1m xmcDUNFwUXz/1qkOMjDS1NZd2RFTGTMXvrP/bh1SEqsjSn5rMehHEivlXpMJ2yQtPpWr 8028iik+LrFpTrcZetJHD41Uxiu5wJP8EhW7idth9ZWYdsNIXEVIg4b6LA7bZE0VYT5L pV4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=vDaIvfAHfBQBxKtGl37uck0V9xJzYTs0QpBXfkf6Wf0=; b=b+LFqDjy37dARhJlHNHDsk/T1q/FyyzUeiQ/b91I5ratrB83xtgDHd6Qvv2DGpyO/j 9suuMzipllb0YN3HNnm99bVpZxwasGIlpVOJYMT+7aFCAUf2dphBczkqEqWxJSgL6iiv wJXJTHb9Twf9PEUMt57hq37mAN6mbW59a7mfKry7hCoyPyBHMFDd2RCtF7pvQgdTltEO fmlH1yTcM467OvyEqP7l/tvGODx0tLmng1TqjXwl+vR2c4iaHCR3CxqkD6WKFg2EXoIX 0Lk8v+NZ+mc8m6KCsT1Ojaq3HIdRStWdf9VjB9nphyzzYdmOO00SkiOYFGGgg75poY2i maOA== X-Gm-Message-State: AOAM532r6zEHP/IfuKl+dUMQbXPg3UN+WNjSmz48WlfeaQxycx9xf+m7 awSNtmIjNxY0kzV2s620XZ93Agmc X-Google-Smtp-Source: ABdhPJyj4dImcEYpojcu1+ODEy76PV++vhRQIS+O+YqVKzG8MMSOcd+BS2sigFhCRy9gzWh8TqwAhA== X-Received: by 2002:a37:a854:: with SMTP id r81mr19577533qke.83.1592302200049; Tue, 16 Jun 2020 03:10:00 -0700 (PDT) Received: from [192.168.1.10] (pool-96-255-60-31.washdc.fios.verizon.net. [96.255.60.31]) by smtp.gmail.com with ESMTPSA id d14sm13857309qkg.25.2020.06.16.03.09.59 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 16 Jun 2020 03:09:59 -0700 (PDT) To: dev@dpdk.org References: <20200616094637.31620-1-david.marchand@redhat.com> From: Chas Williams <3chas3@gmail.com> Message-ID: Date: Tue, 16 Jun 2020 06:09:59 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <20200616094637.31620-1-david.marchand@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] net/bonding: fix socket id check 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Acked-by: Chas Williams On 6/16/20 5:46 AM, David Marchand wrote: > Caught by code review, rte_eth_dev_socket_id() returns -1 on error. > The code should behave the same, but still, do not use LCORE_ID_ANY for > something that is not a lcore id. > > Fixes: c15c5897340d ("net/bonding: avoid allocating mempool on unknown socket") > Cc: stable@dpdk.org > > Signed-off-by: David Marchand > --- > drivers/net/bonding/rte_eth_bond_8023ad.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c > index b77a37ddb3..b7ffa2f2cf 100644 > --- a/drivers/net/bonding/rte_eth_bond_8023ad.c > +++ b/drivers/net/bonding/rte_eth_bond_8023ad.c > @@ -1043,7 +1043,7 @@ bond_mode_8023ad_activate_slave(struct rte_eth_dev *bond_dev, > RTE_ASSERT(port->tx_ring == NULL); > > socket_id = rte_eth_dev_socket_id(slave_id); > - if (socket_id == (int)LCORE_ID_ANY) > + if (socket_id == -1) Testing against < 0 would probably be more future proof. But if someone decides to update rte_eth_dev_socket_id they will hopefully update callers as well. > socket_id = rte_socket_id(); > > element_size = sizeof(struct slow_protocol_frame) + >