DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] event/cnxk: add free for Tx adapter
@ 2022-05-26  8:13 Volodymyr Fialko
  0 siblings, 0 replies; 4+ messages in thread
From: Volodymyr Fialko @ 2022-05-26  8:13 UTC (permalink / raw)
  To: dev, Pavan Nikhilesh, Shijith Thotton
  Cc: jerinj, gakhil, anoobj, konstantin.ananyev, radu.nicolau,
	Volodymyr Fialko

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 <vfialko@marvell.com>
---
 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


^ permalink raw reply	[flat|nested] 4+ messages in thread
* [PATCH] event/cnxk: add free for Tx adapter
@ 2022-05-30 13:08 Volodymyr Fialko
  0 siblings, 0 replies; 4+ messages in thread
From: Volodymyr Fialko @ 2022-05-30 13:08 UTC (permalink / raw)
  To: dev, Pavan Nikhilesh, Shijith Thotton; +Cc: jerinj, anoobj, Volodymyr Fialko

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 <vfialko@marvell.com>
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


^ permalink raw reply	[flat|nested] 4+ messages in thread
* [PATCH] event/cnxk: add free for Tx adapter
@ 2022-05-30 13:19 Volodymyr Fialko
  2022-06-13  5:49 ` Jerin Jacob
  0 siblings, 1 reply; 4+ messages in thread
From: Volodymyr Fialko @ 2022-05-30 13:19 UTC (permalink / raw)
  To: dev, Pavan Nikhilesh, Shijith Thotton; +Cc: jerinj, anoobj, Volodymyr Fialko

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 <vfialko@marvell.com>
---
 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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-06-13  5:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-26  8:13 [PATCH] event/cnxk: add free for Tx adapter Volodymyr Fialko
2022-05-30 13:08 Volodymyr Fialko
2022-05-30 13:19 Volodymyr Fialko
2022-06-13  5:49 ` Jerin Jacob

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).