* Re: [PATCH net-next] vxlan: dont migrate permanent fdb entries during learn
From: Roopa Prabhu @ 2017-06-11 23:26 UTC (permalink / raw)
To: David Miller
Cc: netdev@vger.kernel.org, Jiri Benc, hannes@stressinduktion.org,
Nicolas Dichtel, Nikolay Aleksandrov
In-Reply-To: <20170611.190416.1443081184910537296.davem@davemloft.net>
On Sun, Jun 11, 2017 at 4:04 PM, David Miller <davem@davemloft.net> wrote:
> From: Roopa Prabhu <roopa@cumulusnetworks.com>
> Date: Sun, 11 Jun 2017 15:51:22 -0700
>
>> From: Roopa Prabhu <roopa@cumulusnetworks.com>
>>
>> This patch fixes vxlan_snoop to not move permanent fdb entries
>> on learn events. This is consistent with the bridge fdb
>> handling of permanent entries.
>>
>> Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
>
> Is there an appropriate Fixes: tag by chance?
Just checked history. It has been that way since beginning of time.
Initial vxlan implementation (year 2012) allowed migration of any
entry via learn. A 2013 commit 26a41ae60438 ("vxlan: only migrate
dynamic FDB entries") tried to fix it, but it added a check for static
entries only (NUD_NOARP) and missed permanent entries (NUD_PERMANENT).
I think we can add:
Fixes: 26a41ae60438 ("vxlan: only migrate dynamic FDB entries")
I can re-spin with this Fixes tag.
^ permalink raw reply
* [PATCH net-next v2] vxlan: dont migrate permanent fdb entries during learn
From: Roopa Prabhu @ 2017-06-11 23:32 UTC (permalink / raw)
To: davem; +Cc: netdev, jbenc, hannes, nicolas.dichtel, nikolay
From: Roopa Prabhu <roopa@cumulusnetworks.com>
This patch fixes vxlan_snoop to not move permanent fdb entries
on learn events. This is consistent with the bridge fdb
handling of permanent entries.
Fixes: 26a41ae60438 ("vxlan: only migrate dynamic FDB entries")
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
---
v2 - added Fixes tag
drivers/net/vxlan.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index 7cb21a0..e045c34 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -970,7 +970,7 @@ static bool vxlan_snoop(struct net_device *dev,
return false;
/* Don't migrate static entries, drop packets */
- if (f->state & NUD_NOARP)
+ if (f->state & (NUD_PERMANENT | NUD_NOARP))
return true;
if (net_ratelimit())
--
1.9.1
^ permalink raw reply related
* Re: ipmr: MFC routes when VIF deleted
From: Donald Sharp @ 2017-06-12 0:58 UTC (permalink / raw)
To: Nikolay Aleksandrov; +Cc: Yotam Gigi, netdev@vger.kernel.org
In-Reply-To: <9fa9aa78-2281-dce1-3ff1-a76807d75d42@cumulusnetworks.com>
I would argue that this is just an unintended side effect of the
original implementation. Shuffling interface vif's seems like a good
way to churn a significant number of mroutes to me. If you want to
use a interface it probably is going to be already be configured with
it's own vif, and as such it's just better to figure out the new
proper RPF and insert that mroute. If it isn't, then I need to bring
up that new vif ( and all it's associated pim information, like
establishing a new neighbor relationship ) when I do need to shuffle
interface vif's, In that time I'm dropping a signficant number of
packets while this is happening and all our end users are going to be
screaming at us to fix that hole.
donald
On Sun, Jun 11, 2017 at 12:34 PM, Nikolay Aleksandrov
<nikolay@cumulusnetworks.com> wrote:
> On 11/06/17 11:55, Yotam Gigi wrote:
>> I have been looking into some weird behavior, and I am not sure whether it is
>> a bug or a feature.
>>
>> When a VIF with index v gets deleted, the MFC routes does not get updated, which
>> means that there can be routes pointing to that VIF. On datapath, when packet
>> hits that route, the VIF validity will be checked and will not be sent to that
>> device (but still, the route does not get updated). Now, if the user creates
>> another VIF with the same index v but different underlay device, the same route
>> will forward the traffic to that device.
>>
>> It is relevant to mention that when user adds a MFC route, only the active VIFs
>> are used, so the flow of adding a route with dummy VIF indices and then
>> connecting those VIF indices to real device is not supported. The only way to
>> create a MFC route that has non existing VIFs is to create one with existing
>> VIFs and then delete them.
>>
>> Do we really want to support that? To me, it looks like a buggy flow and I
>> suggest that upon VIF deletion, the MFC routes will be updated to not point to
>> any non existing VIF indices.
>>
>
> Hi Yotam,
> I'm not strongly against such change but my feeling is that we shouldn't change it.
> I think we shouldn't change it because we cannot guarantee that we won't break some
> user-space app that relies on this behaviour or uses it as an optimization.
> User-space ipmr apps work in sync with the kernel and are usually the only ones
> doing such changes so their internal state will be always valid, and I'd guess
> they already deal with this one way or another.
> My second argument is a minor one and is about performance. There are some apps
> (e.g. pimd) which use interface add/del on interface state change (up/down) and
> this could make these ops slower on large setups.
>
> Again I see how this could be helpful and should've probably been like that from the
> start, so if other people feel confident we won't break anything then I wouldn't
> mind the change.
>
> Thanks,
> Nik
>
>
>
^ permalink raw reply
* Re: [PATCH v2 1/2] tcp: md5: add an address prefix for key lookup
From: kbuild test robot @ 2017-06-12 1:20 UTC (permalink / raw)
To: Ivan Delalande
Cc: kbuild-all, David Miller, Eric Dumazet, netdev, linux-kernel,
Ivan Delalande
In-Reply-To: <20170610021449.16091-1-colona@arista.com>
[-- Attachment #1: Type: text/plain, Size: 3013 bytes --]
Hi Ivan,
[auto build test WARNING on net/master]
[also build test WARNING on v4.12-rc4 next-20170609]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Ivan-Delalande/tcp-md5-add-an-address-prefix-for-key-lookup/20170611-184237
config: x86_64-randconfig-s2-06120830 (attached as .config)
compiler: gcc-4.4 (Debian 4.4.7-8) 4.4.7
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64
All warnings (new ones prefixed by >>):
net//ipv4/tcp_ipv4.c: In function 'tcp_md5_do_lookup':
>> net//ipv4/tcp_ipv4.c:908: warning: unused variable 'size'
vim +/size +908 net//ipv4/tcp_ipv4.c
^1da177e4 Linus Torvalds 2005-04-16 892 }
^1da177e4 Linus Torvalds 2005-04-16 893
cfb6eeb4c YOSHIFUJI Hideaki 2006-11-14 894 #ifdef CONFIG_TCP_MD5SIG
cfb6eeb4c YOSHIFUJI Hideaki 2006-11-14 895 /*
cfb6eeb4c YOSHIFUJI Hideaki 2006-11-14 896 * RFC2385 MD5 checksumming requires a mapping of
cfb6eeb4c YOSHIFUJI Hideaki 2006-11-14 897 * IP address->MD5 Key.
cfb6eeb4c YOSHIFUJI Hideaki 2006-11-14 898 * We need to maintain these in the sk structure.
cfb6eeb4c YOSHIFUJI Hideaki 2006-11-14 899 */
cfb6eeb4c YOSHIFUJI Hideaki 2006-11-14 900
cfb6eeb4c YOSHIFUJI Hideaki 2006-11-14 901 /* Find the Key structure for an address. */
b83e3deb9 Eric Dumazet 2015-09-25 902 struct tcp_md5sig_key *tcp_md5_do_lookup(const struct sock *sk,
a915da9b6 Eric Dumazet 2012-01-31 903 const union tcp_md5_addr *addr,
a915da9b6 Eric Dumazet 2012-01-31 904 int family)
cfb6eeb4c YOSHIFUJI Hideaki 2006-11-14 905 {
fd3a154a0 Eric Dumazet 2015-03-24 906 const struct tcp_sock *tp = tcp_sk(sk);
a915da9b6 Eric Dumazet 2012-01-31 907 struct tcp_md5sig_key *key;
a915da9b6 Eric Dumazet 2012-01-31 @908 unsigned int size = sizeof(struct in_addr);
fd3a154a0 Eric Dumazet 2015-03-24 909 const struct tcp_md5sig_info *md5sig;
4b9e1d2ec Ivan Delalande 2017-06-09 910 __be32 mask;
4b9e1d2ec Ivan Delalande 2017-06-09 911 struct tcp_md5sig_key *best_match = NULL;
4b9e1d2ec Ivan Delalande 2017-06-09 912 bool match;
cfb6eeb4c YOSHIFUJI Hideaki 2006-11-14 913
a8afca032 Eric Dumazet 2012-01-31 914 /* caller either holds rcu_read_lock() or socket lock */
a8afca032 Eric Dumazet 2012-01-31 915 md5sig = rcu_dereference_check(tp->md5sig_info,
1e1d04e67 Hannes Frederic Sowa 2016-04-05 916 lockdep_sock_is_held(sk));
:::::: The code at line 908 was first introduced by commit
:::::: a915da9b69273815527ccb3789421cb7027b545b tcp: md5: rcu conversion
:::::: TO: Eric Dumazet <eric.dumazet@gmail.com>
:::::: CC: David S. Miller <davem@davemloft.net>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 29973 bytes --]
^ permalink raw reply
* Alert
From: IT Department @ 2017-06-12 0:25 UTC (permalink / raw)
To: netdev
Recently, we have detect some unusual activity on your account and as a result, all email users are urged to update their email account within 24 hours of receiving this e-mail, please click the link http://beam.to/1469 to confirm that your email account is up to date with the institution requirement.
---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
^ permalink raw reply
* Re: [PATCH v2] arm: eBPF JIT compiler
From: Kees Cook @ 2017-06-12 2:00 UTC (permalink / raw)
To: Shubham Bansal
Cc: Network Development, Daniel Borkmann, David S. Miller,
Alexei Starovoitov, Russell King,
linux-arm-kernel@lists.infradead.org, LKML, Andrew Lunn
In-Reply-To: <CAHgaXdJ=-n8J8ot_5YQC=YMZrwTBvdNTp5Ta_J_J9vNGWQ4DCQ@mail.gmail.com>
On Tue, Jun 6, 2017 at 12:47 PM, Shubham Bansal
<illusionist.neo@gmail.com> wrote:
> Hi Russell, Alexei, David, Daniel, kees,
>
> Any update on this patch moving forward?
Since this has gotten testing by various people and passes the
existing self-tests, I think this can probably go in via the ARM patch
tracker? Russell does that sound okay to you?
-Kees
--
Kees Cook
Pixel Security
^ permalink raw reply
* Re: [PATCH net v3] net: ipmr: Fix some mroute forwarding issues in vrf's
From: David Ahern @ 2017-06-12 2:55 UTC (permalink / raw)
To: David Miller, sharpd
Cc: netdev, Thomas.Winter, nikolay, yotamg, idosch, roopa
In-Reply-To: <20170611.181556.1883936192698112580.davem@davemloft.net>
On 6/11/17 4:15 PM, David Miller wrote:
>
> Applied and queued up for -stable, thank you.
>
The backport will need bcfc7d33110b; that commit should have had the
same Fixes tag -- e58e41596811 ("net: Enable support for VRF with ipv4
multicast")
^ permalink raw reply
* I am waiting for your response to my numerous un-replied emails to you concerning your family inheritance fund ($7.5 million dollars). I seek your assistance and I assured of your capability to champion this business opportunity to remit $7.5 million dollars into your account, if you are interested let me know so that I can send you the details of this transaction. I agreed that 55% of this money will be for you 5% will be set aside for expenses incurred during the business and 40% would be for me. And if you are not willing to handle the transaction don’t border to reply me.
From: Fadi Ayele @ 2017-06-12 3:43 UTC (permalink / raw)
^ permalink raw reply
* [iproute2][PATCH] ip: Remove unneed header
From: Changhyeok Bae @ 2017-06-12 4:33 UTC (permalink / raw)
To: netdev; +Cc: stephen, Changhyeok Bae
Fix redefinition of struct ethhdr with a suitably patched musl libc
that suppresses the kernel if_ether.h.
Signed-off-by: Changhyeok Bae <changhyeok.bae@gmail.com>
---
ip/iplink_bridge.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/ip/iplink_bridge.c b/ip/iplink_bridge.c
index cccdec1..f065b22 100644
--- a/ip/iplink_bridge.c
+++ b/ip/iplink_bridge.c
@@ -13,7 +13,6 @@
#include <stdlib.h>
#include <string.h>
#include <netinet/in.h>
-#include <netinet/ether.h>
#include <linux/if_link.h>
#include <linux/if_bridge.h>
#include <net/if.h>
--
2.7.4
^ permalink raw reply related
* Quick Loans
From: Financial Services Pvt Ltd @ 2017-06-12 4:04 UTC (permalink / raw)
To: Recipients
Apply for a loan at 3% reply to this Email for more Info
^ permalink raw reply
* Re: [PATCH 0/6] Constant Time Memory Comparisons Are Important
From: Emmanuel Grumbach @ 2017-06-12 5:03 UTC (permalink / raw)
To: Emil Lenngren
Cc: Kees Cook, Kalle Valo, Jason A. Donenfeld, LKML,
kernel-hardening-ZwoEplunGu1jrUoiu81ncdBPR1lH4CV8@public.gmane.org,
Anna Schumaker, David Howells, David Safford, David S. Miller,
Gilad Ben-Yossef, Greg Kroah-Hartman, Gustavo Padovan,
J. Bruce Fields, Jeff Layton, Johan Hedberg, Johannes Berg,
Marcel Holtmann, Mimi Zohar
In-Reply-To: <CAO1O6see6yDr-hDVNPi9Kv9wO6p-98w7YhsnnwnVOVCSEGVksw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
On Mon, Jun 12, 2017 at 12:30 AM, Emil Lenngren <emil.lenngren-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> 2017-06-11 22:48 GMT+02:00 Emmanuel Grumbach <egrumbach-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:
>> On Sun, Jun 11, 2017 at 4:36 PM, Kees Cook <keescook-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org> wrote:
>>>
>>> On Sun, Jun 11, 2017 at 1:13 AM, Kalle Valo <kvalo-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org> wrote:
>>> > "Jason A. Donenfeld" <Jason-OnJsPKxuuEcAvxtiuMwx3w@public.gmane.org> writes:
>>> >
>>> >> Whenever you're comparing two MACs, it's important to do this using
>>> >> crypto_memneq instead of memcmp. With memcmp, you leak timing information,
>>> >> which could then be used to iteratively forge a MAC.
>>> >
>>> > Do you have any pointers where I could learn more about this?
>>>
>>> While not using C specifically, this talks about the problem generally:
>>> https://www.chosenplaintext.ca/articles/beginners-guide-constant-time-cryptography.html
>>>
>>
>> Sorry for the stupid question, but the MAC address is in plaintext in
>> the air anyway or easily accessible via user space tools. I fail to
>> see what it is so secret about a MAC address in that code where that
>> same MAC address is accessible via myriads of ways.
>
> I think you're mixing up Media Access Control (MAC) addresses with
> Message Authentication Code (MAC). The second one is a cryptographic
> signature of a message.
Obviously... Sorry for the noise.
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* WARNING in dev_watchdog
From: Dison River @ 2017-06-12 6:37 UTC (permalink / raw)
To: netdev, linux-kernel, security
Hi:
I've got the following error report while fuzzing the kernel with
syzkaller on linux-4.11.0-rc3.
log:
WARNING: CPU: 2 PID: 0 at net/sched/sch_generic.c:316
dev_watchdog+0x648/0x770 net/sched/sch_generic.c:315
NETDEV WATCHDOG: eth0 (e1000): transmit queue 0 timed out
Kernel panic - not syncing: panic_on_warn set ...
CPU: 2 PID: 0 Comm: swapper/2 Not tainted 4.11.0-rc3 #2
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
Ubuntu-1.8.2-1ubuntu1 04/01/2014
Call Trace:
<IRQ>
__dump_stack lib/dump_stack.c:16 [inline]
dump_stack+0x95/0xe8 lib/dump_stack.c:52
panic+0x1ae/0x386 kernel/panic.c:180
__warn+0x1c4/0x1e0 kernel/panic.c:541
warn_slowpath_fmt+0xac/0xd0 kernel/panic.c:564
dev_watchdog+0x648/0x770 net/sched/sch_generic.c:315
call_timer_fn+0x15b/0x5e0 kernel/time/timer.c:1268
expire_timers kernel/time/timer.c:1307 [inline]
__run_timers kernel/time/timer.c:1601 [inline]
run_timer_softirq+0x5c7/0x1140 kernel/time/timer.c:1614
__do_softirq+0x217/0x8b7 kernel/softirq.c:284
invoke_softirq kernel/softirq.c:364 [inline]
irq_exit+0x198/0x1d0 kernel/softirq.c:405
exiting_irq arch/x86/include/asm/apic.h:657 [inline]
smp_apic_timer_interrupt+0x76/0xa0 arch/x86/kernel/apic/apic.c:962
apic_timer_interrupt+0x90/0xa0 arch/x86/entry/entry_64.S:707
RIP: 0010:native_safe_halt arch/x86/include/asm/irqflags.h:53 [inline]
RIP: 0010:arch_safe_halt arch/x86/include/asm/irqflags.h:95 [inline]
RIP: 0010:default_idle+0x1f/0x2d0 arch/x86/kernel/process.c:275
RSP: 0018:ffff88006dee7e78 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff10
RAX: 0000000000000007 RBX: ffff88006de9db40 RCX: 0000000000000000
RDX: 0000000000000000 RSI: 0000000000000001 RDI: ffff88006de9e314
RBP: ffff88006dee7e98 R08: 0000000000000040 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: ffffffff83efc9b8
R13: ffff88006de9db40 R14: 0000000000000002 R15: ffff88006de9db40
</IRQ>
arch_cpu_idle+0xa/0x10 arch/x86/kernel/process.c:266
default_idle_call+0x36/0x50 kernel/sched/idle.c:97
cpuidle_idle_call kernel/sched/idle.c:155 [inline]
do_idle+0x20b/0x2d0 kernel/sched/idle.c:244
cpu_startup_entry+0x18/0x20 kernel/sched/idle.c:346
start_secondary+0x245/0x2d0 arch/x86/kernel/smpboot.c:275
start_cpu+0x14/0x14 arch/x86/kernel/head_64.S:306
Dumping ftrace buffer:
(ftrace buffer empty)
Kernel Offset: disabled
Rebooting in 86400 seconds..
report :
syzkaller login: [ 37.041894] ------------[ cut here ]------------
[ 37.042430] WARNING: CPU: 2 PID: 0 at net/sched/sch_generic.c:316
dev_watchdog+0x648/0x770
[ 37.042978] NETDEV WATCHDOG: eth0 (e1000): transmit queue 0 timed out
[ 37.043405] Kernel panic - not syncing: panic_on_warn set ...
[ 37.043405]
[ 37.043888] CPU: 2 PID: 0 Comm: swapper/2 Not tainted 4.11.0-rc3 #2
[ 37.044297] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996),
BIOS Ubuntu-1.8.2-1ubuntu1 04/01/2014
[ 37.044909] Call Trace:
[ 37.045080] <IRQ>
[ 37.045226] dump_stack+0x95/0xe8
[ 37.045453] ? dev_watchdog+0x648/0x770
[ 37.045712] panic+0x1ae/0x386
[ 37.045924] ? percpu_up_read_preempt_enable.constprop.53+0xae/0xae
[ 37.046342] ? dev_watchdog+0x648/0x770
[ 37.046605] ? vprintk_default+0x28/0x30
[ 37.046873] ? dev_watchdog+0x648/0x770
[ 37.047114] __warn+0x1c4/0x1e0
[ 37.047820] warn_slowpath_fmt+0xac/0xd0
[ 37.048467] ? __warn+0x1e0/0x1e0
[ 37.048698] ? dev_watchdog+0x125/0x770
[ 37.048963] dev_watchdog+0x648/0x770
[ 37.049218] call_timer_fn+0x15b/0x5e0
[ 37.049475] ? call_timer_fn+0xcc/0x5e0
[ 37.049739] ? qdisc_rcu_free+0x110/0x110
[ 37.050014] ? process_timeout+0x20/0x20
[ 37.050285] ? trace_hardirqs_on_caller+0x19e/0x580
[ 37.053699] ? qdisc_rcu_free+0x110/0x110
[ 37.054931] ? qdisc_rcu_free+0x110/0x110
[ 37.055296] run_timer_softirq+0x5c7/0x1140
[ 37.055949] ? msleep_interruptible+0x170/0x170
[ 37.056671] ? lapic_timer_shutdown+0x3d/0x50
[ 37.057268] ? clockevents_switch_state+0xe3/0x320
[ 37.057837] __do_softirq+0x217/0x8b7
[ 37.058097] irq_exit+0x198/0x1d0
[ 37.058326] smp_apic_timer_interrupt+0x76/0xa0
[ 37.058634] apic_timer_interrupt+0x90/0xa0
[ 37.058921] RIP: 0010:default_idle+0x1f/0x2d0
[ 37.059217] RSP: 0018:ffff88006dee7e78 EFLAGS: 00000246 ORIG_RAX:
ffffffffffffff10
[ 37.059702] RAX: 0000000000000007 RBX: ffff88006de9db40 RCX: 0000000000000000
[ 37.060179] RDX: 0000000000000000 RSI: 0000000000000001 RDI: ffff88006de9e314
[ 37.065968] RBP: ffff88006dee7e98 R08: 0000000000000040 R09: 0000000000000000
[ 37.066451] R10: 0000000000000000 R11: 0000000000000000 R12: ffffffff83efc9b8
[ 37.073921] R13: ffff88006de9db40 R14: 0000000000000002 R15: ffff88006de9db40
[ 37.074405] </IRQ>
[ 37.074767] ? default_idle+0x1d/0x2d0
[ 37.075026] arch_cpu_idle+0xa/0x10
[ 37.075266] default_idle_call+0x36/0x50
[ 37.075534] do_idle+0x20b/0x2d0
[ 37.075815] cpu_startup_entry+0x18/0x20
[ 37.076084] start_secondary+0x245/0x2d0
[ 37.076352] start_cpu+0x14/0x14
[ 37.077025] Dumping ftrace buffer:
[ 37.077308] (ftrace buffer empty)
[ 37.077555] Kernel Offset: disabled
[ 37.078786] Rebooting in 86400 seconds..
^ permalink raw reply
* Re: WARNING in dev_watchdog
From: Greg KH @ 2017-06-12 6:42 UTC (permalink / raw)
To: Dison River; +Cc: netdev, linux-kernel, security
In-Reply-To: <CAJsXRPGWqm-DN2+VsEjCAOZV-C2GqkzmjPjJgRoGTUABJSFnow@mail.gmail.com>
On Mon, Jun 12, 2017 at 02:37:22PM +0800, Dison River wrote:
> Hi:
> I've got the following error report while fuzzing the kernel with
> syzkaller on linux-4.11.0-rc3.
>
> log:
> WARNING: CPU: 2 PID: 0 at net/sched/sch_generic.c:316
> dev_watchdog+0x648/0x770 net/sched/sch_generic.c:315
> NETDEV WATCHDOG: eth0 (e1000): transmit queue 0 timed out
> Kernel panic - not syncing: panic_on_warn set ...
>
> CPU: 2 PID: 0 Comm: swapper/2 Not tainted 4.11.0-rc3 #2
> Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
> Ubuntu-1.8.2-1ubuntu1 04/01/2014
> Call Trace:
> <IRQ>
> __dump_stack lib/dump_stack.c:16 [inline]
> dump_stack+0x95/0xe8 lib/dump_stack.c:52
> panic+0x1ae/0x386 kernel/panic.c:180
> __warn+0x1c4/0x1e0 kernel/panic.c:541
> warn_slowpath_fmt+0xac/0xd0 kernel/panic.c:564
> dev_watchdog+0x648/0x770 net/sched/sch_generic.c:315
> call_timer_fn+0x15b/0x5e0 kernel/time/timer.c:1268
> expire_timers kernel/time/timer.c:1307 [inline]
> __run_timers kernel/time/timer.c:1601 [inline]
> run_timer_softirq+0x5c7/0x1140 kernel/time/timer.c:1614
> __do_softirq+0x217/0x8b7 kernel/softirq.c:284
> invoke_softirq kernel/softirq.c:364 [inline]
> irq_exit+0x198/0x1d0 kernel/softirq.c:405
> exiting_irq arch/x86/include/asm/apic.h:657 [inline]
> smp_apic_timer_interrupt+0x76/0xa0 arch/x86/kernel/apic/apic.c:962
> apic_timer_interrupt+0x90/0xa0 arch/x86/entry/entry_64.S:707
> RIP: 0010:native_safe_halt arch/x86/include/asm/irqflags.h:53 [inline]
> RIP: 0010:arch_safe_halt arch/x86/include/asm/irqflags.h:95 [inline]
> RIP: 0010:default_idle+0x1f/0x2d0 arch/x86/kernel/process.c:275
> RSP: 0018:ffff88006dee7e78 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff10
> RAX: 0000000000000007 RBX: ffff88006de9db40 RCX: 0000000000000000
> RDX: 0000000000000000 RSI: 0000000000000001 RDI: ffff88006de9e314
> RBP: ffff88006dee7e98 R08: 0000000000000040 R09: 0000000000000000
> R10: 0000000000000000 R11: 0000000000000000 R12: ffffffff83efc9b8
> R13: ffff88006de9db40 R14: 0000000000000002 R15: ffff88006de9db40
> </IRQ>
> arch_cpu_idle+0xa/0x10 arch/x86/kernel/process.c:266
> default_idle_call+0x36/0x50 kernel/sched/idle.c:97
> cpuidle_idle_call kernel/sched/idle.c:155 [inline]
> do_idle+0x20b/0x2d0 kernel/sched/idle.c:244
> cpu_startup_entry+0x18/0x20 kernel/sched/idle.c:346
> start_secondary+0x245/0x2d0 arch/x86/kernel/smpboot.c:275
> start_cpu+0x14/0x14 arch/x86/kernel/head_64.S:306
> Dumping ftrace buffer:
> (ftrace buffer empty)
> Kernel Offset: disabled
> Rebooting in 86400 seconds..
>
>
> report :
>
>
> syzkaller login: [ 37.041894] ------------[ cut here ]------------
> [ 37.042430] WARNING: CPU: 2 PID: 0 at net/sched/sch_generic.c:316
> dev_watchdog+0x648/0x770
> [ 37.042978] NETDEV WATCHDOG: eth0 (e1000): transmit queue 0 timed out
> [ 37.043405] Kernel panic - not syncing: panic_on_warn set ...
> [ 37.043405]
> [ 37.043888] CPU: 2 PID: 0 Comm: swapper/2 Not tainted 4.11.0-rc3 #2
> [ 37.044297] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996),
> BIOS Ubuntu-1.8.2-1ubuntu1 04/01/2014
> [ 37.044909] Call Trace:
> [ 37.045080] <IRQ>
> [ 37.045226] dump_stack+0x95/0xe8
> [ 37.045453] ? dev_watchdog+0x648/0x770
> [ 37.045712] panic+0x1ae/0x386
> [ 37.045924] ? percpu_up_read_preempt_enable.constprop.53+0xae/0xae
> [ 37.046342] ? dev_watchdog+0x648/0x770
> [ 37.046605] ? vprintk_default+0x28/0x30
> [ 37.046873] ? dev_watchdog+0x648/0x770
> [ 37.047114] __warn+0x1c4/0x1e0
> [ 37.047820] warn_slowpath_fmt+0xac/0xd0
> [ 37.048467] ? __warn+0x1e0/0x1e0
> [ 37.048698] ? dev_watchdog+0x125/0x770
> [ 37.048963] dev_watchdog+0x648/0x770
> [ 37.049218] call_timer_fn+0x15b/0x5e0
> [ 37.049475] ? call_timer_fn+0xcc/0x5e0
> [ 37.049739] ? qdisc_rcu_free+0x110/0x110
> [ 37.050014] ? process_timeout+0x20/0x20
> [ 37.050285] ? trace_hardirqs_on_caller+0x19e/0x580
> [ 37.053699] ? qdisc_rcu_free+0x110/0x110
> [ 37.054931] ? qdisc_rcu_free+0x110/0x110
> [ 37.055296] run_timer_softirq+0x5c7/0x1140
> [ 37.055949] ? msleep_interruptible+0x170/0x170
> [ 37.056671] ? lapic_timer_shutdown+0x3d/0x50
> [ 37.057268] ? clockevents_switch_state+0xe3/0x320
> [ 37.057837] __do_softirq+0x217/0x8b7
> [ 37.058097] irq_exit+0x198/0x1d0
> [ 37.058326] smp_apic_timer_interrupt+0x76/0xa0
> [ 37.058634] apic_timer_interrupt+0x90/0xa0
> [ 37.058921] RIP: 0010:default_idle+0x1f/0x2d0
> [ 37.059217] RSP: 0018:ffff88006dee7e78 EFLAGS: 00000246 ORIG_RAX:
> ffffffffffffff10
> [ 37.059702] RAX: 0000000000000007 RBX: ffff88006de9db40 RCX: 0000000000000000
> [ 37.060179] RDX: 0000000000000000 RSI: 0000000000000001 RDI: ffff88006de9e314
> [ 37.065968] RBP: ffff88006dee7e98 R08: 0000000000000040 R09: 0000000000000000
> [ 37.066451] R10: 0000000000000000 R11: 0000000000000000 R12: ffffffff83efc9b8
> [ 37.073921] R13: ffff88006de9db40 R14: 0000000000000002 R15: ffff88006de9db40
> [ 37.074405] </IRQ>
> [ 37.074767] ? default_idle+0x1d/0x2d0
> [ 37.075026] arch_cpu_idle+0xa/0x10
> [ 37.075266] default_idle_call+0x36/0x50
> [ 37.075534] do_idle+0x20b/0x2d0
> [ 37.075815] cpu_startup_entry+0x18/0x20
> [ 37.076084] start_secondary+0x245/0x2d0
> [ 37.076352] start_cpu+0x14/0x14
> [ 37.077025] Dumping ftrace buffer:
> [ 37.077308] (ftrace buffer empty)
> [ 37.077555] Kernel Offset: disabled
> [ 37.078786] Rebooting in 86400 seconds..
Any hints as to exactly what you were doing at the time, and a
reproducer so we could try to test this?
thanks,
greg k-h
^ permalink raw reply
* Re: [PATCH v3 3/3] net/cxgb4: Use new PCI_DEV_FLAGS_NO_RELAXED_ORDERING flag
From: Ding Tianhong @ 2017-06-12 6:53 UTC (permalink / raw)
To: Alexander Duyck
Cc: Mark Rutland, Gabriele Paoloni, Asit K Mallick, Catalin Marinas,
Will Deacon, Ashok Raj, Bjorn Helgaas, Jeff Kirsher,
linux-pci@vger.kernel.org, Ganesh Goudar, Bob Shaw, Casey Leedom,
Patrick J Cramer, Michael Werner, linux-arm-kernel, Amir Ancel,
Netdev, linux-kernel@vger.kernel.org, David Laight,
Suravee Suthikulpanit, Robin Murphy, David Miller <davem@
In-Reply-To: <CAKgT0UeN7BK94wgU=LiD9CAo0ihrFgv2bZLFrTtr_+bgSbswxQ@mail.gmail.com>
On 2017/6/8 7:24, Alexander Duyck wrote:
> On Wed, Jun 7, 2017 at 2:16 AM, Ding Tianhong <dingtianhong@huawei.com> wrote:
>> From: Casey Leedom <leedom@chelsio.com>
>>
>> cxgb4 Ethernet driver now queries Root Complex Port to determine if it can
>> send TLPs to it with the Relaxed Ordering Attribute set.
>>
>> Signed-off-by: Casey Leedom <leedom@chelsio.com>
>> Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
>
> So I am pretty sure this patch doesn't work with patch 2. We need to
> update it so that it doesn't check the root complex but instead checks
> itself to see if it is allowed to use relaxed ordering.
>
Right, we should check the End Point PCIe device configuration space, not RC.
> What we need here is the ability to detect if relaxed ordering is
> disabled, and if so take the steps needed to enable peer to peer
> relaxed ordering without enabling relaxed ordering to the root
> complex. Do I have that right Casey?
>
I am not very clear to this driver about how to enable peer to peer
relaxed ordering without enabling relaxed ordering to the RC, need
some help from Casey, so I will still focus on this patch and only
fix the peer to RC relaxed ordering problem, I hope Casey could send
another patch to fix it later.
Thanks
Ding
>> ---
>> drivers/net/ethernet/chelsio/cxgb4/cxgb4.h | 1 +
>> drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 17 +++++++++++++++++
>> drivers/net/ethernet/chelsio/cxgb4/sge.c | 5 +++--
>> 3 files changed, 21 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h b/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h
>> index e88c180..478f25a 100644
>> --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h
>> +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h
>> @@ -521,6 +521,7 @@ enum { /* adapter flags */
>> USING_SOFT_PARAMS = (1 << 6),
>> MASTER_PF = (1 << 7),
>> FW_OFLD_CONN = (1 << 9),
>> + ROOT_NO_RELAXED_ORDERING = (1 << 10),
>> };
>>
>> enum {
>> diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
>> index 38a5c67..fbfe341 100644
>> --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
>> +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
>> @@ -4628,6 +4628,7 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
>> #ifdef CONFIG_PCI_IOV
>> u32 v, port_vec;
>> #endif
>> + struct pci_dev *root;
>>
>> printk_once(KERN_INFO "%s - version %s\n", DRV_DESC, DRV_VERSION);
>>
>> @@ -4726,6 +4727,22 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
>> adapter->msg_enable = DFLT_MSG_ENABLE;
>> memset(adapter->chan_map, 0xff, sizeof(adapter->chan_map));
>>
>> + /* If possible, we use PCIe Relaxed Ordering Attribute to deliver
>> + * Ingress Packet Data to Free List Buffers in order to allow for
>> + * chipset performance optimizations between the Root Complex and
>> + * Memory Controllers. (Messages to the associated Ingress Queue
>> + * notifying new Packet Placement in the Free Lists Buffers will be
>> + * send without the Relaxed Ordering Attribute thus guaranteing that
>> + * all preceding PCIe Transaction Layer Packets will be processed
>> + * first.) But some Root Complexes have various issues with Upstream
>> + * Transaction Layer Packets with the Relaxed Ordering Attribute set.
>> + * So we check our Root Complex to see if it's flaged with advice
>> + * against using Relaxed Ordering.
>> + */
>> + root = pci_find_pcie_root_port(adapter->pdev);
>> + if (pcie_get_relaxed_ordering(root))
>> + adapter->flags |= ROOT_NO_RELAXED_ORDERING;
>> +
>> spin_lock_init(&adapter->stats_lock);
>> spin_lock_init(&adapter->tid_release_lock);
>> spin_lock_init(&adapter->win0_lock);
>> diff --git a/drivers/net/ethernet/chelsio/cxgb4/sge.c b/drivers/net/ethernet/chelsio/cxgb4/sge.c
>> index f05f0d4..ac229a3 100644
>> --- a/drivers/net/ethernet/chelsio/cxgb4/sge.c
>> +++ b/drivers/net/ethernet/chelsio/cxgb4/sge.c
>> @@ -2571,6 +2571,7 @@ int t4_sge_alloc_rxq(struct adapter *adap, struct sge_rspq *iq, bool fwevtq,
>> struct fw_iq_cmd c;
>> struct sge *s = &adap->sge;
>> struct port_info *pi = netdev_priv(dev);
>> + int relaxed = !(adap->flags & ROOT_NO_RELAXED_ORDERING);
>>
>> /* Size needs to be multiple of 16, including status entry. */
>> iq->size = roundup(iq->size, 16);
>> @@ -2624,8 +2625,8 @@ int t4_sge_alloc_rxq(struct adapter *adap, struct sge_rspq *iq, bool fwevtq,
>>
>> flsz = fl->size / 8 + s->stat_len / sizeof(struct tx_desc);
>> c.iqns_to_fl0congen |= htonl(FW_IQ_CMD_FL0PACKEN_F |
>> - FW_IQ_CMD_FL0FETCHRO_F |
>> - FW_IQ_CMD_FL0DATARO_F |
>> + FW_IQ_CMD_FL0FETCHRO_V(relaxed) |
>> + FW_IQ_CMD_FL0DATARO_V(relaxed) |
>> FW_IQ_CMD_FL0PADEN_F);
>> if (cong >= 0)
>> c.iqns_to_fl0congen |=
>> --
>> 1.9.0
>>
>>
>
> .
>
^ permalink raw reply
* Re: [PATCH 0/6] Constant Time Memory Comparisons Are Important
From: Arend van Spriel @ 2017-06-12 7:33 UTC (permalink / raw)
To: Emil Lenngren, Emmanuel Grumbach
Cc: Kees Cook, Kalle Valo, Jason A. Donenfeld, LKML,
kernel-hardening-ZwoEplunGu1jrUoiu81ncdBPR1lH4CV8@public.gmane.org,
Anna Schumaker, David Howells, David Safford, David S. Miller,
Gilad Ben-Yossef, Greg Kroah-Hartman, Gustavo Padovan,
J. Bruce Fields, Jeff Layton, Johan Hedberg, Johannes Berg,
Marcel Holtmann, Mimi Zohar
In-Reply-To: <CAO1O6see6yDr-hDVNPi9Kv9wO6p-98w7YhsnnwnVOVCSEGVksw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
On 6/11/2017 11:30 PM, Emil Lenngren wrote:
> 2017-06-11 22:48 GMT+02:00 Emmanuel Grumbach <egrumbach-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:
>> On Sun, Jun 11, 2017 at 4:36 PM, Kees Cook <keescook-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org> wrote:
>>>
>>> On Sun, Jun 11, 2017 at 1:13 AM, Kalle Valo <kvalo-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org> wrote:
>>>> "Jason A. Donenfeld" <Jason-OnJsPKxuuEcAvxtiuMwx3w@public.gmane.org> writes:
>>>>
>>>>> Whenever you're comparing two MACs, it's important to do this using
>>>>> crypto_memneq instead of memcmp. With memcmp, you leak timing information,
>>>>> which could then be used to iteratively forge a MAC.
>>>>
>>>> Do you have any pointers where I could learn more about this?
>>>
>>> While not using C specifically, this talks about the problem generally:
>>> https://www.chosenplaintext.ca/articles/beginners-guide-constant-time-cryptography.html
>>>
>>
>> Sorry for the stupid question, but the MAC address is in plaintext in
>> the air anyway or easily accessible via user space tools. I fail to
>> see what it is so secret about a MAC address in that code where that
>> same MAC address is accessible via myriads of ways.
>
> I think you're mixing up Media Access Control (MAC) addresses with
> Message Authentication Code (MAC). The second one is a cryptographic
> signature of a message.
While this may be obvious to those who are in the know this mixup is
easily made outside the crypto domain and especially in the (wireless)
networking domain (my mind wandered towards the same error path). As
this series is touching stuff outside crypto it is good to be explicit
and not use such abbreviations that can be misinterpreted. The article
Kees referred to is also useful to get into the proper context here and
at least worth mentioning this or other useful references in the cover
letter.
Regards,
Arend
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* [PATCH v1] net/phy: Make phy_ethtool_ksettings_get return void
From: Yuval Shaia @ 2017-06-12 7:42 UTC (permalink / raw)
To: michael.chan, f.fainelli, siva.kallam, prashant, madalin.bucur,
leoli, sebastian.hesselbarth, sergei.shtylyov, grygorii.strashko,
w-kwok2, m-karicheri2, andrew, woojung.huh, UNGLinuxDriver,
vivien.didelot, davem, arnd, tremyfr, jarod, yuval.shaia,
horms+renesas, kazuya.mizuguchi.ks, dan.carpenter,
niklas.soderlund+renesas, johan, masaru.nagai.vx, geert+renesas,
laurent.pinchart, chris.brandt, ivan.khoronzhuk, mugunthanvnm,
netdev, linux-arm-kernel, linuxppc-dev
Make return value void since function never return meaningfull value
Signed-off-by: Yuval Shaia <yuval.shaia@oracle.com>
Acked-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
---
Re-sending since last time forgot to add netdev-list
v0 ->v1:
* These files were missing in v0
* drivers/net/ethernet/renesas/ravb_main.c
* drivers/net/ethernet/renesas/sh_eth.c
* drivers/net/ethernet/ti/netcp_ethss.c
* Add Acked-by: Sergei Shtylyov
---
drivers/net/ethernet/broadcom/b44.c | 3 ++-
drivers/net/ethernet/broadcom/bcm63xx_enet.c | 3 ++-
drivers/net/ethernet/broadcom/genet/bcmgenet.c | 4 +++-
drivers/net/ethernet/broadcom/tg3.c | 4 +++-
drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c | 6 ++----
drivers/net/ethernet/freescale/ucc_geth_ethtool.c | 4 +++-
drivers/net/ethernet/marvell/mv643xx_eth.c | 5 ++---
drivers/net/ethernet/renesas/ravb_main.c | 14 +++++++-------
drivers/net/ethernet/renesas/sh_eth.c | 5 ++---
drivers/net/ethernet/ti/cpsw.c | 9 +++++----
drivers/net/ethernet/ti/netcp_ethss.c | 8 +++-----
drivers/net/phy/phy.c | 10 +++++-----
drivers/net/usb/lan78xx.c | 2 +-
include/linux/phy.h | 4 ++--
net/dsa/slave.c | 9 +++++----
15 files changed, 47 insertions(+), 43 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/b44.c b/drivers/net/ethernet/broadcom/b44.c
index 5b95bb4..9873d2d 100644
--- a/drivers/net/ethernet/broadcom/b44.c
+++ b/drivers/net/ethernet/broadcom/b44.c
@@ -1836,7 +1836,8 @@ static int b44_get_link_ksettings(struct net_device *dev,
if (bp->flags & B44_FLAG_EXTERNAL_PHY) {
BUG_ON(!dev->phydev);
- return phy_ethtool_ksettings_get(dev->phydev, cmd);
+ phy_ethtool_ksettings_get(dev->phydev, cmd);
+ return 0;
}
supported = (SUPPORTED_Autoneg);
diff --git a/drivers/net/ethernet/broadcom/bcm63xx_enet.c b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
index 50d88d3..34ebb40 100644
--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
+++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
@@ -1453,7 +1453,8 @@ static int bcm_enet_get_link_ksettings(struct net_device *dev,
if (priv->has_phy) {
if (!dev->phydev)
return -ENODEV;
- return phy_ethtool_ksettings_get(dev->phydev, cmd);
+ phy_ethtool_ksettings_get(dev->phydev, cmd);
+ return 0;
} else {
cmd->base.autoneg = 0;
cmd->base.speed = (priv->force_speed_100) ?
diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
index a205a9f..daca1c9 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
@@ -477,7 +477,9 @@ static int bcmgenet_get_link_ksettings(struct net_device *dev,
if (!priv->phydev)
return -ENODEV;
- return phy_ethtool_ksettings_get(priv->phydev, cmd);
+ phy_ethtool_ksettings_get(priv->phydev, cmd);
+
+ return 0;
}
static int bcmgenet_set_link_ksettings(struct net_device *dev,
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index 537d571..d600c41 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -12097,7 +12097,9 @@ static int tg3_get_link_ksettings(struct net_device *dev,
if (!(tp->phy_flags & TG3_PHYFLG_IS_CONNECTED))
return -EAGAIN;
phydev = mdiobus_get_phy(tp->mdio_bus, tp->phy_addr);
- return phy_ethtool_ksettings_get(phydev, cmd);
+ phy_ethtool_ksettings_get(phydev, cmd);
+
+ return 0;
}
supported = (SUPPORTED_Autoneg);
diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c b/drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c
index 15571e2..aad825088 100644
--- a/drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c
+++ b/drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c
@@ -75,16 +75,14 @@ static char dpaa_stats_global[][ETH_GSTRING_LEN] = {
static int dpaa_get_link_ksettings(struct net_device *net_dev,
struct ethtool_link_ksettings *cmd)
{
- int err;
-
if (!net_dev->phydev) {
netdev_dbg(net_dev, "phy device not initialized\n");
return 0;
}
- err = phy_ethtool_ksettings_get(net_dev->phydev, cmd);
+ phy_ethtool_ksettings_get(net_dev->phydev, cmd);
- return err;
+ return 0;
}
static int dpaa_set_link_ksettings(struct net_device *net_dev,
diff --git a/drivers/net/ethernet/freescale/ucc_geth_ethtool.c b/drivers/net/ethernet/freescale/ucc_geth_ethtool.c
index b642990..4df282e 100644
--- a/drivers/net/ethernet/freescale/ucc_geth_ethtool.c
+++ b/drivers/net/ethernet/freescale/ucc_geth_ethtool.c
@@ -113,7 +113,9 @@ uec_get_ksettings(struct net_device *netdev, struct ethtool_link_ksettings *cmd)
if (!phydev)
return -ENODEV;
- return phy_ethtool_ksettings_get(phydev, cmd);
+ phy_ethtool_ksettings_get(phydev, cmd);
+
+ return 0;
}
static int
diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c
index 25642de..5794d98 100644
--- a/drivers/net/ethernet/marvell/mv643xx_eth.c
+++ b/drivers/net/ethernet/marvell/mv643xx_eth.c
@@ -1501,10 +1501,9 @@ mv643xx_eth_get_link_ksettings_phy(struct mv643xx_eth_private *mp,
struct ethtool_link_ksettings *cmd)
{
struct net_device *dev = mp->dev;
- int err;
u32 supported, advertising;
- err = phy_ethtool_ksettings_get(dev->phydev, cmd);
+ phy_ethtool_ksettings_get(dev->phydev, cmd);
/*
* The MAC does not support 1000baseT_Half.
@@ -1520,7 +1519,7 @@ mv643xx_eth_get_link_ksettings_phy(struct mv643xx_eth_private *mp,
ethtool_convert_legacy_u32_to_link_mode(cmd->link_modes.advertising,
advertising);
- return err;
+ return 0;
}
static int
diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c
index 3cd7989..9b8e210 100644
--- a/drivers/net/ethernet/renesas/ravb_main.c
+++ b/drivers/net/ethernet/renesas/ravb_main.c
@@ -1076,16 +1076,16 @@ static int ravb_get_link_ksettings(struct net_device *ndev,
struct ethtool_link_ksettings *cmd)
{
struct ravb_private *priv = netdev_priv(ndev);
- int error = -ENODEV;
unsigned long flags;
- if (ndev->phydev) {
- spin_lock_irqsave(&priv->lock, flags);
- error = phy_ethtool_ksettings_get(ndev->phydev, cmd);
- spin_unlock_irqrestore(&priv->lock, flags);
- }
+ if (!ndev->phydev)
+ return -ENODEV;
- return error;
+ spin_lock_irqsave(&priv->lock, flags);
+ phy_ethtool_ksettings_get(ndev->phydev, cmd);
+ spin_unlock_irqrestore(&priv->lock, flags);
+
+ return 0;
}
static int ravb_set_link_ksettings(struct net_device *ndev,
diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
index 2d686cc..b2f0cea 100644
--- a/drivers/net/ethernet/renesas/sh_eth.c
+++ b/drivers/net/ethernet/renesas/sh_eth.c
@@ -1915,16 +1915,15 @@ static int sh_eth_get_link_ksettings(struct net_device *ndev,
{
struct sh_eth_private *mdp = netdev_priv(ndev);
unsigned long flags;
- int ret;
if (!ndev->phydev)
return -ENODEV;
spin_lock_irqsave(&mdp->lock, flags);
- ret = phy_ethtool_ksettings_get(ndev->phydev, cmd);
+ phy_ethtool_ksettings_get(ndev->phydev, cmd);
spin_unlock_irqrestore(&mdp->lock, flags);
- return ret;
+ return 0;
}
static int sh_eth_set_link_ksettings(struct net_device *ndev,
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index f4d7aec..03707ee 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -2165,11 +2165,12 @@ static int cpsw_get_link_ksettings(struct net_device *ndev,
struct cpsw_common *cpsw = priv->cpsw;
int slave_no = cpsw_slave_index(cpsw, priv);
- if (cpsw->slaves[slave_no].phy)
- return phy_ethtool_ksettings_get(cpsw->slaves[slave_no].phy,
- ecmd);
- else
+ if (cpsw->slaves[slave_no].phy) {
+ phy_ethtool_ksettings_get(cpsw->slaves[slave_no].phy, ecmd);
+ return 0;
+ } else {
return -EOPNOTSUPP;
+ }
}
static int cpsw_set_link_ksettings(struct net_device *ndev,
diff --git a/drivers/net/ethernet/ti/netcp_ethss.c b/drivers/net/ethernet/ti/netcp_ethss.c
index dd92950..0847a8f 100644
--- a/drivers/net/ethernet/ti/netcp_ethss.c
+++ b/drivers/net/ethernet/ti/netcp_ethss.c
@@ -1927,7 +1927,6 @@ static int keystone_get_link_ksettings(struct net_device *ndev,
struct netcp_intf *netcp = netdev_priv(ndev);
struct phy_device *phy = ndev->phydev;
struct gbe_intf *gbe_intf;
- int ret;
if (!phy)
return -EINVAL;
@@ -1939,11 +1938,10 @@ static int keystone_get_link_ksettings(struct net_device *ndev,
if (!gbe_intf->slave)
return -EINVAL;
- ret = phy_ethtool_ksettings_get(phy, cmd);
- if (!ret)
- cmd->base.port = gbe_intf->slave->phy_port_t;
+ phy_ethtool_ksettings_get(phy, cmd);
+ cmd->base.port = gbe_intf->slave->phy_port_t;
- return ret;
+ return 0;
}
static int keystone_set_link_ksettings(struct net_device *ndev,
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index 82ab8fb..9c372bf 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -508,8 +508,8 @@ int phy_ethtool_gset(struct phy_device *phydev, struct ethtool_cmd *cmd)
}
EXPORT_SYMBOL(phy_ethtool_gset);
-int phy_ethtool_ksettings_get(struct phy_device *phydev,
- struct ethtool_link_ksettings *cmd)
+void phy_ethtool_ksettings_get(struct phy_device *phydev,
+ struct ethtool_link_ksettings *cmd)
{
ethtool_convert_legacy_u32_to_link_mode(cmd->link_modes.supported,
phydev->supported);
@@ -531,8 +531,6 @@ int phy_ethtool_ksettings_get(struct phy_device *phydev,
cmd->base.autoneg = phydev->autoneg;
cmd->base.eth_tp_mdix_ctrl = phydev->mdix_ctrl;
cmd->base.eth_tp_mdix = phydev->mdix;
-
- return 0;
}
EXPORT_SYMBOL(phy_ethtool_ksettings_get);
@@ -1448,7 +1446,9 @@ int phy_ethtool_get_link_ksettings(struct net_device *ndev,
if (!phydev)
return -ENODEV;
- return phy_ethtool_ksettings_get(phydev, cmd);
+ phy_ethtool_ksettings_get(phydev, cmd);
+
+ return 0;
}
EXPORT_SYMBOL(phy_ethtool_get_link_ksettings);
diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c
index 9eff97a..5833f7e 100644
--- a/drivers/net/usb/lan78xx.c
+++ b/drivers/net/usb/lan78xx.c
@@ -1490,7 +1490,7 @@ static int lan78xx_get_link_ksettings(struct net_device *net,
if (ret < 0)
return ret;
- ret = phy_ethtool_ksettings_get(phydev, cmd);
+ phy_ethtool_ksettings_get(phydev, cmd);
usb_autopm_put_interface(dev->intf);
diff --git a/include/linux/phy.h b/include/linux/phy.h
index e76e4ad..4ec07a6 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -844,8 +844,8 @@ void phy_stop_machine(struct phy_device *phydev);
void phy_trigger_machine(struct phy_device *phydev, bool sync);
int phy_ethtool_sset(struct phy_device *phydev, struct ethtool_cmd *cmd);
int phy_ethtool_gset(struct phy_device *phydev, struct ethtool_cmd *cmd);
-int phy_ethtool_ksettings_get(struct phy_device *phydev,
- struct ethtool_link_ksettings *cmd);
+void phy_ethtool_ksettings_get(struct phy_device *phydev,
+ struct ethtool_link_ksettings *cmd);
int phy_ethtool_ksettings_set(struct phy_device *phydev,
const struct ethtool_link_ksettings *cmd);
int phy_mii_ioctl(struct phy_device *phydev, struct ifreq *ifr, int cmd);
diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index 7693182..ba9f78b 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -689,12 +689,13 @@ dsa_slave_get_link_ksettings(struct net_device *dev,
struct ethtool_link_ksettings *cmd)
{
struct dsa_slave_priv *p = netdev_priv(dev);
- int err = -EOPNOTSUPP;
- if (p->phy != NULL)
- err = phy_ethtool_ksettings_get(p->phy, cmd);
+ if (!p->phy)
+ return -EOPNOTSUPP;
- return err;
+ phy_ethtool_ksettings_get(p->phy, cmd);
+
+ return 0;
}
static int
--
2.9.4
^ permalink raw reply related
* Re: [PATCH 27/44] sparc: remove leon_dma_ops
From: Andreas Larsson @ 2017-06-12 8:06 UTC (permalink / raw)
To: Christoph Hellwig, x86, linux-arm-kernel, xen-devel,
linux-c6x-dev, linux-hexagon, linux-ia64, linux-mips, openrisc,
linuxppc-dev, linux-s390, linux-sh, sparclinux, linux-xtensa,
dmaengine, linux-tegra, dri-devel, linux-samsung-soc, iommu,
netdev
Cc: linux-kernel
In-Reply-To: <20170608132609.32662-28-hch@lst.de>
On 2017-06-08 15:25, Christoph Hellwig wrote:
> We can just use pci32_dma_ops.
>
> Btw, given that leon is 32-bit and appears to be PCI based, do even need
> the special case for it in get_arch_dma_ops at all?
Hi!
Yes, it is needed. LEON systems are AMBA bus based. The common case here
is DMA over AMBA buses. Some LEON systems have PCI bridges, but in
general CONFIG_PCI is not a given.
--
Andreas Larsson
Software Engineer
Cobham Gaisler
^ permalink raw reply
* [PATCH net] proc: snmp6: Use correct type in memset
From: Christian Perle @ 2017-06-12 8:06 UTC (permalink / raw)
To: davem; +Cc: netdev, hejianet
Reading /proc/net/snmp6 yields bogus values on 32 bit kernels.
Use "u64" instead of "unsigned long" in sizeof().
Fixes: 4a4857b ("proc: Reduce cache miss in snmp6_seq_show")
Signed-off-by: Christian Perle <christian.perle@secunet.com>
---
net/ipv6/proc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ipv6/proc.c b/net/ipv6/proc.c
index cc8e3ae..e88bcb8 100644
--- a/net/ipv6/proc.c
+++ b/net/ipv6/proc.c
@@ -219,7 +219,7 @@ static void snmp6_seq_show_item64(struct seq_file *seq, void __percpu *mib,
u64 buff64[SNMP_MIB_MAX];
int i;
- memset(buff64, 0, sizeof(unsigned long) * SNMP_MIB_MAX);
+ memset(buff64, 0, sizeof(u64) * SNMP_MIB_MAX);
snmp_get_cpu_field64_batch(buff64, itemlist, mib, syncpoff);
for (i = 0; itemlist[i].name; i++)
--
2.1.4
^ permalink raw reply related
* Re: WARNING in dev_watchdog
From: Dison River @ 2017-06-12 8:13 UTC (permalink / raw)
To: Greg KH; +Cc: netdev, linux-kernel, security
In-Reply-To: <20170612064232.GA14559@kroah.com>
Sorry,this WARNING is not reproducible.And I don't have PoC for this bug.
2017-06-12 14:42 GMT+08:00 Greg KH <gregkh@linuxfoundation.org>:
> On Mon, Jun 12, 2017 at 02:37:22PM +0800, Dison River wrote:
>> Hi:
>> I've got the following error report while fuzzing the kernel with
>> syzkaller on linux-4.11.0-rc3.
>>
>> log:
>> WARNING: CPU: 2 PID: 0 at net/sched/sch_generic.c:316
>> dev_watchdog+0x648/0x770 net/sched/sch_generic.c:315
>> NETDEV WATCHDOG: eth0 (e1000): transmit queue 0 timed out
>> Kernel panic - not syncing: panic_on_warn set ...
>>
>> CPU: 2 PID: 0 Comm: swapper/2 Not tainted 4.11.0-rc3 #2
>> Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
>> Ubuntu-1.8.2-1ubuntu1 04/01/2014
>> Call Trace:
>> <IRQ>
>> __dump_stack lib/dump_stack.c:16 [inline]
>> dump_stack+0x95/0xe8 lib/dump_stack.c:52
>> panic+0x1ae/0x386 kernel/panic.c:180
>> __warn+0x1c4/0x1e0 kernel/panic.c:541
>> warn_slowpath_fmt+0xac/0xd0 kernel/panic.c:564
>> dev_watchdog+0x648/0x770 net/sched/sch_generic.c:315
>> call_timer_fn+0x15b/0x5e0 kernel/time/timer.c:1268
>> expire_timers kernel/time/timer.c:1307 [inline]
>> __run_timers kernel/time/timer.c:1601 [inline]
>> run_timer_softirq+0x5c7/0x1140 kernel/time/timer.c:1614
>> __do_softirq+0x217/0x8b7 kernel/softirq.c:284
>> invoke_softirq kernel/softirq.c:364 [inline]
>> irq_exit+0x198/0x1d0 kernel/softirq.c:405
>> exiting_irq arch/x86/include/asm/apic.h:657 [inline]
>> smp_apic_timer_interrupt+0x76/0xa0 arch/x86/kernel/apic/apic.c:962
>> apic_timer_interrupt+0x90/0xa0 arch/x86/entry/entry_64.S:707
>> RIP: 0010:native_safe_halt arch/x86/include/asm/irqflags.h:53 [inline]
>> RIP: 0010:arch_safe_halt arch/x86/include/asm/irqflags.h:95 [inline]
>> RIP: 0010:default_idle+0x1f/0x2d0 arch/x86/kernel/process.c:275
>> RSP: 0018:ffff88006dee7e78 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff10
>> RAX: 0000000000000007 RBX: ffff88006de9db40 RCX: 0000000000000000
>> RDX: 0000000000000000 RSI: 0000000000000001 RDI: ffff88006de9e314
>> RBP: ffff88006dee7e98 R08: 0000000000000040 R09: 0000000000000000
>> R10: 0000000000000000 R11: 0000000000000000 R12: ffffffff83efc9b8
>> R13: ffff88006de9db40 R14: 0000000000000002 R15: ffff88006de9db40
>> </IRQ>
>> arch_cpu_idle+0xa/0x10 arch/x86/kernel/process.c:266
>> default_idle_call+0x36/0x50 kernel/sched/idle.c:97
>> cpuidle_idle_call kernel/sched/idle.c:155 [inline]
>> do_idle+0x20b/0x2d0 kernel/sched/idle.c:244
>> cpu_startup_entry+0x18/0x20 kernel/sched/idle.c:346
>> start_secondary+0x245/0x2d0 arch/x86/kernel/smpboot.c:275
>> start_cpu+0x14/0x14 arch/x86/kernel/head_64.S:306
>> Dumping ftrace buffer:
>> (ftrace buffer empty)
>> Kernel Offset: disabled
>> Rebooting in 86400 seconds..
>>
>>
>> report :
>>
>>
>> syzkaller login: [ 37.041894] ------------[ cut here ]------------
>> [ 37.042430] WARNING: CPU: 2 PID: 0 at net/sched/sch_generic.c:316
>> dev_watchdog+0x648/0x770
>> [ 37.042978] NETDEV WATCHDOG: eth0 (e1000): transmit queue 0 timed out
>> [ 37.043405] Kernel panic - not syncing: panic_on_warn set ...
>> [ 37.043405]
>> [ 37.043888] CPU: 2 PID: 0 Comm: swapper/2 Not tainted 4.11.0-rc3 #2
>> [ 37.044297] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996),
>> BIOS Ubuntu-1.8.2-1ubuntu1 04/01/2014
>> [ 37.044909] Call Trace:
>> [ 37.045080] <IRQ>
>> [ 37.045226] dump_stack+0x95/0xe8
>> [ 37.045453] ? dev_watchdog+0x648/0x770
>> [ 37.045712] panic+0x1ae/0x386
>> [ 37.045924] ? percpu_up_read_preempt_enable.constprop.53+0xae/0xae
>> [ 37.046342] ? dev_watchdog+0x648/0x770
>> [ 37.046605] ? vprintk_default+0x28/0x30
>> [ 37.046873] ? dev_watchdog+0x648/0x770
>> [ 37.047114] __warn+0x1c4/0x1e0
>> [ 37.047820] warn_slowpath_fmt+0xac/0xd0
>> [ 37.048467] ? __warn+0x1e0/0x1e0
>> [ 37.048698] ? dev_watchdog+0x125/0x770
>> [ 37.048963] dev_watchdog+0x648/0x770
>> [ 37.049218] call_timer_fn+0x15b/0x5e0
>> [ 37.049475] ? call_timer_fn+0xcc/0x5e0
>> [ 37.049739] ? qdisc_rcu_free+0x110/0x110
>> [ 37.050014] ? process_timeout+0x20/0x20
>> [ 37.050285] ? trace_hardirqs_on_caller+0x19e/0x580
>> [ 37.053699] ? qdisc_rcu_free+0x110/0x110
>> [ 37.054931] ? qdisc_rcu_free+0x110/0x110
>> [ 37.055296] run_timer_softirq+0x5c7/0x1140
>> [ 37.055949] ? msleep_interruptible+0x170/0x170
>> [ 37.056671] ? lapic_timer_shutdown+0x3d/0x50
>> [ 37.057268] ? clockevents_switch_state+0xe3/0x320
>> [ 37.057837] __do_softirq+0x217/0x8b7
>> [ 37.058097] irq_exit+0x198/0x1d0
>> [ 37.058326] smp_apic_timer_interrupt+0x76/0xa0
>> [ 37.058634] apic_timer_interrupt+0x90/0xa0
>> [ 37.058921] RIP: 0010:default_idle+0x1f/0x2d0
>> [ 37.059217] RSP: 0018:ffff88006dee7e78 EFLAGS: 00000246 ORIG_RAX:
>> ffffffffffffff10
>> [ 37.059702] RAX: 0000000000000007 RBX: ffff88006de9db40 RCX: 0000000000000000
>> [ 37.060179] RDX: 0000000000000000 RSI: 0000000000000001 RDI: ffff88006de9e314
>> [ 37.065968] RBP: ffff88006dee7e98 R08: 0000000000000040 R09: 0000000000000000
>> [ 37.066451] R10: 0000000000000000 R11: 0000000000000000 R12: ffffffff83efc9b8
>> [ 37.073921] R13: ffff88006de9db40 R14: 0000000000000002 R15: ffff88006de9db40
>> [ 37.074405] </IRQ>
>> [ 37.074767] ? default_idle+0x1d/0x2d0
>> [ 37.075026] arch_cpu_idle+0xa/0x10
>> [ 37.075266] default_idle_call+0x36/0x50
>> [ 37.075534] do_idle+0x20b/0x2d0
>> [ 37.075815] cpu_startup_entry+0x18/0x20
>> [ 37.076084] start_secondary+0x245/0x2d0
>> [ 37.076352] start_cpu+0x14/0x14
>> [ 37.077025] Dumping ftrace buffer:
>> [ 37.077308] (ftrace buffer empty)
>> [ 37.077555] Kernel Offset: disabled
>> [ 37.078786] Rebooting in 86400 seconds..
>
> Any hints as to exactly what you were doing at the time, and a
> reproducer so we could try to test this?
>
> thanks,
>
> greg k-h
^ permalink raw reply
* [PATCH net-next 0/2] r8152: adjust runtime suspend/resume
From: Hayes Wang @ 2017-06-12 8:21 UTC (permalink / raw)
To: netdev; +Cc: nic_swsd, linux-kernel, linux-usb, Hayes Wang
Improve the flow about runtime suspend/resume and make the code
easy to read.
Hayes Wang (2):
r8152: split rtl8152_resume function
r8152: move calling delay_autosuspend function
drivers/net/usb/r8152.c | 107 ++++++++++++++++++++++++++++--------------------
1 file changed, 62 insertions(+), 45 deletions(-)
--
2.7.4
^ permalink raw reply
* [PATCH net-next 1/2] r8152: split rtl8152_resume function
From: Hayes Wang @ 2017-06-12 8:21 UTC (permalink / raw)
To: netdev-u79uwXL29TY76Z2rM5mHXA
Cc: nic_swsd-Rasf1IRRPZFBDgjK7y7TUQ,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-usb-u79uwXL29TY76Z2rM5mHXA, Hayes Wang
In-Reply-To: <1394712342-15778-272-Taiwan-albertk-Rasf1IRRPZFBDgjK7y7TUQ@public.gmane.org>
Split rtl8152_resume() into rtl8152_runtime_resume() and
rtl8152_system_resume().
Signed-off-by: Hayes Wang <hayeswang-Rasf1IRRPZFBDgjK7y7TUQ@public.gmane.org>
---
drivers/net/usb/r8152.c | 99 ++++++++++++++++++++++++++++++-------------------
1 file changed, 61 insertions(+), 38 deletions(-)
diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
index 5a02053..3257955 100644
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -3686,6 +3686,61 @@ static bool delay_autosuspend(struct r8152 *tp)
return false;
}
+static int rtl8152_runtime_resume(struct r8152 *tp)
+{
+ struct net_device *netdev = tp->netdev;
+
+ if (netif_running(netdev) && netdev->flags & IFF_UP) {
+ struct napi_struct *napi = &tp->napi;
+
+ tp->rtl_ops.autosuspend_en(tp, false);
+ napi_disable(napi);
+ set_bit(WORK_ENABLE, &tp->flags);
+
+ if (netif_carrier_ok(netdev)) {
+ if (rtl8152_get_speed(tp) & LINK_STATUS) {
+ rtl_start_rx(tp);
+ } else {
+ netif_carrier_off(netdev);
+ tp->rtl_ops.disable(tp);
+ netif_info(tp, link, netdev, "linking down\n");
+ }
+ }
+
+ napi_enable(napi);
+ clear_bit(SELECTIVE_SUSPEND, &tp->flags);
+ smp_mb__after_atomic();
+
+ if (!list_empty(&tp->rx_done))
+ napi_schedule(&tp->napi);
+
+ usb_submit_urb(tp->intr_urb, GFP_KERNEL);
+ } else {
+ if (netdev->flags & IFF_UP)
+ tp->rtl_ops.autosuspend_en(tp, false);
+
+ clear_bit(SELECTIVE_SUSPEND, &tp->flags);
+ }
+
+ return 0;
+}
+
+static int rtl8152_system_resume(struct r8152 *tp)
+{
+ struct net_device *netdev = tp->netdev;
+
+ netif_device_attach(netdev);
+
+ if (netif_running(netdev) && netdev->flags & IFF_UP) {
+ tp->rtl_ops.up(tp);
+ netif_carrier_off(netdev);
+ set_bit(WORK_ENABLE, &tp->flags);
+ usb_submit_urb(tp->intr_urb, GFP_KERNEL);
+ }
+
+ return 0;
+}
+
static int rtl8152_runtime_suspend(struct r8152 *tp)
{
struct net_device *netdev = tp->netdev;
@@ -3784,50 +3839,18 @@ static int rtl8152_suspend(struct usb_interface *intf, pm_message_t message)
static int rtl8152_resume(struct usb_interface *intf)
{
struct r8152 *tp = usb_get_intfdata(intf);
- struct net_device *netdev = tp->netdev;
+ int ret;
mutex_lock(&tp->control);
- if (!test_bit(SELECTIVE_SUSPEND, &tp->flags))
- netif_device_attach(netdev);
-
- if (netif_running(netdev) && netdev->flags & IFF_UP) {
- if (test_bit(SELECTIVE_SUSPEND, &tp->flags)) {
- struct napi_struct *napi = &tp->napi;
-
- tp->rtl_ops.autosuspend_en(tp, false);
- napi_disable(napi);
- set_bit(WORK_ENABLE, &tp->flags);
- if (netif_carrier_ok(netdev)) {
- if (rtl8152_get_speed(tp) & LINK_STATUS) {
- rtl_start_rx(tp);
- } else {
- netif_carrier_off(netdev);
- tp->rtl_ops.disable(tp);
- netif_info(tp, link, netdev,
- "linking down\n");
- }
- }
- napi_enable(napi);
- clear_bit(SELECTIVE_SUSPEND, &tp->flags);
- smp_mb__after_atomic();
- if (!list_empty(&tp->rx_done))
- napi_schedule(&tp->napi);
- } else {
- tp->rtl_ops.up(tp);
- netif_carrier_off(netdev);
- set_bit(WORK_ENABLE, &tp->flags);
- }
- usb_submit_urb(tp->intr_urb, GFP_KERNEL);
- } else if (test_bit(SELECTIVE_SUSPEND, &tp->flags)) {
- if (netdev->flags & IFF_UP)
- tp->rtl_ops.autosuspend_en(tp, false);
- clear_bit(SELECTIVE_SUSPEND, &tp->flags);
- }
+ if (test_bit(SELECTIVE_SUSPEND, &tp->flags))
+ ret = rtl8152_runtime_resume(tp);
+ else
+ ret = rtl8152_system_resume(tp);
mutex_unlock(&tp->control);
- return 0;
+ return ret;
}
static int rtl8152_reset_resume(struct usb_interface *intf)
--
2.7.4
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related
* [PATCH net-next 2/2] r8152: move calling delay_autosuspend function
From: Hayes Wang @ 2017-06-12 8:21 UTC (permalink / raw)
To: netdev; +Cc: nic_swsd, linux-kernel, linux-usb, Hayes Wang
In-Reply-To: <1394712342-15778-272-Taiwan-albertk@realtek.com>
Move calling delay_autosuspend() in rtl8152_runtime_suspend(). Calling
delay_autosuspend() as late as possible.
The original flows are
1. check if the driver/device is busy now.
2. set wake events.
3. enter runtime suspend.
If the wake event occurs between (1) and (2), the device may miss it. Besides,
to avoid the runtime resume occurs after runtime suspend immediately, move the
checking to the end of rtl8152_runtime_suspend().
Signed-off-by: Hayes Wang <hayeswang@realtek.com>
---
drivers/net/usb/r8152.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
index 3257955..fb6fa6e 100644
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -3752,13 +3752,6 @@ static int rtl8152_runtime_suspend(struct r8152 *tp)
if (netif_running(netdev) && test_bit(WORK_ENABLE, &tp->flags)) {
u32 rcr = 0;
- if (delay_autosuspend(tp)) {
- clear_bit(SELECTIVE_SUSPEND, &tp->flags);
- smp_mb__after_atomic();
- ret = -EBUSY;
- goto out1;
- }
-
if (netif_carrier_ok(netdev)) {
u32 ocp_data;
@@ -3792,6 +3785,11 @@ static int rtl8152_runtime_suspend(struct r8152 *tp)
ocp_write_dword(tp, MCU_TYPE_PLA, PLA_RCR, rcr);
napi_enable(napi);
}
+
+ if (delay_autosuspend(tp)) {
+ rtl8152_runtime_resume(tp);
+ ret = -EBUSY;
+ }
}
out1:
--
2.7.4
^ permalink raw reply related
* [PATCH v3] sh_eth: add support for changing MTU
From: Niklas Söderlund @ 2017-06-12 8:39 UTC (permalink / raw)
To: Sergei Shtylyov; +Cc: netdev, linux-renesas-soc, Niklas Söderlund
The hardware supports the MTU to be changed and the driver it self is
somewhat prepared to support this. This patch hooks up the callbacks to
be able to change the MTU from user-space.
Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Acked-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
---
Based on v4.12-rc1 and tested on Renesas R-Car Koelsch M2.
Test procedure:
1. On host set MTU to something large (9000) was used for this test.
2. On target set MTU to something other then 1500, in this test the max
MTU of 1978 is used.
3. Send ping with large payload and observe that it works.
ping -M do -s 1954 <target>
The reason for 1954 instead of 1982 is two fold:
1. On Linux (different on Mac IIRC) the ICMP/ping implementation
do not encapsulate the 28 byte ICMP (8) + IP (20).
2. The driver internally reserve 4 bytes of transmission buffer for
an optional VLAN header (4). And since no VLAN is used in this
setup the additional 4 bytes can carry data.
4. For extra verification the packet flow is inspected using tcpdump to
verify that there is no packet fragmentation.
* Changes since v2
- Changed subject from 'sh_eth: add support to change MTU' to 'sh_eth: add
support for changing MTU' as suggested by Sergei.
- Changed variable name of struct net_device from dev to ndev, thanks Sergei!
- Fixed typo.
* Changes since v1
- Fix spelling mistake in comment, thanks Sergei!
- Add Acked-by from Sergei.
drivers/net/ethernet/renesas/sh_eth.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
index f68c4db656eda846..2be46e4a32913972 100644
--- a/drivers/net/ethernet/renesas/sh_eth.c
+++ b/drivers/net/ethernet/renesas/sh_eth.c
@@ -2558,6 +2558,17 @@ static int sh_eth_do_ioctl(struct net_device *ndev, struct ifreq *rq, int cmd)
return phy_mii_ioctl(phydev, rq, cmd);
}
+static int sh_eth_change_mtu(struct net_device *ndev, int new_mtu)
+{
+ if (netif_running(ndev))
+ return -EBUSY;
+
+ ndev->mtu = new_mtu;
+ netdev_update_features(ndev);
+
+ return 0;
+}
+
/* For TSU_POSTn. Please refer to the manual about this (strange) bitfields */
static void *sh_eth_tsu_get_post_reg_offset(struct sh_eth_private *mdp,
int entry)
@@ -3029,6 +3040,7 @@ static const struct net_device_ops sh_eth_netdev_ops = {
.ndo_set_rx_mode = sh_eth_set_rx_mode,
.ndo_tx_timeout = sh_eth_tx_timeout,
.ndo_do_ioctl = sh_eth_do_ioctl,
+ .ndo_change_mtu = sh_eth_change_mtu,
.ndo_validate_addr = eth_validate_addr,
.ndo_set_mac_address = eth_mac_addr,
};
@@ -3043,6 +3055,7 @@ static const struct net_device_ops sh_eth_netdev_ops_tsu = {
.ndo_vlan_rx_kill_vid = sh_eth_vlan_rx_kill_vid,
.ndo_tx_timeout = sh_eth_tx_timeout,
.ndo_do_ioctl = sh_eth_do_ioctl,
+ .ndo_change_mtu = sh_eth_change_mtu,
.ndo_validate_addr = eth_validate_addr,
.ndo_set_mac_address = eth_mac_addr,
};
@@ -3171,6 +3184,13 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
}
sh_eth_set_default_cpu_data(mdp->cd);
+ /* User's manual states max MTU should be 2048 but due to the
+ * alignment calculations in sh_eth_ring_init() the practical
+ * MTU is a bit less. Maybe this can be optimized some more.
+ */
+ ndev->max_mtu = 2000 - (ETH_HLEN + VLAN_HLEN + ETH_FCS_LEN);
+ ndev->min_mtu = ETH_MIN_MTU;
+
/* set function */
if (mdp->cd->tsu)
ndev->netdev_ops = &sh_eth_netdev_ops_tsu;
--
2.13.1
^ permalink raw reply related
* Re: [PATCH v4 1/3] Bluetooth: bnep: fix possible might sleep error in bnep_session
From: AL Yu-Chen Cho @ 2017-06-12 8:43 UTC (permalink / raw)
To: Jeffy Chen, linux-bluetooth
Cc: Brian Norris, Douglas Anderson, Johan Hedberg, Peter Hurley,
Johan Hedberg, netdev, linux-kernel, David S. Miller,
Marcel Holtmann, Gustavo Padovan
In-Reply-To: <1487033725-7208-1-git-send-email-jeffy.chen@rock-chips.com>
On Tue, 2017-02-14 at 08:55 +0800, Jeffy Chen wrote:
> It looks like bnep_session has same pattern as the issue reported in
> old rfcomm:
>
> while (1) {
> set_current_state(TASK_INTERRUPTIBLE);
> if (condition)
> break;
> // may call might_sleep here
> schedule();
> }
> __set_current_state(TASK_RUNNING);
>
> Which fixed at:
> dfb2fae Bluetooth: Fix nested sleeps
>
> So let's fix it at the same way, also follow the suggestion of:
> https://lwn.net/Articles/628628/
>
> Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
> Reviewed-by: Brian Norris <briannorris@chromium.org>
Reviewed-by: AL Yu-Chen Cho <acho@suse.com>
> ---
>
> Changes in v3:
> Add brian's Reviewed-by.
>
> Changes in v2:
> Remove unnecessary memory barrier before wake_up_* functions.
>
> net/bluetooth/bnep/core.c | 11 +++++------
> 1 file changed, 5 insertions(+), 6 deletions(-)
>
> diff --git a/net/bluetooth/bnep/core.c b/net/bluetooth/bnep/core.c
> index fbf251f..4d6b94d 100644
> --- a/net/bluetooth/bnep/core.c
> +++ b/net/bluetooth/bnep/core.c
> @@ -484,16 +484,16 @@ static int bnep_session(void *arg)
> struct net_device *dev = s->dev;
> struct sock *sk = s->sock->sk;
> struct sk_buff *skb;
> - wait_queue_t wait;
> + DEFINE_WAIT_FUNC(wait, woken_wake_function);
>
> BT_DBG("");
>
> set_user_nice(current, -15);
>
> - init_waitqueue_entry(&wait, current);
> add_wait_queue(sk_sleep(sk), &wait);
> while (1) {
> - set_current_state(TASK_INTERRUPTIBLE);
> + /* Ensure session->terminate is updated */
> + smp_mb__before_atomic();
>
> if (atomic_read(&s->terminate))
> break;
> @@ -515,9 +515,8 @@ static int bnep_session(void *arg)
> break;
> netif_wake_queue(dev);
>
> - schedule();
> + wait_woken(&wait, TASK_INTERRUPTIBLE,
> MAX_SCHEDULE_TIMEOUT);
> }
> - __set_current_state(TASK_RUNNING);
> remove_wait_queue(sk_sleep(sk), &wait);
>
> /* Cleanup session */
> @@ -666,7 +665,7 @@ int bnep_del_connection(struct bnep_conndel_req
> *req)
> s = __bnep_get_session(req->dst);
> if (s) {
> atomic_inc(&s->terminate);
> - wake_up_process(s->task);
> + wake_up_interruptible(sk_sleep(s->sock->sk));
> } else
> err = -ENOENT;
>
^ permalink raw reply
* Re: [PATCH v4 2/3] Bluetooth: cmtp: fix possible might sleep error in cmtp_session
From: AL Yu-Chen Cho @ 2017-06-12 8:44 UTC (permalink / raw)
To: Jeffy Chen, linux-bluetooth
Cc: Brian Norris, Douglas Anderson, Johan Hedberg, Peter Hurley,
Johan Hedberg, netdev, linux-kernel, David S. Miller,
Marcel Holtmann, Gustavo Padovan
In-Reply-To: <1487033725-7208-2-git-send-email-jeffy.chen@rock-chips.com>
On Tue, 2017-02-14 at 08:55 +0800, Jeffy Chen wrote:
> It looks like cmtp_session has same pattern as the issue reported in
> old rfcomm:
>
> while (1) {
> set_current_state(TASK_INTERRUPTIBLE);
> if (condition)
> break;
> // may call might_sleep here
> schedule();
> }
> __set_current_state(TASK_RUNNING);
>
> Which fixed at:
> dfb2fae Bluetooth: Fix nested sleeps
>
> So let's fix it at the same way, also follow the suggestion of:
> https://lwn.net/Articles/628628/
>
> Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
> Reviewed-by: Brian Norris <briannorris@chromium.org>
> Remove unnecessary memory barrier before wake_up_* functions.
Reviewed-by: AL Yu-Chen Cho <acho@suse.com>
>
> ---
>
> Changes in v3:
> Add brian's Reviewed-by.
>
> Changes in v2: None
>
> net/bluetooth/cmtp/core.c | 17 ++++++++++-------
> 1 file changed, 10 insertions(+), 7 deletions(-)
>
> diff --git a/net/bluetooth/cmtp/core.c b/net/bluetooth/cmtp/core.c
> index 9e59b66..1152ce3 100644
> --- a/net/bluetooth/cmtp/core.c
> +++ b/net/bluetooth/cmtp/core.c
> @@ -280,16 +280,16 @@ static int cmtp_session(void *arg)
> struct cmtp_session *session = arg;
> struct sock *sk = session->sock->sk;
> struct sk_buff *skb;
> - wait_queue_t wait;
> + DEFINE_WAIT_FUNC(wait, woken_wake_function);
>
> BT_DBG("session %p", session);
>
> set_user_nice(current, -15);
>
> - init_waitqueue_entry(&wait, current);
> add_wait_queue(sk_sleep(sk), &wait);
> while (1) {
> - set_current_state(TASK_INTERRUPTIBLE);
> + /* Ensure session->terminate is updated */
> + smp_mb__before_atomic();
>
> if (atomic_read(&session->terminate))
> break;
> @@ -306,9 +306,8 @@ static int cmtp_session(void *arg)
>
> cmtp_process_transmit(session);
>
> - schedule();
> + wait_woken(&wait, TASK_INTERRUPTIBLE,
> MAX_SCHEDULE_TIMEOUT);
> }
> - __set_current_state(TASK_RUNNING);
> remove_wait_queue(sk_sleep(sk), &wait);
>
> down_write(&cmtp_session_sem);
> @@ -393,7 +392,7 @@ int cmtp_add_connection(struct cmtp_connadd_req
> *req, struct socket *sock)
> err = cmtp_attach_device(session);
> if (err < 0) {
> atomic_inc(&session->terminate);
> - wake_up_process(session->task);
> + wake_up_interruptible(sk_sleep(session-
> >sock->sk));
> up_write(&cmtp_session_sem);
> return err;
> }
> @@ -431,7 +430,11 @@ int cmtp_del_connection(struct cmtp_conndel_req
> *req)
>
> /* Stop session thread */
> atomic_inc(&session->terminate);
> - wake_up_process(session->task);
> +
> + /* Ensure session->terminate is updated */
> + smp_mb__after_atomic();
> +
> + wake_up_interruptible(sk_sleep(session->sock->sk));
> } else
> err = -ENOENT;
>
^ 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