Re: [PATCH 1/2] net: ipv4: route.c: add likely() statements

2021-03-24 Thread Yejune Deng
0, Yejune Deng wrote: > > Add likely() statements in ipv4_confirm_neigh() for 'rt->rt_gw_family > > == AF_INET'. > > Why? Such macros are beneficial in only specific cases, most of the time, > likely/unlikely is cargo cult. > > > > > Signed-off-by: Yej

[PATCH 2/2] net: ipv4: route.c: Remove unnecessary if()

2021-03-23 Thread Yejune Deng
negative_advice handler is only called when dst is non-NULL hence the 'if (rt)' check can be removed. 'if' and 'else if' can be merged together. And use container_of() instead of (struct rtable *). Signed-off-by: Yejune Deng --- net/ipv4/route.c | 16 +

[PATCH 1/2] net: ipv4: route.c: add likely() statements

2021-03-23 Thread Yejune Deng
Add likely() statements in ipv4_confirm_neigh() for 'rt->rt_gw_family == AF_INET'. Signed-off-by: Yejune Deng --- net/ipv4/route.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv4/route.c b/net/ipv4/route.c index fa68c2612252..5762d9bc671c 100644 -

[PATCH] net: ipv4: route.c: Remove unnecessary {else} if()

2021-03-23 Thread Yejune Deng
Put if and else if together, and remove unnecessary judgments, because it's caller can make sure it is true. And add likely() in ipv4_confirm_neigh(). Signed-off-by: Yejune Deng --- net/ipv4/route.c | 18 +++--- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/net

[PATCH] net: ipv4: route.c: simplify procfs code

2021-03-15 Thread Yejune Deng
proc_creat_seq() that directly take a struct seq_operations, and deal with network namespaces in ->open. Signed-off-by: Yejune Deng --- net/ipv4/route.c | 34 -- 1 file changed, 4 insertions(+), 30 deletions(-) diff --git a/net/ipv4/route.c b/net/ipv4/rout

[PATCH] net/rds: Drop duplicate sin and sin6 assignments

2021-03-09 Thread Yejune Deng
There is no need to assign the msg->msg_name to sin or sin6, because there is DECLARE_SOCKADDR statement. Signed-off-by: Yejune Deng --- net/rds/recv.c | 4 1 file changed, 4 deletions(-) diff --git a/net/rds/recv.c b/net/rds/recv.c index aba4afe4dfed..4db109fb6ec2 100644 --- a/net/

[PATCH] inetpeer: use div64_ul() and clamp_val() calculate inet_peer_threshold

2021-02-28 Thread Yejune Deng
In inet_initpeers(), struct inet_peer on IA32 uses 128 bytes in nowdays. Get rid of the cascade and use div64_ul() and clamp_val() calculate that will not need to be adjusted in the future as suggested by Eric Dumazet. Suggested-by: Eric Dumazet Signed-off-by: Yejune Deng --- net/ipv4

Re: [PATCH] inetpeer: use else if instead of if to reduce judgment

2021-02-28 Thread Yejune Deng
Thanks,I will adopt it and resubmit. On Fri, Feb 26, 2021 at 10:50 PM Eric Dumazet wrote: > > > > On 2/26/21 11:57 AM, Yejune Deng wrote: > > In inet_initpeers(), if si.totalram <= (8192*1024)/PAGE_SIZE, it will > > be judged three times. Use else if instead of if, it

[PATCH] inetpeer: use else if instead of if to reduce judgment

2021-02-26 Thread Yejune Deng
In inet_initpeers(), if si.totalram <= (8192*1024)/PAGE_SIZE, it will be judged three times. Use else if instead of if, it only needs to be judged once. Signed-off-by: Yejune Deng --- net/ipv4/inetpeer.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/net/i

Re: [PATCH] arp: Remove the arp_hh_ops structure

2021-02-22 Thread Yejune Deng
Thank you for the clarification. On Tue, Feb 23, 2021 at 12:07 AM David Ahern wrote: > > On 2/22/21 1:37 AM, Eric Dumazet wrote: > > > > > > On 2/22/21 4:15 AM, Yejune Deng wrote: > >> The arp_hh_ops structure is similar to the arp_generic_ops structure. >

[PATCH] arp: Remove the arp_hh_ops structure

2021-02-21 Thread Yejune Deng
ild/src/consumer/net/core/neighbour.c:1009) Reported-by: kernel test robot Signed-off-by: Yejune Deng --- net/ipv4/arp.c | 15 ++- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c index 922dd73e5740..9ee59c2e419a 100644 --- a/net/ipv4/ar

Re: [PATCH] arp: Remove the arp_hh_ops structure

2021-02-20 Thread Yejune Deng
Sorry,it was my fault, I will resubmit. On Sun, Feb 21, 2021 at 9:54 AM David Ahern wrote: > > On 2/19/21 9:32 PM, Yejune Deng wrote: > > static const struct neigh_ops arp_direct_ops = { > > .family = AF_INET, > > .output =

[PATCH] arp: Remove the arp_hh_ops structure

2021-02-19 Thread Yejune Deng
The 'arp_hh_ops' structure is similar to the 'arp_generic_ops' structure. So remove the 'arp_hh_ops' structure. Signed-off-by: Yejune Deng --- net/ipv4/arp.c | 19 +++ 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/net/ipv

[PATCH] tcp_cubic: use memset and offsetof init

2021-01-13 Thread Yejune Deng
In bictcp_reset(), use memset and offsetof instead of = 0. Signed-off-by: Yejune Deng --- net/ipv4/tcp_cubic.c | 11 +-- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/net/ipv4/tcp_cubic.c b/net/ipv4/tcp_cubic.c index c7bf5b2..ffcbe46 100644 --- a/net/ipv4/tcp_cubic.c

[PATCH] net: core: fix msleep() is not accurate

2020-12-14 Thread Yejune Deng
See Documentation/timers/timers-howto.rst, msleep() is not for (1ms - 20ms), use usleep_range() instead. Signed-off-by: Yejune Deng --- net/core/dev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/core/dev.c b/net/core/dev.c index d33099f..c0aa52f 100644 --- a/net

Re: [PATCH] net: core: fix msleep() is not accurate

2020-12-10 Thread Yejune Deng
Does anyone else have a different opinion? If not,I will adopt it and resubmit. On Thu, Dec 10, 2020 at 6:19 PM Eric Dumazet wrote: > > On Thu, Dec 10, 2020 at 10:35 AM Yejune Deng wrote: > > > > See Documentation/timers/timers-howto.rst, msleep() is not > > for (1ms

[PATCH] net: core: fix msleep() is not accurate

2020-12-10 Thread Yejune Deng
See Documentation/timers/timers-howto.rst, msleep() is not for (1ms - 20ms), There is a more advanced API is used. Signed-off-by: Yejune Deng --- net/core/dev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/core/dev.c b/net/core/dev.c index d33099f..6e83ee03 100644

[PATCH] net: phy: marvell: replace phy_modify()

2020-11-30 Thread Yejune Deng
a set of phy_set_bits() looks more neater Signed-off-by: Yejune Deng --- drivers/net/phy/marvell.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c index 587930a..620052c 100644 --- a/drivers/net/phy

[PATCH] net: phy: marvell: replace __phy_modify()

2020-11-30 Thread Yejune Deng
a set of phy_set_bits() looks more neater Signed-off-by: Yejune Deng --- drivers/net/phy/marvell.c | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c index 587930a..f402e7f 100644 --- a/drivers/net

[PATCH] ipvs: replace atomic_add_return()

2020-11-16 Thread Yejune Deng
atomic_inc_return() looks better Signed-off-by: Yejune Deng --- net/netfilter/ipvs/ip_vs_core.c | 2 +- net/netfilter/ipvs/ip_vs_sync.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c index c0b8215

[PATCH] Replace a set of atomic_add()

2020-11-09 Thread Yejune Deng
a set of atomic_inc() looks more readable Signed-off-by: Yejune Deng --- drivers/net/wireless/st/cw1200/bh.c | 10 +- drivers/net/wireless/st/cw1200/wsm.c | 8 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/net/wireless/st/cw1200/bh.c b/drivers/net