Re: [PATCH] wireless: fix typo issue

2021-02-02 Thread Miaohe Lin
On 2021/2/3 15:33, Johannes Berg wrote: > On Wed, 2021-02-03 at 15:00 +0800, samirweng1979 wrote: >> From: wengjianfeng >> >> change 'iff' to 'if'. >> >> Signed-off-by: wengjianfeng >> --- >> net/wireless/chan.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/net/wire

[PATCH] net: Fix broken NETIF_F_CSUM_MASK spell in netdev_features.h

2020-09-10 Thread Miaohe Lin
Remove the weird space inside the NETIF_F_CSUM_MASK. Signed-off-by: Miaohe Lin --- include/linux/netdev_features.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/netdev_features.h b/include/linux/netdev_features.h index 2cc3cf80b49a..0b17c4322b09 100644 --- a

[PATCH v2] net: Correct the comment of dst_dev_put()

2020-09-10 Thread Miaohe Lin
Since commit 8d7017fd621d ("blackhole_netdev: use blackhole_netdev to invalidate dst entries"), we use blackhole_netdev to invalidate dst entries instead of loopback device anymore. Signed-off-by: Miaohe Lin --- net/core/dst.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) di

[PATCH] net: Fix some comments

2020-09-05 Thread Miaohe Lin
Since commit 8d7017fd621d ("blackhole_netdev: use blackhole_netdev to invalidate dst entries"), we use blackhole_netdev to invalidate dst entries instead of loopback device anymore. Also fix broken NETIF_F_HW_CSUM spell. Signed-off-by: Miaohe Lin --- include/linux/netdev_features.h |

[PATCH v2] net: ipv4: remove unused arg exact_dif in compute_score

2020-08-30 Thread Miaohe Lin
The arg exact_dif is not used anymore, remove it. inet_exact_dif_match() is no longer needed after the above is removed, so remove it too. Signed-off-by: Miaohe Lin --- include/net/tcp.h | 10 -- net/ipv4/inet_hashtables.c | 6 ++ 2 files changed, 2 insertions(+), 14

[PATCH v2] net: ipv6: remove unused arg exact_dif in compute_score

2020-08-30 Thread Miaohe Lin
The arg exact_dif is not used anymore, remove it. inet6_exact_dif_match() is no longer needed after the above is removed, remove it too. Signed-off-by: Miaohe Lin --- include/linux/ipv6.h| 11 --- net/ipv6/inet6_hashtables.c | 6 ++ 2 files changed, 2 insertions(+), 15

[PATCH] net: clean up codestyle

2020-08-29 Thread Miaohe Lin
This is a pure codestyle cleanup patch. No functional change intended. Signed-off-by: Miaohe Lin --- include/net/dst.h| 2 +- include/net/sock.h | 2 +- net/ipv4/icmp.c | 2 +- net/ipv4/ip_output.c | 2 +- net/ipv4/ping.c | 6 -- net/ipv4/route.c | 10 +- 6

[PATCH] net: Use helper macro IP_MAX_MTU in __ip_append_data()

2020-08-29 Thread Miaohe Lin
What 0x means here is actually the max mtu of a ip packet. Use help macro IP_MAX_MTU here. Signed-off-by: Miaohe Lin --- net/ipv4/ip_output.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c index 329a0ab87542..f0f234727547

[PATCH] net: ipv6: remove unused arg exact_dif in compute_score

2020-08-29 Thread Miaohe Lin
The arg exact_dif is not used anymore, remove it. Signed-off-by: Miaohe Lin --- net/ipv6/inet6_hashtables.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/net/ipv6/inet6_hashtables.c b/net/ipv6/inet6_hashtables.c index 2d3add9e6116..55c290d55605 100644 --- a/net/ipv6

[PATCH] net: ipv4: remove unused arg exact_dif in compute_score

2020-08-29 Thread Miaohe Lin
The arg exact_dif is not used anymore, remove it. Signed-off-by: Miaohe Lin --- net/ipv4/inet_hashtables.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/net/ipv4/inet_hashtables.c b/net/ipv4/inet_hashtables.c index 239e54474b65..8cbe74313f38 100644 --- a/net/ipv4

[PATCH] net: Set trailer iff skb1 is the last one

2020-08-27 Thread Miaohe Lin
Set trailer iff skb1 is the skbuff where the tailbits space begins. Signed-off-by: Miaohe Lin --- net/core/skbuff.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 0b24aed04060..18ed56316e56 100644 --- a/net/core/skbuff.c +++ b

[PATCH] net: Fix some comments

2020-08-27 Thread Miaohe Lin
Fix some comments, including wrong function name, duplicated word and so on. Signed-off-by: Miaohe Lin --- include/linux/skbuff.h | 4 ++-- include/uapi/linux/in.h | 2 +- net/core/sock.c | 2 +- net/ipv4/raw.c | 2 +- net/l3mdev/l3mdev.c | 2 +- net/socket.c

[PATCH] net: Add 'else' to split mutually exclusive case

2020-08-27 Thread Miaohe Lin
Add else to split mutually exclusive case and avoid unnecessary check. Signed-off-by: Miaohe Lin --- net/ipv4/ping.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c index 19a947bf0faa..265676fd2bbd 100644 --- a/net/ipv4/ping.c +++ b/net/ipv4

[PATCH] net: Call ip_hdrlen() when skbuff is not fragment

2020-08-27 Thread Miaohe Lin
When skbuff is fragment, we exit immediately and leave ip_hdrlen() as unused. And remove the unnecessary local variable fragment. Signed-off-by: Miaohe Lin --- net/core/skbuff.c | 12 ++-- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/net/core/skbuff.c b/net/core

[PATCH] net: exit immediately when off = 0 in skb_headers_offset_update()

2020-08-27 Thread Miaohe Lin
In the case of off = 0, skb_headers_offset_update() do nothing indeed. Signed-off-by: Miaohe Lin --- net/core/skbuff.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 18ed56316e56..f67f0da20a5b 100644 --- a/net/core/skbuff.c +++ b/net/core

[PATCH] net: exit immediately when encounter ipv6 fragment in skb_checksum_setup_ipv6()

2020-08-27 Thread Miaohe Lin
skb_checksum_setup_ipv6() always return -EPROTO if ipv6 packet is fragment. So we should not continue to parse other header type in this case. Also remove unnecessary local variable 'fragment'. Signed-off-by: Miaohe Lin --- net/core/skbuff.c | 12 ++-- 1 file changed, 6 insert

[PATCH] net: clean up codestyle for net/ipv4

2020-08-25 Thread Miaohe Lin
This is a pure codestyle cleanup patch. Also add a blank line after declarations as warned by checkpatch.pl. Signed-off-by: Miaohe Lin --- net/ipv4/ip_options.c | 35 +++ net/ipv4/ip_output.c | 2 +- net/ipv4/route.c | 6 +++--- 3 files changed, 23

[PATCH] net: Remove duplicated midx check against 0

2020-08-25 Thread Miaohe Lin
Check midx against 0 is always equal to check midx against sk_bound_dev_if when sk_bound_dev_if is known not equal to 0 in these case. Signed-off-by: Miaohe Lin --- net/ipv4/ip_sockglue.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4

[PATCH] net: Avoid unnecessary inet_addr_type() call when addr is INADDR_ANY

2020-08-25 Thread Miaohe Lin
We can avoid unnecessary inet_addr_type() call by check addr against INADDR_ANY first. Signed-off-by: Miaohe Lin --- net/ipv4/ping.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c index cc09d1135ce2..19a947bf0faa 100644 --- a/net/ipv4

[PATCH] net: Set ping saddr after we successfully get the ping port

2020-08-25 Thread Miaohe Lin
We can defer set ping saddr until we successfully get the ping port. So we can avoid clear saddr when failed. Since ping_clear_saddr() is not used anymore now, remove it. Signed-off-by: Miaohe Lin --- net/ipv4/ping.c | 19 +++ 1 file changed, 3 insertions(+), 16 deletions

[PATCH v2] netlink: remove duplicated nla_need_padding_for_64bit() check

2020-08-24 Thread Miaohe Lin
The need for padding 64bit is implicitly checked by nla_align_64bit(), so remove this explicit one. Signed-off-by: Miaohe Lin --- lib/nlattr.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/nlattr.c b/lib/nlattr.c index bc5b5cf608c4..98f596bfbfd8 100644 --- a/lib

[PATCH v2] net: gain ipv4 mtu when mtu is not locked

2020-08-24 Thread Miaohe Lin
When mtu is locked, we should not obtain ipv4 mtu as we return immediately in this case and leave acquired ipv4 mtu unused. Signed-off-by: Miaohe Lin --- net/ipv4/route.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 8ca6bcab7b03

[PATCH] net: Use helper macro RT_TOS() in __icmp_send()

2020-08-24 Thread Miaohe Lin
Use helper macro RT_TOS() to get tos in __icmp_send(). Signed-off-by: Miaohe Lin --- net/ipv4/icmp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c index cf36f955bfe6..3b387dc3864f 100644 --- a/net/ipv4/icmp.c +++ b/net/ipv4/icmp.c

[PATCH] net: gain ipv4 mtu when mtu is not locked

2020-08-24 Thread Miaohe Lin
When mtu is locked, we should not obtain ipv4 mtu as we return immediately in this case and leave acquired ipv4 mtu unused. Signed-off-by: Miaohe Lin --- net/ipv4/route.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 8ca6bcab7b03

[PATCH] net: Avoid access icmp_err_convert when icmp code is ICMP_FRAG_NEEDED

2020-08-24 Thread Miaohe Lin
There is no need to fetch errno and fatal info from icmp_err_convert when icmp code is ICMP_FRAG_NEEDED. Signed-off-by: Miaohe Lin --- net/ipv4/raw.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c index 6fd4330287c2..ea4c36e93824 100644

[PATCH] net: wireless: Convert to use the preferred fallthrough macro

2020-08-22 Thread Miaohe Lin
Convert the uses of fallthrough comments to fallthrough macro. Signed-off-by: Miaohe Lin --- net/wireless/chan.c| 4 ++-- net/wireless/mlme.c| 2 +- net/wireless/nl80211.c | 20 ++-- net/wireless/scan.c| 2 +- net/wireless/sme.c | 4

[PATCH] sunrpc: Convert to use the preferred fallthrough macro

2020-08-22 Thread Miaohe Lin
Convert the uses of fallthrough comments to fallthrough macro. Signed-off-by: Miaohe Lin --- net/sunrpc/auth_gss/gss_krb5_wrap.c | 2 +- net/sunrpc/clnt.c | 22 +++--- net/sunrpc/xprt.c | 2 +- net/sunrpc/xprtrdma/verbs.c | 2

[PATCH] net: dccp: Convert to use the preferred fallthrough macro

2020-08-22 Thread Miaohe Lin
Convert the uses of fallthrough comments to fallthrough macro. Signed-off-by: Miaohe Lin --- net/dccp/ccids/ccid3.c | 2 +- net/dccp/feat.c| 3 ++- net/dccp/input.c | 10 +- net/dccp/options.c | 2 +- net/dccp/output.c | 8 net/dccp/proto.c | 8

[PATCH] net: Check the expect of skb->data at mac header

2020-08-20 Thread Miaohe Lin
skb_mpls_push() and skb_mpls_pop() expect skb->data at mac header. Check this assumption or we would get wrong mac_header and network_header. Signed-off-by: Miaohe Lin --- net/core/skbuff.c | 8 1 file changed, 8 insertions(+) diff --git a/net/core/skbuff.c b/net/core/skbuff.c in

[PATCH v2] net: Stop warning about SO_BSDCOMPAT usage

2020-08-19 Thread Miaohe Lin
We've been warning about SO_BSDCOMPAT usage for many years. We may remove this code completely now. Suggested-by: David S. Miller Signed-off-by: Miaohe Lin --- net/core/sock.c | 14 -- 1 file changed, 14 deletions(-) diff --git a/net/core/sock.c b/net/core/sock.c

[PATCH] libceph: Convert to use the preferred fallthrough macro

2020-08-18 Thread Miaohe Lin
Convert the uses of fallthrough comments to fallthrough macro. Signed-off-by: Miaohe Lin --- net/ceph/ceph_hash.c| 20 ++-- net/ceph/crush/mapper.c | 2 +- net/ceph/messenger.c| 4 ++-- net/ceph/mon_client.c | 2 +- net/ceph/osd_client.c | 4 ++-- 5 files changed

[PATCH] net: tipc: Convert to use the preferred fallthrough macro

2020-08-18 Thread Miaohe Lin
Convert the uses of fallthrough comments to fallthrough macro. Signed-off-by: Miaohe Lin --- net/tipc/bearer.c | 2 +- net/tipc/link.c | 2 +- net/tipc/socket.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/net/tipc/bearer.c b/net/tipc/bearer.c index 808b147df7d5

[PATCH] net: Relax the npages test against MAX_SKB_FRAGS

2020-08-18 Thread Miaohe Lin
The npages test against MAX_SKB_FRAGS can be relaxed if we succeed to allocate high order pages as the note in comment said. Signed-off-by: Miaohe Lin --- net/core/skbuff.c | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/net/core/skbuff.c b/net/core/skbuff.c

[PATCH] net: Avoid strcmp current->comm with warncomm when warned >= 5

2020-08-18 Thread Miaohe Lin
We can possibly avoid strcmp warncomm with current->comm by check warned first. Signed-off-by: Miaohe Lin --- net/core/sock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/core/sock.c b/net/core/sock.c index e4f40b175acb..51e13bc42791 100644 --- a/net/core/sock.c ++

[PATCH v2] net: eliminate meaningless memcpy to data in pskb_carve_inside_nonlinear()

2020-08-15 Thread Miaohe Lin
The frags of skb_shared_info of the data is assigned in following loop. It is meaningless to do a memcpy of frags here. Signed-off-by: Miaohe Lin --- net/core/skbuff.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/core/skbuff.c b/net/core/skbuff.c index afbc1a79dc8a

[PATCH] net: handle the return value of pskb_carve_frag_list() correctly

2020-08-15 Thread Miaohe Lin
pskb_carve_frag_list() may return -ENOMEM in pskb_carve_inside_nonlinear(). we should handle this correctly or we would get wrong sk_buff. Fixes: 6fa01ccd8830 ("skbuff: Add pskb_extract() helper function") Signed-off-by: Miaohe Lin --- net/core/skbuff.c | 10 +++--- 1 file

[PATCH v2] bpf: Convert to use the preferred fallthrough macro

2020-08-15 Thread Miaohe Lin
Since commit 294f69e662d1 ("compiler_attributes.h: Add 'fallthrough' pseudo keyword for switch/case use") introduce fallthrough pseudo keyword, then we should convert the uses of fallthrough comments to it. Signed-off-by: Miaohe Lin --- kernel/bpf/cgroup.c | 1 - kerne

[PATCH] net: Fix potential wrong skb->protocol in skb_vlan_untag()

2020-08-15 Thread Miaohe Lin
We may access the two bytes after vlan_hdr in vlan_set_encap_proto(). So we should pull VLAN_HLEN + sizeof(unsigned short) in skb_vlan_untag() or we may access the wrong data. Fixes: 0d5501c1c828 ("net: Always untag vlan-tagged traffic on input.") Signed-off-by: Miaohe Lin --- net/cor

[PATCH] bpf: Convert to use the preferred fallthrough macro

2020-08-14 Thread Miaohe Lin
Convert the uses of fallthrough comments to fallthrough macro. Signed-off-by: Miaohe Lin --- kernel/bpf/cgroup.c | 2 +- kernel/bpf/cpumap.c | 2 +- kernel/bpf/syscall.c | 2 +- kernel/bpf/verifier.c | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/kernel/bpf

[PATCH] net: add missing skb_uarg refcount increment in pskb_carve_inside_header()

2020-08-13 Thread Miaohe Lin
If the skb is zcopied, we should increase the skb_uarg refcount before we involve skb_release_data(). See pskb_expand_head() as a reference. Fixes: 6fa01ccd8830 ("skbuff: Add pskb_extract() helper function") Signed-off-by: Miaohe Lin --- net/core/skbuff.c | 2 ++ 1 file changed, 2

[PATCH] net: correct zerocopy refcnt with newly allocated UDP or RAW uarg

2020-08-13 Thread Miaohe Lin
UDP or RAW uarg is newly allocated when the skb is zcopied. Fixes: 522924b58308 ("net: correct udp zerocopy refcnt also when zerocopy only on append") Signed-off-by: Miaohe Lin --- net/ipv4/ip_output.c | 4 +++- net/ipv6/ip6_output.c | 4 +++- 2 files changed, 6 insertions(+), 2

[PATCH] net: eliminate meaningless memcpy to data in pskb_carve_inside_nonlinear()

2020-08-10 Thread Miaohe Lin
The skb_shared_info part of the data is assigned in the following loop. It is meaningless to do a memcpy here. Signed-off-by: Miaohe Lin --- net/core/skbuff.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 7e2e502ef519..5b983c9472f5 100644

[PATCH] net: Fix potential memory leak in proto_register()

2020-08-10 Thread Miaohe Lin
t;) Signed-off-by: Miaohe Lin --- net/core/sock.c | 25 +++-- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/net/core/sock.c b/net/core/sock.c index 49cd5ffe673e..c9083ad44ea1 100644 --- a/net/core/sock.c +++ b/net/core/sock.c @@ -3406,6 +3406,16 @@ s