DPDK patches and discussions
 help / color / mirror / Atom feed
From: Akhil Goyal <gakhil@marvell.com>
To: "Zhang, Roy Fan" <roy.fan.zhang@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>
Cc: "thomas@monjalon.net" <thomas@monjalon.net>,
	"david.marchand@redhat.com" <david.marchand@redhat.com>,
	"hemant.agrawal@nxp.com" <hemant.agrawal@nxp.com>,
	Anoob Joseph <anoobj@marvell.com>,
	"De Lara Guarch, Pablo" <pablo.de.lara.guarch@intel.com>,
	"Trahe, Fiona" <fiona.trahe@intel.com>,
	"Doherty, Declan" <declan.doherty@intel.com>,
	"matan@nvidia.com" <matan@nvidia.com>,
	"g.singh@nxp.com" <g.singh@nxp.com>,
	"jianjay.zhou@huawei.com" <jianjay.zhou@huawei.com>,
	"asomalap@amd.com" <asomalap@amd.com>,
	"ruifeng.wang@arm.com" <ruifeng.wang@arm.com>,
	"Ananyev, Konstantin" <konstantin.ananyev@intel.com>,
	"Nicolau, Radu" <radu.nicolau@intel.com>,
	"ajit.khaparde@broadcom.com" <ajit.khaparde@broadcom.com>,
	Nagadheeraj Rottela <rnagadheeraj@marvell.com>,
	Ankur Dwivedi <adwivedi@marvell.com>,
	"Power, Ciara" <ciara.power@intel.com>,
	"Wang, Haiyue" <haiyue.wang@intel.com>,
	"jiawenwu@trustnetic.com" <jiawenwu@trustnetic.com>,
	"jianwang@trustnetic.com" <jianwang@trustnetic.com>
Subject: Re: [dpdk-dev] [PATCH v2 0/7] crypto/security session framework rework
Date: Fri, 15 Oct 2021 17:42:41 +0000	[thread overview]
Message-ID: <CO6PR18MB4484FA875A8FEF4BBBB746D9D8B99@CO6PR18MB4484.namprd18.prod.outlook.com> (raw)
In-Reply-To: <MW5PR11MB58094819DFBFE322A61F2B41B8B99@MW5PR11MB5809.namprd11.prod.outlook.com>

> Hi Akhil,
> 
> I tried to fix the problems of seg faults.
> The seg-faults are gone now but all asym tests are failing too.
> The reason is the rte_cryptodev_queue_pair_setup() checks the session
> mempool same for sym and asym.
> Since we don't have a rte_cryptodev_asym_session_pool_create() the
> session mempool created by
> test_cryptodev_asym.c  with rte_mempool_create() will fail the mempool
> check when setting up the queue pair.
> 
> If you think my fix may be useful (although not resolving asym issue) I can
> send it.
> 
Is it a different fix than what I proposed below? If yes, you can send the diff.
I already made the below changes for all the PMDs.
I will try to fix the asym issue, but I suppose it can be dealt in the app
Which can be fixed separately in RC2.

Also, found the root cause of multi process issue, working on making the patches.
Will send v3 soon with all 3 issues(docsis/mp/sessless) fixed atleast.
For Asym, may send a separate patch.

> > Hi Fan,
> > Check for below QAT fix also
> > > >
> > > > Unfortunately the patches still cause seg-fault at QAT and SW PMDs.
> > > >
> > > > - for qat it fails at rte_security_ops->session_size_get not implemented.
> > And for this one
> > diff --git a/drivers/crypto/qat/qat_sym_pmd.c
> > b/drivers/crypto/qat/qat_sym_pmd.c
> > index efda921c05..96cd9d2eee 100644
> > --- a/drivers/crypto/qat/qat_sym_pmd.c
> > +++ b/drivers/crypto/qat/qat_sym_pmd.c
> > @@ -306,6 +306,7 @@ static struct rte_security_ops security_qat_ops = {
> >
> >                 .session_create = qat_security_session_create,
> >                 .session_update = NULL,
> > +               .session_get_size = qat_security_session_get_size,
> >                 .session_stats_get = NULL,
> >                 .session_destroy = qat_security_session_destroy,
> >                 .set_pkt_metadata = NULL,
> > diff --git a/drivers/crypto/qat/qat_sym_session.c
> > b/drivers/crypto/qat/qat_sym_session.c
> > index ef92f22c1a..41b5542343 100644
> > --- a/drivers/crypto/qat/qat_sym_session.c
> > +++ b/drivers/crypto/qat/qat_sym_session.c
> > @@ -2297,4 +2297,10 @@ qat_security_session_destroy(void *dev
> > __rte_unused, void *sess_priv)
> >         }
> >         return 0;
> >  }
> > +
> > +static unsigned int
> > +qat_security_session_get_size(void *device __rte_unused)
> > +{
> > +       return sizeof(struct qat_sym_session);
> > +}
> >  #endif
> >
> > > > - for sw pmds the queue pair's session private mempools are not set.
> > > >
> > > Can you check if below change works for Kasumi. I will replicate for
> others.
> > >
> > > diff --git a/drivers/crypto/kasumi/kasumi_pmd_private.h
> > > b/drivers/crypto/kasumi/kasumi_pmd_private.h
> > > index abedcd616d..fe0e78e516 100644
> > > --- a/drivers/crypto/kasumi/kasumi_pmd_private.h
> > > +++ b/drivers/crypto/kasumi/kasumi_pmd_private.h
> > > @@ -38,8 +38,6 @@ struct kasumi_qp {
> > >         /**< Ring for placing processed ops */
> > >         struct rte_mempool *sess_mp;
> > >         /**< Session Mempool */
> > > -       struct rte_mempool *sess_mp_priv;
> > > -       /**< Session Private Data Mempool */
> > >         struct rte_cryptodev_stats qp_stats;
> > >         /**< Queue pair statistics */
> > >         uint8_t temp_digest[KASUMI_DIGEST_LENGTH];
> > > diff --git a/drivers/crypto/kasumi/rte_kasumi_pmd.c
> > > b/drivers/crypto/kasumi/rte_kasumi_pmd.c
> > > index d6f927417a..1fc59c8b8a 100644
> > > --- a/drivers/crypto/kasumi/rte_kasumi_pmd.c
> > > +++ b/drivers/crypto/kasumi/rte_kasumi_pmd.c
> > > @@ -139,27 +139,24 @@ kasumi_get_session(struct kasumi_qp *qp,
> struct
> > > rte_crypto_op *op)
> > >                                         op->sym->session,
> > >                                         cryptodev_driver_id);
> > >         } else {
> > > -               void *_sess = NULL;
> > > -               void *_sess_private_data = NULL;
> > > +               struct rte_cryptodev_sym_session *_sess = NULL;
> > >
> > > -               if (rte_mempool_get(qp->sess_mp, (void **)&_sess))
> > > +               /* Create temporary session */
> > > +               _sess = rte_cryptodev_sym_session_create(qp->sess_mp);
> > > +               if (_sess == NULL)
> > >                         return NULL;
> > >
> > > -               if (rte_mempool_get(qp->sess_mp_priv,
> > > -                               (void **)&_sess_private_data))
> > > -                       return NULL;
> > > -
> > > -               sess = (struct kasumi_session *)_sess_private_data;
> > > -
> > > +               _sess->sess_data[cryptodev_driver_id].data =
> > > +                               (void *)((uint8_t *)_sess +
> > > +                               rte_cryptodev_sym_get_header_session_size() +
> > > +                               (cryptodev_driver_id * _sess->priv_sz));
> > > +               sess = _sess->sess_data[cryptodev_driver_id].data;
> > >                 if (unlikely(kasumi_set_session_parameters(qp->mgr, sess,
> > >                                 op->sym->xform) != 0)) {
> > >                         rte_mempool_put(qp->sess_mp, _sess);
> > > -                       rte_mempool_put(qp->sess_mp_priv, _sess_private_data);
> > >                         sess = NULL;
> > >                 }
> > >                 op->sym->session = (struct rte_cryptodev_sym_session *)_sess;
> > > -               set_sym_session_private_data(op->sym->session,
> > > -                               cryptodev_driver_id, _sess_private_data);
> > >         }
> > >
> > >         if (unlikely(sess == NULL))
> > > @@ -327,7 +324,6 @@ process_ops(struct rte_crypto_op **ops, struct
> > > kasumi_session *session,
> > >                         memset(ops[i]->sym->session, 0,
> > >                         rte_cryptodev_sym_get_existing_header_session_size(
> > >                                         ops[i]->sym->session));
> > > -                       rte_mempool_put(qp->sess_mp_priv, session);
> > >                         rte_mempool_put(qp->sess_mp, ops[i]->sym->session);
> > >                         ops[i]->sym->session = NULL;
> > >                 }


  reply	other threads:[~2021-10-15 17:42 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-30 14:50 [dpdk-dev] [PATCH 0/3] " Akhil Goyal
2021-09-30 14:50 ` [dpdk-dev] [PATCH 1/3] security: rework session framework Akhil Goyal
2021-09-30 14:50 ` [dpdk-dev] [PATCH 2/3] drivers/net: temporary disable ixgbe and txgbe Akhil Goyal
2021-10-12 12:26   ` Zhang, Roy Fan
2021-10-12 12:29     ` Akhil Goyal
2021-10-12 13:32       ` Zhang, Roy Fan
2021-09-30 14:50 ` [dpdk-dev] [PATCH 3/3] cryptodev: rework session framework Akhil Goyal
2021-10-01 15:53   ` Zhang, Roy Fan
2021-10-04 19:07     ` Akhil Goyal
2021-10-13 19:22 ` [dpdk-dev] [PATCH v2 0/7] crypto/security session framework rework Akhil Goyal
2021-10-13 19:22   ` [dpdk-dev] [PATCH v2 1/7] security: rework session framework Akhil Goyal
2021-10-18 21:34     ` [dpdk-dev] [PATCH v3 0/8] crypto/security session framework rework Akhil Goyal
2021-10-18 21:34       ` [dpdk-dev] [PATCH v3 1/8] security: rework session framework Akhil Goyal
2021-10-18 21:34       ` [dpdk-dev] [PATCH v3 2/8] security: hide security session struct Akhil Goyal
2021-10-18 21:34       ` [dpdk-dev] [PATCH v3 3/8] net/cnxk: rework security session framework Akhil Goyal
2021-10-18 21:34       ` [dpdk-dev] [PATCH v3 4/8] security: pass session iova in PMD sess create Akhil Goyal
2021-10-18 21:34       ` [dpdk-dev] [PATCH v3 5/8] drivers/crypto: support security session get size op Akhil Goyal
2021-10-18 21:34       ` [dpdk-dev] [PATCH v3 6/8] cryptodev: rework session framework Akhil Goyal
2021-10-20 19:27         ` Ananyev, Konstantin
2021-10-21  6:53           ` Akhil Goyal
2021-10-21 10:38             ` Ananyev, Konstantin
2021-10-21 12:30               ` Akhil Goyal
2021-10-21 13:11                 ` Ananyev, Konstantin
2021-10-18 21:34       ` [dpdk-dev] [PATCH v3 7/8] cryptodev: hide sym session structure Akhil Goyal
2021-10-18 21:34       ` [dpdk-dev] [PATCH v3 8/8] cryptodev: pass session iova in configure session Akhil Goyal
2021-10-20 14:36       ` [dpdk-dev] [PATCH v3 0/8] crypto/security session framework rework Hemant Agrawal
2021-10-20 15:45       ` Power, Ciara
2021-10-20 16:41         ` Akhil Goyal
2021-10-20 16:48           ` Akhil Goyal
2021-10-20 18:04             ` Akhil Goyal
2021-10-21  8:43               ` Zhang, Roy Fan
2021-10-13 19:22   ` [dpdk-dev] [PATCH v2 2/7] security: hide security session struct Akhil Goyal
2021-10-13 19:22   ` [dpdk-dev] [PATCH v2 3/7] net/cnxk: rework security session framework Akhil Goyal
2021-10-13 19:22   ` [dpdk-dev] [PATCH v2 4/7] security: pass session iova in PMD sess create Akhil Goyal
2021-10-13 19:22   ` [dpdk-dev] [PATCH v2 5/7] cryptodev: rework session framework Akhil Goyal
2021-10-13 19:22   ` [dpdk-dev] [PATCH v2 6/7] cryptodev: hide sym session structure Akhil Goyal
2021-10-13 19:22   ` [dpdk-dev] [PATCH v2 7/7] cryptodev: pass session iova in configure session Akhil Goyal
2021-10-14 11:47   ` [dpdk-dev] [PATCH v2 0/7] crypto/security session framework rework Akhil Goyal
2021-10-14 12:30     ` Zhang, Roy Fan
2021-10-14 12:34       ` Akhil Goyal
2021-10-14 17:07     ` Zhang, Roy Fan
2021-10-14 18:23       ` Akhil Goyal
2021-10-14 18:57         ` Akhil Goyal
2021-10-15 15:33           ` Zhang, Roy Fan
2021-10-15 17:42             ` Akhil Goyal [this message]
2021-10-15 18:47               ` Akhil Goyal
2021-10-16 13:31                 ` Zhang, Roy Fan
2021-10-16 13:21               ` Zhang, Roy Fan
2021-10-15  8:12         ` Zhang, Roy Fan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CO6PR18MB4484FA875A8FEF4BBBB746D9D8B99@CO6PR18MB4484.namprd18.prod.outlook.com \
    --to=gakhil@marvell.com \
    --cc=adwivedi@marvell.com \
    --cc=ajit.khaparde@broadcom.com \
    --cc=anoobj@marvell.com \
    --cc=asomalap@amd.com \
    --cc=ciara.power@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=declan.doherty@intel.com \
    --cc=dev@dpdk.org \
    --cc=fiona.trahe@intel.com \
    --cc=g.singh@nxp.com \
    --cc=haiyue.wang@intel.com \
    --cc=hemant.agrawal@nxp.com \
    --cc=jianjay.zhou@huawei.com \
    --cc=jianwang@trustnetic.com \
    --cc=jiawenwu@trustnetic.com \
    --cc=konstantin.ananyev@intel.com \
    --cc=matan@nvidia.com \
    --cc=pablo.de.lara.guarch@intel.com \
    --cc=radu.nicolau@intel.com \
    --cc=rnagadheeraj@marvell.com \
    --cc=roy.fan.zhang@intel.com \
    --cc=ruifeng.wang@arm.com \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).