From: "Trahe, Fiona" <fiona.trahe@intel.com>
To: "Verma, Shally" <Shally.Verma@cavium.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: "Athreya, Narayana Prasad" <NarayanaPrasad.Athreya@cavium.com>,
"Challa, Mahipal" <Mahipal.Challa@cavium.com>,
"De Lara Guarch, Pablo" <pablo.de.lara.guarch@intel.com>,
"Gupta, Ashish" <Ashish.Gupta@cavium.com>,
"Sahu, Sunila" <Sunila.Sahu@cavium.com>,
"Trahe, Fiona" <fiona.trahe@intel.com>
Subject: Re: [dpdk-dev] [RFC v2] lib: add compressdev API
Date: Mon, 11 Dec 2017 18:22:29 +0000 [thread overview]
Message-ID: <348A99DA5F5B7549AA880327E580B435892D04F9@IRSMSX101.ger.corp.intel.com> (raw)
In-Reply-To: <BY1PR0701MB1111CB7C1FA085323F078C00F0330@BY1PR0701MB1111.namprd07.prod.outlook.com>
> -----Original Message-----
> From: Verma, Shally [mailto:Shally.Verma@cavium.com]
> Sent: Thursday, December 7, 2017 9:59 AM
> To: Trahe, Fiona <fiona.trahe@intel.com>; dev@dpdk.org
> Cc: Athreya, Narayana Prasad <NarayanaPrasad.Athreya@cavium.com>; Challa, Mahipal
> <Mahipal.Challa@cavium.com>; De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>; Gupta,
> Ashish <Ashish.Gupta@cavium.com>; Sahu, Sunila <Sunila.Sahu@cavium.com>
> Subject: RE: [RFC v2] lib: add compressdev API
>
>
>
> > -----Original Message-----
> > From: Trahe, Fiona [mailto:fiona.trahe@intel.com]
> > Sent: 24 November 2017 22:26
> > To: dev@dpdk.org; Verma, Shally <Shally.Verma@cavium.com>
> > Cc: Challa, Mahipal <Mahipal.Challa@cavium.com>; Athreya, Narayana
> > Prasad <NarayanaPrasad.Athreya@cavium.com>;
> > pablo.de.lara.guarch@intel.com; fiona.trahe@intel.com
> > Subject: [RFC v2] lib: add compressdev API
> >
> > compressdev API
> >
> > Signed-off-by: Trahe, Fiona <fiona.trahe@intel.com>
> > ---
>
> //snip//
>
> > +unsigned int
> > +rte_compressdev_get_header_session_size(void)
> > +{
> > + /*
> > + * Header contains pointers to the private data
> > + * of all registered drivers
> > + */
> > + return (sizeof(void *) * nb_drivers);
> > +}
> > +
> > +unsigned int
> > +rte_compressdev_get_private_session_size(uint8_t dev_id)
> > +{
> > + struct rte_compressdev *dev;
> > + unsigned int header_size = sizeof(void *) * nb_drivers;
> > + unsigned int priv_sess_size;
> > +
> > + if (!rte_compressdev_pmd_is_valid_dev(dev_id))
> > + return 0;
> > +
> > + dev = rte_compressdev_pmd_get_dev(dev_id);
> > +
> > + if (*dev->dev_ops->session_get_size == NULL)
> > + return 0;
> > +
> > + priv_sess_size = (*dev->dev_ops->session_get_size)(dev);
> > +
> > + /*
> > + * If size is less than session header size,
> > + * return the latter, as this guarantees that
> > + * sessionless operations will work
> > + */
>
> [Shally] believe this comment need an edit
>
> > + if (priv_sess_size < header_size)
> > + return header_size;
> > +
> > + return priv_sess_size;
>
> [Shally] This doesn't return header_size inclusive which is fine as per API definition. So should application
> call
> rte_compressdev_get_header_session_size() in case it want to know header_size overhead per session
> and allocate pool with elt_size = sess_header_size + dev_priv_sz?
>
[Fiona] I don't see a need for this and will just return what the PMD returns.
Yes, appl should call rte_compressdev_get_header_session_size()
And rte_compressdev_get_private_session_size() for (one device in) each driver it wants the session to handle.
And pick the largest of these as the element size.
The idea is to use one mempool object for the hdr and another object for each driver.
So if the session is intended to be used on 2 drivers, then the pool should be sized so 3 objects are available (x max_nb_sessions).
Else the API layer would need to store offsets for each type of driver as their session size would be different.
Instead the API layer doesn't need offsets as each driver just grabs an object from the pool and stores the ptr to this in the hdr array.
> > +
> > +}
> //snip//
>
> Thanks
> Shally
next prev parent reply other threads:[~2017-12-11 18:22 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-24 16:56 Trahe, Fiona
2017-12-07 9:58 ` Verma, Shally
2017-12-11 18:22 ` Trahe, Fiona [this message]
2017-12-12 4:43 ` Verma, Shally
2017-12-15 17:49 ` [dpdk-dev] [RFC v3 1/1] " Trahe, Fiona
2017-12-18 21:43 ` Ahmed Mansour
2017-12-22 14:15 ` Trahe, Fiona
2018-01-18 12:53 ` Verma, Shally
2018-01-19 12:00 ` Trahe, Fiona
2018-01-23 11:58 ` Verma, Shally
2018-01-24 19:36 ` Ahmed Mansour
2018-01-25 10:24 ` Verma, Shally
2018-01-25 18:43 ` Trahe, Fiona
2018-01-29 12:26 ` Verma, Shally
2018-01-29 17:16 ` Ahmed Mansour
2017-11-27 10:44 [dpdk-dev] [RFC v2] " Verma, Shally
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=348A99DA5F5B7549AA880327E580B435892D04F9@IRSMSX101.ger.corp.intel.com \
--to=fiona.trahe@intel.com \
--cc=Ashish.Gupta@cavium.com \
--cc=Mahipal.Challa@cavium.com \
--cc=NarayanaPrasad.Athreya@cavium.com \
--cc=Shally.Verma@cavium.com \
--cc=Sunila.Sahu@cavium.com \
--cc=dev@dpdk.org \
--cc=pablo.de.lara.guarch@intel.com \
/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).