Re: [PATCH net] ipv6: use rt6_info members when dst is set in rt6_fill_node

2018-09-08 Thread Xin Long
On Sun, Sep 9, 2018 at 9:45 AM David Ahern wrote: > > On 9/8/18 3:24 AM, Xin Long wrote: > > In inet6_rtm_getroute, since Commit 93531c674315 ("net/ipv6: separate > > handling of FIB entries from dst based routes"), it has used rt->from > > to dump route info instead of rt. > > > > However for som

Re: [PATCH net] ipv6: use rt6_info members when dst is set in rt6_fill_node

2018-09-08 Thread David Ahern
On 9/8/18 3:24 AM, Xin Long wrote: > In inet6_rtm_getroute, since Commit 93531c674315 ("net/ipv6: separate > handling of FIB entries from dst based routes"), it has used rt->from > to dump route info instead of rt. > > However for some route like cache, its information is not the same as > that of

[PATCH net 13/13] net: sched: cls_u32: simplify the hell out u32_delete() emptiness check

2018-09-08 Thread Al Viro
From: Al Viro Now that we have the knode count, we can instantly check if any hnodes are non-empty. And that kills the check for extra references to root hnode - those could happen only if there was a knode to carry such a link. Signed-off-by: Al Viro --- net/sched/cls_u32.c | 48 +---

[PATCH net 12/13] net: sched: cls_u32: keep track of knodes count in tc_u_common

2018-09-08 Thread Al Viro
From: Al Viro allows to simplify u32_delete() considerably Signed-off-by: Al Viro --- net/sched/cls_u32.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c index f6bb3885598d..86cbe4f5800e 100644 --- a/net/sched/cls_u32.c +++ b/net/sched/cls_u3

[PATCH net 11/13] net: sched: cls_u32: get rid of hnode ->tp_c and tp_c argument of u32_set_parms()

2018-09-08 Thread Al Viro
From: Al Viro the latter is redundant, the former - never read... Signed-off-by: Al Viro --- net/sched/cls_u32.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c index 12757e3ec8d8..f6bb3885598d 100644 --- a/net/sched/cl

[PATCH net 09/13] net: sched: cls_u32: pass tc_u_common to u32_set_parms() instead of tc_u_hnode

2018-09-08 Thread Al Viro
From: Al Viro the only thing we used ht for was ht->tp_c and callers can get that without going through ->tp_c at all; start with lifting that into the callers, next commits will massage those, eventually removing ->tp_c altogether. Signed-off-by: Al Viro --- net/sched/cls_u32.c | 8

[PATCH net 10/13] net: sched: cls_u32: the tp_c argument of u32_set_parms() is always tp->data

2018-09-08 Thread Al Viro
From: Al Viro It must be tc_u_common associated with that tp (i.e. tp->data). Proof: * both ->ht_up and ->tp_c are assign-once * ->tp_c of anything inserted into tp_c->hlist is tp_c * hnodes never get reinserted into the lists or moved between those, so anything found by u

[PATCH net 08/13] net: sched: cls_u32: clean tc_u_common hashtable

2018-09-08 Thread Al Viro
From: Al Viro * calculate key *once*, not for each hash chain element * let tc_u_hash() return the pointer to chain head rather than index - callers are cleaner that way. Signed-off-by: Al Viro --- net/sched/cls_u32.c | 24 +--- 1 file changed, 9 insertions(+), 15 deletions

[PATCH net 07/13] net: sched: cls_u32: get rid of tc_u_common ->rcu

2018-09-08 Thread Al Viro
From: Al Viro unused Signed-off-by: Al Viro --- net/sched/cls_u32.c | 1 - 1 file changed, 1 deletion(-) diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c index 281ac954511c..1bfbfcab7260 100644 --- a/net/sched/cls_u32.c +++ b/net/sched/cls_u32.c @@ -98,7 +98,6 @@ struct tc_u_common {

[PATCH net 06/13] net: sched: cls_u32: get rid of tc_u_knode ->tp

2018-09-08 Thread Al Viro
From: Al Viro not used anymore Signed-off-by: Al Viro --- net/sched/cls_u32.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c index d11862823911..281ac954511c 100644 --- a/net/sched/cls_u32.c +++ b/net/sched/cls_u32.c @@ -68,7 +68,6 @@ struct tc_

[PATCH net 04/13] net: sched: cls_u32: make sure that divisor is a power of 2

2018-09-08 Thread Al Viro
From: Al Viro Signed-off-by: Al Viro --- net/sched/cls_u32.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c index 72459b09d910..d9923d474b65 100644 --- a/net/sched/cls_u32.c +++ b/net/sched/cls_u32.c @@ -994,7 +994,11 @@ static

[PATCH net 05/13] net: sched: cls_u32: get rid of unused argument of u32_destroy_key()

2018-09-08 Thread Al Viro
From: Al Viro Signed-off-by: Al Viro --- net/sched/cls_u32.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c index d9923d474b65..d11862823911 100644 --- a/net/sched/cls_u32.c +++ b/net/sched/cls_u32.c @@ -406,8 +406,7 @

[PATCH net 03/13] net: sched: cls_u32: disallow linking to root hnode

2018-09-08 Thread Al Viro
From: Al Viro Operation makes no sense. Nothing will actually break if we do so (depth limit in u32_classify() will prevent infinite loops), but according to maintainers it's best prohibited outright. NOTE: doing so guarantees that u32_destroy() will trigger the call of u32_destroy_hnode(); we

[PATCH net 02/13] net: sched: cls_u32: mark root hnode explicitly

2018-09-08 Thread Al Viro
From: Al Viro ... and produce consistent error on attempt to delete such. Existing check in u32_delete() is inconsistent - after tc qdisc add dev eth0 ingress tc filter add dev eth0 parent : protocol ip prio 100 handle 1: u32 divisor 1 tc filter add dev eth0 parent : protocol ip prio 200

[PATCH net 00/13] cls_u32 cleanups and fixes.

2018-09-08 Thread Al Viro
From: Al Viro A series of net/sched/cls_u32.c cleanups and fixes: 1) fix hnode refcounting. Refcounting for tc_u_hnode is broken; it's not hard to trigger oopsen (including one inside an interrupt handler, with resulting panic) as well as memory corruption. Definitely -stable fodder.

[PATCH net 01/13] net: sched: cls_u32: fix hnode refcounting

2018-09-08 Thread Al Viro
From: Al Viro cls_u32.c misuses refcounts for struct tc_u_hnode - it counts references via ->hlist and via ->tp_root together. u32_destroy() drops the former and, in case when there had been links, leaves the sucker on the list. As the result, there's nothing to protect it from getting freed on

Re: [PATCH net-next] veth: report NEWLINK event when moving the peer device in a new namespace

2018-09-08 Thread David Ahern
Hi Thomas: On 9/7/18 12:52 PM, Thomas Haller wrote: > Hi David, > > > On Mon, 2018-09-03 at 20:54 -0600, David Ahern wrote: > >> From init_net: >> $ ip monitor all-nsid > > I thought the concern of the patch is the overhead of sending one > additional RTM_NEWLINK message. This workaround has l

Re: Why not use all the syn queues? in the function "tcp_conn_request", I have some questions.

2018-09-08 Thread Ttttabcd
Sent with ProtonMail Secure Email. ‐‐‐ Original Message ‐‐‐ On Sunday, 9 September 2018 02:24, Neal Cardwell wrote: > By default, and essentially always in practice (AFAIK), Linux > installations enable syncookies. With syncookies, there is essentially > no limit on the syn queue, o

[PATCH net-next 12/15] net: Add and use skb_mark_not_on_list().

2018-09-08 Thread David Miller
An SKB is not on a list if skb->next is NULL. Codify this convention into a helper function and use it where we are dequeueing an SKB and need to mark it as such. Signed-off-by: David S. Miller --- include/linux/skbuff.h | 5 + net/core/dev.c | 8

[PATCH net-next 11/15] brcmfmac: Use __skb_peek().

2018-09-08 Thread David Miller
Instead of direct SKB list pointer accesses. In these situations, we absolutely know that the SKB queue in question is non-empty. Signed-off-by: David S. Miller --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 2 +- drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 2

[PATCH net-next 09/15] bnx2fc_fcoe: Use skb_queue_walk_safe().

2018-09-08 Thread David Miller
Instead of direct list pointer accesses. Signed-off-by: David S. Miller --- drivers/scsi/bnx2fc/bnx2fc_fcoe.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c index f00045813378..27c8d6ba05bb 100644

[PATCH net-next 14/15] can: Remove SKB list assumptions in rx-offload.c

2018-09-08 Thread David Miller
Eliminate code which assumes that SKBs and skb_queue_head objects can be cast to eachother during list processing. Signed-off-by: David S. Miller --- drivers/net/can/rx-offload.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/net/can/rx-offload.c b/drivers/

[PATCH net-next 13/15] net: Add and use skb_list_del_init().

2018-09-08 Thread David Miller
It documents what is happening, and eliminates the spurious list pointer poisoning. In the long term, in order to get proper list head debugging, we might want to use the list poinson value as the indicator that an SKB is a singleton and not on a list. Signed-off-by: David S. Miller --- inclu

[PATCH net-next 10/15] staging: rtl8192e: Use __skb_peek().

2018-09-08 Thread David Miller
Instead of direct list head pointer accesses. Signed-off-by: David S. Miller --- drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c index d

[PATCH net-next 15/15] rtl818x: Remove SKB list assumptions.

2018-09-08 Thread David Miller
Eliminate the assumption that SKBs and SKB list heads can be cast to eachother in SKB list handling code. Signed-off-by: David S. Miller --- drivers/net/wireless/realtek/rtl818x/rtl8187/dev.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless

[PATCH net-next 01/15] sch_htb: Remove local SKB queue handling code.

2018-09-08 Thread David Miller
Instead, adjust __qdisc_enqueue_tail() such that HTB can use it instead. The only other caller of __qdisc_enqueue_tail() is qdisc_enqueue_tail() so we can move the backlog and return value handling (which HTB doesn't need/want) to the latter. Signed-off-by: David S. Miller --- include/net/sch

[PATCH net-next 02/15] sch_netem: Move private queue handler to generic location.

2018-09-08 Thread David Miller
By hand copies of SKB list handlers do not belong in individual packet schedulers. Signed-off-by: David S. Miller --- include/net/sch_generic.h | 11 +++ net/sched/sch_netem.c | 12 +--- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/include/net/sch_generi

[PATCH net-next 08/15] p54: Use skb_peek_tail() instead of direct head pointer accesses.

2018-09-08 Thread David Miller
Signed-off-by: David S. Miller --- drivers/net/wireless/intersil/p54/txrx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/intersil/p54/txrx.c b/drivers/net/wireless/intersil/p54/txrx.c index 3a4214d362ff..790784568ad2 100644 --- a/drivers/net/wire

[PATCH net-next 06/15] lan78xx: Do not access skb_queue_head list pointers directly.

2018-09-08 Thread David Miller
Use skb_queue_walk() instead. Adjust inner loop test to utilize and skb_queue_is_first(). Unfortunately we have to keep pkt_cnt around because it is used by a latter loop in this function. Signed-off-by: David S. Miller --- drivers/net/usb/lan78xx.c | 4 ++-- 1 file changed, 2 insertions(+),

[PATCH net-next 05/15] mac80211: Don't access sk_queue_head->next directly.

2018-09-08 Thread David Miller
Use __skb_peek() instead. Signed-off-by: David S. Miller --- net/mac80211/rx.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index c6bfd4019d44..a0ca27aeb732 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c @@ -2077,6 +2077,7

[PATCH net-next 07/15] sctp: Use skb_queue_is_first().

2018-09-08 Thread David Miller
Instead of direct skb_queue_head pointer accesses. Signed-off-by: David S. Miller --- net/sctp/ulpqueue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/sctp/ulpqueue.c b/net/sctp/ulpqueue.c index 0b427100b0d4..331cc734e3db 100644 --- a/net/sctp/ulpqueue.c +++ b/net/sc

[PATCH net-next 03/15] infiniband: nes: Use skb_peek_next() and skb_queue_walk().

2018-09-08 Thread David Miller
Instead of direct SKB list accesses. Signed-off-by: David S. Miller --- drivers/infiniband/hw/nes/nes_mgt.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/infiniband/hw/nes/nes_mgt.c b/drivers/infiniband/hw/nes/nes_mgt.c index 9bdb84dc225c..e9661c3a 10

[PATCH net-next 04/15] ppp: Remove direct skb_queue_head list pointer access.

2018-09-08 Thread David Miller
Add a helper, __skb_peek(), and use it in ppp_mp_reconstruct(). Signed-off-by: David S. Miller --- drivers/net/ppp/ppp_generic.c | 2 +- include/linux/skbuff.h| 11 +++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/net/ppp/ppp_generic.c b/drivers/net/p

[PATCH net-next 00/15] SKB list handling cleanups

2018-09-08 Thread David Miller
This is a preparatory patch series which cleans up various forms of sloppy SKB list handling, and makes certain semantics explicit. We are trying to eliminate code that directly accesses the SKB list and SKB queue head next/prev members in any way. It is impossible to convert SKB queue head ove

Re: Why not use all the syn queues? in the function "tcp_conn_request", I have some questions.

2018-09-08 Thread Neal Cardwell
On Sat, Sep 8, 2018 at 11:23 AM Ttttabcd wrote: > > Thank you very much for your previous answer, sorry for the inconvenience. > > But now I want to ask you one more question. > > The question is why we need two variables to control the syn queue? > > The first is the "backlog" parameter of the "l

Re: Fixed PHYs and link up/down from user space ?

2018-09-08 Thread Florian Fainelli
On September 8, 2018 6:59:31 AM PDT, Joakim Tjernlund wrote: >I am looking for a way to set physical link state from user space for a >Fixed PHY. >Found the /sys/class/net/eth1/carrier I/F but that didn't work and I >cannot find something else. The carrier sysfs attribute is not writable by d

Re: [PATCH net-next] net: stmmac: Enable TC Ops for GMAC >= 4

2018-09-08 Thread David Miller
From: Jose Abreu Date: Thu, 6 Sep 2018 13:29:30 +0100 > GMAC >= 4 also supports CBS. Lets enable the TC Ops for these versions. > > Signed-off-by: Jose Abreu Applied, thanks. Please work to fix the performance regressions et al. that are still unresolved in the driver. This stmmac MAC is in

Re: [PATCH net-next] net: sched: act_nat: remove dependency on rtnl lock

2018-09-08 Thread David Miller
From: Vlad Buslov Date: Mon, 3 Sep 2018 10:09:20 +0300 > According to the new locking rule, we have to take tcf_lock for both > ->init() and ->dump(), as RTNL will be removed. > > Use tcf spinlock to protect private nat action data from concurrent > modification during dump. (nat init already u

Re: [PATCH net-next] net: sched: act_skbedit: remove dependency on rtnl lock

2018-09-08 Thread David Miller
From: Vlad Buslov Date: Mon, 3 Sep 2018 10:07:15 +0300 > According to the new locking rule, we have to take tcf_lock for both > ->init() and ->dump(), as RTNL will be removed. > > Use tcf lock to protect skbedit action struct private data from concurrent > modification in init and dump. Use rcu

Re: Why not use all the syn queues? in the function "tcp_conn_request", I have some questions.

2018-09-08 Thread Ttttabcd
Thank you very much for your previous answer, sorry for the inconvenience. But now I want to ask you one more question. The question is why we need two variables to control the syn queue? The first is the "backlog" parameter of the "listen" system call that controls the maximum length limit of

Re: [PATCH 1/7] fix hnode refcounting

2018-09-08 Thread Al Viro
On Fri, Sep 07, 2018 at 08:13:56AM -0400, Jamal Hadi Salim wrote: > > } else { > > bool last; > > > > err = tfilter_del_notify(net, skb, n, tp, block, > > q, parent, fh, false, &last, > >

[PATCH] netlink: fix hash::nelems check

2018-09-08 Thread Li RongQing
The type of hash::nelems has been changed from size_t to atom_t which is int in fact, and impossible to be bigger than UINT_MAX Fixes: 97defe1ecf86 ("rhashtable: Per bucket locks & deferred expansion/shrinking") Signed-off-by: Zhang Yu Signed-off-by: Li RongQing --- net/netlink/af_netlink.c |

Re: [PATCH net] qmi_wwan: Support dynamic config on Quectel EP06

2018-09-08 Thread Bjørn Mork
Kristian Evensen writes: > Quectel EP06 (and EM06/EG06) supports dynamic configuration of USB > interfaces, without the device changing VID/PID or configuration number. > When the configuration is updated and interfaces are added/removed, the > interface numbers change. This means that the curren

Fixed PHYs and link up/down from user space ?

2018-09-08 Thread Joakim Tjernlund
I am looking for a way to set physical link state from user space for a Fixed PHY. Found the /sys/class/net/eth1/carrier I/F but that didn't work and I cannot find something else. I want to make ifplugd/dhcp function as if there were a real cable there(or not) Jocke

[PATCH net] qmi_wwan: Support dynamic config on Quectel EP06

2018-09-08 Thread Kristian Evensen
Quectel EP06 (and EM06/EG06) supports dynamic configuration of USB interfaces, without the device changing VID/PID or configuration number. When the configuration is updated and interfaces are added/removed, the interface numbers change. This means that the current code for matching EP06 does not w

[PATCH net] ipv6: use rt6_info members when dst is set in rt6_fill_node

2018-09-08 Thread Xin Long
In inet6_rtm_getroute, since Commit 93531c674315 ("net/ipv6: separate handling of FIB entries from dst based routes"), it has used rt->from to dump route info instead of rt. However for some route like cache, its information is not the same as that of the 'from' one. It caused 'ip -6 route get' to

[PATCH net-next] net: dsa: b53: Uninitialized variable in b53_adjust_link()

2018-09-08 Thread Dan Carpenter
The "pause" variable is only initialized on BCM5301x. Fixes: 5e004460f874 ("net: dsa: b53: Add helper to set link parameters") Signed-off-by: Dan Carpenter diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c index ea4256cd628b..dbf5b86a07fe 100644 --- a/drivers/net/d