DPDK  21.08.0
rte_event_crypto_adapter.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2018 Intel Corporation.
3  * All rights reserved.
4  */
5 
6 #ifndef _RTE_EVENT_CRYPTO_ADAPTER_
7 #define _RTE_EVENT_CRYPTO_ADAPTER_
8 
167 #ifdef __cplusplus
168 extern "C" {
169 #endif
170 
171 #include <stdint.h>
172 
173 #include "rte_eventdev.h"
174 #include "eventdev_pmd.h"
175 
196 };
197 
203  uint8_t resv[8];
208  uint16_t cdev_id;
210  uint16_t queue_pair_id;
212  uint32_t resv1;
214 };
215 
227  struct rte_event_crypto_request request_info;
231  struct rte_event response_info;
236 };
237 
244  uint8_t event_port_id;
249  uint32_t max_nb;
254 };
255 
277 typedef int (*rte_event_crypto_adapter_conf_cb) (uint8_t id, uint8_t dev_id,
278  struct rte_event_crypto_adapter_conf *conf,
279  void *arg);
280 
289  uint64_t event_deq_count;
293  uint64_t crypto_enq_fail;
297  uint64_t event_enq_count;
303 };
304 
330 int
331 rte_event_crypto_adapter_create_ext(uint8_t id, uint8_t dev_id,
334  void *conf_arg);
335 
363 int
364 rte_event_crypto_adapter_create(uint8_t id, uint8_t dev_id,
365  struct rte_event_port_conf *port_config,
367 
379 int
381 
404 int
406  uint8_t cdev_id,
407  int32_t queue_pair_id,
408  const struct rte_event *event);
409 
426 int
428  int32_t queue_pair_id);
429 
445 int
447 
458 int
460 
474 int
476  struct rte_event_crypto_adapter_stats *stats);
477 
488 int
490 
506 int
507 rte_event_crypto_adapter_service_id_get(uint8_t id, uint32_t *service_id);
508 
523 int
524 rte_event_crypto_adapter_event_port_get(uint8_t id, uint8_t *event_port_id);
525 
566 static inline uint16_t
568  uint8_t port_id,
569  struct rte_event ev[],
570  uint16_t nb_events)
571 {
572  const struct rte_eventdev *dev = &rte_eventdevs[dev_id];
573 
574 #ifdef RTE_LIBRTE_EVENTDEV_DEBUG
575  RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(dev_id, -EINVAL);
576 
577  if (port_id >= dev->data->nb_ports) {
578  rte_errno = EINVAL;
579  return 0;
580  }
581 #endif
582  rte_eventdev_trace_crypto_adapter_enqueue(dev_id, port_id, ev,
583  nb_events);
584 
585  return dev->ca_enqueue(dev->data->ports[port_id], ev, nb_events);
586 }
587 
588 #ifdef __cplusplus
589 }
590 #endif
591 #endif /* _RTE_EVENT_CRYPTO_ADAPTER_ */
int rte_event_crypto_adapter_stats_get(uint8_t id, struct rte_event_crypto_adapter_stats *stats)
int rte_event_crypto_adapter_create_ext(uint8_t id, uint8_t dev_id, rte_event_crypto_adapter_conf_cb conf_cb, enum rte_event_crypto_adapter_mode mode, void *conf_arg)
int rte_event_crypto_adapter_start(uint8_t id)
int rte_event_crypto_adapter_service_id_get(uint8_t id, uint32_t *service_id)
#define rte_errno
Definition: rte_errno.h:29
rte_event_crypto_adapter_mode
static uint16_t rte_event_crypto_adapter_enqueue(uint8_t dev_id, uint8_t port_id, struct rte_event ev[], uint16_t nb_events)
int rte_event_crypto_adapter_stats_reset(uint8_t id)
int rte_event_crypto_adapter_event_port_get(uint8_t id, uint8_t *event_port_id)
int rte_event_crypto_adapter_queue_pair_add(uint8_t id, uint8_t cdev_id, int32_t queue_pair_id, const struct rte_event *event)
int rte_event_crypto_adapter_create(uint8_t id, uint8_t dev_id, struct rte_event_port_conf *port_config, enum rte_event_crypto_adapter_mode mode)
int rte_event_crypto_adapter_free(uint8_t id)
int rte_event_crypto_adapter_stop(uint8_t id)
int rte_event_crypto_adapter_queue_pair_del(uint8_t id, uint8_t cdev_id, int32_t queue_pair_id)
int(* rte_event_crypto_adapter_conf_cb)(uint8_t id, uint8_t dev_id, struct rte_event_crypto_adapter_conf *conf, void *arg)