aboutsummaryrefslogtreecommitdiffstats
path: root/src/vcl/vcl_private.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2020-12-10 18:52:40 -0800
committerFlorin Coras <florin.coras@gmail.com>2020-12-29 21:04:39 +0000
commit14f066e95100cfdcd5f0531e35ba84b7b859a00a (patch)
tree53118cd229784f7a38bc5a4d06f2f3591d43c996 /src/vcl/vcl_private.c
parentb462418890240b2e38dbf522f9dd0196b79e0fa8 (diff)
svm vcl: allow random offsets for fifo segments in apps
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I1658a9c19d8eae4c9a42c0a111d4ad343b8eb8a4
Diffstat (limited to 'src/vcl/vcl_private.c')
-rw-r--r--src/vcl/vcl_private.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/vcl/vcl_private.c b/src/vcl/vcl_private.c
index 5b412351c50..a140e5ea557 100644
--- a/src/vcl/vcl_private.c
+++ b/src/vcl/vcl_private.c
@@ -379,7 +379,6 @@ vcl_segment_attach_session (uword segment_handle, uword rxf_offset,
uword txf_offset, uword mq_offset, u8 is_ct,
vcl_session_t *s)
{
- svm_fifo_shared_t *rxsf, *txsf;
u32 fs_index, eqs_index;
svm_fifo_t *rxf, *txf;
fifo_segment_t *fs;
@@ -393,21 +392,18 @@ vcl_segment_attach_session (uword segment_handle, uword rxf_offset,
return -1;
}
- if (mq_offset != (uword) ~0)
+ if (!is_ct && mq_offset != (uword) ~0)
{
eqs_handle = vcl_vpp_worker_segment_handle (0);
eqs_index = vcl_segment_table_lookup (eqs_handle);
ASSERT (eqs_index != VCL_INVALID_SEGMENT_INDEX);
}
- rxsf = uword_to_pointer (rxf_offset, svm_fifo_shared_t *);
- txsf = uword_to_pointer (txf_offset, svm_fifo_shared_t *);
-
clib_rwlock_reader_lock (&vcm->segment_table_lock);
fs = fifo_segment_get_segment (&vcm->segment_main, fs_index);
- rxf = fifo_segment_alloc_fifo_w_shared (fs, rxsf);
- txf = fifo_segment_alloc_fifo_w_shared (fs, txsf);
+ rxf = fifo_segment_alloc_fifo_w_offset (fs, rxf_offset);
+ txf = fifo_segment_alloc_fifo_w_offset (fs, txf_offset);
if (!is_ct && mq_offset != (uword) ~0)
{
@@ -420,8 +416,8 @@ vcl_segment_attach_session (uword segment_handle, uword rxf_offset,
if (!is_ct)
{
- rxsf->client_session_index = s->session_index;
- txsf->client_session_index = s->session_index;
+ rxf->shr->client_session_index = s->session_index;
+ txf->shr->client_session_index = s->session_index;
rxf->client_thread_index = vcl_get_worker_index ();
txf->client_thread_index = vcl_get_worker_index ();
s->rx_fifo = rxf;
bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
/*
 * Copyright (c) 2016 Cisco and/or its affiliates.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at:
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/*
 * ioam_export_thread.c
 */
#include <vnet/api_errno.h>
#include <vppinfra/pool.h>
#include <ioam/export-common/ioam_export.h>

static vlib_node_registration_t vxlan_gpe_ioam_export_process_node;
extern ioam_export_main_t vxlan_gpe_ioam_export_main;

static uword
vxlan_gpe_ioam_export_process (vlib_main_t * vm,
			       vlib_node_runtime_t * rt, vlib_frame_t * f)
{
  return (ioam_export_process_common (&vxlan_gpe_ioam_export_main,
				      vm, rt, f,
				      vxlan_gpe_ioam_export_process_node.index));
}


/* *INDENT-OFF* */
VLIB_REGISTER_NODE (vxlan_gpe_ioam_export_process_node, static) =
{
 .function = vxlan_gpe_ioam_export_process,
 .type = VLIB_NODE_TYPE_PROCESS,
 .name = "vxlan-gpe-ioam-export-process",
};
/* *INDENT-ON* */

/*
 * fd.io coding-style-patch-verification: ON
 *
 * Local Variables:
 * eval: (c-set-style "gnu")
 * End:
 */