Nick Desaulniers
4d6fb34acb
export.h: fix section name for CONFIG_TRIM_UNUSED_KSYMS for Clang
...
When enabling CONFIG_TRIM_UNUSED_KSYMS, the linker will warn about the
orphan sections:
(".discard.ksym") is being placed in '".discard.ksym"'
repeatedly when linking vmlinux. This is because the stringification
operator, `#`, in the preprocessor escapes strings. GCC and Clang differ
in how they treat section names that contain \".
The portable solution is to not use a string literal with the preprocessor
stringification operator.
Fixes: commit bbda5ec671 ("kbuild: simplify dependency generation for CONFIG_TRIM_UNUSED_KSYMS")
Reported-by: kbuild test robot <lkp@intel.com >
Suggested-by: Kees Cook <keescook@chromium.org >
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Reviewed-by: Kees Cook <keescook@chromium.org >
Cc: Nathan Chancellor <natechancellor@gmail.com >
Cc: Masahiro Yamada <yamada.masahiro@socionext.com >
Cc: Matthias Maennich <maennich@google.com >
Cc: Jessica Yu <jeyu@kernel.org >
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
Cc: Will Deacon <will@kernel.org >
Link: https://bugs.llvm.org/show_bug.cgi?id=42950
Link: https://github.com/ClangBuiltLinux/linux/issues/1166
Link: https://lkml.kernel.org/r/20200929190701.398762-1-ndesaulniers@google.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2020-10-13 18:38:26 -07:00
Nick Desaulniers
a25c13b3aa
compiler.h: avoid escaped section names
...
The stringification operator, `#`, in the preprocessor escapes strings.
For example, `# "foo"` becomes `"\"foo\""`. GCC and Clang differ in how
they treat section names that contain \".
The portable solution is to not use a string literal with the preprocessor
stringification operator.
In this case, since __section unconditionally uses the stringification
operator, we actually want the more verbose
__attribute__((__section__())).
Fixes: commit e04462fb82 ("Compiler Attributes: remove uses of __attribute__ from compiler.h")
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Cc: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com >
Cc: Luc Van Oostenryck <luc.vanoostenryck@gmail.com >
Cc: Nathan Chancellor <natechancellor@gmail.com >
Cc: Arvind Sankar <nivedita@alum.mit.edu >
Link: https://bugs.llvm.org/show_bug.cgi?id=42950
Link: https://lkml.kernel.org/r/20200929194318.548707-1-ndesaulniers@google.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2020-10-13 18:38:26 -07:00
Nick Desaulniers
c8db3b0a7b
compiler-gcc: improve version error
...
As Kees suggests, doing so provides developers with two useful pieces of
information:
- The kernel build was attempting to use GCC.
(Maybe they accidentally poked the wrong configs in a CI.)
- They need 4.9 or better.
("Upgrade to what version?" doesn't need to be dug out of documentation,
headers, etc.)
Suggested-by: Kees Cook <keescook@chromium.org >
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Tested-by: Sedat Dilek <sedat.dilek@gmail.com >
Reviewed-by: Kees Cook <keescook@chromium.org >
Reviewed-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com >
Reviewed-by: Nathan Chancellor <natechancellor@gmail.com >
Reviewed-by: Sedat Dilek <sedat.dilek@gmail.com >
Cc: Andrey Konovalov <andreyknvl@google.com >
Cc: Fangrui Song <maskray@google.com >
Cc: Marco Elver <elver@google.com >
Cc: Alexei Starovoitov <ast@kernel.org >
Cc: Daniel Borkmann <daniel@iogearbox.net >
Cc: Masahiro Yamada <masahiroy@kernel.org >
Cc: Vincenzo Frascino <vincenzo.frascino@arm.com >
Cc: Will Deacon <will@kernel.org >
Link: https://lkml.kernel.org/r/20200902225911.209899-8-ndesaulniers@google.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2020-10-13 18:38:26 -07:00
Marco Elver
527f6750d9
kasan: remove mentions of unsupported Clang versions
...
Since the kernel now requires at least Clang 10.0.1, remove any mention of
old Clang versions and simplify the documentation.
Signed-off-by: Marco Elver <elver@google.com >
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Reviewed-by: Andrey Konovalov <andreyknvl@google.com >
Reviewed-by: Kees Cook <keescook@chromium.org >
Reviewed-by: Nathan Chancellor <natechancellor@gmail.com >
Cc: Fangrui Song <maskray@google.com >
Cc: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com >
Cc: Sedat Dilek <sedat.dilek@gmail.com >
Cc: Alexei Starovoitov <ast@kernel.org >
Cc: Daniel Borkmann <daniel@iogearbox.net >
Cc: Masahiro Yamada <masahiroy@kernel.org >
Cc: Vincenzo Frascino <vincenzo.frascino@arm.com >
Cc: Will Deacon <will@kernel.org >
Link: https://lkml.kernel.org/r/20200902225911.209899-7-ndesaulniers@google.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2020-10-13 18:38:26 -07:00
Nick Desaulniers
3511af0a72
Partially revert "ARM: 8905/1: Emit __gnu_mcount_nc when using Clang 10.0.0 or newer"
...
This partially reverts commit b0fe66cf09 .
The minimum supported version of clang is now clang 10.0.1. We still
want to pass -meabi=gnu.
Suggested-by: Nathan Chancellor <natechancellor@gmail.com >
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Reviewed-by: Kees Cook <keescook@chromium.org >
Reviewed-by: Nathan Chancellor <natechancellor@gmail.com >
Cc: Andrey Konovalov <andreyknvl@google.com >
Cc: Fangrui Song <maskray@google.com >
Cc: Marco Elver <elver@google.com >
Cc: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com >
Cc: Sedat Dilek <sedat.dilek@gmail.com >
Cc: Alexei Starovoitov <ast@kernel.org >
Cc: Daniel Borkmann <daniel@iogearbox.net >
Cc: Masahiro Yamada <masahiroy@kernel.org >
Cc: Vincenzo Frascino <vincenzo.frascino@arm.com >
Cc: Will Deacon <will@kernel.org >
Link: https://lkml.kernel.org/r/20200902225911.209899-6-ndesaulniers@google.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2020-10-13 18:38:26 -07:00
Nick Desaulniers
3759da22e5
Revert "arm64: vdso: Fix compilation with clang older than 8"
...
This reverts commit 3acf4be235 .
The minimum supported version of clang is clang 10.0.1.
Suggested-by: Nathan Chancellor <natechancellor@gmail.com >
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Reviewed-by: Kees Cook <keescook@chromium.org >
Reviewed-by: Nathan Chancellor <natechancellor@gmail.com >
Cc: Andrey Konovalov <andreyknvl@google.com >
Cc: Fangrui Song <maskray@google.com >
Cc: Marco Elver <elver@google.com >
Cc: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com >
Cc: Sedat Dilek <sedat.dilek@gmail.com >
Cc: Alexei Starovoitov <ast@kernel.org >
Cc: Daniel Borkmann <daniel@iogearbox.net >
Cc: Masahiro Yamada <masahiroy@kernel.org >
Cc: Vincenzo Frascino <vincenzo.frascino@arm.com >
Cc: Will Deacon <will@kernel.org >
Link: https://lkml.kernel.org/r/20200902225911.209899-5-ndesaulniers@google.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2020-10-13 18:38:26 -07:00
Nick Desaulniers
2980e6070e
Revert "arm64: bti: Require clang >= 10.0.1 for in-kernel BTI support"
...
This reverts commit b9249cba25 .
The minimum supported version of clang is now 10.0.1.
Suggested-by: Nathan Chancellor <natechancellor@gmail.com >
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Reviewed-by: Kees Cook <keescook@chromium.org >
Reviewed-by: Nathan Chancellor <natechancellor@gmail.com >
Cc: Andrey Konovalov <andreyknvl@google.com >
Cc: Fangrui Song <maskray@google.com >
Cc: Marco Elver <elver@google.com >
Cc: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com >
Cc: Sedat Dilek <sedat.dilek@gmail.com >
Cc: Alexei Starovoitov <ast@kernel.org >
Cc: Daniel Borkmann <daniel@iogearbox.net >
Cc: Masahiro Yamada <masahiroy@kernel.org >
Cc: Vincenzo Frascino <vincenzo.frascino@arm.com >
Cc: Will Deacon <will@kernel.org >
Link: https://lkml.kernel.org/r/20200902225911.209899-4-ndesaulniers@google.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2020-10-13 18:38:26 -07:00
Nick Desaulniers
4c207c50ea
Revert "kbuild: disable clang's default use of -fmerge-all-constants"
...
This reverts commit 87e0d4f0f3 .
-fno-merge-all-constants has been the default since clang-6; the minimum
supported version of clang in the kernel is clang-10 (10.0.1).
Suggested-by: Nathan Chancellor <natechancellor@gmail.com >
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Tested-by: Sedat Dilek <sedat.dilek@gmail.com >
Reviewed-by: Fangrui Song <maskray@google.com >
Reviewed-by: Nathan Chancellor <natechancellor@gmail.com >
Reviewed-by: Sedat Dilek <sedat.dilek@gmail.com >
Reviewed-by: Kees Cook <keescook@chromium.org >
Cc: Andrey Konovalov <andreyknvl@google.com >
Cc: Marco Elver <elver@google.com >
Cc: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com >
Cc: Alexei Starovoitov <ast@kernel.org >
Cc: Daniel Borkmann <daniel@iogearbox.net >
Cc: Masahiro Yamada <masahiroy@kernel.org >
Cc: Vincenzo Frascino <vincenzo.frascino@arm.com >
Cc: Will Deacon <will@kernel.org >
Link: https://lkml.kernel.org/r/20200902225911.209899-3-ndesaulniers@google.com
Link: https://reviews.llvm.org/rL329300 .
Link: https://github.com/ClangBuiltLinux/linux/issues/9
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2020-10-13 18:38:26 -07:00
Nick Desaulniers
1f7a44f63e
compiler-clang: add build check for clang 10.0.1
...
Patch series "set clang minimum version to 10.0.1", v3.
Adds a compile time #error to compiler-clang.h setting the effective
minimum supported version to clang 10.0.1. A separate patch has already
been picked up into the Documentation/ tree also confirming the version.
Next are a series of reverts. One for 32b arm is a partial revert.
Then Marco suggested fixes to KASAN docs.
Finally, improve the warning for GCC too as per Kees.
This patch (of 7):
During Plumbers 2020, we voted to just support the latest release of Clang
for now. Add a compile time check for this.
We plan to remove workarounds for older versions now, which will break in
subtle and not so subtle ways.
Suggested-by: Sedat Dilek <sedat.dilek@gmail.com >
Suggested-by: Nathan Chancellor <natechancellor@gmail.com >
Suggested-by: Kees Cook <keescook@chromium.org >
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Tested-by: Sedat Dilek <sedat.dilek@gmail.com >
Reviewed-by: Kees Cook <keescook@chromium.org >
Reviewed-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com >
Reviewed-by: Sedat Dilek <sedat.dilek@gmail.com >
Acked-by: Marco Elver <elver@google.com >
Acked-by: Nathan Chancellor <natechancellor@gmail.com >
Acked-by: Sedat Dilek <sedat.dilek@gmail.com >
Cc: Andrey Konovalov <andreyknvl@google.com >
Cc: Fangrui Song <maskray@google.com >
Cc: Masahiro Yamada <masahiroy@kernel.org >
Cc: Daniel Borkmann <daniel@iogearbox.net >
Cc: Alexei Starovoitov <ast@kernel.org >
Cc: Will Deacon <will@kernel.org >
Cc: Vincenzo Frascino <vincenzo.frascino@arm.com >
Link: https://lkml.kernel.org/r/20200902225911.209899-1-ndesaulniers@google.com
Link: https://lkml.kernel.org/r/20200902225911.209899-2-ndesaulniers@google.com
Link: https://github.com/ClangBuiltLinux/linux/issues/9
Link: https://github.com/ClangBuiltLinux/linux/issues/941
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2020-10-13 18:38:26 -07:00
Cong Wang
fdafed4599
ip_gre: set dev->hard_header_len and dev->needed_headroom properly
...
GRE tunnel has its own header_ops, ipgre_header_ops, and sets it
conditionally. When it is set, it assumes the outer IP header is
already created before ipgre_xmit().
This is not true when we send packets through a raw packet socket,
where L2 headers are supposed to be constructed by user. Packet
socket calls dev_validate_header() to validate the header. But
GRE tunnel does not set dev->hard_header_len, so that check can
be simply bypassed, therefore uninit memory could be passed down
to ipgre_xmit(). Similar for dev->needed_headroom.
dev->hard_header_len is supposed to be the length of the header
created by dev->header_ops->create(), so it should be used whenever
header_ops is set, and dev->needed_headroom should be used when it
is not set.
Reported-and-tested-by: syzbot+4a2c52677a8a1aa283cb@syzkaller.appspotmail.com
Cc: William Tu <u9012063@gmail.com >
Acked-by: Willem de Bruijn <willemb@google.com >
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com >
Acked-by: Xie He <xie.he.0141@gmail.com >
Signed-off-by: Jakub Kicinski <kuba@kernel.org >
2020-10-13 18:35:29 -07:00
Jonathan Marek
80a18f4a85
clk: qcom: Add display clock controller driver for SM8150 and SM8250
...
Add support for the display clock controller found on SM8150 and SM8250.
Signed-off-by: Jonathan Marek <jonathan@marek.ca >
Tested-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org > (SM8250)
Link: https://lore.kernel.org/r/20200927190653.13876-3-jonathan@marek.ca
Signed-off-by: Stephen Boyd <sboyd@kernel.org >
2020-10-13 18:18:06 -07:00
Jonathan Marek
d05a58047c
dt-bindings: clock: add QCOM SM8150 and SM8250 display clock bindings
...
Add device tree bindings for display clock controller for
Qualcomm Technology Inc's SM8150 and SM8250 SoCs.
Signed-off-by: Jonathan Marek <jonathan@marek.ca >
Tested-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org > (SM8250)
Link: https://lore.kernel.org/r/20200927190653.13876-2-jonathan@marek.ca
Reviewed-by: Rob Herring <robh@kernel.org >
Signed-off-by: Stephen Boyd <sboyd@kernel.org >
2020-10-13 18:18:06 -07:00
Jonathan Marek
0e94711a1f
clk: qcom: add video clock controller driver for SM8250
...
Add support for the video clock controller found on SM8250 based devices.
Derived from the downstream driver.
Signed-off-by: Jonathan Marek <jonathan@marek.ca >
Link: https://lore.kernel.org/r/20200923160635.28370-6-jonathan@marek.ca
Signed-off-by: Stephen Boyd <sboyd@kernel.org >
2020-10-13 18:05:04 -07:00
Jonathan Marek
5658e8cf1a
clk: qcom: add video clock controller driver for SM8150
...
Add support for the video clock controller found on SM8150 based devices.
Derived from the downstream driver.
Signed-off-by: Jonathan Marek <jonathan@marek.ca >
Link: https://lore.kernel.org/r/20200923160635.28370-5-jonathan@marek.ca
Signed-off-by: Stephen Boyd <sboyd@kernel.org >
2020-10-13 18:05:04 -07:00
Jonathan Marek
dafb992a95
dt-bindings: clock: add SM8250 QCOM video clock bindings
...
Add device tree bindings for video clock controller for SM8250 SoCs.
Signed-off-by: Jonathan Marek <jonathan@marek.ca >
Reviewed-by: Rob Herring <robh@kernel.org >
Link: https://lore.kernel.org/r/20200923160635.28370-4-jonathan@marek.ca
Signed-off-by: Stephen Boyd <sboyd@kernel.org >
2020-10-13 18:05:04 -07:00
Jonathan Marek
df3f61d2cd
dt-bindings: clock: add SM8150 QCOM video clock bindings
...
Add device tree bindings for video clock controller for SM8150 SoCs.
Signed-off-by: Jonathan Marek <jonathan@marek.ca >
Reviewed-by: Rob Herring <robh@kernel.org >
Link: https://lore.kernel.org/r/20200923160635.28370-3-jonathan@marek.ca
Signed-off-by: Stephen Boyd <sboyd@kernel.org >
2020-10-13 18:05:03 -07:00
Jonathan Marek
70d795d2d8
dt-bindings: clock: combine qcom,sdm845-videocc and qcom,sc7180-videocc
...
These two bindings are almost identical, so combine them into one. This
will make it easier to add the sm8150 and sm8250 videocc bindings.
Signed-off-by: Jonathan Marek <jonathan@marek.ca >
Reviewed-by: Rob Herring <robh@kernel.org >
Link: https://lore.kernel.org/r/20200923160635.28370-2-jonathan@marek.ca
Signed-off-by: Stephen Boyd <sboyd@kernel.org >
2020-10-13 18:05:03 -07:00
Konrad Dybcio
8c18b41b39
clk: qcom: gcc-msm8994: Add missing clocks, resets and GDSCs
...
This change adds GDSCs, resets and most of the missing
clocks to the msm8994 GCC driver. The remaining ones
are of local_vote_clk and gate_clk type, which are not
yet supported upstream. Also reorder them to match the
original downstream driver.
Signed-off-by: Konrad Dybcio <konradybcio@gmail.com >
Link: https://lore.kernel.org/r/20201005145855.149206-1-konradybcio@gmail.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org >
2020-10-13 18:04:36 -07:00
Julia Lawall
3270ee1455
clk: meson: use semicolons rather than commas to separate statements
...
Replace commas with semicolons. What is done is essentially described by
the following Coccinelle semantic patch (http://coccinelle.lip6.fr/ ):
// <smpl>
@@ expression e1,e2; @@
e1
-,
+;
e2
... when any
// </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr >
Link: https://lore.kernel.org/r/1601233948-11629-11-git-send-email-Julia.Lawall@inria.fr
Signed-off-by: Stephen Boyd <sboyd@kernel.org >
2020-10-13 17:43:07 -07:00
Julia Lawall
39443a27cb
clk: mvebu: ap80x-cpu: use semicolons rather than commas to separate statements
...
Replace commas with semicolons. What is done is essentially described by
the following Coccinelle semantic patch (http://coccinelle.lip6.fr/ ):
// <smpl>
@@ expression e1,e2; @@
e1
-,
+;
e2
... when any
// </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr >
Link: https://lore.kernel.org/r/1601233948-11629-10-git-send-email-Julia.Lawall@inria.fr
Signed-off-by: Stephen Boyd <sboyd@kernel.org >
2020-10-13 17:43:05 -07:00
Julia Lawall
4f8a13e1c2
clk: uniphier: use semicolons rather than commas to separate statements
...
Replace commas with semicolons. What is done is essentially described by
the following Coccinelle semantic patch (http://coccinelle.lip6.fr/ ):
// <smpl>
@@ expression e1,e2; @@
e1
-,
+;
e2
... when any
// </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr >
Link: https://lore.kernel.org/r/1601233948-11629-2-git-send-email-Julia.Lawall@inria.fr
Signed-off-by: Stephen Boyd <sboyd@kernel.org >
2020-10-13 17:43:03 -07:00
Jakub Kicinski
a003ec1f47
Merge branch 'net-add-and-use-function-dev_fetch_sw_netstats-for-fetching-pcpu_sw_netstats'
...
Heiner Kallweit says:
====================
net: add and use function dev_fetch_sw_netstats for fetching pcpu_sw_netstats
In several places the same code is used to populate rtnl_link_stats64
fields with data from pcpu_sw_netstats. Therefore factor out this code
to a new function dev_fetch_sw_netstats().
====================
Signed-off-by: Jakub Kicinski <kuba@kernel.org >
2020-10-13 17:37:37 -07:00
Heiner Kallweit
5fc3594d36
xfrm: use new function dev_fetch_sw_netstats
...
Simplify the code by using new function dev_fetch_sw_netstats().
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com >
Link: https://lore.kernel.org/r/a6b816f4-bbf2-9db0-d59a-7e4e9cc808fe@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org >
2020-10-13 17:33:49 -07:00
Heiner Kallweit
3569939a81
net: openvswitch: use new function dev_fetch_sw_netstats
...
Simplify the code by using new function dev_fetch_sw_netstats().
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com >
Link: https://lore.kernel.org/r/5e52dc91-97b1-82b0-214b-65d404e4a2ec@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org >
2020-10-13 17:33:49 -07:00
Heiner Kallweit
6401297e76
mac80211: use new function dev_fetch_sw_netstats
...
Simplify the code by using new function dev_fetch_sw_netstats().
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com >
Link: https://lore.kernel.org/r/93dda477-70ae-0ccf-71b4-bfebb66c9beb@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org >
2020-10-13 17:33:49 -07:00
Heiner Kallweit
cf89f18fa4
iptunnel: use new function dev_fetch_sw_netstats
...
Simplify the code by using new function dev_fetch_sw_netstats().
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com >
Link: https://lore.kernel.org/r/050f9a83-b195-a3d6-edbd-91a59040be21@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org >
2020-10-13 17:33:49 -07:00
Heiner Kallweit
a0d2698101
net: dsa: use new function dev_fetch_sw_netstats
...
Simplify the code by using new function dev_fetch_sw_netstats().
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com >
Tested-by: Vladimir Oltean <olteanv@gmail.com >
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com >
Link: https://lore.kernel.org/r/b6047017-8226-6b7e-a3cd-064e69fdfa27@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org >
2020-10-13 17:33:49 -07:00
Heiner Kallweit
f3f04f0f3a
net: bridge: use new function dev_fetch_sw_netstats
...
Simplify the code by using new function dev_fetch_sw_netstats().
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com >
Link: https://lore.kernel.org/r/d1c3ff29-5691-9d54-d164-16421905fa59@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org >
2020-10-13 17:33:49 -07:00
Heiner Kallweit
1f68b2096f
qtnfmac: use new function dev_fetch_sw_netstats
...
Simplify the code by using new function dev_fetch_sw_netstats().
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com >
Acked-by: Kalle Valo <kvalo@codeaurora.org >
Link: https://lore.kernel.org/r/166259f2-084c-45d7-e610-2de2a0bdae06@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org >
2020-10-13 17:33:49 -07:00
Heiner Kallweit
ab2b3ff21b
net: usbnet: use new function dev_fetch_sw_netstats
...
Simplify the code by using new function dev_fetch_sw_netstats().
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com >
Link: https://lore.kernel.org/r/70ad3e33-8ea6-e12e-31de-5fec7a3c4f6e@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org >
2020-10-13 17:33:49 -07:00
Heiner Kallweit
ec173778e9
net: usb: qmi_wwan: use new function dev_fetch_sw_netstats
...
Simplify the code by using new function dev_fetch_sw_netstats().
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com >
Acked-by: Bjørn Mork <bjorn@mork.no >
Link: https://lore.kernel.org/r/2c97b75b-107e-0ab6-d9ef-9f38bb03f495@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org >
2020-10-13 17:33:48 -07:00
Heiner Kallweit
9d0151673e
net: macsec: use new function dev_fetch_sw_netstats
...
Simplify the code by using new function dev_fetch_sw_netstats().
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com >
Link: https://lore.kernel.org/r/0d81e0f7-7784-42df-8e10-d0b77ca5b7ee@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org >
2020-10-13 17:33:48 -07:00
Heiner Kallweit
3b51788a2d
IB/hfi1: use new function dev_fetch_sw_netstats
...
Simplify the code by using new function dev_fetch_sw_netstats().
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com >
Link: https://lore.kernel.org/r/6cad1a04-f021-d94b-45fd-7cc7cf07367d@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org >
2020-10-13 17:33:48 -07:00
Heiner Kallweit
44fa32f008
net: add function dev_fetch_sw_netstats for fetching pcpu_sw_netstats
...
In several places the same code is used to populate rtnl_link_stats64
fields with data from pcpu_sw_netstats. Therefore factor out this code
to a new function dev_fetch_sw_netstats().
v2:
- constify argument netstats
- don't ignore netstats being NULL or an ERRPTR
- switch to EXPORT_SYMBOL_GPL
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com >
Link: https://lore.kernel.org/r/6d16a338-52f5-df69-0020-6bc771a7d498@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org >
2020-10-13 17:33:48 -07:00
Tonghao Zhang
3618ad2a7c
virtio-net: ethtool configurable RXCSUM
...
Allow user configuring RXCSUM separately with ethtool -K,
reusing the existing virtnet_set_guest_offloads helper
that configures RXCSUM for XDP. This is conditional on
VIRTIO_NET_F_CTRL_GUEST_OFFLOADS.
If Rx checksum is disabled, LRO should also be disabled.
Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com >
Acked-by: Michael S. Tsirkin <mst@redhat.com >
Acked-by: Jason Wang <jasowang@redhat.com >
Acked-by: Willem de Bruijn <willemb@google.com >
Link: https://lore.kernel.org/r/20201012015820.62042-1-xiangxia.m.yue@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org >
2020-10-13 17:27:05 -07:00
Rishabh Bhatnagar
526b9e0cf3
remoteproc: Add recovery configuration to the sysfs interface
...
Add recovery configuration to the sysfs interface. This will
allow usage of this configuration feature in production
devices where access to debugfs might be limited.
Signed-off-by: Rishabh Bhatnagar <rishabhb@codeaurora.org >
Link: https://lore.kernel.org/r/1601662144-5964-4-git-send-email-rishabhb@codeaurora.org
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org >
2020-10-13 19:22:51 -05:00
Rishabh Bhatnagar
f75c6043a3
remoteproc: Add coredump as part of sysfs interface
...
Add coredump as part of the sysfs interface. This will
allow usage of this configuration feature in production
devices where access to debugfs might be limited.
Signed-off-by: Rishabh Bhatnagar <rishabhb@codeaurora.org >
Link: https://lore.kernel.org/r/1601662144-5964-3-git-send-email-rishabhb@codeaurora.org
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org >
2020-10-13 19:22:04 -05:00
Or Cohen
c9bf52a173
net/af_unix: Remove unused old_pid variable
...
Commit 109f6e39fa ("af_unix: Allow SO_PEERCRED
to work across namespaces.") introduced the old_pid variable
in unix_listen, but it's never used.
Remove the declaration and the call to put_pid.
Signed-off-by: Or Cohen <orcohen@paloaltonetworks.com >
Link: https://lore.kernel.org/r/20201011153527.18628-1-orcohen@paloaltonetworks.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org >
2020-10-13 17:21:46 -07:00
Rishabh Bhatnagar
bf41a0910c
remoteproc: Change default dump configuration to "disabled"
...
Currently "default" configuration option means coredumps are
enabled. To avoid confusion rename the "default" configuration
option to "enabled" and disable collection of dumps by default
as doing so makes sense for production devices.
Signed-off-by: Rishabh Bhatnagar <rishabhb@codeaurora.org >
Link: https://lore.kernel.org/r/1601662144-5964-2-git-send-email-rishabhb@codeaurora.org
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org >
2020-10-13 19:20:54 -05:00
Christian Eggers
4e3bbb33e6
socket: don't clear SOCK_TSTAMP_NEW when SO_TIMESTAMPNS is disabled
...
SOCK_TSTAMP_NEW (timespec64 instead of timespec) is also used for
hardware time stamps (configured via SO_TIMESTAMPING_NEW).
User space (ptp4l) first configures hardware time stamping via
SO_TIMESTAMPING_NEW which sets SOCK_TSTAMP_NEW. In the next step, ptp4l
disables SO_TIMESTAMPNS(_NEW) (software time stamps), but this must not
switch hardware time stamps back to "32 bit mode".
This problem happens on 32 bit platforms were the libc has already
switched to struct timespec64 (from SO_TIMExxx_OLD to SO_TIMExxx_NEW
socket options). ptp4l complains with "missing timestamp on transmitted
peer delay request" because the wrong format is received (and
discarded).
Fixes: 887feae36a ("socket: Add SO_TIMESTAMP[NS]_NEW")
Fixes: 783da70e83 ("net: add sock_enable_timestamps")
Signed-off-by: Christian Eggers <ceggers@arri.de >
Acked-by: Willem de Bruijn <willemb@google.com >
Acked-by: Deepa Dinamani <deepa.kernel@gmail.com >
Signed-off-by: Jakub Kicinski <kuba@kernel.org >
2020-10-13 17:18:18 -07:00
Christian Eggers
59e611a566
socket: fix option SO_TIMESTAMPING_NEW
...
The comparison of optname with SO_TIMESTAMPING_NEW is wrong way around,
so SOCK_TSTAMP_NEW will first be set and than reset again. Additionally
move it out of the test for SOF_TIMESTAMPING_RX_SOFTWARE as this seems
unrelated.
This problem happens on 32 bit platforms were the libc has already
switched to struct timespec64 (from SO_TIMExxx_OLD to SO_TIMExxx_NEW
socket options). ptp4l complains with "missing timestamp on transmitted
peer delay request" because the wrong format is received (and
discarded).
Fixes: 9718475e69 ("socket: Add SO_TIMESTAMPING_NEW")
Signed-off-by: Christian Eggers <ceggers@arri.de >
Reviewed-by: Willem de Bruijn <willemdebruijn.kernel@gmail.com >
Reviewed-by: Deepa Dinamani <deepa.kernel@gmail.com >
Acked-by: Willem de Bruijn <willemb@google.com >
Acked-by: Deepa Dinamani <deepa.kernel@gmail.com >
Signed-off-by: Jakub Kicinski <kuba@kernel.org >
2020-10-13 17:18:18 -07:00
Julia Lawall
0403a2b53c
net/tls: use semicolons rather than commas to separate statements
...
Replace commas with semicolons. Commas introduce unnecessary
variability in the code structure and are hard to see. What is done
is essentially described by the following Coccinelle semantic patch
(http://coccinelle.lip6.fr/ ):
// <smpl>
@@ expression e1,e2; @@
e1
-,
+;
e2
... when any
// </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr >
Link: https://lore.kernel.org/r/1602412498-32025-6-git-send-email-Julia.Lawall@inria.fr
Signed-off-by: Jakub Kicinski <kuba@kernel.org >
2020-10-13 17:11:52 -07:00
Julia Lawall
6159e9633f
net/ipv6: use semicolons rather than commas to separate statements
...
Replace commas with semicolons. Commas introduce unnecessary
variability in the code structure and are hard to see. What is done
is essentially described by the following Coccinelle semantic patch
(http://coccinelle.lip6.fr/ ):
// <smpl>
@@ expression e1,e2; @@
e1
-,
+;
e2
... when any
// </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr >
Acked-by: Paul Moore <paul@paul-moore.com >
Link: https://lore.kernel.org/r/1602412498-32025-5-git-send-email-Julia.Lawall@inria.fr
Signed-off-by: Jakub Kicinski <kuba@kernel.org >
2020-10-13 17:11:52 -07:00
Julia Lawall
44797589c2
tcp: use semicolons rather than commas to separate statements
...
Replace commas with semicolons. Commas introduce unnecessary
variability in the code structure and are hard to see. What is done
is essentially described by the following Coccinelle semantic patch
(http://coccinelle.lip6.fr/ ):
// <smpl>
@@ expression e1,e2; @@
e1
-,
+;
e2
... when any
// </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr >
Link: https://lore.kernel.org/r/1602412498-32025-4-git-send-email-Julia.Lawall@inria.fr
Signed-off-by: Jakub Kicinski <kuba@kernel.org >
2020-10-13 17:11:52 -07:00
Vladimir Oltean
7e38b03f0f
net: mscc: ocelot: remove duplicate ocelot_port_dev_check
...
A helper for checking whether a net_device belongs to mscc_ocelot
already existed and did not need to be rewritten. Use it.
Fixes: 319e4dd11a ("net: mscc: ocelot: introduce conversion helpers between port and netdev")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com >
Link: https://lore.kernel.org/r/20201011092041.3535101-1-vladimir.oltean@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org >
2020-10-13 17:04:43 -07:00
Jakub Kicinski
c93c5482c7
Merge branch 'macb-support-the-2-deep-Tx-queue-on-at91'
...
Willy Tarreau says:
====================
macb: support the 2-deep Tx queue on at91
while running some tests on my Breadbee board, I noticed poor network
Tx performance. I had a look at the driver (macb, at91ether variant)
and noticed that at91ether_start_xmit() immediately stops the queue
after sending a frame and waits for the interrupt to restart the queue,
causing a dead time after each packet is sent.
The AT91RM9200 datasheet states that the controller supports two frames,
one being sent and the other one being queued, so I performed minimal
changes to support this. The transmit performance on my board has
increased by 50% on medium-sized packets (HTTP traffic), and with large
packets I can now reach line rate.
Since this driver is shared by various platforms, I tried my best to
isolate and limit the changes as much as possible and I think it's pretty
reasonable as-is. I've run extensive tests and couldn't meet any
unexpected situation (no stall, overflow nor lockup).
There are 3 patches in this series. The first one adds the missing
interrupt flag for RM9200 (TBRE, indicating the tx buffer is willing
to take a new packet). The second one replaces the single skb with a
2-array and uses only index 0. It does no other change, this is just
to prepare the code for the third one. The third one implements the
queue. Packets are added at the tail of the queue, the queue is
stopped at 2 packets and the interrupt releases 0, 1 or 2 depending
on what the transmit status register reports.
====================
Signed-off-by: Jakub Kicinski <kuba@kernel.org >
2020-10-13 16:57:18 -07:00
Willy Tarreau
0a4e9ce17b
macb: support the two tx descriptors on at91rm9200
...
The at91rm9200 variant used by a few chips including the MSC313 supports
two Tx descriptors (one frame being serialized and another one queued).
However the driver only implemented a single one, which adds a dead time
after each transfer to receive and process the interrupt and wake the
queue up, preventing from reaching line rate.
This patch implements a very basic 2-deep queue to address this limitation.
The tests run on a Breadbee board equipped with an MSC313E show that at
1 GHz, HTTP traffic on medium-sized objects (45kB) was limited to exactly
50 Mbps before this patch, and jumped to 76 Mbps with this patch. And tests
on a single TCP stream with an MTU of 576 jump from 10kpps to 15kpps. With
1500 byte packets it's now possible to reach line rate versus 75 Mbps
before.
Cc: Nicolas Ferre <nicolas.ferre@microchip.com >
Cc: Claudiu Beznea <claudiu.beznea@microchip.com >
Cc: Daniel Palmer <daniel@0x0f.com >
Signed-off-by: Willy Tarreau <w@1wt.eu >
Link: https://lore.kernel.org/r/20201011090944.10607-4-w@1wt.eu
Signed-off-by: Jakub Kicinski <kuba@kernel.org >
2020-10-13 16:57:12 -07:00
Willy Tarreau
73d7422813
macb: prepare at91 to use a 2-frame TX queue
...
The RM9200 supports one frame being sent while another one is waiting in
queue. This avoids the dead time that follows the emission of a frame
and which prevents one from reaching line speed.
Right now the driver supports only a single skb, so we'll first replace
the rm9200-specific skb info with an array of two macb_tx_skb (already
used by other drivers). This patch only moves the skb_length to
txq[0].size and skb_physaddr to skb[0].mapping but doesn't perform any
other change. It already uses [desc] in order to minimize future changes.
Cc: Nicolas Ferre <nicolas.ferre@microchip.com >
Cc: Claudiu Beznea <claudiu.beznea@microchip.com >
Cc: Daniel Palmer <daniel@0x0f.com >
Signed-off-by: Willy Tarreau <w@1wt.eu >
Link: https://lore.kernel.org/r/20201011090944.10607-3-w@1wt.eu
Signed-off-by: Jakub Kicinski <kuba@kernel.org >
2020-10-13 16:57:12 -07:00
Willy Tarreau
fa6031df12
macb: add RM9200's interrupt flag TBRE
...
Transmit Buffer Register Empty replaces TXERR on RM9200 and signals the
sender may try to send again becase the last queued frame is no longer
in queue (being transmitted or already transmitted).
Cc: Nicolas Ferre <nicolas.ferre@microchip.com >
Cc: Claudiu Beznea <claudiu.beznea@microchip.com >
Cc: Daniel Palmer <daniel@0x0f.com >
Signed-off-by: Willy Tarreau <w@1wt.eu >
Link: https://lore.kernel.org/r/20201011090944.10607-2-w@1wt.eu
Signed-off-by: Jakub Kicinski <kuba@kernel.org >
2020-10-13 16:57:12 -07:00
Linus Torvalds
b5fc7a89e5
Merge tag 'overflow-v5.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux
...
Pull overflow update from Kees Cook:
"Just a single change to help enforce all callers are actually checking
the results of the helpers"
* tag 'overflow-v5.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
overflow: Add __must_check attribute to check_*() helpers
2020-10-13 16:37:39 -07:00