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 A51DDA046B for ; Tue, 23 Jul 2019 12:50:28 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7D1FE1BFDB; Tue, 23 Jul 2019 12:50:28 +0200 (CEST) Received: from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com [67.231.154.164]) by dpdk.org (Postfix) with ESMTP id 094AE1BFD0 for ; Tue, 23 Jul 2019 12:50:26 +0200 (CEST) X-Virus-Scanned: Proofpoint Essentials engine Received: from webmail.solarflare.com (uk.solarflare.com [193.34.186.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id A319EB00053; Tue, 23 Jul 2019 10:50:25 +0000 (UTC) Received: from [192.168.1.11] (85.187.13.152) by ukex01.SolarFlarecom.com (10.17.10.4) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 23 Jul 2019 11:50:19 +0100 To: , CC: , , , , , References: <20190717090408.13717-1-vattunuru@marvell.com> <20190723053821.30227-1-vattunuru@marvell.com> <20190723053821.30227-4-vattunuru@marvell.com> From: Andrew Rybchenko Message-ID: <8029e9c7-b2e2-f845-b642-b0e1ccfe3d90@solarflare.com> Date: Tue, 23 Jul 2019 13:50:06 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190723053821.30227-4-vattunuru@marvell.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Originating-IP: [85.187.13.152] X-ClientProxiedBy: ocex03.SolarFlarecom.com (10.20.40.36) To ukex01.SolarFlarecom.com (10.17.10.4) X-TM-AS-Product-Ver: SMEX-12.5.0.1300-8.5.1010-24788.000 X-TM-AS-Result: No-5.885300-8.000000-10 X-TMASE-MatchedRID: 6lay9u8oTUPmLzc6AOD8DfHkpkyUphL9BnIRIVcCWN9Eyyg5iSox6kZU qiaZ+o8nMUcnR685wFyJHDIFM1a8iV/8tX/1KHzFfid4LSHtIANrakICcm9AUfdpM2ZaJMkefZz hAXpj8LwMFsN2HxGImZS7TUFPpaFklCVOxGzpsvzD0ZWEZr/ntlsP0tBwe3qD4Vo4xoaXBy9SAA NZY4RuY3bBwg19x5OO0vwQHJ9bAGIsaaYlMvaOHAPZZctd3P4BUg5zxCPHJW0i0/kre3GputY21 XWJ8dWGOuTnPtgBE6OoDCGNZEhB23qE/IIafU+/uLHENGl+3A9Zi708rC+Dz5GPHiE2kiT4mobo CqMGYjW1QZE1sK93/QpMrf6wO+RHX9vT/VxM5p91e7Xbb6Im2sMA9JsxaUa3K8VLPDcP9n5LaoI CZdDBdeLzNWBegCW2RYvisGWbbS+3sNbcHjySQd0H8LFZNFG7CKFCmhdu5cVC2amBcPq+j1SpGL 4tRW1mJzoqtwjDhTaPMF7BAEA6/cWeomOZ6IOIcD9Wup372FhkBsIn9s3LdiacuAG1cjbB9vIAf hL2ZrSigEHy7J4S6ylkreA5r24aYnCi5itk3iprD5+Qup1qU56oP1a0mRIj X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--5.885300-8.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.5.1010-24788.000 X-MDID: 1563879026-78EiCSvGzj92 Subject: Re: [dpdk-dev] [PATCH v8 3/5] kni: add app specific mempool create & free routine 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" On 7/23/19 8:38 AM, vattunuru@marvell.com wrote: > From: Vamsi Attunuru > > When KNI operates in IOVA = VA mode, it requires mbuf memory > to be physically contiguous to ensure KNI kernel module could > translate IOVA addresses properly. Patch adds a KNI specific > mempool create routine to populate the KNI packet mbuf pool > with memory objects that are being on a page. > > KNI applications need to use this mempool create & free routines > so that mbuf related requirements in IOVA = VA mode are handled > inside those routines based on the enabled mode. > > Updated the release notes with these new routine details. > > Signed-off-by: Vamsi Attunuru > Signed-off-by: Kiran Kumar K > --- > doc/guides/rel_notes/release_19_08.rst | 6 ++++ > examples/kni/main.c | 6 +++- > lib/librte_kni/Makefile | 1 + > lib/librte_kni/meson.build | 1 + > lib/librte_kni/rte_kni.c | 59 ++++++++++++++++++++++++++++++++++ > lib/librte_kni/rte_kni.h | 49 ++++++++++++++++++++++++++++ > lib/librte_kni/rte_kni_version.map | 2 ++ > 7 files changed, 123 insertions(+), 1 deletion(-) > > diff --git a/doc/guides/rel_notes/release_19_08.rst b/doc/guides/rel_notes/release_19_08.rst > index 0a3f840..bd01e99 100644 > --- a/doc/guides/rel_notes/release_19_08.rst > +++ b/doc/guides/rel_notes/release_19_08.rst > @@ -281,6 +281,12 @@ API Changes > offload flag from the library. The application must set this flag if it is > supported by the platform and application wishes to use it. > > +* kni: ``rte_kni_pktmbuf_pool_create`` ``rte_kni_pktmbuf_pool_free`` functions > + were introduced for KNI applications for creating & freeing packet pool. > + Since IOVA=VA mode was added in KNI, packet pool's mbuf memory should be > + physically contiguous for the KNI kernel module to work in IOVA=VA mode, > + this requirment was taken care in the kni packet pool creation fucntions. > + > > ABI Changes > ----------- > diff --git a/examples/kni/main.c b/examples/kni/main.c > index 4710d71..3b9c067 100644 > --- a/examples/kni/main.c > +++ b/examples/kni/main.c > @@ -975,7 +975,7 @@ main(int argc, char** argv) > rte_exit(EXIT_FAILURE, "Could not parse input parameters\n"); > > /* Create the mbuf pool */ > - pktmbuf_pool = rte_pktmbuf_pool_create("mbuf_pool", NB_MBUF, > + pktmbuf_pool = rte_kni_pktmbuf_pool_create("mbuf_pool", NB_MBUF, > MEMPOOL_CACHE_SZ, 0, MBUF_DATA_SZ, rte_socket_id()); > if (pktmbuf_pool == NULL) { > rte_exit(EXIT_FAILURE, "Could not initialise mbuf pool\n"); > @@ -1043,6 +1043,10 @@ main(int argc, char** argv) > continue; > kni_free_kni(port); > } > + > + if (pktmbuf_pool) Typically pointer is compared to NULL, but it is not required here anyway, since rte_mempool_free() handles NULL perfectly itself. > + rte_kni_pktmbuf_pool_free(pktmbuf_pool); > + > for (i = 0; i < RTE_MAX_ETHPORTS; i++) > if (kni_port_params_array[i]) { > rte_free(kni_port_params_array[i]); <...> > diff --git a/lib/librte_kni/rte_kni.h b/lib/librte_kni/rte_kni.h > index 5699a64..7f11927 100644 > --- a/lib/librte_kni/rte_kni.h > +++ b/lib/librte_kni/rte_kni.h > @@ -20,6 +20,7 @@ > #include > #include > #include > +#include I don't understand why it is included here. > #include > > #include > <...>