--- zzzz-none-000/linux-5.15.111/include/linux/if_vlan.h 2023-05-11 14:00:40.000000000 +0000 +++ puma7-arm-6670-761/linux-5.15.111/include/linux/if_vlan.h 2024-02-07 09:28:07.000000000 +0000 @@ -4,6 +4,11 @@ * * Authors: Ben Greear */ +/* +Includes Intel Corporation's changes/modifications dated: 2014. +Changed/modified portions - Copyright © 2014, Intel Corporation. +*/ + #ifndef _LINUX_IF_VLAN_H_ #define _LINUX_IF_VLAN_H_ @@ -13,6 +18,8 @@ #include #include +#include + #define VLAN_HLEN 4 /* The additional bytes required by VLAN * (in addition to the Ethernet header) */ @@ -192,15 +199,39 @@ } static inline u16 -vlan_dev_get_egress_qos_mask(struct net_device *dev, u32 skprio) +vlan_dev_get_egress_qos_mask(struct net_device *dev, struct sk_buff *skb) { +#if defined(PUMA6_OR_NEWER_SOC_TYPE) + if (skb->ti_ds_traffic_prio) + { + return ((VLAN_PRIO_MASK & (7)) << VLAN_PRIO_SHIFT); + } + else if (dev->priv_flags & IFF_BONDING) + { + return ((VLAN_PRIO_MASK & (2)) << VLAN_PRIO_SHIFT); + } + return ((VLAN_PRIO_MASK & (0)) << VLAN_PRIO_SHIFT); +/* TODO: replace the above mapping with the following priority mapping: + if (IS_LACP(skb)) { + + } + else if (skb->ti_ds_traffic_prio) { + return ((VLAN_PRIO_MASK & (4)) << VLAN_PRIO_SHIFT); + } + else if (dev->priv_flags & IFF_BONDING) { + return ((VLAN_PRIO_MASK & (2)) << VLAN_PRIO_SHIFT); + } + return ((VLAN_PRIO_MASK & (0)) << VLAN_PRIO_SHIFT); +*/ +#else + struct vlan_priority_tci_mapping *mp; smp_rmb(); /* coupled with smp_wmb() in vlan_dev_set_egress_priority() */ - mp = vlan_dev_priv(dev)->egress_priority_map[(skprio & 0xF)]; + mp = vlan_dev_priv(dev)->egress_priority_map[(skb->priority & 0xF)]; while (mp) { - if (mp->priority == skprio) { + if (mp->priority == skb->priority) { return mp->vlan_qos; /* This should already be shifted * to mask correctly with the * VLAN's TCI */ @@ -208,6 +239,7 @@ mp = mp->next; } return 0; +#endif } extern bool vlan_do_receive(struct sk_buff **skb); @@ -257,7 +289,7 @@ } static inline u16 vlan_dev_get_egress_qos_mask(struct net_device *dev, - u32 skprio) + struct sk_buff *skb) { return 0; }