aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2019-04-28 21:16:30 -0700
committerDave Barach <openvpp@barachs.net>2019-04-30 16:59:49 +0000
commit87b15cebdaca21f6725637abeceec0f19f4eec51 (patch)
tree3b6063188bc64972bdc359526dd8c0823bcd9fc9 /src/vnet
parentc6eb5bc967d3d70016b4e4e182b3d68b1e558f60 (diff)
svm: more fifo refactor/cleanup
Change-Id: Ie76c69641c8598164d0d00fd498018037258fd86 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet')
-rw-r--r--src/vnet/session-apps/echo_client.c2
-rw-r--r--src/vnet/session-apps/http_server.c2
-rw-r--r--src/vnet/session/application_interface.h8
-rw-r--r--src/vnet/session/session.c15
-rw-r--r--src/vnet/session/session_node.c8
5 files changed, 17 insertions, 18 deletions
diff --git a/src/vnet/session-apps/echo_client.c b/src/vnet/session-apps/echo_client.c
index 8366c56aa6b..bcb2edf3792 100644
--- a/src/vnet/session-apps/echo_client.c
+++ b/src/vnet/session-apps/echo_client.c
@@ -97,7 +97,7 @@ send_data_chunk (echo_client_main_t * ecm, eclient_session_t * s)
clib_memcpy_fast (&hdr.lcl_ip, &at->lcl_ip,
sizeof (ip46_address_t));
hdr.lcl_port = at->lcl_port;
- svm_fifo_enqueue_nowait (f, sizeof (hdr), (u8 *) & hdr);
+ svm_fifo_enqueue (f, sizeof (hdr), (u8 *) & hdr);
svm_fifo_enqueue_nocopy (f, rv);
session_send_io_evt_to_thread_custom (&f->master_session_index,
s->thread_index,
diff --git a/src/vnet/session-apps/http_server.c b/src/vnet/session-apps/http_server.c
index c7e06bfbb2d..ace3c75ebb8 100644
--- a/src/vnet/session-apps/http_server.c
+++ b/src/vnet/session-apps/http_server.c
@@ -310,7 +310,7 @@ send_data (http_session_t * hs, u8 * data)
{
int actual_transfer;
- actual_transfer = svm_fifo_enqueue_nowait
+ actual_transfer = svm_fifo_enqueue
(hs->tx_fifo, bytes_to_send, data + offset);
/* Made any progress? */
diff --git a/src/vnet/session/application_interface.h b/src/vnet/session/application_interface.h
index aa1a3f30877..234813e5814 100644
--- a/src/vnet/session/application_interface.h
+++ b/src/vnet/session/application_interface.h
@@ -469,10 +469,10 @@ app_send_dgram_raw (svm_fifo_t * f, app_session_transport_t * at,
hdr.rmt_port = at->rmt_port;
clib_memcpy_fast (&hdr.lcl_ip, &at->lcl_ip, sizeof (ip46_address_t));
hdr.lcl_port = at->lcl_port;
- rv = svm_fifo_enqueue_nowait (f, sizeof (hdr), (u8 *) & hdr);
+ rv = svm_fifo_enqueue (f, sizeof (hdr), (u8 *) & hdr);
ASSERT (rv == sizeof (hdr));
- rv = svm_fifo_enqueue_nowait (f, actual_write, data);
+ rv = svm_fifo_enqueue (f, actual_write, data);
if (do_evt)
{
if (rv > 0 && svm_fifo_set_event (f))
@@ -497,7 +497,7 @@ app_send_stream_raw (svm_fifo_t * f, svm_msg_q_t * vpp_evt_q, u8 * data,
{
int rv;
- rv = svm_fifo_enqueue_nowait (f, len, data);
+ rv = svm_fifo_enqueue (f, len, data);
if (do_evt)
{
if (rv > 0 && svm_fifo_set_event (f))
@@ -572,7 +572,7 @@ app_recv_stream_raw (svm_fifo_t * f, u8 * buf, u32 len, u8 clear_evt, u8 peek)
if (peek)
return svm_fifo_peek (f, 0, len, buf);
- return svm_fifo_dequeue_nowait (f, len, buf);
+ return svm_fifo_dequeue (f, len, buf);
}
always_inline int
diff --git a/src/vnet/session/session.c b/src/vnet/session/session.c
index aaf252be257..75f7baf7318 100644
--- a/src/vnet/session/session.c
+++ b/src/vnet/session/session.c
@@ -296,7 +296,7 @@ session_enqueue_chain_tail (session_t * s, vlib_buffer_t * b,
continue;
if (is_in_order)
{
- rv = svm_fifo_enqueue_nowait (s->rx_fifo, len, data);
+ rv = svm_fifo_enqueue (s->rx_fifo, len, data);
if (rv == len)
{
written += rv;
@@ -363,9 +363,9 @@ session_enqueue_stream_connection (transport_connection_t * tc,
if (is_in_order)
{
- enqueued = svm_fifo_enqueue_nowait (s->rx_fifo,
- b->current_length,
- vlib_buffer_get_current (b));
+ enqueued = svm_fifo_enqueue (s->rx_fifo,
+ b->current_length,
+ vlib_buffer_get_current (b));
if (PREDICT_FALSE ((b->flags & VLIB_BUFFER_NEXT_PRESENT)
&& enqueued >= 0))
{
@@ -414,10 +414,9 @@ session_enqueue_dgram_connection (session_t * s,
ASSERT (svm_fifo_max_enqueue_prod (s->rx_fifo)
>= b->current_length + sizeof (*hdr));
- svm_fifo_enqueue_nowait (s->rx_fifo, sizeof (session_dgram_hdr_t),
- (u8 *) hdr);
- enqueued = svm_fifo_enqueue_nowait (s->rx_fifo, b->current_length,
- vlib_buffer_get_current (b));
+ svm_fifo_enqueue (s->rx_fifo, sizeof (session_dgram_hdr_t), (u8 *) hdr);
+ enqueued = svm_fifo_enqueue (s->rx_fifo, b->current_length,
+ vlib_buffer_get_current (b));
if (PREDICT_FALSE ((b->flags & VLIB_BUFFER_NEXT_PRESENT) && enqueued >= 0))
{
in_order_off = enqueued > b->current_length ? enqueued : 0;
diff --git a/src/vnet/session/session_node.c b/src/vnet/session/session_node.c
index 605fd584e2d..1a04658cb41 100644
--- a/src/vnet/session/session_node.c
+++ b/src/vnet/session/session_node.c
@@ -414,8 +414,8 @@ session_tx_fifo_chain_tail (vlib_main_t * vm, session_tx_context_t * ctx,
}
}
else
- n_bytes_read = svm_fifo_dequeue_nowait (ctx->s->tx_fifo,
- len_to_deq, data);
+ n_bytes_read = svm_fifo_dequeue (ctx->s->tx_fifo,
+ len_to_deq, data);
}
ASSERT (n_bytes_read == len_to_deq);
chain_b->current_length = n_bytes_read;
@@ -494,8 +494,8 @@ session_tx_fill_buffer (vlib_main_t * vm, session_tx_context_t * ctx,
}
else
{
- n_bytes_read = svm_fifo_dequeue_nowait (ctx->s->tx_fifo,
- len_to_deq, data0);
+ n_bytes_read = svm_fifo_dequeue (ctx->s->tx_fifo,
+ len_to_deq, data0);
ASSERT (n_bytes_read > 0);
}
}