From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0054.outbound.protection.outlook.com [104.47.42.54]) by dpdk.org (Postfix) with ESMTP id 9976B2BBB for ; Thu, 1 Feb 2018 11:01:37 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=1W2sfwr6XhMYpdAgrU3cuae/LfU3FJGtxfDOGRybABw=; b=CY504JIq7/5VkzTS3pZXcklOmlSdUGJ2RNf4PjNWrc9bN+ATuH2jaQFpnt/GDS/XVxF1ES3BFYIOCsPsJuDfQQ/of7ZJ4aOLcsur3ttQSUE/TEX/loYr1DHQE7IG7wZGnNo0IbAv3yrFSxbP5BYGEHZaxAccvBJS8er6AB7o/aY= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Santosh.Shukla@cavium.com; Received: from [192.168.0.105] (103.76.56.167) by CY1PR0701MB1899.namprd07.prod.outlook.com (10.163.42.29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.464.11; Thu, 1 Feb 2018 10:01:33 +0000 To: Andrew Rybchenko , dev References: <1511539591-20966-1-git-send-email-arybchenko@solarflare.com> <1516713372-10572-1-git-send-email-arybchenko@solarflare.com> <1516713372-10572-4-git-send-email-arybchenko@solarflare.com> Cc: Olivier MATZ , Jerin Jacob From: santosh Message-ID: Date: Thu, 1 Feb 2018 15:31:24 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US X-Originating-IP: [103.76.56.167] X-ClientProxiedBy: HK2PR02CA0163.apcprd02.prod.outlook.com (10.171.30.23) To CY1PR0701MB1899.namprd07.prod.outlook.com (10.163.42.29) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d6145359-a974-4eb3-b8f4-08d5695ac747 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:CY1PR0701MB1899; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1899; 3:sC9O4ojo4PVOzZA4Lg65D3YResXEPJmg9C6cYM9wine6UOBXsjHyXCJVYGJ/4KZ0BgDP2nDhEGt9fQ+lz7PcJQ1n/7f6W30rN/KyfxQvBTuYNDiU+//njJQdXE/MXms/CnONe3w5T/Q0T/ToE7rQokXMUDynfSg3czz+1bq7qljnL/JHeiUGTuaF1XR4HOlhkcijElo2Zpf4rbGG/6zAf4tRC6sfeTTZ7HQdJiWYle0JCaEaCTu88UNppDc1GIWQ; 25:SAVd/NqcZnFl9e1olQkbFe7dneVnhFk9YCZ5bzdqYDmmvdkr3bhIzu5LFFLEPMWLMbkaoTQo1i3bwmu4f+Wn1hZkk/m2UPFKnr/UQH7tCPgB6/ATEH/sdD2U2FYbdKbUJ16tWU6v/xgWkreJpt0Y4IchyB/ZUPmR5kyl+EEskXjDjgA1tY8r838MuVR/P8HxplEu0uoiMfYf8BbZiRvddk2PbZtgRZllaktewFLxSlKPdaes35KK1EFkAusrS2E7xrSJWKsH/tPjmKf/7zxlFzodjrfS91ZPHH2ic6E7aJxmPTpa5oNBJiEKLHpjuXmlRw1RIonr2ZtdYG/+eZ/G3w==; 31:getolCTikndiCCPau97L9u3U0IuO3XPgo0vX0fteBpzZ07TyWC94KBFrJ2p4bLMm2d/QgFEbGHwBQcSLu5CQSrS4PSUG7JZ6gIPZHm5kV8bewjrI0cFtoWMG+OVzqoArYZebj29LFKxCbzcopN7oPK/augtFm4WXUG9ZedvlZgNXurzrragR1wgRKxKb1uODrAbqFFJWycuXhs4VFI+NcRa1rIvOj7S1w1J7vmQEVV4= X-MS-TrafficTypeDiagnostic: CY1PR0701MB1899: X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1899; 20:+/pqoPUxJJj3525CfdLo9MU9toFEXcmXQ+WJMtIJNMjDEc7bTOSQQapT175VJC9PAJDJXrcfc5BLcLM9RPhKkjXPPTYJ4++UFld28Itcy5Uygv9zDH8taHD7Z7cgPL6oUPAgMK+zKyFtP5bw8ZDJES3Q780ulbpkPeSCPCnt4unoeEJRsz3OmEacGiTdq2LgDDSK/UNq1GJjpkaMtCSs5DtbSyjGK8pIrwAIKKGMsr34cMSt8U6QNuTN5FRsgcPsOCQeu/tAKBu5CFMCQevRzj7iJnDgn/JwHIZZBefr547JXRpwW7BikcdeffKdhWbCqhYU3y6U/2BXPS+tROjfYqpg38iCo1Xn7rfoSGYtvVAU7Dada+W4hVAooRfXqbZ3t7NtzIT2J3t/hc6pqM8ZhkmKYuLGVQFGUpDRW5GS1Jew9GkJEU7es5jzN8Qm5hkc10r0uXElpJpn2Wf4hYi0Lf+a5Lsmbbn7rYwr5rg85j+4SESys0D9LtIt8enXMllKscqlMEWad2qh3voYeLin8FK9T8M2Tqp6EXkZaIX9mZTARcll2eIQdXjVnTNbDGtiWYpYtcHN61yEYagJyk1mnur0uopp8NcKQBzW41KMiZs=; 4:LF8v2RUPjEDFtaKONwLOtmApPM5NH9nWDvLVWpuVZaaoXrX8F7pjYy2lt3I7Famn90PTvrPRhq8Wczf3QzBOT0KB4BHL3GSnPA2eVEKGb73c+x/uJf95gVHG4ccfNHLF+3zP8RxsPqhVUHdRE8hL6TSqEmXl95H5O/ZfTnrgAGsVvTqGfk2/9k6uR4/ABoBIbPdQ92xvjQugckqtQXkivDlHLG4RycrAJDlNSBHHZU72xiX5hmznzteppOjQFPf+9ZCcL73hu2IXqN9/kYBMeg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(8121501046)(5005006)(10201501046)(3002001)(93006095)(3231101)(2400082)(944501161)(6041288)(20161123564045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(6072148)(201708071742011); SRVR:CY1PR0701MB1899; BCL:0; PCL:0; RULEID:; SRVR:CY1PR0701MB1899; X-Forefront-PRVS: 0570F1F193 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6049001)(396003)(39380400002)(346002)(39860400002)(376002)(366004)(189003)(199004)(93886005)(65956001)(68736007)(86152003)(53936002)(305945005)(7736002)(25786009)(6486002)(4326008)(90366009)(230700001)(65826007)(117156002)(42882006)(6666003)(2950100002)(50466002)(31696002)(72206003)(5660300001)(386003)(107886003)(31686004)(76176011)(478600001)(2486003)(23676004)(52146003)(52116002)(36756003)(97736004)(26005)(64126003)(106356001)(3846002)(6116002)(2906002)(81166006)(47776003)(58126008)(81156014)(66066001)(65806001)(8676002)(16576012)(316002)(8936002)(105586002)(110136005)(83506002)(54906003)(77096007)(16526019); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0701MB1899; H:[192.168.0.105]; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtDWTFQUjA3MDFNQjE4OTk7MjM6SlEvcUhxQjNNYm9ldVQ2SkpYQWtPUDgv?= =?utf-8?B?ZFdFRnVqZlBhTktiVGJmUEEyZjdpMlcvbGd4cU5XMXg5Nzh4dFFLaHJoczZl?= =?utf-8?B?K1pKd25MZlBoekdDcTQrUHI1QmZSY2dtRm5zT3I2VFJaMWdFS1RiMFpBS1Mz?= =?utf-8?B?NXBUclc3ZUV5YWNnOFFWb0Juc21scWRUZDNrYkhDc0pVaHBtcnNnRWlRdm9o?= =?utf-8?B?Q0hQc05sMUdldndhc0h0emJYaXpMN2laUnJnQWpsUG1rVWlTT1o3Q0ZZZ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kg9XyYHEMiKICQl7lh2TOH0ZMUwQWG843U7IPSDmQOGB4RR9bL0ILodkQ/NQFC8d2I/OZXyl709AdJWE5AJfZSzHg9NpsUkliEbSuHosrohHXYmOhqByKW4RhbjfMesWvs1IrAt9Xh8ngR8Q46n6tEvd6ahP4Vvb95eoSjPvzCTn2JSf3pF/OkKjqzZ9Q9zEPFGC75qmbiLOvND2j8n1GgArKD86QIpLohCQkgI6g9GtuxuYzy4WNL0a+45wj0GA4=; 5:XfLM1fuyOIbKx6cEDWDrkBPQiBOJkCIf8f+f0JK55L/M8IesTQMsjKMdqzsMJHgCVsP1/fdYbdKl4PypT32Fp6eB4IjpSKfDhdHeWj0MTSXAsLfirY1ZmRduK+KyvJhpfLqwA/52VzilPXq/c4PV75V032aTYyKQV7jw1Xv+4lc=; 24:9/XuFBIrldd0yRTKzlZcqUPKPOC0l/WShcV+JezOgMmg86OwDJu14bQppS04/bIZ4SPnEeEcQI9aCwlxaYHtP2c6vXnEXCv40e9MIKutSuA=; 7:64D3A8lEgVaKPEEtmotVlVDbo4g6LKc89MXC+2LRUMgGbhN60LRyABCbVI4fQgG1tTm6aZ+2Ij0ugrZSQqurEt3C6LRGQKc8gHOfdsS6wHp6Sy7LwJ9btmeIIgkg97oMy/WbSyEWtvDX7pZJxdUgiVeTcclvmvvVs79DhVFDWQPvNI8mAGKes/EGaKENhs1ADt7K3zCfG1SH36XaiG2YJcJ22aaxrc0AMAq4WNkF1D4FuEr6DRq4v9D+mm0tAA9H SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Feb 2018 10:01:33.7881 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d6145359-a974-4eb3-b8f4-08d5695ac747 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0701MB1899 Subject: [dpdk-dev] [RFC v2 03/17] mempool/octeontx: add callback to calculate memory size 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: Thu, 01 Feb 2018 10:01:38 -0000 Hi Andrew, On Thursday 01 February 2018 11:48 AM, Jacob, Jerin wrote: > The driver requires one and only one physically contiguous > memory chunk for all objects. > > Signed-off-by: Andrew Rybchenko > --- > drivers/mempool/octeontx/rte_mempool_octeontx.c | 25 +++++++++++++++++++++++++ > 1 file changed, 25 insertions(+) > > diff --git a/drivers/mempool/octeontx/rte_mempool_octeontx.c > b/drivers/mempool/octeontx/rte_mempool_octeontx.c > index d143d05..4ec5efe 100644 > --- a/drivers/mempool/octeontx/rte_mempool_octeontx.c > +++ b/drivers/mempool/octeontx/rte_mempool_octeontx.c > @@ -136,6 +136,30 @@ octeontx_fpavf_get_capabilities(const struct rte_mempool *mp, > return 0; > } > > +static ssize_t > +octeontx_fpavf_calc_mem_size(const struct rte_mempool *mp, > + uint32_t obj_num, uint32_t pg_shift, > + size_t *min_chunk_size, size_t *align) > +{ > + ssize_t mem_size; > + > + /* > + * Simply need space for one more object to be able to > + * fullfil alignment requirements. > + */ > + mem_size = rte_mempool_calc_mem_size_def(mp, obj_num + 1, pg_shift, > + I think, you don't need that (obj_num + 1) as because rte_xmem_calc_int() will be checking flags for _ALIGNED + _CAPA_PHYS_CONFIG i.e.. mask = MEMPOOL_F_CAPA_BLK_ALIGNED_OBJECTS | MEMPOOL_F_CAPA_PHYS_CONTIG; if ((flags & mask) == mask) /* alignment need one additional object */ elt_num += 1; > min_chunk_size, align); > + if (mem_size >= 0) { > + /* > + * The whole memory area containing the objects must be > + * physically contiguous. > + */ > + *min_chunk_size = mem_size; > + } > + > + return mem_size; > +} > + > static int > octeontx_fpavf_register_memory_area(const struct rte_mempool *mp, > char *vaddr, rte_iova_t paddr, size_t len) > @@ -159,6 +183,7 @@ static struct rte_mempool_ops octeontx_fpavf_ops = { > .get_count = octeontx_fpavf_get_count, > .get_capabilities = octeontx_fpavf_get_capabilities, > .register_memory_area = octeontx_fpavf_register_memory_area, > + .calc_mem_size = octeontx_fpavf_calc_mem_size, > }; > > MEMPOOL_REGISTER_OPS(octeontx_fpavf_ops); > -- > 2.7.4 >