All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] app/test: fix crypto mbuf pool size
@ 2016-10-07 11:34 Piotr Azarewicz
  2016-10-10 15:37 ` Trahe, Fiona
  2016-10-11 10:06 ` [PATCH v2] " Piotr Azarewicz
  0 siblings, 2 replies; 5+ messages in thread
From: Piotr Azarewicz @ 2016-10-07 11:34 UTC (permalink / raw)
  To: fiona.trahe; +Cc: dev

This patch fix that created pool for crypto mbufs may be too big in some
environments.
To avoid the issue, mbuf pool is reverted to its previous size.
Moreover, here is added additional small pool with one large mbuf, what
is needed in large data test scenarios.

Fixes: 2070f885b76d ("app/test: added tests for libcrypto PMD")

Signed-off-by: Piotr Azarewicz <piotrx.t.azarewicz@intel.com>
---
 app/test/test_cryptodev.c |   28 +++++++++++++++++++++++++---
 1 file changed, 25 insertions(+), 3 deletions(-)

diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index 2917454..914bb0b 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -60,6 +60,7 @@ static enum rte_cryptodev_type gbl_cryptodev_type;
 
 struct crypto_testsuite_params {
 	struct rte_mempool *mbuf_pool;
+	struct rte_mempool *large_mbuf_pool;
 	struct rte_mempool *op_mpool;
 	struct rte_cryptodev_config conf;
 	struct rte_cryptodev_qp_conf qp_conf;
@@ -169,7 +170,7 @@ testsuite_setup(void)
 		/* Not already created so create */
 		ts_params->mbuf_pool = rte_pktmbuf_pool_create(
 				"CRYPTO_MBUFPOOL",
-				NUM_MBUFS, MBUF_CACHE_SIZE, 0, UINT16_MAX,
+				NUM_MBUFS, MBUF_CACHE_SIZE, 0, MBUF_SIZE,
 				rte_socket_id());
 		if (ts_params->mbuf_pool == NULL) {
 			RTE_LOG(ERR, USER1, "Can't create CRYPTO_MBUFPOOL\n");
@@ -177,6 +178,21 @@ testsuite_setup(void)
 		}
 	}
 
+	ts_params->large_mbuf_pool = rte_mempool_lookup(
+			"CRYPTO_LARGE_MBUFPOOL");
+	if (ts_params->large_mbuf_pool == NULL) {
+		/* Not already created so create */
+		ts_params->large_mbuf_pool = rte_pktmbuf_pool_create(
+				"CRYPTO_LARGE_MBUFPOOL",
+				1, 0, 0, UINT16_MAX,
+				rte_socket_id());
+		if (ts_params->large_mbuf_pool == NULL) {
+			RTE_LOG(ERR, USER1,
+				"Can't create CRYPTO_LARGE_MBUFPOOL\n");
+			return TEST_FAILED;
+		}
+	}
+
 	ts_params->op_mpool = rte_crypto_op_pool_create(
 			"MBUF_CRYPTO_SYM_OP_POOL",
 			RTE_CRYPTO_OP_TYPE_SYMMETRIC,
@@ -5149,7 +5165,10 @@ test_AES_GMAC_authentication(const struct gmac_test_data *tdata)
 	if (retval < 0)
 		return retval;
 
-	ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool);
+	if (tdata->aad.len == GMAC_LARGE_PLAINTEXT_LENGTH)
+		ut_params->ibuf = rte_pktmbuf_alloc(ts_params->large_mbuf_pool);
+	else
+		ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool);
 
 	memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0,
 			rte_pktmbuf_tailroom(ut_params->ibuf));
@@ -5233,7 +5252,10 @@ test_AES_GMAC_authentication_verify(const struct gmac_test_data *tdata)
 	if (retval < 0)
 		return retval;
 
-	ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool);
+	if (tdata->aad.len == GMAC_LARGE_PLAINTEXT_LENGTH)
+		ut_params->ibuf = rte_pktmbuf_alloc(ts_params->large_mbuf_pool);
+	else
+		ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool);
 
 	memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0,
 			rte_pktmbuf_tailroom(ut_params->ibuf));
-- 
1.7.9.5

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

* Re: [PATCH] app/test: fix crypto mbuf pool size
  2016-10-07 11:34 [PATCH] app/test: fix crypto mbuf pool size Piotr Azarewicz
@ 2016-10-10 15:37 ` Trahe, Fiona
  2016-10-11 10:06 ` [PATCH v2] " Piotr Azarewicz
  1 sibling, 0 replies; 5+ messages in thread
From: Trahe, Fiona @ 2016-10-10 15:37 UTC (permalink / raw)
  To: Azarewicz, PiotrX T; +Cc: dev

Hi Piotr,

> -----Original Message-----
> From: Azarewicz, PiotrX T
> Sent: Friday, October 7, 2016 12:35 PM
> To: Trahe, Fiona <fiona.trahe@intel.com>
> Cc: dev@dpdk.org
> Subject: [PATCH] app/test: fix crypto mbuf pool size
> 
> This patch fix that created pool for crypto mbufs may be too big in some
> environments.
> To avoid the issue, mbuf pool is reverted to its previous size.
> Moreover, here is added additional small pool with one large mbuf, what is
> needed in large data test scenarios.
> 
> Fixes: 2070f885b76d ("app/test: added tests for libcrypto PMD")
> 
> Signed-off-by: Piotr Azarewicz <piotrx.t.azarewicz@intel.com>
> ---
>  app/test/test_cryptodev.c |   28 +++++++++++++++++++++++++---
>  1 file changed, 25 insertions(+), 3 deletions(-)
> 
> diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c index
> 2917454..914bb0b 100644
> --- a/app/test/test_cryptodev.c
> +++ b/app/test/test_cryptodev.c
> @@ -60,6 +60,7 @@ static enum rte_cryptodev_type gbl_cryptodev_type;
> 
>  struct crypto_testsuite_params {
>  	struct rte_mempool *mbuf_pool;
> +	struct rte_mempool *large_mbuf_pool;
>  	struct rte_mempool *op_mpool;
>  	struct rte_cryptodev_config conf;
>  	struct rte_cryptodev_qp_conf qp_conf;
> @@ -169,7 +170,7 @@ testsuite_setup(void)
>  		/* Not already created so create */
>  		ts_params->mbuf_pool = rte_pktmbuf_pool_create(
>  				"CRYPTO_MBUFPOOL",
> -				NUM_MBUFS, MBUF_CACHE_SIZE, 0,
> UINT16_MAX,
> +				NUM_MBUFS, MBUF_CACHE_SIZE, 0,
> MBUF_SIZE,
>  				rte_socket_id());
>  		if (ts_params->mbuf_pool == NULL) {
>  			RTE_LOG(ERR, USER1, "Can't create
> CRYPTO_MBUFPOOL\n"); @@ -177,6 +178,21 @@ testsuite_setup(void)
>  		}
>  	}
> 
> +	ts_params->large_mbuf_pool = rte_mempool_lookup(
> +			"CRYPTO_LARGE_MBUFPOOL");
> +	if (ts_params->large_mbuf_pool == NULL) {
> +		/* Not already created so create */
> +		ts_params->large_mbuf_pool = rte_pktmbuf_pool_create(
> +				"CRYPTO_LARGE_MBUFPOOL",
> +				1, 0, 0, UINT16_MAX,
> +				rte_socket_id());
> +		if (ts_params->large_mbuf_pool == NULL) {
> +			RTE_LOG(ERR, USER1,
> +				"Can't create
> CRYPTO_LARGE_MBUFPOOL\n");
> +			return TEST_FAILED;
> +		}
> +	}
> +
>  	ts_params->op_mpool = rte_crypto_op_pool_create(
>  			"MBUF_CRYPTO_SYM_OP_POOL",
>  			RTE_CRYPTO_OP_TYPE_SYMMETRIC,
> @@ -5149,7 +5165,10 @@ test_AES_GMAC_authentication(const struct
> gmac_test_data *tdata)
>  	if (retval < 0)
>  		return retval;
> 
> -	ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool);
> +	if (tdata->aad.len == GMAC_LARGE_PLAINTEXT_LENGTH)
> +		ut_params->ibuf = rte_pktmbuf_alloc(ts_params-
> >large_mbuf_pool);
> +	else
> +		ut_params->ibuf = rte_pktmbuf_alloc(ts_params-
> >mbuf_pool);
> 
It would be safer to test if aad.len > MBUF_SIZE, here and below.


>  	memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0,
>  			rte_pktmbuf_tailroom(ut_params->ibuf));
> @@ -5233,7 +5252,10 @@ test_AES_GMAC_authentication_verify(const
> struct gmac_test_data *tdata)
>  	if (retval < 0)
>  		return retval;
> 
> -	ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool);
> +	if (tdata->aad.len == GMAC_LARGE_PLAINTEXT_LENGTH)
> +		ut_params->ibuf = rte_pktmbuf_alloc(ts_params-
> >large_mbuf_pool);
> +	else
> +		ut_params->ibuf = rte_pktmbuf_alloc(ts_params-
> >mbuf_pool);
> 
>  	memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0,
>  			rte_pktmbuf_tailroom(ut_params->ibuf));
> --
> 1.7.9.5

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

* [PATCH v2] app/test: fix crypto mbuf pool size
  2016-10-07 11:34 [PATCH] app/test: fix crypto mbuf pool size Piotr Azarewicz
  2016-10-10 15:37 ` Trahe, Fiona
@ 2016-10-11 10:06 ` Piotr Azarewicz
  2016-10-13  8:47   ` Jastrzebski, MichalX K
  1 sibling, 1 reply; 5+ messages in thread
From: Piotr Azarewicz @ 2016-10-11 10:06 UTC (permalink / raw)
  To: fiona.trahe; +Cc: dev

This patch fix that created pool for crypto mbufs may be too big in some
environments.
To avoid the issue, mbuf pool is reverted to its previous size.
Moreover, here is added additional small pool with one large mbuf, what
is needed in large data test scenarios.

Fixes: ffbe3be0d4b5 ("app/test: add libcrypto")

Signed-off-by: Piotr Azarewicz <piotrx.t.azarewicz@intel.com>
---

v2 change:
- changed check if aad.len > MBUF_SIZE
- added assertion check for rte_pktmbuf_alloc

 app/test/test_cryptodev.c |   32 +++++++++++++++++++++++++++++---
 1 file changed, 29 insertions(+), 3 deletions(-)

diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index 2917454..7d03899 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -60,6 +60,7 @@ static enum rte_cryptodev_type gbl_cryptodev_type;
 
 struct crypto_testsuite_params {
 	struct rte_mempool *mbuf_pool;
+	struct rte_mempool *large_mbuf_pool;
 	struct rte_mempool *op_mpool;
 	struct rte_cryptodev_config conf;
 	struct rte_cryptodev_qp_conf qp_conf;
@@ -169,7 +170,7 @@ testsuite_setup(void)
 		/* Not already created so create */
 		ts_params->mbuf_pool = rte_pktmbuf_pool_create(
 				"CRYPTO_MBUFPOOL",
-				NUM_MBUFS, MBUF_CACHE_SIZE, 0, UINT16_MAX,
+				NUM_MBUFS, MBUF_CACHE_SIZE, 0, MBUF_SIZE,
 				rte_socket_id());
 		if (ts_params->mbuf_pool == NULL) {
 			RTE_LOG(ERR, USER1, "Can't create CRYPTO_MBUFPOOL\n");
@@ -177,6 +178,21 @@ testsuite_setup(void)
 		}
 	}
 
+	ts_params->large_mbuf_pool = rte_mempool_lookup(
+			"CRYPTO_LARGE_MBUFPOOL");
+	if (ts_params->large_mbuf_pool == NULL) {
+		/* Not already created so create */
+		ts_params->large_mbuf_pool = rte_pktmbuf_pool_create(
+				"CRYPTO_LARGE_MBUFPOOL",
+				1, 0, 0, UINT16_MAX,
+				rte_socket_id());
+		if (ts_params->large_mbuf_pool == NULL) {
+			RTE_LOG(ERR, USER1,
+				"Can't create CRYPTO_LARGE_MBUFPOOL\n");
+			return TEST_FAILED;
+		}
+	}
+
 	ts_params->op_mpool = rte_crypto_op_pool_create(
 			"MBUF_CRYPTO_SYM_OP_POOL",
 			RTE_CRYPTO_OP_TYPE_SYMMETRIC,
@@ -5149,7 +5165,12 @@ test_AES_GMAC_authentication(const struct gmac_test_data *tdata)
 	if (retval < 0)
 		return retval;
 
-	ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool);
+	if (tdata->aad.len > MBUF_SIZE)
+		ut_params->ibuf = rte_pktmbuf_alloc(ts_params->large_mbuf_pool);
+	else
+		ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool);
+	TEST_ASSERT_NOT_NULL(ut_params->ibuf,
+			"Failed to allocate input buffer in mempool");
 
 	memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0,
 			rte_pktmbuf_tailroom(ut_params->ibuf));
@@ -5233,7 +5254,12 @@ test_AES_GMAC_authentication_verify(const struct gmac_test_data *tdata)
 	if (retval < 0)
 		return retval;
 
-	ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool);
+	if (tdata->aad.len > MBUF_SIZE)
+		ut_params->ibuf = rte_pktmbuf_alloc(ts_params->large_mbuf_pool);
+	else
+		ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool);
+	TEST_ASSERT_NOT_NULL(ut_params->ibuf,
+			"Failed to allocate input buffer in mempool");
 
 	memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0,
 			rte_pktmbuf_tailroom(ut_params->ibuf));
-- 
1.7.9.5

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

* Re: [PATCH v2] app/test: fix crypto mbuf pool size
  2016-10-11 10:06 ` [PATCH v2] " Piotr Azarewicz
@ 2016-10-13  8:47   ` Jastrzebski, MichalX K
  2016-10-13 18:22     ` De Lara Guarch, Pablo
  0 siblings, 1 reply; 5+ messages in thread
From: Jastrzebski, MichalX K @ 2016-10-13  8:47 UTC (permalink / raw)
  To: Azarewicz, PiotrX T, Trahe, Fiona; +Cc: dev

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Piotr Azarewicz
> Sent: Tuesday, October 11, 2016 12:07 PM
> To: Trahe, Fiona <fiona.trahe@intel.com>
> Cc: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH v2] app/test: fix crypto mbuf pool size
> 
> This patch fix that created pool for crypto mbufs may be too big in some
> environments.
> To avoid the issue, mbuf pool is reverted to its previous size.
> Moreover, here is added additional small pool with one large mbuf, what
> is needed in large data test scenarios.
> 
> Fixes: ffbe3be0d4b5 ("app/test: add libcrypto")
> 
> Signed-off-by: Piotr Azarewicz <piotrx.t.azarewicz@intel.com>
> ---
> 
> v2 change:
> - changed check if aad.len > MBUF_SIZE
> - added assertion check for rte_pktmbuf_alloc
> 
>  app/test/test_cryptodev.c |   32 +++++++++++++++++++++++++++++---
>  1 file changed, 29 insertions(+), 3 deletions(-)
> 
> diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
> index 2917454..7d03899 100644
> --- a/app/test/test_cryptodev.c
> +++ b/app/test/test_cryptodev.c
> @@ -60,6 +60,7 @@ static enum rte_cryptodev_type gbl_cryptodev_type;
> 
>  struct crypto_testsuite_params {
>  	struct rte_mempool *mbuf_pool;
> +	struct rte_mempool *large_mbuf_pool;
>  	struct rte_mempool *op_mpool;
>  	struct rte_cryptodev_config conf;
>  	struct rte_cryptodev_qp_conf qp_conf;
> @@ -169,7 +170,7 @@ testsuite_setup(void)
>  		/* Not already created so create */
>  		ts_params->mbuf_pool = rte_pktmbuf_pool_create(
>  				"CRYPTO_MBUFPOOL",
> -				NUM_MBUFS, MBUF_CACHE_SIZE, 0,
> UINT16_MAX,
> +				NUM_MBUFS, MBUF_CACHE_SIZE, 0,
> MBUF_SIZE,
>  				rte_socket_id());
>  		if (ts_params->mbuf_pool == NULL) {
>  			RTE_LOG(ERR, USER1, "Can't create
> CRYPTO_MBUFPOOL\n");
> @@ -177,6 +178,21 @@ testsuite_setup(void)
>  		}
>  	}
> 
> +	ts_params->large_mbuf_pool = rte_mempool_lookup(
> +			"CRYPTO_LARGE_MBUFPOOL");
> +	if (ts_params->large_mbuf_pool == NULL) {
> +		/* Not already created so create */
> +		ts_params->large_mbuf_pool = rte_pktmbuf_pool_create(
> +				"CRYPTO_LARGE_MBUFPOOL",
> +				1, 0, 0, UINT16_MAX,
> +				rte_socket_id());
> +		if (ts_params->large_mbuf_pool == NULL) {
> +			RTE_LOG(ERR, USER1,
> +				"Can't create
> CRYPTO_LARGE_MBUFPOOL\n");
> +			return TEST_FAILED;
> +		}
> +	}
> +
>  	ts_params->op_mpool = rte_crypto_op_pool_create(
>  			"MBUF_CRYPTO_SYM_OP_POOL",
>  			RTE_CRYPTO_OP_TYPE_SYMMETRIC,
> @@ -5149,7 +5165,12 @@ test_AES_GMAC_authentication(const struct
> gmac_test_data *tdata)
>  	if (retval < 0)
>  		return retval;
> 
> -	ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool);
> +	if (tdata->aad.len > MBUF_SIZE)
> +		ut_params->ibuf = rte_pktmbuf_alloc(ts_params-
> >large_mbuf_pool);
> +	else
> +		ut_params->ibuf = rte_pktmbuf_alloc(ts_params-
> >mbuf_pool);
> +	TEST_ASSERT_NOT_NULL(ut_params->ibuf,
> +			"Failed to allocate input buffer in mempool");
> 
>  	memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0,
>  			rte_pktmbuf_tailroom(ut_params->ibuf));
> @@ -5233,7 +5254,12 @@ test_AES_GMAC_authentication_verify(const
> struct gmac_test_data *tdata)
>  	if (retval < 0)
>  		return retval;
> 
> -	ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool);
> +	if (tdata->aad.len > MBUF_SIZE)
> +		ut_params->ibuf = rte_pktmbuf_alloc(ts_params-
> >large_mbuf_pool);
> +	else
> +		ut_params->ibuf = rte_pktmbuf_alloc(ts_params-
> >mbuf_pool);
> +	TEST_ASSERT_NOT_NULL(ut_params->ibuf,
> +			"Failed to allocate input buffer in mempool");
> 
>  	memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0,
>  			rte_pktmbuf_tailroom(ut_params->ibuf));
> --
> 1.7.9.5

Acked-by: Michal Jastrzebski <michalx.k.jastrzebski@intel.com>

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

* Re: [PATCH v2] app/test: fix crypto mbuf pool size
  2016-10-13  8:47   ` Jastrzebski, MichalX K
@ 2016-10-13 18:22     ` De Lara Guarch, Pablo
  0 siblings, 0 replies; 5+ messages in thread
From: De Lara Guarch, Pablo @ 2016-10-13 18:22 UTC (permalink / raw)
  To: Jastrzebski, MichalX K, Azarewicz, PiotrX T, Trahe, Fiona; +Cc: dev



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Jastrzebski, MichalX
> K
> Sent: Thursday, October 13, 2016 1:48 AM
> To: Azarewicz, PiotrX T; Trahe, Fiona
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v2] app/test: fix crypto mbuf pool size
> 
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Piotr Azarewicz
> > Sent: Tuesday, October 11, 2016 12:07 PM
> > To: Trahe, Fiona <fiona.trahe@intel.com>
> > Cc: dev@dpdk.org
> > Subject: [dpdk-dev] [PATCH v2] app/test: fix crypto mbuf pool size
> >
> > This patch fix that created pool for crypto mbufs may be too big in some
> > environments.
> > To avoid the issue, mbuf pool is reverted to its previous size.
> > Moreover, here is added additional small pool with one large mbuf, what
> > is needed in large data test scenarios.
> >
> > Fixes: ffbe3be0d4b5 ("app/test: add libcrypto")
> >
> > Signed-off-by: Piotr Azarewicz <piotrx.t.azarewicz@intel.com>
> 
> Acked-by: Michal Jastrzebski <michalx.k.jastrzebski@intel.com>

Applied to dpdk-next-crypto.
Thanks,

Pablo

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

end of thread, other threads:[~2016-10-13 18:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-07 11:34 [PATCH] app/test: fix crypto mbuf pool size Piotr Azarewicz
2016-10-10 15:37 ` Trahe, Fiona
2016-10-11 10:06 ` [PATCH v2] " Piotr Azarewicz
2016-10-13  8:47   ` Jastrzebski, MichalX K
2016-10-13 18:22     ` De Lara Guarch, Pablo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.