MCPcopy Create free account
hub / github.com/F-Stack/f-stack / single_dev_process

Function single_dev_process

dpdk/app/test/test_cryptodev_crosscheck.c:753–801  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

751}
752
753static int
754single_dev_process(const struct crosscheck_test_profile *profile, uint16_t dev_id, enum
755 crypto_op_type op_type, const uint8_t *input_buf, uint16_t input_len,
756 uint8_t *output_buf, uint16_t *output_len)
757{
758 struct rte_cryptodev_sym_session *session = NULL;
759 struct rte_mbuf *ibuf = NULL, *obuf = NULL;
760 struct rte_crypto_op *op = NULL;
761 int ret = -1;
762
763 session = session_create(profile, dev_id, op_type);
764 if (session == NULL)
765 goto error;
766
767 ibuf = mbuf_create(input_buf, input_len);
768 if (ibuf == NULL)
769 goto error;
770
771 op = operation_create(profile, ibuf, op_type);
772 if (op == NULL)
773 goto error;
774
775 debug_hexdump(stdout, "Input:", rte_pktmbuf_mtod(ibuf, uint8_t*), ibuf->pkt_len);
776
777 rte_crypto_op_attach_sym_session(op, session);
778
779 struct rte_crypto_op *res = crypto_request_process(dev_id, op);
780 if (res == NULL)
781 goto error;
782
783 obuf = op->sym->m_src;
784 if (obuf == NULL) {
785 RTE_LOG(ERR, USER1, "Invalid packet received\n");
786 goto error;
787 }
788 mbuf_to_buf_copy(obuf, output_buf, output_len);
789
790 ret = 0;
791
792error:
793 if (session != NULL) {
794 int sret;
795 sret = rte_cryptodev_sym_session_free(dev_id, session);
796 RTE_VERIFY(sret == 0);
797 }
798 rte_pktmbuf_free(ibuf);
799 rte_crypto_op_free(op);
800 return ret;
801}
802
803static int
804buffers_compare(const uint8_t *expected, uint16_t expected_len,

Callers 2

crosscheck_all_devicesFunction · 0.85

Calls 10

session_createFunction · 0.85
mbuf_createFunction · 0.85
operation_createFunction · 0.85
debug_hexdumpFunction · 0.85
crypto_request_processFunction · 0.85
mbuf_to_buf_copyFunction · 0.85
rte_pktmbuf_freeFunction · 0.85
rte_crypto_op_freeFunction · 0.85

Tested by

no test coverage detected