diff --git a/target/linux/generic/hack-4.9/950-net-patch-linux-kernel-to-support-shortcut-fe.patch b/target/linux/generic/hack-4.9/950-net-patch-linux-kernel-to-support-shortcut-fe.patch index 69b53ca99..e7844effd 100644 --- a/target/linux/generic/hack-4.9/950-net-patch-linux-kernel-to-support-shortcut-fe.patch +++ b/target/linux/generic/hack-4.9/950-net-patch-linux-kernel-to-support-shortcut-fe.patch @@ -24,11 +24,13 @@ Signed-off-by: Murat Sezgin net/netfilter/nf_conntrack_proto_tcp.c | 10 ++++++++++ 4 files changed, 41 insertions(+) +diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h +index 9a0c945..56f4007 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h -@@ -753,6 +753,9 @@ struct sk_buff { +@@ -738,6 +738,9 @@ struct sk_buff { + #endif __u8 ipvs_property:1; - __u8 inner_protocol_type:1; +#ifdef CONFIG_SHORTCUT_FE + __u8 fast_forwarded:1; @@ -36,6 +38,8 @@ Signed-off-by: Murat Sezgin __u8 remcsum_offload:1; #ifdef CONFIG_NET_SWITCHDEV __u8 offload_fwd_mark:1; +diff --git a/net/Kconfig b/net/Kconfig +index b4621e1..6ba72cf 100644 --- a/net/Kconfig +++ b/net/Kconfig @@ -444,3 +444,6 @@ config HAVE_CBPF_JIT @@ -45,9 +49,11 @@ Signed-off-by: Murat Sezgin + +config SHORTCUT_FE + bool "Enables kernel network stack path for Shortcut Forwarding Engine" +diff --git a/net/core/dev.c b/net/core/dev.c +index ca39cd2..74cd937 100644 --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -2972,6 +2972,12 @@ static int xmit_one(struct sk_buff *skb, +@@ -2929,8 +2929,17 @@ static int xmit_one(struct sk_buff *skb, struct net_device *dev, unsigned int len; int rc; @@ -57,12 +63,7 @@ Signed-off-by: Murat Sezgin + */ + if (!skb->fast_forwarded) { +#endif - #if defined(CONFIG_IMQ) || defined(CONFIG_IMQ_MODULE) - if ((!list_empty(&ptype_all) || !list_empty(&dev->ptype_all)) && - !(skb->imq_flags & IMQ_F_ENQUEUE)) -@@ -2979,6 +2985,9 @@ static int xmit_one(struct sk_buff *skb, if (!list_empty(&ptype_all) || !list_empty(&dev->ptype_all)) - #endif dev_queue_xmit_nit(skb, dev); +#ifdef CONFIG_SHORTCUT_FE + } @@ -70,7 +71,7 @@ Signed-off-by: Murat Sezgin #ifdef CONFIG_ETHERNET_PACKET_MANGLE if (!dev->eth_mangle_tx || -@@ -4130,6 +4139,11 @@ void netdev_rx_handler_unregister(struct +@@ -4061,6 +4070,11 @@ void netdev_rx_handler_unregister(struct net_device *dev) } EXPORT_SYMBOL_GPL(netdev_rx_handler_unregister); @@ -82,7 +83,7 @@ Signed-off-by: Murat Sezgin /* * Limit the use of PFMEMALLOC reserves to those protocols that implement * the special handling of PFMEMALLOC skbs. -@@ -4177,6 +4191,9 @@ static int __netif_receive_skb_core(stru +@@ -4108,6 +4122,9 @@ static int __netif_receive_skb_core(struct sk_buff *skb, bool pfmemalloc) bool deliver_exact = false; int ret = NET_RX_DROP; __be16 type; @@ -92,7 +93,7 @@ Signed-off-by: Murat Sezgin net_timestamp_check(!netdev_tstamp_prequeue, skb); -@@ -4203,6 +4220,14 @@ another_round: +@@ -4134,6 +4151,14 @@ static int __netif_receive_skb_core(struct sk_buff *skb, bool pfmemalloc) goto out; } @@ -107,6 +108,8 @@ Signed-off-by: Murat Sezgin #ifdef CONFIG_NET_CLS_ACT if (skb->tc_verd & TC_NCLS) { skb->tc_verd = CLR_TC_NCLS(skb->tc_verd); +diff --git a/net/netfilter/nf_conntrack_proto_tcp.c b/net/netfilter/nf_conntrack_proto_tcp.c +index f24b626..4581481 100644 --- a/net/netfilter/nf_conntrack_proto_tcp.c +++ b/net/netfilter/nf_conntrack_proto_tcp.c @@ -34,12 +34,22 @@ @@ -132,3 +135,6 @@ Signed-off-by: Murat Sezgin /* If it is set to zero, we disable picking up already established connections. */ +-- +2.7.4 + diff --git a/target/linux/generic/hack-4.9/951-bridge-Add-new-bridge-APIs-needed-for-network-HW-acc.patch b/target/linux/generic/hack-4.9/951-bridge-Add-new-bridge-APIs-needed-for-network-HW-acc.patch index b576ad91b..5cc7dabad 100644 --- a/target/linux/generic/hack-4.9/951-bridge-Add-new-bridge-APIs-needed-for-network-HW-acc.patch +++ b/target/linux/generic/hack-4.9/951-bridge-Add-new-bridge-APIs-needed-for-network-HW-acc.patch @@ -24,6 +24,8 @@ Signed-off-by: Murat Sezgin net/bridge/br_if.c | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+) +diff --git a/include/linux/if_bridge.h b/include/linux/if_bridge.h +index 0911c8c..4473f62 100644 --- a/include/linux/if_bridge.h +++ b/include/linux/if_bridge.h @@ -52,6 +52,7 @@ struct br_ip_list { @@ -34,9 +36,11 @@ Signed-off-by: Murat Sezgin typedef int br_should_route_hook_t(struct sk_buff *skb); extern br_should_route_hook_t __rcu *br_should_route_hook; +diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c +index ed0dd33..342b2d9 100644 --- a/net/bridge/br_if.c +++ b/net/bridge/br_if.c -@@ -654,3 +654,28 @@ void br_port_flags_change(struct net_bri +@@ -655,3 +655,28 @@ void br_port_flags_change(struct net_bridge_port *p, unsigned long mask) if (mask & BR_AUTO_MASK) nbp_update_port_count(br); } @@ -65,3 +69,6 @@ Signed-off-by: Murat Sezgin + u64_stats_update_end(&stats->syncp); +} +EXPORT_SYMBOL_GPL(br_dev_update_stats); +-- +2.7.4 + diff --git a/target/linux/generic/hack-4.9/952-net-conntrack-events-support-multiple-registrant.patch b/target/linux/generic/hack-4.9/952-net-conntrack-events-support-multiple-registrant.patch index 1ad4ad2ea..a898c4a69 100644 --- a/target/linux/generic/hack-4.9/952-net-conntrack-events-support-multiple-registrant.patch +++ b/target/linux/generic/hack-4.9/952-net-conntrack-events-support-multiple-registrant.patch @@ -20,6 +20,8 @@ Signed-off-by: Zhi Chen net/netfilter/nf_conntrack_netlink.c | 19 ++++++ 6 files changed, 139 insertions(+), 1 deletion(-) +diff --git a/include/net/netfilter/nf_conntrack_ecache.h b/include/net/netfilter/nf_conntrack_ecache.h +index 12d967b..c2b98b6 100644 --- a/include/net/netfilter/nf_conntrack_ecache.h +++ b/include/net/netfilter/nf_conntrack_ecache.h @@ -70,6 +70,10 @@ struct nf_ct_event { @@ -33,7 +35,7 @@ Signed-off-by: Zhi Chen struct nf_ct_event_notifier { int (*fcn)(unsigned int events, struct nf_ct_event *item); }; -@@ -78,6 +82,7 @@ int nf_conntrack_register_notifier(struc +@@ -78,6 +82,7 @@ int nf_conntrack_register_notifier(struct net *net, struct nf_ct_event_notifier *nb); void nf_conntrack_unregister_notifier(struct net *net, struct nf_ct_event_notifier *nb); @@ -41,7 +43,7 @@ Signed-off-by: Zhi Chen void nf_ct_deliver_cached_events(struct nf_conn *ct); int nf_conntrack_eventmask_report(unsigned int eventmask, struct nf_conn *ct, -@@ -86,11 +91,13 @@ int nf_conntrack_eventmask_report(unsign +@@ -86,11 +91,13 @@ int nf_conntrack_eventmask_report(unsigned int eventmask, struct nf_conn *ct, static inline void nf_conntrack_event_cache(enum ip_conntrack_events event, struct nf_conn *ct) { @@ -69,7 +71,7 @@ Signed-off-by: Zhi Chen return nf_conntrack_eventmask_report(1 << event, ct, portid, report); } -@@ -114,10 +123,12 @@ nf_conntrack_event_report(enum ip_conntr +@@ -114,10 +123,12 @@ nf_conntrack_event_report(enum ip_conntrack_events event, struct nf_conn *ct, static inline int nf_conntrack_event(enum ip_conntrack_events event, struct nf_conn *ct) { @@ -82,6 +84,8 @@ Signed-off-by: Zhi Chen return nf_conntrack_eventmask_report(1 << event, ct, 0, 0); } +diff --git a/include/net/netns/conntrack.h b/include/net/netns/conntrack.h +index e469e85..1d31db8 100644 --- a/include/net/netns/conntrack.h +++ b/include/net/netns/conntrack.h @@ -86,7 +86,11 @@ struct netns_ct { @@ -96,6 +100,8 @@ Signed-off-by: Zhi Chen struct nf_exp_event_notifier __rcu *nf_expect_event_cb; struct nf_ip_net nf_ct_proto; #if defined(CONFIG_NF_CONNTRACK_LABELS) +diff --git a/net/netfilter/Kconfig b/net/netfilter/Kconfig +index 63073be..08d7aab 100644 --- a/net/netfilter/Kconfig +++ b/net/netfilter/Kconfig @@ -136,6 +136,14 @@ config NF_CONNTRACK_TIMEOUT @@ -113,9 +119,11 @@ Signed-off-by: Zhi Chen config NF_CONNTRACK_TIMESTAMP bool 'Connection tracking timestamping' depends on NETFILTER_ADVANCED +diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c +index 6bd1508..9b81c7c 100644 --- a/net/netfilter/nf_conntrack_core.c +++ b/net/netfilter/nf_conntrack_core.c -@@ -2077,6 +2077,10 @@ int nf_conntrack_init_net(struct net *ne +@@ -1998,6 +1998,10 @@ int nf_conntrack_init_net(struct net *net) ret = nf_conntrack_proto_pernet_init(net); if (ret < 0) goto err_proto; @@ -126,6 +134,8 @@ Signed-off-by: Zhi Chen return 0; err_proto: +diff --git a/net/netfilter/nf_conntrack_ecache.c b/net/netfilter/nf_conntrack_ecache.c +index da9df2d..e0e2a8f 100644 --- a/net/netfilter/nf_conntrack_ecache.c +++ b/net/netfilter/nf_conntrack_ecache.c @@ -18,6 +18,9 @@ @@ -138,7 +148,7 @@ Signed-off-by: Zhi Chen #include #include #include -@@ -117,6 +120,38 @@ static void ecache_work(struct work_stru +@@ -117,6 +120,38 @@ static void ecache_work(struct work_struct *work) schedule_delayed_work(&ctnet->ecache_dwork, delay); } @@ -177,7 +187,7 @@ Signed-off-by: Zhi Chen int nf_conntrack_eventmask_report(unsigned int eventmask, struct nf_conn *ct, u32 portid, int report) { -@@ -171,10 +206,52 @@ out_unlock: +@@ -171,10 +206,52 @@ int nf_conntrack_eventmask_report(unsigned int eventmask, struct nf_conn *ct, rcu_read_unlock(); return ret; } @@ -230,7 +240,7 @@ Signed-off-by: Zhi Chen void nf_ct_deliver_cached_events(struct nf_conn *ct) { struct net *net = nf_ct_net(ct); -@@ -225,6 +302,7 @@ void nf_ct_deliver_cached_events(struct +@@ -225,6 +302,7 @@ void nf_ct_deliver_cached_events(struct nf_conn *ct) out_unlock: rcu_read_unlock(); } @@ -238,7 +248,7 @@ Signed-off-by: Zhi Chen EXPORT_SYMBOL_GPL(nf_ct_deliver_cached_events); void nf_ct_expect_event_report(enum ip_conntrack_expect_events event, -@@ -257,6 +335,12 @@ out_unlock: +@@ -257,6 +335,12 @@ void nf_ct_expect_event_report(enum ip_conntrack_expect_events event, rcu_read_unlock(); } @@ -251,7 +261,7 @@ Signed-off-by: Zhi Chen int nf_conntrack_register_notifier(struct net *net, struct nf_ct_event_notifier *new) { -@@ -277,8 +361,15 @@ out_unlock: +@@ -277,8 +361,15 @@ int nf_conntrack_register_notifier(struct net *net, mutex_unlock(&nf_ct_ecache_mutex); return ret; } @@ -267,14 +277,16 @@ Signed-off-by: Zhi Chen void nf_conntrack_unregister_notifier(struct net *net, struct nf_ct_event_notifier *new) { -@@ -292,6 +383,7 @@ void nf_conntrack_unregister_notifier(st +@@ -291,6 +382,7 @@ void nf_conntrack_unregister_notifier(struct net *net, + RCU_INIT_POINTER(net->ct.nf_conntrack_event_cb, NULL); mutex_unlock(&nf_ct_ecache_mutex); - /* synchronize_rcu() is called from ctnetlink_exit. */ } +#endif EXPORT_SYMBOL_GPL(nf_conntrack_unregister_notifier); int nf_ct_expect_register_notifier(struct net *net, +diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c +index 04111c1..8c741f7 100644 --- a/net/netfilter/nf_conntrack_netlink.c +++ b/net/netfilter/nf_conntrack_netlink.c @@ -28,6 +28,11 @@ @@ -287,9 +299,9 @@ Signed-off-by: Zhi Chen +#endif + #include - #include -@@ -618,14 +623,22 @@ static size_t ctnetlink_nlmsg_size(const + #include +@@ -615,14 +620,22 @@ static size_t ctnetlink_nlmsg_size(const struct nf_conn *ct) ; } @@ -312,7 +324,7 @@ Signed-off-by: Zhi Chen struct nf_conn *ct = item->ct; struct sk_buff *skb; unsigned int type; -@@ -3288,9 +3301,15 @@ static int ctnetlink_stat_exp_cpu(struct +@@ -3260,9 +3273,15 @@ static int ctnetlink_stat_exp_cpu(struct net *net, struct sock *ctnl, } #ifdef CONFIG_NF_CONNTRACK_EVENTS @@ -328,3 +340,6 @@ Signed-off-by: Zhi Chen static struct nf_exp_event_notifier ctnl_notifier_exp = { .fcn = ctnetlink_expect_event, +-- +2.7.4 +