]> git.karo-electronics.de Git - linux-beck.git/log
linux-beck.git
8 years agoipv4: Namespaceify tcp_keepalive_time sysctl knob
Nikolay Borisov [Thu, 7 Jan 2016 14:38:43 +0000 (16:38 +0200)]
ipv4: Namespaceify tcp_keepalive_time sysctl knob

Different net namespaces might have different requirements as to
the keepalive time of tcp sockets. This might be required in cases
where different firewall rules are in place which require tcp
timeout sockets to be increased/decreased independently of the host.

Signed-off-by: Nikolay Borisov <kernel@kyup.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agoMerge branch 'mlxsw-layer2-multicast'
David S. Miller [Sun, 10 Jan 2016 21:50:21 +0000 (16:50 -0500)]
Merge branch 'mlxsw-layer2-multicast'

Jiri Pirko says:

====================
mlxsw: Adding layer 2 multicast

Elad says:

This patchset add Linux hardware reflection for L2 multicast offload and add
MC support in mlxsw. For every bridge MDB entry insertion, either by IGMP
snooping or by static insertion/removal, a switchdev ops is been called.
In mlxsw, a new multicast group (MID) is been created and ports are assigned.
When all ports are removed, the multicast group is been deleted.

---
v1->v2:
- GFP_ATOMIC->GFP_KERNEL change in patch 7/8
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agoswitchdev: Adding IGMP snooping documentation
Elad Raz [Sun, 10 Jan 2016 20:06:29 +0000 (21:06 +0100)]
switchdev: Adding IGMP snooping documentation

Signed-off-by: Elad Raz <eladr@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agomlxsw: Adding layer 2 multicast support
Elad Raz [Sun, 10 Jan 2016 20:06:28 +0000 (21:06 +0100)]
mlxsw: Adding layer 2 multicast support

Add SWITCHDEV_OBJ_ID_PORT_MDB switchdev ops support. On first MDB insertion
creates a new multicast group (MID) and add members port to the MID. Also
add new MDB entry for the flooding-domain (fid-vid) and link the MDB entry
to the newly constructed MC group.

Signed-off-by: Elad Raz <eladr@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Reviewed-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agomlxsw: Adding VID to FID translatation
Elad Raz [Sun, 10 Jan 2016 20:06:27 +0000 (21:06 +0100)]
mlxsw: Adding VID to FID translatation

Adding a generic function that translate VID to FID.

Signed-off-by: Elad Raz <eladr@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agomlxsw: Changing the maximum number of multicast group to a define
Elad Raz [Sun, 10 Jan 2016 20:06:26 +0000 (21:06 +0100)]
mlxsw: Changing the maximum number of multicast group to a define

Signed-off-by: Elad Raz <eladr@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agomlxsw: reg: Adding SMID register
Elad Raz [Sun, 10 Jan 2016 20:06:25 +0000 (21:06 +0100)]
mlxsw: reg: Adding SMID register

Adding back SMID register definition and packing. For each MC group a new
SMID entry will be generated.

Signed-off-by: Elad Raz <eladr@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agomlxsw: reg: Add definition of multicast record for SFD register
Elad Raz [Sun, 10 Jan 2016 20:06:24 +0000 (21:06 +0100)]
mlxsw: reg: Add definition of multicast record for SFD register

Multicast-related records have specific format in SFD register.

Signed-off-by: Elad Raz <eladr@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agobridge: Reflect MDB entries to hardware
Elad Raz [Sun, 10 Jan 2016 20:06:23 +0000 (21:06 +0100)]
bridge: Reflect MDB entries to hardware

Offload MDB changes per port to hardware

Signed-off-by: Elad Raz <eladr@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Reviewed-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agoswitchdev: Adding MDB entry offload
Elad Raz [Sun, 10 Jan 2016 20:06:22 +0000 (21:06 +0100)]
switchdev: Adding MDB entry offload

Define HW multicast entry: MAC and VID.
Using a MAC address simplifies support for both IPV4 and IPv6.

Signed-off-by: Elad Raz <eladr@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agoMerge tag 'batman-adv-for-davem' of git://git.open-mesh.org/linux-merge
David S. Miller [Sun, 10 Jan 2016 02:48:36 +0000 (21:48 -0500)]
Merge tag 'batman-adv-for-davem' of git://git.open-mesh.org/linux-merge

Antonio Quartulli says:

====================
Included changes:
- increase internal module version
- increase BLA wait periods to 6
- purge BLA backbone table when it is disabled
- make sure post function is invoked only if sysfs value is changed
- simplify code by removing useless NULL checks
- various corrections to existing kerneldoc
- minor cleanups
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agomlxsw: spectrum: remove FDB entry in case we get unknown object notification
Jiri Pirko [Thu, 7 Jan 2016 10:50:30 +0000 (11:50 +0100)]
mlxsw: spectrum: remove FDB entry in case we get unknown object notification

It may happen that we get notification for FDB entry for object (port,
lag, vport), which does not exist. Currently we ignore that, which only
causes this being re-sent in next notification. The entry will never
disappear. So get rid of it by simply removing it using SFD register.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agomlxsw: spectrum: pass local_port to mlxsw_sp_port_fdb_uc_op
Jiri Pirko [Thu, 7 Jan 2016 10:50:29 +0000 (11:50 +0100)]
mlxsw: spectrum: pass local_port to mlxsw_sp_port_fdb_uc_op

Do not pass struct mlxsw_sp_port to mlxsw_sp_port_fdb_uc_op and rather
just pass local_port. This is needed in case this is called from SFN
process function and mlxsw_sp_port is not existent for particular
local_port.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: plip: use new parport device model
Sudip Mukherjee [Thu, 7 Jan 2016 10:12:37 +0000 (15:42 +0530)]
net: plip: use new parport device model

Modify plip driver to use the new parallel port device model.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agobatman-adv: Add kerneldoc for batadv_neigh_node::refcount
Sven Eckelmann [Sun, 6 Sep 2015 19:38:48 +0000 (21:38 +0200)]
batman-adv: Add kerneldoc for batadv_neigh_node::refcount

Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: Antonio Quartulli <a@unstable.cc>
8 years agobatman-adv: Remove kerneldoc for missing struct members
Sven Eckelmann [Sun, 6 Sep 2015 19:38:47 +0000 (21:38 +0200)]
batman-adv: Remove kerneldoc for missing struct members

Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: Antonio Quartulli <a@unstable.cc>
8 years agobatman-adv: Fix kerneldoc member names in for main structs
Sven Eckelmann [Sun, 6 Sep 2015 19:38:46 +0000 (21:38 +0200)]
batman-adv: Fix kerneldoc member names in for main structs

Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: Antonio Quartulli <a@unstable.cc>
8 years agobatman-adv: Fix kernel-doc parsing of main structs
Sven Eckelmann [Sun, 6 Sep 2015 19:38:45 +0000 (21:38 +0200)]
batman-adv: Fix kernel-doc parsing of main structs

kernel-doc is not able to skip an #ifdef between the kernel documentation
block and the start of the struct. Moving the #ifdef before the kernel doc
block avoids this problem

Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: Antonio Quartulli <a@unstable.cc>
8 years agobatman-adv: Change ifconfig examples to iproute2
Sven Eckelmann [Wed, 28 Oct 2015 09:58:00 +0000 (10:58 +0100)]
batman-adv: Change ifconfig examples to iproute2

Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: Antonio Quartulli <a@unstable.cc>
8 years agobatman-adv: Split a condition check
Markus Elfring [Tue, 3 Nov 2015 18:20:34 +0000 (19:20 +0100)]
batman-adv: Split a condition check

Let us split a check for a condition at the beginning of the
batadv_is_ap_isolated() function so that a direct return can be performed
in this function if the variable "vlan" contained a null pointer.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: Antonio Quartulli <a@unstable.cc>
8 years agobatman-adv: Delete an unnecessary check before the function call "batadv_softif_vlan_...
Markus Elfring [Tue, 3 Nov 2015 18:20:34 +0000 (19:20 +0100)]
batman-adv: Delete an unnecessary check before the function call "batadv_softif_vlan_free_ref"

The batadv_softif_vlan_free_ref() function tests whether its argument is NULL
and then returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: Antonio Quartulli <a@unstable.cc>
8 years agobatman-adv: Less checks in batadv_tvlv_unicast_send()
Markus Elfring [Sun, 15 Nov 2015 08:00:42 +0000 (09:00 +0100)]
batman-adv: Less checks in batadv_tvlv_unicast_send()

* Let us return directly if a call of the batadv_orig_hash_find() function
  returned a null pointer.

* Omit the initialisation for the variable "skb" at the beginning.

* Replace an assignment by a call of the kfree_skb() function
  and delete the affected variable "ret" then.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: Antonio Quartulli <a@unstable.cc>
8 years agobatman-adv: Delete unnecessary checks before the function call "kfree_skb"
Markus Elfring [Sun, 15 Nov 2015 07:04:43 +0000 (08:04 +0100)]
batman-adv: Delete unnecessary checks before the function call "kfree_skb"

The kfree_skb() function tests whether its argument is NULL and then
returns immediately. Thus the test around the calls is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: Antonio Quartulli <a@unstable.cc>
8 years agobatman-adv: Add function to convert string to batadv throughput
Sven Eckelmann [Sun, 13 Sep 2015 07:44:45 +0000 (09:44 +0200)]
batman-adv: Add function to convert string to batadv throughput

The code to convert the throughput information from a string to the
batman-adv internal (100Kibit/s) representation is duplicated in
batadv_parse_gw_bandwidth. Move this functionality to its own function
batadv_parse_throughput to reduce the code complexity.

Signed-off-by: Sven Eckelmann <sven@open-mesh.com>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: Antonio Quartulli <a@unstable.cc>
8 years agobatman-adv: only call post function if something changed
Simon Wunderlich [Tue, 17 Nov 2015 13:11:26 +0000 (14:11 +0100)]
batman-adv: only call post function if something changed

Currently, the post function is also called on errors or if there were
no changes, which is redundant for the functions currently using these
facilities.

Signed-off-by: Simon Wunderlich <simon@open-mesh.com>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: Antonio Quartulli <a@unstable.cc>
8 years agobatman-adv: increase BLA wait periods to 6
Simon Wunderlich [Mon, 9 Nov 2015 15:20:53 +0000 (16:20 +0100)]
batman-adv: increase BLA wait periods to 6

If networks take a long time to come up, e.g. due to lossy links, then
the bridge loop avoidance wait time to suppress broadcasts may not wait
long enough and detect a backbone before the mesh is brought up.
Increasing the wait period further to 60 seconds makes this scenario
less likely.

Signed-off-by: Simon Wunderlich <simon@open-mesh.com>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: Antonio Quartulli <a@unstable.cc>
8 years agobatman-adv: purge bridge loop avoidance when its disabled
Simon Wunderlich [Mon, 9 Nov 2015 15:20:52 +0000 (16:20 +0100)]
batman-adv: purge bridge loop avoidance when its disabled

When bridge loop avoidance is disabled through sysfs, the internal
datastructures are not disabled, but only BLA operations are disabled.
To be sure that they are removed, purge the data immediately. That is
especially useful if a firmwares network state is changed, and the BLA
wait periods should restart on the new network.

Signed-off-by: Simon Wunderlich <simon@open-mesh.com>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: Antonio Quartulli <a@unstable.cc>
8 years agobatman-adv: remove leftovers of unused BATADV_PRIMARIES_FIRST_HOP flag
Marek Lindner [Sun, 9 Aug 2015 15:56:50 +0000 (23:56 +0800)]
batman-adv: remove leftovers of unused BATADV_PRIMARIES_FIRST_HOP flag

Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: Antonio Quartulli <a@unstable.cc>
8 years agobatman-adv: Fix lockdep annotation of batadv_tlv_container_remove
Sven Eckelmann [Tue, 3 Nov 2015 18:20:34 +0000 (19:20 +0100)]
batman-adv: Fix lockdep annotation of batadv_tlv_container_remove

The function handles tlv containers and not tlv handlers. Thus the
lockdep_assert_held has to check for the container_list lock.

Fixes: 2c72d655b044 ("batman-adv: Annotate deleting functions with external lock via lockdep")
Signed-off-by: Sven Eckelmann <sven@open-mesh.com>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: Antonio Quartulli <a@unstable.cc>
8 years agobatman-adv: Start new development cycle
Simon Wunderlich [Mon, 23 Nov 2015 19:30:15 +0000 (20:30 +0100)]
batman-adv: Start new development cycle

Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
Signed-off-by: Antonio Quartulli <a@unstable.cc>
8 years agoMerge branch 'r8152-adjustments'
David S. Miller [Sat, 9 Jan 2016 02:57:26 +0000 (21:57 -0500)]
Merge branch 'r8152-adjustments'

Hayes Wang says:

====================
r8152: code adjustment

Adjust test_bit(), clear_bit(), disable_aldps(), and enable_aldps().
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agor8152: adjust ALDPS function
hayeswang [Thu, 7 Jan 2016 09:51:12 +0000 (17:51 +0800)]
r8152: adjust ALDPS function

Replace disable_aldps() and enable_aldps() with aldps_en().

Signed-off-by: Hayes Wang <hayeswang@realtek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agor8152: use test_and_clear_bit
hayeswang [Thu, 7 Jan 2016 09:51:11 +0000 (17:51 +0800)]
r8152: use test_and_clear_bit

Replace test_bit() followed by clear_bit() with test_and_clear_bit().

Signed-off-by: Hayes Wang <hayeswang@realtek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agobpf: cleanup bpf_prog_run_{save,clear}_cb helpers
Daniel Borkmann [Wed, 6 Jan 2016 21:32:16 +0000 (22:32 +0100)]
bpf: cleanup bpf_prog_run_{save,clear}_cb helpers

Move the details behind the cb[] access into a small helper to decouple
and make them generic for bpf_prog_run_save_cb()/bpf_prog_run_clear_cb()
that was introduced via commit ff936a04e5f2 ("bpf: fix cb access in socket
filter programs"). Also add a comment to better clarify what is done in
bpf_skb_cb().

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agoMerge branch 'net-sparse-warnings'
David S. Miller [Sat, 9 Jan 2016 02:30:50 +0000 (21:30 -0500)]
Merge branch 'net-sparse-warnings'

Lance Richardson says:

====================
ipv4: fix various issues reported by sparse

This trivial patch series addresses a number of endianness- and
lock-related issues reported by sparse.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agoipv4: eliminate lock count warnings in ping.c
Lance Richardson [Wed, 6 Jan 2016 22:22:47 +0000 (17:22 -0500)]
ipv4: eliminate lock count warnings in ping.c

Add lock release/acquire annotations to ping_seq_start() and
ping_seq_stop() to satisfy sparse.

Signed-off-by: Lance Richardson <lrichard@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agoipv4: eliminate endianness warnings in ip_fib.h
Lance Richardson [Wed, 6 Jan 2016 22:22:46 +0000 (17:22 -0500)]
ipv4: eliminate endianness warnings in ip_fib.h

fib_multipath_hash() computes a hash using __be32 values, force
cast these to u32 to pacify sparse.

Signed-off-by: Lance Richardson <lrichard@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agoipv4: fix endianness warnings in ip_tunnel_core.c
Lance Richardson [Wed, 6 Jan 2016 22:22:45 +0000 (17:22 -0500)]
ipv4: fix endianness warnings in ip_tunnel_core.c

Eliminate endianness mismatch warnings (reported by sparse) in this file by
using appropriate nla_put_*()/nla_get_*() calls.

Signed-off-by: Lance Richardson <lrichard@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next
David S. Miller [Sat, 9 Jan 2016 01:53:16 +0000 (20:53 -0500)]
Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next

Pablo Neira Ayuso says:

====================
Netfilter updates for net-next

The following patchset contains Netfilter updates for net-next, they are:

1) Release nf_tables objects on netns destructions via
   nft_release_afinfo().

2) Destroy basechain and rules on netdevice removal in the new netdev
   family.

3) Get rid of defensive check against removal of inactive objects in
   nf_tables.

4) Pass down netns pointer to our existing nfnetlink callbacks, as well
   as commit() and abort() nfnetlink callbacks.

5) Allow to invert limit expression in nf_tables, so we can throttle
   overlimit traffic.

6) Add packet duplication for the netdev family.

7) Add forward expression for the netdev family.

8) Define pr_fmt() in conntrack helpers.

9) Don't leave nfqueue configuration on inconsistent state in case of
   errors, from Ken-ichirou MATSUZAWA, follow up patches are also from
   him.

10) Skip queue option handling after unbind.

11) Return error on unknown both in nfqueue and nflog command.

12) Autoload ctnetlink when NFQA_CFG_F_CONNTRACK is set.

13) Add new NFTA_SET_USERDATA attribute to store user data in sets,
    from Carlos Falgueras.

14) Add support for 64 bit byteordering changes nf_tables, from Florian
    Westphal.

15) Add conntrack byte/packet counter matching support to nf_tables,
    also from Florian.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agoMerge branch '10GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next...
David S. Miller [Fri, 8 Jan 2016 18:31:06 +0000 (13:31 -0500)]
Merge branch '10GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue

Jeff Kirsher says:

====================
10GbE Intel Wired LAN Driver Updates 2016-01-08

This series contains updates to ixgbe only.

Vasu provides three fixes for ixgbe, first assigns a minimum credit to
a traffic class to resolve a Tx hang for CEE mode configuration.  Second
fix changes the driver to use netdev->fcoe_ddp_xid instead of our local
IXGBE_FCOE_DDP_MAX, since it is correctly set for our different devices
and avoids a DDP skip error on X550.  Lastly fix the PFC configuration
to include X550 devices.

Emil provides a fix for reporting the speed in ethtool by using the
stored value in out adapter structure.  This is due to external drivers
may end up with unknown speed when calling ethtool_get_settings().

Mark fixes the handling of any outer UDP checksum, by passing the
skb up with CHECKSUM_NONE when an outer UDP checksum is set.  This
will cause the stack to check the checksum, also do not increment an
error counter because we do not really know if there is an actual error.
Ixgbe ATR was not handling IPv6 extended headers, so ATR is not being
performed on such packets.  Fix this by skipping extended headers
when they are present.

Usha fixes an issue with X550 and getting FDMI HBA attributes when
FCoE support is enabled.

Neerav fixes an issue for X550 when FCoE and SR-IOV are enabled, which
the hardware generates MDD events.  Resolve this by setting the expected
values in the transmit context descriptors for FCoE/FIP frames and
adding a flush after writing the RDLEN register.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agoMerge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetoot...
David S. Miller [Fri, 8 Jan 2016 18:17:31 +0000 (13:17 -0500)]
Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next

Johan Hedberg says:

====================
pull request: bluetooth-next 2016-01-08

Here's one more bluetooth-next pull request for the 4.5 kernel:

 - Support for CRC check and promiscuous mode for CC2520
 - Fixes to btmrvl driver
 - New ACPI IDs for hci_bcm driver
 - Limited Discovery support for the Bluetooth mgmt interface
 - Minor other cleanups here and there

Please let me know if there are any issues pulling. Thanks.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agoMerge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next...
David S. Miller [Fri, 8 Jan 2016 17:44:21 +0000 (12:44 -0500)]
Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue

Jeff Kirsher says:

====================
40GbE Intel Wired LAN Driver Updates 2016-01-08

This series contains updates to i40e and i40evf only.

Mitch adds a useful error message and return value when the VFs are being
reset, since there is a brief window of time when the VF cannot be
configured because they do not have a VSI to configure.  Also made a driver
change to allow the user to specify a zero MAC address for VFs, which
causes the existing MAC address to be removed and allows the VF to use a
random address (like libvirt).

Sowmini Varadhan from Oracle adds similar functionality/fix to i40e that
was added to ixgbe earlier.  The fix attempts to look up the MAC address
in the Open Firmware on systems that support it and use IDPROM on SPARC
if no OF address is found.

Anjali provides a fix the code path so that we do not call skb_set_hash()
if the feature is disabled.

Jesse removes a device ID that has never been productized and there are
no plans to use it, so just remove it.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonetfilter: nft_ct: add byte/packet counter support
Florian Westphal [Thu, 7 Jan 2016 20:34:24 +0000 (21:34 +0100)]
netfilter: nft_ct: add byte/packet counter support

If the accounting extension isn't present, we'll return a counter
value of 0.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
8 years agonetfilter: nft_byteorder: provide 64bit le/be conversion
Florian Westphal [Fri, 8 Jan 2016 09:29:12 +0000 (10:29 +0100)]
netfilter: nft_byteorder: provide 64bit le/be conversion

Needed to convert the (64bit) conntrack counters to BE ordering.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
8 years agonetfilter: nf_tables: Add new attributes into nft_set to store user data.
Carlos Falgueras García [Tue, 5 Jan 2016 13:03:32 +0000 (14:03 +0100)]
netfilter: nf_tables: Add new attributes into nft_set to store user data.

User data is stored at after 'nft_set_ops' private data into 'data[]'
flexible array. The field 'udata' points to user data and 'udlen' stores
its length.

Add new flag NFTA_SET_USERDATA.

Signed-off-by: Carlos Falgueras García <carlosfg@riseup.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
8 years agonetfilter: nfnetlink_log: just returns error for unknown command
Ken-ichirou MATSUZAWA [Tue, 5 Jan 2016 00:34:34 +0000 (09:34 +0900)]
netfilter: nfnetlink_log: just returns error for unknown command

This patch stops processing options for unknown command.

Signed-off-by: Ken-ichirou MATSUZAWA <chamas@h4.dion.ne.jp>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
8 years agonetfilter: nfnetlink_queue: autoload nf_conntrack_netlink module NFQA_CFG_F_CONNTRACK...
Ken-ichirou MATSUZAWA [Tue, 5 Jan 2016 00:32:59 +0000 (09:32 +0900)]
netfilter: nfnetlink_queue: autoload nf_conntrack_netlink module NFQA_CFG_F_CONNTRACK config flag

This patch enables to load nf_conntrack_netlink module if
NFQA_CFG_F_CONNTRACK config flag is specified.

Signed-off-by: Ken-ichirou MATSUZAWA <chamas@h4.dion.ne.jp>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
8 years agonetfilter: nfnetlink_queue: just returns error for unknown command
Ken-ichirou MATSUZAWA [Tue, 5 Jan 2016 00:31:40 +0000 (09:31 +0900)]
netfilter: nfnetlink_queue: just returns error for unknown command

This patch stops processing options for unknown command.

Signed-off-by: Ken-ichirou MATSUZAWA <chamas@h4.dion.ne.jp>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
8 years agonetfilter: nfnetlink_queue: don't handle options after unbind
Ken-ichirou MATSUZAWA [Tue, 5 Jan 2016 00:29:54 +0000 (09:29 +0900)]
netfilter: nfnetlink_queue: don't handle options after unbind

This patch stops processing after destroying a queue instance.

Signed-off-by: Ken-ichirou MATSUZAWA <chamas@h4.dion.ne.jp>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
8 years agonetfilter: nfnetlink_queue: validate dependencies to avoid breaking atomicity
Ken-ichirou MATSUZAWA [Tue, 5 Jan 2016 00:28:05 +0000 (09:28 +0900)]
netfilter: nfnetlink_queue: validate dependencies to avoid breaking atomicity

Check that dependencies are fulfilled before updating the queue
instance, otherwise we can leave things in intermediate state on errors
in nfqnl_recv_config().

Signed-off-by: Ken-ichirou MATSUZAWA <chamas@h4.dion.ne.jp>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
8 years agoixgbe: Make ATR recognize IPv6 extended headers
Mark Rustad [Wed, 9 Dec 2015 22:55:37 +0000 (14:55 -0800)]
ixgbe: Make ATR recognize IPv6 extended headers

Right now ATR is not handling IPv6 extended headers, so ATR is not
being performed on such packets. Fix that by skipping extended
headers when they are present. This also fixes a problem where
the ATR code was not checking that the inner protocol was actually
TCP before setting up the signature rules. Since the protocol check
is intimately involved with the extended header processing as well,
this all gets fixed together.

Signed-off-by: Mark Rustad <mark.d.rustad@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
8 years agoixgbe: Fix MDD events generated when FCoE+SRIOV are enabled
Neerav Parikh [Wed, 9 Dec 2015 06:13:58 +0000 (22:13 -0800)]
ixgbe: Fix MDD events generated when FCoE+SRIOV are enabled

When FCoE is enabled with SR-IOV on the X550 NIC the hardware
generates MDD events.

This patch fixes these by setting the expected values in the
Tx context descriptors for FCoE/FIP frames and adding a flush
after writing the RDLEN register.

Signed-off-by: Neerav Parikh <neerav.parikh@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
8 years agoixgbe: Fix to get FDMI HBA attributes information with X550
Usha Ketineni [Tue, 8 Dec 2015 12:01:18 +0000 (04:01 -0800)]
ixgbe: Fix to get FDMI HBA attributes information with X550

Check whether the FCOE support is enabled for the devices to get the
 FDMI HBA attributes information instead of checking each device id.
Also, add Model string information for X550.

Signed-off-by: Usha Ketineni <usha.k.ketineni@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
8 years agoixgbe: Correct handling of any outer UDP checksum setting
Mark Rustad [Fri, 4 Dec 2015 19:26:43 +0000 (11:26 -0800)]
ixgbe: Correct handling of any outer UDP checksum setting

If an outer UDP checksum is set, pass the skb up with CHECKSUM_NONE
so that the stack will check the checksum. Do not increment an
error counter, because we don't know that there is an actual error.

Signed-off-by: Mark Rustad <mark.d.rustad@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
8 years agoixgbe: do not call check_link for ethtool in ixgbe_get_settings()
Emil Tantilov [Thu, 3 Dec 2015 23:20:06 +0000 (15:20 -0800)]
ixgbe: do not call check_link for ethtool in ixgbe_get_settings()

In ixgbe_get_settings() the link status and speed of the interface
are determined based on a read from the LINKS register via the call
to mac.ops.check.link(). This can cause issues where external drivers
may end up with unknown speed when calling ethtool_get_setings().

Instead of calling the mac.ops.check_link() we can report the speed
from the adapter structure which is populated by the driver.

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
8 years agoixgbe: fix broken PFC with X550
Vasu Dev [Mon, 23 Nov 2015 18:31:25 +0000 (10:31 -0800)]
ixgbe: fix broken PFC with X550

PFC is configuration is skipped for X550 devices due to a incorrect
device id check, fixing that to include X550 PFC configuration.

Signed-off-by: Vasu Dev <vasu.dev@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
8 years agoixgbe: use correct FCoE DDP max check
Vasu Dev [Mon, 23 Nov 2015 18:31:01 +0000 (10:31 -0800)]
ixgbe: use correct FCoE DDP max check

Use fcoe_ddp_xid from netdev as this is correctly set for different
device IDs to avoid DDP skip error on X550 as "xid=0x20b out-of-range"

Signed-off-by: Vasu Dev <vasu.dev@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
8 years agoixgbe: Fill at least min credits to a TC credit refills
Vasu Dev [Mon, 23 Nov 2015 18:30:51 +0000 (10:30 -0800)]
ixgbe: Fill at least min credits to a TC credit refills

Currently credit_refill and credit_max could be zero for a TC and that
is causing Tx hang for CEE mode configuration, so to fix that have at
min credit assigned to a TC and that is as what IEEE mode already does.

Change-ID: If652c133093a21e530f4e9eab09097976f57fb12
Signed-off-by: Vasu Dev <vasu.dev@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
8 years agoi40e: remove forever unused ID
Jesse Brandeburg [Wed, 9 Dec 2015 23:50:22 +0000 (15:50 -0800)]
i40e: remove forever unused ID

Somehow an ID that has never been productized is in the
code.  There are no plans to use it, so just get
rid of it.

Change-ID: I59117d48ea9ee0360b0fe33833ac8092f8a24b4c
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
8 years agoi40e: Fix Rx hash reported to the stack by our driver
Anjali Singhai Jain [Wed, 9 Dec 2015 23:50:21 +0000 (15:50 -0800)]
i40e: Fix Rx hash reported to the stack by our driver

If the driver calls skb_set_hash even with a zero hash, that
indicates to the stack that the hash calculation is offloaded
in hardware. So the Stack doesn't do a SW hash which is required
for load balancing if the user decides to turn of rx-hashing
on our device.

This patch fixes the path so that we do not call skb_set_hash
if the feature is disabled.

Change-ID: Ic4debfa4ff91b5a72e447348a75768ed7a2d3e1b
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
8 years agoi40e: Look up MAC address in Open Firmware or IDPROM
Sowmini Varadhan [Mon, 7 Dec 2015 20:06:34 +0000 (15:06 -0500)]
i40e: Look up MAC address in Open Firmware or IDPROM

This is the i40e equivalent of commit c762dff24c06 ("ixgbe: Look up MAC
address in Open Firmware or IDPROM").

As with that fix, attempt to look up the MAC address in Open Firmware
on systems that support it, and use IDPROM on SPARC if no OF address
is found.

In the case of the i40e there is an assumption that the default mac
address has already been set up as the primary mac filter on probe,
so if this filter is obtained from the Open Firmware or IDPROM, an
explicit write is needed via i40e_aq_mac_address_write() and
i40e_aq_add_macvlan() invocation.

The I40E_FLAG_PF_MAC flag in the platform-private i40e_pf structure
tracks whether a platform-specific mac address was found, in which
case calls to i40e_aq_mac_address_write() and i40e_aq_add_macvlan()
will be triggered.

Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Acked-by: Shannon Nelson <shannon.nelson@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
8 years agoi40e: allow zero MAC address for VFs
Mitch Williams [Tue, 22 Dec 2015 23:34:43 +0000 (15:34 -0800)]
i40e: allow zero MAC address for VFs

Allow the user to specify a zero MAC address for VFs. This removes the
existing MAC address and allows the VF to use a random address. Libvirt
does this normally when removing a VF from a VM.

Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
8 years agoi40e: change log messages and error returns
Mitch Williams [Tue, 22 Dec 2015 23:34:42 +0000 (15:34 -0800)]
i40e: change log messages and error returns

When VFs are being reset, there is a brief window of time when they
cannot be configured because they don't have a VSI to configure. If
a script is quick, it can fall through that window. To avoid
defenestration, log a useful error message and return -EAGAIN.

Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
8 years agoMerge branch 'macb-usrio-cap'
David S. Miller [Thu, 7 Jan 2016 21:26:36 +0000 (16:26 -0500)]
Merge branch 'macb-usrio-cap'

Neil Armstrong says:

====================
Add new capability and macb DT variant

The first patch introduces a new capability bit to disable usage of the
USRIO register on platform not implementing it thus avoiding some external
imprecise aborts on ARM based platforms.
The two last patchs adds a new macb variant compatible name using the
capability, the NP4 SoC uses this particular hardware configuration.

v1: http://lkml.kernel.org/r/1449485914-12883-1-git-send-email-narmstrong@baylibre.com
v2: http://lkml.kernel.org/r/1449582726-6148-1-git-send-email-narmstrong@baylibre.com
v3: http://lkml.kernel.org/r/1451898103-21868-1-git-send-email-narmstrong@baylibre.com
v4: http://lkml.kernel.org/r/1451900573-22657-1-git-send-email-narmstrong@baylibre.com
v5: switch SoC name to non-generic NP4 name
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agodt-bindings: net: macb: Add NP4 macb variant
Neil Armstrong [Tue, 5 Jan 2016 13:39:18 +0000 (14:39 +0100)]
dt-bindings: net: macb: Add NP4 macb variant

Add NP4 macb SoC variant.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: macb: Add NP4 macb config using USRIO_DISABLED
Neil Armstrong [Tue, 5 Jan 2016 13:39:17 +0000 (14:39 +0100)]
net: macb: Add NP4 macb config using USRIO_DISABLED

Declare a new NP4 SoC variant having USRIO_DISABLED as capability bit.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: ethernet: cadence-macb: Add disabled usrio caps
Neil Armstrong [Tue, 5 Jan 2016 13:39:16 +0000 (14:39 +0100)]
net: ethernet: cadence-macb: Add disabled usrio caps

On some platforms, the macb integration does not use the USRIO
register to configure the (R)MII port and clocks.
When the register is not implemented and the MACB error signal
is connected to the bus error, reading or writing to the USRIO
register can trigger some Imprecise External Aborts on ARM platforms.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agoMerge branch 'mdio-devices'
David S. Miller [Thu, 7 Jan 2016 19:31:28 +0000 (14:31 -0500)]
Merge branch 'mdio-devices'

Andrew Lunn says:

====================
Support MDIO devices

The discussions about changing the way DSA probes switches resulted in
the wish to have switches attached to an MDIO bus to be represented as
an MDIO device. However the current code only supports PHYs on MDIO
busses. This patchset remedies this problem. It consists of a number
of cleanups, abstraction for accessing structure members, and
refactoring, as well as adding the concept of a generic MDIO device
and MDIO driver.

v2:
Added Reviewed-by from Florian
Made phydev_name() an inline function
Added phy_attached_info/phy_attached_print() for information about
the attached phy.
Removed now redundant irq setup from of_mdio.c
Dropped hunks from PHYMII ioctl which prevented access to any address
DSA carrier off before phy setup
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agomdio: Abstract device_remove() and device_free()
Andrew Lunn [Wed, 6 Jan 2016 19:11:27 +0000 (20:11 +0100)]
mdio: Abstract device_remove() and device_free()

Make device_free and device_remove operations in the mdio device
structure, so the core code does not need to differentiate between
phy devices and generic mdio devices.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agomdio: Add support for mdio drivers.
Andrew Lunn [Wed, 6 Jan 2016 19:11:26 +0000 (20:11 +0100)]
mdio: Add support for mdio drivers.

Not all devices on an MDIO bus are PHYs. Meaning not all MDIO drivers
are PHY drivers. Add support for generic MDIO drivers.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agomdio_bus: Add comment to mdiobus_scan() and __mdiobus_register()
Andrew Lunn [Wed, 6 Jan 2016 19:11:25 +0000 (20:11 +0100)]
mdio_bus: Add comment to mdiobus_scan() and __mdiobus_register()

Make it clear that mdiobus_scan () will only find devices which have a
vendor/product ID in registers 2 and 3. These are typically PHY
devices. Other sort of MDIO devices, such as switches, are not
expected to be found during the scan.

Similarly, __mdiobus_register(), which calls mdiobus_scan() will only
find PHY devices, and other sorts of MDIO devices are expected to be
instantiated from device tree.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agomdio_bus: Generalise of_mdiobus_link_phydev()
Andrew Lunn [Wed, 6 Jan 2016 19:11:24 +0000 (20:11 +0100)]
mdio_bus: Generalise of_mdiobus_link_phydev()

This function should work with any sort of MDIO device which can be
probed on the bus, not just PHY devices. So generalise it.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agophy: Move phy specific bus match into phy_device
Andrew Lunn [Wed, 6 Jan 2016 19:11:23 +0000 (20:11 +0100)]
phy: Move phy specific bus match into phy_device

Matching a driver to a device has both generic parts, and parts which
are specific to PHY devices. Move the PHY specific parts into
phy_device.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agophy: Centralize setting driver module owner
Andrew Lunn [Wed, 6 Jan 2016 19:11:22 +0000 (20:11 +0100)]
phy: Centralize setting driver module owner

Rather than have each driver set the driver owner field, do it once in
the core code. This will also help with later changes, when the device
structure will move.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agophy: Move PHY PM operations into phy_device
Andrew Lunn [Wed, 6 Jan 2016 19:11:21 +0000 (20:11 +0100)]
phy: Move PHY PM operations into phy_device

The MDIO PM operations are really PHY device PM operations. So move
them into phy_device. This will be needed when we support devices on
the mdio bus which are not PHYs.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agodsa: Register netdev before phy
Andrew Lunn [Wed, 6 Jan 2016 19:11:20 +0000 (20:11 +0100)]
dsa: Register netdev before phy

When the phy is connected, an info message is printed. If the netdev
it is attached to has not been registered yet, the name
'uninitialised' in the output. By registering the netdev first, then
connecting they phy, we can avoid this.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agophy_device: Move phy attributes into phy_device
Andrew Lunn [Wed, 6 Jan 2016 19:11:19 +0000 (20:11 +0100)]
phy_device: Move phy attributes into phy_device

The mdio_bus exports three attributes:

- PHY ID is the unique 32-bits identifier for a MDIO device implementing
  standard MII registers MII_PHYSID1/2, which is not guaranteed to be the
  case for non-standard compliant devices (e.g: Ethernet switches)

- PHY interface describes the data-path of the PHY/MDIO device, which is
  not strictly a PHY thing, but is required and needed for PHY devices to
  function, a MDIO device could be a control device exclusively

- PHY has fixups describes what the PHY driver may have done, so
  completely PHY specific

These are all phy attributes, not generic mdio attributes. So move the
attributes into the phy device code.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agophy: Add API for {un}registering an mdio device to a bus.
Andrew Lunn [Wed, 6 Jan 2016 19:11:18 +0000 (20:11 +0100)]
phy: Add API for {un}registering an mdio device to a bus.

Rather than have drivers directly manipulate the mii_bus structure,
provide and API for registering and unregistering devices on an MDIO
bus, and performing lookups.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agoof: phy: Only register a phy device for phys
Andrew Lunn [Wed, 6 Jan 2016 19:11:17 +0000 (20:11 +0100)]
of: phy: Only register a phy device for phys

We will soon support devices other than phys on the mdio bus. Look at
a child's compatibility string to determine if it is a phy, before
registering a phy device.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agophy: Add an mdio_device structure
Andrew Lunn [Wed, 6 Jan 2016 19:11:16 +0000 (20:11 +0100)]
phy: Add an mdio_device structure

Not all devices attached to an MDIO bus are phys. So add an
mdio_device structure to represent the generic parts of an mdio
device, and place this structure into the phy_device.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agomdio: Move allocation of interrupts into core
Andrew Lunn [Wed, 6 Jan 2016 19:11:15 +0000 (20:11 +0100)]
mdio: Move allocation of interrupts into core

Have mdio_alloc() create the array of interrupt numbers, and
initialize it to POLLING. This is what most MDIO drivers want, so
allowing code to be removed from the drivers.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agophy: mdio-octeon: Use devm_mdiobus_alloc_size()
Andrew Lunn [Wed, 6 Jan 2016 19:11:14 +0000 (20:11 +0100)]
phy: mdio-octeon: Use devm_mdiobus_alloc_size()

Rather than use devm_kzalloc(), use the mdio helper function.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agophy: Centralise print about attached phy
Andrew Lunn [Wed, 6 Jan 2016 19:11:13 +0000 (20:11 +0100)]
phy: Centralise print about attached phy

Many Ethernet drivers contain the same netdev_info() print statement
about the attached phy. Move it into the phy device code. Additionally
add a varargs function which can be used to append additional
information.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agophy: phy_{read|write}_mmd_indirect: get addr from phydev
Andrew Lunn [Wed, 6 Jan 2016 19:11:12 +0000 (20:11 +0100)]
phy: phy_{read|write}_mmd_indirect: get addr from phydev

The address of the device can be determined from the phydev structure,
rather than passing it as a parameter.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: dnet: Use phy_find_first() helper
Andrew Lunn [Wed, 6 Jan 2016 19:11:11 +0000 (20:11 +0100)]
net: dnet: Use phy_find_first() helper

Replace the open coded search for the first phy with a call to the
existing helper function.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agophy: add phydev_name() wrapper
Andrew Lunn [Wed, 6 Jan 2016 19:11:10 +0000 (20:11 +0100)]
phy: add phydev_name() wrapper

Add a phydev_name() function, to help with moving some structure members
from phy_device.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agophy: Add phydev_err() and phydev_dbg() macros
Andrew Lunn [Wed, 6 Jan 2016 19:11:09 +0000 (20:11 +0100)]
phy: Add phydev_err() and phydev_dbg() macros

In preparation for moving some of the phy_device structure members,
add macros for printing errors and debug information.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agophy: Use phy_read() instead of mdiobus_read()
Andrew Lunn [Wed, 6 Jan 2016 19:11:08 +0000 (20:11 +0100)]
phy: Use phy_read() instead of mdiobus_read()

Since we have a phydev, make use of it and the phy_read() function.
This will help with later refactoring.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agomdio: Move mdiobus_read/write operatings into mdio.h
Andrew Lunn [Wed, 6 Jan 2016 19:11:07 +0000 (20:11 +0100)]
mdio: Move mdiobus_read/write operatings into mdio.h

These are logically MDIO operations, not phy operations, so move them
into the mdio header.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agophy: Consistently use addr for address on an MII bus
Andrew Lunn [Wed, 6 Jan 2016 19:11:06 +0000 (20:11 +0100)]
phy: Consistently use addr for address on an MII bus

Within phy.h, an address on an MII bus has been called both addr and
phy_id. phy_id is particularly confusion, since it also means the ID
found in register 3, if the device on the bus is a phy. Consistently
use addr.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
David S. Miller [Thu, 7 Jan 2016 03:54:18 +0000 (22:54 -0500)]
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net

8 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Linus Torvalds [Thu, 7 Jan 2016 00:15:03 +0000 (16:15 -0800)]
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net

Pull networking fixes from David Miller:
 "As usual, there are a couple straggler bug fixes:

   1) qlcnic_alloc_mbx_args() error returns are not checked in qlcnic
      driver.  Fix from Insu Yun.

   2) SKB refcounting bug in connector, from Florian Westphal.

   3) vrf_get_saddr() has to propagate fib_lookup() errors to it's
      callers, from David Ahern.

   4) Fix AF_UNIX splice/bind deadlock, from Rainer Weikusat.

   5) qdisc_rcu_free() fails to free the per-cpu qstats.  Fix from John
      Fastabend.

   6) vmxnet3 driver passes wrong page to dma_map_page(), fix from
     Shrikrishna Khare.

   7) Don't allow zero cwnd in tcp_cwnd_reduction(), from Yuchung Cheng"

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net:
  tcp: fix zero cwnd in tcp_cwnd_reduction
  Driver: Vmxnet3: Fix regression caused by 5738a09
  net: qmi_wwan: Add WeTelecom-WPD600N
  mkiss: fix scribble on freed memory
  net: possible use after free in dst_release
  net: sched: fix missing free per cpu on qstats
  ARM: net: bpf: fix zero right shift
  6pack: fix free memory scribbles
  net: filter: make JITs zero A for SKF_AD_ALU_XOR_X
  bridge: Only call /sbin/bridge-stp for the initial network namespace
  af_unix: Fix splice-bind deadlock
  net: Propagate lookup failure in l3mdev_get_saddr to caller
  r8152: add reset_resume function
  connector: bump skb->users before callback invocation
  cxgb4: correctly handling failed allocation
  qlcnic: correctly handle qlcnic_alloc_mbx_args

8 years agotcp: fix zero cwnd in tcp_cwnd_reduction
Yuchung Cheng [Wed, 6 Jan 2016 20:42:38 +0000 (12:42 -0800)]
tcp: fix zero cwnd in tcp_cwnd_reduction

Patch 3759824da87b ("tcp: PRR uses CRB mode by default and SS mode
conditionally") introduced a bug that cwnd may become 0 when both
inflight and sndcnt are 0 (cwnd = inflight + sndcnt). This may lead
to a div-by-zero if the connection starts another cwnd reduction
phase by setting tp->prior_cwnd to the current cwnd (0) in
tcp_init_cwnd_reduction().

To prevent this we skip PRR operation when nothing is acked or
sacked. Then cwnd must be positive in all cases as long as ssthresh
is positive:

1) The proportional reduction mode
   inflight > ssthresh > 0

2) The reduction bound mode
  a) inflight == ssthresh > 0

  b) inflight < ssthresh
     sndcnt > 0 since newly_acked_sacked > 0 and inflight < ssthresh

Therefore in all cases inflight and sndcnt can not both be 0.
We check invalid tp->prior_cwnd to avoid potential div0 bugs.

In reality this bug is triggered only with a sequence of less common
events.  For example, the connection is terminating an ECN-triggered
cwnd reduction with an inflight 0, then it receives reordered/old
ACKs or DSACKs from prior transmission (which acks nothing). Or the
connection is in fast recovery stage that marks everything lost,
but fails to retransmit due to local issues, then receives data
packets from other end which acks nothing.

Fixes: 3759824da87b ("tcp: PRR uses CRB mode by default and SS mode conditionally")
Reported-by: Oleksandr Natalenko <oleksandr@natalenko.name>
Signed-off-by: Yuchung Cheng <ycheng@google.com>
Signed-off-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: Add eth_platform_get_mac_address() helper.
David S. Miller [Thu, 5 Nov 2015 16:34:57 +0000 (11:34 -0500)]
net: Add eth_platform_get_mac_address() helper.

A repeating pattern in drivers has become to use OF node information
and, if not found, platform specific host information to extract the
ethernet address for a given device.

Currently this is done with a call to of_get_mac_address() and then
some ifdef'd stuff for SPARC.

Consolidate this into a portable routine, and provide the
arch_get_platform_mac_address() weak function hook for all
architectures to implement if they want.

Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agoDriver: Vmxnet3: Fix regression caused by 5738a09
Shrikrishna Khare [Wed, 6 Jan 2016 18:44:27 +0000 (10:44 -0800)]
Driver: Vmxnet3: Fix regression caused by 5738a09

Reported-by: Bingkuo Liu <bingkuol@vmware.com>
Signed-off-by: Shrikrishna Khare <skhare@vmware.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: move ndo_features_check() close to ndo_start_xmit()
Eric Dumazet [Wed, 6 Jan 2016 14:53:50 +0000 (06:53 -0800)]
net: move ndo_features_check() close to ndo_start_xmit()

TX fast path uses ndo_start_xmit(), ndo_features_check() and
ndo_select_queue().

Move ndo_features_check() close to ndo_start_xmit() to increase
data locality.

All "struct net_device_ops" should now be using C99 initializers.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: qmi_wwan: Add WeTelecom-WPD600N
Kristian Evensen [Wed, 6 Jan 2016 13:15:50 +0000 (14:15 +0100)]
net: qmi_wwan: Add WeTelecom-WPD600N

The WeTelecom-WPD600N is an LTE module that, in addition to supporting most
"normal" bands, also supports LTE over 450MHz. Manual testing showed that
only interface number three replies to QMI messages.

Cc: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Kristian Evensen <kristian.evensen@gmail.com>
Acked-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agofsl/fman: double free on probe failure
Dan Carpenter [Wed, 6 Jan 2016 09:59:10 +0000 (12:59 +0300)]
fsl/fman: double free on probe failure

"priv" is allocated with devm_kzalloc() so freeing it here with kfree()
will lead to a double free.

Fixes: 3933961682a3 ('fsl/fman: Add FMan MAC driver')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agofsl/fman: fix the pause_time test
Dan Carpenter [Wed, 6 Jan 2016 09:58:09 +0000 (12:58 +0300)]
fsl/fman: fix the pause_time test

pause_time is unsigned so it can't be less than zero.  The bug means
that we allow invalid pause-times.

Fixes: 57ba4c9b56d8 ('fsl/fman: Add FMan MAC support')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agomlxsw: core: remove an unnecessary condition
Dan Carpenter [Wed, 6 Jan 2016 09:56:30 +0000 (12:56 +0300)]
mlxsw: core: remove an unnecessary condition

We checked "err" on the lines before so we know it's zero here.

These cause a static checker warning because checking known things can
indicate a bug.  Maybe there is a missing assignment or we are checking
the wrong variable.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>