act_ife.c (a402eae64d0ad12b1c4a411f250d6c161e67f623) act_ife.c (a5135bcfba7345031df45e02cd150a45add47cf8)
1/*
2 * net/sched/ife.c Inter-FE action based on ForCES WG InterFE LFB
3 *
4 * Refer to:
5 * draft-ietf-forces-interfelfb-03
6 * and
7 * netdev01 paper:
8 * "Distributing Linux Traffic Control Classifier-Action

--- 722 unchanged lines hidden (view full) ---

731 struct tcf_meta_info *e;
732 /*
733 OUTERHDR:TOTMETALEN:{TLVHDR:Metadatum:TLVHDR..}:ORIGDATA
734 where ORIGDATA = original ethernet header ...
735 */
736 u16 metalen = ife_get_sz(skb, ife);
737 int hdrm = metalen + skb->dev->hard_header_len + IFE_METAHDRLEN;
738 unsigned int skboff = skb->dev->hard_header_len;
1/*
2 * net/sched/ife.c Inter-FE action based on ForCES WG InterFE LFB
3 *
4 * Refer to:
5 * draft-ietf-forces-interfelfb-03
6 * and
7 * netdev01 paper:
8 * "Distributing Linux Traffic Control Classifier-Action

--- 722 unchanged lines hidden (view full) ---

731 struct tcf_meta_info *e;
732 /*
733 OUTERHDR:TOTMETALEN:{TLVHDR:Metadatum:TLVHDR..}:ORIGDATA
734 where ORIGDATA = original ethernet header ...
735 */
736 u16 metalen = ife_get_sz(skb, ife);
737 int hdrm = metalen + skb->dev->hard_header_len + IFE_METAHDRLEN;
738 unsigned int skboff = skb->dev->hard_header_len;
739 u32 at = G_TC_AT(skb->tc_verd);
740 int new_len = skb->len + hdrm;
741 bool exceed_mtu = false;
742 int err;
743
739 int new_len = skb->len + hdrm;
740 bool exceed_mtu = false;
741 int err;
742
744 if (at & AT_EGRESS) {
743 if (!skb_at_tc_ingress(skb)) {
745 if (new_len > skb->dev->mtu)
746 exceed_mtu = true;
747 }
748
749 spin_lock(&ife->tcf_lock);
750 bstats_update(&ife->tcf_bstats, skb);
751 tcf_lastuse_update(&ife->tcf_tm);
752

--- 15 unchanged lines hidden (view full) ---

768
769 err = skb_cow_head(skb, hdrm);
770 if (unlikely(err)) {
771 ife->tcf_qstats.drops++;
772 spin_unlock(&ife->tcf_lock);
773 return TC_ACT_SHOT;
774 }
775
744 if (new_len > skb->dev->mtu)
745 exceed_mtu = true;
746 }
747
748 spin_lock(&ife->tcf_lock);
749 bstats_update(&ife->tcf_bstats, skb);
750 tcf_lastuse_update(&ife->tcf_tm);
751

--- 15 unchanged lines hidden (view full) ---

767
768 err = skb_cow_head(skb, hdrm);
769 if (unlikely(err)) {
770 ife->tcf_qstats.drops++;
771 spin_unlock(&ife->tcf_lock);
772 return TC_ACT_SHOT;
773 }
774
776 if (!(at & AT_EGRESS))
775 if (skb_at_tc_ingress(skb))
777 skb_push(skb, skb->dev->hard_header_len);
778
779 iethh = (struct ethhdr *)skb->data;
780 __skb_push(skb, hdrm);
781 memcpy(skb->data, iethh, skb->mac_len);
782 skb_reset_mac_header(skb);
783 oethh = eth_hdr(skb);
784

--- 26 unchanged lines hidden (view full) ---

811 else
812 ether_addr_copy(oethh->h_source, iethh->h_source);
813 if (!is_zero_ether_addr(ife->eth_dst))
814 ether_addr_copy(oethh->h_dest, ife->eth_dst);
815 else
816 ether_addr_copy(oethh->h_dest, iethh->h_dest);
817 oethh->h_proto = htons(ife->eth_type);
818
776 skb_push(skb, skb->dev->hard_header_len);
777
778 iethh = (struct ethhdr *)skb->data;
779 __skb_push(skb, hdrm);
780 memcpy(skb->data, iethh, skb->mac_len);
781 skb_reset_mac_header(skb);
782 oethh = eth_hdr(skb);
783

--- 26 unchanged lines hidden (view full) ---

810 else
811 ether_addr_copy(oethh->h_source, iethh->h_source);
812 if (!is_zero_ether_addr(ife->eth_dst))
813 ether_addr_copy(oethh->h_dest, ife->eth_dst);
814 else
815 ether_addr_copy(oethh->h_dest, iethh->h_dest);
816 oethh->h_proto = htons(ife->eth_type);
817
819 if (!(at & AT_EGRESS))
818 if (skb_at_tc_ingress(skb))
820 skb_pull(skb, skb->dev->hard_header_len);
821
822 spin_unlock(&ife->tcf_lock);
823
824 return action;
825}
826
827static int tcf_ife_act(struct sk_buff *skb, const struct tc_action *a,

--- 86 unchanged lines hidden ---
819 skb_pull(skb, skb->dev->hard_header_len);
820
821 spin_unlock(&ife->tcf_lock);
822
823 return action;
824}
825
826static int tcf_ife_act(struct sk_buff *skb, const struct tc_action *a,

--- 86 unchanged lines hidden ---