summaryrefslogtreecommitdiffstats
path: root/src/vnet/ip/reass/ip6_sv_reass.c
AgeCommit message (Expand)AuthorFilesLines
2021-04-01ip: extend show cmd of ip reassembly configurationAnton Nikolaev1-0/+4
2020-12-27ip: Use full reassembly for fragments in ip6-localNeale Ranns1-2/+0
2020-12-16ip: fix possible missing trace indexesKlement Sekera1-0/+7
2020-12-14misc: move to new pool_foreach macrosDamjan Marion1-4/+4
2020-06-10ip: reassembly: LRU algorithm should eliminate the longest unused nodeszhengdelun1-1/+1
2020-04-29ip: use thread local vm instead of thread main for vlib_time_now callsTom Seidenberg1-1/+1
2020-04-24ip: reassembly: improve type safetyKlement Sekera1-9/+8
2020-04-06ip: reassembly: don't set error if no errorKlement Sekera1-3/+2
2020-02-10ip: more detailed show reassembly commandsVladimir Ratnikov1-2/+9
2020-01-15ip: align reass.save_rewrite_lengthv20.05-rc0Klement Sekera1-9/+0
2020-01-03nat: use SVRKlement Sekera1-23/+77
2019-12-16vppinfra: bihash walk cb typedef and continue/stop controlsNeale Ranns1-1/+2
2019-12-13ip: SVR: fix wrong return valueKlement Sekera1-1/+1
2019-10-28ip: reassembly fix sanity checksKlement Sekera1-2/+2
2019-10-07ip: remove dead code in ip6-svrKlement Sekera1-27/+0
2019-10-07ip: reassembly add missing gotoKlement Sekera1-0/+1
2019-10-07ip: reassembly remove dead codeKlement Sekera1-8/+0
2019-09-30ip: svr: fix feature refcountsKlement Sekera1-7/+10
2019-09-26ip: add shallow virtual reassembly functionalityKlement Sekera1-0/+1332
olor: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
/*
 * Copyright (c) 2017 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.
 */
#ifndef SRC_VNET_SESSION_SESSION_DEBUG_H_
#define SRC_VNET_SESSION_SESSION_DEBUG_H_

#include <vnet/session/transport.h>
#include <vlib/vlib.h>

#define foreach_session_dbg_evt		\
  _(ENQ, "enqueue")			\
  _(DEQ, "dequeue")			\
  _(DEQ_NODE, "dequeue")		\
  _(POLL_GAP_TRACK, "poll gap track")	\

typedef enum _session_evt_dbg
{
#define _(sym, str) SESSION_EVT_##sym,
  foreach_session_dbg_evt
#undef _
} session_evt_dbg_e;

#define SESSION_DBG (0)
#define SESSION_DEQ_NODE_EVTS (0)
#define SESSION_EVT_POLL_DBG (1)

#if TRANSPORT_DEBUG && SESSION_DBG

#define DEC_SESSION_ETD(_s, _e, _size)					\
  struct								\
  {									\
    u32 data[_size];							\
  } * ed;								\
  transport_proto_vft_t *vft = 						\
      session_get_transport_vft (_s->session_type);			\
  transport_connection_t *_tc = 					\
      vft->get_connection (_s->connection_index, _s->thread_index);	\
  ed = ELOG_TRACK_DATA (&vlib_global_main.elog_main,			\
			_e, _tc->elog_track)

#define DEC_SESSION_ED(_e, _size)					\
  struct								\
  {									\
    u32 data[_size];							\
  } * ed;								\
  ed = ELOG_DATA (&vlib_global_main.elog_main, _e)

#define SESSION_EVT_DEQ_HANDLER(_s, _body)				\
{									\
  ELOG_TYPE_DECLARE (_e) =						\
  {									\
    .format = "deq: id %d len %d rd %d wnd %d",				\
    .format_args = "i4i4i4i4",						\
  };									\
  DEC_SESSION_ETD(_s, _e, 4);						\
  do { _body; } while (0);						\
}

#define SESSION_EVT_ENQ_HANDLER(_s, _body)				\
{									\
  ELOG_TYPE_DECLARE (_e) =						\
  {									\
    .format = "enq: id %d length %d",					\
    .format_args = "i4i4",						\
  };									\
  DEC_SESSION_ETD(_s, _e, 2);						\
  do { _body; } while (0);						\
}

#if SESSION_DEQ_NODE_EVTS
#define SESSION_EVT_DEQ_NODE_HANDLER(_node_evt)				\
{									\
  ELOG_TYPE_DECLARE (_e) =						\
  {									\
    .format = "deq-node: %s",						\
    .format_args = "t4",                                      		\
    .n_enum_strings = 2,                                        	\
    .enum_strings = {                                           	\
      "start",                                             		\
      "end",                                              		\
    },									\
  };									\
  DEC_SESSION_ED(_e, 1);						\
  ed->data[0] = _node_evt;						\
}
#else
#define SESSION_EVT_DEQ_NODE_HANDLER(_node_evt)
#endif

#if SESSION_DBG && SESSION_EVT_POLL_DBG
#define SESSION_EVT_POLL_GAP(_smm, _my_thread_index)			\
{									\
  ELOG_TYPE_DECLARE (_e) =						\
  {									\
    .format = "nixon-gap: %d MS",					\
    .format_args = "i4",						\
  };									\
  DEC_SESSION_ED(_e, 1);						\
  ed->data[0] =	(u32) ((now -						\
    _smm->last_event_poll_by_thread[my_thread_index])*1000.0);		\
}
#define SESSION_EVT_POLL_GAP_TRACK_HANDLER(_smm, _my_thread_index)	\
{									\
  if (PREDICT_TRUE(							\
	      smm->last_event_poll_by_thread[my_thread_index] != 0.0))	\
    if (now > smm->last_event_poll_by_thread[_my_thread_index] + 500e-6)\
	SESSION_EVT_POLL_GAP(smm, my_thread_index);			\
  _smm->last_event_poll_by_thread[my_thread_index] = now;		\
}

#else
#define SESSION_EVT_POLL_GAP(_smm, _my_thread_index)
#define SESSION_EVT_POLL_GAP_TRACK_HANDLER(_smm, _my_thread_index)
#endif

#define CONCAT_HELPER(_a, _b) _a##_b
#define CC(_a, _b) CONCAT_HELPER(_a, _b)
#define SESSION_EVT_DBG(_evt, _args...) CC(_evt, _HANDLER)(_args)

#else
#define SESSION_EVT_DBG(_evt, _args...)
#endif

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