Thread (30 messages) 30 messages, 4 authors, 2018-07-10
STALE2908d

[PATCH v2 4/4] crypto/scheduler: add minimum head/tailroom requirement

From: Anoob Joseph <hidden>
Date: 2018-07-10 14:44:47
Subsystem: crypto api, the rest · Maintainers: Herbert Xu, "David S. Miller", Linus Torvalds

Minimum head/tailroom requirement for each PMD has to be considered
while populating the dev_info.

Signed-off-by: Anoob Joseph <redacted>
---
v2:
* Added this patch

 drivers/crypto/scheduler/scheduler_pmd_ops.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
diff --git a/drivers/crypto/scheduler/scheduler_pmd_ops.c b/drivers/crypto/scheduler/scheduler_pmd_ops.c
index 147dc51..984ea8c 100644
--- a/drivers/crypto/scheduler/scheduler_pmd_ops.c
+++ b/drivers/crypto/scheduler/scheduler_pmd_ops.c
@@ -323,6 +323,8 @@ scheduler_pmd_info_get(struct rte_cryptodev *dev,
 	struct scheduler_ctx *sched_ctx = dev->data->dev_private;
 	uint32_t max_nb_sessions = sched_ctx->nb_slaves ?
 			UINT32_MAX : RTE_CRYPTODEV_PMD_DEFAULT_MAX_NB_SESSIONS;
+	uint16_t headroom_sz = 0;
+	uint16_t tailroom_sz = 0;
 	uint32_t i;
 
 	if (!dev_info)
@@ -342,12 +344,26 @@ scheduler_pmd_info_get(struct rte_cryptodev *dev,
 				max_nb_sessions ?
 				slave_info.sym.max_nb_sessions :
 				max_nb_sessions;
+
+		/* Get the max headroom requirement among slave PMDs */
+		headroom_sz = slave_info.min_mbuf_headroom_req >
+				headroom_sz ?
+				slave_info.min_mbuf_headroom_req :
+				headroom_sz;
+
+		/* Get the max tailroom requirement among slave PMDs */
+		tailroom_sz = slave_info.min_mbuf_tailroom_req >
+				tailroom_sz ?
+				slave_info.min_mbuf_tailroom_req :
+				tailroom_sz;
 	}
 
 	dev_info->driver_id = dev->driver_id;
 	dev_info->feature_flags = dev->feature_flags;
 	dev_info->capabilities = sched_ctx->capabilities;
 	dev_info->max_nb_queue_pairs = sched_ctx->max_nb_queue_pairs;
+	dev_info->min_mbuf_headroom_req = headroom_sz;
+	dev_info->min_mbuf_tailroom_req = tailroom_sz;
 	dev_info->sym.max_nb_sessions = max_nb_sessions;
 }
 
-- 
2.7.4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help