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 83E5AA00C3; Tue, 16 Aug 2022 17:35:53 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 28CA540691; Tue, 16 Aug 2022 17:35:53 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id AD1AE40150 for ; Tue, 16 Aug 2022 17:35:51 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 27G7106x028935 for ; Tue, 16 Aug 2022 08:35:51 -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=Q2jYDXn8jJfJMF7S9jVprKwK1bz7NqGp1qBBIoEhF3I=; b=NMnAACI3UKK7ifzivxX7uNQYj+HLvzjWXpIkuUvYlMOXgmTn4VkiaK0XW59DgkvuT5iH zXTtktHorb36EBRn0Ys1xYBQVd7imPvSuvTvOq5dyfPjAeD3DU/I4OjOCJ+gooZJmQP/ wPvFoyiBVwtKEO6pQi+HKAov1HO1CsI/nE0Uq23zHAX0i2BOa8avoCG/NZ76U/fIZwLQ gs1Dbmh0PqSX1MeIaL03OMAi+HAQEt1g+iL66vBiq5vRhEF/hQYhW/wvltkQSaermtc8 j8m62eLwKRUy4KvyOYLiTwi42dFk3jWm5uJw5wna2HAv61utzpMBqRNfts87q7ZjX91Z yQ== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3hxbfkux2v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Tue, 16 Aug 2022 08:35:50 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Tue, 16 Aug 2022 08:35:48 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.18 via Frontend Transport; Tue, 16 Aug 2022 08:35:48 -0700 Received: from MININT-80QBFE8.corp.innovium.com (unknown [10.28.161.88]) by maili.marvell.com (Postfix) with ESMTP id 2156E3F704B; Tue, 16 Aug 2022 08:35:46 -0700 (PDT) From: To: , Pavan Nikhilesh , "Shijith Thotton" CC: Subject: [PATCH] event/cnxk: add preliminary Tx queue depth check Date: Tue, 16 Aug 2022 21:05:45 +0530 Message-ID: <20220816153545.7536-1-pbhagavatula@marvell.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: gUQ9mC6G1txPDQJpP_aSfuOiy9DBE-t_ X-Proofpoint-ORIG-GUID: gUQ9mC6G1txPDQJpP_aSfuOiy9DBE-t_ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-08-16_08,2022-08-16_02,2022-06-22_01 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 From: Pavan Nikhilesh add preliminary Tx queue depth check and return on failure. Once the check passes, tx_adapter_enqueue() function becomes a blocking call till it succeeds. Signed-off-by: Pavan Nikhilesh --- drivers/event/cnxk/cn10k_worker.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/event/cnxk/cn10k_worker.h b/drivers/event/cnxk/cn10k_worker.h index 0915f404e0..a71e076ff8 100644 --- a/drivers/event/cnxk/cn10k_worker.h +++ b/drivers/event/cnxk/cn10k_worker.h @@ -655,6 +655,11 @@ cn10k_sso_hws_event_tx(struct cn10k_sso_hws *ws, struct rte_event *ev, } m = ev->mbuf; + txq = cn10k_sso_hws_xtract_meta(m, txq_data); + if (((txq->nb_sqb_bufs_adj - + __atomic_load_n((int16_t *)txq->fc_mem, __ATOMIC_RELAXED)) + << txq->sqes_per_sqb_log2) <= 0) + return 0; cn10k_sso_tx_one(ws, m, cmd, lmt_id, lmt_addr, ev->sched_type, txq_data, flags); -- 2.25.1