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 53BDA41DC3; Fri, 3 Mar 2023 09:10:56 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3983440EE3; Fri, 3 Mar 2023 09:10:56 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 1D3A940687 for ; Fri, 3 Mar 2023 09:10:54 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3236OVv8007642 for ; Fri, 3 Mar 2023 00:10:53 -0800 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=6I3x/jhc8Q9ZQ7B1+TEaX6kDyWGZVz7tD/00dB19f0s=; b=aUfMH2noQcWcHxRb4GhUEalep3TPUAzkj6qKJgGmYOXUjwH8MDcUQEVidoYYu5QnRujx 2td+vHTE2NPrnWKcWmhY2eaa7qvtYxXwvxX4IuNyijrW8bt2gjQR4VCM07JM9AHwZA3n c9JKAXMEdQ1DamWSP0JHqnDM5PRPh4nkC3BT23V7QP0dLL6Zj7vqz4XdaqO0uWhnlWW9 QBi7JXGTv3kdEr0CKaspc1QLrMGN5TzOlq9mBfx9HVqm1JRDv6369hJeYrIyrgYQ1BX9 rBG56iEV7+7ueA50jjUdxv8u5wY+lL8Qmsdr8bBtxniBesVp2qjkGweqWNrXAhWq49Dm Mg== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3p1wr9xbh1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Fri, 03 Mar 2023 00:10:53 -0800 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Fri, 3 Mar 2023 00:10:50 -0800 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.42 via Frontend Transport; Fri, 3 Mar 2023 00:10:50 -0800 Received: from hyd1588t430.caveonetworks.com (unknown [10.29.52.204]) by maili.marvell.com (Postfix) with ESMTP id 697465B695B; Fri, 3 Mar 2023 00:10:47 -0800 (PST) From: Nithin Dabilpuram To: Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao CC: , , Rakesh Kudurumalla Subject: [PATCH 01/15] net/cnxk: resolve sefgault caused during transmit completion Date: Fri, 3 Mar 2023 13:39:59 +0530 Message-ID: <20230303081013.589868-1-ndabilpuram@marvell.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: p4l42RI2DwlLb4r7XZVDQsO82m0TgneE X-Proofpoint-GUID: p4l42RI2DwlLb4r7XZVDQsO82m0TgneE X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-03_01,2023-03-02_02,2023-02-09_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: Rakesh Kudurumalla while sending external buffers from application if tx_compl_ena is not provided as devargs, cq for transmit completion is not initialized but the same is accessed in driver resulting in segfault. This patch fixes the same by calling callback handler before the actual packet is transmitted Signed-off-by: Rakesh Kudurumalla --- Depends-on: series-27133 ("common/cnxk: add cnf10ka A1 platform") drivers/net/cnxk/cn10k_tx.h | 4 ++++ drivers/net/cnxk/cn9k_tx.h | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/drivers/net/cnxk/cn10k_tx.h b/drivers/net/cnxk/cn10k_tx.h index 1c1ce9642a..d0f7bc22a4 100644 --- a/drivers/net/cnxk/cn10k_tx.h +++ b/drivers/net/cnxk/cn10k_tx.h @@ -650,6 +650,10 @@ cn10k_nix_prefree_seg(struct rte_mbuf *m, struct cn10k_eth_txq *txq, uint32_t sqe_id; if (RTE_MBUF_HAS_EXTBUF(m)) { + if (unlikely(txq->tx_compl.ena == 0)) { + rte_pktmbuf_free_seg(m); + return 1; + } if (send_hdr->w0.pnc) { txq->tx_compl.ptr[send_hdr->w1.sqe_id]->next = m; } else { diff --git a/drivers/net/cnxk/cn9k_tx.h b/drivers/net/cnxk/cn9k_tx.h index b4ef45d65c..52661a624c 100644 --- a/drivers/net/cnxk/cn9k_tx.h +++ b/drivers/net/cnxk/cn9k_tx.h @@ -88,6 +88,10 @@ cn9k_nix_prefree_seg(struct rte_mbuf *m, struct cn9k_eth_txq *txq, uint32_t sqe_id; if (RTE_MBUF_HAS_EXTBUF(m)) { + if (unlikely(txq->tx_compl.ena == 0)) { + rte_pktmbuf_free_seg(m); + return 1; + } if (send_hdr->w0.pnc) { txq->tx_compl.ptr[send_hdr->w1.sqe_id]->next = m; } else { -- 2.25.1