On 04/19/2018 07:41 PM, Olivier Matz wrote:
On Mon, Mar 26, 2018 at 05:12:56PM +0100, Andrew Rybchenko wrote:
[...]
@@ -1531,6 +1615,71 @@ rte_mempool_get(struct rte_mempool *mp, void **obj_p)
}
/**
+ * @internal Get contiguous blocks of objects from the pool. Used internally.
+ * @param mp
+ * A pointer to the mempool structure.
+ * @param first_obj_table
+ * A pointer to a pointer to the first object in each block.
+ * @param n
+ * A number of blocks to get.
+ * @return
+ * - >0: Success
+ * - <0: Error
I guess it is 0 here, not >0.
Yes, thanks.
+ */
+static __rte_always_inline int
+__mempool_generic_get_contig_blocks(struct rte_mempool *mp,
+ void **first_obj_table, unsigned int n)
+{
+ int ret;
+
+ ret = rte_mempool_ops_dequeue_contig_blocks(mp, first_obj_table, n);
+ if (ret < 0)
+ __MEMPOOL_CONTIG_BLOCKS_STAT_ADD(mp, get_fail, n);
+ else
+ __MEMPOOL_CONTIG_BLOCKS_STAT_ADD(mp, get_success, n);
+
+ return ret;
+}
+
Is it worth having this function?
Just to follow the same code structure as usual dequeue.
I think it would be simple to include the code in
rte_mempool_get_contig_blocks() below... or am I missing something?
I agree. Will do in v3.
[...]