Exemple #1
0
bool socket_fd_api::is_readable(uint64_t *p_poll_sn, fd_array_t* p_fd_array)
{
	NOT_IN_USE(p_poll_sn);
	NOT_IN_USE(p_fd_array);
	__log_info_funcall("");
	return false;
}
Exemple #2
0
bool buffer_pool::get_buffers_thread_safe(descq_t &pDeque, ring_slave* desc_owner, size_t count, uint32_t lkey)
{
	auto_unlocker lock(m_lock_spin);

	mem_buf_desc_t *head;

	__log_info_funcall("requested %lu, present %lu, created %lu", count, m_n_buffers, m_n_buffers_created);

	if (unlikely(m_n_buffers < count)) {
		VLOG_PRINTF_INFO_ONCE_THEN_ALWAYS(VLOG_DEBUG, VLOG_FUNC, "ERROR! not enough buffers in the pool (requested: %lu, have: %lu, created: %lu, Buffer pool type: %s)",
				count, m_n_buffers, m_n_buffers_created, m_p_bpool_stat->is_rx ? "Rx" : "Tx");

		m_p_bpool_stat->n_buffer_pool_no_bufs++;
		return false;
	}

	// pop buffers from the list
	m_n_buffers -= count;
	m_p_bpool_stat->n_buffer_pool_size -= count;
	while (count-- > 0) {
		// Remove from list
		head = m_p_head;
		m_p_head = m_p_head->p_next_desc;
		head->p_next_desc = NULL;

		// Init
		head->lkey = lkey;
		head->p_desc_owner = desc_owner;

		// Push to queue
		pDeque.push_back(head);
	}

	return true;
}
Exemple #3
0
mem_buf_desc_t *buffer_pool::get_buffers(size_t count, uint32_t lkey)
{
	mem_buf_desc_t *next, *head;

	__log_info_funcall("requested %lu, present %lu, created %lu", count, m_n_buffers, m_n_buffers_created);

	if (unlikely(m_n_buffers < count)) {
		static vlog_levels_t log_severity = VLOG_DEBUG; // DEBUG severity will be used only once - at the 1st time

		VLOG_PRINTF_INFO(log_severity, "ERROR! not enough buffers in the pool (requested: %lu, have: %lu, created: %lu, Buffer pool type: %s)",
				count, m_n_buffers, m_n_buffers_created, m_p_bpool_stat->is_rx ? "Rx" : "Tx");

		log_severity = VLOG_FUNC; // for all times but the 1st one

		m_p_bpool_stat->n_buffer_pool_no_bufs++;

		return NULL;
	}

	// pop buffers from the list
	head = NULL;
	m_n_buffers -= count;
	m_p_bpool_stat->n_buffer_pool_size -= count;
	while (count > 0) {
		next = m_p_head->p_next_desc;
		m_p_head->p_next_desc = head;
		head = m_p_head;
		m_p_head = next;
		head->lkey = lkey;
		--count;
	}

	return head;
}
Exemple #4
0
inline void buffer_pool::put_buffers(mem_buf_desc_t *buff_list)
{
	mem_buf_desc_t *next;
	__log_info_funcall("returning list, present %lu, created %lu", m_n_buffers, m_n_buffers_created);
	while (buff_list) {
		next = buff_list->p_next_desc;
		put_buffer_helper(buff_list);
		buff_list = next;
	}

	if (unlikely(m_n_buffers > m_n_buffers_created)) {
		buffersPanic();
	}
}
Exemple #5
0
void buffer_pool::put_buffers(descq_t *buffers, size_t count)
{
	mem_buf_desc_t *buff_list, *next;
	size_t amount;
	__log_info_funcall("returning %lu, present %lu, created %lu", count, m_n_buffers, m_n_buffers_created);
	for (amount = MIN(count, buffers->size()); amount > 0 ; amount--) {
		buff_list = buffers->get_and_pop_back();
		while (buff_list) {
			next = buff_list->p_next_desc;
			put_buffer_helper(buff_list);
			buff_list = next;
		}
	}

	if (unlikely(m_n_buffers > m_n_buffers_created)) {
		buffersPanic();
	}
}
Exemple #6
0
bool socket_fd_api::is_errorable(int *errors)
{
	NOT_IN_USE(errors);
	__log_info_funcall("");
	return false;
}
Exemple #7
0
bool socket_fd_api::is_writeable()
{
	__log_info_funcall("");
	return true;
}
Exemple #8
0
int socket_fd_api::rx_request_notification(uint64_t poll_sn)
{
	NOT_IN_USE(poll_sn);
	__log_info_funcall("");
	return false;
}
Exemple #9
0
void socket_fd_api::unset_immediate_os_sample()
{
	__log_info_funcall("");
	return;
}