aboutsummaryrefslogtreecommitdiffstats
path: root/resources/templates/honeycomb
diff options
context:
space:
mode:
authorVratko Polak <vrpolak@cisco.com>2024-04-18 14:45:29 +0200
committerVratko Polak <vrpolak@cisco.com>2024-04-19 11:04:31 +0000
commit953b3239a4f241093dc411d164b243dc088f9d0b (patch)
treef52639874dc389abf70d81579e013ce83489c955 /resources/templates/honeycomb
parent44ab3dadf61808df3bb54ba462ba7fb9e669aec2 (diff)
feat(jobspec): Unify soak jobspecsoper-240415
Added 9 common tests (only one for non-default NIC+driver), 4 specific to nodeness (ASTF for 2-node, IPsec for 3-node). + First round, we can add more tests when duration is stable. - Left TODOs for possible improvements. Change-Id: I4724e3a05af0dfbf2ca0c146f1bbd4665d9e0cf0 Signed-off-by: Vratko Polak <vrpolak@cisco.com> (cherry picked from commit fb09f3eae0aa7c88e700d3e49b5dd8763979d04c)
Diffstat (limited to 'resources/templates/honeycomb')
0 files changed, 0 insertions, 0 deletions
88 } /* Comment.PreprocFile */ .highlight .c1 { color: #888888 } /* Comment.Single */ .highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */ .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ .highlight .ge { font-style: italic } /* Generic.Emph */ .highlight .gr { color: #aa0000 } /* Generic.Error */ .highlight .gh { color: #333333 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* 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 */ }
/*
 *------------------------------------------------------------------
 * ip_path_mtu.c
 *
 * Copyright (c) 2020 Graphiant.
 * 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/ip/ip_path_mtu.h>
#include <vnet/ip/ip_frag.h>

typedef enum
{
  IP_PMTU_DROP,
  IP_PMTU_N_NEXT,
} ip_pmtu_next_t;

typedef struct ip_pmtu_trace_t_
{
  u16 pmtu;
  u16 packet_size;
} ip_pmtu_trace_t;

static u8 *
format_ip_pmtu_trace (u8 *s, va_list *args)
{
  CLIB_UNUSED (vlib_main_t * vm) = va_arg (*args, vlib_main_t *);
  CLIB_UNUSED (vlib_node_t * node) = va_arg (*args, vlib_node_t *);
  ip_pmtu_trace_t *t = va_arg (*args, ip_pmtu_trace_t *);

  s = format (s, "path mtu:%d packet size:%d", t->pmtu, t->packet_size);

  return s;
}

static inline uword
ip_pmtu_dpo_inline (vlib_main_t *vm, vlib_node_runtime_t *node,
		    vlib_frame_t *frame, ip_address_family_t af)
{
  u32 n_left_from, *from, next_index, *to_next, n_left_to_next;

  from = vlib_frame_vector_args (frame);
  n_left_from = frame->n_vectors;
  next_index = node->cached_next_index;

  u32 *buffer = 0;

  while (n_left_from > 0)
    {
      vlib_get_next_frame (vm, node, next_index, to_next, n_left_to_next);

      while (n_left_from > 0 && n_left_to_next > 0)
	{
	  const ip_pmtu_dpo_t *ipm0;
	  u32 pi0, *frag_from, frag_left;
	  vlib_buffer_t *p0;
	  ip_frag_error_t error0;
	  u16 next0;

	  /*
	   * Note: The packet is not enqueued now. It is instead put
	   * in a vector where other fragments will be put as well.
	   */
	  pi0 = from[0];
	  from += 1;
	  n_left_from -= 1;

	  p0 = vlib_get_buffer (vm, pi0);
	  ipm0 = ip_pmtu_dpo_get (vnet_buffer (p0)->ip.adj_index[VLIB_TX]);
	  vnet_buffer (p0)->ip.adj_index[VLIB_TX] = ipm0->ipm_dpo.dpoi_index;
	  next0 = ipm0->ipm_dpo.dpoi_next_node;

	  if (PREDICT_FALSE (p0->flags & VLIB_BUFFER_IS_TRACED))
	    {
	      ip_pmtu_trace_t *t;
	      t = vlib_add_trace (vm, node, p0, sizeof (*t));
	      t->pmtu = ipm0->ipm_pmtu;
	      t->packet_size = vlib_buffer_length_in_chain (vm, p0);
	    }

	  if (AF_IP6 == af)
	    error0 =
	      ip6_frag_do_fragment (vm, pi0, ipm0->ipm_pmtu, 0, &buffer);
	  else
	    error0 =
	      ip4_frag_do_fragment (vm, pi0, ipm0->ipm_pmtu, 0, &buffer);

	  if (AF_IP4 == af && error0 == IP_FRAG_ERROR_DONT_FRAGMENT_SET)
	    {
	      icmp4_error_set_vnet_buffer (
		p0, ICMP4_destination_unreachable,
		ICMP4_destination_unreachable_fragmentation_needed_and_dont_fragment_set,
		ipm0->ipm_pmtu);
	      next0 = IP_FRAG_NEXT_ICMP_ERROR;
	    }
	  else
	    {
	      next0 =
		(error0 == IP_FRAG_ERROR_NONE ? next0 : IP_FRAG_NEXT_DROP);
	    }

	  if (error0 == IP_FRAG_ERROR_NONE)
	    {
	      /* Free original buffer chain */
	      vlib_buffer_free_one (vm, pi0); /* Free original packet */
	    }
	  else
	    {
	      vlib_error_count (vm, node->node_index, error0, 1);
	      vec_add1 (buffer, pi0); /* Get rid of the original buffer */
	    }

	  /* Send fragments that were added in the frame */
	  frag_from = buffer;
	  frag_left = vec_len (buffer);

	  while (frag_left > 0)
	    {
	      while (frag_left > 0 && n_left_to_next > 0)
		{
		  u32 i;
		  i = to_next[0] = frag_from[0];
		  frag_from += 1;
		  frag_left -= 1;
		  to_next += 1;
		  n_left_to_next -= 1;

		  vlib_get_buffer (vm, i)->error = node->errors[error0];
		  vlib_validate_buffer_enqueue_x1 (
		    vm, node, next_index, to_next, n_left_to_next, i, next0);
		}
	      vlib_put_next_frame (vm, node, next_index, n_left_to_next);
	      vlib_get_next_frame (vm, node, next_index, to_next,
				   n_left_to_next);
	    }
	  vec_reset_length (buffer);
	}
      vlib_put_next_frame (vm, node, next_index, n_left_to_next);
    }
  vec_free (buffer);

  return frame->n_vectors;
}

// clang-format off

VLIB_NODE_FN (ip4_ip_pmtu_dpo_node) (vlib_main_t *vm,
                                     vlib_node_runtime_t *node,
                                     vlib_frame_t *from_frame)
{
  return (ip_pmtu_dpo_inline (vm, node, from_frame, 0));
}

VLIB_NODE_FN (ip6_ip_pmtu_dpo_node) (vlib_main_t *vm,
                                     vlib_node_runtime_t *node,
                                     vlib_frame_t *from_frame)
{
  return (ip_pmtu_dpo_inline (vm, node, from_frame, 1));
}

VLIB_REGISTER_NODE (ip4_ip_pmtu_dpo_node) = {
  .name = "ip4-pmtu-dpo",
  .vector_size = sizeof (u32),
  .format_trace = format_ip_pmtu_trace,
  .n_errors = IP_FRAG_N_ERROR,
  .error_counters = ip_frag_error_counters,
  .n_next_nodes = IP_PMTU_N_NEXT,
  .next_nodes =
  {
   [IP_PMTU_DROP] = "ip4-drop",
  }
};
VLIB_REGISTER_NODE (ip6_ip_pmtu_dpo_node) = {
  .name = "ip6-pmtu-dpo",
  .vector_size = sizeof (u32),
  .format_trace = format_ip_pmtu_trace,
  .n_errors = IP_FRAG_N_ERROR,
  .error_counters = ip_frag_error_counters,
  .n_next_nodes = IP_PMTU_N_NEXT,
  .next_nodes =
  {
   [IP_PMTU_DROP] = "ip6-drop",
  }
};

// clang-format on

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