aboutsummaryrefslogtreecommitdiffstats
path: root/src/svm/message_queue.c
AgeCommit message (Expand)AuthorFilesLines
2019-09-20session: fix msg freeing on errorNathan Skrzypczak1-5/+0
2019-07-29session: fix vpp to app msg generationFlorin Coras1-2/+4
2019-06-18session: fix memory out of bound issueLijian.Zhang1-1/+1
2018-10-19vppinfra: add atomic macros for __sync builtinsSirshak Das1-3/+3
2018-09-12vcl: improve read and fifo event handlingFlorin Coras1-2/+2
2018-08-10vcl: support for eventfd mq signalingFlorin Coras1-0/+33
2018-08-03svm: add support for eventfd signaling to queueFlorin Coras1-7/+9
2018-07-27vcl: use events for epoll/select/read/writeFlorin Coras1-11/+11
2018-07-18svm: make message queue more compactFlorin Coras1-16/+29
2018-07-17session: send ctrl msg over mqFlorin Coras1-1/+2
2018-07-17session: use msg queue for eventsFlorin Coras1-18/+84
2018-07-08session/svm: fix coverity warningsFlorin Coras1-2/+5
2018-07-06svm: add unidirectional message queueFlorin Coras1-0/+159
88888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: 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) 2019 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.
 */
#include <vnet/tcp/tcp_debug.h>

tcp_dbg_main_t tcp_dbg_main;

void
tcp_evt_track_register (elog_track_t * et)
{
  tcp_dbg_main_t *tdm = &tcp_dbg_main;
  u32 fl_len, track_index;

  fl_len = vec_len (tdm->free_track_indices);
  if (fl_len)
    {
      track_index = tdm->free_track_indices[fl_len - 1];
      _vec_len (tdm->free_track_indices) -= 1;
      et->track_index_plus_one = track_index + 1;
    }
  else
    elog_track_register (&vlib_global_main.elog_main, et);
}

static const char *tcp_evt_grp_str[] = {
#define _(sym, str) str,
  foreach_tcp_evt_grp
#undef _
};

static void
tcp_debug_show_groups (void)
{
  tcp_dbg_main_t *tdm = &tcp_dbg_main;
  vlib_main_t *vm = vlib_get_main ();
  int i = 0;

  vlib_cli_output (vm, "%-10s%-30s%-10s", "Index", "Group", "Level");

  for (i = 0; i < TCP_EVT_N_GRP; i++)
    vlib_cli_output (vm, "%-10d%-30s%-10d", i, tcp_evt_grp_str[i],
		     tdm->grp_dbg_lvl[i]);
}

static clib_error_t *
tcp_debug_fn (vlib_main_t * vm, unformat_input_t * input,
	      vlib_cli_command_t * cmd)
{
  unformat_input_t _line_input, *line_input = &_line_input;
  tcp_dbg_main_t *tdm = &tcp_dbg_main;
  u32 group = ~0, level = ~0;
  clib_error_t *error = 0;
  u8 is_show = 0;

  if (!TCP_DEBUG_ALWAYS)
    return clib_error_return (0, "must compile with TCP_DEBUG_ALWAYS set");

  if (!unformat_user (input, unformat_line_input, line_input))
    return clib_error_return (0, "expected enable | disable");

  while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
    {
      if (unformat (line_input, "show"))
	is_show = 1;
      else if (unformat (line_input, "group %d", &group))
	;
      else if (unformat (line_input, "level %d", &level))
	;
      else
	{
	  error = clib_error_return (0, "unknown input `%U'",
				     format_unformat_error, line_input);
	  goto done;
	}
    }

  if (is_show)
    {
      tcp_debug_show_groups ();
      goto done;
    }
  if (group >= TCP_EVT_N_GRP)
    {
      error = clib_error_return (0, "group out of bounds");
      goto done;
    }
  if (group == ~0 || level == ~0)
    {
      error = clib_error_return (0, "group and level must be set");
      goto done;
    }

  tdm->grp_dbg_lvl[group] = level;

done:

  unformat_free (line_input);
  return error;
}

/* *INDENT-OFF* */
VLIB_CLI_COMMAND (tcp_debug_command, static) =
{
  .path = "tcp debug",
  .short_help = "tcp [show] [debug group <N> level <N>]",
  .function = tcp_debug_fn,
};
/* *INDENT-ON* */

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