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 EFD20A04A3 for ; Tue, 16 Jun 2020 11:47:00 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E63A41BEDE; Tue, 16 Jun 2020 11:47:00 +0200 (CEST) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by dpdk.org (Postfix) with ESMTP id 659021BEDE 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=1592300818; 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=TMCmHJRkCxI4OLZwPK4IrjymRWE/F9bw8Zc1JtlcnOf62wHwB5wxWlC1+iodf/bTzwA14U Aa7uOjkoaIkhpq5jH+PQQ835c8yuL318yEDZTAgiwjdgFUg/ALwwfzsxLcAWqRF1QbAcqq RCwgWYl2Xu4yHYc0rTX1MU6axqYcOy0= 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-stable] [PATCH] net/bonding: fix socket id check 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: , Errors-To: stable-bounces@dpdk.org Sender: "stable" 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