From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ferruh Yigit Subject: Re: [PATCH v2] kni: fix possible kernel crash with va2pa Date: Tue, 19 Mar 2019 18:35:19 +0000 Message-ID: <0463b35b-d38f-3e09-60bb-40bebf7c3cfd@intel.com> References: <20190228073010.49716-1-zhouyates@gmail.com> <20190312092232.93640-1-zhouyates@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit To: Yangchao Zhou , dev@dpdk.org Return-path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 0B3091B19 for ; Tue, 19 Mar 2019 19:35:21 +0100 (CET) In-Reply-To: <20190312092232.93640-1-zhouyates@gmail.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 3/12/2019 9:22 AM, Yangchao Zhou wrote: > va2pa depends on the physical address and virtual address offset of > current mbuf. It may get the wrong physical address of next mbuf which > allocated in another hugepage segment. > > In rte_mempool_populate_default(), trying to allocate whole block of > contiguous memory could be failed. Then, it would reserve memory in > several memzones that have different physical address and virtual address > offsets. The rte_mempool_populate_default() is used by > rte_pktmbuf_pool_create(). > > Signed-off-by: Yangchao Zhou > --- > v2: Add an explanation that causes this problem. > Use m->next to store physical address. Overall code looks good to me, thanks for the work, it looks pretty clean. I would like to do some test before giving an ack. Meanwhile, can you please update kni documentation, to document for the mbufs sent to kernel has mbuf->next fields as physical address. It is OK to send as a new version of the patch with documentation. Thanks, ferruh