From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80042.outbound.protection.outlook.com [40.107.8.42]) by dpdk.org (Postfix) with ESMTP id 6A54E1B05A for ; Mon, 17 Sep 2018 16:07:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=a02PIXSzVA/YUmUAZQK6iwI/m8Au4gVw1nIDAaSQcnE=; b=RSKwNjDxOF9OLV8+RSd4nZmpU5mUhB55UbcIHPMajsqPnka8Abamb/tfV4WNCAEPkGB3+z9J9lvVK/93INyn2pv8MaK7ALBrab0Nk0h+HWnXd6W/NRdROEFTr3s0pRWajBVvIytFaQZJWT83ue1rDGJsvMtMRNZe/EOtghn78Bc= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=akhil.goyal@nxp.com; Received: from [10.232.134.144] (14.143.30.134) by DB7PR04MB4889.eurprd04.prod.outlook.com (2603:10a6:10:18::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.18; Mon, 17 Sep 2018 14:07:13 +0000 To: Tomasz Duszynski , dev@dpdk.org Cc: nsamsono@marvell.com, mw@semihalf.com, Zyta Szpak References: <1535372574-18950-1-git-send-email-tdu@semihalf.com> <1535372574-18950-2-git-send-email-tdu@semihalf.com> From: Akhil Goyal Message-ID: <0ce2f520-15c4-8631-d0c4-3d469fbc81a9@nxp.com> Date: Mon, 17 Sep 2018 19:37:00 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <1535372574-18950-2-git-send-email-tdu@semihalf.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Originating-IP: [14.143.30.134] X-ClientProxiedBy: BM1PR0101CA0037.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:1a::23) To DB7PR04MB4889.eurprd04.prod.outlook.com (2603:10a6:10:18::20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 82d9c09c-1750-40b8-1e41-08d61ca6de7c X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:DB7PR04MB4889; X-Microsoft-Exchange-Diagnostics: 1; DB7PR04MB4889; 3:rGEidS62Pb3akfiqKqBY/emeKY5lVJ/gHT/GdIQ9wJIAGjesBRemhnaZIiSqmb+J62jkozpDf8W2R/kKS1aYzy9dVCHukrWLiedXarwsXEzljG0S5JX25lfJgxwQJWOvsFHxby5+sSfdoSfC3IZdbgx/A9y4M2x9z4hFL/a9wAgbjDse0yk4t/H7gJCxuP4K6UmzEXfd07Cwir+IdY9p9npAxkmsHcLRoPYy1QK+HFbzPH9X5d0FwwJafBhHiAJD; 25:eX5NksGem63tY31xSO3sL6gdDfrKgA/agaiuFHK/DrZHQCTSf5WAuWntvG0naT3buYGy93DBgu8JJCesxUqsInkVQ1jnCF0r7ZPmvsLD3yPogV52QXxMo4xd60lzLDVmBdl8IG/oD27GoAvW9SJHUpe+2JS2Mp1n7TBFNHTPqBMgaUAv5mZXLwoUbwJbi5dQsvEnRMSIVdoTuTw0LHdp8qpgKpBNqk2IT7UECAGVEC6a1Vk+UXwdvt0Ul/iOK9JfJH7+Hhvl6y+oEqyw3734uKUzplZ5G7IMAXmdqVWBQINijdbZcgT3IYOLkuw/tElY6KEZFimcHuM20Z7ZcksD+g==; 31:L02qnuPcB1na+AuKuC9n9hXyllVuD3kOHOyRJCgHBiqeLfUkiVEfbDG3tGy1RyusDMY5ihg5yso3i4h2qyHBcpDAQ9Dq/TS2RyUUFe1FiFMDGRxDqnonoECE7ocI+Vj/fcNfTgZk31aCpme6o5lodj3z97fuYODqFF/I7OQD3giH/3DEO9xN8B/2VlE5RyQ7SQLwElKWUuWcg4ZEXSSXufr/37YDeFL1JXluOUn2r9k= X-MS-TrafficTypeDiagnostic: DB7PR04MB4889: X-Microsoft-Exchange-Diagnostics: 1; DB7PR04MB4889; 20:K6pIa6YehHewxTJrc69VIZXKy+zQZkoOMQ2dGNahPgX7CHuPb91c16fH05j29Gi7nAD1+Jy2nSEoUqNkCRK96zErTT6MKmga++gIED4qRX0dGrUtzFXdM9nluvEqyIfzd5hMhDL4yBX7qyMaUrQVE4Ms/DcIsvNy14SI2YpO9+UR+3hJKFfkpyW+uqkxHbycijiug7A0Q7yMAQgDyDMp9fazPJjti0/2GASdq8PQdi6Yj1lQInDSwQklrW+tC0K7XdAlZ/DYlBt9M64B15yvpncIcl4xSC5J0e8ZFNFKotcRajuFNQ4xPwFdOaaMlyKF7reyGCjHzl8DdwGu1jalKlxzWGMOKPlftVvQOLoo9FuabN7ftX+ZgFmSfxOc8dcj0387XBssykfwpc6BaQib6wwN3kRhGnpE7YFocDFj8h0/mxbQPKVdu1Rdgk+oTCTzbGqO27c6EskdthEPOSWZ0PiZY6KWuOIsjQIAcq77nFSapwzLFasq3IjGuf5DFZP8; 4:esAjCAyMAW4KP9b2ZDcgghr6sri2gSAfJXWnbsrpxPE+cFhAcm34sC/BEbTNR7i2L5nzN6cyQL1MMho59OVCmBAoaZgB5rK4ZWE6/ZodByCzYGuxvL/hRg92B3XSRcb/fYGunZpsetXyjIoAmuWQu1VJitmswISrcbxoDZ0yLJHHHMir6tuxMPfRb2cTcai5Jz8LWSusDFZKF1DBe3spC+ATvb78esRELoRpRTsP6LRqGomWlSF53wQZ+dPYYMN2V8UWAb+kdRl/2pYcaQqUow== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231355)(944501410)(52105095)(10201501046)(3002001)(93006095)(93001095)(6055026)(149027)(150027)(6041310)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(201708071742011)(7699050); SRVR:DB7PR04MB4889; BCL:0; PCL:0; RULEID:; SRVR:DB7PR04MB4889; X-Forefront-PRVS: 0798146F16 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6049001)(346002)(396003)(136003)(366004)(39860400002)(376002)(199004)(189003)(3846002)(6116002)(81156014)(81166006)(2870700001)(68736007)(53936002)(16576012)(316002)(6666003)(6486002)(229853002)(65826007)(5660300001)(77096007)(8936002)(64126003)(36756003)(25786009)(3260700006)(47776003)(58126008)(26005)(2906002)(5009440100003)(53546011)(956004)(386003)(2616005)(11346002)(305945005)(66066001)(65806001)(31696002)(65956001)(4326008)(6246003)(52146003)(8676002)(105586002)(476003)(7736002)(52116002)(86362001)(14444005)(76176011)(186003)(16526019)(44832011)(486006)(106356001)(67846002)(2486003)(446003)(97736004)(478600001)(50466002)(31686004)(23676004)(110426005); DIR:OUT; SFP:1101; SCL:1; SRVR:DB7PR04MB4889; H:[10.232.134.144]; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtEQjdQUjA0TUI0ODg5OzIzOmxzZVY4NGt3bG5OdERHdXBqakpLck5iNzVt?= =?utf-8?B?czdCVGtIUFF3SHc5YjlDMDNVeEtQR1VranVXNzJIMWlkK2w0MmJuNTdKT3dC?= =?utf-8?B?UmVkLzYvTC8xaVZqVk1tektaNFltcVpYaTY0eDB1bUozU1dkNUs3TEV4Yml0?= =?utf-8?B?alJBNEhBRW9XNllvem5WemZwZXlSSjlwNG4xRDgrUWkxKzFGeHdZVzhJVThT?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bqEJWvTmHgZpjPZgaCenQhNDIojimfkSdcYARYNJoWIhQXVpLOxBnpWLwAQH4c1zZk=; 7:8XDaWGW4/dM6UhSfWrWLCfR/CMYRv4HW5/Esnx/ZtV1a1IWTS6AkNNoucYz5Tec6Y5jNiQcCv3vBVPF9ji7yhlJq9iaFvi8O0erUyAPnXFWvBTIPl4T7Vivv+8+AnM57zUyInbUNPMK1X0tB+4uI1p9P1bidGC7rNdBrcESzj6sG8kMhTu5Us9ZTWWEFunDPQKgNpx20reqwKcz93NvQQqzAxsUvouPOaD9n0aiVaC3i3BJdtaxipciHjGbdeeqV SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Sep 2018 14:07:13.1120 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 82d9c09c-1750-40b8-1e41-08d61ca6de7c X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4889 Subject: Re: [dpdk-dev] [PATCH 1/3] crypto/mvsam: add S/G support to crypto dirver 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, 17 Sep 2018 14:07:15 -0000 Hi Tomasz, On 8/27/2018 5:52 PM, Tomasz Duszynski wrote: > From: Zyta Szpak > > The patch adds support for chained source mbufs given > to crypto operations. The crypto engine accepts source buffer > containing a number of segments. The destination buffer > stays the same - always one segment. > On decryption, EIP engine will look for digest at 'auth_icv_offset' > offset in SRC buffer.It must be placed in the last segment and the > offset must be set to reach digest in the last segment. > If application doesn't placed digest in source mbuf, driver try to > copy it to a last segment. > > Signed-off-by: Zyta Szpak > Signed-off-by: Natalie Samsonov > Reviewed-by: Dmitri Epshtein > --- > drivers/crypto/mvsam/rte_mrvl_pmd.c | 96 +++++++++++++++++++++-------- > drivers/crypto/mvsam/rte_mrvl_pmd_private.h | 7 +++ > 2 files changed, 76 insertions(+), 27 deletions(-) > > diff --git a/drivers/crypto/mvsam/rte_mrvl_pmd.c b/drivers/crypto/mvsam/rte_mrvl_pmd.c > index 961802e..001aa28 100644 > --- a/drivers/crypto/mvsam/rte_mrvl_pmd.c > +++ b/drivers/crypto/mvsam/rte_mrvl_pmd.c > @@ -452,8 +452,10 @@ mrvl_request_prepare(struct sam_cio_op_params *request, > struct rte_crypto_op *op) > { > struct mrvl_crypto_session *sess; > - struct rte_mbuf *dst_mbuf; > + struct rte_mbuf *src_mbuf, *dst_mbuf; > + uint16_t segments_nb; > uint8_t *digest; > + int i; > > if (unlikely(op->sess_type == RTE_CRYPTO_OP_SESSIONLESS)) { > MRVL_CRYPTO_LOG_ERR("MRVL CRYPTO PMD only supports session " > @@ -469,29 +471,47 @@ mrvl_request_prepare(struct sam_cio_op_params *request, > return -EINVAL; > } > > - /* > + request->sa = sess->sam_sess; > + request->cookie = op; > + > + src_mbuf = op->sym->m_src; > + segments_nb = src_mbuf->nb_segs; > + /* The following conditions must be met: > + * - Destination buffer is required when segmented source buffer > + * - Segmented destination buffer is not supported > + */ > + if ((segments_nb > 1) && (!op->sym->m_dst)) { > + MRVL_CRYPTO_LOG_ERR("op->sym->m_dst = NULL!\n"); > + return -1; > + } > + /* For non SG case: > * If application delivered us null dst buffer, it means it expects > * us to deliver the result in src buffer. > */ > dst_mbuf = op->sym->m_dst ? op->sym->m_dst : op->sym->m_src; > > - request->sa = sess->sam_sess; > - request->cookie = op; > - > - /* Single buffers only, sorry. */ > - request->num_bufs = 1; > - request->src = src_bd; > - src_bd->vaddr = rte_pktmbuf_mtod(op->sym->m_src, void *); > - src_bd->paddr = rte_pktmbuf_iova(op->sym->m_src); > - src_bd->len = rte_pktmbuf_data_len(op->sym->m_src); > - > - /* Empty source. */ > - if (rte_pktmbuf_data_len(op->sym->m_src) == 0) { > - /* EIP does not support 0 length buffers. */ > - MRVL_CRYPTO_LOG_ERR("Buffer length == 0 not supported!"); > + if (!rte_pktmbuf_is_contiguous(dst_mbuf)) { > + MRVL_CRYPTO_LOG_ERR("Segmented destination buffer " > + "not supported.\n"); > return -1; > } > > + request->num_bufs = segments_nb; > + for (i = 0; i < segments_nb; i++) { > + /* Empty source. */ > + if (rte_pktmbuf_data_len(src_mbuf) == 0) { > + /* EIP does not support 0 length buffers. */ > + MRVL_CRYPTO_LOG_ERR("Buffer length == 0 not supported!"); > + return -1; > + } > + src_bd[i].vaddr = rte_pktmbuf_mtod(src_mbuf, void *); > + src_bd[i].paddr = rte_pktmbuf_iova(src_mbuf); > + src_bd[i].len = rte_pktmbuf_data_len(src_mbuf); > + > + src_mbuf = src_mbuf->next; > + } > + request->src = src_bd; > + > /* Empty destination. */ > if (rte_pktmbuf_data_len(dst_mbuf) == 0) { > /* Make dst buffer fit at least source data. */ > @@ -542,7 +562,7 @@ mrvl_request_prepare(struct sam_cio_op_params *request, > > /* > * EIP supports only scenarios where ICV(digest buffer) is placed at > - * auth_icv_offset. Any other placement means risking errors. > + * auth_icv_offset. > */ > if (sess->sam_sess_params.dir == SAM_DIR_ENCRYPT) { > /* > @@ -551,17 +571,36 @@ mrvl_request_prepare(struct sam_cio_op_params *request, > */ > if (rte_pktmbuf_mtod_offset( > dst_mbuf, uint8_t *, > - request->auth_icv_offset) == digest) { > + request->auth_icv_offset) == digest) > return 0; > - } > } else {/* sess->sam_sess_params.dir == SAM_DIR_DECRYPT */ > /* > * EIP will look for digest at auth_icv_offset > - * offset in SRC buffer. > + * offset in SRC buffer. It must be placed in the last > + * segment and the offset must be set to reach digest > + * in the last segment > */ > - if (rte_pktmbuf_mtod_offset( > - op->sym->m_src, uint8_t *, > - request->auth_icv_offset) == digest) { > + struct rte_mbuf *last_seg = op->sym->m_src; > + uint32_t d_offset = request->auth_icv_offset; > + u32 d_size = sess->sam_sess_params.u.basic.auth_icv_len; > + unsigned char *d_ptr; > + > + /* Find the last segment and the offset for the last segment */ > + while ((last_seg->next != NULL) && > + (d_offset >= last_seg->data_len)) { > + d_offset -= last_seg->data_len; > + last_seg = last_seg->next; > + } > + > + if (rte_pktmbuf_mtod_offset(last_seg, uint8_t *, > + d_offset) == digest) > + return 0; > + > + /* copy digest to last segment */ > + if (last_seg->buf_len >= (d_size + d_offset)) { > + d_ptr = (unsigned char *)last_seg->buf_addr + > + d_offset; > + rte_memcpy(d_ptr, digest, d_size); > return 0; > } > } > @@ -597,11 +636,10 @@ mrvl_crypto_pmd_enqueue_burst(void *queue_pair, struct rte_crypto_op **ops, > int ret; > struct sam_cio_op_params requests[nb_ops]; > /* > - * DPDK uses single fragment buffers, so we can KISS descriptors. > * SAM does not store bd pointers, so on-stack scope will be enough. > */ > - struct sam_buf_info src_bd[nb_ops]; > - struct sam_buf_info dst_bd[nb_ops]; > + struct mrvl_crypto_src_table src_bd[nb_ops]; > + struct sam_buf_info dst_bd[nb_ops]; > struct mrvl_crypto_qp *qp = (struct mrvl_crypto_qp *)queue_pair; > > if (nb_ops == 0) > @@ -609,11 +647,14 @@ mrvl_crypto_pmd_enqueue_burst(void *queue_pair, struct rte_crypto_op **ops, > > /* Prepare the burst. */ > memset(&requests, 0, sizeof(requests)); > + memset(&src_bd, 0, sizeof(src_bd)); > > /* Iterate through */ > for (; iter_ops < nb_ops; ++iter_ops) { > + /* store the op id for debug */ > + src_bd[iter_ops].iter_ops = iter_ops; > if (mrvl_request_prepare(&requests[iter_ops], > - &src_bd[iter_ops], > + src_bd[iter_ops].src_bd, > &dst_bd[iter_ops], > ops[iter_ops]) < 0) { > MRVL_CRYPTO_LOG_ERR( > @@ -767,6 +808,7 @@ cryptodev_mrvl_crypto_create(const char *name, > > sam_params.max_num_sessions = internals->max_nb_sessions; > > + /* sam_set_debug_flags(3); */ > return sam_init(&sam_params); > > init_error: > diff --git a/drivers/crypto/mvsam/rte_mrvl_pmd_private.h b/drivers/crypto/mvsam/rte_mrvl_pmd_private.h > index c16d95b..0689fc3 100644 > --- a/drivers/crypto/mvsam/rte_mrvl_pmd_private.h > +++ b/drivers/crypto/mvsam/rte_mrvl_pmd_private.h > @@ -38,6 +38,8 @@ > */ > #define BITS2BYTES(x) ((x) >> 3) > > +#define MRVL_MAX_SEGMENTS 16 > + > /** The operation order mode enumerator. */ > enum mrvl_crypto_chain_order { > MRVL_CRYPTO_CHAIN_CIPHER_ONLY, > @@ -84,6 +86,11 @@ struct mrvl_crypto_session { > uint16_t cipher_iv_offset; > } __rte_cache_aligned; > > +struct mrvl_crypto_src_table { > + uint16_t iter_ops; > + struct sam_buf_info src_bd[MRVL_MAX_SEGMENTS]; > +} __rte_cache_aligned; > + > /** Set and validate MRVL crypto session parameters */ > extern int > mrvl_crypto_set_session_parameters(struct mrvl_crypto_session *sess, > Please update the doc file for pmd and also set appropriate feature flag for scatter gather support. #define RTE_CRYPTODEV_FF_IN_PLACE_SGL                   (1ULL << 9) /**< In-place Scatter-gather (SGL) buffers, with multiple segments,  * are supported  */ #define RTE_CRYPTODEV_FF_OOP_SGL_IN_SGL_OUT             (1ULL << 10) /**< Out-of-place Scatter-gather (SGL) buffers are  * supported in input and output  */ #define RTE_CRYPTODEV_FF_OOP_SGL_IN_LB_OUT              (1ULL << 11) /**< Out-of-place Scatter-gather (SGL) buffers are supported  * in input, combined with linear buffers (LB), with a  * single segment in output  */ #define RTE_CRYPTODEV_FF_OOP_LB_IN_SGL_OUT              (1ULL << 12) /**< Out-of-place Scatter-gather (SGL) buffers are supported  * in output, combined with linear buffers (LB) in input  */ #define RTE_CRYPTODEV_FF_OOP_LB_IN_LB_OUT               (1ULL << 13) /**< Out-of-place linear buffers (LB) are supported in input and output */