public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH] tcindex01: fix compilation errors due to missing TCA_TCINDEX_ constants
@ 2024-01-16  3:17 Li Wang
  2024-01-16 12:12 ` Petr Vorel
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Li Wang @ 2024-01-16  3:17 UTC (permalink / raw)
  To: ltp; +Cc: jhs

The change addresses compilation errors encountered in the tcindex01.c
test when compiled against kernel-6.7 and above.

  tcindex01.c:67:4: error: ‘TCA_TCINDEX_MASK’ undeclared here (not in a function);
     did you mean ‘TCA_CODEL_MAX’?
     {TCA_TCINDEX_MASK, &mask, sizeof(mask), NULL},
      ^~~~~~~~~~~~~~~~
      TCA_CODEL_MAX
  tcindex01.c:68:4: error: ‘TCA_TCINDEX_SHIFT’ undeclared here (not in a function);
     did you mean ‘TCA_FLOW_RSHIFT’?
     {TCA_TCINDEX_SHIFT, &shift, sizeof(shift), NULL},
      ^~~~~~~~~~~~~~~~~
      TCA_FLOW_RSHIFT
  CC testcases/cve/cve-2016-7117
  CC utils/sctp/func_tests/test_getname_v6.o
  tcindex01.c:69:4: error: ‘TCA_TCINDEX_CLASSID’ undeclared here (not in a function);
     did you mean ‘TCA_FLOWER_CLASSID’?
     {TCA_TCINDEX_CLASSID, &clsid, sizeof(clsid), NULL},
      ^~~~~~~~~~~~~~~~~~~
      TCA_FLOWER_CLASSID

The errors were due to the removal of certain TCA_TCINDEX_ constants
from the kernel's user API (uapi), as indicated by the kernel commit.

  commit 82b2545ed9a (net/sched: Remove uapi support for tcindex classifier)

The reason why I didn't add this into LTP library is that the defines
have been dropped we just need to satisfy this one case.
---

Notes:
    We need to merge this patch before the new release.

 testcases/cve/tcindex01.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/testcases/cve/tcindex01.c b/testcases/cve/tcindex01.c
index b4f2bb01a..70e5639f1 100644
--- a/testcases/cve/tcindex01.c
+++ b/testcases/cve/tcindex01.c
@@ -32,6 +32,23 @@
 
 #define DEVNAME "ltp_dummy1"
 
+#ifndef TCA_TCINDEX_MAX
+enum {
+       TCA_TCINDEX_UNSPEC,
+       TCA_TCINDEX_HASH,
+       TCA_TCINDEX_MASK,
+       TCA_TCINDEX_SHIFT,
+       TCA_TCINDEX_FALL_THROUGH,
+       TCA_TCINDEX_CLASSID,
+       TCA_TCINDEX_POLICE,
+       TCA_TCINDEX_ACT,
+       __TCA_TCINDEX_MAX
+};
+
+#define TCA_TCINDEX_MAX     (__TCA_TCINDEX_MAX - 1)
+#endif
+
+
 static const uint32_t qd_handle = TC_H_MAKE(1 << 16, 0);
 static const uint32_t clsid = TC_H_MAKE(1 << 16, 1);
 static const uint32_t shift = 10;
-- 
2.40.1


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-01-21 17:24 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-16  3:17 [LTP] [PATCH] tcindex01: fix compilation errors due to missing TCA_TCINDEX_ constants Li Wang
2024-01-16 12:12 ` Petr Vorel
2024-01-17  1:42   ` Li Wang
2024-01-17  9:08     ` Petr Vorel
2024-01-16 12:38 ` Martin Doucha
2024-01-16 16:10   ` Petr Vorel
2024-01-17 15:52 ` Jamal Hadi Salim
2024-01-18  0:48   ` Li Wang
2024-01-21 17:24     ` Jamal Hadi Salim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox