* [PATCH net-next] cxgb4: Mask out interrupts that are not enabled.
From: Vishal Kulkarni @ 2019-02-17 4:15 UTC (permalink / raw)
To: netdev, davem; +Cc: nirranjan, indranil, dt, Vishal Kulkarni
There are rare cases where a PL_INT_CAUSE bit may end up getting
set when the corresponding PL_INT_ENABLE bit isn't set.
Signed-off-by: Vishal Kulkarni <vishal@chelsio.com>
---
drivers/net/ethernet/chelsio/cxgb4/t4_hw.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
index 27af347..49e4374 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
@@ -4962,7 +4962,13 @@ static void pl_intr_handler(struct adapter *adap)
*/
int t4_slow_intr_handler(struct adapter *adapter)
{
- u32 cause = t4_read_reg(adapter, PL_INT_CAUSE_A);
+ /* There are rare cases where a PL_INT_CAUSE bit may end up getting
+ * set when the corresponding PL_INT_ENABLE bit isn't set. It's
+ * easiest just to mask that case here.
+ */
+ u32 raw_cause = t4_read_reg(adapter, PL_INT_CAUSE_A);
+ u32 enable = t4_read_reg(adapter, PL_INT_ENABLE_A);
+ u32 cause = raw_cause & enable;
if (!(cause & GLBL_INTR_MASK))
return 0;
@@ -5014,7 +5020,7 @@ int t4_slow_intr_handler(struct adapter *adapter)
ulptx_intr_handler(adapter);
/* Clear the interrupts just processed for which we are the master. */
- t4_write_reg(adapter, PL_INT_CAUSE_A, cause & GLBL_INTR_MASK);
+ t4_write_reg(adapter, PL_INT_CAUSE_A, raw_cause & GLBL_INTR_MASK);
(void)t4_read_reg(adapter, PL_INT_CAUSE_A); /* flush */
return 1;
}
--
1.8.3.1
^ permalink raw reply related
* Re: [PATCH net-next 2/4] net: phy: add genphy_c45_an_config_an
From: Andrew Lunn @ 2019-02-17 4:18 UTC (permalink / raw)
To: Florian Fainelli
Cc: Heiner Kallweit, David Miller, Russell King - ARM Linux,
netdev@vger.kernel.org
In-Reply-To: <407e490f-17f6-c9a5-a128-9a27a3230c39@gmail.com>
On Sat, Feb 16, 2019 at 06:44:24PM -0800, Florian Fainelli wrote:
>
>
> On 2/16/2019 11:51 AM, Heiner Kallweit wrote:
> > From: Andrew Lunn <andrew@lunn.ch>
> > C45 configuration of 10/100 and multi-giga bit auto negotiation
> > advertisement is standardized. Configuration of 1000Base-T however
> > appears to be vendor specific. Move the generic code out of the
> > Marvell driver into the common phy-c45.c file.
> >
> > Signed-off-by: Andrew Lunn <andrew@lunn.ch>
> > [hkallweit1@gmail.com: use new helper linkmode_adv_to_mii_10gbt_adv_t and split patch]
> > Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
> > ---
> > drivers/net/phy/phy-c45.c | 44 +++++++++++++++++++++++++++++++++++++++
> > include/linux/phy.h | 1 +
> > 2 files changed, 45 insertions(+)
> >
> > diff --git a/drivers/net/phy/phy-c45.c b/drivers/net/phy/phy-c45.c
> > index 0374c50b1..bea1b0c6e 100644
> > --- a/drivers/net/phy/phy-c45.c
> > +++ b/drivers/net/phy/phy-c45.c
> > @@ -78,6 +78,50 @@ int genphy_c45_pma_setup_forced(struct phy_device *phydev)
> > }
> > EXPORT_SYMBOL_GPL(genphy_c45_pma_setup_forced);
> >
> > +/**
> > + * genphy_c45_an_config_an - configure advertisement registers
>
> Nit: are not the two "an" redundant" here? Unless the first one means
> something different in which case naming this:
> genphy_c45_an_config_aneg() would be clearer?
Hi Florian
Heiner and I had a brief discussion about this. There is a general
trend in the naming to have the device name in the function name. So
genphy_c45_pma_setup_forced uses the PMA device registers,
genphy_c45_an_disable_aneg uses the AN device registers, etc.
However, genphy_c45_an_config_aneg() might be better.
Andrew
^ permalink raw reply
* Re: [PATCH net-next 3/4] net: phy: marvell10g: use genphy_c45_an_config_an
From: Andrew Lunn @ 2019-02-17 4:22 UTC (permalink / raw)
To: Florian Fainelli
Cc: Heiner Kallweit, David Miller, Russell King - ARM Linux,
netdev@vger.kernel.org
In-Reply-To: <2d9ed6ca-60a0-b0da-8e86-f2fd3ef64343@gmail.com>
> This is not strictly equivalent though because marvell10g only checks
> for the 10000baseT_Full bit set whereas genphy_c45_an_config_an() calls
> linkmode_adv_to_mii_10gbt_adv_t() which you recently updated to also
> check for 2.5G and 5G. This sounds about the right decision, but I
> wonder if Russell did this for a reason (like not able to test 2500baseT
> and 5000baseT?)
Hi Florian
Correct. But both Marvell MAC drivers recently gained the code needed
for 2500BaseX and 5000BaseX. See Maxime and Russell comphy patches.
Russell has tested 2500BaseX SFPs and Maxime has been testing
2500BaseT copper.
Andrew
^ permalink raw reply
* Re: [RFC PATCH] bonding: use mutex lock in bond_get_stats()
From: Cong Wang @ 2019-02-17 6:27 UTC (permalink / raw)
To: Kefeng Wang
Cc: Linux Kernel Network Developers, Willem de Bruijn,
David S . Miller, Jay Vosburgh, Veaceslav Falico, Eric Dumazet,
Wei Yongjun
In-Reply-To: <20190215135056.18376-1-wangkefeng.wang@huawei.com>
On Fri, Feb 15, 2019 at 8:19 AM Kefeng Wang <wangkefeng.wang@huawei.com> wrote:
>
> With CONFIG_DEBUG_SPINLOCK=y, we find following stack,
>
> BUG: spinlock wrong CPU on CPU#0, ip/16047
> lock: 0xffff803f5febc998, .magic: dead4ead, .owner: ip/16047, .owner_cpu: 0
> CPU: 1 PID: 16047 Comm: ip Kdump: loaded Tainted: G E 4.19.12.aarch64 #1
> Hardware name: Huawei TaiShan 2280 V2/BC82AMDA, BIOS TA BIOS TaiShan 2280 V2 - B900 01/29/2019
> Call trace:
> dump_backtrace+0x0/0x1c0
> show_stack+0x24/0x30
> dump_stack+0x90/0xbc
> spin_dump+0x84/0xa8
> do_raw_spin_unlock+0xf8/0x100
> _raw_spin_unlock+0x20/0x30
> bond_get_stats+0x110/0x140 [bonding]
> rtnl_fill_stats+0x50/0x150
> rtnl_fill_ifinfo+0x4d4/0xd18
> rtnl_dump_ifinfo+0x200/0x3a8
> netlink_dump+0x100/0x2b0
> netlink_recvmsg+0x310/0x3e8
> sock_recvmsg+0x58/0x68
> ___sys_recvmsg+0xd0/0x278
> __sys_recvmsg+0x74/0xd0
> __arm64_sys_recvmsg+0x2c/0x38
> el0_svc_common+0x7c/0x118
> el0_svc_handler+0x30/0x40
> el0_svc+0x8/0xc
>
> and then lead to softlockup issue, fix this by using mutex lock instead
> of spin lock.
Why spinlock debugging code complains about this?
It looks like an internal spinlock bug from this stack trace. So,
why do we have to fix it in bonding?
BTW, your kernel warning is tainted, so double check if you
have any out-of-tree modules.
^ permalink raw reply
* Re: pull-request: bpf 2019-02-16
From: David Miller @ 2019-02-17 6:34 UTC (permalink / raw)
To: ast; +Cc: daniel, netdev, kernel-team
In-Reply-To: <20190217031418.2509756-1-ast@kernel.org>
From: Alexei Starovoitov <ast@kernel.org>
Date: Sat, 16 Feb 2019 19:14:18 -0800
> The following pull-request contains BPF updates for your *net* tree.
>
> The main changes are:
>
> 1) fix lockdep false positive in bpf_get_stackid(), from Alexei.
>
> 2) several AF_XDP fixes, from Bjorn, Magnus, Davidlohr.
>
> 3) fix narrow load from struct bpf_sock, from Martin.
>
> 4) mips JIT fixes, from Paul.
>
> 5) gso handling fix in bpf helpers, from Willem.
>
> Please consider pulling these changes from:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf.git
Pulled.
^ permalink raw reply
* Re: pull-request: bpf-next 2019-02-16
From: David Miller @ 2019-02-17 6:56 UTC (permalink / raw)
To: ast; +Cc: daniel, netdev, kernel-team
In-Reply-To: <20190217034233.2607044-1-ast@kernel.org>
From: Alexei Starovoitov <ast@kernel.org>
Date: Sat, 16 Feb 2019 19:42:33 -0800
> The following pull-request contains BPF updates for your *net-next* tree.
>
> The main changes are:
>
> 1) numerous libbpf API improvements, from Andrii, Andrey, Yonghong.
>
> 2) test all bpf progs in alu32 mode, from Jiong.
>
> 3) skb->sk access and bpf_sk_fullsock(), bpf_tcp_sock() helpers, from Martin.
>
> 4) support for IP encap in lwt bpf progs, from Peter.
>
> 5) remove XDP_QUERY_XSK_UMEM dead code, from Jan.
>
> Please consider pulling these changes from:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git
Pulled, thanks Alexei.
^ permalink raw reply
* [PATCH net] mlxsw: __mlxsw_sp_port_headroom_set(): Fix a use of local variable
From: Ido Schimmel @ 2019-02-17 7:18 UTC (permalink / raw)
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, Jiri Pirko, Petr Machata, mlxsw,
Ido Schimmel
From: Petr Machata <petrm@mellanox.com>
The function-local variable "delay" enters the loop interpreted as delay
in bits. However, inside the loop it gets overwritten by the result of
mlxsw_sp_pg_buf_delay_get(), and thus leaves the loop as quantity in
cells. Thus on second and further loop iterations, the headroom for a
given priority is configured with a wrong size.
Fix by introducing a loop-local variable, delay_cells. Rename thres to
thres_cells for consistency.
Fixes: f417f04da589 ("mlxsw: spectrum: Refactor port buffer configuration")
Signed-off-by: Petr Machata <petrm@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
---
drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
index 32519c93df17..b65e274b02e9 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
@@ -862,8 +862,9 @@ int __mlxsw_sp_port_headroom_set(struct mlxsw_sp_port *mlxsw_sp_port, int mtu,
for (i = 0; i < IEEE_8021QAZ_MAX_TCS; i++) {
bool configure = false;
bool pfc = false;
+ u16 thres_cells;
+ u16 delay_cells;
bool lossy;
- u16 thres;
for (j = 0; j < IEEE_8021QAZ_MAX_TCS; j++) {
if (prio_tc[j] == i) {
@@ -877,10 +878,11 @@ int __mlxsw_sp_port_headroom_set(struct mlxsw_sp_port *mlxsw_sp_port, int mtu,
continue;
lossy = !(pfc || pause_en);
- thres = mlxsw_sp_pg_buf_threshold_get(mlxsw_sp, mtu);
- delay = mlxsw_sp_pg_buf_delay_get(mlxsw_sp, mtu, delay, pfc,
- pause_en);
- mlxsw_sp_pg_buf_pack(pbmc_pl, i, thres + delay, thres, lossy);
+ thres_cells = mlxsw_sp_pg_buf_threshold_get(mlxsw_sp, mtu);
+ delay_cells = mlxsw_sp_pg_buf_delay_get(mlxsw_sp, mtu, delay,
+ pfc, pause_en);
+ mlxsw_sp_pg_buf_pack(pbmc_pl, i, thres_cells + delay_cells,
+ thres_cells, lossy);
}
return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(pbmc), pbmc_pl);
--
2.20.1
^ permalink raw reply related
* Re: [PATCH net-next v2 1/2] net: phy: add helper mii_10gbt_stat_mod_linkmode_lpa_t
From: Heiner Kallweit @ 2019-02-17 8:02 UTC (permalink / raw)
To: Florian Fainelli, Andrew Lunn, David Miller; +Cc: netdev@vger.kernel.org
In-Reply-To: <eac9ef21-9847-c2ca-49c8-13f3ed7ff682@gmail.com>
On 17.02.2019 03:35, Florian Fainelli wrote:
>
>
> On 2/16/2019 8:26 AM, Heiner Kallweit wrote:
>> Similar to the existing helpers for the Clause 22 registers add helper
>> mii_10gbt_stat_mod_linkmode_lpa_t.
>>
>> Note that this helper is defined in linux/mdio.h, not like the
>> Clause 22 helpers in linux/mii.h. Reason is that the Clause 45 register
>> constants are defined in uapi/linux/mdio.h. And uapi/linux/mdio.h
>> includes linux/mii.h before defining the C45 register constants.
>
> Nit: this also processes 2.5G and 5G but I can't suggest a better name,
> so this is as good as any.
>
I also thought about this and eventually decided to go with the register
name from the Clause 45 (2015) spec. Not sure whether there's a newer
version, but even if I (after 802.3bz was established) doubt that they
would rename a register.
>>
>> v2:
>> - remove helpers that don't have users in this series
>>
>> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
>
> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
>
^ permalink raw reply
* INFO: task hung in unregister_netdevice_notifier (3)
From: syzbot @ 2019-02-17 8:11 UTC (permalink / raw)
To: davem, linux-can, linux-kernel, mkl, netdev, socketcan,
syzkaller-bugs
Hello,
syzbot found the following crash on:
HEAD commit: aa0c38cf39de Merge branch 'fixes' of git://git.kernel.org/..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=105302a7400000
kernel config: https://syzkaller.appspot.com/x/.config?x=ee434566c893c7b1
dashboard link: https://syzkaller.appspot.com/bug?extid=0f1827363a305f74996f
compiler: gcc (GCC) 9.0.0 20181231 (experimental)
Unfortunately, I don't have any reproducer for this crash yet.
IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+0f1827363a305f74996f@syzkaller.appspotmail.com
INFO: task syz-executor.1:32467 blocked for more than 140 seconds.
Not tainted 5.0.0-rc6+ #69
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
syz-executor.1 D28224 32467 30279 0x00000004
Call Trace:
context_switch kernel/sched/core.c:2844 [inline]
__schedule+0x817/0x1cc0 kernel/sched/core.c:3485
schedule+0x92/0x180 kernel/sched/core.c:3529
__rwsem_down_write_failed_common kernel/locking/rwsem-xadd.c:584 [inline]
rwsem_down_write_failed+0x774/0xc30 kernel/locking/rwsem-xadd.c:613
call_rwsem_down_write_failed+0x17/0x30 arch/x86/lib/rwsem.S:117
__down_write arch/x86/include/asm/rwsem.h:142 [inline]
down_write+0x53/0x90 kernel/locking/rwsem.c:72
unregister_netdevice_notifier+0x7e/0x3a0 net/core/dev.c:1703
raw_release+0x57/0x6f0 net/can/raw.c:358
__sock_release+0xd3/0x250 net/socket.c:579
sock_close+0x1b/0x30 net/socket.c:1139
__fput+0x2df/0x8d0 fs/file_table.c:278
____fput+0x16/0x20 fs/file_table.c:309
task_work_run+0x14a/0x1c0 kernel/task_work.c:113
tracehook_notify_resume include/linux/tracehook.h:188 [inline]
exit_to_usermode_loop+0x273/0x2c0 arch/x86/entry/common.c:166
prepare_exit_to_usermode arch/x86/entry/common.c:197 [inline]
syscall_return_slowpath arch/x86/entry/common.c:268 [inline]
do_syscall_64+0x52d/0x610 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x411d41
Code: 00 00 8b b3 30 01 00 00 31 c0 bf d0 36 44 00 e8 05 f3 00 00 8b b3 08
01 00 00 31 c0 bf e4 36 44 00 e8 f3 f2 00 00 8b 83 e0 00 <00> 00 48 89 ee
bf f9 36 44 00 85 c0 49 0f 44 f4 31 c0 e8 d8 f2 00
RSP: 002b:00007ffc0aec9520 EFLAGS: 00000293 ORIG_RAX: 0000000000000003
RAX: 0000000000000000 RBX: 0000000000000005 RCX: 0000000000411d41
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000004
RBP: 0000000000000000 R08: ffffffff8100a073 R09: 0000000021576e54
R10: 00007ffc0aec9450 R11: 0000000000000293 R12: 0000000000000000
R13: 0000000000000001 R14: 0000000000000072 R15: 0000000000000001
INFO: task syz-executor.5:32470 blocked for more than 140 seconds.
Not tainted 5.0.0-rc6+ #69
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
syz-executor.5 D28224 32470 7467 0x00000004
Call Trace:
context_switch kernel/sched/core.c:2844 [inline]
__schedule+0x817/0x1cc0 kernel/sched/core.c:3485
schedule+0x92/0x180 kernel/sched/core.c:3529
__rwsem_down_write_failed_common kernel/locking/rwsem-xadd.c:584 [inline]
rwsem_down_write_failed+0x774/0xc30 kernel/locking/rwsem-xadd.c:613
call_rwsem_down_write_failed+0x17/0x30 arch/x86/lib/rwsem.S:117
__down_write arch/x86/include/asm/rwsem.h:142 [inline]
down_write+0x53/0x90 kernel/locking/rwsem.c:72
unregister_netdevice_notifier+0x7e/0x3a0 net/core/dev.c:1703
raw_release+0x57/0x6f0 net/can/raw.c:358
__sock_release+0xd3/0x250 net/socket.c:579
sock_close+0x1b/0x30 net/socket.c:1139
__fput+0x2df/0x8d0 fs/file_table.c:278
____fput+0x16/0x20 fs/file_table.c:309
task_work_run+0x14a/0x1c0 kernel/task_work.c:113
tracehook_notify_resume include/linux/tracehook.h:188 [inline]
exit_to_usermode_loop+0x273/0x2c0 arch/x86/entry/common.c:166
prepare_exit_to_usermode arch/x86/entry/common.c:197 [inline]
syscall_return_slowpath arch/x86/entry/common.c:268 [inline]
do_syscall_64+0x52d/0x610 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x411d41
Code: 00 00 8b b3 30 01 00 00 31 c0 bf d0 36 44 00 e8 05 f3 00 00 8b b3 08
01 00 00 31 c0 bf e4 36 44 00 e8 f3 f2 00 00 8b 83 e0 00 <00> 00 48 89 ee
bf f9 36 44 00 85 c0 49 0f 44 f4 31 c0 e8 d8 f2 00
RSP: 002b:00007ffe4f2857d0 EFLAGS: 00000293 ORIG_RAX: 0000000000000003
RAX: 0000000000000000 RBX: 0000000000000008 RCX: 0000000000411d41
RDX: 0000000000000000 RSI: 0000000000741140 RDI: 0000000000000007
RBP: 0000000000000000 R08: ffffffff8175450f R09: 0000000021576e54
R10: 00007ffe4f285700 R11: 0000000000000293 R12: 0000000000000000
R13: 0000000000000001 R14: 0000000000001504 R15: 0000000000000005
INFO: task syz-executor.0:32475 blocked for more than 140 seconds.
Not tainted 5.0.0-rc6+ #69
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
syz-executor.0 D28224 32475 25857 0x00000004
Call Trace:
context_switch kernel/sched/core.c:2844 [inline]
__schedule+0x817/0x1cc0 kernel/sched/core.c:3485
schedule+0x92/0x180 kernel/sched/core.c:3529
__rwsem_down_write_failed_common kernel/locking/rwsem-xadd.c:584 [inline]
rwsem_down_write_failed+0x774/0xc30 kernel/locking/rwsem-xadd.c:613
call_rwsem_down_write_failed+0x17/0x30 arch/x86/lib/rwsem.S:117
__down_write arch/x86/include/asm/rwsem.h:142 [inline]
down_write+0x53/0x90 kernel/locking/rwsem.c:72
unregister_netdevice_notifier+0x7e/0x3a0 net/core/dev.c:1703
raw_release+0x57/0x6f0 net/can/raw.c:358
__sock_release+0xd3/0x250 net/socket.c:579
sock_close+0x1b/0x30 net/socket.c:1139
__fput+0x2df/0x8d0 fs/file_table.c:278
____fput+0x16/0x20 fs/file_table.c:309
task_work_run+0x14a/0x1c0 kernel/task_work.c:113
tracehook_notify_resume include/linux/tracehook.h:188 [inline]
exit_to_usermode_loop+0x273/0x2c0 arch/x86/entry/common.c:166
prepare_exit_to_usermode arch/x86/entry/common.c:197 [inline]
syscall_return_slowpath arch/x86/entry/common.c:268 [inline]
do_syscall_64+0x52d/0x610 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x411d41
Code: 00 00 8b b3 30 01 00 00 31 c0 bf d0 36 44 00 e8 05 f3 00 00 8b b3 08
01 00 00 31 c0 bf e4 36 44 00 e8 f3 f2 00 00 8b 83 e0 00 <00> 00 48 89 ee
bf f9 36 44 00 85 c0 49 0f 44 f4 31 c0 e8 d8 f2 00
RSP: 002b:00007ffd315a7180 EFLAGS: 00000293 ORIG_RAX: 0000000000000003
RAX: 0000000000000000 RBX: 0000000000000005 RCX: 0000000000411d41
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000004
RBP: 0000000000000000 R08: 00000000c77ce9e8 R09: 00000000c77ce9ec
R10: 00007ffd315a70b0 R11: 0000000000000293 R12: 0000000000000000
R13: 0000000000000001 R14: 0000000000000142 R15: 0000000000000000
INFO: task syz-executor.3:32481 blocked for more than 140 seconds.
kobject: 'batman_adv' (00000000eb158d40): kobject_uevent_env
kobject: 'batman_adv' (00000000eb158d40): kobject_uevent_env: filter
function caused the event to drop!
Not tainted 5.0.0-rc6+ #69
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
syz-executor.3 D29872 32481 25311 0x00000004
kobject: 'batman_adv' (00000000eb158d40): kobject_cleanup, parent
(null)
Call Trace:
context_switch kernel/sched/core.c:2844 [inline]
__schedule+0x817/0x1cc0 kernel/sched/core.c:3485
kobject: 'batman_adv' (00000000eb158d40): calling ktype release
kobject: (00000000eb158d40): dynamic_kobj_release
kobject: 'batman_adv': free name
schedule+0x92/0x180 kernel/sched/core.c:3529
kobject: 'rx-0' (000000009425fba9): kobject_cleanup, parent 00000000b76440a4
__rwsem_down_write_failed_common kernel/locking/rwsem-xadd.c:584 [inline]
rwsem_down_write_failed+0x774/0xc30 kernel/locking/rwsem-xadd.c:613
kobject: 'rx-0' (000000009425fba9): auto cleanup 'remove' event
kobject: 'rx-0' (000000009425fba9): kobject_uevent_env
call_rwsem_down_write_failed+0x17/0x30 arch/x86/lib/rwsem.S:117
kobject: 'rx-0' (000000009425fba9): kobject_uevent_env: uevent_suppress
caused the event to drop!
__down_write arch/x86/include/asm/rwsem.h:142 [inline]
down_write+0x53/0x90 kernel/locking/rwsem.c:72
kobject: 'rx-0' (000000009425fba9): auto cleanup kobject_del
register_netdevice_notifier+0x7e/0x630 net/core/dev.c:1634
kobject: 'rx-0' (000000009425fba9): calling ktype release
kobject: 'rx-0': free name
kobject: 'tx-3' (000000005fdfc520): kobject_cleanup, parent 00000000b76440a4
kobject: 'tx-3' (000000005fdfc520): auto cleanup 'remove' event
raw_init+0x299/0x340 net/can/raw.c:343
kobject: 'tx-3' (000000005fdfc520): kobject_uevent_env
kobject: 'tx-3' (000000005fdfc520): kobject_uevent_env: uevent_suppress
caused the event to drop!
kobject: 'tx-3' (000000005fdfc520): auto cleanup kobject_del
kobject: 'tx-3' (000000005fdfc520): calling ktype release
kobject: 'tx-3': free name
kobject: 'tx-2' (00000000b08d97be): kobject_cleanup, parent 00000000b76440a4
kobject: 'tx-2' (00000000b08d97be): auto cleanup 'remove' event
can_create+0x28a/0x4b0 net/can/af_can.c:183
__sock_create+0x3e6/0x750 net/socket.c:1275
kobject: 'tx-2' (00000000b08d97be): kobject_uevent_env
kobject: 'tx-2' (00000000b08d97be): kobject_uevent_env: uevent_suppress
caused the event to drop!
sock_create net/socket.c:1315 [inline]
__sys_socket+0x103/0x220 net/socket.c:1345
kobject: 'tx-2' (00000000b08d97be): auto cleanup kobject_del
kobject: 'tx-2' (00000000b08d97be): calling ktype release
kobject: 'tx-2': free name
kobject: 'tx-1' (00000000709a5639): kobject_cleanup, parent 00000000b76440a4
__do_sys_socket net/socket.c:1354 [inline]
__se_sys_socket net/socket.c:1352 [inline]
__x64_sys_socket+0x73/0xb0 net/socket.c:1352
do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290
entry_SYSCALL_64_after_hwframe+0x49/0xbe
kobject: 'tx-1' (00000000709a5639): auto cleanup 'remove' event
RIP: 0033:0x457e39
Code: Bad RIP value.
RSP: 002b:00007ff564faac78 EFLAGS: 00000246 ORIG_RAX: 0000000000000029
kobject: 'tx-1' (00000000709a5639): kobject_uevent_env
kobject: 'tx-1' (00000000709a5639): kobject_uevent_env: uevent_suppress
caused the event to drop!
kobject: 'tx-1' (00000000709a5639): auto cleanup kobject_del
kobject: 'tx-1' (00000000709a5639): calling ktype release
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000457e39
kobject: 'tx-1': free name
kobject: 'tx-0' (00000000835508d8): kobject_cleanup, parent 00000000b76440a4
RDX: 0000000000000001 RSI: 0000000000000003 RDI: 000000000000001d
kobject: 'tx-0' (00000000835508d8): auto cleanup 'remove' event
kobject: 'tx-0' (00000000835508d8): kobject_uevent_env
kobject: 'tx-0' (00000000835508d8): kobject_uevent_env: uevent_suppress
caused the event to drop!
kobject: 'tx-0' (00000000835508d8): auto cleanup kobject_del
RBP: 000000000073bfa0 R08: 0000000000000000 R09: 0000000000000000
kobject: 'tx-0' (00000000835508d8): calling ktype release
R10: 0000000000000000 R11: 0000000000000246 R12: 00007ff564fab6d4
kobject: 'tx-0': free name
R13: 00000000004c616d R14: 00000000004db2f0 R15: 00000000ffffffff
kobject: 'queues' (00000000b76440a4): kobject_cleanup, parent
(null)
Showing all locks held in the system:
1 lock held by khungtaskd/1039:
kobject: 'queues' (00000000b76440a4): calling ktype release
#0: 00000000b60d248e (rcu_read_lock){....}, at:
debug_show_all_locks+0x5f/0x27e kernel/locking/lockdep.c:4389
kobject: 'queues' (00000000b76440a4): kset_release
1 lock held by udevd/3867:
kobject: 'queues': free name
2 locks held by getty/7415:
#0: 00000000e88d5f59 (&tty->ldisc_sem){++++}, at:
ldsem_down_read+0x33/0x40 drivers/tty/tty_ldsem.c:341
kobject: 'wlan2130' (000000006fe942ce): kobject_uevent_env
#1: 0000000019eb2138 (&ldata->atomic_read_lock){+.+.}, at:
n_tty_read+0x232/0x1b70 drivers/tty/n_tty.c:2154
kobject: 'wlan2130' (000000006fe942ce): kobject_uevent_env: uevent_suppress
caused the event to drop!
2 locks held by getty/7416:
kobject: 'net' (00000000df13c95f): kobject_cleanup, parent (null)
kobject: 'net' (00000000df13c95f): calling ktype release
kobject: 'net': free name
#0: 000000005ade2a44 (&tty->ldisc_sem){++++}, at:
ldsem_down_read+0x33/0x40 drivers/tty/tty_ldsem.c:341
#1: 000000003c9b35b9 (&ldata->atomic_read_lock){+.+.}, at:
n_tty_read+0x232/0x1b70 drivers/tty/n_tty.c:2154
2 locks held by getty/7417:
#0: 00000000014d4db9 (&tty->ldisc_sem){++++}, at:
ldsem_down_read+0x33/0x40 drivers/tty/tty_ldsem.c:341
#1: 0000000040737cf5 (&ldata->atomic_read_lock){+.+.}, at:
n_tty_read+0x232/0x1b70 drivers/tty/n_tty.c:2154
2 locks held by getty/7418:
#0: 00000000495d2925 (&tty->ldisc_sem){++++}, at:
ldsem_down_read+0x33/0x40 drivers/tty/tty_ldsem.c:341
#1: 000000008468a6ce (&ldata->atomic_read_lock){+.+.}, at:
n_tty_read+0x232/0x1b70 drivers/tty/n_tty.c:2154
2 locks held by getty/7419:
#0: 000000000a1e8d17 (&tty->ldisc_sem){++++}, at:
ldsem_down_read+0x33/0x40 drivers/tty/tty_ldsem.c:341
#1: 000000000f0237e0 (&ldata->atomic_read_lock){+.+.}, at:
n_tty_read+0x232/0x1b70 drivers/tty/n_tty.c:2154
2 locks held by getty/7420:
#0: 00000000fe409789 (&tty->ldisc_sem){++++}, at:
ldsem_down_read+0x33/0x40 drivers/tty/tty_ldsem.c:341
#1: 000000005a06b62c (&ldata->atomic_read_lock){+.+.}, at:
n_tty_read+0x232/0x1b70 drivers/tty/n_tty.c:2154
2 locks held by getty/7421:
#0: 00000000ef5d25aa (&tty->ldisc_sem){++++}, at:
ldsem_down_read+0x33/0x40 drivers/tty/tty_ldsem.c:341
#1: 00000000effcff7b (&ldata->atomic_read_lock){+.+.}, at:
n_tty_read+0x232/0x1b70 drivers/tty/n_tty.c:2154
2 locks held by kworker/1:0/28948:
#0: 0000000036c9d838 ((wq_completion)"rcu_gp"){+.+.}, at:
__write_once_size include/linux/compiler.h:220 [inline]
#0: 0000000036c9d838 ((wq_completion)"rcu_gp"){+.+.}, at:
arch_atomic64_set arch/x86/include/asm/atomic64_64.h:34 [inline]
#0: 0000000036c9d838 ((wq_completion)"rcu_gp"){+.+.}, at: atomic64_set
include/asm-generic/atomic-instrumented.h:40 [inline]
#0: 0000000036c9d838 ((wq_completion)"rcu_gp"){+.+.}, at: atomic_long_set
include/asm-generic/atomic-long.h:59 [inline]
#0: 0000000036c9d838 ((wq_completion)"rcu_gp"){+.+.}, at: set_work_data
kernel/workqueue.c:617 [inline]
#0: 0000000036c9d838 ((wq_completion)"rcu_gp"){+.+.}, at:
set_work_pool_and_clear_pending kernel/workqueue.c:644 [inline]
#0: 0000000036c9d838 ((wq_completion)"rcu_gp"){+.+.}, at:
process_one_work+0x87e/0x1790 kernel/workqueue.c:2144
#1: 00000000fba37eaa ((work_completion)(&rew.rew_work)){+.+.}, at:
process_one_work+0x8b4/0x1790 kernel/workqueue.c:2148
1 lock held by syz-executor.4/16551:
#0: 000000008e9f7a44 (&sig->cred_guard_mutex){+.+.}, at:
prepare_bprm_creds fs/exec.c:1407 [inline]
#0: 000000008e9f7a44 (&sig->cred_guard_mutex){+.+.}, at:
__do_execve_file.isra.0+0x376/0x23f0 fs/exec.c:1750
5 locks held by kworker/u4:3/25989:
#0: 00000000e512596f ((wq_completion)"%s""netns"){+.+.}, at:
__write_once_size include/linux/compiler.h:220 [inline]
#0: 00000000e512596f ((wq_completion)"%s""netns"){+.+.}, at:
arch_atomic64_set arch/x86/include/asm/atomic64_64.h:34 [inline]
#0: 00000000e512596f ((wq_completion)"%s""netns"){+.+.}, at: atomic64_set
include/asm-generic/atomic-instrumented.h:40 [inline]
#0: 00000000e512596f ((wq_completion)"%s""netns"){+.+.}, at:
atomic_long_set include/asm-generic/atomic-long.h:59 [inline]
#0: 00000000e512596f ((wq_completion)"%s""netns"){+.+.}, at: set_work_data
kernel/workqueue.c:617 [inline]
#0: 00000000e512596f ((wq_completion)"%s""netns"){+.+.}, at:
set_work_pool_and_clear_pending kernel/workqueue.c:644 [inline]
#0: 00000000e512596f ((wq_completion)"%s""netns"){+.+.}, at:
process_one_work+0x87e/0x1790 kernel/workqueue.c:2144
#1: 00000000d6c01503 (net_cleanup_work){+.+.}, at:
process_one_work+0x8b4/0x1790 kernel/workqueue.c:2148
#2: 000000005ef07189 (pernet_ops_rwsem){++++}, at: cleanup_net+0xae/0x960
net/core/net_namespace.c:518
#3: 00000000a64a1703 (rtnl_mutex){+.+.}, at: rtnl_lock+0x17/0x20
net/core/rtnetlink.c:77
#4: 000000007f9e135c (rcu_state.exp_mutex){+.+.}, at: exp_funnel_lock
kernel/rcu/tree_exp.h:296 [inline]
#4: 000000007f9e135c (rcu_state.exp_mutex){+.+.}, at:
_synchronize_rcu_expedited.constprop.0+0x42a/0x530 kernel/rcu/tree_exp.h:622
2 locks held by syz-executor.1/32467:
#0: 0000000091604586 (&sb->s_type->i_mutex_key#11){+.+.}, at: inode_lock
include/linux/fs.h:757 [inline]
#0: 0000000091604586 (&sb->s_type->i_mutex_key#11){+.+.}, at:
__sock_release+0x89/0x250 net/socket.c:578
#1: 000000005ef07189 (pernet_ops_rwsem){++++}, at:
unregister_netdevice_notifier+0x7e/0x3a0 net/core/dev.c:1703
2 locks held by syz-executor.5/32470:
#0: 00000000a53c9e1d (&sb->s_type->i_mutex_key#11){+.+.}, at: inode_lock
include/linux/fs.h:757 [inline]
#0: 00000000a53c9e1d (&sb->s_type->i_mutex_key#11){+.+.}, at:
__sock_release+0x89/0x250 net/socket.c:578
#1: 000000005ef07189 (pernet_ops_rwsem){++++}, at:
unregister_netdevice_notifier+0x7e/0x3a0 net/core/dev.c:1703
2 locks held by syz-executor.0/32475:
#0: 000000005169c482 (&sb->s_type->i_mutex_key#11){+.+.}, at: inode_lock
include/linux/fs.h:757 [inline]
#0: 000000005169c482 (&sb->s_type->i_mutex_key#11){+.+.}, at:
__sock_release+0x89/0x250 net/socket.c:578
#1: 000000005ef07189 (pernet_ops_rwsem){++++}, at:
unregister_netdevice_notifier+0x7e/0x3a0 net/core/dev.c:1703
1 lock held by syz-executor.3/32481:
#0: 000000005ef07189 (pernet_ops_rwsem){++++}, at:
register_netdevice_notifier+0x7e/0x630 net/core/dev.c:1634
1 lock held by syz-executor.2/32495:
#0: 000000005ef07189 (pernet_ops_rwsem){++++}, at: copy_net_ns+0x1ba/0x340
net/core/net_namespace.c:433
=============================================
NMI backtrace for cpu 1
CPU: 1 PID: 1039 Comm: khungtaskd Not tainted 5.0.0-rc6+ #69
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x172/0x1f0 lib/dump_stack.c:113
nmi_cpu_backtrace.cold+0x63/0xa4 lib/nmi_backtrace.c:101
nmi_trigger_cpumask_backtrace+0x1be/0x236 lib/nmi_backtrace.c:62
arch_trigger_cpumask_backtrace+0x14/0x20 arch/x86/kernel/apic/hw_nmi.c:38
trigger_all_cpu_backtrace include/linux/nmi.h:146 [inline]
check_hung_uninterruptible_tasks kernel/hung_task.c:203 [inline]
watchdog+0x9df/0xee0 kernel/hung_task.c:287
kthread+0x357/0x430 kernel/kthread.c:246
ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:352
Sending NMI from CPU 1 to CPUs 0:
NMI backtrace for cpu 0
CPU: 0 PID: 3867 Comm: udevd Not tainted 5.0.0-rc6+ #69
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
RIP: 0010:pvclock_scale_delta arch/x86/include/asm/pvclock.h:68 [inline]
RIP: 0010:__pvclock_read_cycles arch/x86/include/asm/pvclock.h:85 [inline]
RIP: 0010:pvclock_clocksource_read+0x1b2/0x4d0 arch/x86/kernel/pvclock.c:87
Code: 89 d9 48 89 c2 48 8b 7d a8 4c 89 d6 f7 d9 48 d3 ea 44 89 d9 48 d3 e0
45 85 db 48 0f 48 c2 8b 53 18 83 e6 07 48 89 f9 48 f7 e2 <48> 0f ac d0 20
4c 89 d2 48 c1 e9 03 48 c1 ea 03 42 0f b6 0c 21 42
RSP: 0018:ffff888098037bb8 EFLAGS: 00000a07
RAX: 51a81ae58ed2e6ca RBX: ffffffff89997000 RCX: ffffffff89997017
RDX: 0000000000000287 RSI: 0000000000000000 RDI: ffffffff89997017
RBP: ffff888098037c40 R08: ffffffff8999701c R09: ffffffff89997008
R10: ffffffff89997010 R11: 00000000ffffffff R12: dffffc0000000000
R13: ffffffff89997003 R14: fffffbfff1332e01 R15: ffffffff8999701d
FS: 00007ff1ce5b57a0(0000) GS:ffff8880ae800000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000000c428a8f000 CR3: 0000000098cb6000 CR4: 00000000001406f0
DR0: 00000000200001c0 DR1: 00000000200001c0 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000600
Call Trace:
kvm_clock_read+0x18/0x30 arch/x86/kernel/kvmclock.c:90
kvm_clock_get_cycles+0x9/0x10 arch/x86/kernel/kvmclock.c:97
tk_clock_read kernel/time/timekeeping.c:167 [inline]
timekeeping_get_delta kernel/time/timekeeping.c:261 [inline]
timekeeping_get_ns kernel/time/timekeeping.c:368 [inline]
ktime_get_ts64+0x1b0/0x3f0 kernel/time/timekeeping.c:885
ep_set_mstimeout fs/eventpoll.c:1726 [inline]
ep_poll+0x36a/0xe50 fs/eventpoll.c:1759
do_epoll_wait+0x1b3/0x200 fs/eventpoll.c:2216
__do_sys_epoll_wait fs/eventpoll.c:2226 [inline]
__se_sys_epoll_wait fs/eventpoll.c:2223 [inline]
__x64_sys_epoll_wait+0x97/0xf0 fs/eventpoll.c:2223
do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x7ff1cdcc9943
Code: 00 31 d2 48 29 c2 64 89 11 48 83 c8 ff eb ea 90 90 90 90 90 90 90 90
83 3d b5 dc 2a 00 00 75 13 49 89 ca b8 e8 00 00 00 0f 05 <48> 3d 01 f0 ff
ff 73 34 c3 48 83 ec 08 e8 3b c4 00 00 48 89 04 24
RSP: 002b:00007ffe9afc6838 EFLAGS: 00000246 ORIG_RAX: 00000000000000e8
RAX: ffffffffffffffda RBX: 0000000000000bb8 RCX: 00007ff1cdcc9943
RDX: 0000000000000008 RSI: 00007ffe9afc6930 RDI: 000000000000000a
RBP: 0000000000000001 R08: 0000000000000000 R09: 0000000000000001
R10: 0000000000000bb8 R11: 0000000000000246 R12: 0000000000000003
R13: 0000000000000000 R14: 0000000001c4c770 R15: 0000000001c49250
---
This bug is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@googlegroups.com.
syzbot will keep track of this bug report. See:
https://goo.gl/tpsmEJ#bug-status-tracking for how to communicate with
syzbot.
^ permalink raw reply
* Re: [PATCH net-next 2/4] net: phy: add genphy_c45_an_config_an
From: Heiner Kallweit @ 2019-02-17 8:14 UTC (permalink / raw)
To: Andrew Lunn, Florian Fainelli
Cc: David Miller, Russell King - ARM Linux, netdev@vger.kernel.org
In-Reply-To: <20190217041833.GU5699@lunn.ch>
On 17.02.2019 05:18, Andrew Lunn wrote:
> On Sat, Feb 16, 2019 at 06:44:24PM -0800, Florian Fainelli wrote:
>>
>>
>> On 2/16/2019 11:51 AM, Heiner Kallweit wrote:
>>> From: Andrew Lunn <andrew@lunn.ch>
>>> C45 configuration of 10/100 and multi-giga bit auto negotiation
>>> advertisement is standardized. Configuration of 1000Base-T however
>>> appears to be vendor specific. Move the generic code out of the
>>> Marvell driver into the common phy-c45.c file.
>>>
>>> Signed-off-by: Andrew Lunn <andrew@lunn.ch>
>>> [hkallweit1@gmail.com: use new helper linkmode_adv_to_mii_10gbt_adv_t and split patch]
>>> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
>>> ---
>>> drivers/net/phy/phy-c45.c | 44 +++++++++++++++++++++++++++++++++++++++
>>> include/linux/phy.h | 1 +
>>> 2 files changed, 45 insertions(+)
>>>
>>> diff --git a/drivers/net/phy/phy-c45.c b/drivers/net/phy/phy-c45.c
>>> index 0374c50b1..bea1b0c6e 100644
>>> --- a/drivers/net/phy/phy-c45.c
>>> +++ b/drivers/net/phy/phy-c45.c
>>> @@ -78,6 +78,50 @@ int genphy_c45_pma_setup_forced(struct phy_device *phydev)
>>> }
>>> EXPORT_SYMBOL_GPL(genphy_c45_pma_setup_forced);
>>>
>>> +/**
>>> + * genphy_c45_an_config_an - configure advertisement registers
>>
>> Nit: are not the two "an" redundant" here? Unless the first one means
>> something different in which case naming this:
>> genphy_c45_an_config_aneg() would be clearer?
>
> Hi Florian
>
> Heiner and I had a brief discussion about this. There is a general
> trend in the naming to have the device name in the function name. So
> genphy_c45_pma_setup_forced uses the PMA device registers,
> genphy_c45_an_disable_aneg uses the AN device registers, etc.
>
> However, genphy_c45_an_config_aneg() might be better.
>
Good, then I'll prepare an update with the changed name.
> Andrew
>
Heiner
^ permalink raw reply
* [PATCH net-next v2 0/4] net: phy: add and use genphy_c45_an_config_an
From: Heiner Kallweit @ 2019-02-17 8:35 UTC (permalink / raw)
To: Andrew Lunn, Florian Fainelli, David Miller,
Russell King - ARM Linux
Cc: netdev@vger.kernel.org
This series adds genphy_c45_an_config_an() and uses it in the
marvell10g diver. In addition patch 4 aligns the aneg configuration
with what is done in genphy_config_aneg().
v2:
- in patch 2 changed function name to genphy_c45_an_config_aneg
- in patch 3 add a comment regarding 1000BaseT vendor registers
Andrew Lunn (2):
net: phy: add genphy_c45_an_config_an
net: phy: marvell10g: use genphy_c45_an_config_aneg
Heiner Kallweit (2):
net: phy: add helper linkmode_adv_to_mii_10gbt_adv_t
net: phy: marvell10g: check for newly set aneg
drivers/net/phy/marvell10g.c | 31 ++++++++++---------------
drivers/net/phy/phy-c45.c | 44 ++++++++++++++++++++++++++++++++++++
include/linux/mdio.h | 25 ++++++++++++++++++++
include/linux/phy.h | 1 +
4 files changed, 82 insertions(+), 19 deletions(-)
--
2.20.1
^ permalink raw reply
* [PATCH net-next v2 1/4] net: phy: add helper linkmode_adv_to_mii_10gbt_adv_t
From: Heiner Kallweit @ 2019-02-17 8:36 UTC (permalink / raw)
To: Andrew Lunn, Florian Fainelli, David Miller,
Russell King - ARM Linux
Cc: netdev@vger.kernel.org
In-Reply-To: <ad6530be-336a-1ede-e6d8-e2a016a8d43f@gmail.com>
Add a helper linkmode_adv_to_mii_10gbt_adv_t(), similar to
linkmode_adv_to_mii_adv_t.
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
---
include/linux/mdio.h | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/include/linux/mdio.h b/include/linux/mdio.h
index 5b872c45f..5a65f32d8 100644
--- a/include/linux/mdio.h
+++ b/include/linux/mdio.h
@@ -280,6 +280,31 @@ static inline void mii_10gbt_stat_mod_linkmode_lpa_t(unsigned long *advertising,
advertising, lpa & MDIO_AN_10GBT_STAT_LP10G);
}
+/**
+ * linkmode_adv_to_mii_10gbt_adv_t
+ * @advertising: the linkmode advertisement settings
+ *
+ * A small helper function that translates linkmode advertisement
+ * settings to phy autonegotiation advertisements for the C45
+ * 10GBASE-T AN CONTROL (7.32) register.
+ */
+static inline u32 linkmode_adv_to_mii_10gbt_adv_t(unsigned long *advertising)
+{
+ u32 result = 0;
+
+ if (linkmode_test_bit(ETHTOOL_LINK_MODE_2500baseT_Full_BIT,
+ advertising))
+ result |= MDIO_AN_10GBT_CTRL_ADV2_5G;
+ if (linkmode_test_bit(ETHTOOL_LINK_MODE_5000baseT_Full_BIT,
+ advertising))
+ result |= MDIO_AN_10GBT_CTRL_ADV5G;
+ if (linkmode_test_bit(ETHTOOL_LINK_MODE_10000baseT_Full_BIT,
+ advertising))
+ result |= MDIO_AN_10GBT_CTRL_ADV10G;
+
+ return result;
+}
+
int __mdiobus_read(struct mii_bus *bus, int addr, u32 regnum);
int __mdiobus_write(struct mii_bus *bus, int addr, u32 regnum, u16 val);
--
2.20.1
^ permalink raw reply related
* [PATCH net-next v2 2/4] net: phy: add genphy_c45_an_config_aneg
From: Heiner Kallweit @ 2019-02-17 8:37 UTC (permalink / raw)
To: Andrew Lunn, Florian Fainelli, David Miller,
Russell King - ARM Linux
Cc: netdev@vger.kernel.org
In-Reply-To: <ad6530be-336a-1ede-e6d8-e2a016a8d43f@gmail.com>
From: Andrew Lunn <andrew@lunn.ch>
C45 configuration of 10/100 and multi-giga bit auto negotiation
advertisement is standardized. Configuration of 1000Base-T however
appears to be vendor specific. Move the generic code out of the
Marvell driver into the common phy-c45.c file.
v2:
- change function name to genphy_c45_an_config_aneg
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
[hkallweit1@gmail.com: use new helper linkmode_adv_to_mii_10gbt_adv_t and split patch]
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/phy/phy-c45.c | 44 +++++++++++++++++++++++++++++++++++++++
include/linux/phy.h | 1 +
2 files changed, 45 insertions(+)
diff --git a/drivers/net/phy/phy-c45.c b/drivers/net/phy/phy-c45.c
index 98a04d4cd..16636d49b 100644
--- a/drivers/net/phy/phy-c45.c
+++ b/drivers/net/phy/phy-c45.c
@@ -78,6 +78,50 @@ int genphy_c45_pma_setup_forced(struct phy_device *phydev)
}
EXPORT_SYMBOL_GPL(genphy_c45_pma_setup_forced);
+/**
+ * genphy_c45_an_config_aneg - configure advertisement registers
+ * @phydev: target phy_device struct
+ *
+ * Configure advertisement registers based on modes set in phydev->advertising
+ *
+ * Returns negative errno code on failure, 0 if advertisement didn't change,
+ * or 1 if advertised modes changed.
+ */
+int genphy_c45_an_config_aneg(struct phy_device *phydev)
+{
+ int changed = 0, ret;
+ u32 adv;
+
+ linkmode_and(phydev->advertising, phydev->advertising,
+ phydev->supported);
+
+ adv = linkmode_adv_to_mii_adv_t(phydev->advertising);
+
+ ret = phy_modify_mmd(phydev, MDIO_MMD_AN, MDIO_AN_ADVERTISE,
+ ADVERTISE_ALL | ADVERTISE_100BASE4 |
+ ADVERTISE_PAUSE_CAP | ADVERTISE_PAUSE_ASYM,
+ adv);
+ if (ret < 0)
+ return ret;
+ if (ret > 0)
+ changed = 1;
+
+ adv = linkmode_adv_to_mii_10gbt_adv_t(phydev->advertising);
+
+ ret = phy_modify_mmd(phydev, MDIO_MMD_AN, MDIO_AN_10GBT_CTRL,
+ MDIO_AN_10GBT_CTRL_ADV10G |
+ MDIO_AN_10GBT_CTRL_ADV5G |
+ MDIO_AN_10GBT_CTRL_ADV2_5G,
+ adv);
+ if (ret < 0)
+ return ret;
+ if (ret > 0)
+ changed = 1;
+
+ return changed;
+}
+EXPORT_SYMBOL_GPL(genphy_c45_an_config_aneg);
+
/**
* genphy_c45_an_disable_aneg - disable auto-negotiation
* @phydev: target phy_device struct
diff --git a/include/linux/phy.h b/include/linux/phy.h
index bf1070c2a..3db507e68 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -1101,6 +1101,7 @@ int genphy_c45_read_link(struct phy_device *phydev);
int genphy_c45_read_lpa(struct phy_device *phydev);
int genphy_c45_read_pma(struct phy_device *phydev);
int genphy_c45_pma_setup_forced(struct phy_device *phydev);
+int genphy_c45_an_config_aneg(struct phy_device *phydev);
int genphy_c45_an_disable_aneg(struct phy_device *phydev);
int genphy_c45_read_mdix(struct phy_device *phydev);
int genphy_c45_pma_read_abilities(struct phy_device *phydev);
--
2.20.1
^ permalink raw reply related
* [PATCH net-next v2 3/4] net: phy: marvell10g: use genphy_c45_an_config_aneg
From: Heiner Kallweit @ 2019-02-17 8:39 UTC (permalink / raw)
To: Andrew Lunn, Florian Fainelli, David Miller,
Russell King - ARM Linux
Cc: netdev@vger.kernel.org
In-Reply-To: <ad6530be-336a-1ede-e6d8-e2a016a8d43f@gmail.com>
From: Andrew Lunn <andrew@lunn.ch>
Use new function genphy_c45_config_aneg() in mv3310_config_aneg().
v2:
- add a comment regarding 1000BaseT vendor registers
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
[hkallweit1@gmail.com: patch splitted]
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
drivers/net/phy/marvell10g.c | 25 ++++---------------------
1 file changed, 4 insertions(+), 21 deletions(-)
diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c
index 496805c0d..895574083 100644
--- a/drivers/net/phy/marvell10g.c
+++ b/drivers/net/phy/marvell10g.c
@@ -279,18 +279,15 @@ static int mv3310_config_aneg(struct phy_device *phydev)
return genphy_c45_an_disable_aneg(phydev);
}
- linkmode_and(phydev->advertising, phydev->advertising,
- phydev->supported);
-
- ret = phy_modify_mmd_changed(phydev, MDIO_MMD_AN, MDIO_AN_ADVERTISE,
- ADVERTISE_ALL | ADVERTISE_100BASE4 |
- ADVERTISE_PAUSE_CAP | ADVERTISE_PAUSE_ASYM,
- linkmode_adv_to_mii_adv_t(phydev->advertising));
+ ret = genphy_c45_an_config_aneg(phydev);
if (ret < 0)
return ret;
if (ret > 0)
changed = true;
+ /* Clause 45 has no standardized support for 1000BaseT, therefore
+ * use vendor registers for this mode.
+ */
reg = linkmode_adv_to_mii_ctrl1000_t(phydev->advertising);
ret = phy_modify_mmd_changed(phydev, MDIO_MMD_AN, MV_AN_CTRL1000,
ADVERTISE_1000FULL | ADVERTISE_1000HALF, reg);
@@ -299,20 +296,6 @@ static int mv3310_config_aneg(struct phy_device *phydev)
if (ret > 0)
changed = true;
- /* 10G control register */
- if (linkmode_test_bit(ETHTOOL_LINK_MODE_10000baseT_Full_BIT,
- phydev->advertising))
- reg = MDIO_AN_10GBT_CTRL_ADV10G;
- else
- reg = 0;
-
- ret = phy_modify_mmd_changed(phydev, MDIO_MMD_AN, MDIO_AN_10GBT_CTRL,
- MDIO_AN_10GBT_CTRL_ADV10G, reg);
- if (ret < 0)
- return ret;
- if (ret > 0)
- changed = true;
-
if (changed)
ret = genphy_c45_restart_aneg(phydev);
--
2.20.1
^ permalink raw reply related
* [PATCH net-next v2 4/4] net: phy: marvell10g: check for newly set aneg
From: Heiner Kallweit @ 2019-02-17 8:40 UTC (permalink / raw)
To: Andrew Lunn, Florian Fainelli, David Miller,
Russell King - ARM Linux
Cc: netdev@vger.kernel.org
In-Reply-To: <ad6530be-336a-1ede-e6d8-e2a016a8d43f@gmail.com>
Even if the advertisement registers content didn't change, we may have
just switched to aneg, and therefore have to trigger an aneg restart.
This matches the behavior of genphy_config_aneg().
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/phy/marvell10g.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c
index 895574083..b83eb19cf 100644
--- a/drivers/net/phy/marvell10g.c
+++ b/drivers/net/phy/marvell10g.c
@@ -296,6 +296,16 @@ static int mv3310_config_aneg(struct phy_device *phydev)
if (ret > 0)
changed = true;
+ if (!changed) {
+ /* Configure and restart aneg if it wasn't set before */
+ ret = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_CTRL1);
+ if (ret < 0)
+ return ret;
+
+ if (!(ret & MDIO_AN_CTRL1_ENABLE))
+ changed = 1;
+ }
+
if (changed)
ret = genphy_c45_restart_aneg(phydev);
--
2.20.1
^ permalink raw reply related
* Re: [PATCH net-next v2 0/4] net: phy: add and use genphy_c45_an_config_an
From: Heiner Kallweit @ 2019-02-17 9:26 UTC (permalink / raw)
To: Andrew Lunn, Florian Fainelli, David Miller,
Russell King - ARM Linux
Cc: netdev@vger.kernel.org
In-Reply-To: <ad6530be-336a-1ede-e6d8-e2a016a8d43f@gmail.com>
On 17.02.2019 09:35, Heiner Kallweit wrote:
> This series adds genphy_c45_an_config_an() and uses it in the
> marvell10g diver. In addition patch 4 aligns the aneg configuration
> with what is done in genphy_config_aneg().
>
> v2:
> - in patch 2 changed function name to genphy_c45_an_config_aneg
> - in patch 3 add a comment regarding 1000BaseT vendor registers
>
> Andrew Lunn (2):
> net: phy: add genphy_c45_an_config_an
> net: phy: marvell10g: use genphy_c45_an_config_aneg
>
> Heiner Kallweit (2):
> net: phy: add helper linkmode_adv_to_mii_10gbt_adv_t
> net: phy: marvell10g: check for newly set aneg
>
> drivers/net/phy/marvell10g.c | 31 ++++++++++---------------
> drivers/net/phy/phy-c45.c | 44 ++++++++++++++++++++++++++++++++++++
> include/linux/mdio.h | 25 ++++++++++++++++++++
> include/linux/phy.h | 1 +
> 4 files changed, 82 insertions(+), 19 deletions(-)
>
Forgot to rebase patch 3 what's needed due to another pending patch.
Will send a v3.
^ permalink raw reply
* [PATCH net-next v3 0/4] net: phy: add and use genphy_c45_an_config_an
From: Heiner Kallweit @ 2019-02-17 9:27 UTC (permalink / raw)
To: Andrew Lunn, Florian Fainelli, David Miller,
Russell King - ARM Linux
Cc: netdev@vger.kernel.org
This series adds genphy_c45_an_config_an() and uses it in the
marvell10g diver. In addition patch 4 aligns the aneg configuration
with what is done in genphy_config_aneg().
v2:
- in patch 2 changed function name to genphy_c45_an_config_aneg
- in patch 3 add a comment regarding 1000BaseT vendor registers
v3:
- rebase patch 3
Andrew Lunn (2):
net: phy: add genphy_c45_an_config_an
net: phy: marvell10g: use genphy_c45_an_config_aneg
Heiner Kallweit (2):
net: phy: add helper linkmode_adv_to_mii_10gbt_adv_t
net: phy: marvell10g: check for newly set aneg
drivers/net/phy/marvell10g.c | 31 ++++++++++---------------
drivers/net/phy/phy-c45.c | 44 ++++++++++++++++++++++++++++++++++++
include/linux/mdio.h | 25 ++++++++++++++++++++
include/linux/phy.h | 1 +
4 files changed, 82 insertions(+), 19 deletions(-)
--
2.20.1
^ permalink raw reply
* [PATCH net-next v3 1/4] net: phy: add helper linkmode_adv_to_mii_10gbt_adv_t
From: Heiner Kallweit @ 2019-02-17 9:28 UTC (permalink / raw)
To: Andrew Lunn, Florian Fainelli, David Miller,
Russell King - ARM Linux
Cc: netdev@vger.kernel.org
In-Reply-To: <46898fe1-8924-0da0-1bbd-b54c220ff8d1@gmail.com>
Add a helper linkmode_adv_to_mii_10gbt_adv_t(), similar to
linkmode_adv_to_mii_adv_t.
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
---
include/linux/mdio.h | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/include/linux/mdio.h b/include/linux/mdio.h
index 5b872c45f..5a65f32d8 100644
--- a/include/linux/mdio.h
+++ b/include/linux/mdio.h
@@ -280,6 +280,31 @@ static inline void mii_10gbt_stat_mod_linkmode_lpa_t(unsigned long *advertising,
advertising, lpa & MDIO_AN_10GBT_STAT_LP10G);
}
+/**
+ * linkmode_adv_to_mii_10gbt_adv_t
+ * @advertising: the linkmode advertisement settings
+ *
+ * A small helper function that translates linkmode advertisement
+ * settings to phy autonegotiation advertisements for the C45
+ * 10GBASE-T AN CONTROL (7.32) register.
+ */
+static inline u32 linkmode_adv_to_mii_10gbt_adv_t(unsigned long *advertising)
+{
+ u32 result = 0;
+
+ if (linkmode_test_bit(ETHTOOL_LINK_MODE_2500baseT_Full_BIT,
+ advertising))
+ result |= MDIO_AN_10GBT_CTRL_ADV2_5G;
+ if (linkmode_test_bit(ETHTOOL_LINK_MODE_5000baseT_Full_BIT,
+ advertising))
+ result |= MDIO_AN_10GBT_CTRL_ADV5G;
+ if (linkmode_test_bit(ETHTOOL_LINK_MODE_10000baseT_Full_BIT,
+ advertising))
+ result |= MDIO_AN_10GBT_CTRL_ADV10G;
+
+ return result;
+}
+
int __mdiobus_read(struct mii_bus *bus, int addr, u32 regnum);
int __mdiobus_write(struct mii_bus *bus, int addr, u32 regnum, u16 val);
--
2.20.1
^ permalink raw reply related
* [PATCH net-next v3 2/4] net: phy: add genphy_c45_an_config_aneg
From: Heiner Kallweit @ 2019-02-17 9:29 UTC (permalink / raw)
To: Andrew Lunn, Florian Fainelli, David Miller,
Russell King - ARM Linux
Cc: netdev@vger.kernel.org
In-Reply-To: <46898fe1-8924-0da0-1bbd-b54c220ff8d1@gmail.com>
From: Andrew Lunn <andrew@lunn.ch>
C45 configuration of 10/100 and multi-giga bit auto negotiation
advertisement is standardized. Configuration of 1000Base-T however
appears to be vendor specific. Move the generic code out of the
Marvell driver into the common phy-c45.c file.
v2:
- change function name to genphy_c45_an_config_aneg
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
[hkallweit1@gmail.com: use new helper linkmode_adv_to_mii_10gbt_adv_t and split patch]
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/phy/phy-c45.c | 44 +++++++++++++++++++++++++++++++++++++++
include/linux/phy.h | 1 +
2 files changed, 45 insertions(+)
diff --git a/drivers/net/phy/phy-c45.c b/drivers/net/phy/phy-c45.c
index 98a04d4cd..16636d49b 100644
--- a/drivers/net/phy/phy-c45.c
+++ b/drivers/net/phy/phy-c45.c
@@ -78,6 +78,50 @@ int genphy_c45_pma_setup_forced(struct phy_device *phydev)
}
EXPORT_SYMBOL_GPL(genphy_c45_pma_setup_forced);
+/**
+ * genphy_c45_an_config_aneg - configure advertisement registers
+ * @phydev: target phy_device struct
+ *
+ * Configure advertisement registers based on modes set in phydev->advertising
+ *
+ * Returns negative errno code on failure, 0 if advertisement didn't change,
+ * or 1 if advertised modes changed.
+ */
+int genphy_c45_an_config_aneg(struct phy_device *phydev)
+{
+ int changed = 0, ret;
+ u32 adv;
+
+ linkmode_and(phydev->advertising, phydev->advertising,
+ phydev->supported);
+
+ adv = linkmode_adv_to_mii_adv_t(phydev->advertising);
+
+ ret = phy_modify_mmd(phydev, MDIO_MMD_AN, MDIO_AN_ADVERTISE,
+ ADVERTISE_ALL | ADVERTISE_100BASE4 |
+ ADVERTISE_PAUSE_CAP | ADVERTISE_PAUSE_ASYM,
+ adv);
+ if (ret < 0)
+ return ret;
+ if (ret > 0)
+ changed = 1;
+
+ adv = linkmode_adv_to_mii_10gbt_adv_t(phydev->advertising);
+
+ ret = phy_modify_mmd(phydev, MDIO_MMD_AN, MDIO_AN_10GBT_CTRL,
+ MDIO_AN_10GBT_CTRL_ADV10G |
+ MDIO_AN_10GBT_CTRL_ADV5G |
+ MDIO_AN_10GBT_CTRL_ADV2_5G,
+ adv);
+ if (ret < 0)
+ return ret;
+ if (ret > 0)
+ changed = 1;
+
+ return changed;
+}
+EXPORT_SYMBOL_GPL(genphy_c45_an_config_aneg);
+
/**
* genphy_c45_an_disable_aneg - disable auto-negotiation
* @phydev: target phy_device struct
diff --git a/include/linux/phy.h b/include/linux/phy.h
index bf1070c2a..3db507e68 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -1101,6 +1101,7 @@ int genphy_c45_read_link(struct phy_device *phydev);
int genphy_c45_read_lpa(struct phy_device *phydev);
int genphy_c45_read_pma(struct phy_device *phydev);
int genphy_c45_pma_setup_forced(struct phy_device *phydev);
+int genphy_c45_an_config_aneg(struct phy_device *phydev);
int genphy_c45_an_disable_aneg(struct phy_device *phydev);
int genphy_c45_read_mdix(struct phy_device *phydev);
int genphy_c45_pma_read_abilities(struct phy_device *phydev);
--
2.20.1
^ permalink raw reply related
* [PATCH net-next v3 3/4] net: phy: marvell10g: use genphy_c45_an_config_aneg
From: Heiner Kallweit @ 2019-02-17 9:30 UTC (permalink / raw)
To: Andrew Lunn, Florian Fainelli, David Miller,
Russell King - ARM Linux
Cc: netdev@vger.kernel.org
In-Reply-To: <46898fe1-8924-0da0-1bbd-b54c220ff8d1@gmail.com>
From: Andrew Lunn <andrew@lunn.ch>
Use new function genphy_c45_config_aneg() in mv3310_config_aneg().
v2:
- add a comment regarding 1000BaseT vendor registers
v3:
- rebased
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
[hkallweit1@gmail.com: patch splitted]
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
drivers/net/phy/marvell10g.c | 25 ++++---------------------
1 file changed, 4 insertions(+), 21 deletions(-)
diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c
index 4a6ae63ab..b7742799c 100644
--- a/drivers/net/phy/marvell10g.c
+++ b/drivers/net/phy/marvell10g.c
@@ -274,18 +274,15 @@ static int mv3310_config_aneg(struct phy_device *phydev)
if (phydev->autoneg == AUTONEG_DISABLE)
return genphy_c45_pma_setup_forced(phydev);
- linkmode_and(phydev->advertising, phydev->advertising,
- phydev->supported);
-
- ret = phy_modify_mmd_changed(phydev, MDIO_MMD_AN, MDIO_AN_ADVERTISE,
- ADVERTISE_ALL | ADVERTISE_100BASE4 |
- ADVERTISE_PAUSE_CAP | ADVERTISE_PAUSE_ASYM,
- linkmode_adv_to_mii_adv_t(phydev->advertising));
+ ret = genphy_c45_an_config_aneg(phydev);
if (ret < 0)
return ret;
if (ret > 0)
changed = true;
+ /* Clause 45 has no standardized support for 1000BaseT, therefore
+ * use vendor registers for this mode.
+ */
reg = linkmode_adv_to_mii_ctrl1000_t(phydev->advertising);
ret = phy_modify_mmd_changed(phydev, MDIO_MMD_AN, MV_AN_CTRL1000,
ADVERTISE_1000FULL | ADVERTISE_1000HALF, reg);
@@ -294,20 +291,6 @@ static int mv3310_config_aneg(struct phy_device *phydev)
if (ret > 0)
changed = true;
- /* 10G control register */
- if (linkmode_test_bit(ETHTOOL_LINK_MODE_10000baseT_Full_BIT,
- phydev->advertising))
- reg = MDIO_AN_10GBT_CTRL_ADV10G;
- else
- reg = 0;
-
- ret = phy_modify_mmd_changed(phydev, MDIO_MMD_AN, MDIO_AN_10GBT_CTRL,
- MDIO_AN_10GBT_CTRL_ADV10G, reg);
- if (ret < 0)
- return ret;
- if (ret > 0)
- changed = true;
-
if (changed)
ret = genphy_c45_restart_aneg(phydev);
--
2.20.1
^ permalink raw reply related
* [PATCH net-next v3 4/4] net: phy: marvell10g: check for newly set aneg
From: Heiner Kallweit @ 2019-02-17 9:32 UTC (permalink / raw)
To: Andrew Lunn, Florian Fainelli, David Miller,
Russell King - ARM Linux
Cc: netdev@vger.kernel.org
In-Reply-To: <46898fe1-8924-0da0-1bbd-b54c220ff8d1@gmail.com>
Even if the advertisement registers content didn't change, we may have
just switched to aneg, and therefore have to trigger an aneg restart.
This matches the behavior of genphy_config_aneg().
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/phy/marvell10g.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c
index 895574083..b83eb19cf 100644
--- a/drivers/net/phy/marvell10g.c
+++ b/drivers/net/phy/marvell10g.c
@@ -296,6 +296,16 @@ static int mv3310_config_aneg(struct phy_device *phydev)
if (ret > 0)
changed = true;
+ if (!changed) {
+ /* Configure and restart aneg if it wasn't set before */
+ ret = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_CTRL1);
+ if (ret < 0)
+ return ret;
+
+ if (!(ret & MDIO_AN_CTRL1_ENABLE))
+ changed = 1;
+ }
+
if (changed)
ret = genphy_c45_restart_aneg(phydev);
--
2.20.1
^ permalink raw reply related
* Re: [PATCH net-next] igc: Make function igc_write_rss_indir_tbl() static
From: Neftin, Sasha @ 2019-02-17 10:06 UTC (permalink / raw)
To: Wei Yongjun, Jeff Kirsher; +Cc: intel-wired-lan, netdev, kernel-janitors
In-Reply-To: <20190216020442.14206-1-weiyongjun1@huawei.com>
On 2/16/2019 04:04, Wei Yongjun wrote:
> Fixes the following sparse warning:
>
> drivers/net/ethernet/intel/igc/igc_ethtool.c:646:6: warning:
> symbol 'igc_write_rss_indir_tbl' was not declared. Should it be static?
>
> Fixes: 8c5ad0dae93c ("igc: Add ethtool support")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
> drivers/net/ethernet/intel/igc/igc_ethtool.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/intel/igc/igc_ethtool.c b/drivers/net/ethernet/intel/igc/igc_ethtool.c
> index eff37a6c0afa..544239422577 100644
> --- a/drivers/net/ethernet/intel/igc/igc_ethtool.c
> +++ b/drivers/net/ethernet/intel/igc/igc_ethtool.c
> @@ -643,7 +643,7 @@ static int igc_set_coalesce(struct net_device *netdev,
> return 0;
> }
>
> -void igc_write_rss_indir_tbl(struct igc_adapter *adapter)
> +static void igc_write_rss_indir_tbl(struct igc_adapter *adapter)
> {
> struct igc_hw *hw = &adapter->hw;
> u32 reg = IGC_RETA(0);
>
>
> NACK
'igc_write_rss_indir_tbl' method declared in igc.h file. This method
used in both igc_ethtool.c and igc_main.c and can't be a 'static'
^ permalink raw reply
* Re: [PATCH RFC] net: bridge: don't flood known multicast traffic when snooping is enabled
From: Nikolay Aleksandrov @ 2019-02-17 10:58 UTC (permalink / raw)
To: Florian Fainelli, netdev
Cc: roopa, wkok, anuradhak, bridge, linus.luessing, davem, stephen
In-Reply-To: <2bb7baaa-affb-451c-658d-bc5412a14c31@gmail.com>
On 17/02/2019 05:05, Florian Fainelli wrote:
>
>
> On 2/15/2019 5:04 AM, Nikolay Aleksandrov wrote:
>> The behaviour since b00589af3b04 ("bridge: disable snooping if there is
>> no querier") is wrong, we shouldn't be flooding multicast traffic when
>> there is an mdb entry and we know where it should be forwarded to when
>> multicast snooping is enabled. This patch changes the behaviour to not
>> flood known unicast traffic.
>
> You mean multicast traffic in the last part of the sentence, right?
>
Right. The change I wanted to discuss is when there is no querier and we have
a known mdst - forward only to its registered ports. The rest of the traffic
follows the current rules (i.e. no querier - flood unknown mcast). I'll send
an updated RFC version since this patch has issues as noted in the discussion
and we can continue from there.
>> I'll give two obviously broken cases:
>> - most obvious: static mdb created by the user with snooping enabled
>> - user-space daemon controlling the mdb table (e.g. MLAG)
>>
>> Every user would expect to have traffic forwarded only to the configured
>> mdb destination when snooping is enabled, instead now to get that one
>> needs to enable both snooping and querier. Enabling querier on all
>> switches could be problematic and is not a good solution, for example
>> as summarized by our multicast experts:
>> "every switch would send an IGMP query for any random multicast traffic it
>> received across the entire domain and it would send it forever as long as a
>> host exists wanting that stream even if it has no downstream/directly
>> connected receivers"
>>
>> Sending as an RFC to get the discussion going, but I'm strongly for
>> removing this behaviour and would like to send this patch officially.
>>
>> We could make this behaviour possible via a knob if necessary, but
>> it really should not be the default.
>>
>> Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
>> ---
>> net/bridge/br_device.c | 3 +--
>> net/bridge/br_input.c | 3 +--
>> 2 files changed, 2 insertions(+), 4 deletions(-)
>>
>> diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c
>> index 013323b6dbe4..2aa8a6509924 100644
>> --- a/net/bridge/br_device.c
>> +++ b/net/bridge/br_device.c
>> @@ -96,8 +96,7 @@ netdev_tx_t br_dev_xmit(struct sk_buff *skb, struct net_device *dev)
>> }
>>
>> mdst = br_mdb_get(br, skb, vid);
>> - if ((mdst || BR_INPUT_SKB_CB_MROUTERS_ONLY(skb)) &&
>> - br_multicast_querier_exists(br, eth_hdr(skb)))
>> + if (mdst || BR_INPUT_SKB_CB_MROUTERS_ONLY(skb))
>> br_multicast_flood(mdst, skb, false, true);
>> else
>> br_flood(br, skb, BR_PKT_MULTICAST, false, true);
>> diff --git a/net/bridge/br_input.c b/net/bridge/br_input.c
>> index 5ea7e56119c1..aae78095cf67 100644
>> --- a/net/bridge/br_input.c
>> +++ b/net/bridge/br_input.c
>> @@ -136,8 +136,7 @@ int br_handle_frame_finish(struct net *net, struct sock *sk, struct sk_buff *skb
>> switch (pkt_type) {
>> case BR_PKT_MULTICAST:
>> mdst = br_mdb_get(br, skb, vid);
>> - if ((mdst || BR_INPUT_SKB_CB_MROUTERS_ONLY(skb)) &&
>> - br_multicast_querier_exists(br, eth_hdr(skb))) {
>> + if (mdst || BR_INPUT_SKB_CB_MROUTERS_ONLY(skb)) {
>> if ((mdst && mdst->host_joined) ||
>> br_multicast_is_router(br)) {
>> local_rcv = true;
>>
>
^ permalink raw reply
* Re: [Intel-wired-lan] [PATCH net-next] igc: Make function igc_write_rss_indir_tbl() static
From: Neftin, Sasha @ 2019-02-17 10:59 UTC (permalink / raw)
To: Wei Yongjun, Jeff Kirsher; +Cc: netdev, kernel-janitors, intel-wired-lan
In-Reply-To: <6ef2f327-8dc6-4c86-f42d-4aa7508d19f5@intel.com>
On 2/17/2019 12:06, Neftin, Sasha wrote:
> On 2/16/2019 04:04, Wei Yongjun wrote:
>> Fixes the following sparse warning:
>>
>> drivers/net/ethernet/intel/igc/igc_ethtool.c:646:6: warning:
>> symbol 'igc_write_rss_indir_tbl' was not declared. Should it be static?
>>
>> Fixes: 8c5ad0dae93c ("igc: Add ethtool support")
>> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
>> ---
>> drivers/net/ethernet/intel/igc/igc_ethtool.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/ethernet/intel/igc/igc_ethtool.c
>> b/drivers/net/ethernet/intel/igc/igc_ethtool.c
>> index eff37a6c0afa..544239422577 100644
>> --- a/drivers/net/ethernet/intel/igc/igc_ethtool.c
>> +++ b/drivers/net/ethernet/intel/igc/igc_ethtool.c
>> @@ -643,7 +643,7 @@ static int igc_set_coalesce(struct net_device
>> *netdev,
>> return 0;
>> }
>> -void igc_write_rss_indir_tbl(struct igc_adapter *adapter)
>> +static void igc_write_rss_indir_tbl(struct igc_adapter *adapter)
>> {
>> struct igc_hw *hw = &adapter->hw;
>> u32 reg = IGC_RETA(0);
>>
>>
>> NACK
> 'igc_write_rss_indir_tbl' method declared in igc.h file. This method
> used in both igc_ethtool.c and igc_main.c and can't be a 'static'
> __
please, refer to commit 429abdf0cd3c... (Add multiple receive queues
control supporting)
_____________________________________________
> Intel-wired-lan mailing list
> Intel-wired-lan@osuosl.org
> https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
^ permalink raw reply
* [PATCH mlx5-next v1] net/mlx5: Factor out HCA capabilities functions
From: Leon Romanovsky @ 2019-02-17 11:11 UTC (permalink / raw)
To: Doug Ledford, Jason Gunthorpe
Cc: Leon Romanovsky, RDMA mailing list, Saeed Mahameed, linux-netdev
From: Leon Romanovsky <leonro@mellanox.com>
Combine all HCA capabilities setters under one function
and compile out the ODP related function in case kernel
was compiled without ODP support.
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
...
Changelog v0->v1:
* Embedded config option check into ODP capability function flow
---
.../net/ethernet/mellanox/mlx5/core/main.c | 46 +++++++++++++------
1 file changed, 31 insertions(+), 15 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c
index 6d45518edbdc..025dfaf3466b 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c
@@ -466,7 +466,8 @@ static int handle_hca_cap_odp(struct mlx5_core_dev *dev)
int set_sz;
int err;
- if (!MLX5_CAP_GEN(dev, pg))
+ if (!IS_ENABLED(CONFIG_INFINIBAND_ON_DEMAND_PAGING) ||
+ !MLX5_CAP_GEN(dev, pg))
return 0;
err = mlx5_core_get_caps(dev, MLX5_CAP_ODP);
@@ -576,6 +577,33 @@ static int handle_hca_cap(struct mlx5_core_dev *dev)
return err;
}
+static int set_hca_cap(struct mlx5_core_dev *dev)
+{
+ struct pci_dev *pdev = dev->pdev;
+ int err;
+
+ err = handle_hca_cap(dev);
+ if (err) {
+ dev_err(&pdev->dev, "handle_hca_cap failed\n");
+ goto out;
+ }
+
+ err = handle_hca_cap_atomic(dev);
+ if (err) {
+ dev_err(&pdev->dev, "handle_hca_cap_atomic failed\n");
+ goto out;
+ }
+
+ err = handle_hca_cap_odp(dev);
+ if (err) {
+ dev_err(&pdev->dev, "handle_hca_cap_odp failed\n");
+ goto out;
+ }
+
+out:
+ return err;
+}
+
static int set_hca_ctrl(struct mlx5_core_dev *dev)
{
struct mlx5_reg_host_endianness he_in;
@@ -963,21 +991,9 @@ static int mlx5_load_one(struct mlx5_core_dev *dev, struct mlx5_priv *priv,
goto reclaim_boot_pages;
}
- err = handle_hca_cap(dev);
- if (err) {
- dev_err(&pdev->dev, "handle_hca_cap failed\n");
- goto reclaim_boot_pages;
- }
-
- err = handle_hca_cap_atomic(dev);
- if (err) {
- dev_err(&pdev->dev, "handle_hca_cap_atomic failed\n");
- goto reclaim_boot_pages;
- }
-
- err = handle_hca_cap_odp(dev);
+ err = set_hca_cap(dev);
if (err) {
- dev_err(&pdev->dev, "handle_hca_cap_odp failed\n");
+ dev_err(&pdev->dev, "set_hca_cap failed\n");
goto reclaim_boot_pages;
}
--
2.19.1
^ permalink raw reply related
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