aboutsummaryrefslogtreecommitdiffstats
path: root/src/vcl
diff options
context:
space:
mode:
Diffstat (limited to 'src/vcl')
-rw-r--r--src/vcl/ldp.c3
-rw-r--r--src/vcl/vcl_locked.c3
-rw-r--r--src/vcl/vcl_private.c20
-rw-r--r--src/vcl/vcl_private.h2
4 files changed, 26 insertions, 2 deletions
diff --git a/src/vcl/ldp.c b/src/vcl/ldp.c
index 33b24a7a8bf..38d1301d722 100644
--- a/src/vcl/ldp.c
+++ b/src/vcl/ldp.c
@@ -1945,6 +1945,9 @@ getsockopt (int fd, int level, int optname,
case SO_ERROR:
rv = vls_attr (vlsh, VPPCOM_ATTR_GET_ERROR, optval, optlen);
break;
+ case SO_BINDTODEVICE:
+ rv = 0;
+ break;
default:
LDBG (0, "ERROR: fd %d: getsockopt SOL_SOCKET: vlsh %u "
"optname %d unsupported!", fd, vlsh, optname);
diff --git a/src/vcl/vcl_locked.c b/src/vcl/vcl_locked.c
index 69f492b8694..2f1bcca0182 100644
--- a/src/vcl/vcl_locked.c
+++ b/src/vcl/vcl_locked.c
@@ -766,8 +766,7 @@ vls_share_session (vls_worker_t * vls_wrk, vcl_locked_session_t * vls)
if (s->rx_fifo)
{
- svm_fifo_add_subscriber (s->rx_fifo, vcl_wrk->vpp_wrk_index);
- svm_fifo_add_subscriber (s->tx_fifo, vcl_wrk->vpp_wrk_index);
+ vcl_session_share_fifos (s, s->rx_fifo, s->tx_fifo);
}
else if (s->session_state == VCL_STATE_LISTEN)
{
diff --git a/src/vcl/vcl_private.c b/src/vcl/vcl_private.c
index 3538a092bac..1ef4cc6a27a 100644
--- a/src/vcl/vcl_private.c
+++ b/src/vcl/vcl_private.c
@@ -560,6 +560,26 @@ vcl_segment_alloc_chunk (uword segment_handle, u32 slice_index, u32 size,
return c;
}
+int
+vcl_session_share_fifos (vcl_session_t *s, svm_fifo_t *rxf, svm_fifo_t *txf)
+{
+ vcl_worker_t *wrk = vcl_worker_get_current ();
+ fifo_segment_t *fs;
+
+ clib_rwlock_reader_lock (&vcm->segment_table_lock);
+
+ fs = fifo_segment_get_segment (&vcm->segment_main, rxf->segment_index);
+ s->rx_fifo = fifo_segment_duplicate_fifo (fs, rxf);
+ s->tx_fifo = fifo_segment_duplicate_fifo (fs, txf);
+
+ clib_rwlock_reader_unlock (&vcm->segment_table_lock);
+
+ svm_fifo_add_subscriber (s->rx_fifo, wrk->vpp_wrk_index);
+ svm_fifo_add_subscriber (s->tx_fifo, wrk->vpp_wrk_index);
+
+ return 0;
+}
+
/*
* fd.io coding-style-patch-verification: ON
*
diff --git a/src/vcl/vcl_private.h b/src/vcl/vcl_private.h
index 628b7310788..c3215ad9bbd 100644
--- a/src/vcl/vcl_private.h
+++ b/src/vcl/vcl_private.h
@@ -725,6 +725,8 @@ int vcl_segment_discover_mqs (uword segment_handle, int *fds, u32 n_fds);
svm_fifo_chunk_t *vcl_segment_alloc_chunk (uword segment_handle,
u32 slice_index, u32 size,
uword *offset);
+int vcl_session_share_fifos (vcl_session_t *s, svm_fifo_t *rxf,
+ svm_fifo_t *txf);
/*
* VCL Binary API