tomahawk3_power_test.c (1605B)
1 /* 2 * 3 * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. 4 * 5 * Copyright 2007-2019 Broadcom Inc. All rights reserved. 6 * 7 * The TH3 power test test excercises the WCS power scenario 8 * streaming MPLS/IPv6 packets on all ports at maximum rate. All ports are 9 * configured in MAC/PHY/EXT loopback mode and each port is paired with a same speed 10 * port. The test calculates the number of packets needed to saturate the ports 11 * and send the packets from the CPU to each port pairs initially. 12 * Then the packets are switched between the port pairs indefinitely. Once 13 * the traffic reaches steady state, rate calculation is done by dividing the 14 * transmit packet count changes and transmit byte count changes over a 15 * programmable interval. The rates are checked against expected rates based on 16 * port configuration and oversubscription ratio. Finally, packet integrity 17 * check is achieved by redirecting the packets back to the CPU and compared 18 * against expected packets. 19 * 20 * Configuration parameters passed from CLI: 21 * See power_test_usage[] array 22 */ 23 24 #include <appl/diag/system.h> 25 #include <shared/alloc.h> 26 #include <shared/bsl.h> 27 28 #include <soc/cm.h> 29 #include <soc/dma.h> 30 #include <soc/drv.h> 31 #include <soc/dcb.h> 32 #include <soc/cmicm.h> 33 #include <soc/cmic.h> 34 35 #include <sal/types.h> 36 #include <appl/diag/parse.h> 37 #include <bcm/port.h> 38 #include <bcm/vlan.h> 39 #include <bcm/stat.h> 40 41 #include <soc/init/tomahawk3_flexport_defines.h> 42 #include "testlist.h" 43 #include "gen_pkt.h" 44 #include "streaming_lib.h" 45