summaryrefslogtreecommitdiffstats
path: root/test/test_p2p_ethernet.py
AgeCommit message (Collapse)AuthorFilesLines
2019-11-08tests: python3 use byte strings in raw()Ole Troan1-3/+3
Raw('\xaf) and Raw(b'\xaf) are two quite different things in python 2 versus 3. In most cases this didn't make a difference, apart from those cases where length of payload actually mattered. Type: fix Signed-off-by: Ole Troan <ot@cisco.com> Change-Id: I3cba5c1486e436a3ca8aa10a7b393da75aa9f6b9
2019-11-05misc: Fix python scripts shebang lineRenato Botelho do Couto1-1/+1
Type: fix Since CentOS 8, RPM build script doesn't accept '#!/usr/bin/env python' as a valid shebang line. It requires scripts to explicitly chose between python2 or python3. Change all to use python3 as suggested by Paul Vinciguerra. Depends-On: https://gerrit.fd.io/r/23170 Signed-off-by: Renato Botelho do Couto <renato@netgate.com> Change-Id: Ie72af9f60fd0609e07f05b70f8d96e738b2754d1
2019-06-18fib: fib api updatesNeale Ranns1-23/+11
Enhance the route add/del APIs to take a set of paths rather than just one. Most unicast routing protocols calcualte all the available paths in one run of the algorithm so updating all the paths at once is beneficial for the client. two knobs control the behaviour: is_multipath - if set the the set of paths passed will be added to those that already exist, otherwise the set will replace them. is_add - add or remove the set is_add=0, is_multipath=1 and an empty set, results in deleting the route. It is also considerably faster to add multiple paths at once, than one at a time: vat# ip_add_del_route 1.1.1.1/32 count 100000 multipath via 10.10.10.11 100000 routes in .572240 secs, 174751.80 routes/sec vat# ip_add_del_route 1.1.1.1/32 count 100000 multipath via 10.10.10.12 100000 routes in .528383 secs, 189256.54 routes/sec vat# ip_add_del_route 1.1.1.1/32 count 100000 multipath via 10.10.10.13 100000 routes in .757131 secs, 132077.52 routes/sec vat# ip_add_del_route 1.1.1.1/32 count 100000 multipath via 10.10.10.14 100000 routes in .878317 secs, 113854.12 routes/sec vat# ip_route_add_del 1.1.1.1/32 count 100000 multipath via 10.10.10.11 via 10.10.10.12 via 10.10.10.13 via 10.10.10.14 100000 routes in .900212 secs, 111084.93 routes/sec Change-Id: I416b93f7684745099c1adb0b33edac58c9339c1a Signed-off-by: Neale Ranns <neale.ranns@cisco.com> Signed-off-by: Ole Troan <ot@cisco.com> Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-04-10Tests Cleanup: Fix missing calls to setUpClass/tearDownClass.Paul Vinciguerra1-0/+12
Continuation/Part 2 of https://gerrit.fd.io/r/#/c/17092/ Change-Id: Id0122d84eaf2c05d29e5be63a594d5e528ee7c9a Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-03-11Tests: use self.assertNotIn().Paul Vinciguerra1-7/+7
Many tests use self.assertEqual(error.find("failed"), -1) Use self.assertNotIn("failed", error) to provide more meaningful errors such as AssertionError: 'Failed' not found in '' instead of 0 != -1. Change-Id: I670acdc977b788b2cedf94cfeafc12097781463f Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-03-07VPP-1508: Python3 tests. Explicitly specify string formatting.Paul Vinciguerra1-1/+2
.format() doesn't understand what to do with binary values by default. Specify that we expect coersion to string. Change-Id: Ic4b697f70852124dc85ab231f76b7934d0d71f4d Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-03-04test framework: Fix wrapper functions to match API message names.Ole Troan1-9/+9
In preparation to remove the wrappers in vpp_papi_provider.py, ensure names used in tests match the actual API message names. Change-Id: I230ca4eb75aa727ff68d702e085a2edbbc6b6d19 Signed-off-by: Ole Troan <ot@cisco.com>
2018-12-18PAPI: Add MACAddress object wrapper for vl_api_mac_address_tOle Troan1-6/+6
Change the definition of vl_api_mac_address_t to an aliased type. Change-Id: I1434f316d0fad6a099592f39bceeb8faeaf1d134 Signed-off-by: Ole Troan <ot@cisco.com>
2018-12-10Test framework: StringIO fixes for Python3Ole Troan1-1/+1
Add 2/3 support to binarytomac and mactobinary and move to vpp_mac.py Change-Id: I3dc7e4a24486aee22140c781aae7e44e58935877 Signed-off-by: Ole Troan <ot@cisco.com>
2018-12-05VPP-1508: Python3 compatible printPaul Vinciguerra1-1/+2
Change-Id: I7d2597f2a9589f2463e213da6ca67b1b7593095e Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2018-11-08make test: p2p ethernet refactorKlement Sekera1-22/+2
Change-Id: I48b4b3eaa84e4174e4d0305594675bf983184fa0 Signed-off-by: Klement Sekera <ksekera@cisco.com>
2018-09-11GBP Endpoint UpdatesNeale Ranns1-1/+2
- common types on the API - endpoints keyed in various ways for DP lookup - conparison functions for VPP IP address types Change-Id: If7ec0bbc5cea71fd0983fe78987d147ec1bd7ec8 Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
2018-03-18Remove unnumbered configuration on interface deleteNeale Ranns1-20/+31
Change-Id: Iae5532c3d53e208831f3b2782242d9e59d367087 Signed-off-by: Neale Ranns <nranns@cisco.com>
2017-12-13make "test-all" target pass againGabriel Ganne1-34/+1
The "test-all" target is still never called as part of any continuous test (as it probably should) but at least it can now be expected to succeed. VXLAN-GPE: * decapsulate Ethernet to "l2-input" instead of "ethernet-input" otherwise the inner mac address get checked against the interface one (external) and packet gets dropped (mac mismatch) * set packet input sw_if_index to unicast vxlan tunnel for learning TEST: * VXLAN: * reduce the number of share tunnels: => reduce test duration by half => no functional change * VXLAN-GPE: * fix test TearDown() cli: command is "show vxlan-gpe" only * remove vxlan-gpe specific tests as the were a duplicated of the BridgeDomain one and already inherited. * disable test_mcast_rcv() and test_mcast_flood() tests * P2PEthernetAPI: * remove test: "create 100k of p2p subifs" there already is a "create 1k p2p subifs" so this one is a load test and not a unit test. See: lists.fd.io/pipermail/vpp-dev/2017-November/007280.html Change-Id: Icafb83769eb560cbdeb3dc6d1f1d3c23c0901cd9 Signed-off-by: Gabriel Ganne <gabriel.ganne@enea.com>
2017-08-08L2 over MPLSNeale Ranns1-8/+8
[support for VPWS/VPLS] - switch to using dpo_proto_t rather than fib_protocol_t in fib_paths so that we can describe L2 paths - VLIB nodes to handle pop/push of MPLS labels to L2 Change-Id: Id050d06a11fd2c9c1c81ce5a0654e6c5ae6afa6e Signed-off-by: Neale Ranns <nranns@cisco.com>
2017-08-01P2P EthernetPavel Kotucek1-0/+538
Change-Id: Idb97e573961b3bc2acdeef77582314590795f8c3 Signed-off-by: Pavel Kotucek <pkotucek@cisco.com>
nd-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) 2015 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.
 */
/*
  Copyright (c) 2008 Eliot Dresselhaus

  Permission is hereby granted, free of charge, to any person obtaining
  a copy of this software and associated documentation files (the
  "Software"), to deal in the Software without restriction, including
  without limitation the rights to use, copy, modify, merge, publish,
  distribute, sublicense, and/or sell copies of the Software, and to
  permit persons to whom the Software is furnished to do so, subject to
  the following conditions:

  The above copyright notice and this permission notice shall be
  included in all copies or substantial portions of the Software.

  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

#ifndef included_vector_funcs_h
#define included_vector_funcs_h

#include <vppinfra/byte_order.h>

/* Addition/subtraction. */
#if CLIB_VECTOR_WORD_BITS == 128
#define u8x_add u8x16_add
#define u16x_add u16x8_add
#define u32x_add u32x4_add
#define u64x_add u64x2_add
#define i8x_add i8x16_add
#define i16x_add i16x8_add
#define i32x_add i32x4_add
#define i64x_add i64x2_add
#define u8x_sub u8x16_sub
#define u16x_sub u16x8_sub
#define u32x_sub u32x4_sub
#define u64x_sub u64x2_sub
#define i8x_sub i8x16_sub
#define i16x_sub i16x8_sub
#define i32x_sub i32x4_sub
#define i64x_sub i64x2_sub
#endif

#if CLIB_VECTOR_WORD_BITS == 64
#define u8x_add u8x8_add
#define u16x_add u16x4_add
#define u32x_add u32x2_add
#define i8x_add i8x8_add
#define i16x_add i16x4_add
#define i32x_add i32x2_add
#define u8x_sub u8x8_sub
#define u16x_sub u16x4_sub
#define u32x_sub u32x2_sub
#define i8x_sub i8x8_sub
#define i16x_sub i16x4_sub
#define i32x_sub i32x2_sub
#endif

/* Saturating addition/subtraction. */
#if CLIB_VECTOR_WORD_BITS == 128
#define u8x_add_saturate u8x16_add_saturate
#define u16x_add_saturate u16x8_add_saturate
#define i8x_add_saturate i8x16_add_saturate
#define i16x_add_saturate i16x8_add_saturate
#define u8x_sub_saturate u8x16_sub_saturate
#define u16x_sub_saturate u16x8_sub_saturate
#define i8x_sub_saturate i8x16_sub_saturate
#define i16x_sub_saturate i16x8_sub_saturate
#endif

#if CLIB_VECTOR_WORD_BITS == 64
#define u8x_add_saturate u8x8_add_saturate
#define u16x_add_saturate u16x4_add_saturate
#define i8x_add_saturate i8x8_add_saturate
#define i16x_add_saturate i16x4_add_saturate
#define u8x_sub_saturate u8x8_sub_saturate
#define u16x_sub_saturate u16x4_sub_saturate
#define i8x_sub_saturate i8x8_sub_saturate
#define i16x_sub_saturate i16x4_sub_saturate
#endif

#define _vector_interleave(a,b,t)		\
do {						\
  t _tmp_lo = t##_interleave_lo (a, b);		\
  t _tmp_hi = t##_interleave_hi (a, b);		\
  if (CLIB_ARCH_IS_LITTLE_ENDIAN)		\
    (a) = _tmp_lo, (b) = _tmp_hi;		\
  else						\
    (a) = _tmp_hi, (b) = _tmp_lo;		\
} while (0)

/* 128 bit interleaves. */
#define u8x16_interleave(a,b) _vector_interleave(a,b,u8x16)
#define i8x16_interleave(a,b) _vector_interleave(a,b,i8x16)
#define u16x8_interleave(a,b) _vector_interleave(a,b,u16x8)
#define i16x8_interleave(a,b) _vector_interleave(a,b,i16x8)
#define u32x4_interleave(a,b) _vector_interleave(a,b,u32x4)
#define i32x4_interleave(a,b) _vector_interleave(a,b,i32x4)
#define u64x2_interleave(a,b) _vector_interleave(a,b,u64x2)
#define i64x2_interleave(a,b) _vector_interleave(a,b,i64x2)

/* 64 bit interleaves. */
#define u8x8_interleave(a,b) _vector_interleave(a,b,u8x8)
#define i8x8_interleave(a,b) _vector_interleave(a,b,i8x8)
#define u16x4_interleave(a,b) _vector_interleave(a,b,u16x4)
#define i16x4_interleave(a,b) _vector_interleave(a,b,i16x4)
#define u32x2_interleave(a,b) _vector_interleave(a,b,u32x2)
#define i32x2_interleave(a,b) _vector_interleave(a,b,i32x2)

/* Word sized interleaves. */
#if CLIB_VECTOR_WORD_BITS == 128
#define u8x_interleave u8x16_interleave
#define u16x_interleave u16x8_interleave
#define u32x_interleave u32x4_interleave
#define u64x_interleave u64x2_interleave
#endif

#if CLIB_VECTOR_WORD_BITS == 64
#define u8x_interleave u8x8_interleave
#define u16x_interleave u16x4_interleave
#define u32x_interleave u32x2_interleave
#define u64x_interleave(a,b)	/* do nothing */
#endif

/* Vector word sized shifts. */
#if CLIB_VECTOR_WORD_BITS == 128
#define u8x_shift_left u8x16_shift_left
#define i8x_shift_left i8x16_shift_left
#define u16x_shift_left u16x8_shift_left
#define i16x_shift_left i16x8_shift_left
#define u32x_shift_left u32x4_shift_left
#define i32x_shift_left i32x4_shift_left
#define u64x_shift_left u64x2_shift_left
#define i64x_shift_left i64x2_shift_left
#define u8x_shift_right u8x16_shift_right
#define i8x_shift_right i8x16_shift_right
#define u16x_shift_right u16x8_shift_right
#define i16x_shift_right i16x8_shift_right
#define u32x_shift_right u32x4_shift_right
#define i32x_shift_right i32x4_shift_right
#define u64x_shift_right u64x2_shift_right
#define i64x_shift_right i64x2_shift_right
#define u8x_rotate_left u8x16_rotate_left
#define i8x_rotate_left i8x16_rotate_left
#define u16x_rotate_left u16x8_rotate_left
#define i16x_rotate_left i16x8_rotate_left
#define u32x_rotate_left u32x4_rotate_left
#define i32x_rotate_left i32x4_rotate_left
#define u64x_rotate_left u64x2_rotate_left
#define i64x_rotate_left i64x2_rotate_left
#define u8x_rotate_right u8x16_rotate_right
#define i8x_rotate_right i8x16_rotate_right
#define u16x_rotate_right u16x8_rotate_right
#define i16x_rotate_right i16x8_rotate_right
#define u32x_rotate_right u32x4_rotate_right
#define i32x_rotate_right i32x4_rotate_right
#define u64x_rotate_right u64x2_rotate_right
#define i64x_rotate_right i64x2_rotate_right
#define u8x_ishift_left u8x16_ishift_left
#define i8x_ishift_left i8x16_ishift_left
#define u16x_ishift_left u16x8_ishift_left
#define i16x_ishift_left i16x8_ishift_left
#define u32x_ishift_left u32x4_ishift_left
#define i32x_ishift_left i32x4_ishift_left
#define u64x_ishift_left u64x2_ishift_left
#define i64x_ishift_left i64x2_ishift_left
#define u8x_ishift_right u8x16_ishift_right
#define i8x_ishift_right i8x16_ishift_right
#define u16x_ishift_right u16x8_ishift_right
#define i16x_ishift_right i16x8_ishift_right
#define u32x_ishift_right u32x4_ishift_right
#define i32x_ishift_right i32x4_ishift_right
#define u64x_ishift_right u64x2_ishift_right
#define i64x_ishift_right i64x2_ishift_right
#define u8x_irotate_left u8x16_irotate_left
#define i8x_irotate_left i8x16_irotate_left
#define u16x_irotate_left u16x8_irotate_left
#define i16x_irotate_left i16x8_irotate_left
#define u32x_irotate_left u32x4_irotate_left
#define i32x_irotate_left i32x4_irotate_left
#define u64x_irotate_left u64x2_irotate_left
#define i64x_irotate_left i64x2_irotate_left
#define u8x_irotate_right u8x16_irotate_right
#define i8x_irotate_right i8x16_irotate_right
#define u16x_irotate_right u16x8_irotate_right
#define i16x_irotate_right i16x8_irotate_right
#define u32x_irotate_right u32x4_irotate_right
#define i32x_irotate_right i32x4_irotate_right
#define u64x_irotate_right u64x2_irotate_right
#define i64x_irotate_right i64x2_irotate_right
#endif

#if CLIB_VECTOR_WORD_BITS == 64
#define u8x_shift_left u8x8_shift_left
#define i8x_shift_left i8x8_shift_left
#define u16x_shift_left u16x4_shift_left
#define i16x_shift_left i16x4_shift_left
#define u32x_shift_left u32x2_shift_left
#define i32x_shift_left i32x2_shift_left
#define u8x_shift_right u8x8_shift_right
#define i8x_shift_right i8x8_shift_right
#define u16x_shift_right u16x4_shift_right
#define i16x_shift_right i16x4_shift_right
#define u32x_shift_right u32x2_shift_right
#define i32x_shift_right i32x2_shift_right
#define u8x_rotate_left u8x8_rotate_left
#define i8x_rotate_left i8x8_rotate_left
#define u16x_rotate_left u16x4_rotate_left
#define i16x_rotate_left i16x4_rotate_left
#define u32x_rotate_left u32x2_rotate_left
#define i32x_rotate_left i32x2_rotate_left
#define u8x_rotate_right u8x8_rotate_right
#define i8x_rotate_right i8x8_rotate_right
#define u16x_rotate_right u16x4_rotate_right
#define i16x_rotate_right i16x4_rotate_right
#define u32x_rotate_right u32x2_rotate_right
#define i32x_rotate_right i32x2_rotate_right
#define u8x_ishift_left u8x8_ishift_left
#define i8x_ishift_left i8x8_ishift_left
#define u16x_ishift_left u16x4_ishift_left
#define i16x_ishift_left i16x4_ishift_left
#define u32x_ishift_left u32x2_ishift_left
#define i32x_ishift_left i32x2_ishift_left
#define u8x_ishift_right u8x8_ishift_right
#define i8x_ishift_right i8x8_ishift_right
#define u16x_ishift_right u16x4_ishift_right
#define i16x_ishift_right i16x4_ishift_right
#define u32x_ishift_right u32x2_ishift_right
#define i32x_ishift_right i32x2_ishift_right
#define u8x_irotate_left u8x8_irotate_left
#define i8x_irotate_left i8x8_irotate_left
#define u16x_irotate_left u16x4_irotate_left
#define i16x_irotate_left i16x4_irotate_left
#define u32x_irotate_left u32x2_irotate_left
#define i32x_irotate_left i32x2_irotate_left
#define u8x_irotate_right u8x8_irotate_right
#define i8x_irotate_right i8x8_irotate_right
#define u16x_irotate_right u16x4_irotate_right
#define i16x_irotate_right i16x4_irotate_right
#define u32x_irotate_right u32x2_irotate_right
#define i32x_irotate_right i32x2_irotate_right
#endif

#if CLIB_VECTOR_WORD_BITS == 128
#define u8x_splat u8x16_splat
#define i8x_splat i8x16_splat
#define u16x_splat u16x8_splat
#define i16x_splat i16x8_splat
#define u32x_splat u32x4_splat
#define i32x_splat i32x4_splat
#define u64x_splat u64x2_splat
#define i64x_splat i64x2_splat
#endif

#if CLIB_VECTOR_WORD_BITS == 64
#define u8x_splat u8x8_splat
#define i8x_splat i8x8_splat
#define u16x_splat u16x4_splat
#define i16x_splat i16x4_splat
#define u32x_splat u32x2_splat
#define i32x_splat i32x2_splat
#endif

#define u32x4_transpose_step(x,y)		\
do {						\
  u32x4 _x = (x);				\
  u32x4 _y = (y);				\
  (x) = u32x4_interleave_lo (_x, _y);		\
  (y) = u32x4_interleave_hi (_x, _y);		\
} while (0)

/* 4x4 transpose: x_ij -> x_ji */
#define u32x4_transpose(x0,x1,x2,x3)		\
do {						\
  u32x4 _x0 = (u32x4) (x0);			\
  u32x4 _x1 = (u32x4) (x1);			\
  u32x4 _x2 = (u32x4) (x2);			\
  u32x4 _x3 = (u32x4) (x3);			\
  u32x4_transpose_step (_x0, _x2);		\
  u32x4_transpose_step (_x1, _x3);		\
  u32x4_transpose_step (_x0, _x1);		\
  u32x4_transpose_step (_x2, _x3);		\
  (x0) = (u32x4) _x0;				\
  (x1) = (u32x4) _x1;				\
  (x2) = (u32x4) _x2;				\
  (x3) = (u32x4) _x3;				\
} while (0)

#define i32x4_transpose(x0,x1,x2,x3)		\
do {						\
  u32x4 _x0 = (u32x4) (x0);			\
  u32x4 _x1 = (u32x4) (x1);			\
  u32x4 _x2 = (u32x4) (x2);			\
  u32x4 _x3 = (u32x4) (x3);			\
  u32x4_transpose_step (_x0, _x2);		\
  u32x4_transpose_step (_x1, _x3);		\
  u32x4_transpose_step (_x0, _x1);		\
  u32x4_transpose_step (_x2, _x3);		\
  (x0) = (i32x4) _x0;				\
  (x1) = (i32x4) _x1;				\
  (x2) = (i32x4) _x2;				\
  (x3) = (i32x4) _x3;				\
} while (0)

#undef _

#endif /* included_vector_funcs_h */

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