Oops: 0000000096000004
This commit is contained in:
@@ -410,7 +410,7 @@ func checkImagePresent(ctx context.Context, n *NodeContext, image string) error
|
||||
// crictl inspecti exits non-zero when the image is absent.
|
||||
_, err := n.SystemRunner.RunRetry(ctx, system.RetryOptions{
|
||||
Attempts: 3,
|
||||
Delay: 1 * system.DefaultSecond,
|
||||
Delay: 2 * system.DefaultSecond,
|
||||
}, "crictl", "inspecti", image)
|
||||
if err != nil {
|
||||
return fmt.Errorf("image %q not present: %w", image, err)
|
||||
|
||||
@@ -225,15 +225,50 @@ RUN set -eux; \
|
||||
# Create a structured staging area
|
||||
mkdir -p /tmp/fmc_staging/config; \
|
||||
\
|
||||
# Copy main files to the root of staging
|
||||
# Copy main files
|
||||
cp "$XML_SRC" /tmp/fmc_staging/config.xml; \
|
||||
# Copy the HXS and schemas into the 'config' subfolder where fmc expects them
|
||||
cp "$HXS_FILE" /tmp/fmc_staging/config/; \
|
||||
cp "$SCHEMA_DIR"/*.xsd /tmp/fmc_staging/config/; \
|
||||
\
|
||||
# Production Cleanup (Remove MAC 3 from the main config)
|
||||
# Production Cleanup: Remove RJ45 ports (MAC 3, 4, 5, 6) from the FMC config
|
||||
# This ensures FMC only touches the SFP ports (MAC 9, 10)
|
||||
sed -i '/<macport name="fm0-gb3"/{N;N;N;N;d;}' /tmp/fmc_staging/config.xml; \
|
||||
cp /tmp/fmc_staging/config.xml /tmp/fmc_staging/policy.xml
|
||||
sed -i '/<macport name="fm0-gb4"/{N;N;N;N;d;}' /tmp/fmc_staging/config.xml; \
|
||||
sed -i '/<macport name="fm0-gb5"/{N;N;N;N;d;}' /tmp/fmc_staging/config.xml; \
|
||||
sed -i '/<macport name="fm0-gb6"/{N;N;N;N;d;}' /tmp/fmc_staging/config.xml; \
|
||||
\
|
||||
# Also remove the port bindings for those MACs
|
||||
sed -i '/<port type="MAC" number="3"/d' /tmp/fmc_staging/config.xml; \
|
||||
sed -i '/<port type="MAC" number="4"/d' /tmp/fmc_staging/config.xml; \
|
||||
sed -i '/<port type="MAC" number="5"/d' /tmp/fmc_staging/config.xml; \
|
||||
sed -i '/<port type="MAC" number="6"/d' /tmp/fmc_staging/config.xml; \
|
||||
\
|
||||
# 1. Initialize policy.xml with the correct <netpcd> root tag
|
||||
echo '<?xml version="1.0" encoding="UTF-8"?>' > /tmp/fmc_staging/policy.xml; \
|
||||
echo '<netpcd>' >> /tmp/fmc_staging/policy.xml; \
|
||||
\
|
||||
# 2. Extract policy names and generate dummy blocks
|
||||
# We use a subshell and tr to handle potential weird spacing
|
||||
POLICY_NAMES=$(grep -o 'policy="[^"]*"' /tmp/fmc_staging/config.xml | cut -d'"' -f2 | sort -u); \
|
||||
\
|
||||
for NAME in $POLICY_NAMES; do \
|
||||
echo " <policy name=\"$NAME\">" >> /tmp/fmc_staging/policy.xml; \
|
||||
echo " <dist_order><distributionref name=\"dist_dummy\"/></dist_order>" >> /tmp/fmc_staging/policy.xml; \
|
||||
echo " </policy>" >> /tmp/fmc_staging/policy.xml; \
|
||||
done; \
|
||||
\
|
||||
# 3. Append the distribution and close the root tag
|
||||
# Updated Distribution block for the Dockerfile RUN command
|
||||
cat << 'EOF' >> /tmp/fmc_staging/policy.xml
|
||||
<distribution name="dist_dummy">
|
||||
<protocols><protocolref name="ethernet"/></protocols>
|
||||
<standardhash>
|
||||
<algorithm name="fms_hash_default"/>
|
||||
</standardhash>
|
||||
<keycount>1</keycount>
|
||||
</distribution>
|
||||
</netpcd>
|
||||
EOF
|
||||
|
||||
RUN set -eux; \
|
||||
cd /src/vpp; \
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
usdpaa_mem: usdpaa_mem {
|
||||
compatible = "fsl,usdpaa-mem";
|
||||
alloc-ranges = <0 0 0x10000 0>;
|
||||
alloc-ranges = <0 0x80000000 0 0xffffffff>;
|
||||
size = <0 0x10000000>; // 256MB
|
||||
alignment = <0 0x10000000>;
|
||||
};
|
||||
|
||||
@@ -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
|
||||
# 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
|
||||
|
||||
Reference in New Issue
Block a user