From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 5698B108D; Mon, 23 Jan 2017 13:25:27 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP; 23 Jan 2017 04:25:26 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,274,1477983600"; d="scan'208";a="1086255023" Received: from irsmsx151.ger.corp.intel.com ([163.33.192.59]) by orsmga001.jf.intel.com with ESMTP; 23 Jan 2017 04:24:55 -0800 Received: from irsmsx101.ger.corp.intel.com ([169.254.1.112]) by IRSMSX151.ger.corp.intel.com ([169.254.4.20]) with mapi id 14.03.0248.002; Mon, 23 Jan 2017 12:24:54 +0000 From: "Zhang, Roy Fan" To: "Doherty, Declan" , "dev@dpdk.org" CC: "De Lara Guarch, Pablo" , "stable@dpdk.org" , "Doherty, Declan" Thread-Topic: [dpdk-dev] [PATCH] cryptodev: crypto PMD functions incorrectly inlined Thread-Index: AQHSdXLWixnWMemokUuGT+HXS69FkqFF/B6A Date: Mon, 23 Jan 2017 12:24:54 +0000 Message-ID: <9F7182E3F746AB4EA17801C148F3C60409E632CB@IRSMSX101.ger.corp.intel.com> References: <20170123121835.27317-1-declan.doherty@intel.com> In-Reply-To: <20170123121835.27317-1-declan.doherty@intel.com> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_IC x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMmM4ZWZkMDYtMzAyYS00ZjIwLThkYTEtZDg0MzQ2MzBkMzQxIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IjVxdmdNbFM3QTFHb1ZJUTNzV1VWSzJzODRqTXpcL3J6bm9KSVVQUUg3QVJ3PSJ9 x-originating-ip: [163.33.239.181] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] cryptodev: crypto PMD functions incorrectly inlined X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jan 2017 12:25:28 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Declan Doherty > Sent: Monday, January 23, 2017 12:19 PM > To: dev@dpdk.org > Cc: De Lara Guarch, Pablo ; > stable@dpdk.org; Doherty, Declan > Subject: [dpdk-dev] [PATCH] cryptodev: crypto PMD functions incorrectly > inlined >=20 > rte_cryptodev_pmd_get_dev, rte_cryptodev_pmd_get_named_dev, > rte_cryptodev_pmd_is_valid_dev were incorrectly marked as inline and > therefore not useable from crypto PMDs when built as shared libraries as > they accessed the global rte_cryptodev_globals device structure. >=20 > Fixes: d11b0f30 ("cryptodev: introduce API and framework for crypto > devices") >=20 > Signed-off-by: Declan Doherty > --- > lib/librte_cryptodev/rte_cryptodev.c | 42 > ++++++++++++++++++++++++ > lib/librte_cryptodev/rte_cryptodev_pmd.h | 44 ++++----------------= ------ > lib/librte_cryptodev/rte_cryptodev_version.map | 3 ++ > 3 files changed, 51 insertions(+), 38 deletions(-) >=20 > diff --git a/lib/librte_cryptodev/rte_cryptodev.c > b/lib/librte_cryptodev/rte_cryptodev.c > index 6a51eec..42707cb 100644 > --- a/lib/librte_cryptodev/rte_cryptodev.c > +++ b/lib/librte_cryptodev/rte_cryptodev.c > @@ -255,6 +255,48 @@ rte_cryptodev_create_vdev(const char *name, > const char *args) > return rte_eal_vdev_init(name, args); > } >=20 > +struct rte_cryptodev * > +rte_cryptodev_pmd_get_dev(uint8_t dev_id) { > + return &rte_cryptodev_globals->devs[dev_id]; > +} > + > +struct rte_cryptodev * > +rte_cryptodev_pmd_get_named_dev(const char *name) { > + struct rte_cryptodev *dev; > + unsigned i; > + > + if (name =3D=3D NULL) > + return NULL; > + > + for (i =3D 0; i < rte_cryptodev_globals->max_devs; i++) { > + dev =3D &rte_cryptodev_globals->devs[i]; > + > + if ((dev->attached =3D=3D RTE_CRYPTODEV_ATTACHED) && > + (strcmp(dev->data->name, name) =3D=3D 0)) > + return dev; > + } > + > + return NULL; > +} > + > +unsigned > +rte_cryptodev_pmd_is_valid_dev(uint8_t dev_id) { > + struct rte_cryptodev *dev =3D NULL; > + > + if (dev_id >=3D rte_cryptodev_globals->nb_devs) > + return 0; > + > + dev =3D rte_cryptodev_pmd_get_dev(dev_id); > + if (dev->attached !=3D RTE_CRYPTODEV_ATTACHED) > + return 0; > + else > + return 1; > +} > + > + > int > rte_cryptodev_get_dev_id(const char *name) { diff --git > a/lib/librte_cryptodev/rte_cryptodev_pmd.h > b/lib/librte_cryptodev/rte_cryptodev_pmd.h > index aabef41..b6dc32c 100644 > --- a/lib/librte_cryptodev/rte_cryptodev_pmd.h > +++ b/lib/librte_cryptodev/rte_cryptodev_pmd.h > @@ -160,11 +160,8 @@ extern struct rte_cryptodev_global > *rte_cryptodev_globals; > * @return > * - The rte_cryptodev structure pointer for the given device ID. > */ > -static inline struct rte_cryptodev * > -rte_cryptodev_pmd_get_dev(uint8_t dev_id) -{ > - return &rte_cryptodev_globals->devs[dev_id]; > -} > +struct rte_cryptodev * > +rte_cryptodev_pmd_get_dev(uint8_t dev_id); >=20 > /** > * Get the rte_cryptodev structure device pointer for the named device. > @@ -174,25 +171,8 @@ rte_cryptodev_pmd_get_dev(uint8_t dev_id) > * @return > * - The rte_cryptodev structure pointer for the given device ID. > */ > -static inline struct rte_cryptodev * > -rte_cryptodev_pmd_get_named_dev(const char *name) -{ > - struct rte_cryptodev *dev; > - unsigned i; > - > - if (name =3D=3D NULL) > - return NULL; > - > - for (i =3D 0; i < rte_cryptodev_globals->max_devs; i++) { > - dev =3D &rte_cryptodev_globals->devs[i]; > - > - if ((dev->attached =3D=3D RTE_CRYPTODEV_ATTACHED) && > - (strcmp(dev->data->name, name) =3D=3D 0)) > - return dev; > - } > - > - return NULL; > -} > +struct rte_cryptodev * > +rte_cryptodev_pmd_get_named_dev(const char *name); >=20 > /** > * Validate if the crypto device index is valid attached crypto device. > @@ -202,20 +182,8 @@ rte_cryptodev_pmd_get_named_dev(const char > *name) > * @return > * - If the device index is valid (1) or not (0). > */ > -static inline unsigned > -rte_cryptodev_pmd_is_valid_dev(uint8_t dev_id) -{ > - struct rte_cryptodev *dev =3D NULL; > - > - if (dev_id >=3D rte_cryptodev_globals->nb_devs) > - return 0; > - > - dev =3D rte_cryptodev_pmd_get_dev(dev_id); > - if (dev->attached !=3D RTE_CRYPTODEV_ATTACHED) > - return 0; > - else > - return 1; > -} > +unsigned > +rte_cryptodev_pmd_is_valid_dev(uint8_t dev_id); >=20 > /** > * The pool of rte_cryptodev structures. > diff --git a/lib/librte_cryptodev/rte_cryptodev_version.map > b/lib/librte_cryptodev/rte_cryptodev_version.map > index c581eea..a92df62 100644 > --- a/lib/librte_cryptodev/rte_cryptodev_version.map > +++ b/lib/librte_cryptodev/rte_cryptodev_version.map > @@ -51,5 +51,8 @@ DPDK_17.02 { > global: >=20 > rte_cryptodev_pmd_create_dev_name; > + rte_cryptodev_pmd_get_dev; > + rte_cryptodev_pmd_get_named_dev; > + rte_cryptodev_pmd_is_valid_dev; >=20 > } DPDK_16.11; > -- > 2.9.3 Acked-by: Fan Zhang