dtaht / sch_cake

Out of tree build for the new cake qdisc
100 stars 35 forks source link

sch_cake: properly obtain skb proto in case of VLAN #135

Closed inste closed 4 years ago

inste commented 4 years ago

tc_skb_proto() generally expands as

if (skb_vlan_tag_present(skb))
    return skb->vlan_proto;
return skb->protocol;

and in case of VLAN-tagged packet will return ETH_P_8021Q, but in cake_handle_diffserv() we expect only ETH_P_IP/ETH_P_IPV6, so make our own helper to extract proper values from skb.

Should be fixed in vanilla kernel also.

tohojo commented 4 years ago

Yup, that's better. Did you test that this version works to fix the issue you were seeing?

inste commented 4 years ago

Yup, that's better. Did you test that this version works to fix the issue you were seeing?

Yes, works as expected, and just discovered that skb_mac_offset() was introduced only in 4.11, so added backported verstion to cobalt_compat.h.

tohojo commented 4 years ago

Great! You seem to have dropped the signed-off-by from your commit message, though. Please add that back, then I'm fine with merging this :)

inste commented 4 years ago

Great! You seem to have dropped the signed-off-by from your commit message, though. Please add that back, then I'm fine with merging this :)

Done. I rare commit to upstreams directly, so may forget something :)

tohojo commented 4 years ago

Awesome! I'll submit this to upstream once net-next opens back up in a couple of weeks...

inste commented 4 years ago

@ldir-EDB0 @tohojo plz don't forget to upstream this ;)

tohojo commented 4 years ago

Working on it. Can't upstream it as-is, need to fix the helpers kernel-wide instead :)