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 F1D3AE62 for ; Tue, 12 Jan 2016 19:12:08 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP; 12 Jan 2016 10:12:02 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,558,1444719600"; d="scan'208";a="725595892" Received: from dwdohert-dpdk.ir.intel.com ([163.33.213.167]) by orsmga003.jf.intel.com with ESMTP; 12 Jan 2016 10:12:00 -0800 From: Declan Doherty To: "dev@dpdk.org" , Olivier MATZ , Thomas Monjalon Message-ID: <569541C2.60302@intel.com> Date: Tue, 12 Jan 2016 18:11:14 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: [dpdk-dev] [RFC] cryptodev: Change burst APIs to crypto operation oriented X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2016 18:12:09 -0000 In this rfc I'm looking to get some feedback on a proposal to change the cryptodev burst API from the current implementation of accepting burst of rte_mbuf's to a burst API based on rte_crypto_op's. -static inline uint16_t -rte_cryptodev_dequeue_burst(uint8_t dev_id, uint16_t qp_id, - struct rte_mbuf **pkts, uint16_t nb_pkts) +static inline uint16_t +rte_cryptodev_dequeue_op_burst(uint8_t dev_id, uint16_t qp_id, + struct rte_crypto_op **ops, uint16_t nb_ops) -static inline uint16_t -rte_cryptodev_dequeue_burst(uint8_t dev_id, uint16_t qp_id, - struct rte_mbuf **pkts, uint16_t nb_pkts) + static inline uint16_t +rte_cryptodev_dequeue_op_burst(uint8_t dev_id, uint16_t qp_id, + struct rte_crypto_op **ops, uint16_t nb_ops) The motivation for these changes are to address the concerns raise in the discussion of the rte_mbuf_offload library patch (http://dpdk.org/ml/archives/dev/2015-November/028247.html) by both Thomas and Olivier. By changing to an API which accepts bursts of rte_crypto_op structures we are no longer need to have a specific field in the rte_mbuf for offload operations and instead with a small modification to the rte_crypto_op structure by adding a field for the source rte_mbuf on which the crypto operation is going to be performed the same functionality can be performed. This will break the current dependency between the rte_mbuf and the rte_mbuf_offload library and by proxy the rte_cyptodev library. struct rte_crypto_op { enum rte_crypto_op_sess_type type; enum rte_crypto_op_status status; + struct rte_mbuf *m_src; /**< source mbuf */ struct rte_mbuf *m_dst; /**< Destination mbuf */ .... } Another advantage of this approach is that it simplifies and speeds up the processing of bursts within crypto PMDs as they no longer have to search for the crypto operation within the rte_mbuf_offload structure and can instead just operate on the crypto operation directly. Regarding the rte_mbuf_offload library I think that it should be removed and that we can look adding a more general solution for managing external metadata to the rte_mbuf library when that functionality is required.