* Re: [PATCH net-next] net/ipv4: Add extack message that dev is required for ONLINK
From: David Miller @ 2018-09-01 6:04 UTC (permalink / raw)
To: dsahern; +Cc: netdev, dsahern
In-Reply-To: <20180829235327.18307-1-dsahern@kernel.org>
From: dsahern@kernel.org
Date: Wed, 29 Aug 2018 16:53:27 -0700
> From: David Ahern <dsahern@gmail.com>
>
> Make IPv4 consistent with IPv6 and return an extack message that the
> ONLINK flag requires a nexthop device.
>
> Signed-off-by: David Ahern <dsahern@gmail.com>
Applied.
^ permalink raw reply
* Re: [PATCH net-next] net/ipv6: Do not reset nl_net in ip6_route_info_create
From: David Miller @ 2018-09-01 6:05 UTC (permalink / raw)
To: dsahern; +Cc: netdev, dsahern
In-Reply-To: <20180829235401.18367-1-dsahern@kernel.org>
From: dsahern@kernel.org
Date: Wed, 29 Aug 2018 16:54:01 -0700
> From: David Ahern <dsahern@gmail.com>
>
> nl_net is set on entry to ip6_route_info_create. Only devices
> within that namespace are considered so no need to reset it
> before returning.
>
> Signed-off-by: David Ahern <dsahern@gmail.com>
Applied.
^ permalink raw reply
* Re: [PATCH net-next] net: dsa: mv88e6xxx: Share main switch IRQ
From: David Miller @ 2018-09-01 6:05 UTC (permalink / raw)
To: marek.behun; +Cc: netdev
In-Reply-To: <20180830001350.10062-1-marek.behun@nic.cz>
From: Marek Behún <marek.behun@nic.cz>
Date: Thu, 30 Aug 2018 02:13:50 +0200
> On some boards the interrupt can be shared between multiple devices.
> For example on Turris Mox the interrupt is shared between all switches.
>
> Signed-off-by: Marek Behun <marek.behun@nic.cz>
Applied.
^ permalink raw reply
* Re: [PATCH net] tcp: do not restart timewait timer on rst reception
From: David Miller @ 2018-09-01 6:11 UTC (permalink / raw)
To: fw; +Cc: netdev, edumazet
In-Reply-To: <20180830122429.3546-1-fw@strlen.de>
From: Florian Westphal <fw@strlen.de>
Date: Thu, 30 Aug 2018 14:24:29 +0200
> RFC 1337 says:
> ''Ignore RST segments in TIME-WAIT state.
> If the 2 minute MSL is enforced, this fix avoids all three hazards.''
>
> So with net.ipv4.tcp_rfc1337=1, expected behaviour is to have TIME-WAIT sk
> expire rather than removing it instantly when a reset is received.
>
> However, Linux will also re-start the TIME-WAIT timer.
>
> This causes connect to fail when tying to re-use ports or very long
> delays (until syn retry interval exceeds MSL).
...
> Without this patch, 'ss' shows restarts of tw timer and last packet is
> thus just another pure ack, more than one minute later.
>
> This restores the original code from commit 283fd6cf0be690a83
> ("Merge in ANK networking jumbo patch") in netdev-vger-cvs.git .
>
> For some reason the else branch was removed/lost in 1f28b683339f7
> ("Merge in TCP/UDP optimizations and [..]") and timer restart became
> unconditional.
>
> Reported-by: Michal Tesar <mtesar@redhat.com>
> Signed-off-by: Florian Westphal <fw@strlen.de>
Applied and thanks for the packet drill test case :-)
^ permalink raw reply
* Re: [PATCH v1] bridge: Switch to bitmap_zalloc()
From: David Miller @ 2018-09-01 6:13 UTC (permalink / raw)
To: andriy.shevchenko; +Cc: stephen, bridge, netdev
In-Reply-To: <20180830103318.60804-1-andriy.shevchenko@linux.intel.com>
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Date: Thu, 30 Aug 2018 13:33:18 +0300
> Switch to bitmap_zalloc() to show clearly what we are allocating.
> Besides that it returns pointer of bitmap type instead of opaque void *.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Applied to net-next, thanks.
^ permalink raw reply
* Re: [PATCH net 1/2] selftests: pmtu: maximum MTU for vti4 is 2^16-1-20
From: David Miller @ 2018-09-01 6:14 UTC (permalink / raw)
To: sd; +Cc: netdev, sbrivio, nicolas.dichtel
In-Reply-To: <1e62875c4c72b38b17f6c73f9654696b14fb3166.1535636302.git.sd@queasysnail.net>
From: Sabrina Dubroca <sd@queasysnail.net>
Date: Thu, 30 Aug 2018 16:01:17 +0200
> Since commit 82612de1c98e ("ip_tunnel: restore binding to ifaces with a
> large mtu"), the maximum MTU for vti4 is based on IP_MAX_MTU instead of
> the mysterious constant 0xFFF8. This makes this selftest fail.
>
> Fixes: 82612de1c98e ("ip_tunnel: restore binding to ifaces with a large mtu")
> Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
> Acked-by: Stefano Brivio <sbrivio@redhat.com>
Applied.
^ permalink raw reply
* Re: [PATCH net 2/2] selftests: pmtu: detect correct binary to ping ipv6 addresses
From: David Miller @ 2018-09-01 6:14 UTC (permalink / raw)
To: sd; +Cc: netdev, sbrivio
In-Reply-To: <1dde5f922552343009b6c29f637f6155cea08520.1535636302.git.sd@queasysnail.net>
From: Sabrina Dubroca <sd@queasysnail.net>
Date: Thu, 30 Aug 2018 16:01:18 +0200
> Some systems don't have the ping6 binary anymore, and use ping for
> everything. Detect the absence of ping6 and try to use ping instead.
>
> Fixes: d1f1b9cbf34c ("selftests: net: Introduce first PMTU test")
> Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
> Acked-by: Stefano Brivio <sbrivio@redhat.com>
Applied.
^ permalink raw reply
* Re: [PATCH net] ibmvnic: Include missing return code checks in reset function
From: David Miller @ 2018-09-01 6:16 UTC (permalink / raw)
To: tlfalcon; +Cc: netdev
In-Reply-To: <1535653193-15778-1-git-send-email-tlfalcon@linux.vnet.ibm.com>
From: Thomas Falcon <tlfalcon@linux.vnet.ibm.com>
Date: Thu, 30 Aug 2018 13:19:53 -0500
> Check the return codes of these functions and halt reset
> in case of failure. The driver will remain in a dormant state
> until the next reset event, when device initialization will be
> re-attempted.
>
> Signed-off-by: Thomas Falcon <tlfalcon@linux.vnet.ibm.com>
Applied.
^ permalink raw reply
* [PATCH] net: ipv6: route: Fix a sleep-in-atomic-context bug in ip6_convert_metrics()
From: Jia-Ju Bai @ 2018-09-01 11:19 UTC (permalink / raw)
To: davem, kuznet, yoshfuji; +Cc: netdev, linux-kernel, Jia-Ju Bai
The kernel module may sleep with holding a spinlock.
The function call paths (from bottom to top) in Linux-4.16 are:
[FUNC] kzalloc(GFP_KERNEL)
net/ipv6/route.c, 2430:
kzalloc in ip6_convert_metrics
net/ipv6/route.c, 2890:
ip6_convert_metrics in ip6_route_add
net/ipv6/addrconf.c, 2322:
ip6_route_add in addrconf_prefix_route
net/ipv6/addrconf.c, 3331:
addrconf_prefix_route in fixup_permanent_addr
net/ipv6/addrconf.c, 3354:
fixup_permanent_addr in addrconf_permanent_addr
net/ipv6/addrconf.c, 3358:
_raw_write_lock_bh in addrconf_permanent_addr
To fix this bug, GFP_KERNEL is replaced with GFP_ATOMIC.
This bug is found by my static analysis tool DSAC.
Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
---
net/ipv6/route.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index ec18b3ce8b6d..d15e72def7c1 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -2742,7 +2742,7 @@ static int ip6_convert_metrics(struct net *net, struct fib6_info *rt,
if (!cfg->fc_mx)
return 0;
- p = kzalloc(sizeof(*rt->fib6_metrics), GFP_KERNEL);
+ p = kzalloc(sizeof(*rt->fib6_metrics), GFP_ATOMIC);
if (unlikely(!p))
return -ENOMEM;
--
2.17.0
^ permalink raw reply related
* [PATCH] isdn: mISDN: layer2: Fix a sleep-in-atomic-context bug in create_l2()
From: Jia-Ju Bai @ 2018-09-01 11:57 UTC (permalink / raw)
To: isdn; +Cc: netdev, linux-kernel, Jia-Ju Bai
The kernel module may sleep with holding a spinlock.
The function call paths (from bottom to top) in Linux-4.16 are:
[FUNC] kzalloc(GFP_KERNEL)
drivers/isdn/mISDN/layer2.c, 2126: kzalloc in create_l2
drivers/isdn/mISDN/tei.c, 1054: create_l2 in create_teimgr
drivers/isdn/mISDN/tei.c, 1278: create_teimgr in mgr_ctrl
drivers/isdn/mISDN/tei.c, 1048: [FUNC_PTR]mgr_ctrl in create_teimgr
drivers/isdn/mISDN/tei.c, 1045: _raw_read_lock_irqsave in create_teimgr
Note that [FUNC_PTR] means a function pointer call is used.
To fix this bug, GFP_KERNEL is replaced with GFP_ATOMIC.
This bug is found by my static analysis tool DSAC
Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
---
drivers/isdn/mISDN/layer2.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/isdn/mISDN/layer2.c b/drivers/isdn/mISDN/layer2.c
index 9ff0903a0e89..383f31ae4b92 100644
--- a/drivers/isdn/mISDN/layer2.c
+++ b/drivers/isdn/mISDN/layer2.c
@@ -2123,7 +2123,7 @@ create_l2(struct mISDNchannel *ch, u_int protocol, u_long options, int tei,
struct layer2 *l2;
struct channel_req rq;
- l2 = kzalloc(sizeof(struct layer2), GFP_KERNEL);
+ l2 = kzalloc(sizeof(struct layer2), GFP_ATOMIC);
if (!l2) {
printk(KERN_ERR "kzalloc layer2 failed\n");
return NULL;
--
2.17.0
^ permalink raw reply related
* [PATCH] isdn: mISDN: tei: Fix a sleep-in-atomic-context bug in create_teimgr()
From: Jia-Ju Bai @ 2018-09-01 12:00 UTC (permalink / raw)
To: isdn; +Cc: netdev, linux-kernel, Jia-Ju Bai
The kernel module may sleep with holding a spinlock.
The function call paths (from bottom to top) in Linux-4.16 are:
[FUNC] kzalloc(GFP_KERNEL)
drivers/isdn/mISDN/tei.c, 1058: kzalloc in create_teimgr
drivers/isdn/mISDN/tei.c, 1278: create_teimgr in mgr_ctrl
drivers/isdn/mISDN/tei.c, 1048: [FUNC_PTR]mgr_ctrl in create_teimgr
drivers/isdn/mISDN/tei.c, 1045: _raw_read_lock_irqsave in create_teimgr
Note that [FUNC_PTR] means a function pointer call is used.
To fix this bug, GFP_KERNEL is replaced with GFP_ATOMIC.
This bug is found by my static analysis tool DSAC.
Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
---
drivers/isdn/mISDN/tei.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/isdn/mISDN/tei.c b/drivers/isdn/mISDN/tei.c
index 12d9e5f4beb1..6d95ee639fdb 100644
--- a/drivers/isdn/mISDN/tei.c
+++ b/drivers/isdn/mISDN/tei.c
@@ -1055,7 +1055,7 @@ create_teimgr(struct manager *mgr, struct channel_req *crq)
crq->adr.tei, crq->adr.sapi);
if (!l2)
return -ENOMEM;
- l2->tm = kzalloc(sizeof(struct teimgr), GFP_KERNEL);
+ l2->tm = kzalloc(sizeof(struct teimgr), GFP_ATOMIC);
if (!l2->tm) {
kfree(l2);
printk(KERN_ERR "kmalloc teimgr failed\n");
--
2.17.0
^ permalink raw reply related
* [PATCH] net: cadence: Fix a sleep-in-atomic-context bug in macb_halt_tx()
From: Jia-Ju Bai @ 2018-09-01 12:11 UTC (permalink / raw)
To: nicolas.ferre, davem; +Cc: netdev, linux-kernel, Jia-Ju Bai
The kernel module may sleep with holding a spinlock.
The function call paths (from bottom to top) in Linux-4.16 are:
[FUNC] usleep_range
drivers/net/ethernet/cadence/macb_main.c, 648:
usleep_range in macb_halt_tx
drivers/net/ethernet/cadence/macb_main.c, 730:
macb_halt_tx in macb_tx_error_task
drivers/net/ethernet/cadence/macb_main.c, 721:
_raw_spin_lock_irqsave in macb_tx_error_task
To fix this bug, usleep_range() is replaced with udelay().
This bug is found by my static analysis tool DSAC.
Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
---
drivers/net/ethernet/cadence/macb_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
index a6c911bb5ce2..3dcc31cd4261 100644
--- a/drivers/net/ethernet/cadence/macb_main.c
+++ b/drivers/net/ethernet/cadence/macb_main.c
@@ -641,7 +641,7 @@ static int macb_halt_tx(struct macb *bp)
if (!(status & MACB_BIT(TGO)))
return 0;
- usleep_range(10, 250);
+ udelay(250);
} while (time_before(halt_time, timeout));
return -ETIMEDOUT;
--
2.17.0
^ permalink raw reply related
* [PATCH net-next v3] tcp: propagate gso_segs to the new skb built in tcp collapse
From: Yafang Shao @ 2018-09-01 12:21 UTC (permalink / raw)
To: edumazet, davem; +Cc: netdev, linux-kernel, Yafang Shao
The gso_segs of the new built SKB in tcp collapse is inited to 0,
that makes us hard to know the accurate segments number of this new SKB.
We'd better propagate the gso_segs of the collapsed SKB to the new built
one, so when this SKB is dropped (for example when doing tcp prune) the
sk_drops will be added to the correct value.
If the collapsed SKB is fully copied to the new built one, we just add its
gso_segs to the new SKB.
While if the collapsed SKB is partially copied to the new built SKB,
we have to calculate how many segments are copied.
And when do the calculation we must make sure one SKB holds the same
gso_segs.
Furthemore, we have to reset the gso_segs of this SKB if is is partially
copied, so in the next round when the left segments are copied it could
propagate the correct value.
The gso_size will never exceed 65536 as the max size of the new built SKB
is 4K.
Signed-off-by: Yafang Shao <laoar.shao@gmail.com>
---
net/ipv4/tcp_input.c | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 62508a2..6dc8e2f 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -4910,6 +4910,7 @@ void tcp_rbtree_insert(struct rb_root *root, struct sk_buff *skb)
while (before(start, end)) {
int copy = min_t(int, SKB_MAX_ORDER(0, 0), end - start);
struct sk_buff *nskb;
+ int len = copy;
nskb = alloc_skb(copy, GFP_ATOMIC);
if (!nskb)
@@ -4928,12 +4929,24 @@ void tcp_rbtree_insert(struct rb_root *root, struct sk_buff *skb)
/* Copy data, releasing collapsed skbs. */
while (copy > 0) {
- int offset = start - TCP_SKB_CB(skb)->seq;
int size = TCP_SKB_CB(skb)->end_seq - start;
+ int offset = start - TCP_SKB_CB(skb)->seq;
BUG_ON(offset < 0);
if (size > 0) {
- size = min(copy, size);
+ if (copy >= size) {
+ skb_shinfo(nskb)->gso_segs +=
+ max_t(u16, 1, skb_shinfo(skb)->gso_segs);
+ } else {
+ skb_shinfo(nskb)->gso_size =
+ skb_shinfo(skb)->gso_size;
+ skb_shinfo(nskb)->gso_segs =
+ DIV_ROUND_UP(len, skb_shinfo(nskb)->gso_size);
+ skb_shinfo(skb)->gso_segs =
+ DIV_ROUND_UP(size - copy, skb_shinfo(skb)->gso_size);
+ size = copy;
+ }
+
if (skb_copy_bits(skb, offset, skb_put(nskb, size), size))
BUG();
TCP_SKB_CB(nskb)->end_seq += size;
--
1.8.3.1
^ permalink raw reply related
* [PATCH net-next] tcp: remove useless add operation when init sysctl_max_tw_buckets
From: Yafang Shao @ 2018-09-01 12:21 UTC (permalink / raw)
To: edumazet, davem; +Cc: netdev, linux-kernel, Yafang Shao
In-Reply-To: <1535804465-11795-1-git-send-email-laoar.shao@gmail.com>
cp_hashinfo.ehash_mask is always an odd number, which is set in function
alloc_large_system_hash(). See bellow,
if (_hash_mask)
*_hash_mask = (1 << log2qty) - 1; <<< always odd number
Hence the local variable 'cnt' is a even number, as a result of that it is
no difference to do the incrementation here.
Signed-off-by: Yafang Shao <laoar.shao@gmail.com>
---
net/ipv4/tcp_ipv4.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 44c09ed..09547ef 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -2549,7 +2549,7 @@ static int __net_init tcp_sk_init(struct net *net)
net->ipv4.sysctl_tcp_tw_reuse = 2;
cnt = tcp_hashinfo.ehash_mask + 1;
- net->ipv4.tcp_death_row.sysctl_max_tw_buckets = (cnt + 1) / 2;
+ net->ipv4.tcp_death_row.sysctl_max_tw_buckets = cnt / 2;
net->ipv4.tcp_death_row.hashinfo = &tcp_hashinfo;
net->ipv4.sysctl_max_syn_backlog = max(128, cnt / 256);
--
1.8.3.1
^ permalink raw reply related
* Re: [PATCH v2 1/6] net/wan/fsl_ucc_hdlc: allow ucc index up to 7
From: christophe leroy @ 2018-09-01 7:58 UTC (permalink / raw)
To: David Gounaris, qiang.zhao, netdev, linuxppc-dev, robh+dt
In-Reply-To: <20180829131328.27901-2-david.gounaris@infinera.com>
Le 29/08/2018 à 15:13, David Gounaris a écrit :
> There is a need to allow higher indexes to be
> able to support MPC83xx platforms. (UCC1-UCC8)
>
> Signed-off-by: David Gounaris <david.gounaris@infinera.com>
> ---
> drivers/net/wan/fsl_ucc_hdlc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/wan/fsl_ucc_hdlc.c b/drivers/net/wan/fsl_ucc_hdlc.c
> index 33df76405b86..5cf6dcba039c 100644
> --- a/drivers/net/wan/fsl_ucc_hdlc.c
> +++ b/drivers/net/wan/fsl_ucc_hdlc.c
> @@ -1016,7 +1016,7 @@ static int ucc_hdlc_probe(struct platform_device *pdev)
> }
>
> ucc_num = val - 1;
> - if ((ucc_num > 3) || (ucc_num < 0)) {
> + if ((ucc_num > UCC_MAX_NUM - 1) || (ucc_num < 0)) {
CHECK:UNNECESSARY_PARENTHESES: Unnecessary parentheses around 'ucc_num < 0'
#23: FILE: drivers/net/wan/fsl_ucc_hdlc.c:1018:
+ if ((ucc_num > UCC_MAX_NUM - 1) || (ucc_num < 0)) {
> dev_err(&pdev->dev, ": Invalid UCC num\n");
> return -EINVAL;
> }
>
---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
https://www.avast.com/antivirus
^ permalink raw reply
* Re: [PATCH v2 3/6] net/wan/fsl_ucc_hdlc: Adding ARPHRD_ETHER
From: christophe leroy @ 2018-09-01 8:05 UTC (permalink / raw)
To: David Gounaris, qiang.zhao, netdev, linuxppc-dev, robh+dt
In-Reply-To: <20180829131328.27901-4-david.gounaris@infinera.com>
Le 29/08/2018 à 15:13, David Gounaris a écrit :
> This patch is to avoid discarding ethernet
> packets when using HDLC_ETH protocol.
>
> Signed-off-by: David Gounaris <david.gounaris@infinera.com>
> ---
> drivers/net/wan/fsl_ucc_hdlc.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/drivers/net/wan/fsl_ucc_hdlc.c b/drivers/net/wan/fsl_ucc_hdlc.c
> index c8e526bf1130..0f703d7be5e0 100644
> --- a/drivers/net/wan/fsl_ucc_hdlc.c
> +++ b/drivers/net/wan/fsl_ucc_hdlc.c
> @@ -376,6 +376,10 @@ static netdev_tx_t ucc_hdlc_tx(struct sk_buff *skb, struct net_device *dev)
> dev->stats.tx_bytes += skb->len;
> break;
>
> + case ARPHRD_ETHER:
> + dev->stats.tx_bytes += skb->len;
> + break;
> +
> default:
> dev->stats.tx_dropped++;
> dev_kfree_skb(skb);
> @@ -513,6 +517,8 @@ static int hdlc_rx_done(struct ucc_hdlc_private *priv, int rx_work_limit)
> break;
>
> case ARPHRD_PPP:
> + case ARPHRD_ETHER:
> +
ERROR:TRAILING_WHITESPACE: trailing whitespace
#34: FILE: drivers/net/wan/fsl_ucc_hdlc.c:520:
+^I^I^I$
Note that 'git show' would show it to you in red background so you
shouldn't miss it.
And this additional blank line is unnecessary.
> length -= HDLC_CRC_SIZE;
>
> skb = dev_alloc_skb(length);
>
---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
https://www.avast.com/antivirus
^ permalink raw reply
* Re: [PATCH v2 4/6] net/wan/fsl_ucc_hdlc: hmask
From: christophe leroy @ 2018-09-01 8:06 UTC (permalink / raw)
To: David Gounaris, qiang.zhao, netdev, linuxppc-dev, robh+dt
In-Reply-To: <20180829131328.27901-5-david.gounaris@infinera.com>
Le 29/08/2018 à 15:13, David Gounaris a écrit :
> Ability to set hmask in the device-tree,
> which can be used to change address
> filtering of packets.
>
> Signed-off-by: David Gounaris <david.gounaris@infinera.com>
> ---
> Documentation/devicetree/bindings/soc/fsl/cpm_qe/network.txt | 6 ++++++
> drivers/net/wan/fsl_ucc_hdlc.c | 5 ++++-
> drivers/net/wan/fsl_ucc_hdlc.h | 1 +
> 3 files changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/devicetree/bindings/soc/fsl/cpm_qe/network.txt b/Documentation/devicetree/bindings/soc/fsl/cpm_qe/network.txt
> index 03c741602c6d..6d2dd8a31482 100644
> --- a/Documentation/devicetree/bindings/soc/fsl/cpm_qe/network.txt
> +++ b/Documentation/devicetree/bindings/soc/fsl/cpm_qe/network.txt
> @@ -98,6 +98,12 @@ The property below is dependent on fsl,tdm-interface:
> usage: optional for tdm interface
> value type: <empty>
> Definition : Internal loopback connecting on TDM layer.
> +- fsl,hmask
> + usage: optional
> + Value type: <u16>
> + Definition: HDLC address recognition. Set to zero to disable
> + address filtering of packets:
> + fsl,hmask = /bits/ 16 <0x0000>;
>
> Example for tdm interface:
>
> diff --git a/drivers/net/wan/fsl_ucc_hdlc.c b/drivers/net/wan/fsl_ucc_hdlc.c
> index 0f703d7be5e0..be5b0096af3b 100644
> --- a/drivers/net/wan/fsl_ucc_hdlc.c
> +++ b/drivers/net/wan/fsl_ucc_hdlc.c
> @@ -263,7 +263,7 @@ static int uhdlc_init(struct ucc_hdlc_private *priv)
> iowrite16be(MAX_FRAME_LENGTH, &priv->ucc_pram->mflr);
> iowrite16be(DEFAULT_RFTHR, &priv->ucc_pram->rfthr);
> iowrite16be(DEFAULT_RFTHR, &priv->ucc_pram->rfcnt);
> - iowrite16be(DEFAULT_ADDR_MASK, &priv->ucc_pram->hmask);
> + iowrite16be(priv->hmask, &priv->ucc_pram->hmask);
> iowrite16be(DEFAULT_HDLC_ADDR, &priv->ucc_pram->haddr1);
> iowrite16be(DEFAULT_HDLC_ADDR, &priv->ucc_pram->haddr2);
> iowrite16be(DEFAULT_HDLC_ADDR, &priv->ucc_pram->haddr3);
> @@ -1097,6 +1097,9 @@ static int ucc_hdlc_probe(struct platform_device *pdev)
> if (ret)
> goto free_utdm;
> }
> +
ERROR:TRAILING_WHITESPACE: trailing whitespace
#51: FILE: drivers/net/wan/fsl_ucc_hdlc.c:1099:
+^I$
'git show' (or git log -p) would show it to you in red background.
> + if (of_property_read_u16(np, "fsl,hmask", &uhdlc_priv->hmask))
> + uhdlc_priv->hmask = DEFAULT_ADDR_MASK;
>
> ret = uhdlc_init(uhdlc_priv);
> if (ret) {
> diff --git a/drivers/net/wan/fsl_ucc_hdlc.h b/drivers/net/wan/fsl_ucc_hdlc.h
> index c21134c1f180..b99fa2f1cd99 100644
> --- a/drivers/net/wan/fsl_ucc_hdlc.h
> +++ b/drivers/net/wan/fsl_ucc_hdlc.h
> @@ -106,6 +106,7 @@ struct ucc_hdlc_private {
>
> unsigned short encoding;
> unsigned short parity;
> + unsigned short hmask;
> u32 clocking;
> spinlock_t lock; /* lock for Tx BD and Tx buffer */
> #ifdef CONFIG_PM
>
---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
https://www.avast.com/antivirus
^ permalink raw reply
* Re: [PATCH v2 2/6] net/wan/fsl_ucc_hdlc: allow PARITY_CRC16_PR0_CCITT parity
From: christophe leroy @ 2018-09-01 8:03 UTC (permalink / raw)
To: David Gounaris, qiang.zhao, netdev, linuxppc-dev, robh+dt
In-Reply-To: <20180829131328.27901-3-david.gounaris@infinera.com>
Le 29/08/2018 à 15:13, David Gounaris a écrit :
> Signed-off-by: David Gounaris <david.gounaris@infinera.com>
> ---
> drivers/net/wan/fsl_ucc_hdlc.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/wan/fsl_ucc_hdlc.c b/drivers/net/wan/fsl_ucc_hdlc.c
> index 5cf6dcba039c..c8e526bf1130 100644
> --- a/drivers/net/wan/fsl_ucc_hdlc.c
> +++ b/drivers/net/wan/fsl_ucc_hdlc.c
> @@ -781,7 +781,8 @@ static int ucc_hdlc_attach(struct net_device *dev, unsigned short encoding,
>
> if (parity != PARITY_NONE &&
> parity != PARITY_CRC32_PR1_CCITT &&
> - parity != PARITY_CRC16_PR1_CCITT)
> + parity != PARITY_CRC16_PR1_CCITT &&
> + parity != PARITY_CRC16_PR0_CCITT)
ERROR:TRAILING_WHITESPACE: trailing whitespace
#20: FILE: drivers/net/wan/fsl_ucc_hdlc.c:783:
+^I parity != PARITY_CRC16_PR1_CCITT && $
Also, you could have left the line 'parity != PARITY_CRC16_PR1_CCITT)'
as is and just have added 'parity != PARITY_CRC16_PR0_CCITT &&' on the
previous line, would make more sense to have PR0 before PR1, and instead
of having 2+1- you would only have 1+
> return -EINVAL;
>
> priv->encoding = encoding;
>
---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
https://www.avast.com/antivirus
^ permalink raw reply
* Re: [PATCH v2 5/6] net/wan/fsl_ucc_hdlc: GUMR for non tsa mode
From: christophe leroy @ 2018-09-01 8:08 UTC (permalink / raw)
To: David Gounaris, qiang.zhao, netdev, linuxppc-dev, robh+dt
In-Reply-To: <20180829131328.27901-6-david.gounaris@infinera.com>
Le 29/08/2018 à 15:13, David Gounaris a écrit :
> The following bits in the GUMR is changed for non
> tsa mode: CDS, CTSP and CTSS are set to zero.
>
> When set, there is no tx interrupts from the controller.
>
> Signed-off-by: David Gounaris <david.gounaris@infinera.com>
> ---
> drivers/net/wan/fsl_ucc_hdlc.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/drivers/net/wan/fsl_ucc_hdlc.c b/drivers/net/wan/fsl_ucc_hdlc.c
> index be5b0096af3b..248f1f5bcd04 100644
> --- a/drivers/net/wan/fsl_ucc_hdlc.c
> +++ b/drivers/net/wan/fsl_ucc_hdlc.c
> @@ -97,6 +97,13 @@ static int uhdlc_init(struct ucc_hdlc_private *priv)
> if (priv->tsa) {
> uf_info->tsa = 1;
> uf_info->ctsp = 1;
> + uf_info->cds = 1;
> + uf_info->ctss = 1;
> + }
> + else {
ERROR:ELSE_AFTER_BRACE: else should follow close brace '}'
#27: FILE: drivers/net/wan/fsl_ucc_hdlc.c:103:
+ }
+ else {
CHECK:BRACES: Unbalanced braces around else statement
#27: FILE: drivers/net/wan/fsl_ucc_hdlc.c:103:
+ else {
Should be:
} else {
> + uf_info->cds = 0;
> + uf_info->ctsp = 0;
> + uf_info->ctss = 0;
> }
>
> /* This sets HPM register in CMXUCR register which configures a
>
---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
https://www.avast.com/antivirus
^ permalink raw reply
* Re: [PATCH v2 6/6] net/wan/fsl_ucc_hdlc: tx timeout handler
From: christophe leroy @ 2018-09-01 8:10 UTC (permalink / raw)
To: David Gounaris, qiang.zhao, netdev, linuxppc-dev, robh+dt
In-Reply-To: <20180829131328.27901-7-david.gounaris@infinera.com>
Le 29/08/2018 à 15:13, David Gounaris a écrit :
> Added tx timerout handler. This helps
> when troubleshooting.
>
> Signed-off-by: David Gounaris <david.gounaris@infinera.com>
> ---
> drivers/net/wan/fsl_ucc_hdlc.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/net/wan/fsl_ucc_hdlc.c b/drivers/net/wan/fsl_ucc_hdlc.c
> index 248f1f5bcd04..629ef5049d27 100644
> --- a/drivers/net/wan/fsl_ucc_hdlc.c
> +++ b/drivers/net/wan/fsl_ucc_hdlc.c
> @@ -1002,11 +1002,15 @@ static const struct dev_pm_ops uhdlc_pm_ops = {
> #define HDLC_PM_OPS NULL
>
> #endif
> +static void uhdlc_tx_timeout(struct net_device *ndev) {
ERROR:OPEN_BRACE: open brace '{' following function definitions go on
the next line
#22: FILE: drivers/net/wan/fsl_ucc_hdlc.c:1004:
+static void uhdlc_tx_timeout(struct net_device *ndev) {
> + netdev_err(ndev, "%s\n", __FUNCTION__);
WARNING:USE_FUNC: __func__ should be used instead of gcc specific
__FUNCTION__
#23: FILE: drivers/net/wan/fsl_ucc_hdlc.c:1005:
+ netdev_err(ndev, "%s\n", __FUNCTION__);
> +}
> static const struct net_device_ops uhdlc_ops = {
> .ndo_open = uhdlc_open,
> .ndo_stop = uhdlc_close,
> .ndo_start_xmit = hdlc_start_xmit,
> .ndo_do_ioctl = uhdlc_ioctl,
> + .ndo_tx_timeout = uhdlc_tx_timeout,
> };
>
> static int ucc_hdlc_probe(struct platform_device *pdev)
> @@ -1125,6 +1129,7 @@ static int ucc_hdlc_probe(struct platform_device *pdev)
> hdlc = dev_to_hdlc(dev);
> dev->tx_queue_len = 16;
> dev->netdev_ops = &uhdlc_ops;
> + dev->watchdog_timeo = 2*HZ;
CHECK:SPACING: spaces preferred around that '*' (ctx:VxV)
#38: FILE: drivers/net/wan/fsl_ucc_hdlc.c:1131:
+ dev->watchdog_timeo = 2*HZ;
> hdlc->attach = ucc_hdlc_attach;
> hdlc->xmit = ucc_hdlc_tx;
> netif_napi_add(dev, &uhdlc_priv->napi, ucc_hdlc_poll, 32);
>
---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
https://www.avast.com/antivirus
^ permalink raw reply
* Re: [PATCH v2 0/6] Ethernet over hdlc
From: christophe leroy @ 2018-09-01 8:10 UTC (permalink / raw)
To: David Gounaris, qiang.zhao, netdev, linuxppc-dev, robh+dt
In-Reply-To: <20180829131328.27901-1-david.gounaris@infinera.com>
Le 29/08/2018 à 15:13, David Gounaris a écrit :
> Here is what has been changed in v2 after the review comments.
>
> v2-0001: Using UCC_MAX_NUM
This one has a warning/check from checkpatch
> v2-0002: Unchanged
> v2-0003: Changed commit message
> v2-0004: Adding fsl,hmask into the dt instead of changing the default value.
> v2-0005: Unchanged
> v2-0006: Unchanged
All the above have an error from checkpatch
You should run checkpatch on your patches and fix the errors and warnings.
You can also see them at
https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=63075
Christophe
>
> Adding robh+dt@kernel.org for comments regarding dt.
>
> Best Regards
> David Gounaris
>
> David Gounaris (6):
> net/wan/fsl_ucc_hdlc: allow ucc index up to 7
> net/wan/fsl_ucc_hdlc: allow PARITY_CRC16_PR0_CCITT parity
> net/wan/fsl_ucc_hdlc: Adding ARPHRD_ETHER
> net/wan/fsl_ucc_hdlc: hmask
> net/wan/fsl_ucc_hdlc: GUMR for non tsa mode
> net/wan/fsl_ucc_hdlc: tx timeout handler
>
> .../devicetree/bindings/soc/fsl/cpm_qe/network.txt | 6 +++++
> drivers/net/wan/fsl_ucc_hdlc.c | 28 +++++++++++++++++++---
> drivers/net/wan/fsl_ucc_hdlc.h | 1 +
> 3 files changed, 32 insertions(+), 3 deletions(-)
>
---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
https://www.avast.com/antivirus
^ permalink raw reply
* Re: [PATCH net-next] veth: report NEWLINK event when moving the peer device in a new namespace
From: Lorenzo Bianconi @ 2018-09-01 9:05 UTC (permalink / raw)
To: David Ahern; +Cc: David S. Miller, Network Development, Thomas Haller
In-Reply-To: <20180831165444.GE6236@localhost.localdomain>
>
> > On 8/31/18 10:19 AM, Lorenzo Bianconi wrote:
> > >> On 8/31/18 5:43 AM, Lorenzo Bianconi wrote:
> > >>> When moving a veth device to another namespace, userspace receives a
> > >>> RTM_DELLINK message indicating the device has been removed from current
> > >>> netns. However, the other peer does not receive a netlink event
> > >>> containing new values for IFLA_LINK_NETNSID and IFLA_LINK veth
> > >>> attributes.
> > >>> Fix that behaviour sending to userspace a RTM_NEWLINK message in the peer
> > >>> namespace to report new IFLA_LINK_NETNSID/IFLA_LINK values
> > >>>
> > >>
> > >> A newlink message is generated in the new namespace. What information is
> > >> missing from that message?
> > >>
> > >
> > > Hi David,
> > >
> > > let's assume we have two veth paired devices (veth0 and veth1) on inet
> > > namespace. When moving a veth1 to another namespace, userspace is notified
> > > with RTM_DELLINK event on inet namespace to indicate that veth1 has been
> > > moved to another namespace. However some userspace applications
> > > (e.g. NetworkManager), listening for events on inet namespace, are interested
> > > in veth1 ifindex in the new namespace. This patch sends a new RTM_NEWLINK event
> > > in inet namespace to provide new values for IFLA_LINK_NETNSID/IFLA_LINK
> >
> > This is in init namespace
> > $ ip li set veth2 netns foo
> >
> > $ ip monitor
> > Deleted 20: veth2@veth1: <BROADCAST,MULTICAST,M-DOWN> mtu 1500 qdisc
> > noop state DOWN group default
> > link/ether c6:d0:d6:c5:23:7d brd ff:ff:ff:ff:ff:ff new-netns foo
> > new-ifindex 20
> >
> > It shows the new namespace in the delete message.
>
Hi David,
I was thinking about the commit 38e01b30563a and then I realized I
misread the code
yesterday. The commit 38e01b30563a provides all relevant info but it
emits the event
for veth1 (the device moved in the new namespace).
An userspace application will not receive that message if it filters
events for just
a specific device (veth0 in this case) despite that some device
properties have changed
(since veth0 and veth1 are paired devices). To fix that behavior in
veth_notify routine
I emits a RTM_NEWLINK event for veth0.
Regards,
Lorenzo
^ permalink raw reply
* [BUG] net: wireless: mwifiex: A possible sleep-in-atomic-context bug in mwifiex_wait_queue_complete()
From: Jia-Ju Bai @ 2018-09-01 9:08 UTC (permalink / raw)
To: amitkarwar, nishants, gbhat, huxinming820, kvalo
Cc: linux-wireless, netdev, Linux Kernel Mailing List
mwifiex_usb_tx_complete() is a completion handler function for the
USB driver. So it should not sleep, but it is can sleep according to the
function call paths (from bottom to top) in Linux-4.16:
[FUNC] schedule_timeout
drivers/net/wireless/marvell/mwifiex/sta_ioctl.c, 63:
schedule_timeout in mwifiex_wait_queue_complete
drivers/net/wireless/marvell/mwifiex/cmdevt.c, 673:
mwifiex_wait_queue_complete in mwifiex_send_cmd
drivers/net/wireless/marvell/mwifiex/main.c, 1046:
mwifiex_send_cmd in mwifiex_multi_chan_resync
drivers/net/wireless/marvell/mwifiex/usb.c, 288:
mwifiex_multi_chan_resync in mwifiex_usb_tx_complete
I do not find a good way to fix this bug, so I only report it.
This bug is found by my static analysis tool DSAC.
Best wishes,
Jia-Ju Bai
^ permalink raw reply
* Re: phys_port_id in switchdev mode?
From: Jakub Kicinski @ 2018-09-01 11:34 UTC (permalink / raw)
To: Marcelo Ricardo Leitner
Cc: Florian Fainelli, Or Gerlitz, Simon Horman, Andy Gospodarek,
mchan@broadcom.com, Jiri Pirko, Alexander Duyck, Frederick Botha,
nick viljoen, netdev@vger.kernel.org
In-Reply-To: <20180831201321.GA4590@localhost.localdomain>
On Fri, 31 Aug 2018 17:13:22 -0300, Marcelo Ricardo Leitner wrote:
> On Tue, Aug 28, 2018 at 08:43:51PM +0200, Jakub Kicinski wrote:
> > Ugh, CC: netdev..
> >
> > On Tue, 28 Aug 2018 20:05:39 +0200, Jakub Kicinski wrote:
> > > Hi!
> > >
> > > I wonder if we can use phys_port_id in switchdev to group together
> > > interfaces of a single PCI PF? Here is the problem:
>
> On Mellanox cards, this is already possible via phys_switch_id, as
> each PF has its own phys_switch_id. So all VFs with a given
> phys_switch_id belong to the PF with that same phys_switch_id.
You mean Connect-X4 and on, Connect-X3 also shares PF between ports.
But you're right, in simpler designs there is usually a 1:1 relation
between an external networking port, a PCIe PF and a eswitch. Which
does not mean it's correct to conflate the ports.
> I understand this is a vendor-specific design
It's hardly a strange design :) If the card is a true switch
associating VFs on the PCIe side with an Ethernet port makes no sense.
> but if you have the same phys_switch_id across PFs, does it really
> matter on which PF the VF was created on?
It does, because one can have multiple PFs, potentially connected to
different hosts. And legacy NDOs, for example, must target the right
one.
So for one thing it seems like the right thing to do to associate VFs
with PFs, not external ports.
The other thing is that if you look at your Mellanox card in switchdev
mode, you'll notice that systemd/udev is not able to name the
representor interfaces properly without custom rules, because they are
not linked to the PCIe PF. They are not linked because VF reprs don't
provide legacy SR-IOV NDOs, so we prevent libvirt from poking at them.
phys_port_id should steer libvirt away from VF representors, so we can
get proper naming. (And having legacy NDOs implemented everywhere is a
no-go, because ip link output grows quadratically.)
^ permalink raw reply
* [PATCH v2 net-next 0/7] Add support for Lantiq / Intel vrx200 network
From: Hauke Mehrtens @ 2018-09-01 11:45 UTC (permalink / raw)
To: davem
Cc: netdev, andrew, vivien.didelot, f.fainelli, john, linux-mips, dev,
hauke.mehrtens, devicetree, Hauke Mehrtens
This adds basic support for the GSWIP (Gigabit Switch) found in the
VRX200 SoC.
There are different versions of this IP core used in different SoCs, but
this driver was currently only tested on the VRX200 SoC line, for other
SoCs this driver probably need some adoptions to work.
I also plan to add Layer 2 offloading to the DSA driver and later also
layer 3 offloading which is supported by the PPE HW block.
All these patches should go through the net-next tree.
"MIPS: lantiq: dma: add dev pointer" fixes a problem introduces with
4.19-rc1 and this should also go into 4.19, but it changes the API and I
need this API change in this new driver added in these patches.
Changes since:
v1:
* Add "MIPS: lantiq: dma: add dev pointer"
* checkpatch fixes a all patches
* Added binding documentation
* use readx_poll_timeout function and ETIMEOUT error code
* integrate GPHY firmware loading into DSA driver
* renamed to NET_DSA_LANTIQ_GSWIP
* removed some needed casts
* added of_device_id.data information about the detected switch
* fixed John's email address
Hauke Mehrtens (7):
MIPS: lantiq: dma: add dev pointer
MIPS: lantiq: Do not enable IRQs in dma open
net: dsa: Add Lantiq / Intel GSWIP tag support
dt-bindings: net: Add lantiq,xrx200-net DT bindings
net: lantiq: Add Lantiq / Intel VRX200 Ethernet driver
dt-bindings: net: dsa: Add lantiq,xrx200-gswip DT bindings
net: dsa: Add Lantiq / Intel DSA driver for vrx200
.../devicetree/bindings/net/dsa/lantiq-gswip.txt | 141 +++
.../devicetree/bindings/net/lantiq,xrx200-net.txt | 21 +
MAINTAINERS | 9 +
arch/mips/include/asm/mach-lantiq/xway/xway_dma.h | 1 +
arch/mips/lantiq/xway/dma.c | 5 +-
arch/mips/lantiq/xway/sysctrl.c | 14 +-
drivers/net/dsa/Kconfig | 8 +
drivers/net/dsa/Makefile | 1 +
drivers/net/dsa/lantiq_gswip.c | 1018 ++++++++++++++++++++
drivers/net/dsa/lantiq_pce.h | 153 +++
drivers/net/ethernet/Kconfig | 7 +
drivers/net/ethernet/Makefile | 1 +
drivers/net/ethernet/lantiq_etop.c | 2 +
drivers/net/ethernet/lantiq_xrx200.c | 591 ++++++++++++
include/net/dsa.h | 1 +
net/dsa/Kconfig | 3 +
net/dsa/Makefile | 1 +
net/dsa/dsa.c | 3 +
net/dsa/dsa_priv.h | 3 +
net/dsa/tag_gswip.c | 107 ++
20 files changed, 2080 insertions(+), 10 deletions(-)
create mode 100644 Documentation/devicetree/bindings/net/dsa/lantiq-gswip.txt
create mode 100644 Documentation/devicetree/bindings/net/lantiq,xrx200-net.txt
create mode 100644 drivers/net/dsa/lantiq_gswip.c
create mode 100644 drivers/net/dsa/lantiq_pce.h
create mode 100644 drivers/net/ethernet/lantiq_xrx200.c
create mode 100644 net/dsa/tag_gswip.c
--
2.11.0
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox