]> Git Repo - linux.git/log
linux.git
4 years agonet: ipa: pass channel pointer to gsi_channel_state()
Alex Elder [Thu, 30 Apr 2020 22:13:22 +0000 (17:13 -0500)]
net: ipa: pass channel pointer to gsi_channel_state()

Pass a channel pointer rather than a GSI pointer and channel ID to
gsi_channel_state().

Signed-off-by: Alex Elder <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agoMerge branch 'net-dsa-mv88e6xxx-augment-phylink-support-for-10G'
David S. Miller [Fri, 1 May 2020 22:40:15 +0000 (15:40 -0700)]
Merge branch 'net-dsa-mv88e6xxx-augment-phylink-support-for-10G'

Russell King says:

====================
net: dsa: mv88e6xxx: augment phylink support for 10G

This series adds phylink 10G support for the 88E6390 series switches,
as suggested by Andrew Lunn.

The first patch cleans up the code to use generic definitions for the
registers in a similar way to what was done with the initial conversion
of 1G serdes support.

The second patch adds the necessary bits 10GBASE mode to the
pcs_get_state() method.
====================

Signed-off-by: David S. Miller <[email protected]>
4 years agonet: dsa: mv88e6xxx: 88e6390 10G serdes support
Russell King [Thu, 30 Apr 2020 08:21:39 +0000 (09:21 +0100)]
net: dsa: mv88e6xxx: 88e6390 10G serdes support

Add support for reading and reporting the 10G link status on the
88e6390 in addition to the 1000BASE-X/2500BASE-X/SGMII status.

Signed-off-by: Russell King <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agonet: dsa: mv88e6xxx: use generic clause 45 definitions
Russell King [Thu, 30 Apr 2020 08:21:34 +0000 (09:21 +0100)]
net: dsa: mv88e6xxx: use generic clause 45 definitions

The private MV88E6390_PCS_CONTROL_1 definitions in serdes.h reflects
the IEEE 802.3 standard PCS control register 1 definitions, only
offset by 0x1000 in the PHYXS register space.  Rather than inventing
our own, use those that already exist, and name the register
MV88E6390_10G_CTRL1.

Signed-off-by: Russell King <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agoMerge branch 'net-atlantic-A2-support'
David S. Miller [Fri, 1 May 2020 22:37:59 +0000 (15:37 -0700)]
Merge branch 'net-atlantic-A2-support'

Igor Russkikh says:

====================
net: atlantic: A2 support

This patchset adds support for the new generation of Atlantic NICs.

Chip generations are mostly compatible register-wise, but there are still
some differences. Therefore we've made some of first generation (A1) code
non-static to re-use it where possible.

Some pieces are A2 specific, in which case we redefine/extend such APIs.

v2:
 * removed #pragma pack (2 structures require the packed attribute);
 * use defines instead of magic numbers where possible;

v1: https://patchwork.ozlabs.org/cover/1276220/
====================

Signed-off-by: David S. Miller <[email protected]>
4 years agonet: atlantic: A2 ingress / egress hw configuration
Igor Russkikh [Thu, 30 Apr 2020 08:04:45 +0000 (11:04 +0300)]
net: atlantic: A2 ingress / egress hw configuration

Chip generations are mostly compatible register-wise, but there are still
some differences. Therefore we've made some of first generation (A1) code
non-static to re-use it where possible.

Some pieces are A2 specific, in which case we redefine/extend such APIs.

Signed-off-by: Igor Russkikh <[email protected]>
Signed-off-by: Mark Starovoytov <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agonet: atlantic: basic A2 init/deinit hw_ops
Igor Russkikh [Thu, 30 Apr 2020 08:04:44 +0000 (11:04 +0300)]
net: atlantic: basic A2 init/deinit hw_ops

This patch adds basic A2 HW initialization / deinitialization.

Signed-off-by: Igor Russkikh <[email protected]>
Co-developed-by: Dmitry Bogdanov <[email protected]>
Signed-off-by: Dmitry Bogdanov <[email protected]>
Signed-off-by: Mark Starovoytov <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agonet: atlantic: common functions needed for basic A2 init/deinit hw_ops
Dmitry Bogdanov [Thu, 30 Apr 2020 08:04:43 +0000 (11:04 +0300)]
net: atlantic: common functions needed for basic A2 init/deinit hw_ops

This patch adds common functions (mostly FW-related), which are
needed for basic A2 HW initialization / deinitialization.

Signed-off-by: Dmitry Bogdanov <[email protected]>
Co-developed-by: Igor Russkikh <[email protected]>
Signed-off-by: Igor Russkikh <[email protected]>
Signed-off-by: Mark Starovoytov <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agonet: atlantic: HW bindings for basic A2 init/deinit hw_ops
Dmitry Bogdanov [Thu, 30 Apr 2020 08:04:42 +0000 (11:04 +0300)]
net: atlantic: HW bindings for basic A2 init/deinit hw_ops

This patch adds A2 register definitions for basic A2 HW
initialization / deinitialization.

Signed-off-by: Dmitry Bogdanov <[email protected]>
Co-developed-by: Egor Pomozov <[email protected]>
Signed-off-by: Egor Pomozov <[email protected]>
Co-developed-by: Igor Russkikh <[email protected]>
Signed-off-by: Igor Russkikh <[email protected]>
Co-developed-by: Nikita Danilov <[email protected]>
Signed-off-by: Nikita Danilov <[email protected]>
Signed-off-by: Mark Starovoytov <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agonet: atlantic: add A2 RPF hw_ops
Igor Russkikh [Thu, 30 Apr 2020 08:04:41 +0000 (11:04 +0300)]
net: atlantic: add A2 RPF hw_ops

This patch adds RPF-related hw_ops, which are needed for basic
functionality.

Signed-off-by: Igor Russkikh <[email protected]>
Co-developed-by: Dmitry Bogdanov <[email protected]>
Signed-off-by: Dmitry Bogdanov <[email protected]>
Signed-off-by: Mark Starovoytov <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agonet: atlantic: HW bindings for A2 RFP
Igor Russkikh [Thu, 30 Apr 2020 08:04:40 +0000 (11:04 +0300)]
net: atlantic: HW bindings for A2 RFP

RPF is one of the modules which has been significantly
changed/extended on A2.

This patch adds the necessary A2 register definitions
for RPF, which are used in follow-up patches.

Signed-off-by: Igor Russkikh <[email protected]>
Co-developed-by: Dmitry Bogdanov <[email protected]>
Signed-off-by: Dmitry Bogdanov <[email protected]>
Signed-off-by: Mark Starovoytov <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agonet: atlantic: A2 hw_ops skeleton
Igor Russkikh [Thu, 30 Apr 2020 08:04:39 +0000 (11:04 +0300)]
net: atlantic: A2 hw_ops skeleton

This patch adds basic hw_ops layout for A2.

Actual implementation will be added in the follow-up patches.

Signed-off-by: Igor Russkikh <[email protected]>
Signed-off-by: Mark Starovoytov <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agonet: atlantic: minimal A2 fw_ops
Dmitry Bogdanov [Thu, 30 Apr 2020 08:04:38 +0000 (11:04 +0300)]
net: atlantic: minimal A2 fw_ops

This patch adds the minimum set of FW ops for A2.

Signed-off-by: Dmitry Bogdanov <[email protected]>
Co-developed-by: Igor Russkikh <[email protected]>
Signed-off-by: Igor Russkikh <[email protected]>
Signed-off-by: Mark Starovoytov <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agonet: atlantic: minimal A2 HW bindings required for fw_ops
Dmitry Bogdanov [Thu, 30 Apr 2020 08:04:37 +0000 (11:04 +0300)]
net: atlantic: minimal A2 HW bindings required for fw_ops

This patch adds the bare minimum of A2 HW bindings required to
get fw_ops working.

Signed-off-by: Dmitry Bogdanov <[email protected]>
Signed-off-by: Mark Starovoytov <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agonet: atlantic: A2 driver-firmware interface
Dmitry Bogdanov [Thu, 30 Apr 2020 08:04:36 +0000 (11:04 +0300)]
net: atlantic: A2 driver-firmware interface

This patch adds the driver<->firmware interface for A2

Signed-off-by: Dmitry Bogdanov <[email protected]>
Signed-off-by: Mark Starovoytov <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agonet: atlantic: move IS_CHIP_FEATURE to aq_hw.h
Mark Starovoytov [Thu, 30 Apr 2020 08:04:35 +0000 (11:04 +0300)]
net: atlantic: move IS_CHIP_FEATURE to aq_hw.h

IS_CHIP feature will be used to differentiate between A1 and A2,
where necessary. Thus, move it to aq_hw.h, rename it and make
it accept the 'hw' pointer.

Signed-off-by: Mark Starovoytov <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agonet: atlantic: make hw_get_regs optional
Mark Starovoytov [Thu, 30 Apr 2020 08:04:34 +0000 (11:04 +0300)]
net: atlantic: make hw_get_regs optional

This patch fixes potential crash in case if hw_get_regs is NULL.

Signed-off-by: Mark Starovoytov <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agonet: atlantic: simplify hw_get_fw_version() usage
Nikita Danilov [Thu, 30 Apr 2020 08:04:33 +0000 (11:04 +0300)]
net: atlantic: simplify hw_get_fw_version() usage

hw_get_fw_version() never fails, so this patch simplifies its
usage by utilizing return value instead of output argument.

Signed-off-by: Nikita Danilov <[email protected]>
Signed-off-by: Mark Starovoytov <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agonet: atlantic: add hw_soft_reset, hw_prepare to hw_ops
Mark Starovoytov [Thu, 30 Apr 2020 08:04:32 +0000 (11:04 +0300)]
net: atlantic: add hw_soft_reset, hw_prepare to hw_ops

A2 will have a different implementation of these 2 APIs, so
this patch moves them to hw_ops in preparation for A2.

Signed-off-by: Mark Starovoytov <[email protected]>
Co-developed-by: Dmitry Bezrukov <[email protected]>
Signed-off-by: Dmitry Bezrukov <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agonet: atlantic: add defines for 10M and EEE 100M link mode
Igor Russkikh [Thu, 30 Apr 2020 08:04:31 +0000 (11:04 +0300)]
net: atlantic: add defines for 10M and EEE 100M link mode

This patch adds defines for 10M and EEE 100M link modes, which are
supported by A2.

10M support is added in this patch series.
EEE is out of scope, but will be added in a follow-up series.

Signed-off-by: Igor Russkikh <[email protected]>
Signed-off-by: Mark Starovoytov <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agonet: atlantic: add A2 device IDs
Igor Russkikh [Thu, 30 Apr 2020 08:04:30 +0000 (11:04 +0300)]
net: atlantic: add A2 device IDs

Adding device ids for the new generation of atlantic nic.

Signed-off-by: Igor Russkikh <[email protected]>
Signed-off-by: Mark Starovoytov <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agonet: atlantic: update company name in the driver description
Igor Russkikh [Thu, 30 Apr 2020 08:04:29 +0000 (11:04 +0300)]
net: atlantic: update company name in the driver description

Aquantia is now part of Marvell. Thus, update the driver description.

Signed-off-by: Igor Russkikh <[email protected]>
Signed-off-by: Mark Starovoytov <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agodrivers: net: davinci_mdio: fix potential NULL dereference in davinci_mdio_probe()
Wei Yongjun [Wed, 29 Apr 2020 02:52:20 +0000 (02:52 +0000)]
drivers: net: davinci_mdio: fix potential NULL dereference in davinci_mdio_probe()

platform_get_resource() may fail and return NULL, so we should
better check it's return value to avoid a NULL pointer dereference
since devm_ioremap() does not check input parameters for null.

This is detected by Coccinelle semantic patch.

@@
expression pdev, res, n, t, e, e1, e2;
@@

res = \(platform_get_resource\|platform_get_resource_byname\)(pdev, t, n);
+ if (!res)
+   return -EINVAL;
... when != res == NULL
e = devm_ioremap(e1, res->start, e2);

Fixes: 03f66f067560 ("net: ethernet: ti: davinci_mdio: use devm_ioremap()")
Signed-off-by: Wei Yongjun <[email protected]>
Reviewed-by: Grygorii Strashko <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agonet: fix skb_panic to output real address
Jesper Dangaard Brouer [Mon, 27 Apr 2020 16:37:43 +0000 (18:37 +0200)]
net: fix skb_panic to output real address

In skb_panic() the real pointer values are really needed to diagnose
issues, e.g. data and head are related (to calculate headroom). The
hashed versions of the addresses doesn't make much sense here. The
patch use the printk specifier %px to print the actual address.

The printk documentation on %px:
https://www.kernel.org/doc/html/latest/core-api/printk-formats.html#unmodified-addresses

Fixes: ad67b74d2469 ("printk: hash addresses printed with %p")
Signed-off-by: Jesper Dangaard Brouer <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agonet: ethernet: stmmac: simplify phy modes management for stm32
Christophe Roullier [Mon, 27 Apr 2020 10:00:38 +0000 (12:00 +0200)]
net: ethernet: stmmac: simplify phy modes management for stm32

No new feature, just to simplify stm32 part to be easier to use.
Add by default all Ethernet clocks in DT, and activate or not in function
of phy mode, clock frequency, if property "st,ext-phyclk" is set or not.
Keep backward compatibility
--------------------------------------------------------------------------
|PHY_MODE |    Normal | PHY wo crystal|   PHY wo crystal   |  No 125Mhz  |
|         |       |      25MHz    |        50MHz       |  from PHY   |
--------------------------------------------------------------------------
|  MII    |  -    |     eth-ck    |       n/a          |     n/a  |
|         |       | st,ext-phyclk |                    |             |
--------------------------------------------------------------------------
|  GMII   |  -    |     eth-ck    |       n/a          |     n/a  |
|         |       | st,ext-phyclk |                    |             |
--------------------------------------------------------------------------
| RGMII   |  -    |     eth-ck    |       n/a          |     eth-ck  |
|         |      | st,ext-phyclk |                    |st,eth-clk-sel|
|         |      |               |                    |       or     |
|         |      |               |                    | st,ext-phyclk|
----------------==--------------------------------------------------------
| RMII    |  -   |     eth-ck    |      eth-ck        |       n/a    |
|         |       | st,ext-phyclk | st,eth-ref-clk-sel |              |
|         |       |               | or st,ext-phyclk   |              |
--------------------------------------------------------------------------

Signed-off-by: Christophe Roullier <[email protected]>
Acked-by: Alexandre TORGUE <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agobpf: Fix use-after-free of bpf_link when priming half-fails
Andrii Nakryiko [Fri, 1 May 2020 18:56:22 +0000 (11:56 -0700)]
bpf: Fix use-after-free of bpf_link when priming half-fails

If bpf_link_prime() succeeds to allocate new anon file, but then fails to
allocate ID for it, link priming is considered to be failed and user is
supposed ot be able to directly kfree() bpf_link, because it was never exposed
to user-space.

But at that point file already keeps a pointer to bpf_link and will eventually
call bpf_link_release(), so if bpf_link was kfree()'d by caller, that would
lead to use-after-free.

Fix this by first allocating ID and only then allocating file. Adding ID to
link_idr is ok, because link at that point still doesn't have its ID set, so
no user-space process can create a new FD for it.

Fixes: a3b80e107894 ("bpf: Allocate ID for bpf_link")
Reported-by: [email protected]
Suggested-by: Martin KaFai Lau <[email protected]>
Signed-off-by: Andrii Nakryiko <[email protected]>
Signed-off-by: Alexei Starovoitov <[email protected]>
Acked-by: Martin KaFai Lau <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
4 years agonet: Replace the limit of TCP_LINGER2 with TCP_FIN_TIMEOUT_MAX
Cambda Zhu [Fri, 24 Apr 2020 08:06:16 +0000 (16:06 +0800)]
net: Replace the limit of TCP_LINGER2 with TCP_FIN_TIMEOUT_MAX

This patch changes the behavior of TCP_LINGER2 about its limit. The
sysctl_tcp_fin_timeout used to be the limit of TCP_LINGER2 but now it's
only the default value. A new macro named TCP_FIN_TIMEOUT_MAX is added
as the limit of TCP_LINGER2, which is 2 minutes.

Since TCP_LINGER2 used sysctl_tcp_fin_timeout as the default value
and the limit in the past, the system administrator cannot set the
default value for most of sockets and let some sockets have a greater
timeout. It might be a mistake that let the sysctl to be the limit of
the TCP_LINGER2. Maybe we can add a new sysctl to set the max of
TCP_LINGER2, but FIN-WAIT-2 timeout is usually no need to be too long
and 2 minutes are legal considering TCP specs.

Changes in v3:
- Remove the new socket option and change the TCP_LINGER2 behavior so
  that the timeout can be set to value between sysctl_tcp_fin_timeout
  and 2 minutes.

Changes in v2:
- Add int overflow check for the new socket option.

Changes in v1:
- Add a new socket option to set timeout greater than
  sysctl_tcp_fin_timeout.

Signed-off-by: Cambda Zhu <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agoMerge branch 'r8169-improve-user-message-handling'
David S. Miller [Fri, 1 May 2020 19:53:06 +0000 (12:53 -0700)]
Merge branch 'r8169-improve-user-message-handling'

Heiner Kallweit says:

====================
r8169: improve user message handling

Series improves few aspects of handling messages to users.
====================

Signed-off-by: David S. Miller <[email protected]>
4 years agor8169: switch from netif_xxx message functions to netdev_xxx
Heiner Kallweit [Fri, 1 May 2020 17:26:22 +0000 (19:26 +0200)]
r8169: switch from netif_xxx message functions to netdev_xxx

Considering the few messages we have in the driver, there's not really
a benefit in being able to control them on a message type level.
Therefore simplify the code and switch to the netdev_xxx message
functions. In addition add net_ratelimit() to messages that can be
printed from a hot path.

Signed-off-by: Heiner Kallweit <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agor8169: remove "out of memory" error message from rtl_request_firmware
Heiner Kallweit [Fri, 1 May 2020 17:24:47 +0000 (19:24 +0200)]
r8169: remove "out of memory" error message from rtl_request_firmware

When preparing an unrelated change, checkpatch complained about this
redundant out-of-memory message. Therefore remove it.

Signed-off-by: Heiner Kallweit <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agor8169: simplify counter handling
Heiner Kallweit [Fri, 1 May 2020 17:23:36 +0000 (19:23 +0200)]
r8169: simplify counter handling

The counter handling functions can only fail if rtl8169_do_counters()
times out. In the poll function we emit an error message in case of
timeout, therefore we don't have to propagate the timeout all the
way up just to print another message basically saying the same.

Signed-off-by: Heiner Kallweit <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agor8169: remove redundant driver message when entering promiscuous mode
Heiner Kallweit [Fri, 1 May 2020 17:22:29 +0000 (19:22 +0200)]
r8169: remove redundant driver message when entering promiscuous mode

Net core -  __dev_set_promiscuity - prints a message already when
promiscuous mode in entered/left, therefore we don't have to do this
in the driver too. Also the driver message would be misleading
(would be because "link" message level is disabled per default)
because it would print "promisc mode enabled" even if it's being
left. Reason is that __dev_change_flags() calls dev_set_rx_mode()
before touching the promisc flag.

Signed-off-by: Heiner Kallweit <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agobpf: Bpf_{g,s}etsockopt for struct bpf_sock_addr
Stanislav Fomichev [Thu, 30 Apr 2020 23:31:52 +0000 (16:31 -0700)]
bpf: Bpf_{g,s}etsockopt for struct bpf_sock_addr

Currently, bpf_getsockopt and bpf_setsockopt helpers operate on the
'struct bpf_sock_ops' context in BPF_PROG_TYPE_SOCK_OPS program.
Let's generalize them and make them available for 'struct bpf_sock_addr'.
That way, in the future, we can allow those helpers in more places.

As an example, let's expose those 'struct bpf_sock_addr' based helpers to
BPF_CGROUP_INET{4,6}_CONNECT hooks. That way we can override CC before the
connection is made.

v3:
* Expose custom helpers for bpf_sock_addr context instead of doing
  generic bpf_sock argument (as suggested by Daniel). Even with
  try_socket_lock that doesn't sleep we have a problem where context sk
  is already locked and socket lock is non-nestable.

v2:
* s/BPF_PROG_TYPE_CGROUP_SOCKOPT/BPF_PROG_TYPE_SOCK_OPS/

Signed-off-by: Stanislav Fomichev <[email protected]>
Signed-off-by: Alexei Starovoitov <[email protected]>
Acked-by: Martin KaFai Lau <[email protected]>
Acked-by: John Fastabend <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
4 years agoMerge branch 'net-ReST-part-three'
David S. Miller [Fri, 1 May 2020 19:24:43 +0000 (12:24 -0700)]
Merge branch 'net-ReST-part-three'

Mauro Carvalho Chehab says:

====================
net: manually convert files to ReST format - part 3 (final)

That's the third part (and the final one) of my work to convert the networking
text files into ReST. it is based on linux-next next-20200430 branch.

The full series (including those ones) are at:

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

The  built output documents, on html format is at:

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

Signed-off-by: David S. Miller <[email protected]>
4 years agodocs: networking: arcnet-hardware.rst: don't duplicate chapter names
Mauro Carvalho Chehab [Fri, 1 May 2020 14:44:59 +0000 (16:44 +0200)]
docs: networking: arcnet-hardware.rst: don't duplicate chapter names

Since changeset 58ad30cf91f0 ("docs: fix reference to core-api/namespaces.rst"),
auto-references for chapters are generated. This is a nice feature, but
has a drawback: no chapters can have the same sumber.

So, we need to change two chapter titles, to avoid warnings when
building the docs.

Fixes: 58ad30cf91f0 ("docs: fix reference to core-api/namespaces.rst")
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agonet: docs: add page_pool.rst to index.rst
Mauro Carvalho Chehab [Fri, 1 May 2020 14:44:58 +0000 (16:44 +0200)]
net: docs: add page_pool.rst to index.rst

This file is already in ReST format. Add it to the net
index.rst, in order to make it part of the documentation
body.

Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agodocs: networking: device drivers: convert toshiba/spider_net.txt to ReST
Mauro Carvalho Chehab [Fri, 1 May 2020 14:44:57 +0000 (16:44 +0200)]
docs: networking: device drivers: convert toshiba/spider_net.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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agodocs: networking: device drivers: convert ti/tlan.txt to ReST
Mauro Carvalho Chehab [Fri, 1 May 2020 14:44:56 +0000 (16:44 +0200)]
docs: networking: device drivers: convert ti/tlan.txt to ReST

- add SPDX header;
- adjust titles and chapters, adding proper markups;
- 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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agodocs: networking: device drivers: convert ti/cpsw.txt to ReST
Mauro Carvalho Chehab [Fri, 1 May 2020 14:44:55 +0000 (16:44 +0200)]
docs: networking: device drivers: convert ti/cpsw.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 where needed;
- add to networking/index.rst.

Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agodocs: networking: device drivers: convert ti/cpsw_switchdev.txt to ReST
Mauro Carvalho Chehab [Fri, 1 May 2020 14:44:54 +0000 (16:44 +0200)]
docs: networking: device drivers: convert ti/cpsw_switchdev.txt to ReST

- add SPDX header;
- adjust titles and chapters, adding proper markups;
- use :field: 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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agodocs: networking: device drivers: convert smsc/smc9.txt to ReST
Mauro Carvalho Chehab [Fri, 1 May 2020 14:44:53 +0000 (16:44 +0200)]
docs: networking: device drivers: convert smsc/smc9.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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agodocs: networking: device drivers: convert sb1000.txt to ReST
Mauro Carvalho Chehab [Fri, 1 May 2020 14:44:52 +0000 (16:44 +0200)]
docs: networking: device drivers: convert sb1000.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 lists as such;
- adjust identation, whitespaces and blank lines where needed;
- add to networking/index.rst.

Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agodocs: networking: device drivers: convert qualcomm/rmnet.txt to ReST
Mauro Carvalho Chehab [Fri, 1 May 2020 14:44:51 +0000 (16:44 +0200)]
docs: networking: device drivers: convert qualcomm/rmnet.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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agodocs: networking: device drivers: convert neterion/vxge.txt to ReST
Mauro Carvalho Chehab [Fri, 1 May 2020 14:44:50 +0000 (16:44 +0200)]
docs: networking: device drivers: convert neterion/vxge.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 where needed;
- add to networking/index.rst.

Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agodocs: networking: device drivers: convert neterion/s2io.txt to ReST
Mauro Carvalho Chehab [Fri, 1 May 2020 14:44:49 +0000 (16:44 +0200)]
docs: networking: device drivers: convert neterion/s2io.txt to ReST

- add SPDX header;
- add a document title;
- comment out text-only TOC from html/pdf output;
- 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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agodocs: networking: device drivers: convert microsoft/netvsc.txt to ReST
Mauro Carvalho Chehab [Fri, 1 May 2020 14:44:48 +0000 (16:44 +0200)]
docs: networking: device drivers: convert microsoft/netvsc.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 where needed;
- add to networking/index.rst.

Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agodocs: networking: device drivers: convert intel/ipw2200.txt to ReST
Mauro Carvalho Chehab [Fri, 1 May 2020 14:44:47 +0000 (16:44 +0200)]
docs: networking: device drivers: convert intel/ipw2200.txt to ReST

- add SPDX header;
- adjust titles and chapters, adding proper markups;
- comment out text-only TOC from html/pdf output;
- use copyright symbol;
- use :field: 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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agodocs: networking: device drivers: convert intel/ipw2100.txt to ReST
Mauro Carvalho Chehab [Fri, 1 May 2020 14:44:46 +0000 (16:44 +0200)]
docs: networking: device drivers: convert intel/ipw2100.txt to ReST

- add SPDX header;
- adjust titles and chapters, adding proper markups;
- comment out text-only TOC from html/pdf output;
- use copyright symbol;
- use :field: 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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agodocs: networking: device drivers: convert freescale/gianfar.txt to ReST
Mauro Carvalho Chehab [Fri, 1 May 2020 14:44:45 +0000 (16:44 +0200)]
docs: networking: device drivers: convert freescale/gianfar.txt to ReST

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

Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agodocs: networking: device drivers: convert freescale/dpaa.txt to ReST
Mauro Carvalho Chehab [Fri, 1 May 2020 14:44:44 +0000 (16:44 +0200)]
docs: networking: device drivers: convert freescale/dpaa.txt to ReST

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

Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agodocs: networking: device drivers: convert dlink/dl2k.txt to ReST
Mauro Carvalho Chehab [Fri, 1 May 2020 14:44:43 +0000 (16:44 +0200)]
docs: networking: device drivers: convert dlink/dl2k.txt to ReST

- add SPDX header;
- mark code blocks and literals 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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agodocs: networking: device drivers: convert dec/dmfe.txt to ReST
Mauro Carvalho Chehab [Fri, 1 May 2020 14:44:42 +0000 (16:44 +0200)]
docs: networking: device drivers: convert dec/dmfe.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;
- adjust identation, whitespaces and blank lines where needed;
- add to networking/index.rst.

Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agodocs: networking: device drivers: convert dec/de4x5.txt to ReST
Mauro Carvalho Chehab [Fri, 1 May 2020 14:44:41 +0000 (16:44 +0200)]
docs: networking: device drivers: convert dec/de4x5.txt to ReST

- add SPDX header;
- add a document title;
- 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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agodocs: networking: device drivers: convert davicom/dm9000.txt to ReST
Mauro Carvalho Chehab [Fri, 1 May 2020 14:44:40 +0000 (16:44 +0200)]
docs: networking: device drivers: convert davicom/dm9000.txt to ReST

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

Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agodocs: networking: device drivers: convert cirrus/cs89x0.txt to ReST
Mauro Carvalho Chehab [Fri, 1 May 2020 14:44:39 +0000 (16:44 +0200)]
docs: networking: device drivers: convert cirrus/cs89x0.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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agodocs: networking: device drivers: convert chelsio/cxgb.txt to ReST
Mauro Carvalho Chehab [Fri, 1 May 2020 14:44:38 +0000 (16:44 +0200)]
docs: networking: device drivers: convert chelsio/cxgb.txt to ReST

- add SPDX header;
- use copyright symbol;
- adjust titles and chapters, adding proper markups;
- comment out text-only TOC from html/pdf output;
- mark code blocks and literals as such;
- add notes markups;
- 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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agodocs: networking: device drivers: convert aquantia/atlantic.txt to ReST
Mauro Carvalho Chehab [Fri, 1 May 2020 14:44:37 +0000 (16:44 +0200)]
docs: networking: device drivers: convert aquantia/atlantic.txt to ReST

- add SPDX header;
- use copyright symbol;
- adjust title and its markup;
- comment out text-only TOC from html/pdf output;
- 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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agodocs: networking: device drivers: convert amazon/ena.txt to ReST
Mauro Carvalho Chehab [Fri, 1 May 2020 14:44:36 +0000 (16:44 +0200)]
docs: networking: device drivers: convert amazon/ena.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 where needed;
- add to networking/index.rst.

Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agodocs: networking: device drivers: convert 3com/vortex.txt to ReST
Mauro Carvalho Chehab [Fri, 1 May 2020 14:44:35 +0000 (16:44 +0200)]
docs: networking: device drivers: convert 3com/vortex.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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agodocs: networking: device drivers: convert 3com/3c509.txt to ReST
Mauro Carvalho Chehab [Fri, 1 May 2020 14:44:34 +0000 (16:44 +0200)]
docs: networking: device drivers: convert 3com/3c509.txt to ReST

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

Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agodocs: networking: convert z8530drv.txt to ReST
Mauro Carvalho Chehab [Fri, 1 May 2020 14:44:33 +0000 (16:44 +0200)]
docs: networking: convert z8530drv.txt to ReST

- add SPDX header;
- use copyright symbol;
- adjust titles and chapters, adding proper markups;
- 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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agodocs: networking: convert xfrm_sysctl.txt to ReST
Mauro Carvalho Chehab [Fri, 1 May 2020 14:44:32 +0000 (16:44 +0200)]
docs: networking: convert xfrm_sysctl.txt to ReST

Not much to be done here:

- add SPDX header;
- add a document title;
- add a chapter's markup;
- add to networking/index.rst.

Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agodocs: networking: convert xfrm_sync.txt to ReST
Mauro Carvalho Chehab [Fri, 1 May 2020 14:44:31 +0000 (16:44 +0200)]
docs: networking: convert xfrm_sync.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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agodocs: networking: convert xfrm_proc.txt to ReST
Mauro Carvalho Chehab [Fri, 1 May 2020 14:44:30 +0000 (16:44 +0200)]
docs: networking: convert xfrm_proc.txt to ReST

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

Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agodocs: networking: convert xfrm_device.txt to ReST
Mauro Carvalho Chehab [Fri, 1 May 2020 14:44:29 +0000 (16:44 +0200)]
docs: networking: convert xfrm_device.txt to ReST

- add SPDX header;
- 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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agodocs: networking: convert x25.txt to ReST
Mauro Carvalho Chehab [Fri, 1 May 2020 14:44:28 +0000 (16:44 +0200)]
docs: networking: convert x25.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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agodocs: networking: convert x25-iface.txt to ReST
Mauro Carvalho Chehab [Fri, 1 May 2020 14:44:27 +0000 (16:44 +0200)]
docs: networking: convert x25-iface.txt to ReST

Not much to be done here:

- add SPDX header;
- adjust title markup;
- remove a tail whitespace;
- add to networking/index.rst.

Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agodocs: networking: convert vxlan.txt to ReST
Mauro Carvalho Chehab [Fri, 1 May 2020 14:44:26 +0000 (16:44 +0200)]
docs: networking: convert vxlan.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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agodocs: networking: convert vrf.txt to ReST
Mauro Carvalho Chehab [Fri, 1 May 2020 14:44:25 +0000 (16:44 +0200)]
docs: networking: convert vrf.txt to ReST

- add SPDX header;
- adjust title markup;
- Add a subtitle for the first section;
- mark code blocks and literals as such;
- adjust identation, whitespaces and blank lines;
- add to networking/index.rst.

Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Acked-by: David Ahern <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agodocs: networking: convert udplite.txt to ReST
Mauro Carvalho Chehab [Fri, 1 May 2020 14:44:24 +0000 (16:44 +0200)]
docs: networking: convert udplite.txt to ReST

- add SPDX header;
- 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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agodocs: networking: convert tuntap.txt to ReST
Mauro Carvalho Chehab [Fri, 1 May 2020 14:44:23 +0000 (16:44 +0200)]
docs: networking: convert tuntap.txt to ReST

- add SPDX header;
- use copyright symbol;
- 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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agor8169: remove not needed parameter in rtl8169_set_magic_reg
Heiner Kallweit [Fri, 1 May 2020 08:11:28 +0000 (10:11 +0200)]
r8169: remove not needed parameter in rtl8169_set_magic_reg

Remove a not needed parameter in rtl8169_set_magic_reg.

Signed-off-by: Heiner Kallweit <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agoMerge branch 'bpf_enable_stats'
Alexei Starovoitov [Fri, 1 May 2020 17:36:32 +0000 (10:36 -0700)]
Merge branch 'bpf_enable_stats'

Song Liu says:

====================
run_time_ns is a useful stats for BPF programs. However, it is gated by
sysctl kernel.bpf_stats_enabled. When multiple user space tools are
toggling kernl.bpf_stats_enabled at the same time, they may confuse each
other.

Solve this problem with a new BPF command BPF_ENABLE_STATS.

Changes v8 => v9:
  1. Clean up in selftest (Andrii).
  2. Not using static variable in test program (Andrii).

Changes v7 => v8:
  1. Change name BPF_STATS_RUNTIME_CNT => BPF_STATS_RUN_TIME (Alexei).
  2. Add CHECK_ATTR to bpf_enable_stats() (Alexei).
  3. Rebase (Andrii).
  4. Simplfy the selftest (Alexei).

Changes v6 => v7:
  1. Add test to verify run_cnt matches count measured by the program.

Changes v5 => v6:
  1. Simplify test program (Yonghong).
  2. Rebase (with some conflicts).

Changes v4 => v5:
  1. Use memset to zero bpf_attr in bpf_enable_stats() (Andrii).

Changes v3 => v4:
  1. Add libbpf support and selftest;
  2. Avoid cleaning trailing space.

Changes v2 => v3:
  1. Rename the command to BPF_ENABLE_STATS, and make it extendible.
  2. fix commit log;
  3. remove unnecessary headers.
====================

Signed-off-by: Alexei Starovoitov <[email protected]>
4 years agobpf: Add selftest for BPF_ENABLE_STATS
Song Liu [Thu, 30 Apr 2020 07:15:06 +0000 (00:15 -0700)]
bpf: Add selftest for BPF_ENABLE_STATS

Add test for BPF_ENABLE_STATS, which should enable run_time_ns stats.

~/selftests/bpf# ./test_progs -t enable_stats  -v
test_enable_stats:PASS:skel_open_and_load 0 nsec
test_enable_stats:PASS:get_stats_fd 0 nsec
test_enable_stats:PASS:attach_raw_tp 0 nsec
test_enable_stats:PASS:get_prog_info 0 nsec
test_enable_stats:PASS:check_stats_enabled 0 nsec
test_enable_stats:PASS:check_run_cnt_valid 0 nsec
Summary: 1/0 PASSED, 0 SKIPPED, 0 FAILED

Signed-off-by: Song Liu <[email protected]>
Signed-off-by: Alexei Starovoitov <[email protected]>
Acked-by: Andrii Nakryiko <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
4 years agolibbpf: Add support for command BPF_ENABLE_STATS
Song Liu [Thu, 30 Apr 2020 07:15:05 +0000 (00:15 -0700)]
libbpf: Add support for command BPF_ENABLE_STATS

bpf_enable_stats() is added to enable given stats.

Signed-off-by: Song Liu <[email protected]>
Signed-off-by: Alexei Starovoitov <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
4 years agobpf: Sharing bpf runtime stats with BPF_ENABLE_STATS
Song Liu [Thu, 30 Apr 2020 07:15:04 +0000 (00:15 -0700)]
bpf: Sharing bpf runtime stats with BPF_ENABLE_STATS

Currently, sysctl kernel.bpf_stats_enabled controls BPF runtime stats.
Typical userspace tools use kernel.bpf_stats_enabled as follows:

  1. Enable kernel.bpf_stats_enabled;
  2. Check program run_time_ns;
  3. Sleep for the monitoring period;
  4. Check program run_time_ns again, calculate the difference;
  5. Disable kernel.bpf_stats_enabled.

The problem with this approach is that only one userspace tool can toggle
this sysctl. If multiple tools toggle the sysctl at the same time, the
measurement may be inaccurate.

To fix this problem while keep backward compatibility, introduce a new
bpf command BPF_ENABLE_STATS. On success, this command enables stats and
returns a valid fd. BPF_ENABLE_STATS takes argument "type". Currently,
only one type, BPF_STATS_RUN_TIME, is supported. We can extend the
command to support other types of stats in the future.

With BPF_ENABLE_STATS, user space tool would have the following flow:

  1. Get a fd with BPF_ENABLE_STATS, and make sure it is valid;
  2. Check program run_time_ns;
  3. Sleep for the monitoring period;
  4. Check program run_time_ns again, calculate the difference;
  5. Close the fd.

Signed-off-by: Song Liu <[email protected]>
Signed-off-by: Alexei Starovoitov <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
4 years agohinic: Use kmemdup instead of kzalloc and memcpy
Zou Wei [Wed, 29 Apr 2020 03:35:28 +0000 (11:35 +0800)]
hinic: Use kmemdup instead of kzalloc and memcpy

Fixes coccicheck warnings:

 drivers/net/ethernet/huawei/hinic/hinic_hw_mbox.c:452:17-24: WARNING opportunity for kmemdup
 drivers/net/ethernet/huawei/hinic/hinic_hw_mbox.c:458:23-30: WARNING opportunity for kmemdup

Reported-by: Hulk Robot <[email protected]>
Signed-off-by: Zou Wei <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agohinic: make symbol 'dump_mox_reg' static
Zheng Bin [Wed, 29 Apr 2020 01:58:24 +0000 (09:58 +0800)]
hinic: make symbol 'dump_mox_reg' static

Fix sparse warnings:

drivers/net/ethernet/huawei/hinic/hinic_hw_mbox.c:601:6: warning: symbol 'dump_mox_reg' was not declared. Should it be static?

Reported-by: Hulk Robot <[email protected]>
Signed-off-by: Zheng Bin <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agonet: phy: bcm54140: add second PHY ID
Michael Walle [Tue, 28 Apr 2020 23:06:59 +0000 (01:06 +0200)]
net: phy: bcm54140: add second PHY ID

This PHY has two PHY IDs depending on its mode. Adjust the mask so that
it includes both IDs.

Signed-off-by: Michael Walle <[email protected]>
Reviewed-by: Andrew Lunn <[email protected]>
Reviewed-by: Florian Fainelli <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agonet: phy: bcm54140: apply the workaround on b0 chips
Michael Walle [Tue, 28 Apr 2020 23:06:58 +0000 (01:06 +0200)]
net: phy: bcm54140: apply the workaround on b0 chips

The lower three bits of the phy_id specifies the chip stepping. The
workaround is specifically for the B0 stepping. Apply it only on these
chips.

Signed-off-by: Michael Walle <[email protected]>
Reviewed-by: Andrew Lunn <[email protected]>
Reviewed-by: Florian Fainelli <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agonet: phy: bcm54140: fix phy_id_mask
Michael Walle [Tue, 28 Apr 2020 23:06:57 +0000 (01:06 +0200)]
net: phy: bcm54140: fix phy_id_mask

Broadcom defines the bits for this PHY as follows:
  { oui[24:3], model[6:0], revision[2:0] }

Thus we have to mask the lower three bits only.

Fixes: 6937602ed3f9 ("net: phy: add Broadcom BCM54140 support")
Signed-off-by: Michael Walle <[email protected]>
Reviewed-by: Andrew Lunn <[email protected]>
Reviewed-by: Florian Fainelli <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agonet: phy: bcm54140: use genphy_soft_reset()
Michael Walle [Tue, 28 Apr 2020 23:06:56 +0000 (01:06 +0200)]
net: phy: bcm54140: use genphy_soft_reset()

Set the .soft_reset() op to be sure there will be a reset even if there
is no hardware reset line registered.

Signed-off-by: Michael Walle <[email protected]>
Reviewed-by: Florian Fainelli <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agonet: phy: at803x: add downshift support
Michael Walle [Tue, 28 Apr 2020 21:15:02 +0000 (23:15 +0200)]
net: phy: at803x: add downshift support

The AR8031 and AR8035 support the link speed downshift. Add driver
support for it. One peculiarity of these PHYs is that it needs a
software reset after changing the setting, thus add the .soft_reset()
op and do a phy_init_hw() if necessary.

This was tested on a custom board with the AR8031.

Signed-off-by: Michael Walle <[email protected]>
Reviewed-by: Andrew Lunn <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agor8169: configure PME_SIGNAL for RTL8125 too
Heiner Kallweit [Tue, 28 Apr 2020 20:55:59 +0000 (22:55 +0200)]
r8169: configure PME_SIGNAL for RTL8125 too

RTL8125 supports the same PME_SIGNAL handling as all later RTL8168
chip variants.

Signed-off-by: Heiner Kallweit <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agor8169: improve max jumbo packet size definition
Heiner Kallweit [Tue, 28 Apr 2020 20:54:12 +0000 (22:54 +0200)]
r8169: improve max jumbo packet size definition

Sync definition of max jumbo packet size with vendor driver and reserve
22 bytes for VLAN ethernet header plus checksum.

Signed-off-by: Heiner Kallweit <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agonet: usb: ax88179_178a: Implement ethtool_ops set_eeprom
Bjorn Andersson [Tue, 28 Apr 2020 07:01:39 +0000 (00:01 -0700)]
net: usb: ax88179_178a: Implement ethtool_ops set_eeprom

The vendor driver does upon failing to read a valid MAC address from
EEPROM write the netdev's address back to EEPROM and invoking a EEPROM
reload operation. Based on this we can implement the ethtool_ops
set_eeprom and provide the means to populate the EEPROM from within
Linux.

It's worth noting that ax88179_get_eeprom() will return some default
data unless the content of the EEPROM is deemed "complete", so until the
EEPROM is fully populated (e.g. by running ethtool -e | ethtool -E)
data written with ax88179_set_eeprom() will appear not to stick.

The implementation is based on asix_set_eeprom(), from asix_common.c

Signed-off-by: Bjorn Andersson <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agodpaa2-eth: fix error return code in setup_dpni()
Wei Yongjun [Mon, 27 Apr 2020 10:43:22 +0000 (10:43 +0000)]
dpaa2-eth: fix error return code in setup_dpni()

Fix to return negative error code -ENOMEM from the error handling
case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agonet: ll_temac: Fix return value check in temac_probe()
Wei Yongjun [Mon, 27 Apr 2020 09:40:52 +0000 (09:40 +0000)]
net: ll_temac: Fix return value check in temac_probe()

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

Signed-off-by: Wei Yongjun <[email protected]>
Acked-by: Esben Haabendal <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agonet: ethernet: fec: Revert "net: ethernet: fec: Replace interrupt driven MDIO with...
Fugang Duan [Mon, 27 Apr 2020 14:08:04 +0000 (22:08 +0800)]
net: ethernet: fec: Revert "net: ethernet: fec: Replace interrupt driven MDIO with polled IO"

This reverts commit 29ae6bd1b0d8a57d7c00ab12cbb949fc41986eef.

The commit breaks ethernet function on i.MX6SX, i.MX7D, i.MX8MM,
i.MX8MQ, and i.MX8QXP platforms. Boot yocto system by NFS mounting
rootfs will be failed with the commit.

Signed-off-by: Fugang Duan <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agonet: lpc-enet: fix error return code in lpc_mii_init()
Wei Yongjun [Mon, 27 Apr 2020 12:15:07 +0000 (12:15 +0000)]
net: lpc-enet: fix error return code in lpc_mii_init()

Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Fixes: b7370112f519 ("lpc32xx: Added ethernet driver")
Signed-off-by: Wei Yongjun <[email protected]>
Acked-by: Vladimir Zapolskiy <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agoice: Fix error return code in ice_add_prof()
Wei Yongjun [Mon, 27 Apr 2020 12:12:28 +0000 (12:12 +0000)]
ice: Fix error return code in ice_add_prof()

Fix to return a error code from the error handling case
instead of 0, as done elsewhere in this function.

Fixes: 31ad4e4ee1e4 ("ice: Allocate flow profile")
Signed-off-by: Wei Yongjun <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agoocteontx2-pf: Fix error return code in otx2_probe()
Wei Yongjun [Mon, 27 Apr 2020 12:11:10 +0000 (12:11 +0000)]
octeontx2-pf: Fix error return code in otx2_probe()

Fix to return negative error code -ENOMEM from the error handling
case instead of 0, as done elsewhere in this function.

Fixes: 5a6d7c9daef3 ("octeontx2-pf: Mailbox communication with AF")
Signed-off-by: Wei Yongjun <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agodpaa_eth: Fix comparing pointer to 0
Aishwarya Ramakrishnan [Mon, 27 Apr 2020 10:32:30 +0000 (16:02 +0530)]
dpaa_eth: Fix comparing pointer to 0

Fixes coccicheck warning:
./drivers/net/ethernet/freescale/dpaa/dpaa_eth.c:2110:30-31:
WARNING comparing pointer to 0

Avoid pointer type value compared to 0.

Signed-off-by: Aishwarya Ramakrishnan <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agoptp_qoriq: output PPS signal on FIPER2 in default
Yangbo Lu [Mon, 27 Apr 2020 03:39:03 +0000 (11:39 +0800)]
ptp_qoriq: output PPS signal on FIPER2 in default

Output PPS signal on FIPER2 (Fixed Period Interval Pulse) in default
which is more desired by user.

Signed-off-by: Yangbo Lu <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agoMerge branch 'netlink-validation-improvements-refactoring'
David S. Miller [Fri, 1 May 2020 00:51:42 +0000 (17:51 -0700)]
Merge branch 'netlink-validation-improvements-refactoring'

Johannes Berg says:

====================
netlink validation improvements/refactoring

Alright, this is the resend now, really just changing

 - the WARN_ON_ONCE() as spotted by Jakub;
 - mark the export patch no longer RFC.
   I wasn't actually sure if you meant this one too, and I really
   should dig out and polish the code that showed it in userspace.
====================

Signed-off-by: David S. Miller <[email protected]>
4 years agonetlink: add infrastructure to expose policies to userspace
Johannes Berg [Thu, 30 Apr 2020 20:13:12 +0000 (22:13 +0200)]
netlink: add infrastructure to expose policies to userspace

Add, and use in generic netlink, helpers to dump out a netlink
policy to userspace, including all the range validation data,
nested policies etc.

This lets userspace discover what the kernel understands.

For families/commands other than generic netlink, the helpers
need to be used directly in an appropriate command, or we can
add some infrastructure (a new netlink family) that those can
register their policies with for introspection. I'm not that
familiar with non-generic netlink, so that's left out for now.

The data exposed to userspace also includes min and max length
for binary/string data, I've done that instead of letting the
userspace tools figure out whether min/max is intended based
on the type so that we can extend this later in the kernel, we
might want to just use the range data for example.

Because of this, I opted to not directly expose the NLA_*
values, even if some of them are already exposed via BPF, as
with min/max length we don't need to have different types here
for NLA_BINARY/NLA_MIN_LEN/NLA_EXACT_LEN, we just make them
all NL_ATTR_TYPE_BINARY with min/max length optionally set.

Similarly, we don't really need NLA_MSECS, and perhaps can
remove it in the future - but not if we encode it into the
userspace API now. It gets mapped to NL_ATTR_TYPE_U64 here.

Note that the exposing here corresponds to the strict policy
interpretation, and NLA_UNSPEC items are omitted entirely.
To get those, change them to NLA_MIN_LEN which behaves in
exactly the same way, but is exposed.

Signed-off-by: Johannes Berg <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agonetlink: factor out policy range helpers
Johannes Berg [Thu, 30 Apr 2020 20:13:11 +0000 (22:13 +0200)]
netlink: factor out policy range helpers

Add helpers to get the policy's signed/unsigned range
validation data.

Signed-off-by: Johannes Berg <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agonetlink: remove NLA_EXACT_LEN_WARN
Johannes Berg [Thu, 30 Apr 2020 20:13:10 +0000 (22:13 +0200)]
netlink: remove NLA_EXACT_LEN_WARN

Use a validation type instead, so we can later expose
the NLA_* values to userspace for policy descriptions.

Some transformations were done with this spatch:

    @@
    identifier p;
    expression X, L, A;
    @@
    struct nla_policy p[X] = {
    [A] =
    -{ .type = NLA_EXACT_LEN_WARN, .len = L },
    +NLA_POLICY_EXACT_LEN_WARN(L),
    ...
    };

Signed-off-by: Johannes Berg <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agonetlink: allow NLA_MSECS to have range validation
Johannes Berg [Thu, 30 Apr 2020 20:13:09 +0000 (22:13 +0200)]
netlink: allow NLA_MSECS to have range validation

Since NLA_MSECS is really equivalent to NLA_U64, allow
it to have range validation as well.

Signed-off-by: Johannes Berg <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agonetlink: extend policy range validation
Johannes Berg [Thu, 30 Apr 2020 20:13:08 +0000 (22:13 +0200)]
netlink: extend policy range validation

Using a pointer to a struct indicating the min/max values,
extend the ability to do range validation for arbitrary
values. Small values in the s16 range can be kept in the
policy directly.

Signed-off-by: Johannes Berg <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
This page took 0.112031 seconds and 4 git commands to generate.