diff --git a/apply_newip.sh b/apply_newip.sh index a415b96be943c3ba40807a3dcc57378c5a89c7cd..19d33a0d8c7f16dcdb0ded5d005645f2ac674a94 100644 --- a/apply_newip.sh +++ b/apply_newip.sh @@ -2,7 +2,6 @@ # # Copyright (c) 2022 Huawei Device Co., Ltd. # -# you can use it under the terms of the GPL V2 and the BSD2 license. # See the LICENSE file in directory / of this repository for complete details. # diff --git a/src/linux/include/net/tcp_nip.h b/src/linux/include/net/tcp_nip.h index f2927a472b6d6326a97408ef394174f78a667207..0e962d027e5bfaa01c14f89b8f5a003180b7e96e 100644 --- a/src/linux/include/net/tcp_nip.h +++ b/src/linux/include/net/tcp_nip.h @@ -161,9 +161,9 @@ static inline bool tcp_nip_write_queue_empty(struct sock *sk) /* connect */ int __tcp_nip_connect(struct sock *sk); -int tcp_newip_conn_request(struct request_sock_ops *rsk_ops, - const struct tcp_request_sock_ops *af_ops, - struct sock *sk, struct sk_buff *skb); +int _tcp_nip_conn_request(struct request_sock_ops *rsk_ops, + const struct tcp_request_sock_ops *af_ops, + struct sock *sk, struct sk_buff *skb); struct sk_buff *tcp_nip_make_synack( const struct sock *sk, struct dst_entry *dst, diff --git a/src/linux/net/newip/Kconfig b/src/linux/net/newip/Kconfig deleted file mode 100644 index 5e40c13d9256b053d8b233932c6a07a0cbb7517d..0000000000000000000000000000000000000000 --- a/src/linux/net/newip/Kconfig +++ /dev/null @@ -1,25 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0-only -# -# Copyright (c) 2022 Huawei Device Co., Ltd. -# -# NewIP configuration -# - -# NewIP as module will cause a CRASH if you try to unload it -menuconfig NEWIP - tristate "The NewIP protocol" - default n - help - Support for NewIP. - - To compile this protocol support as a module, choose M here: the - module will be called NewIP. - -if NEWIP -config NEWIP_FAST_KEEPALIVE - tristate "NewIP fast keepalive" - default n - help - Support for NewIP fast keepalive. -endif # NEWIP - diff --git a/src/linux/net/newip/af_ninet.c b/src/linux/net/newip/af_ninet.c index 867f4d2e010098fe13e3b3da9f2803058ba4696e..b193f9f0142cd34ef3a8d742c35102c8474a3163 100644 --- a/src/linux/net/newip/af_ninet.c +++ b/src/linux/net/newip/af_ninet.c @@ -7,7 +7,7 @@ * * Based on linux/net/ipv6/af_inet6.c */ -#define pr_fmt(fmt) "NIP AF-NIET: " fmt +#define pr_fmt(fmt) "NIP: " fmt #include #include diff --git a/src/linux/net/newip/hooks/Kconfig b/src/linux/net/newip/hooks/Kconfig deleted file mode 100644 index 83e2e44cc8e3cd8f81aa4324543d31badf4c966d..0000000000000000000000000000000000000000 --- a/src/linux/net/newip/hooks/Kconfig +++ /dev/null @@ -1,20 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0-only -# -# Copyright (c) 2022 Huawei Device Co., Ltd. -# -# NewIP Hooks configuration -# - -menu "NewIP Hooks" - -config NEWIP_HOOKS - tristate "NewIP Hooks" - depends on VENDOR_HOOKS && NEWIP - default n - help - Enable NewIP hooks implemented as tracepoints - - Allow NewIP modules to attach to tracepoint "hooks" defined via - DECLARE_TRACE or DECLARE_HOOK - -endmenu diff --git a/src/linux/net/newip/icmp.c b/src/linux/net/newip/icmp.c index c376a0e56c1bf8d3a2b382bd2947a3fb58676dcb..0f3a953ffeab6ac7ac345409c8cf8dca1226aee6 100644 --- a/src/linux/net/newip/icmp.c +++ b/src/linux/net/newip/icmp.c @@ -8,6 +8,8 @@ * Based on net/ipv6/icmp.c * Based on net/ipv4/af_inet.c */ +#define pr_fmt(fmt) "NIP-ICMP: " fmt + #include #include #include diff --git a/src/linux/net/newip/ninet_connection_sock.c b/src/linux/net/newip/ninet_connection_sock.c index 7d92e4faee22621d1aa523af7d82111c635db2a9..288cef5339af6b6ecc57781d57bd2434b9268376 100644 --- a/src/linux/net/newip/ninet_connection_sock.c +++ b/src/linux/net/newip/ninet_connection_sock.c @@ -11,6 +11,8 @@ * * Based on net/ipv4/inet_connection_sock.c */ +#define pr_fmt(fmt) "NIP: " fmt + #include #include #include diff --git a/src/linux/net/newip/ninet_hashtables.c b/src/linux/net/newip/ninet_hashtables.c index b777636d1effb4f097de47080ee93fe7faa5d5ba..5dfea0222d63b7b65c6fbc26209f9714694b61ea 100644 --- a/src/linux/net/newip/ninet_hashtables.c +++ b/src/linux/net/newip/ninet_hashtables.c @@ -15,6 +15,8 @@ * Based on include/net/ipv6.h * Based on net/core/secure_seq.c */ +#define pr_fmt(fmt) "NIP: " fmt + #include #include diff --git a/src/linux/net/newip/nip_addrconf.c b/src/linux/net/newip/nip_addrconf.c index e1ee256b2e0935f7f349951bbddc4dc934047b64..56dc3cf404527879cd3140f9238eec98336e312b 100644 --- a/src/linux/net/newip/nip_addrconf.c +++ b/src/linux/net/newip/nip_addrconf.c @@ -7,6 +7,8 @@ * * Based on net/ipv6/addrconf.c */ +#define pr_fmt(fmt) "NIP: " fmt + #include #include #include diff --git a/src/linux/net/newip/nip_addrconf_core.c b/src/linux/net/newip/nip_addrconf_core.c index 34e9867470a8228995ef09ef9efc5ad25878dfea..e6835b2d471219f9d0f6c360a10b02acb15fc6a5 100644 --- a/src/linux/net/newip/nip_addrconf_core.c +++ b/src/linux/net/newip/nip_addrconf_core.c @@ -7,6 +7,8 @@ * * Based on net/ipv6/addrconf_core.c */ +#define pr_fmt(fmt) "NIP: " fmt + #include #include #include diff --git a/src/linux/net/newip/nip_fib.c b/src/linux/net/newip/nip_fib.c index d3ad7e9cc55407d723ee06824ab99dd138dc9636..2029798c7e366c47f86f81259116a275add57b3f 100644 --- a/src/linux/net/newip/nip_fib.c +++ b/src/linux/net/newip/nip_fib.c @@ -7,6 +7,8 @@ * * Based on net/ipv6/ip6_fib.c */ +#define pr_fmt(fmt) "NIP: " fmt + #include #include #include diff --git a/src/linux/net/newip/nip_fib_rules.c b/src/linux/net/newip/nip_fib_rules.c index 1f3481b20a463a4b6916e97a448bafc80bad2a75..1dc26ed6f4f7e99c7bc4aa798a2b4e6bbe3049c6 100644 --- a/src/linux/net/newip/nip_fib_rules.c +++ b/src/linux/net/newip/nip_fib_rules.c @@ -7,6 +7,8 @@ * Based on net/ipv6/fib_rules.c * Based on net/ipv6/fib6_rules.c */ +#define pr_fmt(fmt) "NIP: " fmt + #include #include #include diff --git a/src/linux/net/newip/nip_hooks_register.c b/src/linux/net/newip/nip_hooks_register.c index 5122286fc1c3d0e9f5df51ffd48ffc3eabf31be1..d8188cb90f74f9443d1fc35aad9f14e923b02696 100644 --- a/src/linux/net/newip/nip_hooks_register.c +++ b/src/linux/net/newip/nip_hooks_register.c @@ -5,6 +5,8 @@ * Definitions for the NewIP Hooks Register module. */ #ifdef CONFIG_NEWIP_HOOKS +#define pr_fmt(fmt) "NIP: " fmt + #include /* ninet_ehashfn */ #include diff --git a/src/linux/net/newip/nip_input.c b/src/linux/net/newip/nip_input.c index 5924887061e7300d6b293189ebb905de7e70a087..5ea944392cf80e1c678c5ec93d00f09fb9a6d1b3 100644 --- a/src/linux/net/newip/nip_input.c +++ b/src/linux/net/newip/nip_input.c @@ -7,6 +7,8 @@ * * Based on net/ipv6/ip6_input.c */ +#define pr_fmt(fmt) "NIP-INPUT: " fmt + #include #include #include @@ -50,7 +52,7 @@ static int nip_rcv_finish(struct sk_buff *skb) if (net->ipv4.sysctl_ip_early_demux && !skb_dst(skb) && !skb->sk) { const struct ninet_protocol *ipprot; - DEBUG("%s: try to early demux skb.", __func__); + DEBUG("%s: try to early demux skb, nexthdr=0x%x.", __func__, NIPCB(skb)->nexthdr); ipprot = rcu_dereference(ninet_protos[NIPCB(skb)->nexthdr]); if (ipprot) edemux = READ_ONCE(ipprot->early_demux); diff --git a/src/linux/net/newip/nip_output.c b/src/linux/net/newip/nip_output.c index d3949379618bf03e944cb9a3d33d698577ada759..6c5642a61850c220342b1de9327dd1f5a0ae11f9 100644 --- a/src/linux/net/newip/nip_output.c +++ b/src/linux/net/newip/nip_output.c @@ -7,6 +7,8 @@ * * Based on net/ipv6/ip6_output.c */ +#define pr_fmt(fmt) "NIP-OUTPUT: " fmt + #include #include #include diff --git a/src/linux/net/newip/nip_sockglue.c b/src/linux/net/newip/nip_sockglue.c index a94fbef7341a9ef919920630956680234c952a97..d33ac0b1b08c434c8b2c09fc0c849ce02442ce07 100644 --- a/src/linux/net/newip/nip_sockglue.c +++ b/src/linux/net/newip/nip_sockglue.c @@ -10,6 +10,8 @@ * * Based on net/ipv4/ip_sockglue.c */ +#define pr_fmt(fmt) "NIP: " fmt + #include #include #include diff --git a/src/linux/net/newip/nndisc.c b/src/linux/net/newip/nndisc.c index e365b98bf8cffda93b7c8f7a40ac958554f772ca..a46e4f2123541e93c16f4e9c991c88f8cd304746 100644 --- a/src/linux/net/newip/nndisc.c +++ b/src/linux/net/newip/nndisc.c @@ -7,6 +7,8 @@ * * Based on net/ipv6/ndisc.c */ +#define pr_fmt(fmt) "NIP-ND: " fmt + #include #include #include diff --git a/src/linux/net/newip/protocol.c b/src/linux/net/newip/protocol.c index 1f35d9ee2c77758d1c0dc2ffe0983e91298dca34..8d7f3ea57b608a204b8ecba5d399bfb66c5fad31 100644 --- a/src/linux/net/newip/protocol.c +++ b/src/linux/net/newip/protocol.c @@ -10,6 +10,8 @@ * * Based on net/ipv6/protocol.c */ +#define pr_fmt(fmt) "NIP: " fmt + #include #include #include diff --git a/src/linux/net/newip/route.c b/src/linux/net/newip/route.c index 33af9c19fa2c97bb1ffeeee7048d0af28e5c26bc..3c4f40712a47864fa02a1b28605bb37186ce1857 100644 --- a/src/linux/net/newip/route.c +++ b/src/linux/net/newip/route.c @@ -12,6 +12,8 @@ * Based on net/ipv4/route.c * Based on net/ipv6/route.c */ +#define pr_fmt(fmt) "NIP: " fmt + #include #include #include diff --git a/src/linux/net/newip/tcp_nip.c b/src/linux/net/newip/tcp_nip.c index 2bfd1167895ec4392573773dab70ecb8a51d1e0a..b08ed211b24cd9593809b670aa359665f55236b4 100644 --- a/src/linux/net/newip/tcp_nip.c +++ b/src/linux/net/newip/tcp_nip.c @@ -512,8 +512,8 @@ void ninet_sk_rx_dst_set(struct sock *sk, const struct sk_buff *skb) */ static int tcp_nip_conn_request(struct sock *sk, struct sk_buff *skb) { - return tcp_newip_conn_request(&tcp_nip_request_sock_ops, - &tcp_request_sock_newip_ops, sk, skb); + return _tcp_nip_conn_request(&tcp_nip_request_sock_ops, + &tcp_request_sock_newip_ops, sk, skb); } /* Function @@ -733,9 +733,9 @@ void tcp_nip_keepalive_enable(struct sock *sk) return; } - pr_crit("%s ok, HZ=%u, time/probes/intvl [%u, %u, %u]", - __func__, HZ, tp->keepalive_time, tp->keepalive_probes, - tp->keepalive_intvl); + DEBUG("%s ok, HZ=%u, time/probes/intvl [%u, %u, %u]", + __func__, HZ, tp->keepalive_time, tp->keepalive_probes, + tp->keepalive_intvl); tp->nip_keepalive_enable = true; #endif } diff --git a/src/linux/net/newip/tcp_nip_input.c b/src/linux/net/newip/tcp_nip_input.c index 2aecc7ed06cae97cd92c2d1997745f2af2d06d91..8821e5e7345a3ca4370714710811996d06837af9 100644 --- a/src/linux/net/newip/tcp_nip_input.c +++ b/src/linux/net/newip/tcp_nip_input.c @@ -766,9 +766,9 @@ void tcp_nip_openreq_init_rwin(struct request_sock *req, * sk: transmission control block. * skb: Transfer control block buffer. */ -int tcp_newip_conn_request(struct request_sock_ops *rsk_ops, - const struct tcp_request_sock_ops *af_ops, - struct sock *sk, struct sk_buff *skb) +int _tcp_nip_conn_request(struct request_sock_ops *rsk_ops, + const struct tcp_request_sock_ops *af_ops, + struct sock *sk, struct sk_buff *skb) { struct tcp_fastopen_cookie foc = { .len = -1 }; diff --git a/src/linux/net/newip/udp.c b/src/linux/net/newip/udp.c index c36b6a168ff2199456354cd5211bb52466ea2de3..1b4f3fb49c2d4ac38e6f061d78e99b411d0e0628 100644 --- a/src/linux/net/newip/udp.c +++ b/src/linux/net/newip/udp.c @@ -12,6 +12,8 @@ * Based on net/ipv4/udp.c * Based on net/ipv6/udp.c */ +#define pr_fmt(fmt) "NIP-UDP: " fmt + #include #include #include