Hello,
Good afternoon and how are you?
I have an important and favourable information/proposal which might
interest you to know,
let me hear from you to detail you, it's important
Sincerely,
M.Cheickna
tourecheickna(a)consultant.com
Syzbot recently caught a splat when dropping features from
openvswitch datapaths that are in-use. The WARN() call is
definitely too large a hammer for the situation, so change
to pr_warn.
Second patch in the series introduces a new selftest suite which
can help show that an issue is fixed. This change might be
more suited to net-next tree, so it has been separated out
as an additional patch and can be either applied to either tree
based on preference.
Aaron Conole (2):
openvswitch: switch from WARN to pr_warn
selftests: add openvswitch selftest suite
MAINTAINERS | 1 +
net/openvswitch/datapath.c | 3 +-
tools/testing/selftests/Makefile | 1 +
.../selftests/net/openvswitch/Makefile | 13 +
.../selftests/net/openvswitch/openvswitch.sh | 218 +++++++++++
.../selftests/net/openvswitch/ovs-dpctl.py | 351 ++++++++++++++++++
6 files changed, 586 insertions(+), 1 deletion(-)
create mode 100644 tools/testing/selftests/net/openvswitch/Makefile
create mode 100755 tools/testing/selftests/net/openvswitch/openvswitch.sh
create mode 100644 tools/testing/selftests/net/openvswitch/ovs-dpctl.py
--
2.34.3
Currently, in order to compare memory blocks in KUnit, the KUNIT_EXPECT_EQ or
KUNIT_EXPECT_FALSE macros are used in conjunction with the memcmp function,
such as:
KUNIT_EXPECT_EQ(test, memcmp(foo, bar, size), 0);
Although this usage produces correct results for the test cases, if the
expectation fails the error message is not very helpful, indicating only the
return of the memcmp function.
Therefore, create a new set of macros KUNIT_EXPECT_MEMEQ and
KUNIT_EXPECT_MEMNEQ that compare memory blocks until a determined size. In
case of expectation failure, those macros print the hex dump of the memory
blocks, making it easier to debug test failures for memory blocks.
The v7 has some formatting changes on the first patch and it was rebased on
top of the mainline (due to 7089003304c6).
The first patch of the series introduces the KUNIT_EXPECT_MEMEQ and
KUNIT_EXPECT_MEMNEQ. The second patch adds an example of memory block
expectations on the kunit-example-test.c. And the last patch replaces the
KUNIT_EXPECT_EQ for KUNIT_EXPECT_MEMEQ on the existing occurrences.
Best Regards,
- Maíra Canal
v1 -> v2: https://lore.kernel.org/linux-kselftest/2a0dcd75-5461-5266-2749-808f638f4c5…
- Change "determinated" to "specified" (Daniel Latypov).
- Change the macro KUNIT_EXPECT_ARREQ to KUNIT_EXPECT_MEMEQ, in order to make
it easier for users to infer the right size unit (Daniel Latypov).
- Mark the different bytes on the failure message with a <> (Daniel Latypov).
- Replace a constant number of array elements for ARRAY_SIZE() (André Almeida).
- Rename "array" and "expected" variables to "array1" and "array2" (Daniel Latypov).
v2 -> v3: https://lore.kernel.org/linux-kselftest/20220802212621.420840-1-mairacanal@…
- Make the bytes aligned at output.
- Add KUNIT_SUBSUBTEST_INDENT to the output for the indentation (Daniel Latypov).
- Line up the trailing \ at macros using tabs (Daniel Latypov).
- Line up the params to the functions (Daniel Latypov).
- Change "Increament" to "Augment" (Daniel Latypov).
- Use sizeof() for array sizes (Daniel Latypov).
- Add Daniel Latypov's tags.
v3 -> v4: https://lore.kernel.org/linux-kselftest/CABVgOSm_59Yr82deQm2C=18jjSv_akmn66…
- Fix wrapped lines by the mail client (David Gow).
- Mention on documentation that KUNIT_EXPECT_MEMEQ is not recommended for
structured data (David Gow).
- Add Muhammad Usama Anjum's tag.
v4 -> v5: https://lore.kernel.org/linux-kselftest/20220808125237.277126-1-mairacanal@…
- Rebase on top of drm-misc-next.
- Add David Gow's tags.
v5 -> v6: https://lore.kernel.org/linux-kselftest/20220921014515.113062-1-mairacanal@…
- Rebase on top of Linux 6.1.
- Change KUNIT_ASSERTION macro to _KUNIT_FAILED.
v6 -> v7: https://lore.kernel.org/linux-kselftest/20221018190541.189780-1-mairacanal@…
- Format nits (David Gow).
- Rebase on top of Linux 6.1-rc2.
Maíra Canal (3):
kunit: Introduce KUNIT_EXPECT_MEMEQ and KUNIT_EXPECT_MEMNEQ macros
kunit: Add KUnit memory block assertions to the example_all_expect_macros_test
kunit: Use KUNIT_EXPECT_MEMEQ macro
.../gpu/drm/tests/drm_format_helper_test.c | 12 +--
include/kunit/assert.h | 33 +++++++
include/kunit/test.h | 87 +++++++++++++++++++
lib/kunit/assert.c | 56 ++++++++++++
lib/kunit/kunit-example-test.c | 7 ++
net/core/dev_addr_lists_test.c | 4 +-
6 files changed, 191 insertions(+), 8 deletions(-)
--
2.37.3
hugepage-vmemmap test fails for s390 because it assumes a hugepagesize
of 2 MB, while we have 1 MB on s390. This results in iterating over two
hugepages. If they are consecutive in memory, check_page_flags() will
stumble over the additional head page. Otherwise, it will stumble over
non-huge pageflags, after crossing the first 1 MB hugepage.
Fix this by using 1 MB MAP_LENGTH for s390.
Signed-off-by: Gerald Schaefer <gerald.schaefer(a)linux.ibm.com>
---
tools/testing/selftests/vm/hugepage-vmemmap.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/tools/testing/selftests/vm/hugepage-vmemmap.c b/tools/testing/selftests/vm/hugepage-vmemmap.c
index 557bdbd4f87e..a4695f138cec 100644
--- a/tools/testing/selftests/vm/hugepage-vmemmap.c
+++ b/tools/testing/selftests/vm/hugepage-vmemmap.c
@@ -11,7 +11,14 @@
#include <sys/mman.h>
#include <fcntl.h>
+/*
+ * 1 MB hugepage size for s390
+ */
+#if defined(__s390x__)
+#define MAP_LENGTH (1UL * 1024 * 1024)
+#else
#define MAP_LENGTH (2UL * 1024 * 1024)
+#endif
#ifndef MAP_HUGETLB
#define MAP_HUGETLB 0x40000 /* arch specific */
--
2.34.1