From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 6583D1B6EE for ; Mon, 29 Jan 2018 18:19:21 +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 orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Jan 2018 09:19:20 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,432,1511856000"; d="scan'208";a="199547061" Received: from irsmsx102.ger.corp.intel.com ([163.33.3.155]) by fmsmga005.fm.intel.com with ESMTP; 29 Jan 2018 09:19:17 -0800 Received: from irsmsx101.ger.corp.intel.com ([169.254.1.188]) by IRSMSX102.ger.corp.intel.com ([169.254.2.95]) with mapi id 14.03.0319.002; Mon, 29 Jan 2018 17:19:17 +0000 From: "Zhang, Roy Fan" To: Jay Zhou , "dev@dpdk.org" CC: "yliu@fridaylinux.org" , "maxime.coquelin@redhat.com" , "arei.gonglei@huawei.com" , "Zeng, Xin" , "weidong.huang@huawei.com" , "wangxinxin.wang@huawei.com" , "longpeng2@huawei.com" Thread-Topic: [PATCH] virtio: add new driver for crypto devices Thread-Index: AQHTX8dFV/HgsE430UOJJXSBBIVIC6OLh3WA Date: Mon, 29 Jan 2018 17:19:16 +0000 Message-ID: <9F7182E3F746AB4EA17801C148F3C604330ABC27@IRSMSX101.ger.corp.intel.com> References: <1510938620-15268-1-git-send-email-jianjay.zhou@huawei.com> In-Reply-To: <1510938620-15268-1-git-send-email-jianjay.zhou@huawei.com> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNGVlMDgwN2UtOWY3Yi00YThkLWJiZjctMmI1NTFkNzE1MzZlIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6InROWktqVTlvU0I0SlBkckt4SnZaNkZFbmZucktKdFBzMHpkRTZKZ0wrb0k9In0= dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] virtio: add new driver for crypto devices 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, 29 Jan 2018 17:19:23 -0000 Hi Jay,=20 A few more comments inline. > -----Original Message----- > From: Jay Zhou [mailto:jianjay.zhou@huawei.com] > Sent: Friday, November 17, 2017 5:10 PM > To: dev@dpdk.org > Cc: yliu@fridaylinux.org; maxime.coquelin@redhat.com; > arei.gonglei@huawei.com; Zhang, Roy Fan ; Zeng, > Xin ; weidong.huang@huawei.com; > wangxinxin.wang@huawei.com; longpeng2@huawei.com; > jianjay.zhou@huawei.com > Subject: [PATCH] virtio: add new driver for crypto devices >=20 > +++ b/drivers/crypto/virtio/virtio_crypto.h > @@ -0,0 +1,452 @@ The file "virtio_crypto.h" is identical to the one in the linux kernel head= er, right?=20 Could you use " #include " instead of creating a cop= y of the file? > diff --git a/drivers/crypto/virtio/virtio_cryptodev.c > b/drivers/crypto/virtio/virtio_cryptodev.c > new file mode 100644 > index 0000000..9e6cd20 > --- /dev/null > +++ b/drivers/crypto/virtio/virtio_cryptodev.c > @@ -0,0 +1,1542 @@ ... > + switch (cmd_id) { > + case VIRTIO_CRYPTO_CMD_CIPHER_HASH: > + case VIRTIO_CRYPTO_CMD_HASH_CIPHER: > + ctrl->u.sym_create_session.op_type > + =3D VIRTIO_CRYPTO_SYM_OP_ALGORITHM_CHAINING; The above line is clearly a bug. =20 > + ret =3D virtio_crypto_sym_pad_op_ctrl_req(ctrl, > + xform, true, &cipher_key_data, &auth_key_data, > session); > + if (ret < 0) { > + PMD_SESSION_LOG(ERR, > + "padding sym op ctrl req failed"); > + goto error_out; > + } > + ret =3D virtio_crypto_send_command(vq, ctrl, > + cipher_key_data, auth_key_data, session); > + if (ret < 0) { > + PMD_SESSION_LOG(ERR, > + "create session failed: %d", ret); > + goto error_out; > + } > + break; > + case VIRTIO_CRYPTO_CMD_CIPHER: Again, please try to replace the mallocs into rte_mempool_get() or rte_memp= ool_get_bulk() for performance reason. Best regards, Fan =20