[PATCH v4] can: mcp251xfd: replace sizeof(u32) with val_bytes in regmap

2021-01-22 Thread Su Yanjun
The sizeof(u32) is hardcoded. It's better to use the config value in regmap. It increases the size of target object, but it's flexible when new mcp chip need other val_bytes. Signed-off-by: Su Yanjun --- drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c | 9 ++--- 1 file changed, 6

[PATCH v1] can: mcp251xfd: Add some sysfs debug interfaces for registers r/w

2021-01-21 Thread Su Yanjun
When i debug mcp2518fd, some method to track registers is needed. This easy debug interface will be ok. For example, read a register at 0xe00: echo 0xe00 > can_get_reg cat can_get_reg write a register at 0xe00: echo 0xe00,0x60 > can_set_reg Signed-off-by: Su Yanjun --- .../net/c

[PATCH v3] can: mcp251xfd: replace sizeof(u32) with val_bytes in regmap

2021-01-21 Thread Su Yanjun
The sizeof(u32) is hardcoded. It's better to use the config value in regmap. It increases the size of target object, but it's flexible when new mcp chip need other val_bytes. Signed-off-by: Su Yanjun --- drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c | 9 ++--- 1 file changed, 6

[PATCH v1] can: mcp251xfd: use regmap_bulk_write for compatibility

2021-01-21 Thread Su Yanjun
Recently i use mcp2518fd on 4.x kernel which multiple write is not backported, regmap_raw_write will cause old kernel crash because the tx buffer in driver is smaller then 2K. Use regmap_bulk_write instead for compatibility. Signed-off-by: Su Yanjun --- drivers/net/can/spi/mcp251xfd/mcp251xfd

[PATCH v2] can: mcp251xfd: replace sizeof(u32) with val_bytes in regmap

2021-01-21 Thread Su Yanjun
No functional effect. Signed-off-by: Su Yanjun --- drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c | 15 --- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c b/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c index

[PATCH v1] can: mcp251xfd: replace sizeof(u32) with val_bytes in regmap

2021-01-21 Thread Su Yanjun
No functional effect. Signed-off-by: Su Yanjun --- drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c | 15 --- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c b/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c index

Re: net: ipv6: Fix a bug in ndisc_send_ns when netdev only has a global address

2019-07-30 Thread Su Yanjun
在 2019/7/30 16:15, Mark Smith 写道: Hi, I'm not subscribed to the Linux netdev mailing list, so I can't directly reply to the patch email. This patch is not the correct solution to this issue. Per RFC 4291 "IP Version 6 Addressing Architecture", all IPv6 interfaces are required to have Link-Lo

[PATCH v3] net: xfrm: Add '_rcu' tag for rcu protected pointer in netns_xfrm

2019-03-06 Thread Su Yanjun
noderef] *nlsk [...] So introduce a new wrapper function of nlmsg_unicast to handle type conversions. This patch also fixes a direct access of a rcu protected socket. Fixes: be33690d8fcf("[XFRM]: Fix aevent related crash") Signed-off-by: Su Yanjun --- Changes from v2: - add 'F

Re: [PATCH] net: xfrm: Fix potential oops in xfrm_user_rcv_msg and array out of bounds

2019-03-04 Thread Su Yanjun
On 2019/3/5 15:31, Steffen Klassert wrote: On Tue, Mar 05, 2019 at 03:08:49PM +0800, Su Yanjun wrote: On 2019/3/5 14:49, Herbert Xu wrote: On Sun, Mar 03, 2019 at 10:47:39PM -0500, Su Yanjun wrote: When i review xfrm_user.c code, i found some potentical bug in it. In xfrm_user_rcvmsg if

[PATCH v2] net: xfrm: Add '_rcu' tag for rcu protected pointer in netns_xfrm

2019-03-04 Thread Su Yanjun
noderef] *nlsk [...] So introduce a new wrapper function of nlmsg_unicast to handle type conversions. No functional change. Signed-off-by: Su Yanjun --- Changes from v1: - fix spelling mistakes and the sparse tool' warnings include/net/netns/xfrm.h | 2 +-

[PATCH] net: xfrm: Add '_rcu' tag for rcu protected pointer in netns_xfrm

2019-03-03 Thread Su Yanjun
For rcu protected pointers, we'd bettter add '__rcu' for them. No functional change. Signed-off-by: Su Yanjun --- include/net/netns/xfrm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/net/netns/xfrm.h b/include/net/netns/xfrm.h index 59f45b1..d2a36

[PATCH] net: xfrm: Fix potential oops in xfrm_user_rcv_msg and array out of bounds

2019-03-03 Thread Su Yanjun
When i review xfrm_user.c code, i found some potentical bug in it. In xfrm_user_rcvmsg if type parameter from user space is set to XFRM_MSG_MAX or XFRM_MSG_NEWSADINFO or XFRM_MSG_NEWSPDINFO. It will cause xfrm_user_rcv_msg referring to null entry in xfrm_dispatch array. Signed-off-by: Su

Re: [PATCH] netfilter: nf_ct_helper: Fix possible panic when nf_conntrack_helper_unregister is used in an unloadable module

2019-03-01 Thread Su Yanjun
On 2019/3/1 16:43, Sergei Shtylyov wrote: Hello! On 01.03.2019 8:56, Su Yanjun wrote: From: Su Yanjun Because nf_conntrack_helper_unregister maybe used in an unloadable module, it uses 'synchronize_rcu' which may cause kernel panic. According to the artical:    Article?

[PATCH] netfilter: nf_ct_helper: Fix possible panic when nf_conntrack_helper_unregister is used in an unloadable module

2019-02-28 Thread Su Yanjun
From: Su Yanjun Because nf_conntrack_helper_unregister maybe used in an unloadable module, it uses 'synchronize_rcu' which may cause kernel panic. According to the artical: RCU and Unloadable Modules https://lwn.net/Articles/217484/ When we have a heavy rcu callback load, then s

[PATCH v2] vti4: Fix a ipip packet processing bug in 'IPCOMP' virtual tunnel

2019-01-06 Thread Su Yanjun
ocess in ipcomp virtual tunnel. Signed-off-by: Su Yanjun --- Based on Linus' master branch. Changes from v1: - use a separate handler for ipip packet processing in ipcomp virtual tunnel net/ipv4/ip_vti.c | 50 ++ 1 file changed, 50 insertio

Re: [PATCH] vti4: Fix a ipip packet processing bug in 'IPCOMP' virtual tunnel

2019-01-04 Thread Su Yanjun
On 1/4/2019 3:43 PM, Steffen Klassert wrote: On Thu, Jan 03, 2019 at 07:48:41AM -0500, Su Yanjun wrote: Recently we run a network test over ipcomp virtual tunnel.We find that if a ipv4 packet needs fragment, then the peer can't receive it. We deep into the code and find that when packet

[PATCH] vti4: Fix a ipip packet processing bug in 'IPCOMP' virtual tunnel

2019-01-02 Thread Su Yanjun
ocess in ipcomp virtual tunnel. Signed-off-by: Su Yanjun --- net/ipv4/ip_vti.c | 25 - 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/net/ipv4/ip_vti.c b/net/ipv4/ip_vti.c index de31b30..63de2f6 100644 --- a/net/ipv4/ip_vti.c +++ b/net/ipv4/ip_vti.c @@ -6

[PATCH] ipv6: fix typo in net/ipv6/reassembly.c

2018-12-29 Thread Su Yanjun
Signed-off-by: Su Yanjun --- net/ipv6/reassembly.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c index a5bb59e..36a3d8d 100644 --- a/net/ipv6/reassembly.c +++ b/net/ipv6/reassembly.c @@ -210,7 +210,7 @@ static int ip6_frag_queue

[PATCH] net: 8139cp: fix a BUG triggered by changing mtu with network traffic

2018-12-02 Thread Su Yanjun
d=0 When 8139cp starts to work then cp_tx will check num_queued mismatchs the complete_bytes. The patch will check IntrMask before check IntrStatus in cp_interrupt. When 8139cp interrupt is disabled, just return. Signed-off-by: Su Yanjun --- drivers/net/ethernet/realtek/8139cp.c | 5 + 1 fil