* Re: Toggling link state breaks network connectivity
From: Mason @ 2017-06-13 15:32 UTC (permalink / raw)
To: Florian Fainelli, netdev
Cc: Andrew Lunn, Mans Rullgard, Thibaud Cornic, Matthias May,
Zefir Kurtisi
In-Reply-To: <b3d1fd0c-281a-dd5a-d0e8-75f42475a248@free.fr>
On 13/06/2017 17:07, Mason wrote:
> I did note something that seems important.
>
> If I toggle the link state in software, then connectivity breaks.
>
> If I unplug the ethernet cable, and replug, connectivity remains.
>
> The difference is that plugging/unplugging doesn't call the
> .ndo_stop callback. But 'ip link set eth0 down' does call it.
>
> Should the .ndo_stop callback be symmetric to the .ndo_open callback?
> In other words, should .ndo_open(); .ndo_stop(); be a NOP?
I changed the ndo_open callback to a wrapper that calls:
nb8800_open(dev);
nb8800_stop(dev);
nb8800_open(dev);
With this change, connectivity is broken from the start.
Valid ARP requests are correctly *sent* but the corresponding
ARP replies are not received.
I'm hoping this limits the scope of what needs to be investigated.
Regards.
^ permalink raw reply
* Re: [PATCH] Add printk for bonding module packets_per_slave parameter
From: David Miller @ 2017-06-13 15:34 UTC (permalink / raw)
To: michael.j.dilmore; +Cc: j.vosburgh, vfalico, andy, netdev, linux-kernel
In-Reply-To: <20170613134246.6407-1-michael.j.dilmore@gmail.com>
From: Michael Dilmore <michael.j.dilmore@gmail.com>
Date: Tue, 13 Jun 2017 14:42:46 +0100
> The packets per slave parameter used by round robin mode does not have a printk debug
> message in its set function in bond_options.c. Adding such a function would aid debugging
> of round-robin mode and allow the user to more easily verify that the parameter has been
> set correctly. I should add that I'm motivated by my own experience here - it's not
> obvious from output of tools such as wireshark and ifstat that the parameter is working
> correctly, and with the differences in bonding configuration across different distributions,
> it would have been comforting to see this output.
>
> Signed-off-by: Michael Dilmore <michael.j.dilmore@gmail.com>
>
> cc: Veaceslav Falico <vfalico@gmail.com>,Andy Gospodarek <andy@greyhouse.net>,netdev@vger.kernel.org,linux-kernel@vger.kernel.org
You can verify things by simplying reading the value back.
If every parameter emitted a kernel log message, it would be
unreadable.
I'm not applying this, sorry.
^ permalink raw reply
* Re: Toggling link state breaks network connectivity
From: Florian Fainelli @ 2017-06-13 15:36 UTC (permalink / raw)
To: Mason, netdev; +Cc: Andrew Lunn, Mans Rullgard, Thibaud Cornic
In-Reply-To: <b3d1fd0c-281a-dd5a-d0e8-75f42475a248@free.fr>
On 06/13/2017 08:07 AM, Mason wrote:> I did note something that seems
important.
>
> If I toggle the link state in software, then connectivity breaks.
>
> If I unplug the ethernet cable, and replug, connectivity remains.
What does that actually mean? If you disconnect the cable a link state
should be notified and another link state should be notified, even if
that happens faster than the PHYLIB polling time (1s).
>
> The difference is that plugging/unplugging doesn't call the
> .ndo_stop callback. But 'ip link set eth0 down' does call it.
>
> Should the .ndo_stop callback be symmetric to the .ndo_open callback?
Yes obviously.
> In other words, should .ndo_open(); .ndo_stop(); be a NOP?
--
Florian
^ permalink raw reply
* Re: [PATCH] ip6_tunnel: Correct tos value in collect_md mode
From: Daniel Borkmann @ 2017-06-13 15:37 UTC (permalink / raw)
To: 严海双
Cc: David S. Miller, Alexey Kuznetsov, James Morris, Patrick McHardy,
netdev, linux-kernel, peter.a.dawson, ast
In-Reply-To: <0D379591-C5AA-496C-BC00-18005EAA7D21@cmss.chinamobile.com>
On 06/13/2017 03:31 PM, 严海双 wrote:
>> On 13 Jun 2017, at 5:57 PM, Daniel Borkmann <daniel@iogearbox.net> wrote:
>> On 06/13/2017 09:55 AM, Haishuang Yan wrote:
>>> Same as ip_gre, geneve and vxlan, use key->tos as tos value.
>>
>> Please also add Fixes tag and Cc original authors.
>>
>> Fixes: 0e9a709560db ("ip6_tunnel, ip6_gre: fix setting of DSCP on encapsulated packets”)
>
> Ok, I will add it, thanks
>
>>> Signed-off-by: Haishuang Yan <yanhaishuang@cmss.chinamobile.com>
>>> ---
>>> net/ipv6/ip6_tunnel.c | 4 ++--
>>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
>>> index ef99d59..5f4aff5 100644
>>> --- a/net/ipv6/ip6_tunnel.c
>>> +++ b/net/ipv6/ip6_tunnel.c
>>> @@ -1249,7 +1249,7 @@ int ip6_tnl_xmit(struct sk_buff *skb, struct net_device *dev, __u8 dsfield,
>>> fl6.flowi6_proto = IPPROTO_IPIP;
>>> fl6.daddr = key->u.ipv6.dst;
>>> fl6.flowlabel = key->label;
>>> - dsfield = ip6_tclass(key->label);
>>> + dsfield = key->tos;
>>
>> Not exactly the same as vxlan / geneve. They do use key->tos
>> indeed, but they also set fl6.flowlabel differently:
>>
>> [...]
>> prio = info->key.tos;
>> [...]
>> fl6->flowlabel = ip6_make_flowinfo(RT_TOS(prio),
>> info->key.label);
>> [...]
>>
>> But looks like the latter is done later in ip6_tnl_xmit() eventually
>> before the route lookup as per 5f733ee68f9a ("ip6_tunnel: fix traffic
>> class routing for tunnels") fix. However, you still might want to
>> mask key->tos with RT_TOS().
>
> Do you mean this way?
This one from my last comment: dsfield = RT_TOS(key->tos)
^ permalink raw reply
* Re: [PATCH net] net: phy: Fix MDIO_THUNDER dependencies
From: Randy Dunlap @ 2017-06-13 15:45 UTC (permalink / raw)
To: Florian Fainelli, netdev; +Cc: arnd, Andrew Lunn, open list
In-Reply-To: <20170613001852.10073-1-f.fainelli@gmail.com>
On 06/12/17 17:18, Florian Fainelli wrote:
> After commit 90eff9096c01 ("net: phy: Allow splitting MDIO
> bus/device support from PHYs") we could create a configuration where
> MDIO_DEVICE=y and PHYLIB=m which leads to the following undefined
> references:
>
> drivers/built-in.o: In function `thunder_mdiobus_pci_remove':
>>> mdio-thunder.c:(.text+0x2a212f): undefined reference to
>>> `mdiobus_unregister'
>>> mdio-thunder.c:(.text+0x2a2138): undefined reference to
>>> `mdiobus_free'
> drivers/built-in.o: In function `thunder_mdiobus_pci_probe':
> mdio-thunder.c:(.text+0x2a22e7): undefined reference to
> `devm_mdiobus_alloc_size'
> mdio-thunder.c:(.text+0x2a236f): undefined reference to
> `of_mdiobus_register'
>
> Reported-by: kbuild test robot <fengguang.wu@intel.com>
> Fixes: 90eff9096c01 ("net: phy: Allow splitting MDIO bus/device support from PHYs")
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Tested-by: Randy Dunlap <rdunlap@infradead.org>
Thanks.
> ---
> drivers/net/phy/Kconfig | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig
> index c360dd6ead22..3ab6c58d4be6 100644
> --- a/drivers/net/phy/Kconfig
> +++ b/drivers/net/phy/Kconfig
> @@ -127,6 +127,7 @@ config MDIO_THUNDER
> tristate "ThunderX SOCs MDIO buses"
> depends on 64BIT
> depends on PCI
> + depends on !(MDIO_DEVICE=y && PHYLIB=m)
> select MDIO_CAVIUM
> help
> This driver supports the MDIO interfaces found on Cavium
>
--
~Randy
^ permalink raw reply
* Re: Toggling link state breaks network connectivity
From: Mason @ 2017-06-13 15:47 UTC (permalink / raw)
To: Florian Fainelli, netdev; +Cc: Andrew Lunn, Mans Rullgard, Thibaud Cornic
In-Reply-To: <17e1e9c3-7adb-05fe-18cd-ce6db4ac792d@gmail.com>
On 13/06/2017 17:36, Florian Fainelli wrote:
> On 06/13/2017 08:07 AM, Mason wrote:
>
>> I did note something that seems important.
>> If I toggle the link state in software, then connectivity breaks.
>> If I unplug the ethernet cable, and replug, connectivity remains.
>
> What does that actually mean? If you disconnect the cable a link state
> should be notified and another link state should be notified, even if
> that happens faster than the PHYLIB polling time (1s).
Sorry for being unclear.
If I unplug/replug the cable, ping still works afterward.
(Packet RX appears to be *not* wedged)
If I toggle the link state in SW (set link down/set link up),
I can no longer ping afterward.
(Packet RX appears to be wedged, so ARP replies are not seen)
Maybe the two experiments are too unrelated to consider
the different results relevant in any way?
Regards.
^ permalink raw reply
* Re: Toggling link state breaks network connectivity
From: Florian Fainelli @ 2017-06-13 15:50 UTC (permalink / raw)
To: Mason, netdev; +Cc: Andrew Lunn, Mans Rullgard, Thibaud Cornic
In-Reply-To: <51eb8306-64e5-f528-d663-be80c73098f1@free.fr>
On 06/13/2017 08:47 AM, Mason wrote:
> On 13/06/2017 17:36, Florian Fainelli wrote:
>
>> On 06/13/2017 08:07 AM, Mason wrote:
>>
>>> I did note something that seems important.
>>> If I toggle the link state in software, then connectivity breaks.
>>> If I unplug the ethernet cable, and replug, connectivity remains.
>>
>> What does that actually mean? If you disconnect the cable a link state
>> should be notified and another link state should be notified, even if
>> that happens faster than the PHYLIB polling time (1s).
>
> Sorry for being unclear.
>
> If I unplug/replug the cable, ping still works afterward.
> (Packet RX appears to be *not* wedged)
>
> If I toggle the link state in SW (set link down/set link up),
> I can no longer ping afterward.
> (Packet RX appears to be wedged, so ARP replies are not seen)
>
> Maybe the two experiments are too unrelated to consider
> the different results relevant in any way?
No, they are not, this really tells you that whatever your ndo_open()
and ndo_stop() functions do, they are currently broken with your
particular HW. I have seen numerous problems on some of our older
platforms using bcmgenet where the PHY needs to be reset *before* any
MAC activity occurs, and any MAC activity even qualifies as a reset of
the MAC itself, we can perform a PHY reset there because the PHY is
internal, that may not be an option, and your HW is different anyway.
--
Florian
^ permalink raw reply
* Re: [net-next] macvlan: propagate the mac address change status for lowerdev
From: Sergei Shtylyov @ 2017-06-13 15:53 UTC (permalink / raw)
To: Zhang Shengju, davem, fgao, vyasevic, netdev
In-Reply-To: <1497365111-34821-1-git-send-email-zhangshengju@cmss.chinamobile.com>
Hello!
On 06/13/2017 05:45 PM, Zhang Shengju wrote:
> The macvlan dev should propagate the return value of mac address change for
> lower device in the passthru mode, instead of always return 0.
Returning. Perhaps can be fixed while applying...
> Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
[...]
MBR,Sergei
^ permalink raw reply
* Re: [net-next] fjes: remove duplicate set of flag IFF_BROADCAST
From: Sergei Shtylyov @ 2017-06-13 15:55 UTC (permalink / raw)
To: Zhang Shengju, davem, izumi.taku, netdev
In-Reply-To: <1497358189-3342-1-git-send-email-zhangshengju@cmss.chinamobile.com>
Hello!
On 06/13/2017 03:49 PM, Zhang Shengju wrote:
> Remove unnecessary set of flag IFF_BROADCAST, since ether_setup
s/set/setting/. Perhaps can be fixed while applying...
> already does this.
>
> Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
[...]
MBR, Sergei
^ permalink raw reply
* Re: [PATCH net-next 03/10] bpf: mlx5e: Report bpf_prog ID during XDP_QUERY_PROG
From: Saeed Mahameed @ 2017-06-13 16:04 UTC (permalink / raw)
To: Martin KaFai Lau
Cc: Linux Netdev List, Alexei Starovoitov, Daniel Borkmann,
Kernel Team, Tariq Toukan, Saeed Mahameed
In-Reply-To: <20170613010025.2983342-4-kafai@fb.com>
On Tue, Jun 13, 2017 at 4:00 AM, Martin KaFai Lau <kafai@fb.com> wrote:
> Add support to mlx5e to report bpf_prog ID during XDP_QUERY_PROG.
>
> Signed-off-by: Martin KaFai Lau <kafai@fb.com>
> Cc: Tariq Toukan <tariqt@mellanox.com>
> Cc: Saeed Mahameed <saeedm@mellanox.com>
> Acked-by: Alexei Starovoitov <ast@fb.com>
> Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Saeed Mahameed <saeedm@mellanox.com>
Thanks you Martin.
^ permalink raw reply
* Re: [for-next 4/6] net/mlx5: FPGA, Add basic support for Innova
From: Saeed Mahameed @ 2017-06-13 16:05 UTC (permalink / raw)
To: Jason Gunthorpe
Cc: Majd Dibbiny, Doug Ledford, Ilan Tayari, Alexei Starovoitov,
David S. Miller, netdev@vger.kernel.org,
linux-rdma@vger.kernel.org, jsorensen@fb.com, Andy Shevchenko,
linux-fpga@vger.kernel.org, Alan Tull, yi1.li@linux.intel.com,
Boris Pismenny
In-Reply-To: <20170612161746.GC24829@obsidianresearch.com>
On Mon, Jun 12, 2017 at 7:17 PM, Jason Gunthorpe
<jgunthorpe@obsidianresearch.com> wrote:
> On Sat, Jun 10, 2017 at 02:11:13PM +0000, Majd Dibbiny wrote:
>
>> >> This is especially true for mlx nics as there are many raw packet
>> >> bypass mechanisms available to userspace.
>
>> All of the Raw packet bypass mechanisms are restricted to
>> CAP_NET_RAW, and thus malicious users can't simply open a RAW Packet
>> QP and send it to the FPGA..
>
> It is big expansion of CAP_NET_RAW to also basically also include
> reconfiguring ipsec xfrm.
>
> Plus, if someone configures ethernet bridging (eg in a VM situation)
> then could a hacked VM reconfigure this FPGA?
>
> Jason
Hi Jason
As we mentioned earlier, the device ensures that only the FPGA
component in the driver can configure the FPGA regardless of any type
of standard traffic.
Thanks,
Saeed.
^ permalink raw reply
* Re: [PATCH] Add printk for bonding module packets_per_slave parameter
From: Joe Perches @ 2017-06-13 16:21 UTC (permalink / raw)
To: David Miller, michael.j.dilmore
Cc: j.vosburgh, vfalico, andy, netdev, linux-kernel
In-Reply-To: <20170613.113411.506760268959654820.davem@davemloft.net>
On Tue, 2017-06-13 at 11:34 -0400, David Miller wrote:
> From: Michael Dilmore <michael.j.dilmore@gmail.com>
> Date: Tue, 13 Jun 2017 14:42:46 +0100
>
> > The packets per slave parameter used by round robin mode does not have a printk debug
> > message in its set function in bond_options.c. Adding such a function would aid debugging
> > of round-robin mode and allow the user to more easily verify that the parameter has been
> > set correctly. I should add that I'm motivated by my own experience here - it's not
> > obvious from output of tools such as wireshark and ifstat that the parameter is working
> > correctly, and with the differences in bonding configuration across different distributions,
> > it would have been comforting to see this output.
> >
> > Signed-off-by: Michael Dilmore <michael.j.dilmore@gmail.com>
> >
> > cc: Veaceslav Falico <vfalico@gmail.com>,Andy Gospodarek <andy@greyhouse.net>,netdev@vger.kernel.org,linux-kernel@vger.kernel.org
>
> You can verify things by simplying reading the value back.
>
> If every parameter emitted a kernel log message, it would be
> unreadable.
>
> I'm not applying this, sorry.
I agree. Noisy logging output is not good.
Perhaps a general conversion of the dozens
of existing netdev_info uses in this file to
netdev_dbg and adding this at netdev_dbg is
appropriate.
Something like:
---
drivers/net/bonding/bond_options.c | 119 +++++++++++++++++++------------------
1 file changed, 60 insertions(+), 59 deletions(-)
diff --git a/drivers/net/bonding/bond_options.c b/drivers/net/bonding/bond_options.c
index 8ca683396fcc..9dec49b1b8ae 100644
--- a/drivers/net/bonding/bond_options.c
+++ b/drivers/net/bonding/bond_options.c
@@ -750,8 +750,8 @@ static int bond_option_mode_set(struct bonding *bond,
bond->params.arp_interval = 0;
/* set miimon to default value */
bond->params.miimon = BOND_DEFAULT_MIIMON;
- netdev_info(bond->dev, "Setting MII monitoring interval to %d\n",
- bond->params.miimon);
+ netdev_dbg(bond->dev, "Setting MII monitoring interval to %d\n",
+ bond->params.miimon);
}
/* don't cache arp_validate between modes */
@@ -794,7 +794,7 @@ static int bond_option_active_slave_set(struct bonding *bond,
block_netpoll_tx();
/* check to see if we are clearing active */
if (!slave_dev) {
- netdev_info(bond->dev, "Clearing current active slave\n");
+ netdev_dbg(bond->dev, "Clearing current active slave\n");
RCU_INIT_POINTER(bond->curr_active_slave, NULL);
bond_select_active_slave(bond);
} else {
@@ -805,13 +805,13 @@ static int bond_option_active_slave_set(struct bonding *bond,
if (new_active == old_active) {
/* do nothing */
- netdev_info(bond->dev, "%s is already the current active slave\n",
- new_active->dev->name);
+ netdev_dbg(bond->dev, "%s is already the current active slave\n",
+ new_active->dev->name);
} else {
if (old_active && (new_active->link == BOND_LINK_UP) &&
bond_slave_is_up(new_active)) {
- netdev_info(bond->dev, "Setting %s as active slave\n",
- new_active->dev->name);
+ netdev_dbg(bond->dev, "Setting %s as active slave\n",
+ new_active->dev->name);
bond_change_active_slave(bond, new_active);
} else {
netdev_err(bond->dev, "Could not set %s as active slave; either %s is down or the link is down\n",
@@ -833,17 +833,17 @@ static int bond_option_active_slave_set(struct bonding *bond,
static int bond_option_miimon_set(struct bonding *bond,
const struct bond_opt_value *newval)
{
- netdev_info(bond->dev, "Setting MII monitoring interval to %llu\n",
- newval->value);
+ netdev_dbg(bond->dev, "Setting MII monitoring interval to %llu\n",
+ newval->value);
bond->params.miimon = newval->value;
if (bond->params.updelay)
- netdev_info(bond->dev, "Note: Updating updelay (to %d) since it is a multiple of the miimon value\n",
- bond->params.updelay * bond->params.miimon);
+ netdev_dbg(bond->dev, "Note: Updating updelay (to %d) since it is a multiple of the miimon value\n",
+ bond->params.updelay * bond->params.miimon);
if (bond->params.downdelay)
- netdev_info(bond->dev, "Note: Updating downdelay (to %d) since it is a multiple of the miimon value\n",
- bond->params.downdelay * bond->params.miimon);
+ netdev_dbg(bond->dev, "Note: Updating downdelay (to %d) since it is a multiple of the miimon value\n",
+ bond->params.downdelay * bond->params.miimon);
if (newval->value && bond->params.arp_interval) {
- netdev_info(bond->dev, "MII monitoring cannot be used with ARP monitoring - disabling ARP monitoring...\n");
+ netdev_dbg(bond->dev, "MII monitoring cannot be used with ARP monitoring - disabling ARP monitoring...\n");
bond->params.arp_interval = 0;
if (bond->params.arp_validate)
bond->params.arp_validate = BOND_ARP_VALIDATE_NONE;
@@ -885,8 +885,8 @@ static int bond_option_updelay_set(struct bonding *bond,
bond->params.miimon);
}
bond->params.updelay = value / bond->params.miimon;
- netdev_info(bond->dev, "Setting up delay to %d\n",
- bond->params.updelay * bond->params.miimon);
+ netdev_dbg(bond->dev, "Setting up delay to %d\n",
+ bond->params.updelay * bond->params.miimon);
return 0;
}
@@ -907,8 +907,8 @@ static int bond_option_downdelay_set(struct bonding *bond,
bond->params.miimon);
}
bond->params.downdelay = value / bond->params.miimon;
- netdev_info(bond->dev, "Setting down delay to %d\n",
- bond->params.downdelay * bond->params.miimon);
+ netdev_dbg(bond->dev, "Setting down delay to %d\n",
+ bond->params.downdelay * bond->params.miimon);
return 0;
}
@@ -916,8 +916,7 @@ static int bond_option_downdelay_set(struct bonding *bond,
static int bond_option_use_carrier_set(struct bonding *bond,
const struct bond_opt_value *newval)
{
- netdev_info(bond->dev, "Setting use_carrier to %llu\n",
- newval->value);
+ netdev_dbg(bond->dev, "Setting use_carrier to %llu\n", newval->value);
bond->params.use_carrier = newval->value;
return 0;
@@ -930,16 +929,16 @@ static int bond_option_use_carrier_set(struct bonding *bond,
static int bond_option_arp_interval_set(struct bonding *bond,
const struct bond_opt_value *newval)
{
- netdev_info(bond->dev, "Setting ARP monitoring interval to %llu\n",
- newval->value);
+ netdev_dbg(bond->dev, "Setting ARP monitoring interval to %llu\n",
+ newval->value);
bond->params.arp_interval = newval->value;
if (newval->value) {
if (bond->params.miimon) {
- netdev_info(bond->dev, "ARP monitoring cannot be used with MII monitoring. Disabling MII monitoring\n");
+ netdev_dbg(bond->dev, "ARP monitoring cannot be used with MII monitoring. Disabling MII monitoring\n");
bond->params.miimon = 0;
}
if (!bond->params.arp_targets[0])
- netdev_info(bond->dev, "ARP monitoring has been set up, but no ARP targets have been specified\n");
+ netdev_dbg(bond->dev, "ARP monitoring has been set up, but no ARP targets have been specified\n");
}
if (bond->dev->flags & IFF_UP) {
/* If the interface is up, we may need to fire off
@@ -1000,7 +999,7 @@ static int _bond_option_arp_ip_target_add(struct bonding *bond, __be32 target)
return -EINVAL;
}
- netdev_info(bond->dev, "Adding ARP target %pI4\n", &target);
+ netdev_dbg(bond->dev, "Adding ARP target %pI4\n", &target);
_bond_options_arp_ip_target_set(bond, ind, target, jiffies);
@@ -1036,7 +1035,7 @@ static int bond_option_arp_ip_target_rem(struct bonding *bond, __be32 target)
if (ind == 0 && !targets[1] && bond->params.arp_interval)
netdev_warn(bond->dev, "Removing last arp target with arp_interval on\n");
- netdev_info(bond->dev, "Removing ARP target %pI4\n", &target);
+ netdev_dbg(bond->dev, "Removing ARP target %pI4\n", &target);
bond_for_each_slave(bond, slave, iter) {
targets_rx = slave->target_last_arp_rx;
@@ -1088,8 +1087,8 @@ static int bond_option_arp_ip_targets_set(struct bonding *bond,
static int bond_option_arp_validate_set(struct bonding *bond,
const struct bond_opt_value *newval)
{
- netdev_info(bond->dev, "Setting arp_validate to %s (%llu)\n",
- newval->string, newval->value);
+ netdev_dbg(bond->dev, "Setting arp_validate to %s (%llu)\n",
+ newval->string, newval->value);
if (bond->dev->flags & IFF_UP) {
if (!newval->value)
@@ -1105,8 +1104,8 @@ static int bond_option_arp_validate_set(struct bonding *bond,
static int bond_option_arp_all_targets_set(struct bonding *bond,
const struct bond_opt_value *newval)
{
- netdev_info(bond->dev, "Setting arp_all_targets to %s (%llu)\n",
- newval->string, newval->value);
+ netdev_dbg(bond->dev, "Setting arp_all_targets to %s (%llu)\n",
+ newval->string, newval->value);
bond->params.arp_all_targets = newval->value;
return 0;
@@ -1126,7 +1125,7 @@ static int bond_option_primary_set(struct bonding *bond,
*p = '\0';
/* check to see if we are clearing primary */
if (!strlen(primary)) {
- netdev_info(bond->dev, "Setting primary slave to None\n");
+ netdev_dbg(bond->dev, "Setting primary slave to None\n");
RCU_INIT_POINTER(bond->primary_slave, NULL);
memset(bond->params.primary, 0, sizeof(bond->params.primary));
bond_select_active_slave(bond);
@@ -1135,8 +1134,8 @@ static int bond_option_primary_set(struct bonding *bond,
bond_for_each_slave(bond, slave, iter) {
if (strncmp(slave->dev->name, primary, IFNAMSIZ) == 0) {
- netdev_info(bond->dev, "Setting %s as primary slave\n",
- slave->dev->name);
+ netdev_dbg(bond->dev, "Setting %s as primary slave\n",
+ slave->dev->name);
rcu_assign_pointer(bond->primary_slave, slave);
strcpy(bond->params.primary, slave->dev->name);
bond_select_active_slave(bond);
@@ -1145,15 +1144,15 @@ static int bond_option_primary_set(struct bonding *bond,
}
if (rtnl_dereference(bond->primary_slave)) {
- netdev_info(bond->dev, "Setting primary slave to None\n");
+ netdev_dbg(bond->dev, "Setting primary slave to None\n");
RCU_INIT_POINTER(bond->primary_slave, NULL);
bond_select_active_slave(bond);
}
strncpy(bond->params.primary, primary, IFNAMSIZ);
bond->params.primary[IFNAMSIZ - 1] = 0;
- netdev_info(bond->dev, "Recording %s as primary, but it has not been enslaved to %s yet\n",
- primary, bond->dev->name);
+ netdev_dbg(bond->dev, "Recording %s as primary, but it has not been enslaved to %s yet\n",
+ primary, bond->dev->name);
out:
unblock_netpoll_tx();
@@ -1164,8 +1163,8 @@ static int bond_option_primary_set(struct bonding *bond,
static int bond_option_primary_reselect_set(struct bonding *bond,
const struct bond_opt_value *newval)
{
- netdev_info(bond->dev, "Setting primary_reselect to %s (%llu)\n",
- newval->string, newval->value);
+ netdev_dbg(bond->dev, "Setting primary_reselect to %s (%llu)\n",
+ newval->string, newval->value);
bond->params.primary_reselect = newval->value;
block_netpoll_tx();
@@ -1178,8 +1177,8 @@ static int bond_option_primary_reselect_set(struct bonding *bond,
static int bond_option_fail_over_mac_set(struct bonding *bond,
const struct bond_opt_value *newval)
{
- netdev_info(bond->dev, "Setting fail_over_mac to %s (%llu)\n",
- newval->string, newval->value);
+ netdev_dbg(bond->dev, "Setting fail_over_mac to %s (%llu)\n",
+ newval->string, newval->value);
bond->params.fail_over_mac = newval->value;
return 0;
@@ -1188,8 +1187,8 @@ static int bond_option_fail_over_mac_set(struct bonding *bond,
static int bond_option_xmit_hash_policy_set(struct bonding *bond,
const struct bond_opt_value *newval)
{
- netdev_info(bond->dev, "Setting xmit hash policy to %s (%llu)\n",
- newval->string, newval->value);
+ netdev_dbg(bond->dev, "Setting xmit hash policy to %s (%llu)\n",
+ newval->string, newval->value);
bond->params.xmit_policy = newval->value;
return 0;
@@ -1198,8 +1197,8 @@ static int bond_option_xmit_hash_policy_set(struct bonding *bond,
static int bond_option_resend_igmp_set(struct bonding *bond,
const struct bond_opt_value *newval)
{
- netdev_info(bond->dev, "Setting resend_igmp to %llu\n",
- newval->value);
+ netdev_dbg(bond->dev, "Setting resend_igmp to %llu\n",
+ newval->value);
bond->params.resend_igmp = newval->value;
return 0;
@@ -1237,8 +1236,8 @@ static int bond_option_all_slaves_active_set(struct bonding *bond,
static int bond_option_min_links_set(struct bonding *bond,
const struct bond_opt_value *newval)
{
- netdev_info(bond->dev, "Setting min links value to %llu\n",
- newval->value);
+ netdev_dbg(bond->dev, "Setting min links value to %llu\n",
+ newval->value);
bond->params.min_links = newval->value;
bond_set_carrier(bond);
@@ -1256,6 +1255,8 @@ static int bond_option_lp_interval_set(struct bonding *bond,
static int bond_option_pps_set(struct bonding *bond,
const struct bond_opt_value *newval)
{
+ netdev_dbg(bond->dev, "Setting packets per slave to %d\n",
+ newval->value);
bond->params.packets_per_slave = newval->value;
if (newval->value > 0) {
bond->params.reciprocal_packets_per_slave =
@@ -1274,8 +1275,8 @@ static int bond_option_pps_set(struct bonding *bond,
static int bond_option_lacp_rate_set(struct bonding *bond,
const struct bond_opt_value *newval)
{
- netdev_info(bond->dev, "Setting LACP rate to %s (%llu)\n",
- newval->string, newval->value);
+ netdev_dbg(bond->dev, "Setting LACP rate to %s (%llu)\n",
+ newval->string, newval->value);
bond->params.lacp_fast = newval->value;
bond_3ad_update_lacp_rate(bond);
@@ -1285,8 +1286,8 @@ static int bond_option_lacp_rate_set(struct bonding *bond,
static int bond_option_ad_select_set(struct bonding *bond,
const struct bond_opt_value *newval)
{
- netdev_info(bond->dev, "Setting ad_select to %s (%llu)\n",
- newval->string, newval->value);
+ netdev_dbg(bond->dev, "Setting ad_select to %s (%llu)\n",
+ newval->string, newval->value);
bond->params.ad_select = newval->value;
return 0;
@@ -1377,12 +1378,12 @@ static int bond_option_slaves_set(struct bonding *bond,
switch (command[0]) {
case '+':
- netdev_info(bond->dev, "Adding slave %s\n", dev->name);
+ netdev_dbg(bond->dev, "Adding slave %s\n", dev->name);
ret = bond_enslave(bond->dev, dev);
break;
case '-':
- netdev_info(bond->dev, "Removing slave %s\n", dev->name);
+ netdev_dbg(bond->dev, "Removing slave %s\n", dev->name);
ret = bond_release(bond->dev, dev);
break;
@@ -1402,8 +1403,8 @@ static int bond_option_slaves_set(struct bonding *bond,
static int bond_option_tlb_dynamic_lb_set(struct bonding *bond,
const struct bond_opt_value *newval)
{
- netdev_info(bond->dev, "Setting dynamic-lb to %s (%llu)\n",
- newval->string, newval->value);
+ netdev_dbg(bond->dev, "Setting dynamic-lb to %s (%llu)\n",
+ newval->string, newval->value);
bond->params.tlb_dynamic_lb = newval->value;
return 0;
@@ -1412,8 +1413,8 @@ static int bond_option_tlb_dynamic_lb_set(struct bonding *bond,
static int bond_option_ad_actor_sys_prio_set(struct bonding *bond,
const struct bond_opt_value *newval)
{
- netdev_info(bond->dev, "Setting ad_actor_sys_prio to %llu\n",
- newval->value);
+ netdev_dbg(bond->dev, "Setting ad_actor_sys_prio to %llu\n",
+ newval->value);
bond->params.ad_actor_sys_prio = newval->value;
bond_3ad_update_ad_actor_settings(bond);
@@ -1442,7 +1443,7 @@ static int bond_option_ad_actor_system_set(struct bonding *bond,
if (!is_valid_ether_addr(mac))
goto err;
- netdev_info(bond->dev, "Setting ad_actor_system to %pM\n", mac);
+ netdev_dbg(bond->dev, "Setting ad_actor_system to %pM\n", mac);
ether_addr_copy(bond->params.ad_actor_system, mac);
bond_3ad_update_ad_actor_settings(bond);
@@ -1456,8 +1457,8 @@ static int bond_option_ad_actor_system_set(struct bonding *bond,
static int bond_option_ad_user_port_key_set(struct bonding *bond,
const struct bond_opt_value *newval)
{
- netdev_info(bond->dev, "Setting ad_user_port_key to %llu\n",
- newval->value);
+ netdev_dbg(bond->dev, "Setting ad_user_port_key to %llu\n",
+ newval->value);
bond->params.ad_user_port_key = newval->value;
return 0;
^ permalink raw reply related
* Re: [PATCH nf-next] netns: add and use net_ns_barrier
From: Cong Wang @ 2017-06-13 16:35 UTC (permalink / raw)
To: Florian Westphal
Cc: Eric W. Biederman, netfilter-devel,
Linux Kernel Network Developers
In-Reply-To: <20170613061656.GF18283@breakpoint.cc>
On Mon, Jun 12, 2017 at 11:16 PM, Florian Westphal <fw@strlen.de> wrote:
> Cong Wang <xiyou.wangcong@gmail.com> wrote:
>> On Thu, Jun 1, 2017 at 1:52 AM, Florian Westphal <fw@strlen.de> wrote:
>> > Joe described it nicely, problem is that after unload we may have
>> > conntracks that still have a nf_conn_help extension attached that
>> > has a pointer to a structure that resided in the (unloaded) module.
>>
>> Why not hold a refcnt for its module?
>
> That would work as well.
>
> I'm not sure its nice to disallow rmmod of helper modules if they are
> used by a connection however.
I am _not_ suggesting to disallow rmmod.
>
> Right now you can "rmmod nf_conntrack_foo" at any time and this should
> work just fine without first having to flush affected conntracks
> manually.
My point is that since netns wq could invoke code of that module,
why it doesn't hold a refcnt of that module?
I am not familiar with netfilter code base so not sure if that is
hard to do or not, but it looks more elegant than this barrier.
^ permalink raw reply
* [PATCH] nfc: nci: remove unnecessary null check
From: Gustavo A. R. Silva @ 2017-06-13 16:37 UTC (permalink / raw)
To: Samuel Ortiz, David S. Miller
Cc: linux-wireless, netdev, linux-kernel, Gustavo A. R. Silva,
Guenter Roeck
In-Reply-To: <28317503-e721-2564-a9ff-82182aa0644a@roeck-us.net>
Remove unnecessary NULL check for pointer conn_info.
conn_info is set in list_for_each_entry() using container_of(),
which is never NULL.
Addresses-Coverity-ID: 1362349
Cc: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
---
net/nfc/nci/core.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/net/nfc/nci/core.c b/net/nfc/nci/core.c
index 61fff42..c15cb88 100644
--- a/net/nfc/nci/core.c
+++ b/net/nfc/nci/core.c
@@ -73,11 +73,10 @@ int nci_get_conn_info_by_dest_type_params(struct nci_dev *ndev, u8 dest_type,
if (conn_info->dest_type == dest_type) {
if (!params)
return conn_info->conn_id;
- if (conn_info) {
- if (params->id == conn_info->dest_params->id &&
- params->protocol == conn_info->dest_params->protocol)
- return conn_info->conn_id;
- }
+
+ if (params->id == conn_info->dest_params->id &&
+ params->protocol == conn_info->dest_params->protocol)
+ return conn_info->conn_id;
}
}
--
2.5.0
^ permalink raw reply related
* Re: [PATCH] Add printk for bonding module packets_per_slave parameter
From: Jonathan Toppins @ 2017-06-13 16:42 UTC (permalink / raw)
To: Joe Perches, David Miller, michael.j.dilmore
Cc: j.vosburgh, vfalico, andy, netdev, linux-kernel, nikolay
In-Reply-To: <1497370863.18751.15.camel@perches.com>
On 06/13/2017 12:21 PM, Joe Perches wrote:
> On Tue, 2017-06-13 at 11:34 -0400, David Miller wrote:
>> From: Michael Dilmore <michael.j.dilmore@gmail.com>
>> Date: Tue, 13 Jun 2017 14:42:46 +0100
>>
>>> The packets per slave parameter used by round robin mode does not have a printk debug
>>> message in its set function in bond_options.c. Adding such a function would aid debugging
>>> of round-robin mode and allow the user to more easily verify that the parameter has been
>>> set correctly. I should add that I'm motivated by my own experience here - it's not
>>> obvious from output of tools such as wireshark and ifstat that the parameter is working
>>> correctly, and with the differences in bonding configuration across different distributions,
>>> it would have been comforting to see this output.
>>>
>>> Signed-off-by: Michael Dilmore <michael.j.dilmore@gmail.com>
>>>
>>> cc: Veaceslav Falico <vfalico@gmail.com>,Andy Gospodarek <andy@greyhouse.net>,netdev@vger.kernel.org,linux-kernel@vger.kernel.org
>>
>> You can verify things by simplying reading the value back.
>>
>> If every parameter emitted a kernel log message, it would be
>> unreadable.
>>
>> I'm not applying this, sorry.
>
> I agree. Noisy logging output is not good.
>
> Perhaps a general conversion of the dozens
> of existing netdev_info uses in this file to
> netdev_dbg and adding this at netdev_dbg is
> appropriate.
In general I agree. The few times I have debugged bonds, I always ended
up enabling debug prinks anyway. I don't see a problem moving these to
debug as well.
Adding nik whom converted a lot of this code to common paths for input.
>
> Something like:
> ---
> drivers/net/bonding/bond_options.c | 119 +++++++++++++++++++------------------
> 1 file changed, 60 insertions(+), 59 deletions(-)
>
> diff --git a/drivers/net/bonding/bond_options.c b/drivers/net/bonding/bond_options.c
> index 8ca683396fcc..9dec49b1b8ae 100644
> --- a/drivers/net/bonding/bond_options.c
> +++ b/drivers/net/bonding/bond_options.c
> @@ -750,8 +750,8 @@ static int bond_option_mode_set(struct bonding *bond,
> bond->params.arp_interval = 0;
> /* set miimon to default value */
> bond->params.miimon = BOND_DEFAULT_MIIMON;
> - netdev_info(bond->dev, "Setting MII monitoring interval to %d\n",
> - bond->params.miimon);
> + netdev_dbg(bond->dev, "Setting MII monitoring interval to %d\n",
> + bond->params.miimon);
> }
>
> /* don't cache arp_validate between modes */
> @@ -794,7 +794,7 @@ static int bond_option_active_slave_set(struct bonding *bond,
> block_netpoll_tx();
> /* check to see if we are clearing active */
> if (!slave_dev) {
> - netdev_info(bond->dev, "Clearing current active slave\n");
> + netdev_dbg(bond->dev, "Clearing current active slave\n");
> RCU_INIT_POINTER(bond->curr_active_slave, NULL);
> bond_select_active_slave(bond);
> } else {
> @@ -805,13 +805,13 @@ static int bond_option_active_slave_set(struct bonding *bond,
>
> if (new_active == old_active) {
> /* do nothing */
> - netdev_info(bond->dev, "%s is already the current active slave\n",
> - new_active->dev->name);
> + netdev_dbg(bond->dev, "%s is already the current active slave\n",
> + new_active->dev->name);
> } else {
> if (old_active && (new_active->link == BOND_LINK_UP) &&
> bond_slave_is_up(new_active)) {
> - netdev_info(bond->dev, "Setting %s as active slave\n",
> - new_active->dev->name);
> + netdev_dbg(bond->dev, "Setting %s as active slave\n",
> + new_active->dev->name);
> bond_change_active_slave(bond, new_active);
> } else {
> netdev_err(bond->dev, "Could not set %s as active slave; either %s is down or the link is down\n",
> @@ -833,17 +833,17 @@ static int bond_option_active_slave_set(struct bonding *bond,
> static int bond_option_miimon_set(struct bonding *bond,
> const struct bond_opt_value *newval)
> {
> - netdev_info(bond->dev, "Setting MII monitoring interval to %llu\n",
> - newval->value);
> + netdev_dbg(bond->dev, "Setting MII monitoring interval to %llu\n",
> + newval->value);
> bond->params.miimon = newval->value;
> if (bond->params.updelay)
> - netdev_info(bond->dev, "Note: Updating updelay (to %d) since it is a multiple of the miimon value\n",
> - bond->params.updelay * bond->params.miimon);
> + netdev_dbg(bond->dev, "Note: Updating updelay (to %d) since it is a multiple of the miimon value\n",
> + bond->params.updelay * bond->params.miimon);
> if (bond->params.downdelay)
> - netdev_info(bond->dev, "Note: Updating downdelay (to %d) since it is a multiple of the miimon value\n",
> - bond->params.downdelay * bond->params.miimon);
> + netdev_dbg(bond->dev, "Note: Updating downdelay (to %d) since it is a multiple of the miimon value\n",
> + bond->params.downdelay * bond->params.miimon);
> if (newval->value && bond->params.arp_interval) {
> - netdev_info(bond->dev, "MII monitoring cannot be used with ARP monitoring - disabling ARP monitoring...\n");
> + netdev_dbg(bond->dev, "MII monitoring cannot be used with ARP monitoring - disabling ARP monitoring...\n");
> bond->params.arp_interval = 0;
> if (bond->params.arp_validate)
> bond->params.arp_validate = BOND_ARP_VALIDATE_NONE;
> @@ -885,8 +885,8 @@ static int bond_option_updelay_set(struct bonding *bond,
> bond->params.miimon);
> }
> bond->params.updelay = value / bond->params.miimon;
> - netdev_info(bond->dev, "Setting up delay to %d\n",
> - bond->params.updelay * bond->params.miimon);
> + netdev_dbg(bond->dev, "Setting up delay to %d\n",
> + bond->params.updelay * bond->params.miimon);
>
> return 0;
> }
> @@ -907,8 +907,8 @@ static int bond_option_downdelay_set(struct bonding *bond,
> bond->params.miimon);
> }
> bond->params.downdelay = value / bond->params.miimon;
> - netdev_info(bond->dev, "Setting down delay to %d\n",
> - bond->params.downdelay * bond->params.miimon);
> + netdev_dbg(bond->dev, "Setting down delay to %d\n",
> + bond->params.downdelay * bond->params.miimon);
>
> return 0;
> }
> @@ -916,8 +916,7 @@ static int bond_option_downdelay_set(struct bonding *bond,
> static int bond_option_use_carrier_set(struct bonding *bond,
> const struct bond_opt_value *newval)
> {
> - netdev_info(bond->dev, "Setting use_carrier to %llu\n",
> - newval->value);
> + netdev_dbg(bond->dev, "Setting use_carrier to %llu\n", newval->value);
> bond->params.use_carrier = newval->value;
>
> return 0;
> @@ -930,16 +929,16 @@ static int bond_option_use_carrier_set(struct bonding *bond,
> static int bond_option_arp_interval_set(struct bonding *bond,
> const struct bond_opt_value *newval)
> {
> - netdev_info(bond->dev, "Setting ARP monitoring interval to %llu\n",
> - newval->value);
> + netdev_dbg(bond->dev, "Setting ARP monitoring interval to %llu\n",
> + newval->value);
> bond->params.arp_interval = newval->value;
> if (newval->value) {
> if (bond->params.miimon) {
> - netdev_info(bond->dev, "ARP monitoring cannot be used with MII monitoring. Disabling MII monitoring\n");
> + netdev_dbg(bond->dev, "ARP monitoring cannot be used with MII monitoring. Disabling MII monitoring\n");
> bond->params.miimon = 0;
> }
> if (!bond->params.arp_targets[0])
> - netdev_info(bond->dev, "ARP monitoring has been set up, but no ARP targets have been specified\n");
> + netdev_dbg(bond->dev, "ARP monitoring has been set up, but no ARP targets have been specified\n");
> }
> if (bond->dev->flags & IFF_UP) {
> /* If the interface is up, we may need to fire off
> @@ -1000,7 +999,7 @@ static int _bond_option_arp_ip_target_add(struct bonding *bond, __be32 target)
> return -EINVAL;
> }
>
> - netdev_info(bond->dev, "Adding ARP target %pI4\n", &target);
> + netdev_dbg(bond->dev, "Adding ARP target %pI4\n", &target);
>
> _bond_options_arp_ip_target_set(bond, ind, target, jiffies);
>
> @@ -1036,7 +1035,7 @@ static int bond_option_arp_ip_target_rem(struct bonding *bond, __be32 target)
> if (ind == 0 && !targets[1] && bond->params.arp_interval)
> netdev_warn(bond->dev, "Removing last arp target with arp_interval on\n");
>
> - netdev_info(bond->dev, "Removing ARP target %pI4\n", &target);
> + netdev_dbg(bond->dev, "Removing ARP target %pI4\n", &target);
>
> bond_for_each_slave(bond, slave, iter) {
> targets_rx = slave->target_last_arp_rx;
> @@ -1088,8 +1087,8 @@ static int bond_option_arp_ip_targets_set(struct bonding *bond,
> static int bond_option_arp_validate_set(struct bonding *bond,
> const struct bond_opt_value *newval)
> {
> - netdev_info(bond->dev, "Setting arp_validate to %s (%llu)\n",
> - newval->string, newval->value);
> + netdev_dbg(bond->dev, "Setting arp_validate to %s (%llu)\n",
> + newval->string, newval->value);
>
> if (bond->dev->flags & IFF_UP) {
> if (!newval->value)
> @@ -1105,8 +1104,8 @@ static int bond_option_arp_validate_set(struct bonding *bond,
> static int bond_option_arp_all_targets_set(struct bonding *bond,
> const struct bond_opt_value *newval)
> {
> - netdev_info(bond->dev, "Setting arp_all_targets to %s (%llu)\n",
> - newval->string, newval->value);
> + netdev_dbg(bond->dev, "Setting arp_all_targets to %s (%llu)\n",
> + newval->string, newval->value);
> bond->params.arp_all_targets = newval->value;
>
> return 0;
> @@ -1126,7 +1125,7 @@ static int bond_option_primary_set(struct bonding *bond,
> *p = '\0';
> /* check to see if we are clearing primary */
> if (!strlen(primary)) {
> - netdev_info(bond->dev, "Setting primary slave to None\n");
> + netdev_dbg(bond->dev, "Setting primary slave to None\n");
> RCU_INIT_POINTER(bond->primary_slave, NULL);
> memset(bond->params.primary, 0, sizeof(bond->params.primary));
> bond_select_active_slave(bond);
> @@ -1135,8 +1134,8 @@ static int bond_option_primary_set(struct bonding *bond,
>
> bond_for_each_slave(bond, slave, iter) {
> if (strncmp(slave->dev->name, primary, IFNAMSIZ) == 0) {
> - netdev_info(bond->dev, "Setting %s as primary slave\n",
> - slave->dev->name);
> + netdev_dbg(bond->dev, "Setting %s as primary slave\n",
> + slave->dev->name);
> rcu_assign_pointer(bond->primary_slave, slave);
> strcpy(bond->params.primary, slave->dev->name);
> bond_select_active_slave(bond);
> @@ -1145,15 +1144,15 @@ static int bond_option_primary_set(struct bonding *bond,
> }
>
> if (rtnl_dereference(bond->primary_slave)) {
> - netdev_info(bond->dev, "Setting primary slave to None\n");
> + netdev_dbg(bond->dev, "Setting primary slave to None\n");
> RCU_INIT_POINTER(bond->primary_slave, NULL);
> bond_select_active_slave(bond);
> }
> strncpy(bond->params.primary, primary, IFNAMSIZ);
> bond->params.primary[IFNAMSIZ - 1] = 0;
>
> - netdev_info(bond->dev, "Recording %s as primary, but it has not been enslaved to %s yet\n",
> - primary, bond->dev->name);
> + netdev_dbg(bond->dev, "Recording %s as primary, but it has not been enslaved to %s yet\n",
> + primary, bond->dev->name);
>
> out:
> unblock_netpoll_tx();
> @@ -1164,8 +1163,8 @@ static int bond_option_primary_set(struct bonding *bond,
> static int bond_option_primary_reselect_set(struct bonding *bond,
> const struct bond_opt_value *newval)
> {
> - netdev_info(bond->dev, "Setting primary_reselect to %s (%llu)\n",
> - newval->string, newval->value);
> + netdev_dbg(bond->dev, "Setting primary_reselect to %s (%llu)\n",
> + newval->string, newval->value);
> bond->params.primary_reselect = newval->value;
>
> block_netpoll_tx();
> @@ -1178,8 +1177,8 @@ static int bond_option_primary_reselect_set(struct bonding *bond,
> static int bond_option_fail_over_mac_set(struct bonding *bond,
> const struct bond_opt_value *newval)
> {
> - netdev_info(bond->dev, "Setting fail_over_mac to %s (%llu)\n",
> - newval->string, newval->value);
> + netdev_dbg(bond->dev, "Setting fail_over_mac to %s (%llu)\n",
> + newval->string, newval->value);
> bond->params.fail_over_mac = newval->value;
>
> return 0;
> @@ -1188,8 +1187,8 @@ static int bond_option_fail_over_mac_set(struct bonding *bond,
> static int bond_option_xmit_hash_policy_set(struct bonding *bond,
> const struct bond_opt_value *newval)
> {
> - netdev_info(bond->dev, "Setting xmit hash policy to %s (%llu)\n",
> - newval->string, newval->value);
> + netdev_dbg(bond->dev, "Setting xmit hash policy to %s (%llu)\n",
> + newval->string, newval->value);
> bond->params.xmit_policy = newval->value;
>
> return 0;
> @@ -1198,8 +1197,8 @@ static int bond_option_xmit_hash_policy_set(struct bonding *bond,
> static int bond_option_resend_igmp_set(struct bonding *bond,
> const struct bond_opt_value *newval)
> {
> - netdev_info(bond->dev, "Setting resend_igmp to %llu\n",
> - newval->value);
> + netdev_dbg(bond->dev, "Setting resend_igmp to %llu\n",
> + newval->value);
> bond->params.resend_igmp = newval->value;
>
> return 0;
> @@ -1237,8 +1236,8 @@ static int bond_option_all_slaves_active_set(struct bonding *bond,
> static int bond_option_min_links_set(struct bonding *bond,
> const struct bond_opt_value *newval)
> {
> - netdev_info(bond->dev, "Setting min links value to %llu\n",
> - newval->value);
> + netdev_dbg(bond->dev, "Setting min links value to %llu\n",
> + newval->value);
> bond->params.min_links = newval->value;
> bond_set_carrier(bond);
>
> @@ -1256,6 +1255,8 @@ static int bond_option_lp_interval_set(struct bonding *bond,
> static int bond_option_pps_set(struct bonding *bond,
> const struct bond_opt_value *newval)
> {
> + netdev_dbg(bond->dev, "Setting packets per slave to %d\n",
> + newval->value);
> bond->params.packets_per_slave = newval->value;
> if (newval->value > 0) {
> bond->params.reciprocal_packets_per_slave =
> @@ -1274,8 +1275,8 @@ static int bond_option_pps_set(struct bonding *bond,
> static int bond_option_lacp_rate_set(struct bonding *bond,
> const struct bond_opt_value *newval)
> {
> - netdev_info(bond->dev, "Setting LACP rate to %s (%llu)\n",
> - newval->string, newval->value);
> + netdev_dbg(bond->dev, "Setting LACP rate to %s (%llu)\n",
> + newval->string, newval->value);
> bond->params.lacp_fast = newval->value;
> bond_3ad_update_lacp_rate(bond);
>
> @@ -1285,8 +1286,8 @@ static int bond_option_lacp_rate_set(struct bonding *bond,
> static int bond_option_ad_select_set(struct bonding *bond,
> const struct bond_opt_value *newval)
> {
> - netdev_info(bond->dev, "Setting ad_select to %s (%llu)\n",
> - newval->string, newval->value);
> + netdev_dbg(bond->dev, "Setting ad_select to %s (%llu)\n",
> + newval->string, newval->value);
> bond->params.ad_select = newval->value;
>
> return 0;
> @@ -1377,12 +1378,12 @@ static int bond_option_slaves_set(struct bonding *bond,
>
> switch (command[0]) {
> case '+':
> - netdev_info(bond->dev, "Adding slave %s\n", dev->name);
> + netdev_dbg(bond->dev, "Adding slave %s\n", dev->name);
> ret = bond_enslave(bond->dev, dev);
> break;
>
> case '-':
> - netdev_info(bond->dev, "Removing slave %s\n", dev->name);
> + netdev_dbg(bond->dev, "Removing slave %s\n", dev->name);
> ret = bond_release(bond->dev, dev);
> break;
>
> @@ -1402,8 +1403,8 @@ static int bond_option_slaves_set(struct bonding *bond,
> static int bond_option_tlb_dynamic_lb_set(struct bonding *bond,
> const struct bond_opt_value *newval)
> {
> - netdev_info(bond->dev, "Setting dynamic-lb to %s (%llu)\n",
> - newval->string, newval->value);
> + netdev_dbg(bond->dev, "Setting dynamic-lb to %s (%llu)\n",
> + newval->string, newval->value);
> bond->params.tlb_dynamic_lb = newval->value;
>
> return 0;
> @@ -1412,8 +1413,8 @@ static int bond_option_tlb_dynamic_lb_set(struct bonding *bond,
> static int bond_option_ad_actor_sys_prio_set(struct bonding *bond,
> const struct bond_opt_value *newval)
> {
> - netdev_info(bond->dev, "Setting ad_actor_sys_prio to %llu\n",
> - newval->value);
> + netdev_dbg(bond->dev, "Setting ad_actor_sys_prio to %llu\n",
> + newval->value);
>
> bond->params.ad_actor_sys_prio = newval->value;
> bond_3ad_update_ad_actor_settings(bond);
> @@ -1442,7 +1443,7 @@ static int bond_option_ad_actor_system_set(struct bonding *bond,
> if (!is_valid_ether_addr(mac))
> goto err;
>
> - netdev_info(bond->dev, "Setting ad_actor_system to %pM\n", mac);
> + netdev_dbg(bond->dev, "Setting ad_actor_system to %pM\n", mac);
> ether_addr_copy(bond->params.ad_actor_system, mac);
> bond_3ad_update_ad_actor_settings(bond);
>
> @@ -1456,8 +1457,8 @@ static int bond_option_ad_actor_system_set(struct bonding *bond,
> static int bond_option_ad_user_port_key_set(struct bonding *bond,
> const struct bond_opt_value *newval)
> {
> - netdev_info(bond->dev, "Setting ad_user_port_key to %llu\n",
> - newval->value);
> + netdev_dbg(bond->dev, "Setting ad_user_port_key to %llu\n",
> + newval->value);
>
> bond->params.ad_user_port_key = newval->value;
> return 0;
>
^ permalink raw reply
* [PATCH] nfc: Add sockaddr length checks before accessing sa_family in bind handlers
From: Mateusz Jurczyk @ 2017-06-13 16:44 UTC (permalink / raw)
To: Samuel Ortiz, David S. Miller, linux-wireless, netdev,
linux-kernel
Verify that the caller-provided sockaddr structure is large enough to
contain the sa_family field, before accessing it in bind() handlers of the
AF_NFC socket. Since the syscall doesn't enforce a minimum size of the
corresponding memory region, very short sockaddrs (zero or one byte long)
result in operating on uninitialized memory while referencing .sa_family.
Signed-off-by: Mateusz Jurczyk <mjurczyk@google.com>
---
net/nfc/llcp_sock.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/net/nfc/llcp_sock.c b/net/nfc/llcp_sock.c
index 2ffb18e73df6..80cf35ed320a 100644
--- a/net/nfc/llcp_sock.c
+++ b/net/nfc/llcp_sock.c
@@ -77,7 +77,8 @@ static int llcp_sock_bind(struct socket *sock, struct sockaddr *addr, int alen)
struct sockaddr_nfc_llcp llcp_addr;
int len, ret = 0;
- if (!addr || addr->sa_family != AF_NFC)
+ if (!addr || alen < offsetofend(struct sockaddr, sa_family) ||
+ addr->sa_family != AF_NFC)
return -EINVAL;
pr_debug("sk %p addr %p family %d\n", sk, addr, addr->sa_family);
@@ -151,7 +152,8 @@ static int llcp_raw_sock_bind(struct socket *sock, struct sockaddr *addr,
struct sockaddr_nfc_llcp llcp_addr;
int len, ret = 0;
- if (!addr || addr->sa_family != AF_NFC)
+ if (!addr || alen < offsetofend(struct sockaddr, sa_family) ||
+ addr->sa_family != AF_NFC)
return -EINVAL;
pr_debug("sk %p addr %p family %d\n", sk, addr, addr->sa_family);
--
2.13.1.508.gb3defc5cc-goog
^ permalink raw reply related
* Re: [PATCH] Add printk for bonding module packets_per_slave parameter
From: David Miller @ 2017-06-13 16:46 UTC (permalink / raw)
To: joe; +Cc: michael.j.dilmore, j.vosburgh, vfalico, andy, netdev,
linux-kernel
In-Reply-To: <1497370863.18751.15.camel@perches.com>
From: Joe Perches <joe@perches.com>
Date: Tue, 13 Jun 2017 09:21:03 -0700
> On Tue, 2017-06-13 at 11:34 -0400, David Miller wrote:
>> From: Michael Dilmore <michael.j.dilmore@gmail.com>
>> Date: Tue, 13 Jun 2017 14:42:46 +0100
>>
>> > The packets per slave parameter used by round robin mode does not have a printk debug
>> > message in its set function in bond_options.c. Adding such a function would aid debugging
>> > of round-robin mode and allow the user to more easily verify that the parameter has been
>> > set correctly. I should add that I'm motivated by my own experience here - it's not
>> > obvious from output of tools such as wireshark and ifstat that the parameter is working
>> > correctly, and with the differences in bonding configuration across different distributions,
>> > it would have been comforting to see this output.
>> >
>> > Signed-off-by: Michael Dilmore <michael.j.dilmore@gmail.com>
>> >
>> > cc: Veaceslav Falico <vfalico@gmail.com>,Andy Gospodarek <andy@greyhouse.net>,netdev@vger.kernel.org,linux-kernel@vger.kernel.org
>>
>> You can verify things by simplying reading the value back.
>>
>> If every parameter emitted a kernel log message, it would be
>> unreadable.
>>
>> I'm not applying this, sorry.
>
> I agree. Noisy logging output is not good.
>
> Perhaps a general conversion of the dozens
> of existing netdev_info uses in this file to
> netdev_dbg and adding this at netdev_dbg is
> appropriate.
>
> Something like:
Agreed, please submit this formally.
^ permalink raw reply
* Re: [PATCH net-next] of_mdio: move of_mdio_parse_addr to header file
From: Florian Fainelli @ 2017-06-13 16:49 UTC (permalink / raw)
To: Jon Mason, Andrew Lunn, Rob Herring, Frank Rowand
Cc: netdev, devicetree, linux-kernel, Liviu Dudau, Michael Ellerman
In-Reply-To: <1497365768-17627-1-git-send-email-jon.mason@broadcom.com>
On 06/13/2017 07:56 AM, Jon Mason wrote:
> The of_mdio_parse_addr() helper function is useful to other code, but
> the module dependency chain causes issues. To work around this, we can
> move of_mdio_parse_addr() to be an inline function in the header file.
> This gets rid of the dependencies and still allows for the reuse of
> code.
>
> Reported-by: Liviu Dudau <liviu@dudau.co.uk>
> Signed-off-by: Jon Mason <jon.mason@broadcom.com>
> Fixes: 342fa1964439 ("mdio: mux: make child bus walking more permissive and errors more verbose")
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Thanks!
--
Florian
^ permalink raw reply
* Re: [PATCH] r8152: give the device version
From: David Miller @ 2017-06-13 17:00 UTC (permalink / raw)
To: oneukum; +Cc: netdev, hayeswang
In-Reply-To: <20170612115651.8015-1-oneukum@suse.com>
From: Oliver Neukum <oneukum@suse.com>
Date: Mon, 12 Jun 2017 13:56:51 +0200
> Getting the device version out of the driver really aids debugging.
>
> Signed-off-by: Oliver Neukum <oneukum@suse.com>
Applied.
^ permalink raw reply
* Re: [PATCH net-next] net: mvpp2: enable basic 10G support
From: David Miller @ 2017-06-13 17:00 UTC (permalink / raw)
To: antoine.tenart
Cc: gregory.clement, thomas.petazzoni, nadavh, stefanc, mw, linux,
netdev
In-Reply-To: <20170612140139.31377-1-antoine.tenart@free-electrons.com>
From: Antoine Tenart <antoine.tenart@free-electrons.com>
Date: Mon, 12 Jun 2017 16:01:39 +0200
> On GOP port 0 two MAC modes are available: GMAC and XLG. The XLG MAC is
> used for 10G connectivity. This patch adds a basic 10G support by
> allowing to use the XLG MAC on port 0 and by reworking the
> port_enable/disable functions so that the XLG MAC is configured when
> using 10G.
>
> Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
Applied.
^ permalink raw reply
* Re: [PATCH net-next] ibmvnic: Client-initiated failover
From: David Miller @ 2017-06-13 17:00 UTC (permalink / raw)
To: tlfalcon; +Cc: netdev, nfont, jallen
In-Reply-To: <1497288904-15259-1-git-send-email-tlfalcon@linux.vnet.ibm.com>
From: Thomas Falcon <tlfalcon@linux.vnet.ibm.com>
Date: Mon, 12 Jun 2017 12:35:04 -0500
> The IBM vNIC protocol provides support for the user to initiate
> a failover from the client LPAR in case the current backing infrastructure
> is deemed inadequate or in an error state.
>
> Support for two H_VIOCTL sub-commands for vNIC devices are required
> to implement this function. These commands are H_GET_SESSION_TOKEN
> and H_SESSION_ERR_DETECTED.
>
> "[H_GET_SESSION_TOKEN] is used to obtain a session token from a VNIC client
> adapter. This token is opaque to the caller and is intended to be used in
> tandem with the SESSION_ERROR_DETECTED vioctl subfunction."
>
> "[H_SESSION_ERR_DETECTED] is used to report that the currently active
> backing device for a VNIC client adapter is behaving poorly, and that
> the hypervisor should attempt to fail over to a different backing device,
> if one is available."
>
> To provide tools access to this functionality the vNIC driver creates a
> sysfs file that, when written to, will send a request to pHyp to failover
> to a different backing device.
>
> Signed-off-by: Thomas Falcon <tlfalcon@linux.vnet.ibm.com>
Applied.
^ permalink raw reply
* Re: [PATCH net-next] ibmvnic: Remove netdev notify for failover resets
From: David Miller @ 2017-06-13 17:00 UTC (permalink / raw)
To: nfont; +Cc: netdev
In-Reply-To: <20170613004745.52815.48392.stgit@ltcalpine2-lp23.aus.stglabs.ibm.com>
From: Nathan Fontenot <nfont@linux.vnet.ibm.com>
Date: Mon, 12 Jun 2017 20:47:45 -0400
> When handling a driver reset due to a failover of the backing
> server on the vios, doing the netdev_notify_peers() can cause
> network traffic to stall or halt. Remove the netdev notify call
> for failover resets.
>
> Signed-off-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>
Applied.
^ permalink raw reply
* Re: [PATCH 0/2] MDIO bus reset GPIO cleanups
From: David Miller @ 2017-06-13 17:00 UTC (permalink / raw)
To: sergei.shtylyov
Cc: andrew, f.fainelli, robh+dt, frowand.list, netdev, devicetree
In-Reply-To: <20170612205537.977289294@cogentembedded.com>
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Date: Mon, 12 Jun 2017 23:55:37 +0300
> Commit 4c5e7a2c0501 ("dt-bindings: mdio: Clarify binding document")
> declared that a MDIO reset GPIO property should have only a single GPIO
> reference/specifier, however the supporting code was left intact...
> Here's a couple of the obvious cleanups to that code:
>
> [1/2] mdio_bus: handle only single PHY reset GPIO
> [2/2] mdio_bus: use devm_gpiod_get_optional()
Series applied.
^ permalink raw reply
* Re: [PATCH] Add printk for bonding module packets_per_slave parameter
From: Joe Perches @ 2017-06-13 17:00 UTC (permalink / raw)
To: jtoppins, David Miller, michael.j.dilmore
Cc: j.vosburgh, vfalico, andy, netdev, linux-kernel, nikolay
In-Reply-To: <dffd68fa-66bf-7709-7df7-7aa5e0e2ed44@redhat.com>
On Tue, 2017-06-13 at 12:42 -0400, Jonathan Toppins wrote:
> On 06/13/2017 12:21 PM, Joe Perches wrote:
> > On Tue, 2017-06-13 at 11:34 -0400, David Miller wrote:
> > > From: Michael Dilmore <michael.j.dilmore@gmail.com>
> > > Date: Tue, 13 Jun 2017 14:42:46 +0100
> > >
> > > > The packets per slave parameter used by round robin mode does not have a printk debug
> > > > message in its set function in bond_options.c. Adding such a function would aid debugging
> > > > of round-robin mode and allow the user to more easily verify that the parameter has been
> > > > set correctly. I should add that I'm motivated by my own experience here - it's not
> > > > obvious from output of tools such as wireshark and ifstat that the parameter is working
> > > > correctly, and with the differences in bonding configuration across different distributions,
> > > > it would have been comforting to see this output.
[]
> > > You can verify things by simplying reading the value back.
> > >
> > > If every parameter emitted a kernel log message, it would be
> > > unreadable.
> > >
> > > I'm not applying this, sorry.
> >
> > I agree. Noisy logging output is not good.
> >
> > Perhaps a general conversion of the dozens
> > of existing netdev_info uses in this file to
> > netdev_dbg and adding this at netdev_dbg is
> > appropriate.
>
> In general I agree. The few times I have debugged bonds, I always ended
> up enabling debug prinks anyway. I don't see a problem moving these to
> debug as well.
>
> Adding nik whom converted a lot of this code to common paths for input.
If Nikolay agrees with the conversion, it's trivial.
Please submit it. I did it just for reference.
Stylistic nits about the existing file:
There are some inconsistencies in pr_info/pr_err uses
with invalid inputs.
It would also be nicer if the forward static declarations
were removed and the static definitions reordered.
^ permalink raw reply
* Re: [PATCH] netconsole: Remove duplicate "netconsole: " logging prefix
From: David Miller @ 2017-06-13 17:01 UTC (permalink / raw)
To: joe; +Cc: linux-kernel, netdev
In-Reply-To: <a61deabca48ccbbfb1b0d077881d114ad0c5bc75.1497310740.git.joe@perches.com>
From: Joe Perches <joe@perches.com>
Date: Mon, 12 Jun 2017 16:39:51 -0700
> It's already added by pr_fmt so remove the explicit use.
>
> Signed-off-by: Joe Perches <joe@perches.com>
Applied.
^ 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