020-libxdp-Use-__noinline__-reserved-attribute-for-XDP-d.patch 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. From 1f160c287c14b4300c4248752e20da5981c9763e Mon Sep 17 00:00:00 2001
  2. From: Christian Marangi <[email protected]>
  3. Date: Wed, 18 Jan 2023 19:00:54 +0100
  4. Subject: [PATCH] libxdp: Use __noinline__ reserved attribute for XDP
  5. dispatcher
  6. The use of noinline is wrong as noline is not a reserved attribute and
  7. with gcc12 this became an error. Use the reserved __noinline__ attribute
  8. to fix compilation error.
  9. Signed-off-by: Christian Marangi <[email protected]>
  10. [a.heider: adapt lib/libxdp/protocol.org too]
  11. Signed-off-by: Andre Heider <[email protected]>
  12. ---
  13. lib/libxdp/protocol.org | 2 +-
  14. lib/libxdp/xdp-dispatcher.c.in | 4 ++--
  15. 2 files changed, 3 insertions(+), 3 deletions(-)
  16. --- a/lib/libxdp/protocol.org
  17. +++ b/lib/libxdp/protocol.org
  18. @@ -59,7 +59,7 @@ static volatile const struct xdp_dispatc
  19. /* The volatile return value prevents the compiler from assuming it knows the
  20. * return value and optimising based on that.
  21. */
  22. -__attribute__ ((noinline))
  23. +__attribute__ ((__noinline__))
  24. int prog0(struct xdp_md *ctx) {
  25. volatile int ret = XDP_DISPATCHER_RETVAL;
  26. --- a/lib/libxdp/xdp-dispatcher.c.in
  27. +++ b/lib/libxdp/xdp-dispatcher.c.in
  28. @@ -29,7 +29,7 @@ static volatile const struct xdp_dispatc
  29. * return value and optimising based on that.
  30. */
  31. forloop(`i', `0', NUM_PROGS,
  32. -`__attribute__ ((noinline))
  33. +`__attribute__ ((__noinline__))
  34. int format(`prog%d', i)(struct xdp_md *ctx) {
  35. volatile int ret = XDP_DISPATCHER_RETVAL;
  36. @@ -39,7 +39,7 @@ int format(`prog%d', i)(struct xdp_md *c
  37. }
  38. ')
  39. -__attribute__ ((noinline))
  40. +__attribute__ ((__noinline__))
  41. int compat_test(struct xdp_md *ctx) {
  42. volatile int ret = XDP_DISPATCHER_RETVAL;