diff options
author | Florin Coras <fcoras@cisco.com> | 2018-05-04 15:46:57 -0700 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2018-05-09 11:34:06 +0000 |
commit | 8e43d04ca4f4496aaefc4f5e2b6e1c0951624099 (patch) | |
tree | 3addc5766002d5224dde2c7fa4efe018480830e4 /src/vnet/session/application_interface.h | |
parent | ee7f0bd9e7ce4106d3b9511b0efede4326bded51 (diff) |
session: cleanup session tx function
- rework the function to declutter and avoid building more than one tx
frame
- add dual loop although benefits in my tests seem to be minimal
- improve tcp/udp echo external apps. They have slightly better
throughput than internal echo apps.
- udp bugfixes
Change-Id: Iea4a245b1b1bb407a7f403dedcce2664a49f774b
Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/session/application_interface.h')
-rw-r--r-- | src/vnet/session/application_interface.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/vnet/session/application_interface.h b/src/vnet/session/application_interface.h index 5fd218533dc..49c2862ac45 100644 --- a/src/vnet/session/application_interface.h +++ b/src/vnet/session/application_interface.h @@ -204,7 +204,7 @@ app_send_dgram_raw (svm_fifo_t * f, app_session_transport_t * at, int rv; max_enqueue = svm_fifo_max_enqueue (f); - if (svm_fifo_max_enqueue (f) <= sizeof (session_dgram_hdr_t)) + if (max_enqueue <= sizeof (session_dgram_hdr_t)) return 0; max_enqueue -= sizeof (session_dgram_hdr_t); @@ -217,9 +217,6 @@ app_send_dgram_raw (svm_fifo_t * f, app_session_transport_t * at, clib_memcpy (&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); - if (rv <= 0) - return 0; - ASSERT (rv == sizeof (hdr)); if ((rv = svm_fifo_enqueue_nowait (f, actual_write, data)) > 0) @@ -231,6 +228,7 @@ app_send_dgram_raw (svm_fifo_t * f, app_session_transport_t * at, svm_queue_add (vpp_evt_q, (u8 *) & evt, noblock); } } + ASSERT (rv); return rv; } |