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 3F667A0350; Tue, 23 Jun 2020 19:57:14 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 193711D6C7; Tue, 23 Jun 2020 19:57:13 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id EAF831D6C1 for ; Tue, 23 Jun 2020 19:57:11 +0200 (CEST) IronPort-SDR: 8iBF5JLa5pQ5WnrRUpoxmGSFMqLru1YHr5oEHvZGblptbDsXdV+x+1G35Qy3wxvG6/OXvnmW/E qRKP7Zb5w1FQ== X-IronPort-AV: E=McAfee;i="6000,8403,9661"; a="131581343" X-IronPort-AV: E=Sophos;i="5.75,272,1589266800"; d="scan'208";a="131581343" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Jun 2020 10:57:10 -0700 IronPort-SDR: 1JUT+/XXW7IeHJ5l/6BhVeYP8XOwvt40ovOe99tzo5cdI7Fgxcn7nN808GAyaVwNQAi4LyCZWh gQ6qry3YXbzA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,272,1589266800"; d="scan'208";a="301337941" Received: from orsmsx102.amr.corp.intel.com ([10.22.225.129]) by fmsmga004.fm.intel.com with ESMTP; 23 Jun 2020 10:57:09 -0700 Received: from orsmsx156.amr.corp.intel.com (10.22.240.22) by ORSMSX102.amr.corp.intel.com (10.22.225.129) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 23 Jun 2020 10:57:09 -0700 Received: from ORSEDG001.ED.cps.intel.com (10.7.248.4) by ORSMSX156.amr.corp.intel.com (10.22.240.22) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 23 Jun 2020 10:57:08 -0700 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.106) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 23 Jun 2020 10:57:08 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=U9H1icWBL1xcPyt37eXpbDJL56NdWTZ91dqL+uiS80TmaRdHNpSua3Zuhr9zQztLPrXqkhh7KgZEBOi8F9uFzhXdlnXrUdswiUrVKHd5iTZIC+Ea7nhMszzUuGvV16DcM0GAVpFr/5RnbQUCJGCptbg4AFIEaXRqq4sYgZsYChw1SQSQ+j9pHgG46Wr8wEVnW0Zq0FtIJ3iaG28IYZnskimFMfFHkrsdOKU6E6JFY+AXI6AcwC4nntyijHPiwUC6S9NvOaxasdOEkfaDgr0dU3/GJSMvJQ4vjKDhN5/BFZ/Sx+0SUMha6XewJJjRHleaggZBhSpx9i7KkDMbdpBstA== 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=J78K0rW7vF0cWkvJMUwcwUfqGBy7yln3kgwa4sNknLY=; b=TefvUXa0h6cmCqBOp+8mr/ziRJTXlEK3gAT0GXr8k0shNzcdMW3BuuBO7J55/TUU3rTTtimL4OPgzzt2TKukEw+2jsXC2OKPd4ZaRmtsyXVTBLHmMT/dNhCxfv73/RVCbUso0/QPiFPO31NzSeaGNtWOcJrt3+Q69nUgvBj+QPywrgdv928sWSLYfqgABiKcho5vVKLvRkQrsvpZTWXn+JS5zr20x+l0z1pj++ZcZO8zJx15yMvfcr+ppqPngLKmGckfViUerIlADaPOX62Mbp7U8pz0x+SFNUbte9cA+BoAfUV+ux4wHTY3Ig1hWEEFFeGwebSSs2bC+rM2QKfMFg== 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=J78K0rW7vF0cWkvJMUwcwUfqGBy7yln3kgwa4sNknLY=; b=Cq0lkwcmyAwDWenQjyf+kj/R6Q+w2bRgS4xCJb3+WE1xhgKWMKTj8qYus/oklybCWM/Ee2gNl4+/vrJawwYvMIl2AYxTWijRa28sqwRnLsvHMvnyynm7hUSkjC5KX+NedJ0J7J3KEJ746vFxXxqKdDLiQzw2jYiawsVtvHYBlh4= Received: from SN6PR11MB3101.namprd11.prod.outlook.com (2603:10b6:805:d8::23) by SN6PR11MB3293.namprd11.prod.outlook.com (2603:10b6:805:be::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22; Tue, 23 Jun 2020 17:57:06 +0000 Received: from SN6PR11MB3101.namprd11.prod.outlook.com ([fe80::ac58:2cf3:c611:9b0]) by SN6PR11MB3101.namprd11.prod.outlook.com ([fe80::ac58:2cf3:c611:9b0%3]) with mapi id 15.20.3109.027; Tue, 23 Jun 2020 17:57:06 +0000 From: "De Lara Guarch, Pablo" To: "Coyle, David" , "akhil.goyal@nxp.com" , "Doherty, Declan" , "Trahe, Fiona" , "Zhang, Roy Fan" , "Ananyev, Konstantin" CC: "dev@dpdk.org" , "thomas@monjalon.net" , "Yigit, Ferruh" , "Ryan, Brendan" , "hemant.agrawal@nxp.com" , "anoobj@marvell.com" , "ruifeng.wang@arm.com" , "lironh@marvell.com" , "rnagadheeraj@marvell.com" , "jsrikanth@marvell.com" , "G.Singh@nxp.com" , "jianjay.zhou@huawei.com" , "ravi1.kumar@amd.com" , "Richardson, Bruce" , "olivier.matz@6wind.com" , "honnappa.nagarahalli@arm.com" , "stephen@networkplumber.org" , "alexr@mellanox.com" , "jerinj@marvell.com" , "O'loingsigh, Mairtin" Thread-Topic: [PATCH v2 3/6] crypto/aesni_mb: add support for DOCSIS protocol Thread-Index: AQHWSUpDUnYftzXp5Ey1F8Ma/wEqkajmen1g Date: Tue, 23 Jun 2020 17:57:06 +0000 Message-ID: References: <20200604151324.50704-1-david.coyle@intel.com> <20200623101423.9215-1-david.coyle@intel.com> <20200623101423.9215-4-david.coyle@intel.com> In-Reply-To: <20200623101423.9215-4-david.coyle@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.2.0.6 authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.198.151.190] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: b4fcf285-7ffe-4eaf-fd5f-08d8179ed808 x-ms-traffictypediagnostic: SN6PR11MB3293: 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:7219; x-forefront-prvs: 04433051BF x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: LPRn8tVhKjdenNf6vri9IPG9WY6O1KiMncHvajQhag0ISX2mvlmU58DRyeG463cwoNf0fJ9GOOqMjmfiCD2CPgjv1nDWQCcptu1pNdVJKsIUlr04hPZGrZAvB+tUSJ/jJ8TW58Yx2HFkIkBqihHGvCakbm1uYyAEDtthLU1sOmoHmspM+jRiPUxsJ918itGD2sxKscowmFXrGbGtTaLFgOyI0iLbAabgNbaDZDDeMInTDgEYZ2VKMHM3RHUPLrsRiiSJgk7Zp4vmjftwuIvi95tSFSxs3YfGbd9C+9YRpFvjAnHXMMUiyNynPiT9hVv239O05qNEpwWqg1CecmYn21c0G+6lwtlmmCla9PCofwZRZ9M5DibmFqh6HHXBo2Ea x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN6PR11MB3101.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(396003)(346002)(136003)(376002)(39860400002)(366004)(66556008)(64756008)(66446008)(478600001)(107886003)(66476007)(26005)(316002)(33656002)(7696005)(2906002)(71200400001)(186003)(53546011)(66946007)(55016002)(4326008)(7416002)(5660300002)(6506007)(6636002)(8676002)(76116006)(86362001)(54906003)(9686003)(83380400001)(8936002)(52536014)(110136005)(921003); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: Ia1Gr5fr3jsz77Sic9/tVF7x1kiC8Jk0y//bJMKs3jI/FibEXOBVNQgTfmlkV19FG5SVoSMVVQOIRyRhYT+ic4eeT4Cse069lW7zp7Iq7crJyLoItb95YlGJhhbCAJbHQb0ZCLNDEX+r4xH4b/Cq/dhO5YVvnJrL5695mWfhHH5lzvZg/EjH4Pt9nf02DhMKaR2iexCCyBty3/yyxebK4JCZF6YKA8y8bd9lfAQrqrz9xvWxjVnuUO4vhwbm2F1+T3VVNLHdSq1OsH5PjyzjO9p+aULzokpvkGXPBRUEloVlKx1JQ/qFJJorvypm8F6Ft0deCSnIwM53ZfzbpMr+aa6neiWa9bDuqg7qGvXHM5SeVZ9Yg5HohKP/zSlrg1/oZ2+3XoQLKMsjXr3bePB6ewLJjmUuX9xHL0ofBuVVE7WaMrMGZTXG6QQbhigGmZbQovb6yZmPEZ0kLNFk53b1vR0UZhCySBbU1gE9pb9/9C/s2BcCU4h7RJaTK2MvQvpg Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: b4fcf285-7ffe-4eaf-fd5f-08d8179ed808 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Jun 2020 17:57:06.7835 (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: 2MzbmWeNaOX1C6aDofuVQkikq+i/0PIL3DDfZEvQd+eZa8G92Na48UCpetDdJt8sJw6llO5hD4HWNx17ZULaWVGC53JoyBKISp8izGqesy0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB3293 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v2 3/6] crypto/aesni_mb: add support for DOCSIS protocol 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 David, > -----Original Message----- > From: Coyle, David > Sent: Tuesday, June 23, 2020 11:14 AM > To: akhil.goyal@nxp.com; Doherty, Declan ; De > Lara Guarch, Pablo ; Trahe, Fiona > ; Zhang, Roy Fan ; > Ananyev, Konstantin > Cc: dev@dpdk.org; thomas@monjalon.net; Yigit, Ferruh > ; Ryan, Brendan ; > hemant.agrawal@nxp.com; anoobj@marvell.com; ruifeng.wang@arm.com; > lironh@marvell.com; rnagadheeraj@marvell.com; jsrikanth@marvell.com; > G.Singh@nxp.com; jianjay.zhou@huawei.com; ravi1.kumar@amd.com; > Richardson, Bruce ; olivier.matz@6wind.com; > honnappa.nagarahalli@arm.com; stephen@networkplumber.org; > alexr@mellanox.com; jerinj@marvell.com; Coyle, David > ; O'loingsigh, Mairtin > Subject: [PATCH v2 3/6] crypto/aesni_mb: add support for DOCSIS protocol >=20 > Add support to the AESNI-MB PMD for the DOCSIS protocol, through the > rte_security API. This, therefore, includes adding support for the rte_se= curity API > to this PMD. >=20 > Signed-off-by: David Coyle > Signed-off-by: Mairtin o Loingsigh ... > +static inline void > +verify_docsis_sec_crc(JOB_AES_HMAC *job, uint16_t crc_len, uint8_t > +*status) { > + uint16_t crc_offset; > + uint8_t *crc; > + > + if (!job->msg_len_to_hash_in_bytes) > + return; > + > + crc_offset =3D job->hash_start_src_offset_in_bytes + > + job->msg_len_to_hash_in_bytes - > + job->cipher_start_src_offset_in_bytes; > + crc =3D job->dst + crc_offset; > + > + /* Verify CRC (at the end of the message) */ > + if (memcmp(job->auth_tag_output, crc, crc_len) !=3D 0) I'd say we can use direct RTE_ETHER_CRC_LEN here, as there is no other poss= ible case, right? It should perform better. > + *status =3D RTE_CRYPTO_OP_STATUS_AUTH_FAILED; } #endif > + > static inline void > verify_digest(JOB_AES_HMAC *job, void *digest, uint16_t len, uint8_t *st= atus) { > @@ -1196,9 +1452,27 @@ static inline struct rte_crypto_op * > post_process_mb_job(struct aesni_mb_qp *qp, JOB_AES_HMAC *job) { > struct rte_crypto_op *op =3D (struct rte_crypto_op *)job->user_data; > - struct aesni_mb_session *sess =3D get_sym_session_private_data( > - op->sym->session, > - cryptodev_driver_id); > + struct aesni_mb_session *sess =3D NULL; > + > +#ifdef AESNI_MB_DOCSIS_SEC_ENABLED > + struct rte_security_op *sec_op =3D NULL; > + > + if (unlikely(op->type =3D=3D RTE_CRYPTO_OP_TYPE_SECURITY)) { Not sure if this unlikely is actually needed. I don't expect to have multip= le types enqueued in the same queue, so this or the other branch will always be taken. > + /* > + * Assuming at this point that if it's a security type op, that > + * this is for DOCSIS > + */ > + sec_op =3D (struct rte_security_op *)&op->security; > + struct rte_crypto_sym_op *crypto_sym =3D > + &sec_op->docsis.crypto_sym; > + sess =3D get_sec_session_private_data(crypto_sym- > >sec_session); ... > - retval =3D set_mb_job_params(job, qp, op, &digest_idx); > +#ifdef AESNI_MB_DOCSIS_SEC_ENABLED > + if (unlikely(op->type =3D=3D RTE_CRYPTO_OP_TYPE_SECURITY)) Same comment as above. > + retval =3D set_sec_mb_job_params(job, qp, op, > + &digest_idx); > + else > +#endif