On 17-Apr-20 2:14 PM, Aaron Conole wrote:
Initial IP fragmentation unit test.
Signed-off-by: Aaron Conole <acon...@redhat.com>
---
<snip>
+ if (!pkt_pool)
+ pkt_pool = rte_pktmbuf_pool_create("FRAG_MBUF_POOL",
+ NUM_MBUFS, BURST, 0,
+ RTE_MBUF_DEFAULT_BUF_SIZE,
+ SOCKET_ID_ANY);
+ if (pkt_pool == NULL) {
+ printf("%s: Error creating pkt mempool\n", __func__);
+ goto bad_setup;
+ }
+
+ if (!direct_pool)
+ direct_pool = rte_pktmbuf_pool_create("FRAG_D_MBUF_POOL",
+ NUM_MBUFS, BURST, 0,
+ RTE_MBUF_DEFAULT_BUF_SIZE,
+ SOCKET_ID_ANY);
+ if (!direct_pool) {
+ printf("%s: Error creating direct mempool\n", __func__);
+ goto bad_setup;
+ }
+
+ if (!indirect_pool)
+ indirect_pool = rte_pktmbuf_pool_create("FRAG_I_MBUF_POOL",
+ NUM_MBUFS, BURST, 0,
+ 0, SOCKET_ID_ANY);
+ if (!indirect_pool) {
+ printf("%s: Error creating indirect mempool\n", __func__);
+ goto bad_setup;
+ }
Nitpicking, but i believe the coding style guide discourages using
boolean syntax for anything other than boolean checks, and it is better
to use a more explicit `if (x == NULL)`.
--
Thanks,
Anatoly