4.18.6. Example 6: Establish and Verify Packet Forwarding in a Switch
packets.
# Example 6 script
# Using PVA-3102 in slot,port 1,1 for Tx, 1,2 for Rx
# Configure MAC Addresses for transmission 1,1 to 1,2 and back
set TxPort 1,1
set RxPort 1,2
pva_pkt_addr $TxPort auto match store
# Configure both Test Ports for auto speed, duplex, polarity.
pva_speed $TxPort auto duplex auto arm
pva_polarity $TxPort auto arm
pva_speed $RxPort auto duplex auto arm
pva_polarity $RxPort auto arm
# Force a re-link, to establish the desired line conditions.
pva_relink $TxPort
pva_relink $RxPort
# Verify that the links are up.
pva_link_wait $TxPort
pva_link_wait $RxPort
# Transmit Traffic on both ports to prime any switch bridging
pva_tx_pkt $TxPort size 60 rate line count 0
pva_tx_pkt $RxPort size 60 rate line count 0
after 30000
pva_tx_pkt $TxPort stop
pva_tx_pkt $RxPort stop
# Start the Received Packet Counter on the RxPort.
set rslt [pva_rx_pkt $RxPort start]
# Transmit 512k packets with the TxPort
set rslt [pva_tx_pkt $TxPort size 60 rate line count 512K
start]
# Check for Transmit completed
while {[lindex [pva_tx_pkt $TxPort stat] 3] != "IDLE"} { }
# Read the Received Packet Counter.
set rslt [pva_rx_pkt $RxPort stat]
# Stop the Received Packet Counter.
pva_rx_pkt $RxPort stop