Branch data Line data Source code
1 : : /* SPDX-License-Identifier: BSD-3-Clause
2 : : *
3 : : * Copyright (c) 2016 Freescale Semiconductor, Inc. All rights reserved.
4 : : * Copyright 2016-2019,2022-2025 NXP
5 : : *
6 : : */
7 : :
8 : : #include <unistd.h>
9 : : #include <stdio.h>
10 : : #include <sys/types.h>
11 : : #include <string.h>
12 : : #include <stdlib.h>
13 : : #include <fcntl.h>
14 : : #include <errno.h>
15 : :
16 : : #include <eal_export.h>
17 : : #include <rte_mbuf.h>
18 : : #include <ethdev_driver.h>
19 : : #include <rte_malloc.h>
20 : : #include <rte_memcpy.h>
21 : : #include <rte_string_fns.h>
22 : : #include <rte_cycles.h>
23 : : #include <rte_kvargs.h>
24 : : #include <dev_driver.h>
25 : : #include "rte_dpaa2_mempool.h"
26 : :
27 : : #include <bus_fslmc_driver.h>
28 : : #include <fslmc_logs.h>
29 : : #include <mc/fsl_dpbp.h>
30 : : #include <portal/dpaa2_hw_pvt.h>
31 : : #include <portal/dpaa2_hw_dpio.h>
32 : : #include "dpaa2_hw_mempool.h"
33 : : #include "dpaa2_hw_mempool_logs.h"
34 : :
35 : : #include <dpaax_iova_table.h>
36 : :
37 : : RTE_EXPORT_INTERNAL_SYMBOL(rte_dpaa2_bpid_info)
38 : : struct dpaa2_bp_info *rte_dpaa2_bpid_info;
39 : : static struct dpaa2_bp_list *h_bp_list;
40 : :
41 : : static int16_t s_dpaa2_pool_ops_idx = RTE_MEMPOOL_MAX_OPS_IDX;
42 : :
43 : : RTE_EXPORT_INTERNAL_SYMBOL(rte_dpaa2_mpool_get_ops_idx)
44 : 0 : int rte_dpaa2_mpool_get_ops_idx(void)
45 : : {
46 : 0 : return s_dpaa2_pool_ops_idx;
47 : : }
48 : :
49 : : static int
50 : 0 : rte_hw_mbuf_create_pool(struct rte_mempool *mp)
51 : : {
52 : : struct dpaa2_bp_list *bp_list;
53 : : struct dpaa2_dpbp_dev *avail_dpbp;
54 : : struct dpaa2_bp_info *bp_info;
55 : : struct dpbp_attr dpbp_attr;
56 : : uint32_t bpid;
57 : : unsigned int lcore_id;
58 : : struct rte_mempool_cache *cache;
59 : : int ret;
60 : :
61 : 0 : avail_dpbp = dpaa2_alloc_dpbp_dev();
62 : :
63 [ # # ]: 0 : if (rte_dpaa2_bpid_info == NULL) {
64 : 0 : rte_dpaa2_bpid_info = (struct dpaa2_bp_info *)rte_malloc(NULL,
65 : : sizeof(struct dpaa2_bp_info) * MAX_BPID,
66 : : RTE_CACHE_LINE_SIZE);
67 [ # # ]: 0 : if (rte_dpaa2_bpid_info == NULL)
68 : : return -ENOMEM;
69 : : memset(rte_dpaa2_bpid_info, 0,
70 : : sizeof(struct dpaa2_bp_info) * MAX_BPID);
71 : : }
72 : :
73 [ # # ]: 0 : if (!avail_dpbp) {
74 : 0 : DPAA2_MEMPOOL_ERR("DPAA2 pool not available!");
75 : 0 : return -ENOENT;
76 : : }
77 : :
78 [ # # ]: 0 : if (unlikely(!DPAA2_PER_LCORE_DPIO)) {
79 : 0 : ret = dpaa2_affine_qbman_swp();
80 [ # # ]: 0 : if (ret) {
81 : 0 : DPAA2_MEMPOOL_ERR(
82 : : "Failed to allocate IO portal, tid: %d",
83 : : rte_gettid());
84 : 0 : goto err1;
85 : : }
86 : : }
87 : :
88 : 0 : ret = dpbp_enable(&avail_dpbp->dpbp, CMD_PRI_LOW, avail_dpbp->token);
89 [ # # ]: 0 : if (ret != 0) {
90 : 0 : DPAA2_MEMPOOL_ERR("Resource enable failure with err code: %d",
91 : : ret);
92 : 0 : goto err1;
93 : : }
94 : :
95 : 0 : ret = dpbp_get_attributes(&avail_dpbp->dpbp, CMD_PRI_LOW,
96 : 0 : avail_dpbp->token, &dpbp_attr);
97 [ # # ]: 0 : if (ret != 0) {
98 : 0 : DPAA2_MEMPOOL_ERR("Resource read failure with err code: %d",
99 : : ret);
100 : 0 : goto err2;
101 : : }
102 : :
103 : 0 : bp_info = rte_malloc(NULL,
104 : : sizeof(struct dpaa2_bp_info),
105 : : RTE_CACHE_LINE_SIZE);
106 [ # # ]: 0 : if (!bp_info) {
107 : 0 : DPAA2_MEMPOOL_ERR("Unable to allocate buffer pool memory");
108 : : ret = -ENOMEM;
109 : 0 : goto err2;
110 : : }
111 : :
112 : : /* Allocate the bp_list which will be added into global_bp_list */
113 : 0 : bp_list = rte_malloc(NULL, sizeof(struct dpaa2_bp_list),
114 : : RTE_CACHE_LINE_SIZE);
115 [ # # ]: 0 : if (!bp_list) {
116 : 0 : DPAA2_MEMPOOL_ERR("Unable to allocate buffer pool memory");
117 : : ret = -ENOMEM;
118 : 0 : goto err3;
119 : : }
120 : :
121 : : /* Set parameters of buffer pool list */
122 : 0 : bp_list->buf_pool.num_bufs = mp->size;
123 [ # # ]: 0 : bp_list->buf_pool.size = mp->elt_size
124 : 0 : - sizeof(struct rte_mbuf) - rte_pktmbuf_priv_size(mp);
125 : 0 : bp_list->buf_pool.bpid = dpbp_attr.bpid;
126 : 0 : bp_list->buf_pool.h_bpool_mem = NULL;
127 : 0 : bp_list->buf_pool.dpbp_node = avail_dpbp;
128 : : /* Identification for our offloaded pool_data structure */
129 : 0 : bp_list->dpaa2_ops_index = mp->ops_index;
130 [ # # ]: 0 : if (s_dpaa2_pool_ops_idx == RTE_MEMPOOL_MAX_OPS_IDX) {
131 : 0 : s_dpaa2_pool_ops_idx = mp->ops_index;
132 [ # # ]: 0 : } else if (s_dpaa2_pool_ops_idx != mp->ops_index) {
133 : 0 : DPAA2_MEMPOOL_ERR("Only single ops index only");
134 : : ret = -EINVAL;
135 : 0 : goto err4;
136 : : }
137 : :
138 : 0 : bp_list->next = h_bp_list;
139 : 0 : bp_list->mp = mp;
140 : :
141 : 0 : bpid = dpbp_attr.bpid;
142 : :
143 : 0 : rte_dpaa2_bpid_info[bpid].meta_data_size = sizeof(struct rte_mbuf)
144 : 0 : + rte_pktmbuf_priv_size(mp);
145 : 0 : rte_dpaa2_bpid_info[bpid].bp_list = bp_list;
146 [ # # ]: 0 : rte_dpaa2_bpid_info[bpid].bpid = bpid;
147 : :
148 : : rte_memcpy(bp_info, (void *)&rte_dpaa2_bpid_info[bpid],
149 : : sizeof(struct dpaa2_bp_info));
150 : 0 : mp->pool_data = (void *)bp_info;
151 : :
152 : 0 : DPAA2_MEMPOOL_DEBUG("BP List created for bpid =%d", dpbp_attr.bpid);
153 : :
154 : 0 : h_bp_list = bp_list;
155 : : /* Update per core mempool cache threshold to optimal value which is
156 : : * number of buffers that can be released to HW buffer pool in
157 : : * a single API call.
158 : : */
159 [ # # ]: 0 : for (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) {
160 : 0 : cache = &mp->local_cache[lcore_id];
161 : 0 : DPAA2_MEMPOOL_DEBUG("lCore %d: cache->flushthresh %d -> %d",
162 : : lcore_id, cache->flushthresh,
163 : : (uint32_t)(cache->size + DPAA2_MBUF_MAX_ACQ_REL));
164 [ # # ]: 0 : if (cache->flushthresh)
165 : 0 : cache->flushthresh = cache->size + DPAA2_MBUF_MAX_ACQ_REL;
166 : : }
167 : :
168 : : return 0;
169 : : err4:
170 : 0 : rte_free(bp_list);
171 : 0 : err3:
172 : 0 : rte_free(bp_info);
173 : 0 : err2:
174 : 0 : dpbp_disable(&avail_dpbp->dpbp, CMD_PRI_LOW, avail_dpbp->token);
175 : 0 : err1:
176 : 0 : dpaa2_free_dpbp_dev(avail_dpbp);
177 : :
178 : 0 : return ret;
179 : : }
180 : :
181 : : static void
182 : 0 : rte_hw_mbuf_free_pool(struct rte_mempool *mp)
183 : : {
184 : : struct dpaa2_bp_info *bpinfo;
185 : : struct dpaa2_bp_list *bp;
186 : : struct dpaa2_dpbp_dev *dpbp_node;
187 : :
188 [ # # ]: 0 : if (!mp->pool_data) {
189 : 0 : DPAA2_MEMPOOL_ERR("Not a valid dpaa2 buffer pool");
190 : 0 : return;
191 : : }
192 : :
193 : : bpinfo = (struct dpaa2_bp_info *)mp->pool_data;
194 : 0 : bp = bpinfo->bp_list;
195 : 0 : dpbp_node = bp->buf_pool.dpbp_node;
196 : :
197 : 0 : dpbp_disable(&(dpbp_node->dpbp), CMD_PRI_LOW, dpbp_node->token);
198 : :
199 [ # # ]: 0 : if (h_bp_list == bp) {
200 : 0 : h_bp_list = h_bp_list->next;
201 : : } else { /* if it is not the first node */
202 : : struct dpaa2_bp_list *prev = h_bp_list, *temp;
203 : 0 : temp = h_bp_list->next;
204 [ # # ]: 0 : while (temp) {
205 [ # # ]: 0 : if (temp == bp) {
206 : 0 : prev->next = temp->next;
207 : 0 : rte_free(bp);
208 : 0 : break;
209 : : }
210 : : prev = temp;
211 : 0 : temp = temp->next;
212 : : }
213 : : }
214 : :
215 : 0 : rte_free(mp->pool_data);
216 : 0 : dpaa2_free_dpbp_dev(dpbp_node);
217 : : }
218 : :
219 : : static void
220 : 0 : rte_dpaa2_mbuf_release(struct rte_mempool *pool __rte_unused,
221 : : void * const *obj_table,
222 : : uint32_t bpid,
223 : : uint32_t meta_data_size,
224 : : int count)
225 : : {
226 : : struct qbman_release_desc releasedesc;
227 : : struct qbman_swp *swp;
228 : : int ret;
229 : : int i, n, retry_count;
230 : : uint64_t bufs[DPAA2_MBUF_MAX_ACQ_REL];
231 : :
232 [ # # ]: 0 : if (unlikely(!DPAA2_PER_LCORE_DPIO)) {
233 : 0 : ret = dpaa2_affine_qbman_swp();
234 [ # # ]: 0 : if (ret != 0) {
235 : 0 : DPAA2_MEMPOOL_ERR(
236 : : "Failed to allocate IO portal, tid: %d",
237 : : rte_gettid());
238 : 0 : return;
239 : : }
240 : : }
241 : 0 : swp = DPAA2_PER_LCORE_PORTAL;
242 : :
243 : : /* Create a release descriptor required for releasing
244 : : * buffers into QBMAN
245 : : */
246 : 0 : qbman_release_desc_clear(&releasedesc);
247 : 0 : qbman_release_desc_set_bpid(&releasedesc, bpid);
248 : :
249 : 0 : n = count % DPAA2_MBUF_MAX_ACQ_REL;
250 [ # # ]: 0 : if (unlikely(!n))
251 : 0 : goto aligned;
252 : :
253 : : /* convert mbuf to buffers for the remainder */
254 [ # # ]: 0 : for (i = 0; i < n ; i++) {
255 : : #ifdef RTE_LIBRTE_DPAA2_USE_PHYS_IOVA
256 : 0 : bufs[i] = (uint64_t)rte_mempool_virt2iova(obj_table[i])
257 : 0 : + meta_data_size;
258 : : #else
259 : : bufs[i] = (uint64_t)obj_table[i] + meta_data_size;
260 : : #endif
261 : : }
262 : :
263 : : /* feed them to bman */
264 : : retry_count = 0;
265 [ # # ]: 0 : while ((ret = qbman_swp_release(swp, &releasedesc, bufs, n)) ==
266 : : -EBUSY) {
267 : 0 : retry_count++;
268 [ # # ]: 0 : if (retry_count > DPAA2_MAX_TX_RETRY_COUNT) {
269 : 0 : DPAA2_MEMPOOL_ERR("bman release retry exceeded, low fbpr?");
270 : 0 : return;
271 : : }
272 : : }
273 : :
274 : 0 : aligned:
275 : : /* if there are more buffers to free */
276 [ # # ]: 0 : while (n < count) {
277 : : /* convert mbuf to buffers */
278 [ # # ]: 0 : for (i = 0; i < DPAA2_MBUF_MAX_ACQ_REL; i++) {
279 : : #ifdef RTE_LIBRTE_DPAA2_USE_PHYS_IOVA
280 : 0 : bufs[i] = (uint64_t)
281 : 0 : rte_mempool_virt2iova(obj_table[n + i])
282 : 0 : + meta_data_size;
283 : : #else
284 : : bufs[i] = (uint64_t)obj_table[n + i] + meta_data_size;
285 : : #endif
286 : : }
287 : :
288 : : retry_count = 0;
289 : 0 : while ((ret = qbman_swp_release(swp, &releasedesc, bufs,
290 [ # # ]: 0 : DPAA2_MBUF_MAX_ACQ_REL)) == -EBUSY) {
291 : 0 : retry_count++;
292 [ # # ]: 0 : if (retry_count > DPAA2_MAX_TX_RETRY_COUNT) {
293 : 0 : DPAA2_MEMPOOL_ERR("bman release retry exceeded, low fbpr?");
294 : 0 : return;
295 : : }
296 : : }
297 : 0 : n += DPAA2_MBUF_MAX_ACQ_REL;
298 : : }
299 : : }
300 : :
301 : : RTE_EXPORT_INTERNAL_SYMBOL(rte_dpaa2_bpid_info_init)
302 : 0 : int rte_dpaa2_bpid_info_init(struct rte_mempool *mp)
303 : : {
304 : 0 : struct dpaa2_bp_info *bp_info = mempool_to_bpinfo(mp);
305 : 0 : uint32_t bpid = bp_info->bpid;
306 : :
307 [ # # ]: 0 : if (!rte_dpaa2_bpid_info) {
308 : 0 : rte_dpaa2_bpid_info = (struct dpaa2_bp_info *)rte_malloc(NULL,
309 : : sizeof(struct dpaa2_bp_info) * MAX_BPID,
310 : : RTE_CACHE_LINE_SIZE);
311 [ # # ]: 0 : if (rte_dpaa2_bpid_info == NULL)
312 : : return -ENOMEM;
313 : : memset(rte_dpaa2_bpid_info, 0,
314 : : sizeof(struct dpaa2_bp_info) * MAX_BPID);
315 : : }
316 : :
317 : 0 : rte_dpaa2_bpid_info[bpid].meta_data_size = sizeof(struct rte_mbuf)
318 : 0 : + rte_pktmbuf_priv_size(mp);
319 : 0 : rte_dpaa2_bpid_info[bpid].bp_list = bp_info->bp_list;
320 : 0 : rte_dpaa2_bpid_info[bpid].bpid = bpid;
321 : :
322 : 0 : return 0;
323 : : }
324 : :
325 : : RTE_EXPORT_SYMBOL(rte_dpaa2_mbuf_pool_bpid)
326 : : uint16_t
327 : 0 : rte_dpaa2_mbuf_pool_bpid(struct rte_mempool *mp)
328 : : {
329 : : struct dpaa2_bp_info *bp_info;
330 : :
331 : 0 : bp_info = mempool_to_bpinfo(mp);
332 [ # # ]: 0 : if (!(bp_info->bp_list)) {
333 : 0 : DPAA2_MEMPOOL_ERR("DPAA2 buffer pool not configured");
334 : 0 : return -ENOMEM;
335 : : }
336 : :
337 : 0 : return bp_info->bpid;
338 : : }
339 : :
340 : : RTE_EXPORT_SYMBOL(rte_dpaa2_mbuf_from_buf_addr)
341 : : struct rte_mbuf *
342 : 0 : rte_dpaa2_mbuf_from_buf_addr(struct rte_mempool *mp, void *buf_addr)
343 : : {
344 : : struct dpaa2_bp_info *bp_info;
345 : :
346 : 0 : bp_info = mempool_to_bpinfo(mp);
347 [ # # ]: 0 : if (!(bp_info->bp_list)) {
348 : 0 : DPAA2_MEMPOOL_ERR("DPAA2 buffer pool not configured");
349 : 0 : return NULL;
350 : : }
351 : :
352 : 0 : return (struct rte_mbuf *)((uint8_t *)buf_addr -
353 : 0 : bp_info->meta_data_size);
354 : : }
355 : :
356 : : RTE_EXPORT_INTERNAL_SYMBOL(rte_dpaa2_mbuf_alloc_bulk)
357 : : int
358 : 0 : rte_dpaa2_mbuf_alloc_bulk(struct rte_mempool *pool,
359 : : void **obj_table, unsigned int count)
360 : : {
361 : : #ifdef RTE_LIBRTE_DPAA2_DEBUG_DRIVER
362 : : static int alloc;
363 : : #endif
364 : : struct qbman_swp *swp;
365 : : uint16_t bpid;
366 : : size_t bufs[DPAA2_MBUF_MAX_ACQ_REL];
367 : : int i, ret;
368 : : unsigned int n = 0;
369 : : struct dpaa2_bp_info *bp_info;
370 : :
371 : 0 : bp_info = mempool_to_bpinfo(pool);
372 : :
373 [ # # ]: 0 : if (!(bp_info->bp_list)) {
374 : 0 : DPAA2_MEMPOOL_ERR("DPAA2 buffer pool not configured");
375 : 0 : return -ENOENT;
376 : : }
377 : :
378 : 0 : bpid = bp_info->bpid;
379 : :
380 [ # # ]: 0 : if (unlikely(!DPAA2_PER_LCORE_DPIO)) {
381 : 0 : ret = dpaa2_affine_qbman_swp();
382 [ # # ]: 0 : if (ret != 0) {
383 : 0 : DPAA2_MEMPOOL_ERR(
384 : : "Failed to allocate IO portal, tid: %d",
385 : : rte_gettid());
386 : 0 : return ret;
387 : : }
388 : : }
389 : 0 : swp = DPAA2_PER_LCORE_PORTAL;
390 : :
391 [ # # ]: 0 : while (n < count) {
392 : : /* Acquire is all-or-nothing, so we drain in 7s,
393 : : * then the remainder.
394 : : */
395 [ # # ]: 0 : if ((count - n) > DPAA2_MBUF_MAX_ACQ_REL) {
396 : 0 : ret = qbman_swp_acquire(swp, bpid, (void *)bufs,
397 : : DPAA2_MBUF_MAX_ACQ_REL);
398 : : } else {
399 : 0 : ret = qbman_swp_acquire(swp, bpid, (void *)bufs,
400 : : count - n);
401 : : }
402 : : /* In case of less than requested number of buffers available
403 : : * in pool, qbman_swp_acquire returns 0
404 : : */
405 [ # # ]: 0 : if (ret <= 0) {
406 : : DPAA2_MEMPOOL_DP_DEBUG(
407 : : "Buffer acquire failed with err code: %d", ret);
408 : : /* The API expect the exact number of requested bufs */
409 : : /* Releasing all buffers allocated */
410 : 0 : rte_dpaa2_mbuf_release(pool, obj_table, bpid,
411 : : bp_info->meta_data_size, n);
412 : 0 : return -ENOBUFS;
413 : : }
414 : : /* assigning mbuf from the acquired objects */
415 [ # # # # ]: 0 : for (i = 0; (i < ret) && bufs[i]; i++) {
416 : 0 : DPAA2_MODIFY_IOVA_TO_VADDR(bufs[i], size_t);
417 : 0 : obj_table[n] = (struct rte_mbuf *)
418 : 0 : (bufs[i] - bp_info->meta_data_size);
419 : : DPAA2_MEMPOOL_DP_DEBUG(
420 : : "Acquired %p address %p from BMAN\n",
421 : : (void *)bufs[i], (void *)obj_table[n]);
422 : 0 : n++;
423 : : }
424 : : }
425 : :
426 : : #ifdef RTE_LIBRTE_DPAA2_DEBUG_DRIVER
427 : : alloc += n;
428 : : DPAA2_MEMPOOL_DP_DEBUG("Total = %d , req = %d done = %d\n",
429 : : alloc, count, n);
430 : : #endif
431 : : return 0;
432 : : }
433 : :
434 : : static int
435 : 0 : rte_hw_mbuf_free_bulk(struct rte_mempool *pool,
436 : : void * const *obj_table, unsigned int n)
437 : : {
438 : : struct dpaa2_bp_info *bp_info;
439 : :
440 : 0 : bp_info = mempool_to_bpinfo(pool);
441 [ # # ]: 0 : if (!(bp_info->bp_list)) {
442 : 0 : DPAA2_MEMPOOL_ERR("DPAA2 buffer pool not configured");
443 : 0 : return -ENOENT;
444 : : }
445 : 0 : rte_dpaa2_mbuf_release(pool, obj_table, bp_info->bpid,
446 : : bp_info->meta_data_size, n);
447 : :
448 : 0 : return 0;
449 : : }
450 : :
451 : : static unsigned int
452 : 0 : rte_hw_mbuf_get_count(const struct rte_mempool *mp)
453 : : {
454 : : int ret;
455 : 0 : unsigned int num_of_bufs = 0;
456 : : struct dpaa2_bp_info *bp_info;
457 : : struct dpaa2_dpbp_dev *dpbp_node;
458 : : struct fsl_mc_io mc_io;
459 : :
460 [ # # # # ]: 0 : if (!mp || !mp->pool_data) {
461 : 0 : DPAA2_MEMPOOL_ERR("Invalid mempool provided");
462 : 0 : return 0;
463 : : }
464 : :
465 : : bp_info = (struct dpaa2_bp_info *)mp->pool_data;
466 : 0 : dpbp_node = bp_info->bp_list->buf_pool.dpbp_node;
467 : :
468 : : /* In case as secondary process access stats, MCP portal in priv-hw may
469 : : * have primary process address. Need the secondary process based MCP
470 : : * portal address for this object.
471 : : */
472 : 0 : mc_io.regs = dpaa2_get_mcp_ptr(MC_PORTAL_INDEX);
473 : 0 : ret = dpbp_get_num_free_bufs(&mc_io, CMD_PRI_LOW,
474 : 0 : dpbp_node->token, &num_of_bufs);
475 [ # # ]: 0 : if (ret) {
476 : 0 : DPAA2_MEMPOOL_ERR("Unable to obtain free buf count (err=%d)",
477 : : ret);
478 : 0 : return 0;
479 : : }
480 : :
481 : : DPAA2_MEMPOOL_DP_DEBUG("Free bufs = %u\n", num_of_bufs);
482 : :
483 : 0 : return num_of_bufs;
484 : : }
485 : :
486 : : static int
487 : 0 : dpaa2_populate(struct rte_mempool *mp, unsigned int max_objs,
488 : : void *vaddr, rte_iova_t paddr, size_t len,
489 : : rte_mempool_populate_obj_cb_t *obj_cb, void *obj_cb_arg)
490 : : {
491 : : struct rte_memseg_list *msl;
492 : : /* The memsegment list exists incase the memory is not external.
493 : : * So, DMA-Map is required only when memory is provided by user,
494 : : * i.e. External.
495 : : */
496 : 0 : msl = rte_mem_virt2memseg_list(vaddr);
497 : :
498 [ # # ]: 0 : if (!msl) {
499 : 0 : DPAA2_MEMPOOL_DEBUG("Memsegment is External.");
500 : 0 : rte_fslmc_vfio_mem_dmamap((size_t)vaddr,
501 : : (size_t)paddr, (size_t)len);
502 : : }
503 : : /* Insert entry into the PA->VA Table */
504 : 0 : dpaax_iova_table_update(paddr, vaddr, len);
505 : :
506 : 0 : return rte_mempool_op_populate_helper(mp, 0, max_objs, vaddr, paddr,
507 : : len, obj_cb, obj_cb_arg);
508 : : }
509 : :
510 : : static const struct rte_mempool_ops dpaa2_mpool_ops = {
511 : : .name = DPAA2_MEMPOOL_OPS_NAME,
512 : : .alloc = rte_hw_mbuf_create_pool,
513 : : .free = rte_hw_mbuf_free_pool,
514 : : .enqueue = rte_hw_mbuf_free_bulk,
515 : : .dequeue = rte_dpaa2_mbuf_alloc_bulk,
516 : : .get_count = rte_hw_mbuf_get_count,
517 : : .populate = dpaa2_populate,
518 : : };
519 : :
520 : 253 : RTE_MEMPOOL_REGISTER_OPS(dpaa2_mpool_ops);
521 : :
522 [ - + ]: 253 : RTE_LOG_REGISTER_DEFAULT(dpaa2_logtype_mempool, NOTICE);
|