On 25-May-20 1:37 AM, Dmitry Kozlyuk wrote:
All supported OS create memory segment lists (MSL) and reserve VA space
for them in a nearly identical way. Move common code into EAL private
functions to reduce duplication.

Signed-off-by: Dmitry Kozlyuk <dmitry.kozl...@gmail.com>
---

<snip>

+void
+eal_memseg_list_populate(struct rte_memseg_list *msl, void *addr, int n_segs)
+{
+       uint64_t page_sz = msl->page_sz;
+       int i;
+
+       for (i = 0; i < n_segs; i++) {
+               struct rte_fbarray *arr = &msl->memseg_arr;
+               struct rte_memseg *ms = rte_fbarray_get(arr, i);
+
+               if (rte_eal_iova_mode() == RTE_IOVA_VA)
+                       ms->iova = (uintptr_t)addr;
+               else
+                       ms->iova = RTE_BAD_IOVA;
+               ms->addr = addr;
+               ms->hugepage_sz = page_sz;
+               ms->socket_id = 0;
+               ms->len = page_sz;
+
+               rte_fbarray_set_used(arr, i);
+
+               addr = RTE_PTR_ADD(addr, page_sz);

This breaks 32-bit build. I believe page_sz should be size_t, not uint64_t.

--
Thanks,
Anatoly

Reply via email to