From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9977BA0C49; Tue, 20 Jul 2021 09:05:43 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 14ED44068F; Tue, 20 Jul 2021 09:05:43 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 5E7F54068B for ; Tue, 20 Jul 2021 09:05:41 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16K6u3FE020212 for ; Tue, 20 Jul 2021 00:05:40 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=Gm/anjLyYTzFg6oV+Yq122LE4gDL1/orw6jaI6aitZM=; b=RDWOUzl1QvupEvWYa97mJYYjlWrl/JTFtXsfriWpdDKgykNdqjMO0NlPsti2zNlqnfX3 Lzjy+lRRsMpdNQNnya+1TEFSNX17UDc0S7KQnfh71Ex8fXdkNAsQ4a71VF8fU5n15l1P fW9I/4ZOLdLV3FUilyHxPMrQ/qeTabx6Y8m6j5EsNlTrz6i7wuLMxSOi9W0NPR5/UnAi 7ZvWFzKmroucpGdeqsn1KA4kUtOxYeMNJOYyDU8dcDNISpRgpLsHpv2pRUGBmR1ZPxIu yR7XQz/bSAGikDyMcmMbREx93M/iExBpWgrkMpXy3nx7lu2gDzWChVtZStzxo2KXTfzk SQ== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com with ESMTP id 39vytqd6ra-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Tue, 20 Jul 2021 00:05:37 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Tue, 20 Jul 2021 00:04:41 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.18 via Frontend Transport; Tue, 20 Jul 2021 00:04:40 -0700 Received: from BG-LT7430.marvell.com (BG-LT7430.marvell.com [10.28.177.176]) by maili.marvell.com (Postfix) with ESMTP id 051F93F7048; Tue, 20 Jul 2021 00:04:38 -0700 (PDT) From: To: , Pavan Nikhilesh , "Shijith Thotton" CC: Date: Tue, 20 Jul 2021 12:34:32 +0530 Message-ID: <20210720070432.1649-1-pbhagavatula@marvell.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: 7BNSHCoQV-HuPc4EOvsG9gmuWKqBYNSH X-Proofpoint-GUID: 7BNSHCoQV-HuPc4EOvsG9gmuWKqBYNSH X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.790 definitions=2021-07-20_04:2021-07-19, 2021-07-20 signatures=0 Subject: [dpdk-dev] [PATCH] event/cnxk: fix reading stale Tx queue depth X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" From: Pavan Nikhilesh Reads to Tx queue FC memory need to be atomic to avoid cores using same Tx queue spinning on stale values. Fixes: 313e884a22fd ("event/cnxk: support Tx adapter fast path") Signed-off-by: Pavan Nikhilesh --- Please squash this into next-event tree drivers/event/cnxk/cn9k_worker.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/event/cnxk/cn9k_worker.h b/drivers/event/cnxk/cn9k_worker.h index cc1e141957..9b2a0bf882 100644 --- a/drivers/event/cnxk/cn9k_worker.h +++ b/drivers/event/cnxk/cn9k_worker.h @@ -420,7 +420,8 @@ NIX_RX_FASTPATH_MODES static __rte_always_inline void cn9k_sso_txq_fc_wait(const struct cn9k_eth_txq *txq) { - while (!(((txq)->nb_sqb_bufs_adj - *(txq)->fc_mem) + while (!((txq->nb_sqb_bufs_adj - + __atomic_load_n(txq->fc_mem, __ATOMIC_RELAXED)) << (txq)->sqes_per_sqb_log2)) ; } -- 2.17.1