01 Jun, 2016
5 commits
-
The iadev->rx_open[] array holds "iadev->num_vc" pointers (this code
assumes that pointers are 32 bits). So the > here should be >= or else
we could end up reading a garbage pointer from one element beyond the
end of the array.Signed-off-by: Dan Carpenter
Signed-off-by: David S. Miller -
This bug was there when the driver was first added in back in year 2000.
It causes a Smatch warning:drivers/atm/firestream.c:849 process_incoming()
error: buffer overflow 'res_strings' 60
Signed-off-by: David S. Miller -
When create a new vxlan link, example:
ip link add vtap mtu 1440 type vxlan vni 1 dev eth0The argument "mtu" has no effect, because it is not set to conf->mtu. The
default value is used in vxlan_dev_configure function.This problem was introduced by commit 0dfbdf4102b9 (vxlan: Factor out device
configuration).Fixes: 0dfbdf4102b9 (vxlan: Factor out device configuration)
Signed-off-by: Chen Haiquan
Acked-by: Cong Wang
Signed-off-by: David S. Miller -
If CONFIG_DEBUG_OBJECTS_TIMERS=y, hrtimer_init_on_stack() requires
a matching call to destroy_hrtimer_on_stack() to clean up timer
debug objects.Signed-off-by: Guenter Roeck
Signed-off-by: David S. Miller -
hrtimer_init_on_stack() needs a matching call to
destroy_hrtimer_on_stack(), so both need to be exported.Signed-off-by: Guenter Roeck
Signed-off-by: David S. Miller
30 May, 2016
9 commits
-
l2tp_ip6 tunnel and session lookups were still using init_net, although
the l2tp core infrastructure already supports lookups keyed by 'net'.As a result, l2tp_ip6_recv discarded packets for tunnels/sessions
created in namespaces other than the init_net.Fix, by using dev_net(skb->dev) or sock_net(sk) where appropriate.
Signed-off-by: Shmulik Ladkani
Signed-off-by: David S. Miller -
Clarify how secure_redirects works. Mention that RFC1122 always applies.
Signed-off-by: Eric Garver
Signed-off-by: David S. Miller -
Signed-off-by: Edward Cree
Signed-off-by: David S. Miller -
Fix a logic error to avoid potential null pointer dereference.
Signed-off-by: Baozeng Ding
Reviewed-by: Stefan Schmidt
Signed-off-by: David S. Miller -
Since NAPI works by shutting down event interrupts when theres
work and turning them on when theres none, the net driver must
make sure that interrupts are disabled when it reschedules polling.
By calling napi_reschedule, the driver switches to polling mode,
therefor there should be no interrupt interference.
Any received packets will be handled in nps_enet_poll by polling the HW
indication of received packet until all packets are handled.Signed-off-by: Elad Kanfi
Acked-by: Noam Camus
Tested-by: Alexey Brodkin
Signed-off-by: David S. Miller -
Use %*ph specifier to dump small buffers in hex format instead doing this
byte-by-byte.Signed-off-by: Andy Shevchenko
Signed-off-by: David S. Miller -
If we pass ERR_PTR(-EFAULT) to kfree() then it's going to oops.
Fixes: 2ece068e1b1d ('ptp: use memdup_user().')
Signed-off-by: Dan Carpenter
Acked-by: Richard Cochran
Signed-off-by: David S. Miller -
A previous patch added the fou6.ko module, but that failed to link
in a couple of configurations:net/built-in.o: In function `ip6_tnl_encap_add_fou_ops':
net/ipv6/fou6.c:88: undefined reference to `ip6_tnl_encap_add_ops'
net/ipv6/fou6.c:94: undefined reference to `ip6_tnl_encap_add_ops'
net/ipv6/fou6.c:97: undefined reference to `ip6_tnl_encap_del_ops'
net/built-in.o: In function `ip6_tnl_encap_del_fou_ops':
net/ipv6/fou6.c:106: undefined reference to `ip6_tnl_encap_del_ops'
net/ipv6/fou6.c:107: undefined reference to `ip6_tnl_encap_del_ops'If CONFIG_IPV6=m, ip6_tnl_encap_add_ops/ip6_tnl_encap_del_ops
are in a module, but fou6.c can still be built-in, and that
obviously fails to link.Also, if CONFIG_IPV6=y, but CONFIG_IPV6_TUNNEL=m or
CONFIG_IPV6_TUNNEL=n, the same problem happens for a different
reason.This adds two new silent Kconfig symbols to work around both
problems:- CONFIG_IPV6_FOU is now always set to 'm' if either CONFIG_NET_FOU=m
or CONFIG_IPV6=m
- CONFIG_IPV6_FOU_TUNNEL is set implicitly when IPV6_FOU is enabled
and NET_FOU_IP_TUNNELS is also turned out, and it will ensure
that CONFIG_IPV6_TUNNEL is also available.The options could be made user-visible as well, to give additional
room for configuration, but it seems easier not to bother users
with more choice here.Signed-off-by: Arnd Bergmann
Fixes: aa3463d65e7b ("fou: Add encap ops for IPv6 tunnels")
Signed-off-by: David S. Miller -
A recent cleanup moved MAX_IPTUN_ENCAP_OPS along with some other
definitions, but it is now invisible when CONFIG_INET is
not defined, but still referenced from ip6_tunnel.h:In file included from net/xfrm/xfrm_input.c:17:0:
include/net/ip6_tunnel.h:67:17: error: 'MAX_IPTUN_ENCAP_OPS' undeclared here (not in a function)
ip6tun_encaps[MAX_IPTUN_ENCAP_OPS];
^~~~~~~~~~~~~~~~~~~This hides the ip6_encap_hlen and ip6_tnl_encap functions inside
of CONFIG_INET so we don't run into the the problem.Alternatively we could move the macro out of the #ifdef again to
restore the previous behaviorSigned-off-by: Arnd Bergmann
Fixes: 55c2bc143224 ("net: Cleanup encap items in ip_tunnels.h")
Signed-off-by: David S. Miller
27 May, 2016
9 commits
-
Yuval Mintz says:
====================
qed*: Bug fixesThis series contain several small fixes, most of which deal with
either 100g support, sriov or bandwidth configurations.
====================Signed-off-by: David S. Miller
-
Currently 100g devices don't support minimum/maximum BW configurations,
yet link flaps might cause the driver to attempt to do such a
configuration. Prevent this just as we do for the maximum BW.Signed-off-by: Yuval Mintz
Signed-off-by: David S. Miller -
Adapter can support 100g in both MSIx and INTa, but not in MSI.
Signed-off-by: Sudarsana Reddy Kalluru
Signed-off-by: Yuval Mintz
Signed-off-by: David S. Miller -
Some of the HW configurations are currently missing for 100g devices.
This can cause various classification issues, as well as prevent device
from fully reaching line-rate.Signed-off-by: Yuval Mintz
Signed-off-by: David S. Miller -
When DCBx re-negotiation is occurring, the PF's configurations for
maximum and minimum bandwidth guarantees are currently lost.Signed-off-by: Yuval Mintz
Signed-off-by: David S. Miller -
Commit 39651abd2814 ("qed: add support for dcbx") is re-configuring
the QM hw-block as part of its sequence. This is done in attention
handling context which is non-sleepable, yet memory is allocated in
this flow using GFP_KERNEL.Signed-off-by: Sudarsana Reddy Kalluru
Signed-off-by: Yuval Mintz
Signed-off-by: David S. Miller -
PFs and VFs differ in their registered ethtool operations,
but they're using a common function for get_sset_count().
As a result, `ethtool -i' for a VF would indicate it supports
selftest, although that's not the case.Signed-off-by: Yuval Mintz
Signed-off-by: David S. Miller -
Since driver is using a FW-based GRO implementation, this has some
effects on its ability to cope with GRO enablement/disablement.
As a result, driver must perform an inner-reload as a result of a state
change in the offload configuration of said feature.[Failure to do so means network stack would continue to receive
aggregated packets even though user requested the feature to be disabled].Signed-off-by: Yuval Mintz
Signed-off-by: David S. Miller -
VF is currently ignoring the minimum provided by the API,
mistakenly using the maximum for minimum as well.Signed-off-by: Yuval Mintz
Signed-off-by: David S. Miller
26 May, 2016
17 commits
-
Eric Dumazet says:
====================
net/mlx4_en: fix statsmlx4 has various bugs in its ndo_get_stats() and related functions.
This patch series address the obvious issues.
Remaining ones will be discussed later.
====================Signed-off-by: David S. Miller
-
We simply can use the standard net_device stats.
We do not need to clear fields that are already 0.
Signed-off-by: Eric Dumazet
Cc: Willem de Bruijn
Cc: Eugenia Emantayev
Signed-off-by: David S. Miller -
mlx4 uses a private struct net_device_stats in a vain attempt
to avoid races.This is buggy because multiple cpus could call mlx4_en_get_stats()
at the same time, so ret_stats can not guarantee stable results.To fix this, we need to switch to ndo_get_stats64() as this
method provides per-thread storage.This allows to reduce mlx4_en_priv bloat.
Signed-off-by: Eric Dumazet
Cc: Willem de Bruijn
Cc: Eugenia Emantayev
Signed-off-by: David S. Miller -
mlx4_en_clear_stats() clears about everything but few TX ring
fields are missing :
- queue_stopped, wake_queue, tso_packets, xmit_moreSigned-off-by: Eric Dumazet
Cc: Willem de Bruijn
Cc: Eugenia Emantayev
Signed-off-by: David S. Miller -
1) mlx4_en_xmit() can increment priv->stats.tx_dropped, but this variable
is overwritten in mlx4_en_DUMP_ETH_STATS().2) This increment was not SMP safe, as a port might have many TX queues.
Add a per TX ring tx_dropped to fix these issues.
This is u32 as mlx4_en_DUMP_ETH_STATS() will add a 32bit field.
So lets avoid bugs with SNMP agents having to cope with partial
overwraps. (One of these agents being bond_fold_stats())Signed-off-by: Eric Dumazet
Reported-by: Willem de Bruijn
Cc: Eugenia Emantayev
Acked-by: Alexei Starovoitov
Signed-off-by: David S. Miller -
We have this situation: that EP hash table, contains only the EPs
that are listening, while the transports one, has the opposite.
We have to traverse both to dump all.But when we traverse the transports one we will also get EPs that are
in the EP hash if they are listening. In this case, the EP is dumped
twice.We will fix it by checking if the endpoint that is in the endpoint
hash table contains any ep->asoc in there, as it means we will also
find it via transport hash, and thus we can/should skip it, depending
on the filters used, like 'ss -l'.Still, we should NOT skip it if the user is listing only listening
endpoints, because then we are not traversing the transport hash.
so we have to check idiag_states there also.Signed-off-by: Xin Long
Acked-by: Marcelo Ricardo Leitner
Signed-off-by: David S. Miller -
Fix a typo in the driver, replace comma with a semicolon at the end
of statement. While using comma is a legal C here and probably does
not even generate compiler warning, it was unlikely the intention.Signed-off-by: Marek Vasut
Cc: David S. Miller
Cc: Caesar Wang
Cc: Heiko Stuebner
Signed-off-by: David S. Miller -
The memcpy() currently copies mdio_bus_data into new_bus->irq, which
makes no sense, since the mdio_bus_data structure contains more than
just irqs. The code was likely supposed to copy mdio_bus_data->irqs
into the new_bus->irq instead, so fix this.Fixes: e7f4dc3536a4 ("mdio: Move allocation of interrupts into core")
Signed-off-by: Marek Vasut
Cc: David S. Miller
Cc: Giuseppe Cavallaro
Cc: Alexandre Torgue
Reviewed-by: Andrew Lunn
Signed-off-by: David S. Miller -
This patch follows Eric Dumazet's commit 7b70176421 for Atheros
atl1c driver to fix one exactly same bug in alx driver, that the
network link will be lost in 1-5 minutes after the device is up.My laptop Lenovo Y580 with Atheros AR8161 ethernet device hit the
same problem with kernel 4.4, and it will be cured by Jarod Wilson's
commit c406700c for alx driver which get merged in 4.5. But there
are still some alx devices can't function well even with Jarod's
patch, while this patch could make them work fine. More details on
https://bugzilla.kernel.org/show_bug.cgi?id=70761The debug shows the issue is very likely to be related with the RX
DMA address, specifically 0x...f80, if RX buffer get 0x...f80 several
times, their will be RX overflow error and device will stop working.For kernel 4.5.0 with Jarod's patch which works fine with my
AR8161/Lennov Y580, if I made some change to the
__netdev_alloc_skb
--> __alloc_page_frag()
to make the allocated buffer can get an address with 0x...f80,
then the same error happens. If I make it to 0x...f40 or 0x....fc0,
everything will be still fine. So I tend to believe that the
0x..f80 address cause the silicon to behave abnormally.Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=70761
Cc: Eric Dumazet
Cc: Johannes Berg
Cc: Jarod Wilson
Signed-off-by: Feng Tang
Tested-by: Ole Lukoie
Signed-off-by: David S. Miller -
The team_device_event() notifier calls team_compute_features() to fix
vlan_features under team->lock to protect team->port_list. The problem is
that subsequent __team_compute_features() calls netdev_change_features()
to propagate vlan_features to upper vlan devices while team->lock is still
taken. This can lead to deadlock when NETIF_F_LRO is modified on lower
devices or team device itself.Example:
The team0 as active backup with eth0 and eth1 NICs. Both eth0 & eth1 are
LRO capable and LRO is enabled. Thus LRO is also enabled on team0.The command 'ethtool -K team0 lro off' now hangs due to this deadlock:
dev_ethtool()
-> ethtool_set_features()
-> __netdev_update_features(team)
-> netdev_sync_lower_features()
-> netdev_update_features(lower_1)
-> __netdev_update_features(lower_1)
-> netdev_features_change(lower_1)
-> call_netdevice_notifiers(...)
-> team_device_event(lower_1)
-> team_compute_features(team) [TAKES team->lock]
-> netdev_change_features(team)
-> __netdev_update_features(team)
-> netdev_sync_lower_features()
-> netdev_update_features(lower_2)
-> __netdev_update_features(lower_2)
-> netdev_features_change(lower_2)
-> call_netdevice_notifiers(...)
-> team_device_event(lower_2)
-> team_compute_features(team) [DEADLOCK]The bug is present in team from the beginning but it appeared after the commit
fd867d5 (net/core: generic support for disabling netdev features down stack)
that adds synchronization of features with lower devices.Fixes: fd867d5 (net/core: generic support for disabling netdev features down stack)
Cc: Jiri Pirko
Signed-off-by: Ivan Vecera
Signed-off-by: Jiri Pirko
Signed-off-by: David S. Miller -
Florian Fainelli says:
====================
Documentation: dsa: misc fixesHere are some miscelaneous documentation fixes for DSA, I targeted "net"
because these are not functional code changes, but still documentation fixes
per-se.Changes in v2:
- reword what the port_vlan_filtering is about based on feedback from Vivien and Ido
====================Signed-off-by: David S. Miller
-
Described what the port_vlan_filtering function is supposed to
accomplish.Fixes: fb2dabad69f0 ("net: dsa: support VLAN filtering switchdev attr")
Signed-off-by: Florian Fainelli
Reviewed-by: Vivien Didelot
Signed-off-by: David S. Miller -
We no longer have a priv_size structure member since 5feebd0a8a79 ("net:
dsa: Remove allocation of driver private memory")Reviewed-by: Vivien Didelot
Signed-off-by: Florian Fainelli
Signed-off-by: David S. Miller -
This function has been removed in 4baee937b8d5 ("net: dsa: remove DSA
link polling") in favor of using the PHYLIB polling mechanism.Reviewed-by: Vivien Didelot
Signed-off-by: Florian Fainelli
Signed-off-by: David S. Miller -
Otherwise, if we fail to allocate new PIO buffers, our TXQs will try to
use the old ones, which aren't there any more.Fixes: 183233bec810 "sfc: Allocate and link PIO buffers; map them with write-combining"
Signed-off-by: Edward Cree
Signed-off-by: David S. Miller -
Gregory CLEMENT says:
====================
Fix spinlock usage in HWBMthese two patches fix spinlock related issues introduced in v4.6. They
have been reported by Russell King and Jean-Jacques Hiblot.
====================Signed-off-by: David S. Miller
-
When hwbm_pool_add exited in error the spinlock was not released. This
patch fixes this issue.Fixes: 8cb2d8bf57e6 ("net: add a hardware buffer management helper API")
Reported-by: Jean-Jacques Hiblot
Cc:
Signed-off-by: Gregory CLEMENT
Signed-off-by: David S. Miller