mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-07 04:12:04 -04:00
net/sched: act_mpls: Add action to push MPLS LSE before Ethernet header
Define the MAC_PUSH action which pushes an MPLS LSE before the mac header (instead of between the mac and the network headers as the plain PUSH action does). The only special case is when the skb has an offloaded VLAN. In that case, it has to be inlined before pushing the MPLS header. Change-Id: Iea0792dac8682bccc4a6a506244c81ed799f779f Signed-off-by: Guillaume Nault gnault@redhat.com Signed-off-by: David S. Miller davem@davemloft.net Git-commit: a45294af9e96a3e060b6272fa7cd2c4b196de335 Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git [quic_jguidry@quicinc.com: Enabled net/sched filtering and classification in sdxlemur.config] Signed-off-by: James Wyatt Guidry <quic_jguidry@quicinc.com>
This commit is contained in:
parent
df885aa30f
commit
79ff84826e
4 changed files with 120 additions and 0 deletions
84
arch/arm/configs/vendor/sdxlemur.config
vendored
84
arch/arm/configs/vendor/sdxlemur.config
vendored
|
|
@ -384,3 +384,87 @@ CONFIG_SDX_EXT_IPC=y
|
|||
CONFIG_MACSEC=y
|
||||
CONFIG_SYSVIPC=y
|
||||
CONFIG_NET_SCHED_ACT_VLAN_QGKI=y
|
||||
CONFIG_LWTUNNEL=y
|
||||
#
|
||||
# MPLS
|
||||
#
|
||||
CONFIG_MPLS=y
|
||||
CONFIG_NET_MPLS_GSO=y
|
||||
CONFIG_MPLS_ROUTING=y
|
||||
CONFIG_MPLS_IPTUNNEL=y
|
||||
#
|
||||
# Queueing/Scheduling
|
||||
#
|
||||
CONFIG_NET_SCHED=y
|
||||
CONFIG_NET_SCH_CBQ=y
|
||||
CONFIG_NET_SCH_HTB=y
|
||||
CONFIG_NET_SCH_HFSC=y
|
||||
CONFIG_NET_SCH_PRIO=y
|
||||
CONFIG_NET_SCH_MULTIQ=y
|
||||
CONFIG_NET_SCH_RED=y
|
||||
CONFIG_NET_SCH_SFB=y
|
||||
CONFIG_NET_SCH_SFQ=y
|
||||
CONFIG_NET_SCH_TEQL=y
|
||||
CONFIG_NET_SCH_TBF=y
|
||||
CONFIG_NET_SCH_CBS=y
|
||||
CONFIG_NET_SCH_ETF=y
|
||||
CONFIG_NET_SCH_TAPRIO=y
|
||||
CONFIG_NET_SCH_GRED=y
|
||||
CONFIG_NET_SCH_DSMARK=y
|
||||
CONFIG_NET_SCH_NETEM=y
|
||||
CONFIG_NET_SCH_DRR=y
|
||||
CONFIG_NET_SCH_MQPRIO=y
|
||||
CONFIG_NET_SCH_SKBPRIO=y
|
||||
CONFIG_NET_SCH_CHOKE=y
|
||||
CONFIG_NET_SCH_QFQ=y
|
||||
CONFIG_NET_SCH_CODEL=y
|
||||
CONFIG_NET_SCH_FQ_CODEL=y
|
||||
CONFIG_NET_SCH_CAKE=y
|
||||
CONFIG_NET_SCH_FQ=y
|
||||
CONFIG_NET_SCH_HHF=y
|
||||
CONFIG_NET_SCH_PIE=y
|
||||
CONFIG_NET_SCH_INGRESS=y
|
||||
CONFIG_NET_SCH_PLUG=y
|
||||
CONFIG_NET_SCH_DEFAULT=y
|
||||
#
|
||||
# Classification
|
||||
#
|
||||
CONFIG_NET_CLS=y
|
||||
CONFIG_NET_CLS_BASIC=y
|
||||
CONFIG_NET_CLS_TCINDEX=y
|
||||
CONFIG_NET_CLS_ROUTE4=y
|
||||
CONFIG_NET_CLS_FW=y
|
||||
CONFIG_NET_CLS_U32=y
|
||||
CONFIG_CLS_U32_PERF=y
|
||||
CONFIG_CLS_U32_MARK=y
|
||||
CONFIG_NET_CLS_RSVP=y
|
||||
CONFIG_NET_CLS_RSVP6=y
|
||||
CONFIG_NET_CLS_FLOW=y
|
||||
CONFIG_NET_CLS_CGROUP=y
|
||||
CONFIG_NET_CLS_BPF=y
|
||||
CONFIG_NET_CLS_FLOWER=y
|
||||
CONFIG_NET_CLS_MATCHALL=y
|
||||
CONFIG_NET_EMATCH=y
|
||||
CONFIG_NET_CLS_ACT=y
|
||||
CONFIG_NET_ACT_POLICE=y
|
||||
CONFIG_NET_ACT_GACT=y
|
||||
CONFIG_NET_ACT_MIRRED=y
|
||||
CONFIG_NET_ACT_SAMPLE=y
|
||||
CONFIG_NET_ACT_IPT=y
|
||||
CONFIG_NET_ACT_NAT=y
|
||||
CONFIG_NET_ACT_PEDIT=y
|
||||
CONFIG_NET_ACT_SIMP=y
|
||||
CONFIG_NET_ACT_SKBEDIT=y
|
||||
CONFIG_NET_ACT_CSUM=y
|
||||
CONFIG_NET_ACT_MPLS=y
|
||||
CONFIG_NET_ACT_VLAN=y
|
||||
CONFIG_NET_ACT_BPF=y
|
||||
CONFIG_NET_ACT_CONNMARK=y
|
||||
CONFIG_NET_ACT_CTINFO=y
|
||||
CONFIG_NET_ACT_SKBMOD=y
|
||||
CONFIG_NET_ACT_IFE=y
|
||||
CONFIG_NET_ACT_TUNNEL_KEY=y
|
||||
CONFIG_NET_ACT_CT=y
|
||||
CONFIG_NET_TC_SKB_EXT=y
|
||||
CONFIG_NET_SCH_FIFO=y
|
||||
CONFIG_NET_SCHED_ACT_MPLS_QGKI=y
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
#define TCA_MPLS_ACT_PUSH 2
|
||||
#define TCA_MPLS_ACT_MODIFY 3
|
||||
#define TCA_MPLS_ACT_DEC_TTL 4
|
||||
#define TCA_MPLS_ACT_MAC_PUSH 5
|
||||
|
||||
struct tc_mpls {
|
||||
tc_gen; /* generic TC action fields. */
|
||||
|
|
|
|||
|
|
@ -988,6 +988,19 @@ config NET_SCHED_ACT_VLAN_QGKI
|
|||
|
||||
If unsure, say Y.
|
||||
|
||||
config NET_SCHED_ACT_MPLS_QGKI
|
||||
bool "MPLS mac_push patch"
|
||||
depends on NET_ACT_MPLS
|
||||
depends on QGKI
|
||||
help
|
||||
Say Y here to support tc MPLS mac_push actions. Macro guards the code
|
||||
against ABI breakage. When this flag is enabled, it is safe to assume
|
||||
that the build is a Non GKI build.
|
||||
|
||||
Say N to exclude this support.
|
||||
|
||||
If unsure, say Y.
|
||||
|
||||
endif # NET_SCHED
|
||||
|
||||
config NET_SCH_FIFO
|
||||
|
|
|
|||
|
|
@ -87,6 +87,25 @@ static int tcf_mpls_act(struct sk_buff *skb, const struct tc_action *a,
|
|||
skb->dev && skb->dev->type == ARPHRD_ETHER))
|
||||
goto drop;
|
||||
break;
|
||||
#ifdef CONFIG_NET_SCHED_ACT_MPLS_QGKI
|
||||
case TCA_MPLS_ACT_MAC_PUSH:
|
||||
if (skb_vlan_tag_present(skb)) {
|
||||
if (__vlan_insert_inner_tag(skb, skb->vlan_proto,
|
||||
skb_vlan_tag_get(skb),
|
||||
ETH_HLEN) < 0)
|
||||
goto drop;
|
||||
|
||||
skb->protocol = skb->vlan_proto;
|
||||
__vlan_hwaccel_clear_tag(skb);
|
||||
}
|
||||
|
||||
new_lse = tcf_mpls_get_lse(NULL, p, mac_len ||
|
||||
!eth_p_mpls(skb->protocol));
|
||||
|
||||
if (skb_mpls_push(skb, new_lse, p->tcfm_proto, 0, false))
|
||||
goto drop;
|
||||
break;
|
||||
#endif
|
||||
case TCA_MPLS_ACT_MODIFY:
|
||||
if (!pskb_may_pull(skb,
|
||||
skb_network_offset(skb) + MPLS_HLEN))
|
||||
|
|
@ -191,6 +210,9 @@ static int tcf_mpls_init(struct net *net, struct nlattr *nla,
|
|||
}
|
||||
break;
|
||||
case TCA_MPLS_ACT_PUSH:
|
||||
#ifdef CONFIG_NET_SCHED_ACT_MPLS_QGKI
|
||||
case TCA_MPLS_ACT_MAC_PUSH:
|
||||
#endif
|
||||
if (!tb[TCA_MPLS_LABEL]) {
|
||||
NL_SET_ERR_MSG_MOD(extack, "Label is required for MPLS push");
|
||||
return -EINVAL;
|
||||
|
|
|
|||
Loading…
Reference in a new issue