1、基于最新内核侵入式修改内容刷新sfc newip配套代码,删除newip目录Kconfig文件,直接使用内核仓net_hooks目录的Kconfig

2、文件增加#define pr_fmt(fmt) "NIP: " fmt,保证debug打印前增加NIP打印,快速获取NIP相关日志

Signed-off-by: yangyanjun <yangyanjun@huawei.com>
This commit is contained in:
yangyanjun
2022-10-21 11:23:10 +08:00
parent 0294474b07
commit f496c886ff
18 changed files with 32 additions and 40 deletions
-18
View File
@@ -1,18 +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
# linux-5.10/net/Kconfig define NEWIP
if NEWIP
config NEWIP_FAST_KEEPALIVE
tristate "NewIP fast keepalive"
default n
help
Support for NewIP fast keepalive.
endif # NEWIP
+1 -1
View File
@@ -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 <linux/module.h>
#include <linux/capability.h>
-20
View File
@@ -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
+2
View File
@@ -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 <linux/module.h>
#include <linux/errno.h>
#include <linux/types.h>
@@ -11,6 +11,8 @@
*
* Based on net/ipv4/inet_connection_sock.c
*/
#define pr_fmt(fmt) "NIP: " fmt
#include <linux/module.h>
#include <linux/nip.h>
#include <linux/jhash.h>
+2
View File
@@ -15,6 +15,8 @@
* Based on include/net/ipv6.h
* Based on net/core/secure_seq.c
*/
#define pr_fmt(fmt) "NIP: " fmt
#include <linux/module.h>
#include <linux/random.h>
+2
View File
@@ -7,6 +7,8 @@
*
* Based on net/ipv6/addrconf.c
*/
#define pr_fmt(fmt) "NIP: " fmt
#include <linux/errno.h>
#include <linux/types.h>
#include <linux/kernel.h>
+2
View File
@@ -7,6 +7,8 @@
*
* Based on net/ipv6/addrconf_core.c
*/
#define pr_fmt(fmt) "NIP: " fmt
#include <net/nip.h>
#include <net/nip_addrconf.h>
#include <net/ip.h>
+2
View File
@@ -7,6 +7,8 @@
*
* Based on net/ipv6/ip6_fib.c
*/
#define pr_fmt(fmt) "NIP: " fmt
#include <linux/errno.h>
#include <linux/types.h>
#include <linux/net.h>
+2
View File
@@ -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 <net/nip_fib.h>
#include <linux/netdevice.h>
#include <linux/notifier.h>
+2
View File
@@ -5,6 +5,8 @@
* Definitions for the NewIP Hooks Register module.
*/
#ifdef CONFIG_NEWIP_HOOKS
#define pr_fmt(fmt) "NIP: " fmt
#include <net/ninet_hashtables.h> /* ninet_ehashfn */
#include <trace/hooks/nip_hooks.h>
+3 -1
View File
@@ -7,6 +7,8 @@
*
* Based on net/ipv6/ip6_input.c
*/
#define pr_fmt(fmt) "NIP-INPUT: " fmt
#include <linux/errno.h>
#include <linux/types.h>
#include <linux/socket.h>
@@ -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);
+2
View File
@@ -7,6 +7,8 @@
*
* Based on net/ipv6/ip6_output.c
*/
#define pr_fmt(fmt) "NIP-OUTPUT: " fmt
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/string.h>
+2
View File
@@ -10,6 +10,8 @@
*
* Based on net/ipv4/ip_sockglue.c
*/
#define pr_fmt(fmt) "NIP: " fmt
#include <linux/module.h>
#include <linux/types.h>
#include <linux/skbuff.h>
+2
View File
@@ -7,6 +7,8 @@
*
* Based on net/ipv6/ndisc.c
*/
#define pr_fmt(fmt) "NIP-ND: " fmt
#include <linux/module.h>
#include <linux/errno.h>
#include <linux/types.h>
+2
View File
@@ -10,6 +10,8 @@
*
* Based on net/ipv6/protocol.c
*/
#define pr_fmt(fmt) "NIP: " fmt
#include <net/protocol.h>
#include <linux/module.h>
#include <linux/netdevice.h>
+2
View File
@@ -12,6 +12,8 @@
* Based on net/ipv4/route.c
* Based on net/ipv6/route.c
*/
#define pr_fmt(fmt) "NIP: " fmt
#include <linux/module.h>
#include <linux/netdevice.h>
#include <linux/socket.h>
+2
View File
@@ -12,6 +12,8 @@
* Based on net/ipv4/udp.c
* Based on net/ipv6/udp.c
*/
#define pr_fmt(fmt) "NIP-UDP: " fmt
#include <linux/uaccess.h>
#include <linux/errno.h>
#include <linux/if_arp.h>