> -----Original Message----- > From: Andrew Rybchenko <andrew.rybche...@oktetlabs.ru> > [...] > > diff --git a/lib/mempool/rte_mempool.c b/lib/mempool/rte_mempool.c > > index 51c0ba2931..2204f140b3 100644 > > --- a/lib/mempool/rte_mempool.c > > +++ b/lib/mempool/rte_mempool.c > > @@ -371,6 +371,8 @@ rte_mempool_populate_iova(struct rte_mempool *mp, > > char *vaddr, > > > > STAILQ_INSERT_TAIL(&mp->mem_list, memhdr, next); > > mp->nb_mem_chunks++; > > + if (iova == RTE_BAD_IOVA) > > + mp->flags |= MEMPOOL_F_NON_IO; > > As I understand rte_mempool_populate_iova() may be called few times for > one mempool. The flag must be set if all invocations are done with > RTE_BAD_IOVA. So, it should be set by default and just removed when iova > != RTE_BAD_IOVA happens.
I don't agree at all. If any object of the pool is unsuitable for IO, the pool cannot be considered suitable for IO. So if there's a single invocation with RTE_BAD_IOVA, the flag must be set forever. > Yes, it is a corner case. May be it makes sense to cover it by unit test > as well. True for either your logic or mine, I'll add it. Ack on the rest of the comments, thanks.