]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/log
mirror_ubuntu-hirsute-kernel.git
4 years agonetlink: limit recursion depth in policy validation
Johannes Berg [Thu, 30 Apr 2020 20:13:06 +0000 (22:13 +0200)]
netlink: limit recursion depth in policy validation

Now that we have nested policies, we can theoretically
recurse forever parsing attributes if a (sub-)policy
refers back to a higher level one. This is a situation
that has happened in nl80211, and we've avoided it there
by not linking it.

Add some code to netlink parsing to limit recursion depth.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonetlink: remove type-unsafe validation_data pointer
Johannes Berg [Thu, 30 Apr 2020 20:13:05 +0000 (22:13 +0200)]
netlink: remove type-unsafe validation_data pointer

In the netlink policy, we currently have a void *validation_data
that's pointing to different things:
 * a u32 value for bitfield32,
 * the netlink policy for nested/nested array
 * the string for NLA_REJECT

Remove the pointer and place appropriate type-safe items in the
union instead.

While at it, completely dissolve the pointer for the bitfield32
case and just put the value there directly.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agoMerge branch 'net-dsa-b53-ARL-improvements'
David S. Miller [Fri, 1 May 2020 00:43:29 +0000 (17:43 -0700)]
Merge branch 'net-dsa-b53-ARL-improvements'

Florian Fainelli says:

====================
net: dsa: b53: ARL improvements

This patch series improves the b53 driver ARL search code by
renaming the ARL entries to be reflective of what they are: bins, and
then introduce the number of buckets so we can properly bound check ARL
searches.

The final patch removes an unused argument.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet: dsa: b53: Remove is_static argument to b53_read_op()
Florian Fainelli [Thu, 30 Apr 2020 18:49:11 +0000 (11:49 -0700)]
net: dsa: b53: Remove is_static argument to b53_read_op()

This argument is not used.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet: dsa: b53: Bound check ARL searches
Florian Fainelli [Thu, 30 Apr 2020 18:49:10 +0000 (11:49 -0700)]
net: dsa: b53: Bound check ARL searches

ARL searches are done by reading two ARL entries at a time, do not cap
the search at 1024 which would only limit us to half of the possible ARL
capacity, but use b53_max_arl_entries() instead which does the right
multiplication between bins and indexes.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet: dsa: b53: Provide number of ARL buckets
Florian Fainelli [Thu, 30 Apr 2020 18:49:09 +0000 (11:49 -0700)]
net: dsa: b53: Provide number of ARL buckets

In preparation for doing proper upper bound checking of FDB/MDB entries
being added to the ARL, provide the number of ARL buckets for each
switch chip we support. All chips have 1024 buckets, except 7278 which
has only 256.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet: dsa: b53: Rename num_arl_entries to num_arl_bins
Florian Fainelli [Thu, 30 Apr 2020 18:49:08 +0000 (11:49 -0700)]
net: dsa: b53: Rename num_arl_entries to num_arl_bins

The variable currently holds the number of ARL bins per ARL buckets,
which is different from the number of ARL entries which would be bins
times buckets. We will be adding a num_arl_buckets in a subsequent patch
so get variables straight now.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agoMerge branch 'r8169-refactor-and-improve-interrupt-coalescing'
David S. Miller [Fri, 1 May 2020 00:39:15 +0000 (17:39 -0700)]
Merge branch 'r8169-refactor-and-improve-interrupt-coalescing'

Heiner Kallweit says:

====================
r8169: refactor and improve interrupt coalescing

Refactor and improve interrupt coalescing.
====================

Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agor8169: add check for invalid parameter combination in rtl_set_coalesce
Heiner Kallweit [Thu, 30 Apr 2020 19:59:48 +0000 (21:59 +0200)]
r8169: add check for invalid parameter combination in rtl_set_coalesce

Realtek provided information about a HW constraint that time limit must
not be set to 0 if the frame limit is >0. Add a check for this and
reject invalid parameter combinations.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agor8169: improve rtl_set_coalesce
Heiner Kallweit [Thu, 30 Apr 2020 19:58:47 +0000 (21:58 +0200)]
r8169: improve rtl_set_coalesce

Use FIELD_PREP() to make the code better readable, and avoid the loop.
No functional change intended.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agor8169: improve interrupt coalescing parameter handling
Heiner Kallweit [Thu, 30 Apr 2020 19:58:06 +0000 (21:58 +0200)]
r8169: improve interrupt coalescing parameter handling

The chip supports only frame limits 0, 4, 8, .. 60 internally.
Returning EINVAL for all val % 4 != 0 seems to be a little bit too
unfriendly to the user. Therefore round up the frame limit to the next
supported value. In addition round up the time limit, else a very low
limit could be rounded down to 0, and interpreted as "ignore value"
by the chip.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agor8169: improve rtl_coalesce_choose_scale
Heiner Kallweit [Thu, 30 Apr 2020 19:57:32 +0000 (21:57 +0200)]
r8169: improve rtl_coalesce_choose_scale

The time limit provided by userspace is multiplied with 1000,
what could result in an overflow. Therefore change the time limit
parameter unit from ns to us, and avoid the problematic operation.
If there's no matching scale because provided time limit is too big,
return ERANGE instead of EINVAL to provide a hint to the user what's
wrong.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agor8169: improve rtl_get_coalesce
Heiner Kallweit [Thu, 30 Apr 2020 19:56:58 +0000 (21:56 +0200)]
r8169: improve rtl_get_coalesce

Use FIELD_GET() macro to make the code better readable. In addition
change the logic to round the time limit up, not down. Reason is that
a time limit <1us would be rounded to 0 currently, what would be
interpreted as "no time limit set".

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agor8169: merge scale for tx and rx irq coalescing
Heiner Kallweit [Thu, 30 Apr 2020 19:56:20 +0000 (21:56 +0200)]
r8169: merge scale for tx and rx irq coalescing

Rx and tx scale are the same always. Simplify the code by using one
scale for rx and tx only.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agor8169: don't pass net_device to irq coalescing sub-functions
Heiner Kallweit [Thu, 30 Apr 2020 19:55:36 +0000 (21:55 +0200)]
r8169: don't pass net_device to irq coalescing sub-functions

The net_device argument is just used to get a struct rtl8169_private
pointer via netdev_priv(). Therefore pass the struct rtl8169_private
pointer directly.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agohsr: remove hsr interface if all slaves are removed
Taehee Yoo [Thu, 30 Apr 2020 17:37:02 +0000 (17:37 +0000)]
hsr: remove hsr interface if all slaves are removed

When all hsr slave interfaces are removed, hsr interface doesn't work.
At that moment, it's fine to remove an unused hsr interface automatically
for saving resources.
That's a common behavior of virtual interfaces.

Signed-off-by: Taehee Yoo <ap420073@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agoMerge branch 'tcp-sack-compression-changes'
David S. Miller [Thu, 30 Apr 2020 20:24:01 +0000 (13:24 -0700)]
Merge branch 'tcp-sack-compression-changes'

Eric Dumazet says:

====================
tcp: sack compression changes

Patch series refines SACK compression.

We had issues with missing SACK when TCP option space is tight.

Uses hrtimer slack to improve performance.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agotcp: add hrtimer slack to sack compression
Eric Dumazet [Thu, 30 Apr 2020 17:35:43 +0000 (10:35 -0700)]
tcp: add hrtimer slack to sack compression

Add a sysctl to control hrtimer slack, default of 100 usec.

This gives the opportunity to reduce system overhead,
and help very short RTT flows.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Soheil Hassas Yeganeh <soheil@google.com>
Acked-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agotcp: tcp_sack_new_ofo_skb() should be more conservative
Eric Dumazet [Thu, 30 Apr 2020 17:35:42 +0000 (10:35 -0700)]
tcp: tcp_sack_new_ofo_skb() should be more conservative

Currently, tcp_sack_new_ofo_skb() sends an ack if prior
acks were 'compressed', if room has to be made in tp->selective_acks[]

But there is no guarantee all four sack ranges can be included
in SACK option. As a matter of fact, when TCP timestamps option
is used, only three SACK ranges can be included.

Lets assume only two ranges can be included, and force the ack:

- When we touch more than 2 ranges in the reordering
  done if tcp_sack_extend() could be done.

- If we have at least 2 ranges when adding a new one.

This enforces that before a range is in third or fourth
position, at least one ACK packet included it in first/second
position.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Soheil Hassas Yeganeh <soheil@google.com>
Acked-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agotcp: add tp->dup_ack_counter
Eric Dumazet [Thu, 30 Apr 2020 17:35:41 +0000 (10:35 -0700)]
tcp: add tp->dup_ack_counter

In commit 86de5921a3d5 ("tcp: defer SACK compression after DupThresh")
I added a TCP_FASTRETRANS_THRESH bias to tp->compressed_ack in order
to enable sack compression only after 3 dupacks.

Since we plan to relax this rule for flows that involve
stacks not requiring this old rule, this patch adds
a distinct tp->dup_ack_counter.

This means the TCP_FASTRETRANS_THRESH value is now used
in a single location that a future patch can adjust:

if (tp->dup_ack_counter < TCP_FASTRETRANS_THRESH) {
tp->dup_ack_counter++;
goto send_now;
}

This patch also introduces tcp_sack_compress_send_ack()
helper to ease following patch comprehension.

This patch refines LINUX_MIB_TCPACKCOMPRESSED to not
count the acks that we had to send if the timer expires
or tcp_sack_compress_send_ack() is sending an ack.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Soheil Hassas Yeganeh <soheil@google.com>
Acked-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agoMerge tag 'mlx5-updates-2020-04-30' of git://git.kernel.org/pub/scm/linux/kernel...
David S. Miller [Thu, 30 Apr 2020 20:15:16 +0000 (13:15 -0700)]
Merge tag 'mlx5-updates-2020-04-30' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux

Saeed Mahameed says:

====================
mlx5-updates-2020-04-30

1) Add release all pages support, From Eran.
   to release all FW pages at once on driver unload, when supported by FW.

2) From Maxim and Tariq, Trivial Data path cleanup and code improvements
   in preparation for their next features, TLS offload and TX performance
    improvements

3) Multiple cleanups.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agoMerge branch 'mlxsw-Prepare-SPAN-API-for-upcoming-changes'
David S. Miller [Thu, 30 Apr 2020 20:02:32 +0000 (13:02 -0700)]
Merge branch 'mlxsw-Prepare-SPAN-API-for-upcoming-changes'

Ido Schimmel says:

====================
mlxsw: Prepare SPAN API for upcoming changes

Switched port analyzer (SPAN) is used for packet mirroring. Over mlxsw
this is achieved by attaching tc-mirred action to either matchall or
flower classifier.

The current API used to configure SPAN consists of two functions:
mlxsw_sp_span_mirror_add() and mlxsw_sp_span_mirror_del().

These two functions pack a lot of different operations:

* SPAN agent configuration: Determining the egress port and optional
  headers that need to encapsulate the mirrored packet (when mirroring
  to a gretap, for example)

* Egress mirror buffer configuration: Allocating / freeing a buffer when
  port is analyzed (inspected) at egress

* SPAN agent binding: Binding the SPAN agent to a trigger, if any. The
  current triggers are incoming / outgoing packet and they are only used
  for matchall-based mirroring

This non-modular design makes it difficult to extend the API for future
changes, such as new mirror targets (CPU) and new global triggers (early
dropped packets, for example).

Therefore, this patch set gradually adds APIs for above mentioned
operations and then converts the two existing users to use it instead of
the old API. No functional changes intended. Tested with existing
mirroring selftests.

Patch set overview:

Patches #1-#5 gradually add the new API
Patches #6-#8 convert existing users to use the new API
Patch #9 removes the old API
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agomlxsw: spectrum_span: Remove old SPAN API
Ido Schimmel [Thu, 30 Apr 2020 17:01:16 +0000 (20:01 +0300)]
mlxsw: spectrum_span: Remove old SPAN API

Remove the old SPAN API now that matchall-based and flower-based
mirroring were converted to use the new API.

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agomlxsw: spectrum_span: Use new analyzed ports list during speed / MTU change
Ido Schimmel [Thu, 30 Apr 2020 17:01:15 +0000 (20:01 +0300)]
mlxsw: spectrum_span: Use new analyzed ports list during speed / MTU change

As previously explained, each port whose outgoing traffic is analyzed
needs to have an egress mirror buffer.

The size of the egress mirror buffer is calculated based on various
parameters, two of which are the speed and the MTU of the port.

Therefore, when the MTU or the speed of a port change, the SPAN code is
called to see if the egress mirror buffer of the port needs to be
adjusted.

Currently, this is done by traversing all the SPAN agents and for each
SPAN agent the list of bound ports is traversed.

Instead of the above, traverse the recently added list of analyzed
ports.

This will later allow us to remove the old SPAN API.

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agomlxsw: spectrum_acl: Convert flower-based mirroring to new SPAN API
Ido Schimmel [Thu, 30 Apr 2020 17:01:14 +0000 (20:01 +0300)]
mlxsw: spectrum_acl: Convert flower-based mirroring to new SPAN API

In flower-based mirroring, mirroring is done with ACLs and the SPAN
agent is not bound to a port. Instead its identifier is specified in an
ACL action.

Convert this type of mirroring to use the new API.

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agomlxsw: spectrum: Convert matchall-based mirroring to new SPAN API
Ido Schimmel [Thu, 30 Apr 2020 17:01:13 +0000 (20:01 +0300)]
mlxsw: spectrum: Convert matchall-based mirroring to new SPAN API

In matchall-based mirroring, mirroring is not done with ACLs, but a SPAN
agent is bound to the ingress / egress of a port and all incoming /
outgoing traffic is mirrored.

Convert this type of mirroring to use the new API.

First the SPAN agent is resolved, then the port is marked as analyzed
and its egress mirror buffer is potentially allocated. Lastly, the
binding is performed.

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agomlxsw: spectrum_span: Add APIs to bind / unbind a SPAN agent
Ido Schimmel [Thu, 30 Apr 2020 17:01:12 +0000 (20:01 +0300)]
mlxsw: spectrum_span: Add APIs to bind / unbind a SPAN agent

Currently, a SPAN agent can only be bound to a per-port trigger where
the trigger is either an incoming packet (INGRESS) or an outgoing packet
(EGRESS) to / from the port.

A follow-up patch set will introduce the concept of global triggers and
per-{port, TC} enablement. With global triggers, the trigger entry is
only keyed by a trigger and not by a port and a trigger. The trigger can
be, for example, a packet that was early dropped.

While the binding between the SPAN agent and the trigger is performed
only once, the trigger entry needs to be reference counted, as the
trigger can be enabled on multiple ports.

Add APIs to bind / unbind a SPAN agent to a trigger and reference count
the trigger entry in preparation for global triggers.

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agomlxsw: spectrum_span: Wrap buffer change in a function
Ido Schimmel [Thu, 30 Apr 2020 17:01:11 +0000 (20:01 +0300)]
mlxsw: spectrum_span: Wrap buffer change in a function

The code that adjusts the egress buffer size is not symmetric at the
moment. The update is done via a call to
mlxsw_sp_span_port_buffer_update(), but the disablement is done inline
by invoking the write to SBIB register directly.

Wrap the disablement code in mlxsw_sp_span_port_buffer_disable().

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Suggested-by: Petr Machata <petrm@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agomlxsw: spectrum_span: Rename function
Ido Schimmel [Thu, 30 Apr 2020 17:01:10 +0000 (20:01 +0300)]
mlxsw: spectrum_span: Rename function

Next patch will introduce mlxsw_sp_span_port_buffer_disable() function
that disables the egress buffer on an analyzed port. Rename the opposite
function that updates the buffer on an analyzed port accordingly.

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Suggested-by: Petr Machata <petrm@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agomlxsw: spectrum_span: Add APIs to get / put an analyzed port
Ido Schimmel [Thu, 30 Apr 2020 17:01:09 +0000 (20:01 +0300)]
mlxsw: spectrum_span: Add APIs to get / put an analyzed port

An analyzed port is a port whose incoming / outgoing traffic is mirrored
to a SPAN agent and analyzed on a remote server.

A port can be analyzed by multiple tc filters and therefore the
corresponding analyzed port entry needs to be reference counted. This is
significant because ports whose outgoing traffic is analyzed need to
have an egress mirror buffer.

Add APIs to get / put an analyzed port. Allocate an egress mirror buffer
on a port when it is first inspected at egress and free the buffer when
it is no longer inspected at egress.

Protect the list of analyzed ports with a mutex, as a later patch will
traverse it from a context in which RTNL lock is not held.

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agomlxsw: spectrum_span: Add APIs to get / put a SPAN agent
Ido Schimmel [Thu, 30 Apr 2020 17:01:08 +0000 (20:01 +0300)]
mlxsw: spectrum_span: Add APIs to get / put a SPAN agent

Given a netdev that packets should be mirrored to, create a SPAN agent
and return its identifier to the caller.

The SPAN agent is reference counted, as multiple tc-mirred actions can
point to the same destination netdev.

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agoMerge branch 'net-ReST-part-two'
David S. Miller [Thu, 30 Apr 2020 19:56:39 +0000 (12:56 -0700)]
Merge branch 'net-ReST-part-two'

Mauro Carvalho Chehab says:

====================
net: manually convert files to ReST format - part 2

That's the second part of my work to convert the networking
text files into ReST. it is based on today's linux-next (next-20200430).

The full series (including those ones) are at:

https://git.linuxtv.org/mchehab/experimental.git/log/?h=net-docs

I should be sending the remaining patches (another /38 series)
after getting those merged at -next.

The documents, converted to HTML via the building system are at:

https://www.infradead.org/~mchehab/kernel_docs/networking/
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agodocs: networking: convert tproxy.txt to ReST
Mauro Carvalho Chehab [Thu, 30 Apr 2020 16:04:32 +0000 (18:04 +0200)]
docs: networking: convert tproxy.txt to ReST

- add SPDX header;
- adjust title markup;
- mark code blocks and literals as such;
- adjust identation, whitespaces and blank lines where needed;
- add to networking/index.rst.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agodocs: networking: convert timestamping.txt to ReST
Mauro Carvalho Chehab [Thu, 30 Apr 2020 16:04:31 +0000 (18:04 +0200)]
docs: networking: convert timestamping.txt to ReST

- add SPDX header;
- add a document title;
- adjust titles and chapters, adding proper markups;
- mark code blocks and literals as such;
- adjust identation, whitespaces and blank lines where needed;
- add to networking/index.rst.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agodocs: networking: convert team.txt to ReST
Mauro Carvalho Chehab [Thu, 30 Apr 2020 16:04:30 +0000 (18:04 +0200)]
docs: networking: convert team.txt to ReST

Not much to be done here:
- add SPDX header;
- add a document title;
- add to networking/index.rst.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agodocs: networking: convert tcp-thin.txt to ReST
Mauro Carvalho Chehab [Thu, 30 Apr 2020 16:04:29 +0000 (18:04 +0200)]
docs: networking: convert tcp-thin.txt to ReST

Not much to be done here:

- add SPDX header;
- adjust identation, whitespaces and blank lines where needed;
- add to networking/index.rst.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agodocs: networking: convert tc-actions-env-rules.txt to ReST
Mauro Carvalho Chehab [Thu, 30 Apr 2020 16:04:28 +0000 (18:04 +0200)]
docs: networking: convert tc-actions-env-rules.txt to ReST

- add SPDX header;
- add a document title;
- use the right numbered list markup;
- adjust identation, whitespaces and blank lines where needed;
- add to networking/index.rst.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agodocs: networking: convert switchdev.txt to ReST
Mauro Carvalho Chehab [Thu, 30 Apr 2020 16:04:27 +0000 (18:04 +0200)]
docs: networking: convert switchdev.txt to ReST

- add SPDX header;
- use copyright symbol;
- adjust title markup;
- mark code blocks and literals as such;
- mark tables as such;
- adjust identation, whitespaces and blank lines where needed;
- add to networking/index.rst.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agodocs: networking: convert strparser.txt to ReST
Mauro Carvalho Chehab [Thu, 30 Apr 2020 16:04:26 +0000 (18:04 +0200)]
docs: networking: convert strparser.txt to ReST

- add SPDX header;
- adjust title markup;
- mark code blocks and literals as such;
- mark tables as such;
- adjust identation, whitespaces and blank lines where needed;
- add to networking/index.rst.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agodocs: networking: convert skfp.txt to ReST
Mauro Carvalho Chehab [Thu, 30 Apr 2020 16:04:25 +0000 (18:04 +0200)]
docs: networking: convert skfp.txt to ReST

- add SPDX header;
- use copyright symbol;
- add a document title;
- adjust titles and chapters, adding proper markups;
- comment out text-only TOC from html/pdf output;
- adjust identation, whitespaces and blank lines where needed;
- add to networking/index.rst.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agodocs: networking: convert seg6-sysctl.txt to ReST
Mauro Carvalho Chehab [Thu, 30 Apr 2020 16:04:24 +0000 (18:04 +0200)]
docs: networking: convert seg6-sysctl.txt to ReST

- add SPDX header;
- mark code blocks and literals as such;
- add a document title;
- adjust chapters, adding proper markups;
- mark lists as such;
- add to networking/index.rst.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agodocs: networking: convert secid.txt to ReST
Mauro Carvalho Chehab [Thu, 30 Apr 2020 16:04:23 +0000 (18:04 +0200)]
docs: networking: convert secid.txt to ReST

Not much to be done here:
- add SPDX header;
- add a document title;
- add to networking/index.rst.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agodocs: networking: convert sctp.txt to ReST
Mauro Carvalho Chehab [Thu, 30 Apr 2020 16:04:22 +0000 (18:04 +0200)]
docs: networking: convert sctp.txt to ReST

- add SPDX header;
- add a document title;
- adjust identation, whitespaces and blank lines where needed;
- add to networking/index.rst.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agodocs: networking: convert rxrpc.txt to ReST
Mauro Carvalho Chehab [Thu, 30 Apr 2020 16:04:21 +0000 (18:04 +0200)]
docs: networking: convert rxrpc.txt to ReST

- add SPDX header;
- adjust title markup;
- use autonumbered list markups;
- mark code blocks and literals as such;
- mark tables as such;
- adjust identation, whitespaces and blank lines where needed;
- add to networking/index.rst.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agodocs: networking: convert regulatory.txt to ReST
Mauro Carvalho Chehab [Thu, 30 Apr 2020 16:04:20 +0000 (18:04 +0200)]
docs: networking: convert regulatory.txt to ReST

- add SPDX header;
- adjust title markup;
- mark code blocks and literals as such;
- adjust identation, whitespaces and blank lines where needed;
- add to networking/index.rst.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agodocs: networking: convert rds.txt to ReST
Mauro Carvalho Chehab [Thu, 30 Apr 2020 16:04:19 +0000 (18:04 +0200)]
docs: networking: convert rds.txt to ReST

- add SPDX header;
- add a document title;
- mark code blocks and literals as such;
- mark tables as such;
- mark lists as such;
- adjust identation, whitespaces and blank lines where needed;
- add to networking/index.rst.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agodocs: networking: convert ray_cs.txt to ReST
Mauro Carvalho Chehab [Thu, 30 Apr 2020 16:04:18 +0000 (18:04 +0200)]
docs: networking: convert ray_cs.txt to ReST

- add SPDX header;
- use copyright symbol;
- add a document title;
- mark code blocks and literals as such;
- mark tables as such;
- adjust identation, whitespaces and blank lines where needed;
- add to networking/index.rst.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agodocs: networking: convert radiotap-headers.txt to ReST
Mauro Carvalho Chehab [Thu, 30 Apr 2020 16:04:17 +0000 (18:04 +0200)]
docs: networking: convert radiotap-headers.txt to ReST

- add SPDX header;
- adjust title markup;
- mark code blocks and literals as such;
- adjust identation, whitespaces and blank lines where needed;
- add to networking/index.rst.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agodocs: networking: convert proc_net_tcp.txt to ReST
Mauro Carvalho Chehab [Thu, 30 Apr 2020 16:04:16 +0000 (18:04 +0200)]
docs: networking: convert proc_net_tcp.txt to ReST

- add SPDX header;
- add a document title;
- mark code blocks and literals as such;
- mark tables as such;
- adjust identation, whitespaces and blank lines where needed;
- add to networking/index.rst.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agodocs: networking: convert ppp_generic.txt to ReST
Mauro Carvalho Chehab [Thu, 30 Apr 2020 16:04:15 +0000 (18:04 +0200)]
docs: networking: convert ppp_generic.txt to ReST

- add SPDX header;
- adjust title markup;
- mark code blocks and literals as such;
- mark tables as such;
- adjust identation, whitespaces and blank lines where needed;
- add to networking/index.rst.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agodocs: networking: convert PLIP.txt to ReST
Mauro Carvalho Chehab [Thu, 30 Apr 2020 16:04:14 +0000 (18:04 +0200)]
docs: networking: convert PLIP.txt to ReST

- add SPDX header;
- mark code blocks and literals as such;
- adjust identation, whitespaces and blank lines where needed;
- add to networking/index.rst.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agodocs: networking: convert pktgen.txt to ReST
Mauro Carvalho Chehab [Thu, 30 Apr 2020 16:04:13 +0000 (18:04 +0200)]
docs: networking: convert pktgen.txt to ReST

- add SPDX header;
- adjust title markup;
- use bold markups on a few places;
- mark code blocks and literals as such;
- adjust identation, whitespaces and blank lines where needed;
- add to networking/index.rst.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agodocs: networking: convert phonet.txt to ReST
Mauro Carvalho Chehab [Thu, 30 Apr 2020 16:04:12 +0000 (18:04 +0200)]
docs: networking: convert phonet.txt to ReST

- add SPDX header;
- adjust title markup;
- use copyright symbol;
- add notes markups;
- mark code blocks and literals as such;
- adjust identation, whitespaces and blank lines where needed;
- add to networking/index.rst.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Acked-by: Rémi Denis-Courmont <courmisch@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agodocs: networking: convert packet_mmap.txt to ReST
Mauro Carvalho Chehab [Thu, 30 Apr 2020 16:04:11 +0000 (18:04 +0200)]
docs: networking: convert packet_mmap.txt to ReST

This patch has a big diff, but most are due to whitespaces.

Yet, the conversion is similar to other files under networking:

- add SPDX header;
- add a document title;
- adjust titles and chapters, adding proper markups;
- mark lists as such;
- mark tables as such;
- mark code blocks and literals as such;
- adjust identation, whitespaces and blank lines where needed;
- add to networking/index.rst.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agodocs: networking: convert operstates.txt to ReST
Mauro Carvalho Chehab [Thu, 30 Apr 2020 16:04:10 +0000 (18:04 +0200)]
docs: networking: convert operstates.txt to ReST

- add SPDX header;
- add a document title;
- adjust chapters, adding proper markups;
- mark lists as such;
- adjust identation, whitespaces and blank lines where needed;
- add to networking/index.rst.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agodocs: networking: convert openvswitch.txt to ReST
Mauro Carvalho Chehab [Thu, 30 Apr 2020 16:04:09 +0000 (18:04 +0200)]
docs: networking: convert openvswitch.txt to ReST

- add SPDX header;
- adjust title markup;
- mark code blocks and literals as such;
- adjust identation, whitespaces and blank lines;
- add to networking/index.rst.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agodocs: networking: convert nf_flowtable.txt to ReST
Mauro Carvalho Chehab [Thu, 30 Apr 2020 16:04:08 +0000 (18:04 +0200)]
docs: networking: convert nf_flowtable.txt to ReST

- add SPDX header;
- adjust title markup;
- mark code blocks and literals as such;
- add notes markups;
- adjust identation, whitespaces and blank lines;
- add to networking/index.rst.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agodocs: networking: convert nf_conntrack-sysctl.txt to ReST
Mauro Carvalho Chehab [Thu, 30 Apr 2020 16:04:07 +0000 (18:04 +0200)]
docs: networking: convert nf_conntrack-sysctl.txt to ReST

- add SPDX header;
- add a document title;
- mark lists as such;
- add to networking/index.rst.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agodocs: networking: convert netif-msg.txt to ReST
Mauro Carvalho Chehab [Thu, 30 Apr 2020 16:04:06 +0000 (18:04 +0200)]
docs: networking: convert netif-msg.txt to ReST

- add SPDX header;
- adjust title and chapter markups;
- mark lists as such;
- mark code blocks and literals as such;
- adjust identation, whitespaces and blank lines;
- add to networking/index.rst.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agodocs: networking: convert netfilter-sysctl.txt to ReST
Mauro Carvalho Chehab [Thu, 30 Apr 2020 16:04:05 +0000 (18:04 +0200)]
docs: networking: convert netfilter-sysctl.txt to ReST

Not much to be done here:

- add SPDX header;
- add a document title;
- add a chapter markup;
- mark tables as such;
- add to networking/index.rst.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agodocs: networking: convert netdevices.txt to ReST
Mauro Carvalho Chehab [Thu, 30 Apr 2020 16:04:04 +0000 (18:04 +0200)]
docs: networking: convert netdevices.txt to ReST

- add SPDX header;
- adjust title markup;
- mark lists as such;
- adjust identation, whitespaces and blank lines;
- add to networking/index.rst.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agodocs: networking: convert netdev-features.txt to ReST
Mauro Carvalho Chehab [Thu, 30 Apr 2020 16:04:03 +0000 (18:04 +0200)]
docs: networking: convert netdev-features.txt to ReST

Not much to be done here:

- add SPDX header;
- adjust titles and chapters, adding proper markups;
- add to networking/index.rst.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agodocs: networking: convert netconsole.txt to ReST
Mauro Carvalho Chehab [Thu, 30 Apr 2020 16:04:02 +0000 (18:04 +0200)]
docs: networking: convert netconsole.txt to ReST

- add SPDX header;
- add a document title;
- mark code blocks and literals as such;
- mark tables as such;
- add notes markups;
- adjust identation, whitespaces and blank lines;
- add to networking/index.rst.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agodocs: networking: convert multiqueue.txt to ReST
Mauro Carvalho Chehab [Thu, 30 Apr 2020 16:04:01 +0000 (18:04 +0200)]
docs: networking: convert multiqueue.txt to ReST

- add SPDX header;
- adjust titles and chapters, adding proper markups;
- mark code blocks and literals as such;
- use :field: markup;
- adjust identation, whitespaces and blank lines;
- add to networking/index.rst.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agodocs: networking: convert mpls-sysctl.txt to ReST
Mauro Carvalho Chehab [Thu, 30 Apr 2020 16:04:00 +0000 (18:04 +0200)]
docs: networking: convert mpls-sysctl.txt to ReST

- add SPDX header;
- add a document title;
- mark lists as such;
- adjust identation, whitespaces and blank lines;
- add to networking/index.rst.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agodocs: networking: convert mac80211-injection.txt to ReST
Mauro Carvalho Chehab [Thu, 30 Apr 2020 16:03:59 +0000 (18:03 +0200)]
docs: networking: convert mac80211-injection.txt to ReST

- add SPDX header;
- adjust title markup;
- mark code blocks and literals as such;
- mark tables as such;
- adjust identation, whitespaces and blank lines;
- add to networking/index.rst.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agodocs: networking: convert ltpc.txt to ReST
Mauro Carvalho Chehab [Thu, 30 Apr 2020 16:03:58 +0000 (18:03 +0200)]
docs: networking: convert ltpc.txt to ReST

- add SPDX header;
- add a document title;
- mark code blocks and literals as such;
- mark tables as such;
- adjust identation, whitespaces and blank lines;
- add to networking/index.rst.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agodocs: networking: convert lapb-module.txt to ReST
Mauro Carvalho Chehab [Thu, 30 Apr 2020 16:03:57 +0000 (18:03 +0200)]
docs: networking: convert lapb-module.txt to ReST

- add SPDX header;
- adjust title markup;
- mark code blocks and literals as such;
- mark tables as such;
- adjust identation, whitespaces and blank lines;
- add to networking/index.rst.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agodocs: networking: convert l2tp.txt to ReST
Mauro Carvalho Chehab [Thu, 30 Apr 2020 16:03:56 +0000 (18:03 +0200)]
docs: networking: convert l2tp.txt to ReST

- add SPDX header;
- add a document title;
- mark tables as such;
- adjust identation, whitespaces and blank lines;
- add to networking/index.rst.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agoMerge branch 'inet_diag-add-cgroup-attribute-and-filter'
David S. Miller [Thu, 30 Apr 2020 19:54:02 +0000 (12:54 -0700)]
Merge branch 'inet_diag-add-cgroup-attribute-and-filter'

Dmitry Yakunin says:

====================
inet_diag: add cgroup attribute and filter

This patch series extends inet diag with cgroup v2 ID attribute and
filter. Which allows investigate sockets on per cgroup basis. Patch for
ss is already sent to iproute2-next mailing list.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agoinet_diag: add support for cgroup filter
Dmitry Yakunin [Thu, 30 Apr 2020 15:51:15 +0000 (18:51 +0300)]
inet_diag: add support for cgroup filter

This patch adds ability to filter sockets based on cgroup v2 ID.
Such filter is helpful in ss utility for filtering sockets by
cgroup pathname.

Signed-off-by: Dmitry Yakunin <zeil@yandex-team.ru>
Reviewed-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agoinet_diag: add cgroup id attribute
Dmitry Yakunin [Thu, 30 Apr 2020 15:51:14 +0000 (18:51 +0300)]
inet_diag: add cgroup id attribute

This patch adds cgroup v2 ID to common inet diag message attributes.
Cgroup v2 ID is kernfs ID (ino or ino+gen). This attribute allows filter
inet diag output by cgroup ID obtained by name_to_handle_at() syscall.
When net_cls or net_prio cgroup is activated this ID is equal to 1 (root
cgroup ID) for newly created sockets.

Some notes about this ID:

1) gets initialized in socket() syscall
2) incoming socket gets ID from listening socket
   (not during accept() syscall)
3) not changed when process get moved to another cgroup
4) can point to deleted cgroup (refcounting)

v2:
  - use CONFIG_SOCK_CGROUP_DATA instead if CONFIG_CGROUPS

v3:
  - fix attr size by using nla_total_size_64bit() (Eric Dumazet)
  - more detailed commit message (Konstantin Khlebnikov)

Signed-off-by: Dmitry Yakunin <zeil@yandex-team.ru>
Reviewed-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Acked-By: Tejun Heo <tj@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agoMerge branch 'stmmac-intel-Fixes-and-cleanups-after-dwmac-intel-split'
David S. Miller [Thu, 30 Apr 2020 19:50:16 +0000 (12:50 -0700)]
Merge branch 'stmmac-intel-Fixes-and-cleanups-after-dwmac-intel-split'

Andy Shevchenko says:

====================
stmmac: intel: Fixes and cleanups after dwmac-intel split

Seems the split of dwmac-intel didn't go well and on top of that new
functionality in the driver has not been properly tested.

Patch 1 fixes a nasty kernel crash due to missed error handling.
Patches 2 and 3 fix the incorrect split (clock and PCI bar handling).

Patch 4 converts driver to use new PCI IRQ allocation API.

The rest is a set of clean ups that may have been done in the initial
submission.

Series has been tested on couple of Elkhart Lake platforms with different
behaviour of ethernet hardware.

Changelog v3:
- added the cover letter (David)
- appended separate fix as a first patch
- marked patches 2 and 3 with Fixes tag
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agostmmac: intel: Place object in the Makefile according to the order
Andy Shevchenko [Thu, 30 Apr 2020 15:02:54 +0000 (18:02 +0300)]
stmmac: intel: Place object in the Makefile according to the order

Follow the order for the platform drivers, i.e. generic object are going first.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agostmmac: intel: Fix indentation to put on one line affected code
Andy Shevchenko [Thu, 30 Apr 2020 15:02:53 +0000 (18:02 +0300)]
stmmac: intel: Fix indentation to put on one line affected code

There is no competition to get more LOCs into the kernel, and driver can look
better and have improved readability without those additional line breaks.

While at it, shorten info structures that they are all PCI, at the end it's
a PCI driver for Intel hardware.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agostmmac: intel: Eliminate useless conditions and variables
Andy Shevchenko [Thu, 30 Apr 2020 15:02:52 +0000 (18:02 +0300)]
stmmac: intel: Eliminate useless conditions and variables

There are useless conditions like

func()
{
...
int ret;
...
ret = foo();
if (ret)
return ret;

return 0;
}

which may be replaced with direct return statement, what we have done here.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agostmmac: intel: Convert to use pci_alloc_irq_vectors() API
Andy Shevchenko [Thu, 30 Apr 2020 15:02:51 +0000 (18:02 +0300)]
stmmac: intel: Convert to use pci_alloc_irq_vectors() API

pci_enable_msi() is deprecated API, thus, switch to modern
pci_alloc_irq_vectors().

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agostmmac: intel: Remove unnecessary loop for PCI BARs
Andy Shevchenko [Thu, 30 Apr 2020 15:02:50 +0000 (18:02 +0300)]
stmmac: intel: Remove unnecessary loop for PCI BARs

Copy'n'paste without thinking is not a good idea and in this case it brought
unnecessary loop over PCI BAR resources which was needed to workaround one of
STMicro RVP boards. Remove unnecessary loops from Intel driver.

Fixes: 58da0cfa6cf1 ("net: stmmac: create dwmac-intel.c to contain all Intel platform")
Cc: Voon Weifeng <weifeng.voon@intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agostmmac: intel: Fix clock handling on error and remove paths
Andy Shevchenko [Thu, 30 Apr 2020 15:02:49 +0000 (18:02 +0300)]
stmmac: intel: Fix clock handling on error and remove paths

clk_prepare_enable() might fail, we have to check its returned value.
Besides that we have to call clk_disable_unprepare() on the error and
remove paths. Do above in the dwmac-intel driver.

While at it, remove leftover in stmmac_pci and remove unneeded condition
for NULL-aware clk_unregister_fixed_rate() call.

Fixes: 58da0cfa6cf1 ("net: stmmac: create dwmac-intel.c to contain all Intel platform")
Cc: Voon Weifeng <weifeng.voon@intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agostmmac: intel: Fix kernel crash due to wrong error path
Andy Shevchenko [Thu, 30 Apr 2020 15:02:48 +0000 (18:02 +0300)]
stmmac: intel: Fix kernel crash due to wrong error path

Unfortunately sometimes ->probe() may fail. The commit b9663b7ca6ff
("net: stmmac: Enable SERDES power up/down sequence")
messed up with error handling and thus:

[   12.811311] ------------[ cut here ]------------
[   12.811993] kernel BUG at net/core/dev.c:9937!

Fix this by properly crafted error path.

Fixes: b9663b7ca6ff ("net: stmmac: Enable SERDES power up/down sequence")
Cc: Voon Weifeng <weifeng.voon@intel.com>
Cc: Ong Boon Leong <boon.leong.ong@intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agoMerge branch 'net-smc-add-event-based-framework-for-LLC-msgs'
David S. Miller [Thu, 30 Apr 2020 19:44:34 +0000 (12:44 -0700)]
Merge branch 'net-smc-add-event-based-framework-for-LLC-msgs'

Karsten Graul says:

====================
net/smc: add event-based framework for LLC msgs

These patches are the next step towards SMC-R link failover support. They add
a new framework to handle Link Layer Control (LLC) messages and adapt the
existing code to use the new framework.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet/smc: remove obsolete link state DELETING
Karsten Graul [Thu, 30 Apr 2020 13:55:51 +0000 (15:55 +0200)]
net/smc: remove obsolete link state DELETING

The connection layer in af_smc.c is now using the new LLC flow
framework, which made the link state DELETING obsolete. Remove the state
and the respective helpers.

Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
Reviewed-by: Ursula Braun <ubraun@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet/smc: remove handling of CONFIRM_RKEY_CONTINUE
Karsten Graul [Thu, 30 Apr 2020 13:55:50 +0000 (15:55 +0200)]
net/smc: remove handling of CONFIRM_RKEY_CONTINUE

The new SMC-R multiple link support will support a maximum of 3 links,
and one CONFIRM_RKEY LLC message can transport 3 rkeys of an rmb buffer.
There is no need for the LLC message type CONFIRM_RKEY_CONTINUE which is
needed when more than 3 rkeys per rmb buffer needs to be exchanged.

Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
Reviewed-by: Ursula Braun <ubraun@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet/smc: adapt SMC remote DELETE_RKEY processing to use the LLC flow
Karsten Graul [Thu, 30 Apr 2020 13:55:49 +0000 (15:55 +0200)]
net/smc: adapt SMC remote DELETE_RKEY processing to use the LLC flow

Use the LLC flow framework for the processing of DELETE_RKEY messages
that were received from the peer.

Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
Reviewed-by: Ursula Braun <ubraun@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet/smc: adapt SMC remote CONFIRM_RKEY processing to use the LLC flow
Karsten Graul [Thu, 30 Apr 2020 13:55:48 +0000 (15:55 +0200)]
net/smc: adapt SMC remote CONFIRM_RKEY processing to use the LLC flow

Use the LLC flow framework for the processing of CONFIRM_RKEY messages
that were received from the peer.

Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
Reviewed-by: Ursula Braun <ubraun@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet/smc: new smc_rtoken_set functions for multiple link support
Karsten Graul [Thu, 30 Apr 2020 13:55:47 +0000 (15:55 +0200)]
net/smc: new smc_rtoken_set functions for multiple link support

Introduce smc_rtoken_set() to set the rtoken for a new link to an
existing rmb whose rtoken is given, and smc_rtoken_set2() to set an
rtoken for a new link whose link_id is given.

Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
Reviewed-by: Ursula Braun <ubraun@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet/smc: move the TEST_LINK response processing into event handler
Karsten Graul [Thu, 30 Apr 2020 13:55:46 +0000 (15:55 +0200)]
net/smc: move the TEST_LINK response processing into event handler

Get rid of the extra function and move the two-liner for the TEST_LINK
response processing into the event handler function.

Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
Reviewed-by: Ursula Braun <ubraun@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet/smc: multiple link support and LLC flow for smc_llc_do_delete_rkey
Karsten Graul [Thu, 30 Apr 2020 13:55:45 +0000 (15:55 +0200)]
net/smc: multiple link support and LLC flow for smc_llc_do_delete_rkey

Adapt smc_llc_do_delete_rkey() to use the LLC flow and support multiple
links when deleting the rkeys for rmb buffers at the peer.

Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
Reviewed-by: Ursula Braun <ubraun@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet/smc: multiple link support and LLC flow for smc_llc_do_confirm_rkey
Karsten Graul [Thu, 30 Apr 2020 13:55:44 +0000 (15:55 +0200)]
net/smc: multiple link support and LLC flow for smc_llc_do_confirm_rkey

Adapt smc_llc_do_confirm_rkey() to use the LLC flow and support the
rkeys of multiple links when the CONFIRM_RKEY LLC message is build.

Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
Reviewed-by: Ursula Braun <ubraun@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet/smc: adapt SMC client code to use the LLC flow
Karsten Graul [Thu, 30 Apr 2020 13:55:43 +0000 (15:55 +0200)]
net/smc: adapt SMC client code to use the LLC flow

Change the code that processes the SMC client part of connection
establishment to use the LLC flow framework (CONFIRM_LINK request
messages).

Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
Reviewed-by: Ursula Braun <ubraun@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet/smc: adapt SMC server code to use the LLC flow
Karsten Graul [Thu, 30 Apr 2020 13:55:42 +0000 (15:55 +0200)]
net/smc: adapt SMC server code to use the LLC flow

Change the code that processes the SMC server part of connection
establishment to use the LLC flow framework (CONFIRM_LINK response
messages).

Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
Reviewed-by: Ursula Braun <ubraun@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet/smc: add logic to evaluate CONFIRM_LINK messages to LLC layer
Karsten Graul [Thu, 30 Apr 2020 13:55:41 +0000 (15:55 +0200)]
net/smc: add logic to evaluate CONFIRM_LINK messages to LLC layer

Introduce smc_llc_eval_conf_link() to evaluate the CONFIRM_LINK message
contents. This implements this logic at the LLC layer. The function will
be used by af_smc.c to process the received LLC layer messages.

Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
Reviewed-by: Ursula Braun <ubraun@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet/smc: introduce link group type
Karsten Graul [Thu, 30 Apr 2020 13:55:40 +0000 (15:55 +0200)]
net/smc: introduce link group type

Add a type field to the link group which reflects the current link group
redundancy state.

Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
Reviewed-by: Ursula Braun <ubraun@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet/smc: enqueue all received LLC messages
Karsten Graul [Thu, 30 Apr 2020 13:55:39 +0000 (15:55 +0200)]
net/smc: enqueue all received LLC messages

Introduce smc_llc_enqueue() to enqueue LLC messages, and adapt
smc_llc_rx_handler() to enqueue all received LLC messages.
smc_llc_enqueue() also makes it possible to enqueue LLC messages from
local code.

Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
Reviewed-by: Ursula Braun <ubraun@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet/smc: add event-based llc_flow framework
Karsten Graul [Thu, 30 Apr 2020 13:55:38 +0000 (15:55 +0200)]
net/smc: add event-based llc_flow framework

The new framework allows to start specific types of LLC control flows,
protects active flows and makes it possible to wait for flows to finish
before starting a new flow.
This mechanism is used for the LLC control layer to model flows like
'add link' or 'delete link' which need to send/receive several LLC
messages and are not allowed to get interrupted by the wrong type of
messages.
'Add link' or 'Delete link' messages arriving in the middle of a flow
are delayed and processed when the current flow finished.

Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
Reviewed-by: Ursula Braun <ubraun@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet/faraday: Fix unnecessary check in ftmac100_probe()
Tang Bin [Thu, 30 Apr 2020 12:15:31 +0000 (20:15 +0800)]
net/faraday: Fix unnecessary check in ftmac100_probe()

The function ftmac100_probe() is only called with an openfirmware
platform device. Therefore there is no need to check that the passed
in device is NULL.

Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agorionet: Fix use correct return type for ndo_start_xmit()
Yunjian Wang [Thu, 30 Apr 2020 11:26:40 +0000 (19:26 +0800)]
rionet: Fix use correct return type for ndo_start_xmit()

The method ndo_start_xmit() returns a value of type netdev_tx_t. Fix
the ndo function to use the correct type.

Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet: caif: Fix use correct return type for ndo_start_xmit()
Yunjian Wang [Thu, 30 Apr 2020 10:16:16 +0000 (18:16 +0800)]
net: caif: Fix use correct return type for ndo_start_xmit()

The method ndo_start_xmit() returns a value of type netdev_tx_t. Fix
the ndo function to use the correct type.

Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agoMerge branch 'net-phy-mdio-add-IPQ40xx-MDIO-support'
David S. Miller [Thu, 30 Apr 2020 19:11:14 +0000 (12:11 -0700)]
Merge branch 'net-phy-mdio-add-IPQ40xx-MDIO-support'

Robert Marko says:

====================
net: phy: mdio: add IPQ40xx MDIO support

This patch series provides support for the IPQ40xx built-in MDIO interface.
Included are driver, devicetree bindings for it and devicetree node.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agoARM: dts: qcom: ipq4019: add MDIO node
Robert Marko [Thu, 30 Apr 2020 09:07:07 +0000 (11:07 +0200)]
ARM: dts: qcom: ipq4019: add MDIO node

This patch adds the necessary MDIO interface node
to the Qualcomm IPQ4019 DTSI.

Built-in QCA8337N switch is managed using it,
and since we have a driver for it lets add it.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
Signed-off-by: Robert Marko <robert.marko@sartura.hr>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Cc: Luka Perkov <luka.perkov@sartura.hr>
Signed-off-by: David S. Miller <davem@davemloft.net>