From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id F3075AAD2 for ; Tue, 13 Mar 2018 15:59:32 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Mar 2018 07:57:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,465,1515484800"; d="scan'208";a="34627348" Received: from fyigit-mobl.ger.corp.intel.com (HELO [10.237.221.62]) ([10.237.221.62]) by orsmga003.jf.intel.com with ESMTP; 13 Mar 2018 07:57:26 -0700 To: cys , dev References: <528c4b67.fc.1620aaef223.Coremail.chaoys155@163.com> From: Ferruh Yigit Message-ID: <60b8909c-b28d-eec4-110e-4c02c32cb087@intel.com> Date: Tue, 13 Mar 2018 14:57:26 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <528c4b67.fc.1620aaef223.Coremail.chaoys155@163.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] kni: continuous memory restriction ? 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: , X-List-Received-Date: Tue, 13 Mar 2018 14:59:33 -0000 On 3/9/2018 12:14 PM, cys wrote: > Commit 8451269e6d7ba7501723fe2efd0 said "remove continuous memory restriction"; > http://dpdk.org/browse/dpdk/commit/lib/librte_eal/linuxapp/kni/kni_net.c?id=8451269e6d7ba7501723fe2efd05745010295bac > For chained mbufs(nb_segs > 1), function va2pa use the offset of previous mbuf > to calculate physical address of next mbuf. > So anywhere guarante that all mbufs have the same offset (buf_addr - buf_physaddr) ? > Or have I misunderstood chained mbufs? Hi, Your description is correct, KNI chained mbufs is broken if chained mbufs are from different mempools. Two commits seems involved, in time order: [1] d89a58dfe90b ("kni: support chained mbufs") [2] 8451269e6d7b ("kni: remove continuous memory restriction") With current implementation, kernel needs to know physical address of the mbuf to be able to access it. For chained mbufs, first mbuf is OK but for rest kernel side gets the virtual address of the mbuf and this only works if all chained mbufs are from same mempool. I don't have any good solution indeed, but it is possible to: a) If you are using chained mbufs, keep old limitation of using singe mempool b) Serialize chained mbufs for KNI in userspace