Hi Abhinandan,
> >
> > > This is failing with asym changes. Please look into this.
> >
> > Thanks for pointing this out. It is failing as null crypto does not support 
> > asym
> > And asym_session_create would need an op from driver which is NULL for null
> > crypto
> >
> > Please check if below change is working for you.
> I could not apply this patch cleanly. I see that you are skipping the asym 
> test for
> NULL PMD.
> Can I use openssl or any open source PMD to test this feature? If yes, please
> provide the command line.

The patch is not skipping specifically null pmd.
It is not creating asym session and asym op mempools for devices which do not
Support asym sessions.

OpenSSL can be used as it support asym ops(vdev can be passed as command line 
arg),
But the test will not execute, as it would not support event crypto adapter.
This patch can be tested with PMD which support ASYM crypto adapter and no other
PMD support that as of now.

> >
> > diff --git a/app/test/test_event_crypto_adapter.c
> > b/app/test/test_event_crypto_adapter.c
> > index eecfc22057..2ecc7e2cea 100644
> > --- a/app/test/test_event_crypto_adapter.c
> > +++ b/app/test/test_event_crypto_adapter.c
> > @@ -934,13 +934,16 @@ test_asym_session_with_op_new_mode(void)
> >  static int
> >  configure_cryptodev(void)
> >  {
> > +       const struct rte_cryptodev_capabilities *capability;
> >         struct rte_cryptodev_qp_conf qp_conf;
> >         struct rte_cryptodev_config conf;
> >         struct rte_cryptodev_info info;
> >         unsigned int session_size;
> > +       unsigned int i = 0;
> >         uint8_t nb_devs;
> >         int ret;
> >
> > +
> >         params.mbuf_pool = rte_pktmbuf_pool_create(
> >                         "CRYPTO_ADAPTER_MBUFPOOL",
> >                         NUM_MBUFS, MBUF_CACHE_SIZE, 0, MBUF_SIZE, @@ -963,19
> > +966,6 @@ configure_cryptodev(void)
> >                 RTE_LOG(ERR, USER1, "Can't create CRYPTO_OP_POOL\n");
> >                 return TEST_FAILED;
> >         }
> > -       params.asym_op_mpool = rte_crypto_op_pool_create(
> > -                       "EVENT_CRYPTO_ASYM_OP_POOL",
> > -                       RTE_CRYPTO_OP_TYPE_ASYMMETRIC,
> > -                       NUM_MBUFS, MBUF_CACHE_SIZE,
> > -                       (DEFAULT_NUM_XFORMS *
> > -                       sizeof(struct rte_crypto_asym_xform)) +
> > -                       sizeof(union rte_event_crypto_metadata),
> > -                       rte_socket_id());
> > -       if (params.asym_op_mpool == NULL) {
> > -               RTE_LOG(ERR, USER1, "Can't create CRYPTO_ASYM_OP_POOL\n");
> > -               return TEST_FAILED;
> > -       }
> > -
> >
> >         /* Create a NULL crypto device */
> >         nb_devs = rte_cryptodev_device_count_by_driver(
> > @@ -1020,16 +1010,34 @@ configure_cryptodev(void)
> >         TEST_ASSERT_NOT_NULL(params.session_priv_mpool,
> >                         "session mempool allocation failed\n");
> >
> > -       params.asym_sess_mpool = rte_cryptodev_asym_session_pool_create(
> > -                       "CRYPTO_AD_ASYM_SESS_MP",
> > -                       MAX_NB_SESSIONS, 0,
> > -                       sizeof(union rte_event_crypto_metadata),
> > -                       SOCKET_ID_ANY);
> > -       TEST_ASSERT_NOT_NULL(params.asym_sess_mpool,
> > -                       "asym session mempool allocation failed\n");
> > -
> > -
> >         rte_cryptodev_info_get(TEST_CDEV_ID, &info);
> > +
> > +       while ((capability = &info.capabilities[i++])->op !=
> > +                       RTE_CRYPTO_OP_TYPE_UNDEFINED) {
> > +               if (capability->op == RTE_CRYPTO_OP_TYPE_ASYMMETRIC) {
> > +                       params.asym_op_mpool = rte_crypto_op_pool_create(
> > +                               "EVENT_CRYPTO_ASYM_OP_POOL",
> > +                               RTE_CRYPTO_OP_TYPE_ASYMMETRIC,
> > +                               NUM_MBUFS, MBUF_CACHE_SIZE,
> > +                               (DEFAULT_NUM_XFORMS *
> > +                               sizeof(struct rte_crypto_asym_xform)) +
> > +                               sizeof(union rte_event_crypto_metadata),
> > +                               rte_socket_id());
> > +                       TEST_ASSERT_NOT_NULL(params.asym_op_mpool,
> > +                                       "Can't create
> > + CRYPTO_ASYM_OP_POOL\n");
> > +
> > +                       params.asym_sess_mpool =
> > +                               rte_cryptodev_asym_session_pool_create(
> > +                                       "CRYPTO_AD_ASYM_SESS_MP",
> > +                                       MAX_NB_SESSIONS, 0,
> > +                                       sizeof(union 
> > rte_event_crypto_metadata),
> > +                                       SOCKET_ID_ANY);
> > +                       TEST_ASSERT_NOT_NULL(params.asym_sess_mpool,
> > +                               "asym session mempool allocation failed\n");
> > +                       break;
> > +               }
> > +       }
> > +
> >         conf.nb_queue_pairs = info.max_nb_queue_pairs;
> >         conf.socket_id = SOCKET_ID_ANY;
> >         conf.ff_disable = RTE_CRYPTODEV_FF_SECURITY;
> >
> >

Reply via email to