[PATCH net-next] net: tap: use eth_type_vlan in tap_get_user

2021-01-13 Thread menglong8 . dong
From: Menglong Dong Replace the check for ETH_P_8021Q and ETH_P_8021AD in tap_get_user with eth_type_vlan. Signed-off-by: Menglong Dong --- drivers/net/tap.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/tap.c b/drivers/net/tap.c index 3c652c8ac5ba..cf9197fe

[PATCH net-next] net: core: use eth_type_vlan in tap_get_user_xdp

2021-01-13 Thread menglong8 . dong
From: Menglong Dong Replace the check for ETH_P_8021Q and ETH_P_8021AD in tap_get_user_xdp with eth_type_vlan. Signed-off-by: Menglong Dong --- drivers/net/tap.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/tap.c b/drivers/net/tap.c index 3c652c8ac5ba..e007

[PATCH net-next] net: bridge: use eth_type_vlan in br_dev_queue_push_xmit

2021-01-13 Thread menglong8 . dong
From: Menglong Dong Replace the check for ETH_P_8021Q and ETH_P_8021AD in br_dev_queue_push_xmit with eth_type_vlan. Signed-off-by: Menglong Dong --- net/bridge/br_forward.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/bridge/br_forward.c b/net/bridge/br_forward.c

[PATCH v2 net-next] net: bridge: check vlan with eth_type_vlan() method

2021-01-14 Thread menglong8 . dong
From: Menglong Dong Replace some checks for ETH_P_8021Q and ETH_P_8021AD with eth_type_vlan(). Signed-off-by: Menglong Dong --- v2: - use eth_type_vlan() in br_validate() and __br_vlan_set_proto() too. --- net/bridge/br_forward.c | 3 +-- net/bridge/br_netlink.c | 11 +++ net/bridge

[PATCH v2 net-next] net: tap: check vlan with eth_type_vlan() method

2021-01-14 Thread menglong8 . dong
From: Menglong Dong Replace some checks for ETH_P_8021Q and ETH_P_8021AD in drivers/net/tap.c with eth_type_vlan. Signed-off-by: Menglong Dong --- v2: - use eth_type_vlan() in tap_get_user_xdp() too. --- drivers/net/tap.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git

[PATCH v3 net-next] net: bridge: check vlan with eth_type_vlan() method

2021-01-14 Thread menglong8 . dong
From: Menglong Dong Replace some checks for ETH_P_8021Q and ETH_P_8021AD with eth_type_vlan(). Signed-off-by: Menglong Dong --- v3: - fix compile warning in br_vlan_set_proto() by casting 'val' to be16. v2: - use eth_type_vlan() in br_validate() and __br_vlan_set_proto() too. --- net/brid

[PATCH v4 net-next] net: bridge: check vlan with eth_type_vlan() method

2021-01-17 Thread menglong8 . dong
From: Menglong Dong Replace some checks for ETH_P_8021Q and ETH_P_8021AD with eth_type_vlan(). Signed-off-by: Menglong Dong --- v4: - remove unnecessary brackets. v3: - fix compile warning in br_vlan_set_proto() by casting 'val' to be16. v2: - use eth_type_vlan() in br_validate() and __br_v

[PATCH net-next] net: core: init every ctl_table in netns_core_table

2021-01-17 Thread menglong8 . dong
From: Menglong Dong For now, there is only one element in netns_core_table, and it is inited directly in sysctl_core_net_init. To make it more flexible, we can init every element at once, just like what ipv4_sysctl_init_net() did. Signed-off-by: Menglong Dong --- net/core/sysctl_net_core.c | 1

[PATCH net-next] net: core: Namespace-ify sysctl_wmem_default and sysctl_rmem_default

2021-01-17 Thread menglong8 . dong
From: Menglong Dong For now, sysctl_wmem_default and sysctl_rmem_default are globally unified. It's not convenient in some case. For example, when we use docker and try to control the default udp socket receive buffer for each container. For that reason, make sysctl_wmem_default and sysctl_rmem_

[PATCH net-next] net: core: Namespace-ify sysctl_rmem_max and sysctl_wmem_max

2021-01-17 Thread menglong8 . dong
From: Menglong Dong For now, sysctl_wmem_max and sysctl_rmem_max are globally unified. It's not convenient in some case. For example, when we use docker and try to control the default udp socket receive buffer for each container. For that reason, make sysctl_wmem_max and sysctl_rmem_max per-name

[PATCH net-next] net: tun: fix misspellings using codespell tool

2021-01-18 Thread menglong8 . dong
From: Menglong Dong Some typos are found out by codespell tool: $ codespell -w -i 3 ./drivers/net/tun.c aovid ==> avoid Fix typos found by codespell. Signed-off-by: Menglong Dong --- drivers/net/tun.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/tun.c b/dr

[PATCH net-next 0/3] Namespace-ify some sysctl in net/core

2021-01-18 Thread menglong8 . dong
From: Menglong Dong For now, most sysctl in 'net/core' are globally unified, such as sysctl_wmem_default, sysctl_rmem_default, sysctl_wmem_default, sysctl_rmem_default, etc. It's not convenient in some case. For example, when we use docker and try to control the default udp socket receive buffer

[PATCH net-next 3/3] net: core: Namespace-ify sysctl_rmem_max and sysctl_wmem_max

2021-01-18 Thread menglong8 . dong
From: Menglong Dong For now, sysctl_wmem_max and sysctl_rmem_max are globally unified. It's not convenient in some case. For example, when we use docker and try to control the default udp socket receive buffer for each container. For that reason, make sysctl_wmem_max and sysctl_rmem_max per-name

[PATCH net-next 1/3] net: core: init every ctl_table in netns_core_table

2021-01-18 Thread menglong8 . dong
From: Menglong Dong For now, there is only one element in netns_core_table, and it is inited directly in sysctl_core_net_init. To make it more flexible, we can init every element at once, just like what ipv4_sysctl_init_net() did. Signed-off-by: Menglong Dong --- net/core/sysctl_net_core.c | 1

[PATCH net-next 2/3] net: core: Namespace-ify sysctl_wmem_default and sysctl_rmem_default

2021-01-18 Thread menglong8 . dong
From: Menglong Dong For now, sysctl_wmem_default and sysctl_rmem_default are globally unified. It's not convenient in some case. For example, when we use docker and try to control the default udp socket receive buffer for each container. For that reason, make sysctl_wmem_default and sysctl_rmem_

[PATCH v4 net-next] net: socket: use BIT() for MSG_*

2021-02-16 Thread menglong8 . dong
From: Menglong Dong The bit mask for MSG_* seems a little confused here. Replace it with BIT() to make it clear to understand. Signed-off-by: Menglong Dong --- v4: - CC netdev v3: - move changelog here v2: - use BIT() instead of BIT_MASK() --- include/linux/socket.h | 71 ++

[PATCH bpf-next] bpf: change 'BPF_ADD' to 'BPF_AND' in print_bpf_insn()

2021-01-26 Thread menglong8 . dong
From: Menglong Dong This 'BPF_ADD' is duplicated, and I belive it should be 'BPF_AND'. Fixes: 981f94c3e921 ("bpf: Add bitwise atomic instructions") Signed-off-by: Menglong Dong --- kernel/bpf/disasm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/bpf/disasm.c b/ker

[PATCH net-next] net: packet: make pkt_sk() inline

2021-01-27 Thread menglong8 . dong
From: Menglong Dong It's better make 'pkt_sk()' inline here, as non-inline function shouldn't occur in headers. Besides, this function is simple enough to be inline. Signed-off-by: Menglong Dong --- net/packet/internal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/p

[PATCH] selftests/bpf: remove duplicate include in test_lsm

2021-01-05 Thread menglong8 . dong
From: Menglong Dong 'unistd.h' included in 'selftests/bpf/prog_tests/test_lsm.c' is duplicated. Signed-off-by: Menglong Dong --- tools/testing/selftests/bpf/prog_tests/test_lsm.c | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/testing/selftests/bpf/prog_tests/test_lsm.c b/tools/testi

[PATCH net-next] net/bridge: fix misspellings using codespell tool

2021-01-07 Thread menglong8 . dong
From: Menglong Dong Some typos are found out by codespell tool: $ codespell ./net/bridge/ ./net/bridge/br_stp.c:604: permanant ==> permanent ./net/bridge/br_stp.c:605: persistance ==> persistence ./net/bridge/br.c:125: underlaying ==> underlying ./net/bridge/br_input.c:43: modue ==> mode ./n

[PATCH net-next] net: core: use eth_type_vlan in __netif_receive_skb_core

2021-01-11 Thread menglong8 . dong
From: Menglong Dong Replace the check for ETH_P_8021Q and ETH_P_8021AD in __netif_receive_skb_core with eth_type_vlan. Signed-off-by: Menglong Dong --- net/core/dev.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/net/core/dev.c b/net/core/dev.c index e4d77c8abe76..2

[PATCH net-next] net: netlink: remove netlink_broadcast_filtered

2021-03-09 Thread menglong8 . dong
From: Menglong Dong It seems that 'netlink_broadcast_filtered()' is not used anywhere besides 'netlink_broadcast()'. In order to reduce function calls, just remove it. Signed-off-by: Menglong Dong --- include/linux/netlink.h | 4 net/netlink/af_netlink.c | 22 ++ 2 f

[PATCH v4 RESEND net-next] net: socket: use BIT() for MSG_*

2021-03-09 Thread menglong8 . dong
From: Menglong Dong The bit mask for MSG_* seems a little confused here. Replace it with BIT() to make it clear to understand. Signed-off-by: Menglong Dong --- v4: - CC netdev v3: - move changelog here v2: - use BIT() instead of BIT_MASK() --- include/linux/socket.h | 71 ++

[PATCH] kernel/bpf/: fix misspellings using codespell tool

2021-03-11 Thread menglong8 . dong
From: Liu xuzhi A typo is found out by codespell tool in 34th lines of hashtab.c: $ codespell ./kernel/bpf/ ./hashtab.c:34 : differrent ==> different Fix a typo found by codespell. Signed-off-by: Liu xuzhi --- kernel/bpf/hashtab.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff -

[PATCH net-next] /net/hsr: fix misspellings using codespell tool

2021-03-18 Thread menglong8 . dong
From: Xiong Zhenwu A typo is found out by codespell tool in 111th line of hsr_debugfs.c: $ codespell ./net/hsr/ net/hsr/hsr_debugfs.c:111: Debufs ==> Debugfs Fix typos found by codespell. Signed-off-by: Xiong Zhenwu --- net/hsr/hsr_debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deleti

[PATCH net-next] /net/core/: fix misspellings using codespell tool

2021-03-18 Thread menglong8 . dong
From: Xiong Zhenwu A typo is found out by codespell tool in 1734th line of drop_monitor.c: $ codespell ./net/core/ ./net/core/drop_monitor.c:1734: guarnateed ==> guaranteed Fix a typo found by codespell. Signed-off-by: Xiong Zhenwu --- net/core/drop_monitor.c | 2 +- 1 file changed, 1 inser

[PATCH net-next 0/2] net: socket: use BIT() for MSG_* and fix MSG_CMSG_COMPAT

2021-03-21 Thread menglong8 . dong
From: Menglong Dong In the first patch, I use BIT() for MSG_* to make the code tidier. Directly use BIT() for MSG_* will be a bit problematic, because 'msg_flags' is defined as 'int' somewhere, and MSG_CMSG_COMPAT will make it become negative, just like what Guenter Roeck reported here: https:/

[PATCH net-next 1/2] net: socket: use BIT() for MSG_*

2021-03-21 Thread menglong8 . dong
From: Menglong Dong The bit mask for MSG_* seems a little confused here. Replace it with BIT() to make it clear to understand. Signed-off-by: Menglong Dong --- include/linux/socket.h | 71 ++ 1 file changed, 37 insertions(+), 34 deletions(-) diff --git

[PATCH net-next 2/2] net: socket: change MSG_CMSG_COMPAT to BIT(21)

2021-03-21 Thread menglong8 . dong
From: Menglong Dong Currently, MSG_CMSG_COMPAT is defined as '1 << 31'. However, 'msg_flags' is defined with type of 'int' somewhere, such as 'packet_recvmsg' and other recvmsg functions: static int packet_recvmsg(struct socket *sock, struct msghdr *msg, size_t len,

[PATCH v2 net-next 0/2] net: socket: use BIT() for MSG_* and fix MSG_CMSG_COMPAT

2021-03-21 Thread menglong8 . dong
From: Menglong Dong In the first patch, I use BIT() for MSG_* to make the code tidier. Directly use BIT() for MSG_* will be a bit problematic, because 'msg_flags' is defined as 'int' somewhere, and MSG_CMSG_COMPAT will make it become negative, just like what Guenter Roeck reported here: https:/

[PATCH v2 net-next 1/2] net: socket: use BIT() for MSG_*

2021-03-21 Thread menglong8 . dong
From: Menglong Dong The bit mask for MSG_* seems a little confused here. Replace it with BIT() to make it clear to understand. Signed-off-by: Menglong Dong --- include/linux/socket.h | 71 ++ 1 file changed, 37 insertions(+), 34 deletions(-) diff --git

[PATCH v2 net-next 2/2] net: socket: change MSG_CMSG_COMPAT to BIT(21)

2021-03-21 Thread menglong8 . dong
From: Menglong Dong Currently, MSG_CMSG_COMPAT is defined as '1 << 31'. However, 'msg_flags' is defined with type of 'int' somewhere, such as 'packet_recvmsg' and other recvmsg functions: static int packet_recvmsg(struct socket *sock, struct msghdr *msg, size_t len,

[PATCH] net: macvlan: remove redundant initialization in macvlan_dev_netpoll_setup

2020-11-04 Thread menglong8 . dong
From: Menglong Dong The initialization for err with 0 seems useless, as it is soon updated with -ENOMEM. So, we can init err with -ENOMEM. Signed-off-by: Menglong Dong --- drivers/net/macvlan.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/macvlan.c b/driver

[PATCH v2] net: macvlan: remove redundant initialization in macvlan_dev_netpoll_setup

2020-11-04 Thread menglong8 . dong
From: Menglong Dong The initialization for err with 0 seems useless, as it is soon updated with -ENOMEM. So, we can remove it. Changes since v1: -Keep -ENOMEM still. Signed-off-by: Menglong Dong --- drivers/net/macvlan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/driv

[PATCH net-next] net: udp: introduce UDP_MIB_MEMERRORS for udp_mem

2020-11-04 Thread menglong8 . dong
From: Menglong Dong When udp_memory_allocated is at the limit, __udp_enqueue_schedule_skb will return a -ENOBUFS, and skb will be dropped in __udp_queue_rcv_skb without any counters being done. It's hard to find out what happened once this happen. So we introduce a UDP_MIB_MEMERRORS to do this j

[PATCH v2 net-next] net: udp: introduce UDP_MIB_MEMERRORS for udp_mem

2020-11-05 Thread menglong8 . dong
From: Menglong Dong When udp_memory_allocated is at the limit, __udp_enqueue_schedule_skb will return a -ENOBUFS, and skb will be dropped in __udp_queue_rcv_skb without any counters being done. It's hard to find out what happened once this happen. So we introduce a UDP_MIB_MEMERRORS to do this j

[PATCH] net: ipv4: remove redundant initialization in inet_rtm_deladdr

2020-11-05 Thread menglong8 . dong
From: Menglong Dong The initialization for 'err' with '-EINVAL' is redundant and can be removed, as it is updated soon. Signed-off-by: Menglong Dong --- net/ipv4/devinet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index 123a6d3.

[PATCH] net: udp: remove redundant initialization in udp_dump_one

2020-11-05 Thread menglong8 . dong
From: Menglong Dong The initialization for 'err' with '-EINVAL' is redundant and can be removed, as it is updated soon and not used. Signed-off-by: Menglong Dong --- net/ipv4/udp_diag.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv4/udp_diag.c b/net/ipv4/udp_diag.

[PATCH] net: udp: remove redundant initialization in udp_gro_complete

2020-11-05 Thread menglong8 . dong
From: Menglong Dong The initialization for 'err' with '-ENOSYS' is redundant and can be removed, as it is updated soon and not used. Signed-off-by: Menglong Dong --- net/ipv4/udp_offload.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv4/udp_offload.c b/net/ipv4/udp

[PATCH] net: udp: remove redundant initialization in udp_send_skb

2020-11-05 Thread menglong8 . dong
From: Menglong Dong The initialization for 'err' with 0 is redundant and can be removed, as it is updated by ip_send_skb and not used before that. Signed-off-by: Menglong Dong --- net/ipv4/udp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c

[PATCH] samples/bpf: remove duplicate include

2020-11-06 Thread menglong8 . dong
From: Menglong Dong Obviously, 'bpf/bpf.h' in 'samples/bpf/hbm.c' is duplicated. Signed-off-by: Menglong Dong --- samples/bpf/hbm.c | 1 - 1 file changed, 1 deletion(-) diff --git a/samples/bpf/hbm.c b/samples/bpf/hbm.c index ff4c533..400e741 100644 --- a/samples/bpf/hbm.c +++ b/samples/bpf/h

[PATCH] net: sched: fix misspellings using misspell-fixer tool

2020-11-08 Thread menglong8 . dong
From: Menglong Dong Some typos are found out by misspell-fixer tool: $ misspell-fixer -rnv ./net/sched/ ./net/sched/act_api.c:686 ./net/sched/act_bpf.c:68 ./net/sched/cls_rsvp.h:241 ./net/sched/em_cmp.c:44 ./net/sched/sch_pie.c:408 Fix typos found by misspell-fixer. Signed-off-by: Menglong Don

[PATCH] net: tcp: ratelimit warnings in tcp_recvmsg

2020-11-09 Thread menglong8 . dong
From: Menglong Dong 'before(*seq, TCP_SKB_CB(skb)->seq) == true' means that one or more skbs are lost somehow. Once this happen, it seems that it will never recover automatically. As a result, a warning will be printed and a '-EAGAIN' will be returned in non-block mode. As a general suituation,

[PATCH v2 net-next] net: udp: remove redundant initialization in udp_gro_complete

2020-11-09 Thread menglong8 . dong
From: Menglong Dong The initialization for 'err' with '-ENOSYS' is redundant and can be removed, as it is updated soon and not used. Changes since v1: - Move the err declaration below struct sock *sk Signed-off-by: Menglong Dong --- net/ipv4/udp_offload.c | 2 +- 1 file changed, 1 insertion(+