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 5181EA051C; Fri, 26 Jun 2020 17:13:56 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 87F451C1C7; Fri, 26 Jun 2020 17:13:55 +0200 (CEST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 621CF1C1C0 for ; Fri, 26 Jun 2020 17:13:53 +0200 (CEST) IronPort-SDR: VoNYn/XNvlgfYGGq5oSfycGalPJvCjbxW2dyRe3xG3rohxSaW9wJjxKs4PmYs+CQThHPVM1iD3 vv8K1in/7qbQ== X-IronPort-AV: E=McAfee;i="6000,8403,9663"; a="206871567" X-IronPort-AV: E=Sophos;i="5.75,284,1589266800"; d="scan'208";a="206871567" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jun 2020 08:13:50 -0700 IronPort-SDR: iEfkFIt0OYoSnYqQ6uC2s65juvgjORwNulEpLpWCaZqHn4fyv2DzOeZyQ16ftwcebQhlDHpGhk nKlWykvt6+Mw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,284,1589266800"; d="scan'208";a="312344195" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga002.fm.intel.com with ESMTP; 26 Jun 2020 08:13:49 -0700 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 26 Jun 2020 08:13:48 -0700 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; Fri, 26 Jun 2020 08:13:46 -0700 Received: from FMSEDG002.ED.cps.intel.com (10.1.192.134) 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; Fri, 26 Jun 2020 08:13:46 -0700 Received: from NAM04-BN3-obe.outbound.protection.outlook.com (104.47.46.51) by edgegateway.intel.com (192.55.55.69) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 26 Jun 2020 08:13:45 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jo5a0eBGVBzXjLNQG/Fns1L5PdBoopYn7/Vbi9BoqGxnHVeVvVQNU1UxgQiaXSKjCj32tfBnszzSrlKV3uCeeTzENqeY3bfmFX6RFIYEt+PwRDPtRL0Obqn5t6s8A/jYBe3/HxgrSGJ4c6/ErVyCbylZudPfZXd9GH6LfrSfP7swcGvqLpaqfxh5IIklSqzHdNTs3TtHHCQKjCEbkHKEh/Ep12Iv64gjtSDrETLq1x6xck+XGODjRJecZpkdX6Y7KHAbJbuC+mgro8zuVb56APhtydMLdowyyVdafRPZjjP3E7xt1Jw0xzILHYyGfAebLM/4tl9Me/QKqOdkGu1YCA== 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=NePvH70ov8cvBvYbWI+rlWRFF23g5IFvHeCHCR5BkD4=; b=LIS0oQ+P1AWk+GkNffYjTpYrltjN31QcA2RaBTEvHlcNMTQnDxqSg45ZEaXOVj0a8kUP5iJcfJdxVfO3JgyfMSkdEoX0Vb72+l/xdF7FxATY+C+sA6PqUPHP+GOTBYCz7hWlyeh9EuTrGJUXuniyWuo0z/QgSJjC4woyaHSYzCDGX4SV48k6YLiI4GJOYn/zm4PLrMbn7mmP6CSyrnjyKseU81r8cj70P9zInhnXr42xgEro5huM4/yrBGLQkiUrOsPt9TO5wYkEAFp7Wqi5T2G8lzI9VliMQI9GCbQKaChdoATogS27nmCf5ouQHI0mO9kKpOqMatnJW9OHApJBVA== 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=NePvH70ov8cvBvYbWI+rlWRFF23g5IFvHeCHCR5BkD4=; b=JUikpTyY/M06FvOpuh0MwiV+s9AzkPXtaBu7T2SoCVrot8n0F9T8AbGnuxSQ38pqj8iiNjeXi3rNC64XsVWYSIwEJeOWwyjBKo/wZon4HMIZEi5zurSDd3X2dwUaXddZWjGmemhnrMe+/ys9hQdQ9WJDjMKLAFoSUXUw7T/qs0c= Received: from MN2PR11MB3550.namprd11.prod.outlook.com (2603:10b6:208:ee::21) by MN2PR11MB3950.namprd11.prod.outlook.com (2603:10b6:208:137::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.25; Fri, 26 Jun 2020 15:13:40 +0000 Received: from MN2PR11MB3550.namprd11.prod.outlook.com ([fe80::8181:d8ec:fef7:532f]) by MN2PR11MB3550.namprd11.prod.outlook.com ([fe80::8181:d8ec:fef7:532f%2]) with mapi id 15.20.3109.027; Fri, 26 Jun 2020 15:13:40 +0000 From: "Coyle, David" To: "De Lara Guarch, Pablo" , "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: AQHWSUpD5P7r8g5TwEu95AcvKSFZGKjmfNUAgARr+TA= Date: Fri, 26 Jun 2020 15:13:40 +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: Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-reaction: no-action dlp-version: 11.2.0.6 dlp-product: dlpe-windows 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.166] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: bc61d9a0-4518-43d5-fcc9-08d819e3825e x-ms-traffictypediagnostic: MN2PR11MB3950: 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:9508; x-forefront-prvs: 0446F0FCE1 x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Rpg2gE5LMXsYv4wV/bJ4QUM1tNXPgj0EZuYgIsyGiVSA0yzE31iYD7PzgSuTPQEnwFCxBpz3sPPTBjMip7XM96/70xldoZNtINRYCvEBg4XV8pn7HB4MKqm5U9FpB2zpTPdjEyCome1/FXYYfS9MiKdGGGKQ4aPY8et1E8MUr2Vzpsrq31YWUM9FN+KlrDSdwNZsP+sCVZ4Lxlz/u4mb/2vYARt0lKLqYnS1VElwbSwRndpKoIcyMAOoOxlLzLuokX3+6eY89hykBDH4z1X84IHY6OprhU3oQ6IvVv/8yYy0ZhWJRRaDZ6JSVjV+sCcY1CvQdhdiUuyRouNG8nxMlkJjLICnJCqmPPuy8B2uClbTbZw0z/Gp8W1qFy2sL5iP x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR11MB3550.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(136003)(39860400002)(396003)(366004)(346002)(376002)(83380400001)(5660300002)(8676002)(8936002)(26005)(478600001)(4326008)(107886003)(186003)(2906002)(9686003)(7416002)(6636002)(55016002)(52536014)(6506007)(66446008)(86362001)(76116006)(33656002)(71200400001)(66556008)(64756008)(66946007)(110136005)(66476007)(316002)(54906003)(7696005)(921003); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: u+EmfAWcm0LbiZ1Kxj+uETmQyJSn+j4LgdGzBW+RM0C/MUlwGnCQUs/GNV/sA5ZJ8cNLRlP+YIH9I3E6hvAX5nJA4ymdfB/VvRl30HYJc3SQRrDet2KK3UYaMXrRK0chxcK71uXUUP1wAd+iOSbsIP05ybcoVvAxHt7xf48qMX2zbZFeyncFlhhQLrfvegLGxkVlNmwrZUQV7qPcLcFgdSMSoPpA+RwQU4yeMv9neQJ51jxr9rN9IkUDXMTbDU7hgMTB9a+DObuWs16RXbJ961k1B+TTg2qE6/IuKVMuOsnbgkaAGNBKnGMwTIbT+u/LMDJKDNYJWwYgL6w55R6HzVmPLXDs/du3nu2LQ/xTI7MOL8NNjMDASODSTDGs+dTBXJBF0fpxTV3/Qoqf7WuG8U7sTGE/npxN98M1pYKwtRbI/zQcnsGheq+bBvEhXxDmiWZ+fm0mE9tB3c6B294igsctS0SbHK4JrUAO5FC9PMsSZpp0n8LS8BxDaTdoPCnd Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MN2PR11MB3550.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: bc61d9a0-4518-43d5-fcc9-08d819e3825e X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Jun 2020 15:13:40.7129 (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: vH3GbabCcJ2FDAVAggabOaAzsN2BkUtZ4YgnWEpu7vkg43AM9dLb3PkldF1JcEUAqHm8m100pIT3Z8WyIbbHqA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3950 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 Pablo, thank you for the comments > -----Original Message----- > From: De Lara Guarch, Pablo > Sent: Tuesday, June 23, 2020 6:57 PM >=20 > > +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) >=20 > I'd say we can use direct RTE_ETHER_CRC_LEN here, as there is no other > possible case, right? > It should perform better. [DC] You are correct - I have changed this to use RTE_ETHER_CRC_LEN. I had been thinking about removing the crc_size from the rte_security_docsi= s_xform and the docsis capabilities completely and your comment here has made me re= alize I should do this, as there is only 1 CRC length that can be used for DOCSIS= . So these have been removed. These changes will be in v3 early next week >=20 > > + *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 > > *status) { @@ -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)) { >=20 > Not sure if this unlikely is actually needed. I don't expect to have mult= iple > types enqueued in the same queue, so this or the other branch will always > be taken. [DC] That's a fair point - I have removed the unlikely Again, the change will be available in v3 >=20 > > + /* > > + * 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); >=20 > ... >=20 > > - 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)) >=20 > Same comment as above. [DC] Same reply as above. :) >=20 > > + retval =3D set_sec_mb_job_params(job, qp, op, > > + &digest_idx); > > + else > > +#endif