Beispiel #1
0
int
pqos_mba_get(const unsigned socket,
             const unsigned max_num_cos,
             unsigned *num_cos,
             struct pqos_mba *mba_tab)
{
	int ret;

	if (num_cos == NULL || mba_tab == NULL || max_num_cos == 0)
		return PQOS_RETVAL_PARAM;

	_pqos_api_lock();

        ret = _pqos_check_init(1);
        if (ret != PQOS_RETVAL_OK) {
                _pqos_api_unlock();
                return ret;
        }

        if (m_interface == PQOS_INTER_MSR)
                ret = hw_mba_get(socket, max_num_cos, num_cos, mba_tab);
        else {
#ifdef __linux__
                ret = os_mba_get(socket, max_num_cos, num_cos, mba_tab);
#else
                LOG_INFO("OS interface not supported!\n");
                ret = PQOS_RETVAL_RESOURCE;
#endif
        }

	_pqos_api_unlock();

	return ret;
}
Beispiel #2
0
int pqos_mba_get(const unsigned socket,
                 const unsigned max_num_cos,
                 unsigned *num_cos,
                 struct pqos_mba *mba_tab)
{
	int ret;

	_pqos_api_lock();

        ret = _pqos_check_init(1);
        if (ret != PQOS_RETVAL_OK) {
                _pqos_api_unlock();
                return ret;
        }

	ret = hw_mba_get(socket, max_num_cos, num_cos, mba_tab);

	_pqos_api_unlock();

	return ret;
}