Oops: 0000000096000004

This commit is contained in:
2026-04-10 00:41:11 +08:00
parent b8bc6a13cf
commit ee1f78f496
4 changed files with 73 additions and 14 deletions

View File

@@ -3,20 +3,44 @@ set -e
echo "--- Starting NXP DPAA1 Hardware Initialization ---"
# 1. Run FMC to configure FMan, QMan, and BMan
# -c: path to config xml
# -p: path to policy xml
# -a: apply the configuration
# Only unbind the SFP ports (MAC 9 and 10)
# Leave MAC 3, 4, 5, 6 for Linux (Kubernetes management)
SFP_PORTS="9 10"
echo "Releasing SFP hardware ports from kernel..."
for port in $SFP_PORTS; do
if [ -e /sys/bus/platform/drivers/fsl-dpa-ethernet/fm0-port.$port ]; then
echo "fm0-port.$port" > /sys/bus/platform/drivers/fsl-dpa-ethernet/unbind 2>/dev/null || true
echo "Successfully unbound MAC $port"
else
echo "MAC $port already released or not found."
fi
done
# 1. PRE-REQUISITE: Unbind ports from the kernel
# This frees the hardware so FMC/VPP can claim it.
# MAC 3 usually maps to fm0-port.3 or similar in sysfs.
echo "Releasing hardware ports from kernel..."
for port in 3 4 5 6 9 10; do
# Try to unbind from the DPAA Ethernet driver if it exists
if [ -e /sys/bus/platform/drivers/fsl-dpa-ethernet/fm0-port.$port ]; then
echo "fm0-port.$port" > /sys/bus/platform/drivers/fsl-dpa-ethernet/unbind 2>/dev/null || true
fi
# Ensure the interface is DOWN
# Note: You may need to map MAC numbers to eth names (eth0, eth1, etc.)
done
# 2. Run FMC
if [ -f /etc/fmc/config.xml ]; then
echo "Applying FMC Configuration..."
cd /etc/fmc
fmc -c /etc/fmc/config.xml -p /etc/fmc/policy.xml -a
cd /etc/fmc
# Using -l dbg1 helps see exactly why a port fails if it happens again
fmc -c /etc/fmc/config.xml -p /etc/fmc/policy.xml -a -l dbg1
echo "FMC Configuration applied successfully."
else
echo "ERROR: /etc/fmc/config.xml not found!"
echo "VPP will likely fail with 'Main heap allocation failure'."
exit 1
fi
echo "--- Starting VPP Forwarder ---"
# 2. Start VPP and replace this script's process (exec)
exec vpp -c /etc/vpp/startup.conf