]> git.karo-electronics.de Git - karo-tx-linux.git/log
karo-tx-linux.git
7 years agoqed*: Utilize Firmware 8.15.3.0
Mintz, Yuval [Sat, 11 Mar 2017 16:39:18 +0000 (18:39 +0200)]
qed*: Utilize Firmware 8.15.3.0

This patch advances the qed* drivers into using the newer firmware -
This solves several firmware bugs, mostly related [but not limited to]
various init/deinit issues in various offloaded protocols.

It also introduces a major 4-Cached SGE change in firmware, which can be
seen in the storage drivers' changes.

In addition, this firmware is required for supporting the new QL41xxx
series of adapters; While this patch doesn't add the actual support,
the firmware contains the necessary initialization & firmware logic to
operate such adapters [actual support would be added later on].

Changes from Previous versions:
-------------------------------
 - V2 - fix kbuild-test robot warnings

Signed-off-by: Tomer Tayar <Tomer.Tayar@cavium.com>
Signed-off-by: Ram Amrani <Ram.Amrani@cavium.com>
Signed-off-by: Manish Rangankar <Manish.Rangankar@cavium.com>
Signed-off-by: Chad Dupuis <Chad.Dupuis@cavium.com>
Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agoMerge branch 'mpls-ttl-propagation'
David S. Miller [Mon, 13 Mar 2017 22:29:23 +0000 (15:29 -0700)]
Merge branch 'mpls-ttl-propagation'

Robert Shearman says:

====================
mpls: allow TTL propagation from IP packets to be configured

Allow TTL propagation from IP packets to MPLS packets to be
configured. Add a new optional LWT attribute, MPLS_IPTUNNEL_TTL, which
allows the TTL to be set in the resulting MPLS packet, with the value
of 0 having the semantics of enabling propagation of the TTL from the
IP header (i.e. non-zero values disable propagation).

Also allow the configuration to be overridden globally by reusing the
same sysctl to control whether the TTL is propagated from IP packets
into the MPLS header. If the per-LWT attribute is set then it
overrides the global configuration. If the TTL isn't propagated then a
default TTL value is used which can be configured via a new sysctl,
"net.mpls.default_ttl". This is kept separate from the configuration
of whether IP TTL propagation is enabled as it can be used in the
future when non-IP payloads are supported (i.e. where there is no
payload TTL that can be propagated).
====================

Signed-off-by: Robert Shearman <rshearma@brocade.com>
Acked-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agompls: allow TTL propagation from IP packets to be configured
Robert Shearman [Fri, 10 Mar 2017 20:43:25 +0000 (20:43 +0000)]
mpls: allow TTL propagation from IP packets to be configured

Allow TTL propagation from IP packets to MPLS packets to be
configured. Add a new optional LWT attribute, MPLS_IPTUNNEL_TTL, which
allows the TTL to be set in the resulting MPLS packet, with the value
of 0 having the semantics of enabling propagation of the TTL from the
IP header (i.e. non-zero values disable propagation).

Also allow the configuration to be overridden globally by reusing the
same sysctl to control whether the TTL is propagated from IP packets
into the MPLS header. If the per-LWT attribute is set then it
overrides the global configuration. If the TTL isn't propagated then a
default TTL value is used which can be configured via a new sysctl,
"net.mpls.default_ttl". This is kept separate from the configuration
of whether IP TTL propagation is enabled as it can be used in the
future when non-IP payloads are supported (i.e. where there is no
payload TTL that can be propagated).

Signed-off-by: Robert Shearman <rshearma@brocade.com>
Acked-by: David Ahern <dsa@cumulusnetworks.com>
Tested-by: David Ahern <dsa@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agompls: allow TTL propagation to IP packets to be configured
Robert Shearman [Fri, 10 Mar 2017 20:43:24 +0000 (20:43 +0000)]
mpls: allow TTL propagation to IP packets to be configured

Provide the ability to control on a per-route basis whether the TTL
value from an MPLS packet is propagated to an IPv4/IPv6 packet when
the last label is popped as per the theoretical model in RFC 3443
through a new route attribute, RTA_TTL_PROPAGATE which can be 0 to
mean disable propagation and 1 to mean enable propagation.

In order to provide the ability to change the behaviour for packets
arriving with IPv4/IPv6 Explicit Null labels and to provide an easy
way for a user to change the behaviour for all existing routes without
having to reprogram them, a global knob is provided. This is done
through the addition of a new per-namespace sysctl,
"net.mpls.ip_ttl_propagate", which defaults to enabled. If the
per-route attribute is set (either enabled or disabled) then it
overrides the global configuration.

Signed-off-by: Robert Shearman <rshearma@brocade.com>
Acked-by: David Ahern <dsa@cumulusnetworks.com>
Tested-by: David Ahern <dsa@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonet: usb: rtl8150: use new api ethtool_{get|set}_link_ksettings
Philippe Reynes [Sun, 12 Mar 2017 22:16:25 +0000 (23:16 +0100)]
net: usb: rtl8150: use new api ethtool_{get|set}_link_ksettings

The ethtool api {get|set}_settings is deprecated.
We move this driver to new api {get|set}_link_ksettings.

As I don't have the hardware, I'd be very pleased if
someone may test this patch.

Signed-off-by: Philippe Reynes <tremyfr@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonet: usb: r8152: use new api ethtool_{get|set}_link_ksettings
Philippe Reynes [Sun, 12 Mar 2017 21:41:58 +0000 (22:41 +0100)]
net: usb: r8152: use new api ethtool_{get|set}_link_ksettings

The ethtool api {get|set}_settings is deprecated.
We move this driver to new api {get|set}_link_ksettings.

As I don't have the hardware, I'd be very pleased if
someone may test this patch.

Signed-off-by: Philippe Reynes <tremyfr@gmail.com>
Acked-by: Hayes Wang <hayeswang@realtek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonet: usb: catc: use new api ethtool_{get|set}_link_ksettings
Philippe Reynes [Sun, 12 Mar 2017 21:08:26 +0000 (22:08 +0100)]
net: usb: catc: use new api ethtool_{get|set}_link_ksettings

The ethtool api {get|set}_settings is deprecated.
We move this driver to new api {get|set}_link_ksettings.

As I don't have the hardware, I'd be very pleased if
someone may test this patch.

Signed-off-by: Philippe Reynes <tremyfr@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonet: usb: asix88179_178a: use new api ethtool_{get|set}_link_ksettings
Philippe Reynes [Sun, 12 Mar 2017 17:02:36 +0000 (18:02 +0100)]
net: usb: asix88179_178a: use new api ethtool_{get|set}_link_ksettings

The ethtool api {get|set}_settings is deprecated.
We move this driver to new api {get|set}_link_ksettings.

As I don't have the hardware, I'd be very pleased if
someone may test this patch.

Signed-off-by: Philippe Reynes <tremyfr@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonet: tun: use new api ethtool_{get|set}_link_ksettings
Philippe Reynes [Sat, 11 Mar 2017 21:03:50 +0000 (22:03 +0100)]
net: tun: use new api ethtool_{get|set}_link_ksettings

The ethtool api {get|set}_settings is deprecated.
We move this driver to new api {get|set}_link_ksettings.

Signed-off-by: Philippe Reynes <tremyfr@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonet: net_netdev: use new api ethtool_{get|set}_link_ksettings
Philippe Reynes [Thu, 9 Mar 2017 22:10:13 +0000 (23:10 +0100)]
net: net_netdev: use new api ethtool_{get|set}_link_ksettings

The ethtool api {get|set}_settings is deprecated.
We move this driver to new api {get|set}_link_ksettings.

As I don't have the hardware, I'd be very pleased if
someone may test this patch.

Signed-off-by: Philippe Reynes <tremyfr@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agoMerge branch 'gtp-misc-improvements'
David S. Miller [Mon, 13 Mar 2017 20:04:31 +0000 (13:04 -0700)]
Merge branch 'gtp-misc-improvements'

Andreas Schultz says:

====================
gtp: misc improvements

This is a resent of last series that missed the merge window. There
are no changes compared to v4.

v4: Compared to v3 it contains mostly smallish naming and spelling fixes.
It also drops the documentation patch, Harald did a better job with the
documentation and the some things I described do not yet match the implementation.
I'll readd the relevant parts with a follow up series.

This series lays the groundwork for removing the socket references from
the GTP netdevice by removing duplicate code and simplifying the logic on
some code paths.

It slighly changes the GTP genl API by making the socket parameters optional
(though one of them is still required).

The removal of the socket references will break the 1:1 releation between
GTP netdevice and GTP socket that prevents us to support multiple VRFs with
overlapping IP addresse spaces attached to the same GTP-U entity (needed for
multi APN support, coming a follow up series).

Pablo found a socket hold problem in v2. In order to solve that I had to
switch the socket references from the struct socket to the internal
struct sock. This should have no functionl impact, but we can now hang
on to the reference without blocking user space from closing the GTP socket.

v4->v5:
 * resent for new merge window
v3->v4:
 * drop the documentation patch
 * spelling fixes
 * pass nlattr instead of genl_info into gtp_find_dev,
   makes the code slightly more compact and readable
v2->v3:
 * add documentation to explain the goal of all these changes
 * incorporate review comments
 * switch from struct socket to struct sock
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agogtp: add socket to pdp context
Andreas Schultz [Thu, 9 Mar 2017 16:43:02 +0000 (17:43 +0100)]
gtp: add socket to pdp context

Having the socket present in context simplifies the sending logic.
It also fixes the invalid assumption that we have to use the same
sending socket for all client IP's on a specific gtp interface.

Signed-off-by: Andreas Schultz <aschultz@tpip.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agogtp: consolidate pdp context destruction into helper
Andreas Schultz [Thu, 9 Mar 2017 16:43:01 +0000 (17:43 +0100)]
gtp: consolidate pdp context destruction into helper

Consolidate duplicate code into helper.

Signed-off-by: Andreas Schultz <aschultz@tpip.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agogtp: unify genl_find_pdp and prepare for per socket lookup
Andreas Schultz [Thu, 9 Mar 2017 16:43:00 +0000 (17:43 +0100)]
gtp: unify genl_find_pdp and prepare for per socket lookup

This unifies duplicate code into a helper. It also prepares the
groundwork to add a lookup version that uses the socket to find
attached pdp contexts.

Signed-off-by: Andreas Schultz <aschultz@tpip.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agogtp: consolidate gtp socket rx path
Andreas Schultz [Thu, 9 Mar 2017 16:42:59 +0000 (17:42 +0100)]
gtp: consolidate gtp socket rx path

Add network device to gtp context in preparation for splitting
the TEID from the network device.

Use this to rework the socker rx path. Move the common RX part
of v0 and v1 into a helper. Also move the final rx part into
that helper as well.

Signed-off-by: Andreas Schultz <aschultz@tpip.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agogtp: merge gtp_get_net and gtp_genl_find_dev
Andreas Schultz [Thu, 9 Mar 2017 16:42:58 +0000 (17:42 +0100)]
gtp: merge gtp_get_net and gtp_genl_find_dev

Both function are always used together with the final goal to
get the gtp_dev. This simplifies the code by merging them together.

The netdevice lookup is changed to use the regular dev_get_by_index.
The gtp netdevice list is now only used to find the PDP contexts for
imcomming packets. It can be completely eliminated Once the TEID
hash is moved into the GTP socket.

Signed-off-by: Andreas Schultz <aschultz@tpip.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agogtp: make GTP sockets in gtp_newlink optional
Andreas Schultz [Thu, 9 Mar 2017 16:42:57 +0000 (17:42 +0100)]
gtp: make GTP sockets in gtp_newlink optional

Having both GTPv0-U and GTPv1-U is not always desirable.
Fallback from GTPv1-U to GTPv0-U was depreciated from 3GPP
Rel-8 onwards. Post Rel-8 implementation are discuraged
from listening on the v0 port (see 3GPP TS 29.281, Sect. 1).

A future change will completely decouple the sockets from the
network device. Till then, at least one of the sockets needs to
be specified (either v0 or v1), the other is optional.

Signed-off-by: Andreas Schultz <aschultz@tpip.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agogtp: switch from struct socket to struct sock for the GTP sockets
Andreas Schultz [Thu, 9 Mar 2017 16:42:56 +0000 (17:42 +0100)]
gtp: switch from struct socket to struct sock for the GTP sockets

After enabling the UDP encapsulation, only the sk member is used.

Holding the socket would prevent user space from closing the socket,
but holding a reference to the sk member does not have the same
effect.

This change will make it simpler to later detach the sockets from
the netdevice.

Signed-off-by: Andreas Schultz <aschultz@tpip.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonet: stmmac: added default rx queue size in stmmac_dma_interrupt
Joao Pinto [Mon, 13 Mar 2017 10:36:29 +0000 (10:36 +0000)]
net: stmmac: added default rx queue size in stmmac_dma_interrupt

This patch adds the rx queue default size when dma interrupts are treated,
since dma op mode can be also set there.

Signed-off-by: Joao Pinto <jpinto@synopsys.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonet: stmmac: set default number of rx and tx queues in stmmac_pci
Joao Pinto [Mon, 13 Mar 2017 10:07:07 +0000 (10:07 +0000)]
net: stmmac: set default number of rx and tx queues in stmmac_pci

This patch configures default number of RX and TX queues when
using the pci glue driver.

Signed-off-by: Joao Pinto <jpinto@synopsys.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agosch_tbf: Remove bogus semicolon in if() conditional.
David S. Miller [Mon, 13 Mar 2017 07:00:03 +0000 (00:00 -0700)]
sch_tbf: Remove bogus semicolon in if() conditional.

Fixes: 49b499718fa1 ("net: sched: make default fifo qdiscs appear in the dump")
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agor8169: replace init_timer with setup_timer
Zhu Yanjun [Sun, 12 Mar 2017 09:02:54 +0000 (05:02 -0400)]
r8169: replace init_timer with setup_timer

Replace init_timer with setup_timer to simplify the source code.

Signed-off-by: Zhu Yanjun <yanjun.zhu@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agoMerge branch 'mv88e6xxx-rework-ATU-support'
David S. Miller [Mon, 13 Mar 2017 06:54:08 +0000 (23:54 -0700)]
Merge branch 'mv88e6xxx-rework-ATU-support'

Vivien Didelot says:

====================
net: dsa: mv88e6xxx: rework ATU support

The purpose of this patch series is to rework the code related to the
Address Translation Unit (ATU), and bring support for it to the 88E6390
family of switch chips.

All Global (1) ATU related code have been reworked and moved to its own
file. Some port related bits used for ATU configuration (such as the
Learn2All and MessagePort feature) have also been taken care of.

The ports' mode and egress flooding mode have been refactored to fix the
egress of frames with unknown unicast or multicast destination address,
and write all these bits regardless the port mode (Normal, DSA, etc.)

Finally remove the eth_addr_greater which was only used by mv88e6xxx.

Changes in v2:
  - add Reviewed-by tags
  - split mv88e6xxx_g1_atu_set_age_time and mv88e6xxx_atu_setup addition
  - remove DSA_TAG_PROTO_TRAILER check
  - split Message Port and Learn2All addition
  - remove unused MV88E6XXX_FLAG_G1_ATU_FID flag
  - add dsa_is_normal_port helper
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agoetherdevice: remove unused eth_addr_greater
Vivien Didelot [Sat, 11 Mar 2017 21:13:03 +0000 (16:13 -0500)]
etherdevice: remove unused eth_addr_greater

eth_addr_greater() was introduced for the mv88e6xxx driver, but is not
used anymore. There is no other user, thus remove this function.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonet: dsa: mv88e6xxx: add port priority override op
Vivien Didelot [Sat, 11 Mar 2017 21:13:02 +0000 (16:13 -0500)]
net: dsa: mv88e6xxx: add port priority override op

Add a new operation to disable the DA, SA and VTU priority override.

Setting such limit is not likely to be used soon, so provide a
port_disable_pri_override operation directly. This can be changed later
for port_set_pri_override when we'll need it.

Also remove the now obsolete mv88e6xxx_6320_family helper.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonet: dsa: mv88e6xxx: add port ATU learn limit op
Vivien Didelot [Sat, 11 Mar 2017 21:13:01 +0000 (16:13 -0500)]
net: dsa: mv88e6xxx: add port ATU learn limit op

Add a new operation to disable the limiting of learnt MAC addresses.

Setting such limit is not likely to be used soon, so provide a
port_disable_learn_limit operation directly. This can be changed later
for port_set_learn_limit when we'll need it.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonet: dsa: mv88e6xxx: fix port egress flooding mode
Vivien Didelot [Sat, 11 Mar 2017 21:13:00 +0000 (16:13 -0500)]
net: dsa: mv88e6xxx: fix port egress flooding mode

The Marvell switch ports can be configured to allow or prevent egress of
frames with an unknown unicast or multicast destination address.

Some switch chips such as 88E6095 and 88E6185 have two disjoint bits in
Port Control Register (0x04) bit 2 "Forward Unknown" (for unicast) and
Port Control 2 Register (0x08) bit 6 "Default Forward" (for multicast).

Other chips such as 88E608588E612388E6352, and 88E6390 have a 2-bit
value in Port Control Register (0x04) bits 3:2 "EgressFloods".

The current code does not fully implement the disjoint bits variant and
assigns incorrect ones to some chip models. Fix that with two
implementation references (6185 and 6352 that I currently have) of a
port_set_egress_floods operation (as named in datasheets).

Old chips such as 88E6060 don't have egress flooding mode, so don't
error out if the operation is not provided.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonet: dsa: mv88e6xxx: rework port mode setup
Vivien Didelot [Sat, 11 Mar 2017 21:12:59 +0000 (16:12 -0500)]
net: dsa: mv88e6xxx: rework port mode setup

A switch port mode is defined by the association of its egress mode, its
frame mode and if supported or required, the ether type value.

Pack all this in a mv88e6xxx_set_port_mode function and provide helpers
for the Normal Network mode, the DSA mode, and the Ether Type DSA mode,
as well as an helper to setup a port's mode depending on its nature.

Define PORT_ETH_TYPE_DEFAULT for the 0x9100 reset value of port E Type.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonet: dsa: add dsa_is_normal_port helper
Vivien Didelot [Sat, 11 Mar 2017 21:12:58 +0000 (16:12 -0500)]
net: dsa: add dsa_is_normal_port helper

Introduce a dsa_is_normal_port helper to check if a given port is a
normal user port as opposed to a CPU port or DSA link.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonet: dsa: mv88e6xxx: rename the port vector member
Vivien Didelot [Sat, 11 Mar 2017 21:12:57 +0000 (16:12 -0500)]
net: dsa: mv88e6xxx: rename the port vector member

Not all Marvell switch chips support port trunking, which is embedded in
the port vector data for ATU operations.

Rename the portv_trunkid member of the mv88e6xxx_atu_entry structure to
portvec to be more concise and consistent with the different chips.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonet: dsa: mv88e6xxx: rename new FID helper
Vivien Didelot [Sat, 11 Mar 2017 21:12:56 +0000 (16:12 -0500)]
net: dsa: mv88e6xxx: rename new FID helper

Rename the _mv88e6xxx_fid_new helper to mv88e6xxx_atu_new to get rid of
the old underscore prefix naming convention and be consistent with the
rest of the chip-wide ATU API.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonet: dsa: mv88e6xxx: rework ATU Remove
Vivien Didelot [Sat, 11 Mar 2017 21:12:55 +0000 (16:12 -0500)]
net: dsa: mv88e6xxx: rework ATU Remove

Add a fresh documented implementation of the ATU Move operation, and use
it to replace the current ATU Remove operation.

Note that not all Marvell switch chip support the ATU Move operation.
For those supporting it, the number of bits used to mask the destination
port may vary. 6352 and such use 4-bit, while 6390 use 5-bit. Thus add a
new atu_move_port_mask member in the info structure to describe the
presence and variant of ATU Move operation.

Note that the ATU Move operation is not documented in the 6185 datasheet
but the chip does support the operation.

All remaining _mv88e6xxx_atu_* functions are now unused as well as the
MV88E6XXX_FLAG_G1_ATU_FID flag, thus remove them.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonet: dsa: mv88e6xxx: rework ATU Flush
Vivien Didelot [Sat, 11 Mar 2017 21:12:54 +0000 (16:12 -0500)]
net: dsa: mv88e6xxx: rework ATU Flush

Add a fresh documented implementation of the ATU Flush/Move operation.
Use it to replace the current ATU Flush operation.

_mv88e6xxx_atu_flush_move is still used by the Move operation so keep it
until the Move operation is refactored in a next commit.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonet: dsa: mv88e6xxx: rework ATU GetNext
Vivien Didelot [Sat, 11 Mar 2017 21:12:53 +0000 (16:12 -0500)]
net: dsa: mv88e6xxx: rework ATU GetNext

Add and use a fresh documented implementation of the ATU GetNext.

Since it is not necessary to write the MAC address to iterate from, only
do it once directly in the ATU GetNext operation, if the provided ATU
entry structure is not valid. This makes the user code simpler.

Also, there is no need to loop when getting a single ATU entry. So
remove the mv88e6xxx_atu_get helper and add a simpler snippet in
mv88e6xxx_port_db_load_purge to lookup a given MAC address.

The _mv88e6xxx_atu_mac_{read,write} are not used anymore thus remove
them. _mv88e6xxx_atu_data_{read,write} are still used so keep them.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonet: dsa: mv88e6xxx: rework ATU Load/Purge
Vivien Didelot [Sat, 11 Mar 2017 21:12:52 +0000 (16:12 -0500)]
net: dsa: mv88e6xxx: rework ATU Load/Purge

All Marvell switch chips have an ATU accessed using the same Global (1)
register layout. Only the handling of the FID differs as more bits were
necessary to support more and more databases.

Add and use a fresh documented implementation of the ATU Load/Purge.

The static mv88e6xxx_g1_atu_{fid_write,op_wait,op,data_write,mac_write}
functions won't need to be exposed in the end so for the moment keep
their counterparts _mv88e6xxx_atu_{wait,cmd,data_write,mac_write} as is,
since they are still used by other ATU operations.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonet: dsa: mv88e6xxx: enable ATU Learn2All
Vivien Didelot [Sat, 11 Mar 2017 21:12:51 +0000 (16:12 -0500)]
net: dsa: mv88e6xxx: enable ATU Learn2All

The ATU Learn2All feature allows newly learnt addresses to be spanned on
ports marked as "Message Port", currently all DSA ports.

This commit enables this feature which is necessary and quite convenient
for multi-chip switch fabrics.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonet: dsa: mv88e6xxx: setup message ports
Vivien Didelot [Sat, 11 Mar 2017 21:12:50 +0000 (16:12 -0500)]
net: dsa: mv88e6xxx: setup message ports

All interconnectable Marvell switch chips have an ATU Learn2All feature
which allows newly learnt addresses to be spanned on ports marked as
"Message Port".

This commit configures the DSA ports as Message Port. Note that this has
no effect until the Learn2All feature is enabled.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonet: dsa: mv88e6xxx: add ATU setup helper
Vivien Didelot [Sat, 11 Mar 2017 21:12:49 +0000 (16:12 -0500)]
net: dsa: mv88e6xxx: add ATU setup helper

Move the configuration of the default ageing time in a new
mv88e6xxx_atu_setup function.

That function will be extended later to contain all ATU related
configuration bits.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonet: dsa: mv88e6xxx: move ATU ageing time setter
Vivien Didelot [Sat, 11 Mar 2017 21:12:48 +0000 (16:12 -0500)]
net: dsa: mv88e6xxx: move ATU ageing time setter

Move the ATU ageing time setter code in a new global1_atu.c file, which
will be extended in future patches to contains all consequent Global (1)
ATU support code.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonet: dsa: mv88e6xxx: add port mask helper
Vivien Didelot [Sat, 11 Mar 2017 21:12:47 +0000 (16:12 -0500)]
net: dsa: mv88e6xxx: add port mask helper

Add a mv88e6xxx_port_mask() helper to get the bitmask of ports in a
switch chip, that will be used in several features.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agoMerge branch 'mlxsw-tc-flower-offload-stats'
David S. Miller [Mon, 13 Mar 2017 06:50:15 +0000 (23:50 -0700)]
Merge branch 'mlxsw-tc-flower-offload-stats'

Jiri Pirko says:

====================
mlxsw: Add support for TC flower offload statistics

Arkadi says:
This patchset adds support for retrieving TC flower statistics for
offloaded rules, which includes packets count, bytes count and last used
time stamp. Currently The statistics are gathered on a per-rule basis.

This patchset also includes generic allocator for counters.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agomlxsw: spectrum: Add support for TC flower offload statistics
Arkadi Sharshevsky [Sat, 11 Mar 2017 08:42:59 +0000 (09:42 +0100)]
mlxsw: spectrum: Add support for TC flower offload statistics

Add support for TC flower offload statistics including number of packets,
bytes and last use timestamp. Currently the statistics are gathered on a
per-rule basis.

Signed-off-by: Arkadi Sharshvesky <arkadis@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agomlxsw: spectrum: Add support for counters on TCAM entries
Arkadi Sharshevsky [Sat, 11 Mar 2017 08:42:58 +0000 (09:42 +0100)]
mlxsw: spectrum: Add support for counters on TCAM entries

Add support for packets and byte statistics on TCAM entries. The counters
are allocated from the generic flow counters pool.

Signed-off-by: Arkadi Sharshevsky <arkadis@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agomlxsw: spectrum: Add support for Policing and Counting action block
Arkadi Sharshevsky [Sat, 11 Mar 2017 08:42:57 +0000 (09:42 +0100)]
mlxsw: spectrum: Add support for Policing and Counting action block

Add support for Policing and Counting action block. This action block
will be used to bind counter to TCAM entries.

Signed-off-by: Arkadi Sharshevsky <arkadis@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agomlxsw: spectrum: Add periodic ACL rule activity update
Arkadi Sharshevsky [Sat, 11 Mar 2017 08:42:56 +0000 (09:42 +0100)]
mlxsw: spectrum: Add periodic ACL rule activity update

Introduce periodic task for dumping the activity status for the ACL
rule TCAM entries. This is done in order to emulate last use statistics.

Signed-off-by: Arkadi Sharshevsky <arkadis@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.comi>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agomlxsw: spectrum: Add support for direct rule access
Arkadi Sharshevsky [Sat, 11 Mar 2017 08:42:55 +0000 (09:42 +0100)]
mlxsw: spectrum: Add support for direct rule access

Currently the ACL rules can be accessed only by hashing. In order to
dump the activity the rules are also placed in a list.

Signed-off-by: Arkadi Sharshevsky <arkadis@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agomlxsw: spectrum_acl_tcam: Add support for retrieving TCAM entry activity
Arkadi Sharshevsky [Sat, 11 Mar 2017 08:42:54 +0000 (09:42 +0100)]
mlxsw: spectrum_acl_tcam: Add support for retrieving TCAM entry activity

Add support for retrieving TCAM entry activity. In order to support ACL
rule activity corresponding TCAM entry should be queried.

Signed-off-by: Arkadi Sharshevsky <arkadis@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agomlxsw: spectrum: Add support for generic flow counter allocation
Arkadi Sharshevsky [Sat, 11 Mar 2017 08:42:53 +0000 (09:42 +0100)]
mlxsw: spectrum: Add support for generic flow counter allocation

Add support for allocating generic flow counter. Generic flow counter
can count packets or packets and bytes and can be assigned to different
hardware processes. First use will be for counting packets and bytes of
ACL rules, and will be introduced in the following patches.

Signed-off-by: Arkadi Sharshevsky <arkadis@mellanox.com>
Reviewed-by: Ido schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agomlxsw: reg: Add Monitoring General Purpose Counter Set register
Arkadi Sharshevsky [Sat, 11 Mar 2017 08:42:52 +0000 (09:42 +0100)]
mlxsw: reg: Add Monitoring General Purpose Counter Set register

The MGPC register retrieves generic flow counter value. It will be
used to query ACL counters.

Signed-off-by: Arkadi Sharshevsky <arkadis@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agomlxsw: spectrum: Add support for counter allocator
Arkadi Sharshevsky [Sat, 11 Mar 2017 08:42:51 +0000 (09:42 +0100)]
mlxsw: spectrum: Add support for counter allocator

Add implementation for counter allocator. The ASIC has special memory
pool for various counting purposes. Counter memory is distributed between
equal size banks.

The static sub-pool configuration should specify the following parameters
for each sub-pool:
- Number of required banks.
- Maximum entry size.

Each module can add dedicated sub-pool or use existing one.

Signed-off-by: Arkadi Sharshevsky <arkadis@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agodrop_monitor: use setup_timer
Geliang Tang [Sat, 11 Mar 2017 00:46:59 +0000 (08:46 +0800)]
drop_monitor: use setup_timer

Use setup_timer() instead of init_timer() to simplify the code.

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agoambassador: use setup_timer
Geliang Tang [Sat, 11 Mar 2017 00:46:56 +0000 (08:46 +0800)]
ambassador: use setup_timer

Use setup_timer() instead of init_timer() to simplify the code.

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agoMerge branch 'nfp-xdp_adjust_head'
David S. Miller [Mon, 13 Mar 2017 06:43:20 +0000 (23:43 -0700)]
Merge branch 'nfp-xdp_adjust_head'

Jakub Kicinski says:

====================
nfp: XDP adjust head support

This series adds support for XDP adjust head.  Bulk of the code
is actually just paying technical debt.  On reconfiguration request
nfp was allocating new resources separately leaving device running
with the existing set of rings.  We used to manage the new resources
in special ring set structures.  This set is simply separating the
datapath part of the device structure from the control information
allowing the new datapath structure to be allocated with all new
memory and rings.  The swap operation is now greatly simplified.
We also save a lot of parameter passing this way.  Hopefully the churn
is worth the negative diffstat.

Support for XDP adjust head is done in a pretty standard way.  NFP
is a bit special because it prepends metadata before packet data
so we have to do a bit of memcpying in case XDP will run.  We also
luck out a little bit because the fact that we already have prepend
space allocated means that one byte is enough to store the extra XDP
space (256 of standard prepend space is a bit inconvenient since
it would normally require 16bits or boolean with additional shifts).
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonfp: add support for xdp_adjust_head()
Jakub Kicinski [Fri, 10 Mar 2017 18:38:39 +0000 (10:38 -0800)]
nfp: add support for xdp_adjust_head()

Support prepending data from XDP.  We are already always allocating
some headroom because FW may prepend metadata to packets.
xdp_adjust_head() can be supported by making sure that headroom is
big enough for XDP.  In case FW had prepended metadata to the packet,
however, we have to move it out of the way before we call XDP.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonfp: prepare metadata handling for xdp_adjust_head()
Jakub Kicinski [Fri, 10 Mar 2017 18:38:38 +0000 (10:38 -0800)]
nfp: prepare metadata handling for xdp_adjust_head()

XDP may require us to move metadata to make room for pushing
headers.  Track meta data location with a pointer and pass
it explicitly to functions.

While at it validate that meta_len from the descriptor is not
bogus.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonfp: reorganize pkt_off variable
Jakub Kicinski [Fri, 10 Mar 2017 18:38:37 +0000 (10:38 -0800)]
nfp: reorganize pkt_off variable

Rename pkt_off variable to dma_off, it should hold data offset
counting from beginning of DMA mapping.  Compute the value only
in XDP context.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonfp: validate rx offset from the BAR and size down it's field
Jakub Kicinski [Fri, 10 Mar 2017 18:38:36 +0000 (10:38 -0800)]
nfp: validate rx offset from the BAR and size down it's field

NFP_NET_CFG_RX_OFFSET is 32bit wide, make sure what we read from
there is reasonable for packet headroom.  This allows us to store
the rx_offset in a 8bit variable.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonfp: store dma direction in data path structure
Jakub Kicinski [Fri, 10 Mar 2017 18:38:35 +0000 (10:38 -0800)]
nfp: store dma direction in data path structure

Instead of testing if xdp_prog is present store the dma direction
in data path structure.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonfp: switch to using data path structures for reconfiguration
Jakub Kicinski [Fri, 10 Mar 2017 18:38:34 +0000 (10:38 -0800)]
nfp: switch to using data path structures for reconfiguration

Instead of passing around sets of rings and their parameters just
store all information in the data path structure.

We will no longer user xchg() on XDP programs when we swap programs
while the traffic is guaranteed not to be flowing.  This allows us
to simply assign the entire data path structures instead of copying
field by field.

The optimization to reallocate only the rings on the side (RX/TX)
which has been changed is also removed since it seems like it's not
worth the code complexity.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonfp: use dp to carry xdp_prog at reconfig time
Jakub Kicinski [Fri, 10 Mar 2017 18:38:33 +0000 (10:38 -0800)]
nfp: use dp to carry xdp_prog at reconfig time

Use xdp_prog member of data path struct to carry the xdp_prog to
alloc/free free functions.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonfp: use dp to carry mtu at reconfig time
Jakub Kicinski [Fri, 10 Mar 2017 18:38:32 +0000 (10:38 -0800)]
nfp: use dp to carry mtu at reconfig time

Move the mtu member from ring set to data path struct.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonfp: use dp to carry fl_bufsz at reconfig time
Jakub Kicinski [Fri, 10 Mar 2017 18:38:31 +0000 (10:38 -0800)]
nfp: use dp to carry fl_bufsz at reconfig time

Use fl_bufsz member of data path struct to carry desired size of
free list entries.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonfp: use dp to carry number of stack tx rings and vectors
Jakub Kicinski [Fri, 10 Mar 2017 18:38:30 +0000 (10:38 -0800)]
nfp: use dp to carry number of stack tx rings and vectors

Instead of passing variables around use dp to store number of tx rings
for the stack and number of IRQ vectors.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonfp: pass new data path to ring reconfig
Jakub Kicinski [Fri, 10 Mar 2017 18:38:29 +0000 (10:38 -0800)]
nfp: pass new data path to ring reconfig

Make callers of nfp_net_ring_reconfig() pass newly allocated data
path structure.  We will gradually make use of that structure
instead of passing parameters around to all the allocation functions.
This commit adds allocation and propagation of new data path struct,
no parameters are converted, yet.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonfp: move control BAR pointer into data path structure
Jakub Kicinski [Fri, 10 Mar 2017 18:38:28 +0000 (10:38 -0800)]
nfp: move control BAR pointer into data path structure

Control BAR pointer is used to unmask interrupts so it should be
in the first cacheline of adapter structure.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonfp: separate data path information from the reset of adapter structure
Jakub Kicinski [Fri, 10 Mar 2017 18:38:27 +0000 (10:38 -0800)]
nfp: separate data path information from the reset of adapter structure

Move all data path information into a separate structure.  This way
we will be able to allocate new data path with all new rings etc.
and swap it in easily.

No functional changes.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agoMerge branch 'stmmac-multiqueue-mac-prep'
David S. Miller [Mon, 13 Mar 2017 06:41:04 +0000 (23:41 -0700)]
Merge branch 'stmmac-multiqueue-mac-prep'

Joao Pinto says:

====================
prepare mac operations for multiple queues

As agreed with David Miller, this patch-set is the first of 3 to enable
multiple queues in stmmac.

This first one concentrates on mac operations adding functionalities as:
a) Configuration through DT
b) RX and TX scheduling algorithms programming
b) TX queues weight programming (essential in weightes algorithms)
c) RX enable as DCB or AVB (preparing for future AVB support)
d) Mapping RX queue to DMA channel
e) IRQ treatment prepared for multiple queues
f) Debug dump prepared for multiple queues
g) CBS configuration

In v3 patch-set version I included a new patch to enable CBS configuration
(Patch 9).
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonet: stmmac: configuration of CBS in case of a TX AVB queue
Joao Pinto [Fri, 10 Mar 2017 18:24:59 +0000 (18:24 +0000)]
net: stmmac: configuration of CBS in case of a TX AVB queue

This patch adds the configuration of the AVB Credit-Based Shaper.

Signed-off-by: Joao Pinto <jpinto@synopsys.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonet: stmmac: mac debug prepared for multiple queues
Joao Pinto [Fri, 10 Mar 2017 18:24:58 +0000 (18:24 +0000)]
net: stmmac: mac debug prepared for multiple queues

This patch prepares mac debug dump for multiple queues.

Signed-off-by: Joao Pinto <jpinto@synopsys.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonet: stmmac: prepare irq_status for mtl
Joao Pinto [Fri, 10 Mar 2017 18:24:57 +0000 (18:24 +0000)]
net: stmmac: prepare irq_status for mtl

This patch prepares mac irq status treatment for multiple queues.

Signed-off-by: Joao Pinto <jpinto@synopsys.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonet: stmmac: flow_ctrl functions adapted to mtl
Joao Pinto [Fri, 10 Mar 2017 18:24:56 +0000 (18:24 +0000)]
net: stmmac: flow_ctrl functions adapted to mtl

This patch adapts flow_ctrl function to prepare it for multiple queues.

Signed-off-by: Joao Pinto <jpinto@synopsys.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonet: stmmac: mapping mtl rx to dma channel
Joao Pinto [Fri, 10 Mar 2017 18:24:55 +0000 (18:24 +0000)]
net: stmmac: mapping mtl rx to dma channel

This patch adds the functionality of RX queue to dma channel mapping
based on configuration.

Signed-off-by: Joao Pinto <jpinto@synopsys.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonet: stmmac: mtl rx queue enabled as dcb or avb
Joao Pinto [Fri, 10 Mar 2017 18:24:54 +0000 (18:24 +0000)]
net: stmmac: mtl rx queue enabled as dcb or avb

This patch introduces the enabling of RX queues as DCB or as AVB based
on configuration.

Signed-off-by: Joao Pinto <jpinto@synopsys.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonet: stmmac: configure tx queue weight
Joao Pinto [Fri, 10 Mar 2017 18:24:53 +0000 (18:24 +0000)]
net: stmmac: configure tx queue weight

This patch adds TX queues weight programming.

Signed-off-by: Joao Pinto <jpinto@synopsys.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonet: stmmac: configure mtl rx and tx algorithms
Joao Pinto [Fri, 10 Mar 2017 18:24:52 +0000 (18:24 +0000)]
net: stmmac: configure mtl rx and tx algorithms

This patch adds the RX and TX scheduling algorithms programming.
It introduces the multiple queues configuration function
(stmmac_mtl_configuration) in stmmac_main.

Signed-off-by: Joao Pinto <jpinto@synopsys.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonet: stmmac: multiple queues dt configuration
Joao Pinto [Fri, 10 Mar 2017 18:24:51 +0000 (18:24 +0000)]
net: stmmac: multiple queues dt configuration

This patch adds the multiple queues configuration in the Device Tree.
It was also created a set of structures to keep the RX and TX queues
configurations to be used in the driver.

Signed-off-by: Joao Pinto <jpinto@synopsys.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agoMerge branch 'stmmac-tegra186'
David S. Miller [Mon, 13 Mar 2017 06:35:21 +0000 (23:35 -0700)]
Merge branch 'stmmac-tegra186'

Thierry Reding says:

====================
net: stmmac: Fixes and Tegra186 support

This series of patches start with a few cleanups that I ran across while
adding Tegra186 support to the stmmac driver. It then adds code for FIFO
size parsing from feature registers and finally enables support for the
incarnation of the Synopsys DWC QOS IP found on NVIDIA Tegra186 SoCs.

This is based on next-20170310.

Changes in v2:
- address review comments by Mikko and Joao
- add two additional cleanup patches
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonet: stmmac: dwc-qos: Add Tegra186 support
Thierry Reding [Fri, 10 Mar 2017 16:35:01 +0000 (17:35 +0100)]
net: stmmac: dwc-qos: Add Tegra186 support

The NVIDIA Tegra186 SoC contains an instance of the Synopsys DWC
ethernet QOS IP core. The binding that it uses is slightly different
from existing ones because of the integration (clocks, resets, ...).

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonet: stmmac: dwc-qos: Split out ->probe() and ->remove()
Thierry Reding [Fri, 10 Mar 2017 16:35:00 +0000 (17:35 +0100)]
net: stmmac: dwc-qos: Split out ->probe() and ->remove()

Split out the binding specific parts of ->probe() and ->remove() to
enable the driver to support variants of the binding. This is useful in
order to keep backwards-compatibility while making it easy for a sub-
driver to deal only with the updated bindings rather than having to add
compatibility quirks all over the place.

Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
Reviewed-By: Joao Pinto <jpinto@synopsys.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonet: stmmac: Program RX queue size and flow control
Thierry Reding [Fri, 10 Mar 2017 16:34:59 +0000 (17:34 +0100)]
net: stmmac: Program RX queue size and flow control

Program the receive queue size based on the RX FIFO size and enable
hardware flow control for large FIFOs.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonet: stmmac: Parse FIFO sizes from feature registers
Thierry Reding [Fri, 10 Mar 2017 16:34:58 +0000 (17:34 +0100)]
net: stmmac: Parse FIFO sizes from feature registers

New version of this core encode the FIFO sizes in one of the feature
registers. Use these sizes as default, but still allow device tree to
override them for backwards compatibility.

Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonet: stmmac: Check for DMA mapping errors
Thierry Reding [Fri, 10 Mar 2017 16:34:57 +0000 (17:34 +0100)]
net: stmmac: Check for DMA mapping errors

When DMA mapping an SKB fragment, the mapping must be checked for
errors, otherwise the DMA debug code will complain upon unmap.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonet: stmmac: Balance PTP reference clock enable/disable
Thierry Reding [Fri, 10 Mar 2017 16:34:56 +0000 (17:34 +0100)]
net: stmmac: Balance PTP reference clock enable/disable

clk_prepare_enable() and clk_disable_unprepare() for this clock aren't
properly balanced, which can trigger a WARN_ON() in the common clock
framework.

Reviewed-By: Joao Pinto <jpinto@synopsys.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonet: stmmac: Disable PTP reference clock on error
Thierry Reding [Fri, 10 Mar 2017 16:34:55 +0000 (17:34 +0100)]
net: stmmac: Disable PTP reference clock on error

If an error occurs while opening the device, make sure to disable the
PTP reference clock.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonet: stmmac: Stop PHY and remove TX timer on error
Thierry Reding [Fri, 10 Mar 2017 16:34:54 +0000 (17:34 +0100)]
net: stmmac: Stop PHY and remove TX timer on error

If an error occurs while opening the device, make sure that both the TX
timer and the PHY are properly cleaned up.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonet: stmmac: Rename clk_ptp_ref clock to ptp_ref
Thierry Reding [Fri, 10 Mar 2017 16:34:53 +0000 (17:34 +0100)]
net: stmmac: Rename clk_ptp_ref clock to ptp_ref

There aren't currently any users of the "clk_ptp_ref", but there are
other references to "ptp_ref", so I'm leaning towards considering that a
typo. Fix it.

Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: devicetree@vger.kernel.org
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agovxlan: use appropriate family on L3 miss
Vincent Bernat [Fri, 10 Mar 2017 15:30:24 +0000 (16:30 +0100)]
vxlan: use appropriate family on L3 miss

When sending a L3 miss, the family is set to AF_INET even for IPv6. This
causes userland (eg "ip monitor") to be confused. Ensure we send the
appropriate family in this case. For L2 miss, keep using AF_INET.

Signed-off-by: Vincent Bernat <vincent@bernat.im>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonet: Eliminate duplicated codes by creating one new function in_dev_select_addr
Gao Feng [Fri, 10 Mar 2017 04:38:47 +0000 (12:38 +0800)]
net: Eliminate duplicated codes by creating one new function in_dev_select_addr

There are two duplicated loops codes which used to select right
address in current codes. Now eliminate these codes by creating
one new function in_dev_select_addr.

Signed-off-by: Gao Feng <fgao@ikuai8.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agoMerge branch 'sctp-rx-side-stream-reconf-asoc-reset-and-add-streams-and-response'
David S. Miller [Mon, 13 Mar 2017 06:22:24 +0000 (23:22 -0700)]
Merge branch 'sctp-rx-side-stream-reconf-asoc-reset-and-add-streams-and-response'

Xin Long says:

====================
sctp: add receiver-side procedures for stream reconf asoc reset and add streams and response

Patch 2/7, 4/7, 5/7, 6/7 are to implement the process of asoc reset request,
add streams requests and all kinds of responses.

Patch 1/7 and 3/7 are ahead of 2/7 and 4/7 to add two event notification
for asoc reset and add streams.

Patch 7/7 is the last patch for implementing rfc6525 sctp stream reconf
to add sysctl and sockopt interface for users to enable sctp stream reconf.

After this patchset, sctp stream reconf will be able to work as rfc6525.

v1->v2:
  - put these into a smaller group.
  - rename the titles of the commits and improve some changelogs.
  - improve sctp_chunk_lookup_strreset_param and reuse it in patch 4/7.
  - process addstrm outreq as the ack of in addstrm inreq if strreset_chunk
    is not NULL in patch 4/7.
  - remove the stream alloc when sending addstrm inreq, and the process in
    peer will response it by sending a addstrm out request back in patch 5/7.
  - adjust the process of addstrm in resp to fit in the codes that only alloc
    streams through addstrm outreq in patch 6/7.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agosctp: add get and set sockopt for reconf_enable
Xin Long [Fri, 10 Mar 2017 04:11:12 +0000 (12:11 +0800)]
sctp: add get and set sockopt for reconf_enable

This patchset is to add SCTP_RECONFIG_SUPPORTED sockopt, it would
set and get asoc reconf_enable value when asoc_id is set, or it
would set and get ep reconf_enalbe value if asoc_id is 0.

It is also to add sysctl interface for users to set the default
value for reconf_enable.

After this patch, stream reconf will work.

Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agosctp: implement receiver-side procedures for the Reconf Response Parameter
Xin Long [Fri, 10 Mar 2017 04:11:11 +0000 (12:11 +0800)]
sctp: implement receiver-side procedures for the Reconf Response Parameter

This patch is to implement Receiver-Side Procedures for the
Re-configuration Response Parameter in rfc6525 section 5.2.7.

sctp_process_strreset_resp would process the response for any
kind of reconf request, and the stream reconf is applied only
when the response result is success.

Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agosctp: implement receiver-side procedures for the Add Incoming Streams Request Parameter
Xin Long [Fri, 10 Mar 2017 04:11:10 +0000 (12:11 +0800)]
sctp: implement receiver-side procedures for the Add Incoming Streams Request Parameter

This patch is to implement Receiver-Side Procedures for the Add Incoming
Streams Request Parameter described in rfc6525 section 5.2.6.

It is also to fix that it shouldn't have add streams when sending addstrm
in request, as the process in peer will handle it by sending a addstrm out
request back.

Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agosctp: implement receiver-side procedures for the Add Outgoing Streams Request Parameter
Xin Long [Fri, 10 Mar 2017 04:11:09 +0000 (12:11 +0800)]
sctp: implement receiver-side procedures for the Add Outgoing Streams Request Parameter

This patch is to add Receiver-Side Procedures for the Add Outgoing
Streams Request Parameter described in section 5.2.5.

It is also to improve sctp_chunk_lookup_strreset_param, so that it
can be used for processing addstrm_out request.

Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agosctp: add support for generating add stream change event notification
Xin Long [Fri, 10 Mar 2017 04:11:08 +0000 (12:11 +0800)]
sctp: add support for generating add stream change event notification

This patch is to add Stream Change Event described in rfc6525
section 6.1.3.

Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agosctp: implement receiver-side procedures for the SSN/TSN Reset Request Parameter
Xin Long [Fri, 10 Mar 2017 04:11:07 +0000 (12:11 +0800)]
sctp: implement receiver-side procedures for the SSN/TSN Reset Request Parameter

This patch is to implement Receiver-Side Procedures for the SSN/TSN
Reset Request Parameter described in rfc6525 section 6.2.4.

The process is kind of complicate, it's wonth having some comments
from section 6.2.4 in the codes.

Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agosctp: add support for generating assoc reset event notification
Xin Long [Fri, 10 Mar 2017 04:11:06 +0000 (12:11 +0800)]
sctp: add support for generating assoc reset event notification

This patch is to add Association Reset Event described in rfc6525
section 6.1.2.

Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agoliquidio: optimize DMA in NUMA systems
VSR Burru [Fri, 10 Mar 2017 01:03:24 +0000 (17:03 -0800)]
liquidio: optimize DMA in NUMA systems

Optimize DMA in NUMA systems by allocating memory from NUMA node that NIC
is plugged in to; DMA will no longer cross NUMA nodes.  If NIC IRQs are
pinned to a local CPU, that CPU's access to the DMA'd data is also
optimized.

Signed-off-by: VSR Burru <veerasenareddy.burru@cavium.com>
Signed-off-by: Felix Manlunas <felix.manlunas@cavium.com>
Signed-off-by: Raghu Vatsavayi <raghu.vatsavayi@cavium.com>
Signed-off-by: Satanand Burla <satananda.burla@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agoMerge branch 'netvsc-fix-module-removal-hangs'
David S. Miller [Mon, 13 Mar 2017 06:15:44 +0000 (23:15 -0700)]
Merge branch 'netvsc-fix-module-removal-hangs'

Stephen Hemminger says:

====================
netvsc: fix module removal hangs

A couple of patches are necessary to make netvsc driver module
removable again.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonetvsc: fix hang on netvsc module removal
stephen hemminger [Thu, 9 Mar 2017 23:04:15 +0000 (15:04 -0800)]
netvsc: fix hang on netvsc module removal

The code in netvsc_device_remove was incorrectly calling napi_disable
repeatedly on the same element. This would cause attempts
to remove netvsc module to hang.

Fixes: 2506b1dc4bbe ("netvsc: implement NAPI")
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonetvsc: need napi scheduled during removal
stephen hemminger [Thu, 9 Mar 2017 23:04:14 +0000 (15:04 -0800)]
netvsc: need napi scheduled during removal

Since rndis_halt_device waits until all outstanding sends and
receives are completed. Netvsc device needs to still schedule
NAPI to see those completions.

Fixes: 2506b1dc4bbe ("netvsc: implement NAPI")
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>