[v1] eventdev/event_crypto: process event port's impl rel cap

Message ID 20221130120323.1559191-1-ganapati.kundapura@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Jerin Jacob
Headers
Series [v1] eventdev/event_crypto: process event port's impl rel cap |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/intel-Testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance fail Performance Testing issues
ci/github-robot: build success github build: passed
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-abi-testing warning Testing issues
ci/iol-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS

Commit Message

Kundapura, Ganapati Nov. 30, 2022, 12:03 p.m. UTC
In the current implementation adapter queries event device's capability for
implicit release support.

This information is used to decide whether events are enqueued back as
NEW or FWD events.

This patch updates the adapter to query the port caps for implicit release
to decide on events enqueuing back as NEW/FWD events.

Signed-off-by: Ganapati Kundapura <ganapati.kundapura@intel.com>
  

Patch

diff --git a/lib/eventdev/rte_event_crypto_adapter.c b/lib/eventdev/rte_event_crypto_adapter.c
index 3c585d7..1c0a22b 100644
--- a/lib/eventdev/rte_event_crypto_adapter.c
+++ b/lib/eventdev/rte_event_crypto_adapter.c
@@ -53,7 +53,7 @@  struct event_crypto_adapter {
 	uint8_t eventdev_id;
 	/* Event port identifier */
 	uint8_t event_port_id;
-	/* Store event device's implicit release capability */
+	/* Store event port's implicit release capability */
 	uint8_t implicit_release_disabled;
 	/* Flag to indicate backpressure at cryptodev
 	 * Stop further dequeuing events from eventdev
@@ -320,7 +320,6 @@  rte_event_crypto_adapter_create_ext(uint8_t id, uint8_t dev_id,
 {
 	struct event_crypto_adapter *adapter;
 	char mem_name[CRYPTO_ADAPTER_NAME_LEN];
-	struct rte_event_dev_info dev_info;
 	int socket_id;
 	uint8_t i;
 	int ret;
@@ -361,17 +360,6 @@  rte_event_crypto_adapter_create_ext(uint8_t id, uint8_t dev_id,
 		return -ENOMEM;
 	}
 
-	ret = rte_event_dev_info_get(dev_id, &dev_info);
-	if (ret < 0) {
-		RTE_EDEV_LOG_ERR("Failed to get info for eventdev %d: %s!",
-				 dev_id, dev_info.driver_name);
-		eca_circular_buffer_free(&adapter->ebuf);
-		rte_free(adapter);
-		return ret;
-	}
-
-	adapter->implicit_release_disabled = (dev_info.event_dev_cap &
-			RTE_EVENT_DEV_CAP_IMPLICIT_RELEASE_DISABLE);
 	adapter->eventdev_id = dev_id;
 	adapter->socket_id = socket_id;
 	adapter->conf_cb = conf_cb;
@@ -837,6 +825,7 @@  eca_init_service(struct event_crypto_adapter *adapter, uint8_t id)
 	struct rte_event_crypto_adapter_conf adapter_conf;
 	struct rte_service_spec service;
 	int ret;
+	uint32_t impl_rel;
 
 	if (adapter->service_inited)
 		return 0;
@@ -866,6 +855,17 @@  eca_init_service(struct event_crypto_adapter *adapter, uint8_t id)
 
 	adapter->max_nb = adapter_conf.max_nb;
 	adapter->event_port_id = adapter_conf.event_port_id;
+
+	if (rte_event_port_attr_get(adapter->eventdev_id,
+				adapter->event_port_id,
+				RTE_EVENT_PORT_ATTR_IMPLICIT_RELEASE_DISABLE,
+				&impl_rel)) {
+		RTE_EDEV_LOG_ERR("Failed to get port info for eventdev %" PRId32,
+				 adapter->eventdev_id);
+		return -EINVAL;
+	}
+
+	adapter->implicit_release_disabled = (uint8_t)impl_rel;
 	adapter->service_inited = 1;
 
 	return ret;