qosmngr: airoha: Fix QoS issue with EN7523+IFC.

When the LUT1 IFC table overflows it seems to
affect tagged TCP-based VLAN traffic and
ingress flows are not properly setup in HW NAT.
This commit is contained in:
Markus Gothe 2025-11-10 19:25:25 +01:00
parent 8fee332f4c
commit ce1b42e095

View file

@ -411,33 +411,42 @@ hw_commit_all() {
/userfs/bin/qosrule discpline Enable 0 /userfs/bin/qosrule discpline Enable 0
fi fi
if [ -x /userfs/bin/blapi_cmd ]; then if ! strings /proc/device-tree/compatible | grep -qFx econet,en7523; then
echo 1 > /proc/ifc_send_to_ppe if [ -x /userfs/bin/blapi_cmd ]; then
for tc in $(seq 0 7); do echo 1 > /proc/ifc_send_to_ppe
if [ -s "/tmp/qos/dscp_values_${tc}_4" ]; then for tc in $(seq 0 7); do
sort -un "/tmp/qos/dscp_values_${tc}_4" | awk 'NR==1{first=$1;last=$1;next} if [ -s "/tmp/qos/dscp_values_${tc}_4" ]; then
$1 == last+1 {last=$1;next} sort -un "/tmp/qos/dscp_values_${tc}_4" | awk 'NR==1{first=$1;last=$1;next}
{system("/userfs/bin/blapi_cmd traffic set_traffic_class DSCP " first*4 " " or(last*4, 0x3) " 1");first=$1;last=first} $1 == last+1 {last=$1;next}
END{system("/userfs/bin/blapi_cmd traffic set_traffic_class DSCP " first*4 " " or(last*4, 0x3) " 1")}' {system("/userfs/bin/blapi_cmd traffic set_traffic_class DSCP " first*4 " " or(last*4, 0x3) " 1");first=$1;last=first}
fi END{system("/userfs/bin/blapi_cmd traffic set_traffic_class DSCP " first*4 " " or(last*4, 0x3) " 1")}'
if [ -s "/tmp/qos/dscp_values_${tc}_6" ]; then fi
[ -s "/tmp/qos/dscp_values_${tc}_4" ] && sort -un "/tmp/qos/dscp_values_${tc}_6" | awk 'NR==1{first=$1;last=$1;next} if [ -s "/tmp/qos/dscp_values_${tc}_6" ]; then
$1 == last+1 {last=$1;next} [ -s "/tmp/qos/dscp_values_${tc}_4" ] && sort -un "/tmp/qos/dscp_values_${tc}_6" | awk 'NR==1{first=$1;last=$1;next}
{system("/userfs/bin/blapi_cmd traffic set_traffic_class DSCP " first*4 " " or(last*4, 0x3) " 0");first=$1;last=first} $1 == last+1 {last=$1;next}
END{system("/userfs/bin/blapi_cmd traffic set_traffic_class DSCP " first*4 " " or(last*4, 0x3) " 0")}' {system("/userfs/bin/blapi_cmd traffic set_traffic_class DSCP " first*4 " " or(last*4, 0x3) " 0");first=$1;last=first}
sort -un "/tmp/qos/dscp_values_${tc}_6" | awk 'NR==1{first=$1;last=$1;next} END{system("/userfs/bin/blapi_cmd traffic set_traffic_class DSCP " first*4 " " or(last*4, 0x3) " 0")}'
$1 == last+1 {last=$1;next} sort -un "/tmp/qos/dscp_values_${tc}_6" | awk 'NR==1{first=$1;last=$1;next}
{system("/userfs/bin/blapi_cmd traffic set_traffic_class DSCP " first*4 " " or(last*4, 0x3) " 1");first=$1;last=first} $1 == last+1 {last=$1;next}
END{system("/userfs/bin/blapi_cmd traffic set_traffic_class DSCP " first*4 " " or(last*4, 0x3) " 1")}' {system("/userfs/bin/blapi_cmd traffic set_traffic_class DSCP " first*4 " " or(last*4, 0x3) " 1");first=$1;last=first}
fi END{system("/userfs/bin/blapi_cmd traffic set_traffic_class DSCP " first*4 " " or(last*4, 0x3) " 1")}'
done fi
fi done
fi
if [ -x /userfs/bin/ifc ]; then if [ -x /userfs/bin/ifc ]; then
echo 1 > /proc/ifc_send_to_ppe echo 1 > /proc/ifc_send_to_ppe
for pbit in $(seq 0 7); do for pbit in $(seq 0 7); do
/userfs/bin/ifc add vip pbit $pbit /userfs/bin/ifc add vip pbit $pbit
done done
fi
else
if [ -x /userfs/bin/ifc ]; then
echo 1 > /proc/ifc_send_to_ppe
for pbit in $(seq 1 7); do
/userfs/bin/ifc add vip pbit $pbit
done
fi
fi fi
hw_nat -! > /dev/null 2>&1 hw_nat -! > /dev/null 2>&1