From patchwork Tue Jun 16 09:47:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 71637 X-Patchwork-Delegate: jerinj@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 751FEA04A3; Tue, 16 Jun 2020 11:47:18 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5BF471BF1B; Tue, 16 Jun 2020 11:47:18 +0200 (CEST) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by dpdk.org (Postfix) with ESMTP id 06D9A1BF1B for ; Tue, 16 Jun 2020 11:47:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592300836; 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=AG6LUwUQlU8DS4VU5ptgOH84cSRGt1/KPntcuqj/ITU=; b=HiDkth7kRsv/dDXjxJzwPAfvR3kU3lFBsUsAfRJilDc7Aki70Z7k40gEDfg2xKL9ADWVnJ Wtnc8BpuTqLQL1EcgiZxfSDxdXJ3wUbBrISERE2a6rpEdZITlpMHeu/suD0XB4ZcAJfAp0 d+GCltmF5biFjIEX56vEsJo6pPk3FjM= 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-432-_vkqnefSMh6aAT81aT2n5Q-1; Tue, 16 Jun 2020 05:47:12 -0400 X-MC-Unique: _vkqnefSMh6aAT81aT2n5Q-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D83AB1100F60; Tue, 16 Jun 2020 09:47:11 +0000 (UTC) Received: from dmarchan.remote.csb (unknown [10.40.193.186]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9FA3719C79; Tue, 16 Jun 2020 09:47:10 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: stable@dpdk.org, Liron Himi , Natalie Samsonov Date: Tue, 16 Jun 2020 11:47:00 +0200 Message-Id: <20200616094700.31749-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [dpdk-dev] [PATCH] net/mvpp2: fix non-EAL thread support 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 inspection, for a non-EAL thread identified with rte_lcore_id() == LCORE_ID_ANY, the code currently arbitrarily uses lcore 0 while there is no guarantee this lcore is used. Fixes: 3588aaa68eab ("net/mrvl: fix HIF objects allocation") Cc: stable@dpdk.org Signed-off-by: David Marchand Acked-by: Liron Himi Signed-off-by: David Marchand --- drivers/net/mvpp2/mrvl_ethdev.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/mvpp2/mrvl_ethdev.c b/drivers/net/mvpp2/mrvl_ethdev.c index b98b1fd667..9037274327 100644 --- a/drivers/net/mvpp2/mrvl_ethdev.c +++ b/drivers/net/mvpp2/mrvl_ethdev.c @@ -816,7 +816,7 @@ mrvl_flush_bpool(struct rte_eth_dev *dev) unsigned int core_id = rte_lcore_id(); if (core_id == LCORE_ID_ANY) - core_id = 0; + core_id = rte_get_master_lcore(); hif = mrvl_get_hif(priv, core_id); @@ -1620,7 +1620,7 @@ mrvl_fill_bpool(struct mrvl_rxq *rxq, int num) core_id = rte_lcore_id(); if (core_id == LCORE_ID_ANY) - core_id = 0; + core_id = rte_get_master_lcore(); hif = mrvl_get_hif(rxq->priv, core_id); if (!hif) @@ -1770,7 +1770,7 @@ mrvl_rx_queue_release(void *rxq) unsigned int core_id = rte_lcore_id(); if (core_id == LCORE_ID_ANY) - core_id = 0; + core_id = rte_get_master_lcore(); if (!q) return;