From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 4C4768E5D for ; Tue, 2 Feb 2016 18:38:59 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga104.fm.intel.com with ESMTP; 02 Feb 2016 09:38:58 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,385,1449561600"; d="scan'208";a="739264952" Received: from irsmsx152.ger.corp.intel.com ([163.33.192.66]) by orsmga003.jf.intel.com with ESMTP; 02 Feb 2016 09:38:57 -0800 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.102]) by IRSMSX152.ger.corp.intel.com ([169.254.6.200]) with mapi id 14.03.0248.002; Tue, 2 Feb 2016 17:38:56 +0000 From: "De Lara Guarch, Pablo" To: "Doherty, Declan" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] cryptodev: add capabilities discovery mechanism Thread-Index: AQHRW1/qW2Y5JoZUFEaFVtgUShOvgZ8Y1rUA Date: Tue, 2 Feb 2016 17:38:55 +0000 Message-ID: References: <1454159457-6857-1-git-send-email-declan.doherty@intel.com> In-Reply-To: <1454159457-6857-1-git-send-email-declan.doherty@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiOWY0NmU2YTUtZjBhOS00NDExLTlhODctZmYxOWJmNzA2NmIxIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjQuMTAuMTkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiQzdXUDQ5SUZcL2QzN25aMnArVjM5bEF5aGsxQ0FcL0JieVV6SkdhTW9zbDIwPSJ9 x-ctpclassification: CTP_IC x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] cryptodev: add capabilities discovery mechanism X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Feb 2016 17:38:59 -0000 Hi Declan, > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Declan Doherty > Sent: Saturday, January 30, 2016 1:11 PM > To: dev@dpdk.org > Subject: [dpdk-dev] [PATCH] cryptodev: add capabilities discovery > mechanism [...] > --- a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c > +++ b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c > @@ -572,6 +572,7 @@ aesni_mb_pmd_dequeue_burst(void *queue_pair, > } >=20 >=20 > + Remove this blank line. > static int cryptodev_aesni_mb_uninit(const char *name); >=20 > static int > @@ -622,6 +623,24 @@ cryptodev_aesni_mb_create(const char *name, > unsigned socket_id) [...] > diff --git a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c > b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c > index 96d22f6..368a803 100644 > --- a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c > +++ b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c > @@ -38,6 +38,87 @@ >=20 > #include "rte_aesni_mb_pmd_private.h" >=20 > + > +static const struct rte_cryptodev_capabilities aesni_mb_pmd_capabilities= [] > =3D { > + { /* MD5 HMAC */ > + .op =3D RTE_CRYPTO_OP_TYPE_SYMMETRIC, > + .sym =3D { > + .type =3D RTE_CRYPTO_XFORM_AUTH, > + .auth =3D { > + RTE_CRYPTO_AUTH_MD5_HMAC, 64, 16, 12, > { 0 } I would use the variable names to set the values, it will be longer but I find it more readable. > + } > + } [...] > diff --git a/lib/librte_cryptodev/rte_cryptodev.h > b/lib/librte_cryptodev/rte_cryptodev.h > index 892375d..61a162b 100644 > --- a/lib/librte_cryptodev/rte_cryptodev.h > +++ b/lib/librte_cryptodev/rte_cryptodev.h > @@ -91,12 +91,131 @@ enum rte_cryptodev_type { > #define CDEV_PMD_TRACE(fmt, args...) > #endif >=20 > + > +/** > + * Symmetric Crypto Capability > + */ > +struct rte_cryptodev_symmetric_capability { > + enum rte_crypto_xform_type type; > + /**< Transform type : Authentication / Cipher */ > + > + union { > + struct { > + enum rte_crypto_auth_algorithm algo; > + /**< authentication algorithm */ > + uint16_t block; Suggest to rename most variables to x_size (i.e. block_size). > + /**< algorithm block size */ > + uint16_t key; > + /**< Key size supported */ In cipher structure, key size is a structure supporting a range of sizes, authentication key does not need it? > + uint16_t digest; > + /**< Maximum digest size supported */ > + struct { > + uint16_t min; /**< minimum aad size */ > + uint16_t max; /**< maximum aad size */ > + uint16_t increment; > + /**< if a range of sizes are supported, > + * this parameter is used to indicate > + * increments in byte size that are supported > + * between the minimum and maximum */ > + } aad; [...] > +/** > + * Get the name of a crypto device feature flag > + * > + * @param mask The mask describing the flag. Wrong parameter name. > + * > + * @return > + * The name of this flag, or NULL if it's not a valid feature flag. > + */ > + > +extern const char * > +rte_cryptodev_get_feature_name(uint64_t flag); > + [...] > diff --git a/lib/librte_cryptodev/rte_cryptodev_version.map > b/lib/librte_cryptodev/rte_cryptodev_version.map > index ff8e93d..9cd12cf 100644 > --- a/lib/librte_cryptodev/rte_cryptodev_version.map > +++ b/lib/librte_cryptodev/rte_cryptodev_version.map > @@ -10,6 +10,7 @@ DPDK_2.2 { > rte_cryptodev_configure; > rte_cryptodev_create_vdev; > rte_cryptodev_get_dev_id; > + rte_cryptodev_get_feature_name; > rte_cryptodev_info_get; > rte_cryptodev_pmd_allocate; > rte_cryptodev_pmd_callback_process; > @@ -27,6 +28,5 @@ DPDK_2.2 { > rte_cryptodev_queue_pair_setup; > rte_cryptodev_queue_pair_start; > rte_cryptodev_queue_pair_stop; > - No need to remove the blank line here. > local: *; > }; > \ No newline at end of file > -- > 2.5.0