--- zzzz-none-000/linux-4.9.279/include/linux/if_vlan.h 2021-08-08 06:38:54.000000000 +0000 +++ puma7-arm-6591-750/linux-4.9.279/include/linux/if_vlan.h 2023-02-08 10:58:16.000000000 +0000 @@ -9,6 +9,11 @@ * 2 of the License, or (at your option) any later version. * */ +/* +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_ @@ -18,6 +23,8 @@ #include #include +#include + #define VLAN_HLEN 4 /* The additional bytes required by VLAN * (in addition to the Ethernet header) */ @@ -171,15 +178,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 */ @@ -187,6 +218,7 @@ mp = mp->next; } return 0; +#endif } extern bool vlan_do_receive(struct sk_buff **skb); @@ -233,7 +265,7 @@ } static inline u16 vlan_dev_get_egress_qos_mask(struct net_device *dev, - u32 skprio) + struct sk_buff *skb) { return 0; }