From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id A24E0A0525; Tue, 21 Jan 2020 15:29:35 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 898443772; Tue, 21 Jan 2020 15:29:34 +0100 (CET) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 8642C343C for ; Tue, 21 Jan 2020 15:29:32 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Jan 2020 06:29:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,346,1574150400"; d="scan'208";a="425505874" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga005.fm.intel.com with ESMTP; 21 Jan 2020 06:29:31 -0800 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 21 Jan 2020 06:29:30 -0800 Received: from fmsmsx604.amr.corp.intel.com (10.18.126.84) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 21 Jan 2020 06:29:30 -0800 Received: from FMSEDG001.ED.cps.intel.com (10.1.192.133) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Tue, 21 Jan 2020 06:29:30 -0800 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.101) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 21 Jan 2020 06:29:28 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bjlWhNEudJUR4n4NK5B295SbvfEfeSgXl+POD1ITWRVDka12nLNegGWsAmEbPwnhc2+Ktt5mUqvNg6Hrz3wYS3xLmI0+IvlNyWTHxWpjOPMaCmVQuqkGyYM0fKo1QXuIe/soreiwEOEJ8Rmyy+oB2sI6eBnhkXQ3A6r7V8ld9ZMwZc9GVTcZkFsmNgD7Bi+uB+csBJK1w+Z7KiOh/L6ns7YExvzqlRKX4I2JI0LVWGCxCiz5qo8toNpDOwaMJDELFGOBNaumIJoTuhpEawR3IuA6uwjlUdHmnje601uLAxm7OSaZQbJ73QbhgPCjdahD5qEUg3C/ybBUPlW+TThoyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mpIT4dWQEuph0uBsnKpTZcZ8PfoJIscR3LTuGzT5W50=; b=jXkss9HeUmvNXBr9vNZxXJDbok+XxzzFrD7my0LRSZbJjEHY4oW7vjpylIsu1P7Lj1jctpD3MFmHw89kDE327OtgS+4GEzIlEt78z+f4sFaxJFCoXsQiRUg2kXqkBoHzbqbFA4HNUBv7GTctsyjw5YOYsl8zRXlk13IKy3qLvycKNUphoU5oB9gQmWkk1RKmU4jIR3Z5lzB6SogAhUTohBGgFkTDIKLvsoVSW9PBg/xu2cGIwI/UtMjBRB8LOt+wcdQ4IWN2LU1G+RrT5l7jkIDN/qTGLXThO80mN9w7n8KVXRZfu9+h+Q3QwqhVYByyPHVbesji+P4UUVC3g2AkQA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mpIT4dWQEuph0uBsnKpTZcZ8PfoJIscR3LTuGzT5W50=; b=l7A9KqjnYZcJEQi5Y41fg2dxASkcGmtaptuDO8mPql3eTfnVdDaJh5MwAiJSVE7ut8W9UmFIr5X9y2bs6iXp6S0i7nGDfDNcmeDKAOLgctmFeNGkiLuXq4Irnr+HhYWZQFaAfyXtk6SKutZgwXjBNdfZNu4VI0Ze0ymNIvq4Uyg= Received: from SN6PR11MB2558.namprd11.prod.outlook.com (52.135.94.19) by SN6PR11MB3503.namprd11.prod.outlook.com (52.135.124.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.23; Tue, 21 Jan 2020 14:29:24 +0000 Received: from SN6PR11MB2558.namprd11.prod.outlook.com ([fe80::4d86:362a:13c3:8386]) by SN6PR11MB2558.namprd11.prod.outlook.com ([fe80::4d86:362a:13c3:8386%7]) with mapi id 15.20.2644.024; Tue, 21 Jan 2020 14:29:24 +0000 From: "Ananyev, Konstantin" To: "De Lara Guarch, Pablo" , "Smoczynski, MarcinX" , "akhil.goyal@nxp.com" , "Zhang, Roy Fan" , "Doherty, Declan" , "Nicolau, Radu" CC: "dev@dpdk.org" , "Smoczynski, MarcinX" Thread-Topic: [dpdk-dev] [PATCH v3 2/6] crypto/aesni_gcm: cpu crypto support Thread-Index: AQHVy9Hv++kqvH5P/0Cyg+Qy7lXruaf1LJqAgAAHu6A= Date: Tue, 21 Jan 2020 14:29:24 +0000 Message-ID: References: <20200115182832.17012-1-marcinx.smoczynski@intel.com> <20200115182832.17012-3-marcinx.smoczynski@intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZWExYWQ5NmQtNzA0My00NjQ1LWEzMDYtMWFmMTAzYzZmODk3IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiMDNkeldTc2ZvSnFyK1BHZzlTTFNBZTltSTZ6eTRsbjZ6TVFRbUxhM01Yak9iMytcLzBUdVJ1Wm1aQ2grMGwrNXkifQ== dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.2.0.6 x-ctpclassification: CTP_NT authentication-results: spf=none (sender IP is ) smtp.mailfrom=konstantin.ananyev@intel.com; x-originating-ip: [192.198.151.162] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 73378265-3ffa-4964-51cb-08d79e7e5070 x-ms-traffictypediagnostic: SN6PR11MB3503: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3826; x-forefront-prvs: 0289B6431E x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(346002)(366004)(396003)(376002)(39860400002)(136003)(199004)(189003)(4326008)(9686003)(64756008)(55016002)(66946007)(66476007)(76116006)(66446008)(66556008)(54906003)(107886003)(2906002)(316002)(110136005)(478600001)(33656002)(8936002)(86362001)(26005)(81156014)(6636002)(81166006)(71200400001)(7696005)(6506007)(186003)(5660300002)(52536014)(8676002)(921003)(1121003); DIR:OUT; SFP:1102; SCL:1; SRVR:SN6PR11MB3503; H:SN6PR11MB2558.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: dB/tR3QQq4igoiAwUFwdbkeUp5hpRi3H7rGoTaJ6Y7uoRsB+J6GWIZE4zj3g2g8j7UzvOVQdnm7MKirHx6lT7k492dXsBpxuTTKUmm8+Pi8aTHRGWYzC89sAPYVJ/nrr/53cYHOFzfQVMPrruwbmn4C5x08NsK/xHZhunbEXoNgMrdV3YTgv333ljCHYttdKBCm2sLVbX6pi+CHNKDTCmqmuIb1zZwNWgiJfCy9h5jzbArGpZnxQz5a+NNecuufCf59mQndH+GeB7hpXo8pMQtZpKiJzgpRz/he7DSPyf/nDMvJ7Ve2C3+7ldpyU/F2XLOj/ZSie2PC9A+Ry3axFQkq/3KgLZ3dNKgPU2+kCmN3fBLYJ2yGN38VQ4oTGfqtzsESAoMX92GBBGbvJdjK2jc7rUcfR4ErNmgiC2XOwnJpHL0q8jreLOo4rZ4CWTWY0o/g9u+17nk8yCr1MJ1798nsU/I5IcUiBPJsBkjFXZX6JPNkUz8CU+xSDIHjMHZP9 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 73378265-3ffa-4964-51cb-08d79e7e5070 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Jan 2020 14:29:24.6292 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 5t7UReHFaaaNfVGXiJAUYlTHCDKOGN1/uYzzuOIzcZkiLpnrZE9/KRd40/k0ff+EDbpoW42eYvNfMz4+LmPb786Q8Jswjt4w6FsMgp43BYQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB3503 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v3 2/6] crypto/aesni_gcm: cpu crypto support 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Pablo, > > Add support for CPU crypto mode by introducing required handler. > > Crypto mode (sync/async) is chosen during sym session create if an appr= opriate > > flag is set in an xform type number. > > > > Authenticated encryption and decryption are supported with tag > > generation/verification. > > > > Signed-off-by: Marcin Smoczynski > > --- > > drivers/crypto/aesni_gcm/aesni_gcm_ops.h | 9 ++ > > drivers/crypto/aesni_gcm/aesni_gcm_pmd.c | 149 +++++++++++++++++- > > drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c | 3 + > > .../crypto/aesni_gcm/aesni_gcm_pmd_private.h | 18 ++- > > 4 files changed, 169 insertions(+), 10 deletions(-) > > > > diff --git a/drivers/crypto/aesni_gcm/aesni_gcm_ops.h > > b/drivers/crypto/aesni_gcm/aesni_gcm_ops.h > > index e272f1067..404c0adff 100644 >=20 > ... >=20 > > --- a/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c > > +++ b/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c > > @@ -25,9 +25,16 @@ aesni_gcm_set_session_parameters(const struct > > aesni_gcm_ops *gcm_ops, > > const struct rte_crypto_sym_xform *aead_xform; > > uint8_t key_length; > > const uint8_t *key; > > + uint32_t xform_type; > > + > > + /* check for CPU-crypto mode */ > > + xform_type =3D xform->type; > > + sess->mode =3D xform_type | RTE_CRYPTO_SYM_CPU_CRYPTO ? > > + AESNI_GCM_MODE_SYNC : AESNI_GCM_MODE_ASYNC; > > + xform_type &=3D RTE_CRYPTO_SYM_XFORM_TYPE_MASK; > > > > /* AES-GMAC */ > > - if (xform->type =3D=3D RTE_CRYPTO_SYM_XFORM_AUTH) { > > + if (xform_type =3D=3D RTE_CRYPTO_SYM_XFORM_AUTH) { > > auth_xform =3D xform; > > if (auth_xform->auth.algo !=3D RTE_CRYPTO_AUTH_AES_GMAC) { >=20 > Could you add support for AES-GMAC, so all algorithms supported by this P= MD support this new API? Not sure I get you here... This code is present in current version of the driver too, no addition/dele= tions as I can see: /* AES-GMAC */ if (xform->type =3D=3D RTE_CRYPTO_SYM_XFORM_AUTH) { auth_xform =3D xform; if (auth_xform->auth.algo !=3D RTE_CRYPTO_AUTH_AES_GMAC) { AESNI_GCM_LOG(ERR, "Only AES GMAC is supported as a= n " "authentication only algorithm"); return -ENOTSUP; } The only thing is changed: xform type calculation. Konstantin >=20 > > AESNI_GCM_LOG(ERR, "Only AES GMAC is supported as > > an " > > @@ -49,7 +56,7 @@ aesni_gcm_set_session_parameters(const struct > > aesni_gcm_ops *gcm_ops, > > sess->req_digest_length =3D auth_xform->auth.digest_length; >=20 > ... >=20 > > --- a/drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c > > +++ b/drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c > > @@ -331,9 +331,12 @@ struct rte_cryptodev_ops aesni_gcm_pmd_ops =3D { > > .queue_pair_release =3D aesni_gcm_pmd_qp_release, > > .queue_pair_count =3D aesni_gcm_pmd_qp_count, > > > > + .sym_cpu_process =3D aesni_gcm_pmd_cpu_crypto_process, > > + > > .sym_session_get_size =3D > > aesni_gcm_pmd_sym_session_get_size, > > .sym_session_configure =3D > > aesni_gcm_pmd_sym_session_configure, > > .sym_session_clear =3D aesni_gcm_pmd_sym_session_clear > > }; > > > > struct rte_cryptodev_ops *rte_aesni_gcm_pmd_ops =3D &aesni_gcm_pmd_ops= ; > > + >=20 > Remove this extra line. >=20 > Thanks! > Pablo