> -----Original Message-----
> From: Dmitry Kozlyuk <[email protected]>
> Sent: Sunday, July 5, 2020 3:08 PM
> To: Fady Bader <[email protected]>
> Cc: [email protected]; Thomas Monjalon <[email protected]>; Tasnim Bashar
> <[email protected]>; Tal Shnaiderman <[email protected]>; Yohad Tor
> <[email protected]>; [email protected];
> [email protected]; [email protected]; [email protected];
> [email protected]; [email protected]; [email protected];
> [email protected]
> Subject: Re: [PATCH v5 2/3] mempool: use generic memory management
>
> On Sun, 5 Jul 2020 14:46:28 +0300, Fady Bader wrote:
> [snip]
> > /* populate the mempool with an anonymous mapping */ @@ -740,20
> > +741,20 @@ rte_mempool_populate_anon(struct rte_mempool *mp)
> > }
> >
> > /* get chunk of virtually continuous memory */
> > - addr = mmap(NULL, size, PROT_READ | PROT_WRITE,
> > - MAP_SHARED | MAP_ANONYMOUS, -1, 0);
> > - if (addr == MAP_FAILED) {
> > + addr = rte_mem_map(NULL, size, RTE_PROT_READ | RTE_PROT_WRITE,
> > + RTE_MAP_SHARED | RTE_MAP_ANONYMOUS, -1, 0);
> > + if (addr == NULL) {
> > rte_errno = errno;
>
> rte_errno is set by rte_mem_map(), using errno here is incorrect on Windows.
Ok, I'll send a new version soon.
>
> > return 0;
> > }
> > /* can't use MMAP_LOCKED, it does not exist on BSD */
> > - if (mlock(addr, size) < 0) {
> > + if (rte_mem_lock(addr, size) < 0) {
> > rte_errno = errno;
>
> Ditto.
>
> [snip]
>
> --
> Dmitry Kozlyuk