summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2021-06-16 14:46:57 -0700
committerDave Barach <openvpp@barachs.net>2021-06-16 23:23:50 +0000
commit8eb8d50ecfd7507aae340cb05a0fb07a790e4303 (patch)
tree5799f08d5472c6093fc54a33288a4ae4f1567d6f
parentcba215dad3101c6b03483c5c40f806903de8460d (diff)
vcl: fix fifo sharing
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Iec1fe8315a057214901250d5fb06d1c1e33dda46
-rw-r--r--src/svm/fifo_segment.c8
-rw-r--r--src/svm/fifo_segment.h1
-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
6 files changed, 35 insertions, 2 deletions
diff --git a/src/svm/fifo_segment.c b/src/svm/fifo_segment.c
index b680d27fe33..6ab07974ff7 100644
--- a/src/svm/fifo_segment.c
+++ b/src/svm/fifo_segment.c
@@ -903,6 +903,14 @@ fifo_segment_alloc_fifo_w_offset (fifo_segment_t *fs, uword offset)
return f;
}
+svm_fifo_t *
+fifo_segment_duplicate_fifo (fifo_segment_t *fs, svm_fifo_t *f)
+{
+ svm_fifo_t *nf = fs_fifo_alloc (fs, 0);
+ clib_memcpy (nf, f, sizeof (*f));
+ return nf;
+}
+
/**
* Free fifo allocated in fifo segment
*/
diff --git a/src/svm/fifo_segment.h b/src/svm/fifo_segment.h
index a4290bb1dc7..74f73d43334 100644
--- a/src/svm/fifo_segment.h
+++ b/src/svm/fifo_segment.h
@@ -132,6 +132,7 @@ svm_fifo_t *fifo_segment_alloc_fifo_w_slice (fifo_segment_t * fs,
fifo_segment_ftype_t ftype);
svm_fifo_t *fifo_segment_alloc_fifo_w_offset (fifo_segment_t *fs,
uword offset);
+svm_fifo_t *fifo_segment_duplicate_fifo (fifo_segment_t *fs, svm_fifo_t *f);
/**
* Free fifo allocated in fifo segment
diff --git a/src/vcl/ldp.c b/src/vcl/ldp.c
index 54a8f66354f..316d97df2e2 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 ea22bcd22f5..6c606f6b0db 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 712c07049c6..95a45ffd099 100644
--- a/src/vcl/vcl_private.c
+++ b/src/vcl/vcl_private.c
@@ -569,6 +569,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 ab3ecab36fa..151e4e91f44 100644
--- a/src/vcl/vcl_private.h
+++ b/src/vcl/vcl_private.h
@@ -730,6 +730,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
81'>181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230
2n-clx-xxv710
-------------

64b-l2switching-base-avf
````````````````````````

2t1c
::::

.. raw:: html

    <a name="64b-2t1c-base-avf"></a>
    <center>
    Links to builds:
    <a href="https://packagecloud.io/app/fdio/master/search?dist=ubuntu%2Fbionic" target="_blank">vpp-ref</a>,
    <a href="https://jenkins.fd.io/view/csit/job/csit-vpp-perf-mrr-daily-master-2n-clx" target="_blank">csit-ref</a>
    <iframe width="1100" height="800" frameborder="0" scrolling="no" src="../_static/vpp/2n-clx-xxv710-64b-2t1c-l2-base-avf.html"></iframe>
    <p><br></p>
    </center>

4t2c
::::

.. raw:: html

    <a name="64b-4t2c-base-avf"></a>
    <center>
    Links to builds:
    <a href="https://packagecloud.io/app/fdio/master/search?dist=ubuntu%2Fbionic" target="_blank">vpp-ref</a>,
    <a href="https://jenkins.fd.io/view/csit/job/csit-vpp-perf-mrr-daily-master-2n-clx" target="_blank">csit-ref</a>
    <iframe width="1100" height="800" frameborder="0" scrolling="no" src="../_static/vpp/2n-clx-xxv710-64b-4t2c-l2-base-avf.html"></iframe>
    <p><br></p>
    </center>

8t4c
::::

.. raw:: html

    <a name="64b-8t4c-base-avf"></a>
    <center>
    Links to builds:
    <a href="https://packagecloud.io/app/fdio/master/search?dist=ubuntu%2Fbionic" target="_blank">vpp-ref</a>,
    <a href="https://jenkins.fd.io/view/csit/job/csit-vpp-perf-mrr-daily-master-2n-clx" target="_blank">csit-ref</a>
    <iframe width="1100" height="800" frameborder="0" scrolling="no" src="../_static/vpp/2n-clx-xxv710-64b-8t4c-l2-base-avf.html"></iframe>
    <p><br></p>
    </center>

64b-l2switching-base-dpdk
`````````````````````````

2t1c
::::

.. raw:: html

    <a name="64b-2t1c-base-dpdk"></a>
    <center>
    Links to builds:
    <a href="https://packagecloud.io/app/fdio/master/search?dist=ubuntu%2Fbionic" target="_blank">vpp-ref</a>,
    <a href="https://jenkins.fd.io/view/csit/job/csit-vpp-perf-mrr-daily-master-2n-clx" target="_blank">csit-ref</a>
    <iframe width="1100" height="800" frameborder="0" scrolling="no" src="../_static/vpp/2n-clx-xxv710-64b-2t1c-l2-base-dpdk.html"></iframe>
    <p><br></p>
    </center>

4t2c
::::

.. raw:: html

    <a name="64b-4t2c-base-dpdk"></a>
    <center>
    Links to builds:
    <a href="https://packagecloud.io/app/fdio/master/search?dist=ubuntu%2Fbionic" target="_blank">vpp-ref</a>,
    <a href="https://jenkins.fd.io/view/csit/job/csit-vpp-perf-mrr-daily-master-2n-clx" target="_blank">csit-ref</a>
    <iframe width="1100" height="800" frameborder="0" scrolling="no" src="../_static/vpp/2n-clx-xxv710-64b-4t2c-l2-base-dpdk.html"></iframe>
    <p><br></p>
    </center>

8t4c
::::

.. raw:: html

    <a name="64b-8t4c-base-dpdk"></a>
    <center>
    Links to builds:
    <a href="https://packagecloud.io/app/fdio/master/search?dist=ubuntu%2Fbionic" target="_blank">vpp-ref</a>,
    <a href="https://jenkins.fd.io/view/csit/job/csit-vpp-perf-mrr-daily-master-2n-clx" target="_blank">csit-ref</a>
    <iframe width="1100" height="800" frameborder="0" scrolling="no" src="../_static/vpp/2n-clx-xxv710-64b-8t4c-l2-base-dpdk.html"></iframe>
    <p><br></p>
    </center>

64b-l2switching-base-scale-avf
``````````````````````````````

2t1c
::::

.. raw:: html

    <a name="64b-2t1c-scale-avf"></a>
    <center>
    Links to builds:
    <a href="https://packagecloud.io/app/fdio/master/search?dist=ubuntu%2Fbionic" target="_blank">vpp-ref</a>,
    <a href="https://jenkins.fd.io/view/csit/job/csit-vpp-perf-mrr-daily-master-2n-clx" target="_blank">csit-ref</a>
    <iframe width="1100" height="800" frameborder="0" scrolling="no" src="../_static/vpp/2n-clx-xxv710-64b-2t1c-l2-base-scale-avf.html"></iframe>
    <p><br></p>
    </center>

4t2c
::::

.. raw:: html

    <a name="64b-4t2c-scale-avf"></a>
    <center>
    Links to builds:
    <a href="https://packagecloud.io/app/fdio/master/search?dist=ubuntu%2Fbionic" target="_blank">vpp-ref</a>,
    <a href="https://jenkins.fd.io/view/csit/job/csit-vpp-perf-mrr-daily-master-2n-clx" target="_blank">csit-ref</a>
    <iframe width="1100" height="800" frameborder="0" scrolling="no" src="../_static/vpp/2n-clx-xxv710-64b-4t2c-l2-base-scale-avf.html"></iframe>
    <p><br></p>
    </center>

8t4c
::::

.. raw:: html

    <a name="64b-8t4c-scale-avf"></a>
    <center>
    Links to builds:
    <a href="https://packagecloud.io/app/fdio/master/search?dist=ubuntu%2Fbionic" target="_blank">vpp-ref</a>,
    <a href="https://jenkins.fd.io/view/csit/job/csit-vpp-perf-mrr-daily-master-2n-clx" target="_blank">csit-ref</a>
    <iframe width="1100" height="800" frameborder="0" scrolling="no" src="../_static/vpp/2n-clx-xxv710-64b-8t4c-l2-base-scale-avf.html"></iframe>
    <p><br></p>
    </center>

64b-l2switching-base-scale-dpdk
```````````````````````````````

2t1c
::::

.. raw:: html

    <a name="64b-2t1c-scale-dpdk"></a>
    <center>
    Links to builds:
    <a href="https://packagecloud.io/app/fdio/master/search?dist=ubuntu%2Fbionic" target="_blank">vpp-ref</a>,
    <a href="https://jenkins.fd.io/view/csit/job/csit-vpp-perf-mrr-daily-master-2n-clx" target="_blank">csit-ref</a>
    <iframe width="1100" height="800" frameborder="0" scrolling="no" src="../_static/vpp/2n-clx-xxv710-64b-2t1c-l2-base-scale-dpdk.html"></iframe>
    <p><br></p>
    </center>

4t2c
::::

.. raw:: html

    <a name="64b-4t2c-scale-dpdk"></a>
    <center>
    Links to builds:
    <a href="https://packagecloud.io/app/fdio/master/search?dist=ubuntu%2Fbionic" target="_blank">vpp-ref</a>,
    <a href="https://jenkins.fd.io/view/csit/job/csit-vpp-perf-mrr-daily-master-2n-clx" target="_blank">csit-ref</a>
    <iframe width="1100" height="800" frameborder="0" scrolling="no" src="../_static/vpp/2n-clx-xxv710-64b-4t2c-l2-base-scale-dpdk.html"></iframe>
    <p><br></p>
    </center>

8t4c
::::

.. raw:: html

    <a name="64b-8t4c-scale-dpdk"></a>
    <center>
    Links to builds:
    <a href="https://packagecloud.io/app/fdio/master/search?dist=ubuntu%2Fbionic" target="_blank">vpp-ref</a>,
    <a href="https://jenkins.fd.io/view/csit/job/csit-vpp-perf-mrr-daily-master-2n-clx" target="_blank">csit-ref</a>
    <iframe width="1100" height="800" frameborder="0" scrolling="no" src="../_static/vpp/2n-clx-xxv710-64b-8t4c-l2-base-scale-dpdk.html"></iframe>
    <p><br></p>
    </center>

64b-l2switching-base-scale-af_xdp
`````````````````````````````````

2t1c
::::

.. raw:: html

    <a name="64b-2t1c-base-af_xdp"></a>
    <a name="64b-2t1c-scale-af_xdp"></a>
    <center>
    Links to builds:
    <a href="https://packagecloud.io/app/fdio/master/search?dist=ubuntu%2Fbionic" target="_blank">vpp-ref</a>,
    <a href="https://jenkins.fd.io/view/csit/job/csit-vpp-perf-mrr-daily-master-2n-clx" target="_blank">csit-ref</a>
    <iframe width="1100" height="800" frameborder="0" scrolling="no" src="../_static/vpp/2n-clx-xxv710-64b-2t1c-l2-base-scale-af_xdp.html"></iframe>
    <p><br></p>
    </center>

4t2c
::::

.. raw:: html

    <a name="64b-4t2c-base-af_xdp"></a>
    <a name="64b-4t2c-scale-af_xdp"></a>
    <center>
    Links to builds:
    <a href="https://packagecloud.io/app/fdio/master/search?dist=ubuntu%2Fbionic" target="_blank">vpp-ref</a>,
    <a href="https://jenkins.fd.io/view/csit/job/csit-vpp-perf-mrr-daily-master-2n-clx" target="_blank">csit-ref</a>
    <iframe width="1100" height="800" frameborder="0" scrolling="no" src="../_static/vpp/2n-clx-xxv710-64b-4t2c-l2-base-scale-af_xdp.html"></iframe>
    <p><br></p>
    </center>

8t4c
::::

.. raw:: html

    <a name="64b-8t4c-base-af_xdp"></a>
    <a name="64b-8t4c-scale-af_xdp"></a>
    <center>
    Links to builds:
    <a href="https://packagecloud.io/app/fdio/master/search?dist=ubuntu%2Fbionic" target="_blank">vpp-ref</a>,
    <a href="https://jenkins.fd.io/view/csit/job/csit-vpp-perf-mrr-daily-master-2n-clx" target="_blank">csit-ref</a>
    <iframe width="1100" height="800" frameborder="0" scrolling="no" src="../_static/vpp/2n-clx-xxv710-64b-8t4c-l2-base-scale-af_xdp.html"></iframe>
    <p><br></p>
    </center>