unsigned int num_of_bufs = 0;
struct dpaa2_bp_info *bp_info;
struct dpaa2_dpbp_dev *dpbp_node;
+ struct fsl_mc_io mc_io;
if (!mp || !mp->pool_data) {
DPAA2_MEMPOOL_ERR("Invalid mempool provided");
bp_info = (struct dpaa2_bp_info *)mp->pool_data;
dpbp_node = bp_info->bp_list->buf_pool.dpbp_node;
- ret = dpbp_get_num_free_bufs(&dpbp_node->dpbp, CMD_PRI_LOW,
+ /* In case as secondary process access stats, MCP portal in priv-hw may
+ * have primary process address. Need the secondary process based MCP
+ * portal address for this object.
+ */
+ mc_io.regs = dpaa2_get_mcp_ptr(MC_PORTAL_INDEX);
+ ret = dpbp_get_num_free_bufs(&mc_io, CMD_PRI_LOW,
dpbp_node->token, &num_of_bufs);
if (ret) {
DPAA2_MEMPOOL_ERR("Unable to obtain free buf count (err=%d)",