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 39FD0A04A3; Tue, 16 Jun 2020 11:47:01 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1A1281BF26; Tue, 16 Jun 2020 11:47:01 +0200 (CEST) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by dpdk.org (Postfix) with ESMTP id 753261BEE1 for ; Tue, 16 Jun 2020 11:46:59 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592300819; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VmduH42SwbvlCNGz5zVytKikZlxNS1CBjAlD7KTYNHI=; b=ASThgx9AtUTzqsS2U2tE0CPXuQ2HGXrjn0uiOnuwpa4Tm3edzpvMh0QfTXaBUzMtv4YzaC UIauil1rqPApiKwjqafW75ZmEj3eyZSlK88qdCCyIlTG1asjvE7HR6+SUUvqYxsIUU1TYe a18QA9okLvaqToNp4NcO8EMHi8LJig0= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-272-HhVvDTk-ODisVoVH6IOk7w-1; Tue, 16 Jun 2020 05:46:56 -0400 X-MC-Unique: HhVvDTk-ODisVoVH6IOk7w-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6112F18A2669; Tue, 16 Jun 2020 09:46:55 +0000 (UTC) Received: from dmarchan.remote.csb (unknown [10.40.193.186]) by smtp.corp.redhat.com (Postfix) with ESMTP id B99871C8; Tue, 16 Jun 2020 09:46:53 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: stable@dpdk.org, Chas Williams , "Wei Hu (Xavier)" , Eric Kinzie , Declan Doherty Date: Tue, 16 Jun 2020 11:46:37 +0200 Message-Id: <20200616094637.31620-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8bit Subject: [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" 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) socket_id = rte_socket_id(); element_size = sizeof(struct slow_protocol_frame) + -- 2.23.0