Skip to content

ethtool: clean up and fix

Jesse Brandeburg netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest13 patches 18 repliesIn review

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/13ethtool: convert boilerplate licenses to SPDXjson_print.c json_print.h qsfp.c +10 more+13 -591 reply
2/13ethtool: fix trivial issue in allocationrxclass.c+1 -11 reply
3/13ethtool: disallow passing null to find_optionethtool.c+1 -11 reply
4/13ethtool: commonize power related stringscmis.c qsfp.c sff-common.h +1 more+14 -231 reply
5/13ethtool: fix extra warningsnetlink/permaddr.c+1 -11 reply
6/13ethtool: fix uninitialized local variable usenetlink/parser.c+2 -31 reply
7/13ethtool: avoid null pointer dereferencenetlink/parser.c+2 -23 replies
8/13ethtool: fix runtime errors found by sanitizersamd8111e.c internal.h netlink/features.c+5 -54 replies
9/13ethtool: merge uapi changes to implement BIT and friendsfsl_enetc.c uapi/linux/ethtool.h uapi/linux/ethtool_netlink.h+70 -502 replies
10/13ethtool: refactor bit shifts to use BIT and BIT_ULLamd8111e.c de2104x.c ethtool.c +15 more+822 -8220 replies
11/13ethtool: fix missing free of memory after failuretest-common.c+6 -31 reply
12/13ethtool: fix leak of memory after reallocnetlink/msgbuff.c+18 -211 reply
13/13ethtool: fix bug and use standard string parsingethtool.c+11 -71 reply

Reviews trailers per patch

4 of 13 patches have a Reviewed-by or Acked-by.

PatchAndrew LunnMichal Kubecek
1/13A-b
2/13
3/13
4/13A-b
5/13
6/13R-b
7/13
8/13
9/13
10/13
11/13A-b
12/13
13/13

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH ethtool v2 00/13] ethtool: clean up and fix

This series is an update to the ethtool application code, and was triggered by running some static analysis tools and doing some general refactor on the ethtool code to make it clearer.

The tools run were:

$ scan-build make
$ cppcheck
$ make CFLAGS+='-fsanitize=address,undefined' LDFLAGS+='-lubsan -lasan'

The big change in this series is a refactor of all the various bit shifts from (1 << foo) to BIT(foo). The goal was to make the code more readable and maintainable, while fixing a few small bugs and hopefully preventing more in the future from people forgetting to add 1UL to a 1 being used in a bitshift.

It includes a uapi sync/update to match a patch that was sent to the kernel separately in the following link:

v2: first external version, updated commit message for 7/13
v1: internal version

Jesse Brandeburg (13):
ethtool: convert boilerplate licenses to SPDX
ethtool: fix trivial issue in allocation
ethtool: disallow passing null to find_option
ethtool: commonize power related strings
ethtool: fix extra warnings
ethtool: fix uninitialized local variable use
ethtool: avoid null pointer dereference
ethtool: fix runtime errors found by sanitizers
ethtool: merge uapi changes to implement BIT and friends
ethtool: refactor bit shifts to use BIT and BIT_ULL
ethtool: fix missing free of memory after failure
ethtool: fix leak of memory after realloc
ethtool: fix bug and use standard string parsing

 amd8111e.c                   | 198 ++++++++---------
 cmis.c                       |  10 +-
 de2104x.c                    | 410 +++++++++++++++++------------------
 ethtool.c                    |  38 ++--
 fsl_enetc.c                  |   2 -
 internal.h                   |  26 +--
 json_print.c                 |   6 +-
 json_print.h                 |   6 +-
 natsemi.c                    | 358 +++++++++++++++---------------
 netlink/bitset.c             |   6 +-
 netlink/features.c           |   4 +-
 netlink/monitor.c            |   4 +-
 netlink/msgbuff.c            |  39 ++--
 netlink/parser.c             |  13 +-
 netlink/permaddr.c           |   2 +-
 netlink/settings.c           |  10 +-
 netlink/stats.c              |   2 +-
 qsfp.c                       |  21 +-
 qsfp.h                       | 353 +++++++++++++++---------------
 realtek.c                    |  48 ++--
 rxclass.c                    |   4 +-
 sfc.c                        |   7 +-
 sff-common.c                 |   6 +-
 sff-common.h                 |   9 +-
 sfpdiag.c                    |  67 +++---
 sfpid.c                      | 151 +++++++------
 stmmac.c                     |   5 +-
 test-cmdline.c               |   5 +-
 test-common.c                |  14 +-
 test-features.c              |   5 +-
 tse.c                        |   7 +-
 uapi/linux/ethtool.h         | 112 ++++++----
 uapi/linux/ethtool_netlink.h |   6 +-
 33 files changed, 961 insertions(+), 993 deletions(-)

base-commit: 3acf7eee7ade666289f98311befe334bb57d3765

Signature · 1 line
2.31.1