TC syntax for DSCP set, difficulty: Linux 2.6.22

This is not exactly an OpenWRT question but since Broadcom based devices are natively stuck on Linux 2.6.22 or thereabouts, still a current one:

I'd like to use DSCP VOICE-ADMIT 44=0x2c for some voip connections. But the syntax in this ancient tc version is difficult, tc here won't even support "action pedit munge ip tos set". Please I do know how to do it with iptables, this is all about doing it with tc.

I've googled everything since 15 year old mail list messages and everything I can find, only to find almost nothing at all.
Found this mailing list message explaining part of what might be the problem, the date might put this a bit later than 2.6.22 so the bug might manifest itself here, although the mailing list "ok" example won't run either:

https://www.spinics.net/lists/netdev/msg190368.html
Subject: [PATCH iproute] tc pedit action: fix parsing offset options.
Date: Wed, 29 Feb 2012 19:34:28 +0300
This patch fix parsing offset option with "at" parameter.
Tc returns error If keywords "offmask" and "shift" are presented.

Error: action pedit munge offset 2 u16 at 0 offmask 0f0000000 shift 22 set 11500
Ok: action pedit munge offset 2 u16 at 0 0f0000000 22 set 11500

But no variation I try seems to get it right, match u8 0 0 is here for example only to keep the focus on pedit:

# tc filter add dev ppp0 parent 8:0 protocol ip prio 999 u32 match u8 0 0 \
action pedit munge offset 0 u8 at 1 0xff 0 set 0x2c

parse_cmd argc 2 set offset 0 length 1
pack_key8: Final word off 0 val 0000002c mask ffffff00
parse_cmd done argc 0 (null) offset 0 length 1
RTNETLINK answers: Invalid argument
We have an error talking to the kernel

# tc filter add dev ppp0 parent 8:0 protocol ip prio 999 u32 match u8 0 0 \
action pedit munge offset 0 u16 at 0 0x00ff 0 set 0x2c

parse_cmd argc 2 set offset 0 length 2
pack_key16: Final val 00002c00 mask ffff0000
parse_cmd done argc 0 (null) offset 0 length 2
RTNETLINK answers: Invalid argument
We have an error talking to the kernel

# tc filter add dev ppp0 parent 8:0 protocol ip prio 999 u32 match u8 0 0 \
action pedit munge offset 0 u32 at 0 0x00ff0000 16 set 0x2c

parse_cmd argc 2 set offset 0 length 4
parse_cmd done argc 0 (null) offset 0 length 4
RTNETLINK answers: Invalid argument
We have an error talking to the kernel

Old memories and smart brains welcome :wink:

@ml70, welcome to the community!

Who told you that?

Nope, not true, nor relevant question for OpenWrt. OpenWrt's not stuck on that kernel - that very old. The current release candidate ( v19.07.0-rc2) is on v 4.9.100.

See: https://openwrt.org/meta/infobox/broadcom_wifi


So, on to your issue:

  • Are you trying to flag traffic for DSCP in OpenWrt or something?

The OpenWrt builds for Broadcom chips are the same recent kernels as other chips, but wifi driver support is often limited or none. In a wired application these chips work fine.

1 Like

Just to extend the answers given above, beyond the challenging wireless situation, xDSL/ cable/ fibre modem or FXS support usually doesn't exist at all for Broadcom chips.

1 Like