| 150 | const uint16_t tag_size); |
| 151 | |
| 152 | static struct rte_mbuf * |
| 153 | setup_test_string(struct rte_mempool *mpool, |
| 154 | const char *string, size_t len, uint8_t blocksize) |
| 155 | { |
| 156 | struct rte_mbuf *m = rte_pktmbuf_alloc(mpool); |
| 157 | size_t t_len = len - (blocksize ? (len % blocksize) : 0); |
| 158 | |
| 159 | if (m) { |
| 160 | char *dst; |
| 161 | |
| 162 | memset(m->buf_addr, 0, m->buf_len); |
| 163 | dst = rte_pktmbuf_append(m, t_len); |
| 164 | if (!dst) { |
| 165 | rte_pktmbuf_free(m); |
| 166 | return NULL; |
| 167 | } |
| 168 | if (string != NULL) |
| 169 | rte_memcpy(dst, string, t_len); |
| 170 | else |
| 171 | memset(dst, 0, t_len); |
| 172 | } |
| 173 | |
| 174 | return m; |
| 175 | } |
| 176 | |
| 177 | /* Get number of bytes in X bits (rounding up) */ |
| 178 | static uint32_t |
no test coverage detected