| 643 | } |
| 644 | |
| 645 | static struct rte_mbuf* |
| 646 | mbuf_create(const uint8_t *input_buf, uint16_t input_len) |
| 647 | { |
| 648 | struct rte_mbuf *pkt; |
| 649 | uint8_t *pkt_data; |
| 650 | |
| 651 | pkt = rte_pktmbuf_alloc(testsuite_params.mbuf_pool); |
| 652 | if (pkt == NULL) { |
| 653 | RTE_LOG(ERR, USER1, "Failed to allocate input buffer in mempool"); |
| 654 | return NULL; |
| 655 | } |
| 656 | |
| 657 | /* zeroing tailroom */ |
| 658 | memset(rte_pktmbuf_mtod(pkt, uint8_t *), 0, rte_pktmbuf_tailroom(pkt)); |
| 659 | |
| 660 | pkt_data = (uint8_t *)rte_pktmbuf_append(pkt, input_len); |
| 661 | if (pkt_data == NULL) { |
| 662 | RTE_LOG(ERR, USER1, "no room to append data, len: %d", input_len); |
| 663 | goto error; |
| 664 | } |
| 665 | rte_memcpy(pkt_data, input_buf, input_len); |
| 666 | |
| 667 | return pkt; |
| 668 | error: |
| 669 | rte_pktmbuf_free(pkt); |
| 670 | return NULL; |
| 671 | } |
| 672 | |
| 673 | static struct rte_crypto_op* |
| 674 | operation_create(const struct crosscheck_test_profile *profile, |
no test coverage detected