platform/kernel/linux-starfive.git
4 years agonet: bcmgenet: set Rx mode before starting netif
Doug Berger [Wed, 29 Apr 2020 20:02:00 +0000 (13:02 -0700)]
net: bcmgenet: set Rx mode before starting netif

This commit explicitly calls the bcmgenet_set_rx_mode() function when
the network interface is started. This function is normally called by
ndo_set_rx_mode when the flags are changed, but apparently not when
the driver is suspended and resumed.

This change ensures that address filtering or promiscuous mode are
properly restored by the driver after the MAC may have been reset.

Fixes: b6e978e50444 ("net: bcmgenet: add suspend/resume callbacks")
Signed-off-by: Doug Berger <opendmb@gmail.com>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next
David S. Miller [Wed, 29 Apr 2020 21:14:44 +0000 (14:14 -0700)]
Merge git://git./linux/kernel/git/pablo/nf-next

Pablo Neira Ayuso says:

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

The following patchset contains Netfilter updates for nf-next:

1) Add IPS_HW_OFFLOAD status bit, from Bodong Wang.

2) Remove 128-bit limit on the set element data area, rise it
   to 64 bytes.

3) Report EOPNOTSUPP for unsupported NAT types and flags.

4) Set up nft_nat flags from the control plane path.

5) Add helper functions to set up the nf_nat_range2 structure.

6) Add netmap support for nft_nat.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agoMerge branch 'net-smc-preparations-for-SMC-R-link-failover'
David S. Miller [Wed, 29 Apr 2020 19:26:33 +0000 (12:26 -0700)]
Merge branch 'net-smc-preparations-for-SMC-R-link-failover'

Karsten Graul says:

====================
net/smc: preparations for SMC-R link failover

This patch series prepares the SMC code for the implementation of SMC-R link
failover capabilities which are still missing to reach full compliance with
RFC 7609.
The code changes are separated into 65 patches which together form the new
functionality. I tried to create meaningful patches which allow to follow the
implementation.

Question: how to handle the remaining 52 patches? All of them are needed for
link failover to work and should make it into the same merge window.
Can I send them all together?

The SMC-R implementation will transparently make use of the link failover
feature when matching RoCE devices are available, no special setup is required.
All RoCE devices with the same PNET ID as the TCP device (hardware-defined or
user-defined via the smc_pnet tool) are candidates to get used to form a link
in a link group. When at least 2 RoCE devices are available on both
communication endpoints then a symmetric link group is formed, meaning the link
group has 2 independent links. If one RoCE device goes down then all connections
on this link are moved to the surviving link. Upon recovery of the failing
device or availability of a new one, the symmetric link group will be restored.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet/smc: move llc layer related init and clear into smc_llc.c
Karsten Graul [Wed, 29 Apr 2020 15:10:49 +0000 (17:10 +0200)]
net/smc: move llc layer related init and clear into smc_llc.c

Introduce smc_llc_lgr_init() and smc_llc_lgr_clear() to implement all
llc layer specific initialization and cleanup in module smc_llc.c.

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: use mutex instead of rwlock_t to protect buffers
Karsten Graul [Wed, 29 Apr 2020 15:10:48 +0000 (17:10 +0200)]
net/smc: use mutex instead of rwlock_t to protect buffers

The locks for sndbufs and rmbs are never used from atomic context. Using
a mutex for these locks will allow to nest locks with other mutexes.

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: process llc responses in tasklet context
Karsten Graul [Wed, 29 Apr 2020 15:10:47 +0000 (17:10 +0200)]
net/smc: process llc responses in tasklet context

When llc responses are received then possible waiters for this response
are to be notified. This can be done in tasklet context, without to
use a work in the llc work queue. Move all code that handles llc
responses into smc_llc_rx_response().

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: use worker to process incoming llc messages
Karsten Graul [Wed, 29 Apr 2020 15:10:46 +0000 (17:10 +0200)]
net/smc: use worker to process incoming llc messages

Incoming llc messages are processed in irq tasklet context, and
a worker is used to send outgoing messages. The worker is needed
because getting a send buffer could result in a wait for a free buffer.

To make sure all incoming llc messages are processed in a serialized way
introduce an event queue and create a new queue entry for each message
which is queued to this event queue. A new worker processes the event
queue entries in order.
And remove the use of a separate worker to send outgoing llc messages
because the messages are processed in worker context already.
With this event queue the serialized llc_wq work queue is obsolete,
remove it.

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: simplify link deactivation
Karsten Graul [Wed, 29 Apr 2020 15:10:45 +0000 (17:10 +0200)]
net/smc: simplify link deactivation

Cancel the testlink worker during link clear processing and remove the
extra function smc_llc_link_inactive().

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 testlink work to system work queue
Karsten Graul [Wed, 29 Apr 2020 15:10:44 +0000 (17:10 +0200)]
net/smc: move testlink work to system work queue

The testlink work waits for a response to the testlink request and
blocks the single threaded llc_wq. This type of work does not have to be
serialized and can be moved to the system work queue.

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 new link state and related helpers
Karsten Graul [Wed, 29 Apr 2020 15:10:43 +0000 (17:10 +0200)]
net/smc: add new link state and related helpers

Before a link can be reused it must have been cleared. Lowest current
link state is INACTIVE, which does not mean that the link is already
cleared.
Add a new state UNUSED that is set when the link is cleared and can be
reused.
Add helper smc_llc_usable_link() to find an active link in a link group,
and smc_link_usable() to determine if a link is usable.

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: multi-link support for smc_rmb_rtoken_handling()
Karsten Graul [Wed, 29 Apr 2020 15:10:42 +0000 (17:10 +0200)]
net/smc: multi-link support for smc_rmb_rtoken_handling()

Extend smc_rmb_rtoken_handling() and smc_rtoken_delete() to support
multiple links.

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: convert static link ID instances to support multiple links
Karsten Graul [Wed, 29 Apr 2020 15:10:41 +0000 (17:10 +0200)]
net/smc: convert static link ID instances to support multiple links

As a preparation for the support of multiple links remove the usage of
a static link id (SMC_SINGLE_LINK) and allow dynamic link ids.

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: convert static link ID to dynamic references
Karsten Graul [Wed, 29 Apr 2020 15:10:40 +0000 (17:10 +0200)]
net/smc: convert static link ID to dynamic references

As a preparation for the support of multiple links remove the usage of
a static link id (SMC_SINGLE_LINK) and allow dynamic link ids.

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_idx for link group array
Karsten Graul [Wed, 29 Apr 2020 15:10:39 +0000 (17:10 +0200)]
net/smc: introduce link_idx for link group array

The link_id is the index of the link in the array of the link group.
When a link in the array is reused for a new link, a different unique
link_id should be used, otherwise the index in the array could collide
with the previous link at this array position.
Use a new variable link_idx as array index, and make link_id an
increasing unique id value.

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: separate function for link initialization
Karsten Graul [Wed, 29 Apr 2020 15:10:38 +0000 (17:10 +0200)]
net/smc: separate function for link initialization

Move the initialization of a new link into its own function, separate
from smc_lgr_create, to allow more than one link per link group.
Do an extra check if the IB device initialization was successful, and
reset the link state if any error occurs during smcr_link_init().
And rename two existing functions to use the prefix smcr_ to indicate
that they belong to the SMC-R code path.

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: rework pnet table to support SMC-R failover
Karsten Graul [Wed, 29 Apr 2020 15:10:37 +0000 (17:10 +0200)]
net/smc: rework pnet table to support SMC-R failover

The pnet table stored pnet ids in the smc device structures. When a
device is going down its smc device structure is freed, and when the
device is brought online again it no longer has a pnet id set.
Rework the pnet table implementation to store the device name with their
assigned pnet id and apply the pnet id to devices when they are
registered.

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 agoRevert "net: ethernet: fec: Prevent MII event after MII_SPEED write"
David S. Miller [Wed, 29 Apr 2020 19:15:42 +0000 (12:15 -0700)]
Revert "net: ethernet: fec: Prevent MII event after MII_SPEED write"

This reverts commit 790ab249b55d75fdb427b92f81964cd7cb525eec.

This change needs more work.

Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agoila: remove unused inline function ila_addr_is_ila
YueHaibing [Wed, 29 Apr 2020 13:25:30 +0000 (21:25 +0800)]
ila: remove unused inline function ila_addr_is_ila

There's no callers in-tree anymore since commit 84287bb32856 ("ila: add
checksum neutral map auto").

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet: hsr: remove unused inline functions
YueHaibing [Wed, 29 Apr 2020 13:24:30 +0000 (21:24 +0800)]
net: hsr: remove unused inline functions

There's no callers in-tree anymore.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonetpoll: Fix use correct return type for ndo_start_xmit()
Yunjian Wang [Wed, 29 Apr 2020 10:20:58 +0000 (18:20 +0800)]
netpoll: 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 agoptp: ptp_ines: convert to devm_platform_ioremap_resource
Wei Yongjun [Wed, 29 Apr 2020 07:58:20 +0000 (07:58 +0000)]
ptp: ptp_ines: convert to devm_platform_ioremap_resource

Use the helper function that wraps the calls to platform_get_resource()
and devm_ioremap_resource() together.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet: hns3: adds support for reading module eeprom info
Yonglong Liu [Wed, 29 Apr 2020 03:46:24 +0000 (11:46 +0800)]
net: hns3: adds support for reading module eeprom info

This patch adds support for reading the optical module eeprom
info via "ethtool -m".

Signed-off-by: Yonglong Liu <liuyonglong@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Acked-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agoMerge branch 'net-ReST-convert'
David S. Miller [Tue, 28 Apr 2020 21:40:29 +0000 (14:40 -0700)]
Merge branch 'net-ReST-convert'

Mauro Carvalho Chehab says:

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

There are very few documents upstream that aren't converted upstream.

This series convert part of the networking text files into ReST.
It is part of a bigger set of patches, which were split on parts,
in order to make reviewing task easier.

The full series (including those ones) are at:

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

And 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 kcm.txt to ReST
Mauro Carvalho Chehab [Mon, 27 Apr 2020 22:01:53 +0000 (00:01 +0200)]
docs: networking: convert kcm.txt to ReST

- add SPDX header;
- adjust titles and chapters, adding proper markups;
- 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 ipvs-sysctl.txt to ReST
Mauro Carvalho Chehab [Mon, 27 Apr 2020 22:01:52 +0000 (00:01 +0200)]
docs: networking: convert ipvs-sysctl.txt to ReST

- add SPDX header;
- add a document title;
- 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>
Acked-by: Simon Horman <horms@verge.net.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agodocs: networking: convert ipvlan.txt to ReST
Mauro Carvalho Chehab [Mon, 27 Apr 2020 22:01:51 +0000 (00:01 +0200)]
docs: networking: convert ipvlan.txt to ReST

- add SPDX header;
- adjust titles and chapters, adding proper markups;
- 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 ipv6.txt to ReST
Mauro Carvalho Chehab [Mon, 27 Apr 2020 22:01:50 +0000 (00:01 +0200)]
docs: networking: convert ipv6.txt to ReST

Not much to be done here:

- add SPDX header;
- add a document title;
- mark a literal as such, in order to avoid a warning;
- 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 ip-sysctl.txt to ReST
Mauro Carvalho Chehab [Mon, 27 Apr 2020 22:01:49 +0000 (00:01 +0200)]
docs: networking: convert ip-sysctl.txt to ReST

- add SPDX header;
- adjust titles and chapters, adding proper markups;
- mark code blocks and literals as such;
- mark lists as such;
- mark tables as such;
- use footnote 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 ipsec.txt to ReST
Mauro Carvalho Chehab [Mon, 27 Apr 2020 22:01:48 +0000 (00:01 +0200)]
docs: networking: convert ipsec.txt to ReST

Not much to be done here:

- add SPDX header;
- add a document title;
- 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 iphase.txt to ReST
Mauro Carvalho Chehab [Mon, 27 Apr 2020 22:01:47 +0000 (00:01 +0200)]
docs: networking: convert iphase.txt to ReST

- add SPDX header;
- adjust title using the proper markup;
- mark code blocks and literals as such;
- mark tables as such;
- 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 ip_dynaddr.txt to ReST
Mauro Carvalho Chehab [Mon, 27 Apr 2020 22:01:46 +0000 (00:01 +0200)]
docs: networking: convert ip_dynaddr.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 ipddp.txt to ReST
Mauro Carvalho Chehab [Mon, 27 Apr 2020 22:01:45 +0000 (00:01 +0200)]
docs: networking: convert ipddp.txt to ReST

Not much to be done here:

- add SPDX header;
- use a document title from existing text;
- adjust a chapter markup;
- 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 ila.txt to ReST
Mauro Carvalho Chehab [Mon, 27 Apr 2020 22:01:44 +0000 (00:01 +0200)]
docs: networking: convert ila.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 hinic.txt to ReST
Mauro Carvalho Chehab [Mon, 27 Apr 2020 22:01:43 +0000 (00:01 +0200)]
docs: networking: convert hinic.txt to ReST

Not much to be done here:

- add SPDX header;
- adjust titles and chapters, adding proper 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 gtp.txt to ReST
Mauro Carvalho Chehab [Mon, 27 Apr 2020 22:01:42 +0000 (00:01 +0200)]
docs: networking: convert gtp.txt to ReST

- add SPDX header;
- adjust titles and chapters, adding proper markups;
- 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 gen_stats.txt to ReST
Mauro Carvalho Chehab [Mon, 27 Apr 2020 22:01:41 +0000 (00:01 +0200)]
docs: networking: convert gen_stats.txt to ReST

- add SPDX header;
- mark code blocks and literals as such;
- mark tables as such;
- 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 generic_netlink.txt to ReST
Mauro Carvalho Chehab [Mon, 27 Apr 2020 22:01:40 +0000 (00:01 +0200)]
docs: networking: convert generic_netlink.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 generic-hdlc.txt to ReST
Mauro Carvalho Chehab [Mon, 27 Apr 2020 22:01:39 +0000 (00:01 +0200)]
docs: networking: convert generic-hdlc.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 framerelay.txt to ReST
Mauro Carvalho Chehab [Mon, 27 Apr 2020 22:01:38 +0000 (00:01 +0200)]
docs: networking: convert framerelay.txt to ReST

- add SPDX header;
- add a document title;
- 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 fore200e.txt to ReST
Mauro Carvalho Chehab [Mon, 27 Apr 2020 22:01:37 +0000 (00:01 +0200)]
docs: networking: convert fore200e.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 filter.txt to ReST
Mauro Carvalho Chehab [Mon, 27 Apr 2020 22:01:36 +0000 (00:01 +0200)]
docs: networking: convert filter.txt to ReST

- add SPDX header;
- adjust title markup;
- mark code blocks and literals as such;
- use footnote markup;
- 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 fib_trie.txt to ReST
Mauro Carvalho Chehab [Mon, 27 Apr 2020 22:01:35 +0000 (00:01 +0200)]
docs: networking: convert fib_trie.txt to ReST

- add SPDX header;
- adjust title 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 eql.txt to ReST
Mauro Carvalho Chehab [Mon, 27 Apr 2020 22:01:34 +0000 (00:01 +0200)]
docs: networking: convert eql.txt to ReST

- add SPDX header;
- add a document title;
- adjust titles and chapters, adding proper markups;
- 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 driver.txt to ReST
Mauro Carvalho Chehab [Mon, 27 Apr 2020 22:01:33 +0000 (00:01 +0200)]
docs: networking: convert driver.txt to ReST

- add SPDX header;
- add a document title;
- 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 dns_resolver.txt to ReST
Mauro Carvalho Chehab [Mon, 27 Apr 2020 22:01:32 +0000 (00:01 +0200)]
docs: networking: convert dns_resolver.txt to ReST

- add SPDX header;
- adjust titles and chapters, adding proper markups;
- comment out text-only TOC from html/pdf output;

- 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 defza.txt to ReST
Mauro Carvalho Chehab [Mon, 27 Apr 2020 22:01:31 +0000 (00:01 +0200)]
docs: networking: convert defza.txt to ReST

Not much to be done here:

- add SPDX header;
- add a document title;
- use :field: markup for the version number;
- 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 decnet.txt to ReST
Mauro Carvalho Chehab [Mon, 27 Apr 2020 22:01:30 +0000 (00:01 +0200)]
docs: networking: convert decnet.txt to ReST

- add SPDX header;
- adjust titles and chapters, adding proper 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 dctcp.txt to ReST
Mauro Carvalho Chehab [Mon, 27 Apr 2020 22:01:29 +0000 (00:01 +0200)]
docs: networking: convert dctcp.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 dccp.txt to ReST
Mauro Carvalho Chehab [Mon, 27 Apr 2020 22:01:28 +0000 (00:01 +0200)]
docs: networking: convert dccp.txt to ReST

- add SPDX header;
- adjust title markup;
- comment out text-only TOC from html/pdf output;
- 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 cxacru.txt to ReST
Mauro Carvalho Chehab [Mon, 27 Apr 2020 22:01:27 +0000 (00:01 +0200)]
docs: networking: convert cxacru.txt to ReST

- add SPDX header;
- add a document title;
- mark code blocks and literals as such;
- 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 cops.txt to ReST
Mauro Carvalho Chehab [Mon, 27 Apr 2020 22:01:26 +0000 (00:01 +0200)]
docs: networking: convert cops.txt to ReST

- add SPDX header;
- adjust titles and chapters, adding proper markups;
- 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 cdc_mbim.txt to ReST
Mauro Carvalho Chehab [Mon, 27 Apr 2020 22:01:25 +0000 (00:01 +0200)]
docs: networking: convert cdc_mbim.txt to ReST

- add SPDX header;
- 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 bonding.txt to ReST
Mauro Carvalho Chehab [Mon, 27 Apr 2020 22:01:24 +0000 (00:01 +0200)]
docs: networking: convert bonding.txt to ReST

- add SPDX header;
- adjust titles and chapters, adding proper markups;
- comment out text-only TOC from html/pdf output;
- 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 baycom.txt to ReST
Mauro Carvalho Chehab [Mon, 27 Apr 2020 22:01:23 +0000 (00:01 +0200)]
docs: networking: convert baycom.txt to ReST

- add SPDX header;
- adjust titles and chapters, adding proper markups;
- 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 ax25.txt to ReST
Mauro Carvalho Chehab [Mon, 27 Apr 2020 22:01:22 +0000 (00:01 +0200)]
docs: networking: convert ax25.txt to ReST

There isn't much to be done here. Just:

- add SPDX header;
- add a document title.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agodocs: networking: convert atm.txt to ReST
Mauro Carvalho Chehab [Mon, 27 Apr 2020 22:01:21 +0000 (00:01 +0200)]
docs: networking: convert atm.txt to ReST

There isn't much to be done here. Just:

- add SPDX header;
- add a document title.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agodocs: networking: convert arcnet.txt to ReST
Mauro Carvalho Chehab [Mon, 27 Apr 2020 22:01:20 +0000 (00:01 +0200)]
docs: networking: convert arcnet.txt to ReST

- add SPDX header;
- use document title markup;
- add notes markups;
- 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 arcnet-hardware.txt to ReST
Mauro Carvalho Chehab [Mon, 27 Apr 2020 22:01:19 +0000 (00:01 +0200)]
docs: networking: convert arcnet-hardware.txt to ReST

- add SPDX header;
- add document title markup;
- add notes markups;
- mark tables 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 altera_tse.txt to ReST
Mauro Carvalho Chehab [Mon, 27 Apr 2020 22:01:18 +0000 (00:01 +0200)]
docs: networking: convert altera_tse.txt to ReST

- add SPDX header;
- use copyright symbol;
- adjust titles and chapters, adding proper markups;
- 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 6pack.txt to ReST
Mauro Carvalho Chehab [Mon, 27 Apr 2020 22:01:17 +0000 (00:01 +0200)]
docs: networking: convert 6pack.txt to ReST

- add SPDX header;
- use title markups;
- 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 caif files to ReST
Mauro Carvalho Chehab [Mon, 27 Apr 2020 22:01:16 +0000 (00:01 +0200)]
docs: networking: convert caif files to ReST

There are two text files for caif, plus one already converted
file.

Convert the two remaining ones to ReST, create a new index.rst
file for CAIF, adding it to the main networking documentation
index.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet: ethernet: fec: Prevent MII event after MII_SPEED write
Andrew Lunn [Tue, 28 Apr 2020 17:58:33 +0000 (19:58 +0200)]
net: ethernet: fec: Prevent MII event after MII_SPEED write

The change to polled IO for MDIO completion assumes that MII events
are only generated for MDIO transactions. However on some SoCs writing
to the MII_SPEED register can also trigger an MII event. As a result,
the next MDIO read has a pending MII event, and immediately reads the
data registers before it contains useful data. When the read does
complete, another MII event is posted, which results in the next read
also going wrong, and the cycle continues.

By writing 0 to the MII_DATA register before writing to the speed
register, this MII event for the MII_SPEED is suppressed, and polled
IO works as expected.

Fixes: 29ae6bd1b0d8 ("net: ethernet: fec: Replace interrupt driven MDIO with polled IO")
Reported-by: Andy Duan <fugang.duan@nxp.com>
Suggested-by: Andy Duan <fugang.duan@nxp.com>
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agodpaa2-eth: Use proper division helper in dpaa2_dbg_ch_show
Nathan Chancellor [Tue, 28 Apr 2020 17:42:22 +0000 (10:42 -0700)]
dpaa2-eth: Use proper division helper in dpaa2_dbg_ch_show

When building arm32 allmodconfig:

ERROR: modpost: "__aeabi_uldivmod"
[drivers/net/ethernet/freescale/dpaa2/fsl-dpaa2-eth.ko] undefined!

frames and cdan are both of type __u64 (unsigned long long) so we need
to use div64_u64 to avoid this issues.

Fixes: 460fd830dd9d ("dpaa2-eth: add channel stat to debugfs")
Link: https://github.com/ClangBuiltLinux/linux/issues/1012
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Reported-by: kernelci.org bot <bot@kernelci.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet: phy: bcm54140: Make a bunch of functions static
ChenTao [Tue, 28 Apr 2020 01:48:04 +0000 (09:48 +0800)]
net: phy: bcm54140: Make a bunch of functions static

Fix the following warning:

drivers/net/phy/bcm54140.c:663:5: warning:
symbol 'bcm54140_did_interrupt' was not declared. Should it be static?
drivers/net/phy/bcm54140.c:672:5: warning:
symbol 'bcm54140_ack_intr' was not declared. Should it be static?
drivers/net/phy/bcm54140.c:684:5: warning:
symbol 'bcm54140_config_intr' was not declared. Should it be static?

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: ChenTao <chentao107@huawei.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agoMerge branch 'kselftest-add-fixture-parameters'
David S. Miller [Tue, 28 Apr 2020 20:30:44 +0000 (13:30 -0700)]
Merge branch 'kselftest-add-fixture-parameters'

Jakub Kicinski says:

====================
kselftest: add fixture parameters

This set is an attempt to make running tests for different
sets of data easier. The direct motivation is the tls
test which we'd like to run for TLS 1.2 and TLS 1.3,
but currently there is no easy way to invoke the same
tests with different parameters.

Tested all users of kselftest_harness.h.

Dave, would it be possible to take these via net-next?
It seems we're failing to get Shuah's attention.

v2:
 - don't run tests by fixture
 - don't pass params as an explicit argument

v3:
 - go back to the orginal implementation with an extra
   parameter, and running by fixture (Kees);
 - add LIST_APPEND helper (Kees);
 - add a dot between fixture and param name (Kees);
 - rename the params to variants (Tim);

v4:
 - whitespace fixes.

v5 (Kees):
 - move a comment;
 - remove a temporary variable;
 - reword the commit message on patch 4.

v6:
 - resend for net-next.

v1: https://lore.kernel.org/netdev/20200313031752.2332565-1-kuba@kernel.org/
v2: https://lore.kernel.org/netdev/20200314005501.2446494-1-kuba@kernel.org/
v3: https://lore.kernel.org/netdev/20200316225647.3129354-1-kuba@kernel.org/
v4: https://lore.kernel.org/netdev/20200317010419.3268916-1-kuba@kernel.org/
v5: https://lore.kernel.org/netdev/20200318010153.40797-1-kuba@kernel.org/
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agoselftests: tls: run all tests for TLS 1.2 and TLS 1.3
Jakub Kicinski [Tue, 28 Apr 2020 01:03:51 +0000 (18:03 -0700)]
selftests: tls: run all tests for TLS 1.2 and TLS 1.3

TLS 1.2 and TLS 1.3 differ in the implementation.
Use fixture parameters to run all tests for both
versions, and remove the one-off TLS 1.2 test.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agokselftest: add fixture variants
Jakub Kicinski [Tue, 28 Apr 2020 01:03:50 +0000 (18:03 -0700)]
kselftest: add fixture variants

Allow users to build parameterized variants of fixtures.

If fixtures want variants, they call FIXTURE_VARIANT() to declare
the structure to fill for each variant. Each fixture will be re-run
for each of the variants defined by calling FIXTURE_VARIANT_ADD()
with the differing parameters initializing the structure.

Since tests are being re-run, additional initialization (steps,
no_print) is also added.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agokselftest: run tests by fixture
Jakub Kicinski [Tue, 28 Apr 2020 01:03:49 +0000 (18:03 -0700)]
kselftest: run tests by fixture

Now that all tests have a fixture object move from a global
list of tests to a list of tests per fixture.

Order of tests may change as we will now group and run test
fixture by fixture, rather than in declaration order.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agokselftest: create fixture objects
Jakub Kicinski [Tue, 28 Apr 2020 01:03:48 +0000 (18:03 -0700)]
kselftest: create fixture objects

Grouping tests by fixture will allow us to parametrize
test runs. Create full objects for fixtures.

Add a "global" fixture for tests without a fixture.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agokselftest: factor out list manipulation to a helper
Jakub Kicinski [Tue, 28 Apr 2020 01:03:47 +0000 (18:03 -0700)]
kselftest: factor out list manipulation to a helper

Kees suggest to factor out the list append code to a macro,
since following commits need it, which leads to code duplication.

Suggested-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agoMerge branch 'nexthop-API-sysctl'
David S. Miller [Tue, 28 Apr 2020 19:50:37 +0000 (12:50 -0700)]
Merge branch 'nexthop-API-sysctl'

Roopa Prabhu says:

====================
New sysctl to turn off nexthop API compat mode

Currently route nexthop API maintains user space compatibility
with old route API by default. Dumps and netlink notifications
support both new and old API format. In systems which have
moved to the new API, this compatibility mode cancels some
of the performance benefits provided by the new nexthop API.

This patch adds new sysctl nexthop_compat_mode which is on
by default but provides the ability to turn off compatibility
mode allowing systems to run entirely with the new routing
API if they wish to. Old route API behaviour and support is
not modified by this sysctl

v4:
- Use davids note for Documenting the sysctl
- test with latest iproute2 and adjust 'pref'

v3:
- Document new sysctl
- move sysctl to use proc_dointvec_minmax with 0 and 1 values
- selftest: remove pref medium in ipv6 test

v2:
       - Incorporate David Aherns pointers on covering dumps and
         nexthop deletes. Also use one ipv4 sysctl to cover
         both ipv4 and ipv6 (I see it is done that way for many
         others)
       - Added a selftest to cover dump and notfications for nexthop
 api compat mode
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agoselftests: net: add new testcases for nexthop API compat mode sysctl
Roopa Prabhu [Mon, 27 Apr 2020 20:56:47 +0000 (13:56 -0700)]
selftests: net: add new testcases for nexthop API compat mode sysctl

New tests to check route dump and notifications with
net.ipv4.nexthop_compat_mode on and off.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Reviewed-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet: ipv4: add sysctl for nexthop api compatibility mode
Roopa Prabhu [Mon, 27 Apr 2020 20:56:46 +0000 (13:56 -0700)]
net: ipv4: add sysctl for nexthop api compatibility mode

Current route nexthop API maintains user space compatibility
with old route API by default. Dumps and netlink notifications
support both new and old API format. In systems which have
moved to the new API, this compatibility mode cancels some
of the performance benefits provided by the new nexthop API.

This patch adds new sysctl nexthop_compat_mode which is on
by default but provides the ability to turn off compatibility
mode allowing systems to run entirely with the new routing
API. Old route API behaviour and support is not modified by this
sysctl.

Uses a single sysctl to cover both ipv4 and ipv6 following
other sysctls. Covers dumps and delete notifications as
suggested by David Ahern.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Reviewed-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet: ipv6: new arg skip_notify to ip6_rt_del
Roopa Prabhu [Mon, 27 Apr 2020 20:56:45 +0000 (13:56 -0700)]
net: ipv6: new arg skip_notify to ip6_rt_del

Used in subsequent work to skip route delete
notifications on nexthop deletes.

Suggested-by: David Ahern <dsahern@gmail.com>
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Reviewed-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonetfilter: nft_nat: add netmap support
Pablo Neira Ayuso [Fri, 24 Apr 2020 19:55:37 +0000 (21:55 +0200)]
netfilter: nft_nat: add netmap support

This patch allows you to NAT the network address prefix onto another
network address prefix, a.k.a. netmapping.

Userspace must specify the NF_NAT_RANGE_NETMAP flag and the prefix
address through the NFTA_NAT_REG_ADDR_MIN and NFTA_NAT_REG_ADDR_MAX
netlink attributes.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
4 years agonetfilter: nft_nat: add helper function to set up NAT address and protocol
Pablo Neira Ayuso [Fri, 24 Apr 2020 19:55:36 +0000 (21:55 +0200)]
netfilter: nft_nat: add helper function to set up NAT address and protocol

This patch add nft_nat_setup_addr() and nft_nat_setup_proto() to set up
the NAT mangling.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
4 years agonetfilter: nft_nat: set flags from initialization path
Pablo Neira Ayuso [Fri, 24 Apr 2020 19:55:35 +0000 (21:55 +0200)]
netfilter: nft_nat: set flags from initialization path

This patch sets the NAT flags from the control plane path.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
4 years agonetfilter: nft_nat: return EOPNOTSUPP if type or flags are not supported
Pablo Neira Ayuso [Fri, 24 Apr 2020 19:55:34 +0000 (21:55 +0200)]
netfilter: nft_nat: return EOPNOTSUPP if type or flags are not supported

Instead of EINVAL which should be used for malformed netlink messages.

Fixes: eb31628e37a0 ("netfilter: nf_tables: Add support for IPv6 NAT")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
4 years agonet: ethernet: ti: fix return value check in k3_cppi_desc_pool_create_name()
Wei Yongjun [Mon, 27 Apr 2020 09:33:43 +0000 (09:33 +0000)]
net: ethernet: ti: fix return value check in k3_cppi_desc_pool_create_name()

In case of error, the function gen_pool_create() returns NULL pointer
not ERR_PTR(). The IS_ERR() test in the return value check should be
replaced with NULL test.

Fixes: 93a76530316a ("net: ethernet: ti: introduce am65x/j721e gigabit eth subsystem driver")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agor8169: improve error message if no dedicated PHY driver is found
Heiner Kallweit [Mon, 27 Apr 2020 19:07:00 +0000 (21:07 +0200)]
r8169: improve error message if no dedicated PHY driver is found

There's a number of consumer mainboards where the BIOS leaves the PHY
in a state that it's reporting an invalid PHY ID. To detect such cases
add the PHY ID to the error message if no dedicated PHY driver is found.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonetfilter: nf_tables: allow up to 64 bytes in the set element data area
Pablo Neira Ayuso [Fri, 24 Apr 2020 19:55:33 +0000 (21:55 +0200)]
netfilter: nf_tables: allow up to 64 bytes in the set element data area

So far, the set elements could store up to 128-bits in the data area.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
4 years agoMerge tag 'batadv-next-for-davem-20200427' of git://git.open-mesh.org/linux-merge
David S. Miller [Mon, 27 Apr 2020 20:04:18 +0000 (13:04 -0700)]
Merge tag 'batadv-next-for-davem-20200427' of git://git.open-mesh.org/linux-merge

Simon Wunderlich says:

====================
This cleanup patchset includes the following patches:

 - bump version strings, by Simon Wunderlich

 - fix spelling error, by Sven Eckelmann

 - drop unneeded types.h include, by Sven Eckelmann

 - change random number generation to prandom_u32_max(),
   by Sven Eckelmann

 - remove unused function batadv_arp_change_timeout(), by Yue Haibing
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agoMerge branch 'mlxsw-Rework-matchall-offloading-plumbing'
David S. Miller [Mon, 27 Apr 2020 19:43:30 +0000 (12:43 -0700)]
Merge branch 'mlxsw-Rework-matchall-offloading-plumbing'

Ido Schimmel says:

====================
mlxsw: Rework matchall offloading plumbing

Jiri says:

Currently the matchall and flower are handled by registering separate
callbacks in mlxsw. That leads to faulty indication "in_hw_count 2" in
filter show command for every inserted flower filter. That happens
because matchall callback just blindly returns 0 for it and it is
wrongly accounted for as "the offloader".

I inspected different ways to fix this problem. The only clean solution
is to rework handling of matchall in mlxsw a bit. The driver newely
registers one callback for bound block which is called for both matchall
and flower filter insertions.

On the way, iron out the matchall code a bit, push it into a separate
file etc.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agoselftests: forwarding: tc_actions.sh: add matchall mirror test
Jiri Pirko [Mon, 27 Apr 2020 15:13:10 +0000 (18:13 +0300)]
selftests: forwarding: tc_actions.sh: add matchall mirror test

Add test for matchall classifier with mirred egress mirror action.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agomlxsw: spectrum: Move flow offload binding into spectrum_flow.c
Jiri Pirko [Mon, 27 Apr 2020 15:13:09 +0000 (18:13 +0300)]
mlxsw: spectrum: Move flow offload binding into spectrum_flow.c

Move the code taking case of setup of flow offload into spectrum_flow.c
Do small renaming of callbacks on the way.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agomlxsw: spectrum_matchall: Process matchall events from the same cb as flower
Jiri Pirko [Mon, 27 Apr 2020 15:13:08 +0000 (18:13 +0300)]
mlxsw: spectrum_matchall: Process matchall events from the same cb as flower

Currently there are two callbacks registered: one for matchall,
one for flower. This causes the user to see "in_hw_count 2" in TC filter
dump. Because of this and also as a preparation for future matchall
offload for rules equivalent to flower-all-match, move the processing of
shared block into matchall.c. Leave only one cb for mlxsw driver
per-block.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agomlxsw: spectrum: Avoid copying sample values and use RCU pointer direcly instead
Jiri Pirko [Mon, 27 Apr 2020 15:13:07 +0000 (18:13 +0300)]
mlxsw: spectrum: Avoid copying sample values and use RCU pointer direcly instead

Currently, only the psample_group is accessed using RCU on RX path.
However, it is possible (unlikely) that other sample values get change
during RX processing. Fix this by having the port->sample struct
accessed as RCU pointer, containing all sample values including
psample_group pointer. That avoids extra alloc per-port, copying the
values and the race condition described above.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agomlxsw: spectrum_matchall: Push per-port rule add/del into separate functions
Jiri Pirko [Mon, 27 Apr 2020 15:13:06 +0000 (18:13 +0300)]
mlxsw: spectrum_matchall: Push per-port rule add/del into separate functions

As the replace/destroy is going to be used later on per-block, push
the per-port rule addition/deletion into separate functions.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agomlxsw: spectrum_matchall: Move ingress indication into mall_entry
Jiri Pirko [Mon, 27 Apr 2020 15:13:05 +0000 (18:13 +0300)]
mlxsw: spectrum_matchall: Move ingress indication into mall_entry

Instead of having it in mirror_entry structure, move it to mall_entry
and set it during rule insertion.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agomlxsw: spectrum_matchall: Pass mall_entry as arg to mlxsw_sp_mall_port_sample_add()
Jiri Pirko [Mon, 27 Apr 2020 15:13:04 +0000 (18:13 +0300)]
mlxsw: spectrum_matchall: Pass mall_entry as arg to mlxsw_sp_mall_port_sample_add()

In the preparation for future changes, have the
mlxsw_sp_mall_port_sample_add() function to accept mall_entry including
all needed info originally obtained from cls and act pointers.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agomlxsw: spectrum_matchall: Pass mall_entry as arg to mlxsw_sp_mall_port_mirror_add()
Jiri Pirko [Mon, 27 Apr 2020 15:13:03 +0000 (18:13 +0300)]
mlxsw: spectrum_matchall: Pass mall_entry as arg to mlxsw_sp_mall_port_mirror_add()

In the preparation for future changes, have the
mlxsw_sp_mall_port_mirror_add() function to accept mall_entry including
the "to_dev" originally obtained from act pointer.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agomlxsw: spectrum_acl: Use block variable in mlxsw_sp_acl_rule_del()
Jiri Pirko [Mon, 27 Apr 2020 15:13:02 +0000 (18:13 +0300)]
mlxsw: spectrum_acl: Use block variable in mlxsw_sp_acl_rule_del()

On couple of places in mlxsw_sp_acl_rule_del(), block variable is not
used directly as it could be. So do it.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agomlxsw: spectrum: Push matchall bits into a separate file
Jiri Pirko [Mon, 27 Apr 2020 15:13:01 +0000 (18:13 +0300)]
mlxsw: spectrum: Push matchall bits into a separate file

Similar to flower, have matchall related code in a separate file.
Do some small renaming on the way (consistent "mall" prefixes,
dropped "_tc_", dropped "_port_" where suitable).

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agomlxsw: spectrum: Push flow_block related functions into a separate file
Jiri Pirko [Mon, 27 Apr 2020 15:13:00 +0000 (18:13 +0300)]
mlxsw: spectrum: Push flow_block related functions into a separate file

The code around flow_block is currently mixed in spectrum_acl.c.
However, as it really does not directly relate to ACL part only,
push the bits into a separate file.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agomlxsw: spectrum: Rename acl_block to flow_block
Jiri Pirko [Mon, 27 Apr 2020 15:12:59 +0000 (18:12 +0300)]
mlxsw: spectrum: Rename acl_block to flow_block

The acl_block structure is going to be used for non-acl case - matchall
offload. So rename it accordingly.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agomlxsw: spectrum_acl: Move block helpers into inline header functions
Jiri Pirko [Mon, 27 Apr 2020 15:12:58 +0000 (18:12 +0300)]
mlxsw: spectrum_acl: Move block helpers into inline header functions

The struct is defined in the header, no need to have the helpers
in the c file. Move the helpers to the header.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agoMerge branch 'r8169-improve-chip-config-handling'
David S. Miller [Mon, 27 Apr 2020 18:48:47 +0000 (11:48 -0700)]
Merge branch 'r8169-improve-chip-config-handling'

Heiner Kallweit says:

====================
r8169: improve chip config handling

Series includes two improvements for chip configuration handling.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agor8169: improve configuring RxConfig register
Heiner Kallweit [Sun, 26 Apr 2020 21:36:56 +0000 (23:36 +0200)]
r8169: improve configuring RxConfig register

Two bits in RxConfig are controlled by the following dev->feature's:
- NETIF_F_RXALL
- NETIF_F_HW_VLAN_CTAG_RX (since RTL8125)

We have to take care that RxConfig gets fully configured in
rtl_hw_start() after e.g. resume from hibernation. Therefore:

- Factor out setting the feature-controlled RxConfig bits to a new
  function rtl_set_rx_config_features() that is called from
  rtl8169_set_features() and rtl_hw_start().
- Don't deal with RX_VLAN_8125 in rtl_init_rxcfg(), it will be set
  by rtl_set_rx_config_features().
- Don't handle NETIF_F_RXALL in rtl_set_rx_mode().

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agor8169: improve handling CPCMD_MASK
Heiner Kallweit [Sun, 26 Apr 2020 21:35:59 +0000 (23:35 +0200)]
r8169: improve handling CPCMD_MASK

It's sufficient to do the masking once in probe() for clearing
unwanted bits that may have been set by the BIOS.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agoMerge branch 'net-bridge-mrp'
David S. Miller [Mon, 27 Apr 2020 18:40:25 +0000 (11:40 -0700)]
Merge branch 'net-bridge-mrp'

Horatiu Vultur says:

====================
net: bridge: mrp: Add support for Media Redundancy Protocol(MRP)

Media Redundancy Protocol is a data network protocol standardized by
International Electrotechnical Commission as IEC 62439-2. It allows rings of
Ethernet switches to overcome any single failure with recovery time faster than
STP. It is primarily used in Industrial Ethernet applications.

Based on the previous RFC[1][2][3][4][5], and patches[6][7][8], the MRP state
machine and all the timers were moved to userspace, except for the timers used
to generate MRP Test frames.  In this way the userspace doesn't know and should
not know if the HW or the kernel will generate the MRP Test frames. The
following changes were added to the bridge to support the MRP:
- the existing netlink interface was extended with MRP support,
- allow to detect when a MRP frame was received on a MRP ring port
- allow MRP instance to forward/terminate MRP frames
- generate MRP Test frames in case the HW doesn't have support for this

To be able to offload MRP support to HW, the switchdev API  was extend.

With these changes the userspace doesn't do the following because already the
kernel/HW will do:
- doesn't need to forward/terminate MRP frames
- doesn't need to generate MRP Test frames
- doesn't need to detect when the ring is open/closed.

The userspace application that is using the new netlink can be found here[9].

The current implementation both in kernel and userspace supports only 2 roles:
  MRM - this one is responsible to send MRP_Test and MRP_Topo frames on both
  ring ports. It needs to process MRP_Test to know if the ring is open or
  closed. This operation is desired to be offloaded to the HW because it
  requires to generate and process up to 4000 frames per second. Whenever it
  detects that the ring is open it sends MRP_Topo frames to notify all MRC about
  changes in the topology. MRM needs also to process MRP_LinkChange frames,
  these frames are generated by the MRC. When the ring is open then the state
  of both ports is to forward frames and when the ring is closed then the
  secondary port is blocked.

  MRC - this one is responsible to forward MRP frames between the ring ports.
  In case one of the ring ports gets a link down or up, then MRC will generate
  a MRP_LinkChange frames. This node should also process MRP_Topo frames and to
  clear its FDB when it receives this frame.

 Userspace
               Deamon +----------+ Client
                +
                |
 +--------------|-----------------------------------------+
  Kernel        |
                + Netlink

                |                              + Interrupt
                |                              |
 +--------------|------------------------------|----------+
  HW            | Switchdev                    |
                +                              |

The user interacts using the client (called 'mrp'), the client talks to the
deamon (called 'mrp_server'), which talks with the kernel using netlink. The
kernel will try to offload the requests to the HW via switchdev API.

If this will be accepted then in the future the netlink interface can be
expended with multiple attributes which are required by different roles of the
MRP. Like Media Redundancy Automanager(MRA), Media Interconnect Manager(MIM) and
Media Interconnect Client(MIC).

[1] https://www.spinics.net/lists/netdev/msg623647.html
[2] https://www.spinics.net/lists/netdev/msg624378.html
[3] https://www.spinics.net/lists/netdev/msg627500.html
[4] https://www.spinics.net/lists/netdev/msg641005.html
[5] https://www.spinics.net/lists/netdev/msg643991.html
[6] https://www.spinics.net/lists/netdev/msg645378.html
[7] https://www.spinics.net/lists/kernel/msg3484685.html
[8] https://www.spinics.net/lists/netdev/msg646202.html
[9] https://github.com/microchip-ung/mrp/tree/patch-v9

-v4:
  - fix comments in br_mrp.c
  - use skb_header_pointer to get br_mrp_tlv_hdr
  - fix line over 80 characters

-v3:
  - fix unused variables

-v2:
  - drop patch 4
  - add port flag BR_MRP_LOST_CONT;
  - another fix for bisectability

-v1:
  - fix bisectability issues
  - in case of errors use extack

-RFC v5:
  - use nla_parse_nested
  - rework the usage of the rcu in br_mrp
  - reorder patches
  - few other small issues raised by Nikolay

-RFC v4:
  - extend existing netlink interface to add mrp support
  - use rcu locks

-RFC v3:
  - move MRP state machine in userspace
  - create generic netlink interface for configuring the HW using switchdev API

-RFC v2:
  - extend switchdev API to offload to HW
====================

Signed-off-by: David S. Miller <davem@davemloft.net>