<div dir="ltr"><div dir="ltr">Recheck-request: iol-broadcom-Performance<div><br></div><div>This patch should not fail a performance test in CI - checking with a rerun now. </div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Feb 26, 2024 at 5:25 AM Radu Nicolau <<a href="mailto:radu.nicolau@intel.com">radu.nicolau@intel.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">There are use cases where a SA should be able to use different cryptodevs on<br>
different lcores, for example there can be cryptodevs with just 1 qp per VF.<br>
For this purpose this patch relaxes the check in create lookaside session function.<br>
Also add a check to verify that a CQP is available for the current lcore.<br>
<br>
Fixes: a8ade12123c3 ("examples/ipsec-secgw: create lookaside sessions at init")<br>
Cc: <a href="mailto:stable@dpdk.org" target="_blank">stable@dpdk.org</a><br>
Cc: <a href="mailto:vfialko@marvell.com" target="_blank">vfialko@marvell.com</a><br>
<br>
Signed-off-by: Radu Nicolau <<a href="mailto:radu.nicolau@intel.com" target="_blank">radu.nicolau@intel.com</a>><br>
Tested-by: Ting-Kai Ku <<a href="mailto:ting-kai.ku@intel.com" target="_blank">ting-kai.ku@intel.com</a>><br>
Acked-by: Ciara Power <<a href="mailto:ciara.power@intel.com" target="_blank">ciara.power@intel.com</a>><br>
Acked-by: Kai Ji <<a href="mailto:kai.ji@intel.com" target="_blank">kai.ji@intel.com</a>><br>
---<br>
v3: check if the cryptodev are not of the same type<br>
<br>
examples/ipsec-secgw/ipsec.c | 25 ++++++++++++++++++++-----<br>
1 file changed, 20 insertions(+), 5 deletions(-)<br>
<br>
diff --git a/examples/ipsec-secgw/ipsec.c b/examples/ipsec-secgw/ipsec.c<br>
index f5cec4a928..b59576c049 100644<br>
--- a/examples/ipsec-secgw/ipsec.c<br>
+++ b/examples/ipsec-secgw/ipsec.c<br>
@@ -288,10 +288,21 @@ create_lookaside_session(struct ipsec_ctx *ipsec_ctx_lcore[],<br>
if (cdev_id == RTE_CRYPTO_MAX_DEVS)<br>
cdev_id = ipsec_ctx->tbl[cdev_id_qp].id;<br>
else if (cdev_id != ipsec_ctx->tbl[cdev_id_qp].id) {<br>
- RTE_LOG(ERR, IPSEC,<br>
- "SA mapping to multiple cryptodevs is "<br>
- "not supported!");<br>
- return -EINVAL;<br>
+ struct rte_cryptodev_info dev_info_1, dev_info_2;<br>
+ rte_cryptodev_info_get(cdev_id, &dev_info_1);<br>
+ rte_cryptodev_info_get(ipsec_ctx->tbl[cdev_id_qp].id,<br>
+ &dev_info_2);<br>
+ if (dev_info_1.driver_id == dev_info_2.driver_id) {<br>
+ RTE_LOG(WARNING, IPSEC,<br>
+ "SA mapped to multiple cryptodevs for SPI %d\n",<br>
+ sa->spi);<br>
+<br>
+ } else {<br>
+ RTE_LOG(WARNING, IPSEC,<br>
+ "SA mapped to multiple cryptodevs of different types for SPI %d\n",<br>
+ sa->spi);<br>
+<br>
+ }<br>
}<br>
<br>
/* Store per core queue pair information */<br>
@@ -908,7 +919,11 @@ ipsec_enqueue(ipsec_xform_fn xform_func, struct ipsec_ctx *ipsec_ctx,<br>
continue;<br>
}<br>
<br>
- enqueue_cop(sa->cqp[ipsec_ctx->lcore_id], &priv->cop);<br>
+ if (likely(sa->cqp[ipsec_ctx->lcore_id]))<br>
+ enqueue_cop(sa->cqp[ipsec_ctx->lcore_id], &priv->cop);<br>
+ else<br>
+ RTE_LOG(ERR, IPSEC, "No CQP available for lcore %d\n",<br>
+ ipsec_ctx->lcore_id);<br>
}<br>
}<br>
<br>
-- <br>
2.34.1<br>
<br>
</blockquote></div><br clear="all"><div><br></div></div>