Hi Christian,

On Fri, 23 Aug 2019 at 11:21, Christian Leeb <christian.l...@ch.abb.com> wrote:
>
> Hi
>
>
>
> We are using 802.1Q tag for PTP. Fine with setting VLAN ID.
>
> How can I set PCP (priority code point in 802.1Q tag) specifically for PTP?
>
> This is how far I got:
>
> By default, applications are using skb (Linux socket buffer) priority 0.
> skb priority can be statically mapped to PCP using vconfig set_egress_map. 
> E.g. “vconfig set_egress_map eth0.100 0 7” maps all skb prio 0 to PCP 7. This 
> for eth0.100.
>
>
>
> Is it possible to set skb prio used by ptp4l?
>
>

Linuxptp master supports the SO_PRIORITY API since this commit:
https://github.com/richardcochran/linuxptp/commit/c15e8c76000cdd00335a039f89693b820044ac91
Prior to that, you needed to do skbedit trickery. Here is an example
on how to match L2 PTP by EtherType:

    # Add the qdisc holding the classifiers
    $ tc qdisc add dev "${iface}" clsact
    # Match L2 PTP frames by EtherType
    # Since we use u32 filter which starts from IP protocol,
    # we need to go back and specify -2 negative offset.
    $ tc filter add dev "${iface}" egress prio 1 u32 match u16 0x88f7
0xffff at -2 action skbedit priority 7

I suppose it's possible to get a similar effect using the netfilter
mangle table and -j CLASSIFY --set-class 0:7, but I'm not exactly sure
how to match on PTP using that one.

By the way you might also need a qdisc that maps skb->priority to
netdev queue, like mqprio.


>
> In practice we would like to map per application, e.g. PCP = 7 for PTP, PCP = 
> 5 for “application 1”. Current PTP4L does not support this, so it sends with 
> skb prio = 0 (the default). As a workaround we could map skb prio 0 to target 
> PCP and set skb prio of all other applications values other than 0.
>
>
>
> Regards, Chris
>
> _______________________________________________
> Linuxptp-users mailing list
> Linuxptp-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linuxptp-users

Hope this helps,
-Vladimir


_______________________________________________
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users

Reply via email to