aboutsummaryrefslogtreecommitdiffstats
path: root/topologies/available/2n_hw_testbed1.yaml.example
blob: ee2faaf5fdf00987e1a042927387fe43b91d79aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33

@media only all and (prefers-color-scheme: dark) {
.highlight .hll { background-color: #49483e }
.highlight .c { color: #75715e } /* Comment */
.highlight .err { color: #960050; background-color: #1e0010 } /* Error */
.highlight .k { color: #66d9ef } /* Keyword */
.highlight .l { color: #ae81ff } /* Literal */
.highlight .n { color: #f8f8f2 } /* Name */
.highlight .o { color: #f92672 } /* Operator */
.highlight .p { color: #f8f8f2 } /* Punctuation */
.highlight .ch { color: #75715e } /* Comment.Hashbang */
.highlight .cm { color: #75715e } /* Comment.Multiline */
.highlight .cp { color: #75715e } /* Comment.Preproc */
.highlight .cpf { color: #75715e } /* Comment.PreprocFile */
.highlight .c1 { color: #75715e } /* Comment.Single */
.highlight .cs { color: #75715e } /* Comment.Special */
.highlight .gd { color: #f92672 } /* Generic.Deleted */
.highlight .ge { font-style: ital
# Copyright (c) 2018 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.

# Example file of topology

---
metadata:
  version: 0.1
  schema: # list of schema files against which to validate
    - resources/topology_schemas/2_node_topology.sch.yaml
    - resources/topology_schemas/topology.sch.yaml
  tags: [hw, 2-node]

nodes:
  TG:
    type: TG
    host: 10.0.0.3
    arch: x86_64
    port: 22
    username: lab
    password: lab
    interfaces:
      port3:
        mac_address: "08:00:27:35:59:04"
        pci_address: "0000:00:08.0"
        link: link1
        model: Intel-X553
      port5:
        mac_address: "08:00:27:46:2b:4c"
        pci_address: "0000:00:09.0"
        link: link2
        model: Intel-X553
  DUT1:
    type: DUT
    host: 10.0.0.1
    arch: x86_64
    port: 22
    username: lab
    password: lab
    uio_driver: vfio-pci
    interfaces:
      port1:
        mac_address: "08:00:27:ae:29:2b"
        pci_address: "0000:00:08.0"
        link: link1
        model: Intel-X553
      port3:
        mac_address: "08:00:27:f3:be:f0"
        pci_address: "0000:00:09.0"
        link: link2
        model: Intel-X553
t;vppinfra/error.h> #include <" plugin-name "/" plugin-name ".h> typedef struct { u32 sw_if_index; u32 next_index; } " plugin-name "_trace_t; #ifndef CLIB_MARCH_VARIANT /* packet trace format function */ static u8 * format_" plugin-name "_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 *); " plugin-name "_trace_t * t = va_arg (*args, " plugin-name "_trace_t *); s = format (s, \"" PLUGIN-NAME ": sw_if_index %d, next index %d\\n\", t->sw_if_index, t->next_index); return s; } vlib_node_registration_t " plugin-name "_node; #endif /* CLIB_MARCH_VARIANT */ #define foreach_" plugin-name "_error \\ _(SWAPPED, \"Mac swap packets processed\") typedef enum { #define _(sym,str) " PLUGIN-NAME "_ERROR_##sym, foreach_" plugin-name "_error #undef _ " PLUGIN-NAME "_N_ERROR, } " plugin-name "_error_t; #ifndef CLIB_MARCH_VARIANT static char * " plugin-name "_error_strings[] = { #define _(sym,string) string, foreach_" plugin-name "_error #undef _ }; #endif /* CLIB_MARCH_VARIANT */ typedef enum { " PLUGIN-NAME "_NEXT_DROP, " PLUGIN-NAME "_N_NEXT, } " plugin-name "_next_t; always_inline uword "plugin-name"_inline (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame, int is_ip4, int is_trace) { u32 n_left_from, *from; vlib_buffer_t *bufs[VLIB_FRAME_SIZE], **b; u16 nexts[VLIB_FRAME_SIZE], *next; from = vlib_frame_vector_args (frame); n_left_from = frame->n_vectors; vlib_get_buffers (vm, from, bufs, n_left_from); b = bufs; next = nexts; while (n_left_from >= 4) { /* Prefetch next iteration. */ if (PREDICT_TRUE (n_left_from >= 8)) { vlib_prefetch_buffer_header (b[4], STORE); vlib_prefetch_buffer_header (b[5], STORE); vlib_prefetch_buffer_header (b[6], STORE); vlib_prefetch_buffer_header (b[7], STORE); CLIB_PREFETCH (b[4]->data, CLIB_CACHE_LINE_BYTES, STORE); CLIB_PREFETCH (b[5]->data, CLIB_CACHE_LINE_BYTES, STORE); CLIB_PREFETCH (b[6]->data, CLIB_CACHE_LINE_BYTES, STORE); CLIB_PREFETCH (b[7]->data, CLIB_CACHE_LINE_BYTES, STORE); } /* $$$$ process 4x pkts right here */ next[0] = 0; next[1] = 0; next[2] = 0; next[3] = 0; if (is_trace) { if (b[0]->flags & VLIB_BUFFER_IS_TRACED) { "plugin-name"_trace_t *t = vlib_add_trace (vm, node, b[0], sizeof (*t)); t->next_index = next[0]; t->sw_if_index = vnet_buffer(b[0])->sw_if_index[VLIB_RX]; } if (b[1]->flags & VLIB_BUFFER_IS_TRACED) { "plugin-name"_trace_t *t = vlib_add_trace (vm, node, b[1], sizeof (*t)); t->next_index = next[1]; t->sw_if_index = vnet_buffer(b[1])->sw_if_index[VLIB_RX]; } if (b[2]->flags & VLIB_BUFFER_IS_TRACED) { "plugin-name"_trace_t *t = vlib_add_trace (vm, node, b[2], sizeof (*t)); t->next_index = next[2]; t->sw_if_index = vnet_buffer(b[2])->sw_if_index[VLIB_RX]; } if (b[3]->flags & VLIB_BUFFER_IS_TRACED) { "plugin-name"_trace_t *t = vlib_add_trace (vm, node, b[3], sizeof (*t)); t->next_index = next[3]; t->sw_if_index = vnet_buffer(b[3])->sw_if_index[VLIB_RX]; } } b += 4; next += 4; n_left_from -= 4; } while (n_left_from > 0) { /* $$$$ process 1 pkt right here */ next[0] = 0; if (is_trace) { if (b[0]->flags & VLIB_BUFFER_IS_TRACED) { "plugin-name"_trace_t *t = vlib_add_trace (vm, node, b[0], sizeof (*t)); t->next_index = next[0]; t->sw_if_index = vnet_buffer(b[0])->sw_if_index[VLIB_RX]; } } b += 1; next += 1; n_left_from -= 1; } vlib_buffer_enqueue_to_next (vm, node, from, nexts, frame->n_vectors); return frame->n_vectors; } VLIB_NODE_FN ("plugin-name"_node) (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame) { if (PREDICT_FALSE (node->flags & VLIB_NODE_FLAG_TRACE)) return " plugin-name "_inline (vm, node, frame, 1 /* is_ip4 */ , 1 /* is_trace */ ); else return " plugin-name "_inline (vm, node, frame, 1 /* is_ip4 */ , 0 /* is_trace */ ); } /* *INDENT-OFF* */ #ifndef CLIB_MARCH_VARIANT VLIB_REGISTER_NODE (" plugin-name "_node) = { .name = \"" plugin-name "\", .vector_size = sizeof (u32), .format_trace = format_" plugin-name "_trace, .type = VLIB_NODE_TYPE_INTERNAL, .n_errors = ARRAY_LEN(" plugin-name "_error_strings), .error_strings = " plugin-name "_error_strings, .n_next_nodes = " PLUGIN-NAME "_N_NEXT, /* edit / add dispositions here */ .next_nodes = { [" PLUGIN-NAME "_NEXT_DROP] = \"error-drop\", }, }; #endif /* CLIB_MARCH_VARIANT */ /* *INDENT-ON* */ /* * fd.io coding-style-patch-verification: " capital-oh-en " * * Local Variables: * eval: (c-set-style \"gnu\") * End: */ ")