From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0059.outbound.protection.outlook.com [104.47.33.59]) by dpdk.org (Postfix) with ESMTP id 6028D1D7 for ; Sun, 29 Apr 2018 18:30:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=w2oJv9on1TUJkyVXMZtg3nrwvhuWuND5DUBhseHLeAI=; b=EW4xkTihXhKvBNTKZUHlrH/frn2RDZ91o4+0x7fLV8atS64rX7WrbMNP1dPAHQxvrSH5zftJvgMrJT69NMuXH89PK4Yi8A3YTPjp3vW99aPT713a92+2pTyzxXtNQgwfypy56QnC26pcBetTmsQ02i0KTuL4MSJ4udAk4K8v2CE= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.JacobKollanukkaran@cavium.com; Received: from jerin (116.68.105.116) by CY1PR07MB2524.namprd07.prod.outlook.com (2a01:111:e400:c636::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.715.20; Sun, 29 Apr 2018 16:30:46 +0000 Date: Sun, 29 Apr 2018 22:00:30 +0530 From: Jerin Jacob To: Abhinandan Gujjar Cc: hemant.agrawal@nxp.com, akhil.goyal@nxp.com, dev@dpdk.org, narender.vangati@intel.com, nikhil.rao@intel.com, gage.eads@intel.com Message-ID: <20180429163028.GE11546@jerin> References: <1524573807-168522-1-git-send-email-abhinandan.gujjar@intel.com> <1524573807-168522-7-git-send-email-abhinandan.gujjar@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1524573807-168522-7-git-send-email-abhinandan.gujjar@intel.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-Originating-IP: [116.68.105.116] X-ClientProxiedBy: MAXPR0101CA0056.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:e::18) To CY1PR07MB2524.namprd07.prod.outlook.com (2a01:111:e400:c636::15) X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:CY1PR07MB2524; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2524; 3:P1uUWdh75jmW9VcDIAZ7R8ThFx4Ei5Y5COTFZ8Ei/umkyg+fVL5v/e41nvWuHyk2ieGiMrlkXvNlJj2ZA+LTCvjT7FjGhmKUZliuKlbfk8DvHRX7ujjVH0yPv9/Z9i9FhzmePeN+FA5I74dXgSqbYAbTSNvPpHTnZp4LmqENgFKWAy7WEkCLsG/HZ0o3RNTZDqoRQYxJORf86tdHOADbvpq7iG0OJVH2u2iyV1mostmWNHQam2G+i5sYrHplMXda; 25:nX1iv8oJI/+Oo41tYxi2ucXvOHj9xpyE1c55jtHdur1DUC+/LDwVAQZqJqmx6pUuh2qaU21KoTmQU6/yXnxyr+tf7rTdLE/rmmxYE64efFxotNryD2exRkKZleTOzzNADEmX8PCxrEr/DcgLCbmSq4DMvLQAX/4rbGD7IUmm1PhjT3oR7rHVZPsrws8BqVnKpMbYWn4aquQXgmp5LZpOXmhr0nzMcNuhuQp1c1JPNcm0/NE3JMgOOgFwwhitUrdGNOijAM12ydhV5y96SES/xe1dYSRzFDgDzYtfvqf1Ek1tVbR6Zl4SENH565RMGy5IDiNcvkMZ3xV/qtHSPq5/Sw==; 31:1rAN7xa8lPo7KQzD9jD8oa7PL0ACY5PZNnE+5dTM9AcbsTM7bqmBf//QbxxTdu6Igsc037fUG/SzTnCIHSBhID8kv2uESid/LOaWclI+yLgY0GZBCP5uebwBl2Kf8+B9cwzN4QVdQgvqCVnR8BtzbCmnm25WlnJAEL3nATtr1gIM5bPWaGJ/tMHjtIlNB9586B4Xz3ldLbDjPdSH47wT0wcc88dZyIJsBZSWE8NJ9bo= X-MS-TrafficTypeDiagnostic: CY1PR07MB2524: X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2524; 20:qnBxtxYgJChL9rnDBcTuvFLm+DEML3m9p9z2UvZAHz0Grznk3gHE4/ol5jiyRvf0fMXKAxfh3Vm8uSMjeShbZphst3F64c3j4ZxuV1rALtCr8aAr+raCiBJ+6DiSZ+7Aw/Sw3GHAoo8hPxqwdY5gS5KLYGmjZNEn9J99uJY2uctuc8LCiWBbJx86CgxC4KdYcf8YYfy1b/ff6dGxZod3goc9yZu/N7BHbGDPHSeoGwL/19cRAcp4yRisjNh6y+AI2A3ZmJogRbyVUPE6PEJ+4BgxqQDH+LcD0RHN1EINzXdRln877hJe3+np8RxCpjx9Q6N06v23phuu6S3vaLadOLB8iqpwheHxmEh5IwRWFNXo5vNt1lbawuCPCYq1vQ1ZTIjg7EXgeDCbftZ4VUSPgPH+VY7dZp51zA+13iHt8f4mlfzmovXHnIRg/d1/rV/PrZjdmEvgJVHJnUGG6pJXlMu7qacLS8u6gTOImPWkMAVOs1rbxk3sz23ctZyVaIsgwLTvxShpGwun26CO6rPs6Z/9ZqKsjpUzLFrUJGxF1G8I7M/1UhlJGj1nXE7gP/3hFwtOd/bXYVL2YZNyji43BB1HX9Iajloh+t7Pv1puziM= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192374486261705)(185117386973197)(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(93006095)(10201501046)(3231254)(944501410)(52105095)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123564045)(20161123560045)(20161123558120)(6072148)(201708071742011); SRVR:CY1PR07MB2524; BCL:0; PCL:0; RULEID:; SRVR:CY1PR07MB2524; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2524; 4:hsl2g6K2jhKFzzwpptwVSVA17qw9EFCCSYot5MSsbUQgjdW2CNoiIlIkWNPfy9K5egnvyDQbRKfibNL4OkDxN3IOAf8ldJQzg96sU1m/IjIbrnUIDvpwIH4e6PG14kwscxkqPYYAaH+qczYqQSAUtsDbo6SI2+8clUH+a5lfmavyjwJtzvrTwm2QWtSrWp9K6Ek2mo8i24MlkgBWHxjOf+JV1bZxE7YZszdZ0bImn4YNjnWk7VZ9+s3eq1A2CuysrhibSB/yMCMd2uh9SIuk0RFaW2r4uoqc5qYUV7lUSVnMczHEwz0tGPk/dirCub5HE8z+vAd3Glf4A9uYFvJAmYAwAkFzFCODyWCdq6nHm6IQNi7CxggTKmWWvmO9WOyS X-Forefront-PRVS: 0657D528EC X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(346002)(376002)(39850400004)(39380400002)(396003)(13464003)(199004)(189003)(16586007)(58126008)(25786009)(446003)(316002)(229853002)(8676002)(42882007)(106356001)(105586002)(53376002)(55016002)(305945005)(72206003)(6246003)(68736007)(478600001)(11346002)(5660300001)(6916009)(8936002)(53936002)(6666003)(6306002)(9686003)(6116002)(59450400001)(47776003)(386003)(76176011)(476003)(3846002)(26005)(33896004)(2906002)(33656002)(97736004)(6496006)(52116002)(486006)(33716001)(1076002)(7736002)(23726003)(4326008)(50466002)(186003)(44832011)(66066001)(55236004)(81166006)(8656006)(16526019)(81156014)(956004)(18370500001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR07MB2524; H:jerin; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR07MB2524; 23:jCQGCEw2b3WmeiDllRFFOk4DzToYM0DUs7xlv1LM7?= =?us-ascii?Q?2NhIpSRkGnu+bpDwD1hTEninBTDdNIdUoovC6AKmpVy6jQPthnBQtcW51AOU?= =?us-ascii?Q?qoYJA7ALK2Z3EtmPxZ7q+xuS8eoQZIkhEevnG9tbK1PATsF8K1e53yyL5r81?= =?us-ascii?Q?536yRuveFmPg/4AYKNa9+saS41r8oyFm5+qSFegXkmLheO60cvmMGL9tpT2X?= =?us-ascii?Q?12ENOY0jjWTcKQHcygxcohOsZLEkATou7oaxNqmanqEdKFdsfqfjD6M7tPCL?= =?us-ascii?Q?7ImPatxr/vlU+hjL92Veh0ZHzVsTXInUe/sCu3KwSqc+hjTP1XyHysQVp91P?= =?us-ascii?Q?S5jRu/lSB53dXB6Md7uV2Hd/lsRwDsxChh67+tP9iIEPDUZHXUeRCbCiNHis?= =?us-ascii?Q?jp+Iz7NJGd19MlM1nRyqSsNDObAEsnYktW4q/ks+MH4kGkT5Uh2LuUdHkWbn?= =?us-ascii?Q?+TJCPlg6GO77+AUqkz+LoQIGOwfAX0+XTQwSo4bQlo/xJTI8PIKq6lXp3c0t?= =?us-ascii?Q?rQ50op82OjRYLYdtzYXFD0bPODvkJ7eJCNSwLzvXGZIhPCnBmL+avkND08T+?= =?us-ascii?Q?CzDJWcyl8XVFYzaWrBhWNY06sTHqYDqDljueWd1KgcpTnO61c0pqmZeslXMN?= =?us-ascii?Q?okmYXEeasdh284DtpXaNMnGJ/1BcIHx77TRNIqOW3WIanSr8W4mrhsADAg0e?= =?us-ascii?Q?qDkkBAnLqNnjUvkd4WLQ2b9wMDbn+zgf7K2RHYnX2sqWWeYPOUK/7nO1B03I?= =?us-ascii?Q?padgayXjI2DJWGWYs4D4YoRcQPEkPrlYpgRt3ItPw1gX9tdfn5SyZbPlCqoO?= =?us-ascii?Q?jaHcpf7aEC+CfWrV29g+RryaW0OO8IW+xsM3Z4nTE7W+elQuLRrB9uXreKWP?= =?us-ascii?Q?HvEYVlxEv3GbS95BI0U42h8hQjvVH35zlqm0Q8mEFikqh2sTf4S1wQY9T4YQ?= =?us-ascii?Q?bIEw1tJpqGk3wFYUxLjVdGpcmukX9YYR3Ssikwkl9XgaslAtGzV291w8xQx+?= =?us-ascii?Q?Fv2VQwXlyWAW56Ydico+DtBA/8nqVENN7Jp8hLcnhQ4UagEfTwd5HAhJDHOF?= =?us-ascii?Q?3FP5s7awbtFkY25UoLDielekNAbZLV6b+dPvBWJiVwqblG750d06JGeTSm3V?= =?us-ascii?Q?RwrnevofCLSUCgklKg87iTqBXDZ1uVOIP2smBXaUxDnEulrAoX3X3OuDdnlT?= =?us-ascii?Q?LjS91kXQYzay9KE6Lm3007DA3qLmbLvZ92yHBsnHpko8pCtu3NveYoUTqPJs?= =?us-ascii?Q?EibtHciBxiOvk8kBtpDspn8P6pYzXLSLAk36TLrBEDjD1rmxKcrtcIntQHvO?= =?us-ascii?Q?qMU7q2r63D6/0a+GdNXQ+whQzDAl6mqUWFIXPGpZegzMCwMJf+nboMaBe5uv?= =?us-ascii?Q?LknU/NS2ArUXF2BWf5J/W1xTXEynXkrFP4ti7PIMpTIl/s8GEE/sYJ+7NwaJ?= =?us-ascii?Q?M4fytAsK4GebZ3EYd+UvNFv/oYAsSY=3D?= X-Microsoft-Antispam-Message-Info: UyV9MWs032dbba9yVYk7X10y+2ZuWEDBAIR1zG6rpGArsikPfdiBlJZx7wq2gAFNXBm9oYEjVDI17PbiI10u4rDrEIxnJAMr+Gw4ch5inEXJD3JqWJ4FXPgcZLS7y+fTn6PUtGUfnrqxxMxR4VFEXJgJmr7QaE6XwY4O85IvuER3pe8eJ53SL2LvPdTimUAq X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2524; 6:wcs5L+2UTa1e16l/+h3l5VmKKUGDuzpfUcM7WdjPFqUqUBCEq5L05/1okeDtlrbsEnketqDsfGzSKLVZbiH35KCTotG+8/j26bWZce+Z9AbmagyqMyiXlf+AN9leFIqZCkPbyIUT3j7QaaiWkSnu6KDfmM2lhLlxs2d3sd4Jp+qQ1zZydt12YVh7X0rNVCc6NoT/gKCRTWxyWhA6JPylLNU5apo1ezlqyOPI4RN4RcNTlf46pk+MxL3+wQDEHmRo/H0QX9PjbMUVXxR7DgB0/GCyyTau1xK3xy839y8KoAASllTs+RNdFV7kFt/XQckDymtcOXXFB1uTrdMF+OTmOUbJ0TJPxrrf0WG51vEKZuFsaAK1fJeYKs+T+4esqJJwpKp5rrdvAaeN4tHTgWeEaSKzHioABSwFtgdZcJRkiwNJWnumDnQFptH56Tk8kqyH/FffqKupGGWV6irPOeferQ==; 5:pe8AXuvo1wNFkLkpxbOYfKQ2btIfKIIA8L5bds9pk97dhSw5EsURZdwn/lbOAn8amPMO/lRUOjk27xduZRJbrGrnyjbGQ25k8USl5YDaP32oRd0Kf1mEZWgZ9X0ZXwSF0lgA7O4Lv8QcZaLxRG/+63XyKC0Q28UdyfKYvSM4TY0=; 24:riF6tDGtolVYfDaGgkWMNvQksih9j2+g4pqL53NHRqYV5hwpuj0eyKyI7kZUjZtaBAM2aNmuQ7Lvfwm2CfrQeorcqKRrKjEVsoQs9MEVyfw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2524; 7:tdz6zB6ii6eA/ka8/tJ5QWocq53n2cNmsZY2Q0V3nL03x7nhuDubdlyIIdBnoorT3+SJNkII3jpGvUGXVJfvDjD4m3thdc6ga+BEXw+9oIxunmdQpbdUrAlG9lmnd5avu1/dL8BBVquDI3x15RdDWK1xx4GjOnzZYP8Uad3zuNacuDZ1NWj+OVZhiXag73EAuQ46GWz6hs2KOhDyb7sR2qO51VMYhEjrf7SYE/8qRkDMJMn3h6AQXdtVbVryf3Ut X-MS-Office365-Filtering-Correlation-Id: 3d0c5e46-c8eb-4eee-a2e5-08d5adee91c2 X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Apr 2018 16:30:46.5035 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3d0c5e46-c8eb-4eee-a2e5-08d5adee91c2 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR07MB2524 Subject: Re: [dpdk-dev] [v2, 6/6] doc: add event crypto adapter documentation 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: Sun, 29 Apr 2018 16:30:53 -0000 -----Original Message----- > Date: Tue, 24 Apr 2018 18:13:27 +0530 > From: Abhinandan Gujjar > To: jerin.jacob@caviumnetworks.com, hemant.agrawal@nxp.com, > akhil.goyal@nxp.com, dev@dpdk.org > CC: narender.vangati@intel.com, abhinandan.gujjar@intel.com, > nikhil.rao@intel.com, gage.eads@intel.com > Subject: [v2,6/6] doc: add event crypto adapter documentation > X-Mailer: git-send-email 1.9.1 > > Add entries in the programmer's guide, API index, maintainer's file > and release notes for the event crypto adapter. > > Signed-off-by: Abhinandan Gujjar > --- > + > +The packet flow from cryptodev to the event device can be accomplished > +using both SW and HW based transfer mechanisms. > +The Adapter queries an eventdev PMD to determine which mechanism to be used. > +The adapter uses an EAL service core function for SW based packet transfer > +and uses the eventdev PMD functions to configure HW based packet transfer > +between the cryptodev and the event device. > + > +Crypto adapter uses a new event type called ``RTE_EVENT_TYPE_CRYPTODEV`` > +to indicate the event source. > + I think, we can add diagrams used in rte_event_crypto_adapter.h with sequence number in SVG format here to make it easier to understand for the end user. > +API Overview > +------------ > + > +This section has a brief introduction to the event crypto adapter APIs. > +The application is expected to create an adapter which is associated with > +a single eventdev, then add cryptodev and queue pair to the adapter instance. > + > +Adapter can be started in ``RTE_EVENT_CRYPTO_ADAPTER_DEQ_ONLY`` or > +``RTE_EVENT_CRYPTO_ADAPTER_ENQ_DEQ`` mode. > +In first mode, application will submit a crypto operation directly to cryptodev. > +In the second mode, application will send a crypto ops to cryptodev adapter > +via eventdev. The cryptodev adapter then submits the crypto operation to the > +crypto device. > + > +Create an adapter instance > +-------------------------- > + > +An adapter instance is created using ``rte_event_crypto_adapter_create()``. This > +function is called with event device to be associated with the adapter and port > +configuration for the adapter to setup an event port(if the adapter needs to use > +a service function). > + > +.. code-block:: c > + > + int err; > + uint8_t dev_id, id; > + struct rte_event_dev_info dev_info; > + struct rte_event_port_conf conf; > + enum rte_event_crypto_adapter_mode mode; > + > + err = rte_event_dev_info_get(id, &dev_info); > + > + conf.new_event_threshold = dev_info.max_num_events; > + conf.dequeue_depth = dev_info.max_event_port_dequeue_depth; > + conf.enqueue_depth = dev_info.max_event_port_enqueue_depth; > + mode = RTE_EVENT_CRYPTO_ADAPTER_ENQ_DEQ; > + err = rte_event_crypto_adapter_create(id, dev_id, &conf, mode); > + > +If the application desires to have finer control of eventdev port allocation > +and setup, it can use the ``rte_event_crypto_adapter_create_ext()`` function. > +The ``rte_event_crypto_adapter_create_ext()`` function is passed as a callback > +function. The callback function is invoked if the adapter needs to use a > +service function and needs to create an event port for it. The callback is > +expected to fill the ``struct rte_event_crypto_adapter_conf`` structure > +passed to it. > + > +For ENQ-DEQ mode, the event port created by adapter can be retrived using s/retrived/retrieved ? > +``rte_event_crypto_adapter_event_port_get()`` API. > +Application can use this event port to link with event queue on which it > +enqueue events towards the crypto adapter. > + > +.. code-block:: c > + > + uint8_t id, evdev, crypto_ev_port_id, app_qid; > + struct rte_event ev; > + int ret; > + > + ret = rte_event_crypto_adapter_event_port_get(id, &crypto_ev_port_id); > + ret = rte_event_queue_setup(evdev, app_qid, NULL); > + ret = rte_event_port_link(evdev, crypto_ev_port_id, &app_qid, NULL, 1); > + > + /* Fill in event info and update event_ptr with rte_crypto_op */ > + memset(&ev, 0, sizeof(ev)); > + ev.queue_id = app_qid; > + . > + . > + ev.event_ptr = op; > + ret = rte_event_enqueue_burst(evdev, app_ev_port_id, ev, nb_events); > + > + > +Adding queue pair to the adapter instance > +----------------------------------------- > + > +Cryptodev device id and queue pair are created using cryptodev APIs. > +Refer '`_. > + > +.. code-block:: c > + > + struct rte_cryptodev_config conf; > + struct rte_cryptodev_qp_conf qp_conf; > + uint8_t cdev_id = 0; > + uint16_t qp_id = 0; > + > + rte_cryptodev_configure(cdev_id, &conf); > + rte_cryptodev_queue_pair_setup(cdev_id, qp_id, &qp_conf); > + > +These cryptodev id and queue pair are added to the instance using the > +``rte_event_crypto_adapter_queue_pair_add()`` function. > +The same is removed using ``rte_event_crypto_adapter_queue_pair_del()``. > + > +.. code-block:: c > + > + struct rte_event_crypto_queue_pair_conf conf; > + > + rte_event_crypto_adapter_queue_pair_add(id, cdev_id, qp_id, &conf); > + > + > +Querying adapter capabilities > +----------------------------- > + > +The ``rte_event_crypto_adapter_caps_get()`` function allows > +the application to query the adapter capabilities for an eventdev and cryptodev > +combination. This API provides whether cryptodev and eventdev are connected using > +internal HW port or not. > + > +.. code-block:: c > + > + rte_event_crypto_adapter_caps_get(dev_id, cdev_id, &cap); > + > + > +Configure the service function > +------------------------------ > + > +If the adapter uses a service function, the application is required to assign > +a service core to the service function as show below. > + > +.. code-block:: c > + > + uint32_t service_id; > + > + if (rte_event_crypto_adapter_service_id_get(id, &service_id) == 0) > + rte_service_map_lcore_set(service_id, CORE_ID); > + > + > +Set event request/response information > +-------------------------------------- > + > +In the ENQ_DEQ mode, the application needs to specify the cryptodev ID > +and queue pair ID (request information) in addition to the event > +information (response information) needed to enqueue an event after > +the crypto operation has completed. The request and response information > +are specified in the ``struct rte_crypto_op`` private data or session's > +private data. I think, we can mention the use of rte_event_crypto_adapter_event_port_get() API here. > + > +In the DEQ mode, the application is required to provide only the > +response information. > + > +The SW adapter or HW PMD uses ``rte_crypto_op::sess_type`` to > +decide whether request/response data is located in the crypto session/ > +crypto security session or at an offset in the ``struct rte_crypto_op``. > +The ``rte_crypto_op::private_data_offset`` is used to locate the request/ > +response in the ``rte_crypto_op``. > + > +For crypto session, ``rte_cryptodev_sym_session_set_private_data()`` API > +will be used to set request/response data. The same data will be obtained > +by ``rte_cryptodev_sym_session_get_private_data()`` API. > + > +For security session, ``rte_security_session_set_private_data()`` API > +will be used to set request/response data. The same data will be obtained > +by ``rte_security_session_get_private_data()`` API. I think, we need to talk about RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA capability here and have check in sample code/common code(please ignore if the check is already present in common code) > + > +For session-less it is mandatory to place the request/response data with > +the ``rte_crypto_op``. > + > +.. code-block:: c > + > + union rte_event_crypto_metadata m_data; > + struct rte_event ev; > + struct rte_crypto_op *op; > + > + /* Allocate & fill op structure */ > + op = rte_crypto_op_alloc(); > + > + memset(&m_data, 0, sizeof(m_data)); > + memset(&ev, 0, sizeof(ev)); > + /* Fill event information and update event_ptr to rte_crypto_op */ > + ev.event_ptr = op; > + > + if (op->sess_type == RTE_CRYPTO_OP_WITH_SESSION) { > + /* Copy response information */ > + rte_memcpy(&m_data.response_info, &ev, sizeof(ev)); > + /* Copy request information */ > + m_data.request_info.cdev_id = cdev_id; > + m_data.request_info.queue_pair_id = qp_id; > + /* Call set API to store private data information */ > + rte_cryptodev_sym_session_set_private_data( > + op->sym->session, > + &m_data, > + sizeof(m_data)); > + } if (op->sess_type == RTE_CRYPTO_OP_SESSIONLESS) { > + uint32_t len = IV_OFFSET + MAXIMUM_IV_LENGTH + > + (sizeof(struct rte_crypto_sym_xform) * 2); > + op->private_data_offset = len; > + /* Copy response information */ > + rte_memcpy(&m_data.response_info, &ev, sizeof(ev)); > + /* Copy request information */ > + m_data.request_info.cdev_id = cdev_id; > + m_data.request_info.queue_pair_id = qp_id; > + /* Store private data information along with rte_crypto_op */ > + rte_memcpy(op + len, &m_data, sizeof(m_data)); > + } > +