From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4B02CA00BE; Tue, 29 Oct 2019 10:13:32 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1EC121BECA; Tue, 29 Oct 2019 10:13:31 +0100 (CET) Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by dpdk.org (Postfix) with ESMTP id 03E481BEC8 for ; Tue, 29 Oct 2019 10:13:30 +0100 (CET) Received: by mail-wr1-f65.google.com with SMTP id a11so12728055wra.6 for ; Tue, 29 Oct 2019 02:13:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=NEhyftGmfRxDBlCR+Pdsmk3hKnMi/3gHbBQFiyuPj48=; b=cBUTJXgzkkZWgo6j9Ewz4CHKgi0Du5diem8GbtpOkXMuy3Nj5pMIwcefbKkwUDKQGb IcNiBe/2YVJgqlwnHkzpELGkhexIrRsOnbrXSVAU2KJmBNvZqTF5Y87Rs2GPxBIiFQYw mA+jjPBZ/5SZbfAYLQ0JsS35tUIvEbcisN/3EIeQN1QboirzonBSTehAp9R44pKQ/7Cu k+y/V8eZqSGW46PtlmqM/ezJsC2xi9QV/LnVm76Fg3M+Q/T5wuzj6701h0JFqcKpk6bQ 2jALwvbS1J4YGAL0axFTh0UcTnmHhdjYvfZM39cp6keZcAB8I93m93BSls4/VuHPXd7o wiQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=NEhyftGmfRxDBlCR+Pdsmk3hKnMi/3gHbBQFiyuPj48=; b=qDUrJzaWxlrlZwxUg8OQLxpQOte+ZsgxRt5boFdju1dd8+b6ssZlENuVHO6lyxvf0h 9oebhTq0l8GTFFHbRXGVJWKxC0TzMMvJk6i38kom5niOTawStHt1POHDqjIwueUvCZ48 t1oHqsKYky4IKiW63lQa224o2DJhqmVnJ589F5t/rylsFMrE6mtwpR7KyRvptbSpUUfY mZkZd7p0gYujIw5wrHBF51J1lRmhjFxpGjL49MNSMQSNzt3wJTj5rBS8dzVo1Y2IA4XC 0sYRdh0jgGvWH97X10l8bVVGGFPf0EyECQ5MmQ2M42Y3JWVCmL6gNMoA2TCZidfiH73m IO7g== X-Gm-Message-State: APjAAAUx8GTsYXj3aoErjJ4snCQX5gDftEeJjGrz78VTTg6LmusXKMdL Wh1ySEPgWvkYX5Am+IJoF0Yg5g== X-Google-Smtp-Source: APXvYqx8+eNzMYuk8A6GXkA4+IfnChkdIQ3LBZtZK7smyeyV5L0x5TgGkgqRbGOVFeFF417rAgzsrg== X-Received: by 2002:adf:f40a:: with SMTP id g10mr18460430wro.228.1572340409646; Tue, 29 Oct 2019 02:13:29 -0700 (PDT) Received: from 6wind.com (2a01cb0c0005a6000226b0fffeed02fc.ipv6.abo.wanadoo.fr. [2a01:cb0c:5:a600:226:b0ff:feed:2fc]) by smtp.gmail.com with ESMTPSA id n17sm14348767wrt.25.2019.10.29.02.13.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Oct 2019 02:13:28 -0700 (PDT) Date: Tue, 29 Oct 2019 10:13:28 +0100 From: Olivier Matz To: Vamsi Krishna Attunuru Cc: Anatoly Burakov , Andrew Rybchenko , Ferruh Yigit , "Giridharan, Ganesan" , Jerin Jacob Kollanukkaran , Kiran Kumar Kokkilagadda , Stephen Hemminger , Thomas Monjalon , "dev@dpdk.org" Message-ID: <20191029091328.jciu3zijml5xupjo@platinum> References: <20190719133845.32432-1-olivier.matz@6wind.com> <20191028140122.9592-1-olivier.matz@6wind.com> <20191028140122.9592-2-olivier.matz@6wind.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 Subject: Re: [dpdk-dev] [EXT] [PATCH 1/5] mempool: allow unaligned addr/len in populate virt X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Vamsi, On Tue, Oct 29, 2019 at 09:02:26AM +0000, Vamsi Krishna Attunuru wrote: > Hi Olivier, > > Thanks for patch set, able run the tests with 512MB page size with this patch > set on Octeontx2 platform, somehow mbuf is holding null fields when pool is > created with 2MB page size, tests like l3fwd, kni are failing due to the > malformed mbufs. Can you confirm if the patch set was verified on any platform > with different page sizes. Meanwhile I will also debug this issue. Thank you for testing. I tested the patch locally on x86 with 2MB huge pages, and using travis-ci. Maybe it is related to the octeontx2 mempool driver? There is a specific condition to align the object start address to a multiple of total_elt_sz. Is it this specific patch that breaks your test? Or is it the full patchset? Thanks, Olivier > > Regards > A Vamsi > > > -----Original Message----- > > From: Olivier Matz > > Sent: Monday, October 28, 2019 7:31 PM > > To: dev@dpdk.org > > Cc: Anatoly Burakov ; Andrew Rybchenko > > ; Ferruh Yigit ; > > Giridharan, Ganesan ; Jerin Jacob Kollanukkaran > > ; Kiran Kumar Kokkilagadda ; > > Stephen Hemminger ; Thomas Monjalon > > ; Vamsi Krishna Attunuru > > Subject: [EXT] [PATCH 1/5] mempool: allow unaligned addr/len in populate virt > > > > External Email > > > > ---------------------------------------------------------------------- > > rte_mempool_populate_virt() currently requires that both addr and length are > > page-aligned. > > > > Remove this uneeded constraint which can be annoying with big hugepages (ex: > > 1GB). > > > > Signed-off-by: Olivier Matz > > --- > > lib/librte_mempool/rte_mempool.c | 18 +++++++----------- > > lib/librte_mempool/rte_mempool.h | 3 +-- > > 2 files changed, 8 insertions(+), 13 deletions(-) > > > > diff --git a/lib/librte_mempool/rte_mempool.c > > b/lib/librte_mempool/rte_mempool.c > > index 0f29e8712..76cbacdf3 100644 > > --- a/lib/librte_mempool/rte_mempool.c > > +++ b/lib/librte_mempool/rte_mempool.c > > @@ -368,17 +368,11 @@ rte_mempool_populate_virt(struct rte_mempool > > *mp, char *addr, > > size_t off, phys_len; > > int ret, cnt = 0; > > > > - /* address and len must be page-aligned */ > > - if (RTE_PTR_ALIGN_CEIL(addr, pg_sz) != addr) > > - return -EINVAL; > > - if (RTE_ALIGN_CEIL(len, pg_sz) != len) > > - return -EINVAL; > > - > > if (mp->flags & MEMPOOL_F_NO_IOVA_CONTIG) > > return rte_mempool_populate_iova(mp, addr, RTE_BAD_IOVA, > > len, free_cb, opaque); > > > > - for (off = 0; off + pg_sz <= len && > > + for (off = 0; off < len && > > mp->populated_size < mp->size; off += phys_len) { > > > > iova = rte_mem_virt2iova(addr + off); @@ -389,7 +383,10 @@ > > rte_mempool_populate_virt(struct rte_mempool *mp, char *addr, > > } > > > > /* populate with the largest group of contiguous pages */ > > - for (phys_len = pg_sz; off + phys_len < len; phys_len += pg_sz) { > > + for (phys_len = RTE_PTR_ALIGN_CEIL(addr + off + 1, pg_sz) - > > + (addr + off); > > + off + phys_len < len; > > + phys_len = RTE_MIN(phys_len + pg_sz, len - off)) { > > rte_iova_t iova_tmp; > > > > iova_tmp = rte_mem_virt2iova(addr + off + phys_len); > > @@ -575,8 +572,7 @@ rte_mempool_populate_default(struct rte_mempool > > *mp) > > * have > > */ > > mz = rte_memzone_reserve_aligned(mz_name, 0, > > - mp->socket_id, flags, > > - RTE_MAX(pg_sz, align)); > > + mp->socket_id, flags, align); > > } > > if (mz == NULL) { > > ret = -rte_errno; > > @@ -601,7 +597,7 @@ rte_mempool_populate_default(struct rte_mempool > > *mp) > > (void *)(uintptr_t)mz); > > else > > ret = rte_mempool_populate_virt(mp, mz->addr, > > - RTE_ALIGN_FLOOR(mz->len, pg_sz), pg_sz, > > + mz->len, pg_sz, > > rte_mempool_memchunk_mz_free, > > (void *)(uintptr_t)mz); > > if (ret < 0) { > > diff --git a/lib/librte_mempool/rte_mempool.h > > b/lib/librte_mempool/rte_mempool.h > > index 8053f7a04..0fe8aa7b8 100644 > > --- a/lib/librte_mempool/rte_mempool.h > > +++ b/lib/librte_mempool/rte_mempool.h > > @@ -1042,9 +1042,8 @@ int rte_mempool_populate_iova(struct rte_mempool > > *mp, char *vaddr, > > * A pointer to the mempool structure. > > * @param addr > > * The virtual address of memory that should be used to store objects. > > - * Must be page-aligned. > > * @param len > > - * The length of memory in bytes. Must be page-aligned. > > + * The length of memory in bytes. > > * @param pg_sz > > * The size of memory pages in this virtual area. > > * @param free_cb > > -- > > 2.20.1 >