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 7985CA0540; Mon, 30 May 2022 15:08:25 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2848A40E28; Mon, 30 May 2022 15:08:25 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 5381340694 for ; Mon, 30 May 2022 15:08:24 +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 24UC1RSu018928 for ; Mon, 30 May 2022 06:08:23 -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=n1ZoDKFEYeYQaaQN7zkI4rJs1TP9AcKTVilUCvL6II8=; b=c+j/OreFcezJL9z5RgWiAs/0P9UqaRQ/XhfOKwOxDxfoIBrlzdKdJ5QxJjtL6h48t2mk Z0gIhj3EDmxGAwrVoQFHENBt8IRPRSO4+YuBdwmKPVYjZJefGBwObXK48ydJ0FFCIApI KpbCmnIyEBHODztL5IKHc91ry8OkpSARJTbwa2g8AjnCpd2aEJvy/FI75S9S4uR0dRdB ERl0LgyE5nTXtQVqNyws+Zk0vW51ac5F8rs1qx44StZ2G0uYDU5khfsp1i9Yntrbmpi9 o40QmZhlqd8579Ftgbyf2fMs+Wi3h1z7uz+vWaIONAEHcSoT8h9U1cIFzDYDlB63b5Yw fg== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3gbk8n5gcq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Mon, 30 May 2022 06:08:23 -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; Mon, 30 May 2022 06:08:21 -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.2 via Frontend Transport; Mon, 30 May 2022 06:08:21 -0700 Received: from localhost.localdomain (unknown [10.28.34.39]) by maili.marvell.com (Postfix) with ESMTP id 816E73F70C1; Mon, 30 May 2022 06:08:19 -0700 (PDT) From: Volodymyr Fialko To: , Pavan Nikhilesh , "Shijith Thotton" CC: , , Volodymyr Fialko Subject: [PATCH] event/cnxk: add free for Tx adapter Date: Mon, 30 May 2022 15:08:16 +0200 Message-ID: <20220530130816.1136587-1-vfialko@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: AIzHNQFSaWFzaUcv317uDhSyjZhT1G_7 X-Proofpoint-GUID: AIzHNQFSaWFzaUcv317uDhSyjZhT1G_7 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.874,Hydra:6.0.486,FMLib:17.11.64.514 definitions=2022-05-30_04,2022-05-30_01,2022-02-23_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 Tx adapter allocate data during eth_tx_adapter_queue_add() call and it's only cleaned but not freed during eth_tx_adapter_queue_del(). Implemented eth_tx_adapter_free() callback to free adapter data. Signed-off-by: Volodymyr Fialko Change-Id: I72480c5ac8a65688aa790d4ad66a2f5b0c3148a9 --- drivers/event/cnxk/cn10k_eventdev.c | 3 +++ drivers/event/cnxk/cn9k_eventdev.c | 3 +++ drivers/event/cnxk/cnxk_eventdev.h | 4 +++ drivers/event/cnxk/cnxk_eventdev_adptr.c | 34 ++++++++++++++++++++++++ 4 files changed, 44 insertions(+) diff --git a/drivers/event/cnxk/cn10k_eventdev.c b/drivers/event/cnxk/cn10k_eventdev.c index 214eca4239..110c7af439 100644 --- a/drivers/event/cnxk/cn10k_eventdev.c +++ b/drivers/event/cnxk/cn10k_eventdev.c @@ -878,6 +878,9 @@ static struct eventdev_ops cn10k_sso_dev_ops = { .eth_tx_adapter_caps_get = cn10k_sso_tx_adapter_caps_get, .eth_tx_adapter_queue_add = cn10k_sso_tx_adapter_queue_add, .eth_tx_adapter_queue_del = cn10k_sso_tx_adapter_queue_del, + .eth_tx_adapter_start = cnxk_sso_tx_adapter_start, + .eth_tx_adapter_stop = cnxk_sso_tx_adapter_stop, + .eth_tx_adapter_free = cnxk_sso_tx_adapter_free, .timer_adapter_caps_get = cnxk_tim_caps_get, diff --git a/drivers/event/cnxk/cn9k_eventdev.c b/drivers/event/cnxk/cn9k_eventdev.c index 076847d9a4..bf7bbc2c43 100644 --- a/drivers/event/cnxk/cn9k_eventdev.c +++ b/drivers/event/cnxk/cn9k_eventdev.c @@ -1110,6 +1110,9 @@ static struct eventdev_ops cn9k_sso_dev_ops = { .eth_tx_adapter_caps_get = cn9k_sso_tx_adapter_caps_get, .eth_tx_adapter_queue_add = cn9k_sso_tx_adapter_queue_add, .eth_tx_adapter_queue_del = cn9k_sso_tx_adapter_queue_del, + .eth_tx_adapter_start = cnxk_sso_tx_adapter_start, + .eth_tx_adapter_stop = cnxk_sso_tx_adapter_stop, + .eth_tx_adapter_free = cnxk_sso_tx_adapter_free, .timer_adapter_caps_get = cnxk_tim_caps_get, diff --git a/drivers/event/cnxk/cnxk_eventdev.h b/drivers/event/cnxk/cnxk_eventdev.h index e7cd90095d..baee5d11f0 100644 --- a/drivers/event/cnxk/cnxk_eventdev.h +++ b/drivers/event/cnxk/cnxk_eventdev.h @@ -113,6 +113,7 @@ struct cnxk_sso_evdev { uint16_t max_port_id; uint16_t max_queue_id[RTE_MAX_ETHPORTS]; uint8_t tx_adptr_configured; + uint32_t tx_adptr_active_mask; uint16_t tim_adptr_ring_cnt; uint16_t *timer_adptr_rings; uint64_t *timer_adptr_sz; @@ -310,5 +311,8 @@ int cnxk_sso_tx_adapter_queue_add(const struct rte_eventdev *event_dev, int cnxk_sso_tx_adapter_queue_del(const struct rte_eventdev *event_dev, const struct rte_eth_dev *eth_dev, int32_t tx_queue_id); +int cnxk_sso_tx_adapter_start(uint8_t id, const struct rte_eventdev *event_dev); +int cnxk_sso_tx_adapter_stop(uint8_t id, const struct rte_eventdev *event_dev); +int cnxk_sso_tx_adapter_free(uint8_t id, const struct rte_eventdev *event_dev); #endif /* __CNXK_EVENTDEV_H__ */ diff --git a/drivers/event/cnxk/cnxk_eventdev_adptr.c b/drivers/event/cnxk/cnxk_eventdev_adptr.c index fa96090bfa..586a7751e2 100644 --- a/drivers/event/cnxk/cnxk_eventdev_adptr.c +++ b/drivers/event/cnxk/cnxk_eventdev_adptr.c @@ -589,3 +589,37 @@ cnxk_sso_tx_adapter_queue_del(const struct rte_eventdev *event_dev, return 0; } + +int +cnxk_sso_tx_adapter_start(uint8_t id, const struct rte_eventdev *event_dev) +{ + struct cnxk_sso_evdev *dev = cnxk_sso_pmd_priv(event_dev); + + dev->tx_adptr_active_mask |= (1 << id); + + return 0; +} + +int +cnxk_sso_tx_adapter_stop(uint8_t id, const struct rte_eventdev *event_dev) +{ + struct cnxk_sso_evdev *dev = cnxk_sso_pmd_priv(event_dev); + + dev->tx_adptr_active_mask &= ~(1 << id); + + return 0; +} + +int +cnxk_sso_tx_adapter_free(uint8_t id __rte_unused, + const struct rte_eventdev *event_dev) +{ + struct cnxk_sso_evdev *dev = cnxk_sso_pmd_priv(event_dev); + + if (dev->tx_adptr_data_sz && dev->tx_adptr_active_mask == 0) { + dev->tx_adptr_data_sz = 0; + free(dev->tx_adptr_data); + } + + return 0; +} -- 2.25.1