Skip to content

Commit d6faebe

Browse files
committed
Merge: CNB96: netdevsim: update netdevsim to the v6.12
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/5367 JIRA: https://issues.redhat.com/browse/RHEL-57764 Tested: Verified using existing and newly introduced self-tests Commits: ``` e2ece0b ("tools/net/ynl: Add --output-json arg to ynl cli") 771b701 ("tools/net/ynl: Report netlink errors without stacktrace") 2a0683b ("selftests: Introduce Makefile variable to list shared bash scripts") 39369c9 ("selftests: netdevsim: add a config file") afbf75e ("selftests: netdevsim: set test timeout to 10 minutes") b86761f ("selftests: net: add scaffolding for Netlink tests in Python") 796c8c7 ("selftests: nl_netdev: add a trivial Netlink netdev test") f216306 ("netdevsim: report stats by default, like a real device") b4db9f8 ("selftests: drivers: add scaffolding for Netlink tests in Python") f0e6c86 ("testing: net-drv: add a driver test for stats reporting") 6ce2b68 ("selftests: net: reuse common code in bpf_offload") 1580cbc ("net: netdevsim: add some fake page pool use") 72ba6cb ("tools: ynl: don't return None for dumps") eeb409b ("selftests: net: print report check location in python tests") 99583b9 ("selftests: net: print full exception on failure") 8554d6e ("selftests: net: support use of NetdevSimDev under "with" in python") 05fa5c3 ("selftests: net: exercise page pool reporting via netlink") 94e2a19 ("net: netdevsim: select PAGE_POOL in Kconfig") 655614e ("selftests: net: fix counting totals when some checks fail") 4fa6bd4 ("selftests: net: set the exit code correctly in Python tests") 1a20a9a ("selftests: drv-net: define endpoint structures") 5433892 ("selftests: drv-net: factor out parsing of the env") 1880f27 ("selftests: drv-net: construct environment for running tests which require an endpoint") a48a87c ("selftests: drv-net: add a trivial ping test") 01b4316 ("selftests: net: support matching cases by name prefix") 31611ce ("selftests: drv-net: add a TCP ping test case (and useful helpers)") f1e68a1 ("selftests: drv-net: add require_XYZ() helpers for validating env") e1bb5e6 ("selftests: net: py: check process exit code in bkg() and background cmd()") 3762ec0 ("netdevsim: add NAPI support") 1cf2704 ("net: selftest: add test for netdev netlink queue-get API") a61a459 ("testing: net-drv: use stats64 for testing") 5add2f7 ("netdevsim: fix backwards compatibility in nsim_get_iflink()") ``` Signed-off-by: Ivan Vecera <ivecera@redhat.com> Approved-by: Herton R. Krzesinski <herton@redhat.com> Approved-by: Petr Oros <poros@redhat.com> Approved-by: Hangbin Liu <haliu@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: Rado Vrbovsky <rvrbovsk@redhat.com>
2 parents f177edd + efdf578 commit d6faebe

File tree

34 files changed

+1609
-111
lines changed

34 files changed

+1609
-111
lines changed

Documentation/dev-tools/kselftest.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,9 +239,21 @@ Contributing new tests (details)
239239

240240
TEST_PROGS_EXTENDED, TEST_GEN_PROGS_EXTENDED mean it is the
241241
executable which is not tested by default.
242+
242243
TEST_FILES, TEST_GEN_FILES mean it is the file which is used by
243244
test.
244245

246+
TEST_INCLUDES is similar to TEST_FILES, it lists files which should be
247+
included when exporting or installing the tests, with the following
248+
differences:
249+
250+
* symlinks to files in other directories are preserved
251+
* the part of paths below tools/testing/selftests/ is preserved when
252+
copying the files to the output directory
253+
254+
TEST_INCLUDES is meant to list dependencies located in other directories of
255+
the selftests hierarchy.
256+
245257
* First use the headers inside the kernel source and/or git repo, and then the
246258
system headers. Headers for the kernel release as opposed to headers
247259
installed by the distro on the system should be the primary focus to be able

drivers/net/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,7 @@ config NETDEVSIM
580580
depends on PSAMPLE || PSAMPLE=n
581581
depends on PTP_1588_CLOCK_MOCK || PTP_1588_CLOCK_MOCK=n
582582
select NET_DEVLINK
583+
select PAGE_POOL
583584
help
584585
This driver is a developer testing tool and software model that can
585586
be used to test various control path networking APIs, especially

drivers/net/netdevsim/ethtool.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,13 @@ nsim_set_fecparam(struct net_device *dev, struct ethtool_fecparam *fecparam)
140140
return 0;
141141
}
142142

143+
static void
144+
nsim_get_fec_stats(struct net_device *dev, struct ethtool_fec_stats *fec_stats)
145+
{
146+
fec_stats->corrected_blocks.total = 123;
147+
fec_stats->uncorrectable_blocks.total = 4;
148+
}
149+
143150
static int nsim_get_ts_info(struct net_device *dev,
144151
struct kernel_ethtool_ts_info *info)
145152
{
@@ -163,6 +170,7 @@ static const struct ethtool_ops nsim_ethtool_ops = {
163170
.set_channels = nsim_set_channels,
164171
.get_fecparam = nsim_get_fecparam,
165172
.set_fecparam = nsim_set_fecparam,
173+
.get_fec_stats = nsim_get_fec_stats,
166174
.get_ts_info = nsim_get_ts_info,
167175
};
168176

@@ -182,6 +190,9 @@ void nsim_ethtool_init(struct netdevsim *ns)
182190

183191
nsim_ethtool_ring_init(ns);
184192

193+
ns->ethtool.pauseparam.report_stats_rx = true;
194+
ns->ethtool.pauseparam.report_stats_tx = true;
195+
185196
ns->ethtool.fec.fec = ETHTOOL_FEC_NONE;
186197
ns->ethtool.fec.active_fec = ETHTOOL_FEC_NONE;
187198

0 commit comments

Comments
 (0)