p4_testbed/scripts/00-wedge_on_reboot.sh
2024-12-23 16:45:18 +01:00

56 lines
2.4 KiB
Bash

#!/bin/bash
# Run this script when:
# When the switch has been restarted or you encounter the following error:
# ```sh
# $ ./run_switchd.sh -p l1switch
# Using SDE /home/user/bf-sde-9.7.0
# Using SDE_INSTALL /home/user/bf-sde-9.7.0/install
# Setting up DMA Memory Pool
# [sudo] password for user:
# Using TARGET_CONFIG_FILE /home/user/bf-sde-9.7.0/install/share/p4/targets/tofino/l1switch.conf
# Using PATH /home/user/bf-sde-9.7.0/install/bin:/home/user/.local/bin:/home/user/bf-sde-9.7.0/install/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
# Using LD_LIBRARY_PATH /usr/local/lib:/home/user/bf-sde-9.7.0/install/lib:
# bf_sysfs_fname /sys/class/bf/bf0/device/dev_add
# Install dir: /home/user/bf-sde-9.7.0/install (0x558ddab20980)
# bf_switchd: system services initialized
# bf_switchd: loading conf_file /home/user/bf-sde-9.7.0/install/share/p4/targets/tofino/l1switch.conf...
# bf_switchd: processing device configuration...
# Configuration for dev_id 0
# Family : tofino
# pci_sysfs_str : /sys/devices/pci0000:00/0000:00:03.0/0000:05:00.0
# pci_domain : 0
# pci_bus : 5
# pci_fn : 0
# pci_dev : 0
# pci_int_mode : 1
# sbus_master_fw: /home/user/bf-sde-9.7.0/install/
# pcie_fw : /home/user/bf-sde-9.7.0/install/
# serdes_fw : /home/user/bf-sde-9.7.0/install/
# sds_fw_path : /home/user/bf-sde-9.7.0/install/share/tofino_sds_fw/avago/firmware
# microp_fw_path:
# bf_switchd: processing P4 configuration...
# P4 profile for dev_id 0
# num P4 programs 1
# p4_name: l1switch
# p4_pipeline_name: pipe
# libpd:
# libpdthrift:
# context: /home/user/bf-sde-9.7.0/install/l1switch.tofino/pipe/context.json
# config: /home/user/bf-sde-9.7.0/install/l1switch.tofino/pipe/tofino.bin
# Pipes in scope [0 1 2 3 ]
# diag:
# accton diag:
# Agent[0]: /home/user/bf-sde-9.7.0/install/lib/libpltfm_mgr.so
# non_default_port_ppgs: 0
# SAI default initialize: 1
# bf_switchd: library /home/user/bf-sde-9.7.0/install/lib/libpltfm_mgr.so loaded
# bf_switchd: agent[0] initialized
# 2024-12-09 15:37:28.067316 BF_PLTFM ERROR - Error getting ipv6 address for interface enx020000000002
#
# CHSS MGMT ERROR: Failed to configure cdc_eth ipv6
# ```
sudo "$SDE_INSTALL/bin/bf_kpkt_mod_load" "$SDE_INSTALL"
sudo ip link set "$(basename /sys/module/bf_kpkt/drivers/pci:bf/*/net/*)" up