<div dir="auto">dpdk already does too much inling. need multiple performance benchmark before accepting </div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Sun, Nov 1, 2026, 09:04 Sun Yuechi <<a href="mailto:sunyuechi@iscas.ac.cn">sunyuechi@iscas.ac.cn</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Add __rte_flatten, which inlines every call a function makes into it,<br>
where the callee's body is available.<br>
<br>
__rte_always_inline marks the callee and inlines it at every call site.<br>
Here the requirement is local to one caller, and the callees are shared<br>
with paths that do not want inlining. Flatten applies at the boundary<br>
that needs it.<br>
<br>
A spill slot has a fixed offset on a fixed-width vector ISA. With RVV<br>
its size depends on VLEN and is known only at run time, and once the<br>
frame holds such a slot the rest of it is addressed through vlenb.<br>
Inlining such calls is then worth the code growth.<br>
<br>
Signed-off-by: Sun Yuechi <<a href="mailto:sunyuechi@iscas.ac.cn" target="_blank" rel="noreferrer">sunyuechi@iscas.ac.cn</a>><br>
---<br>
 lib/eal/include/rte_common.h | 13 +++++++++++++<br>
 1 file changed, 13 insertions(+)<br>
<br>
diff --git a/lib/eal/include/rte_common.h b/lib/eal/include/rte_common.h<br>
index fed373f412..e32b6b13d6 100644<br>
--- a/lib/eal/include/rte_common.h<br>
+++ b/lib/eal/include/rte_common.h<br>
@@ -547,6 +547,19 @@ static void __attribute__((destructor(RTE_PRIO(prio)), used)) func(void)<br>
 #define __rte_noinline __attribute__((noinline))<br>
 #endif<br>
<br>
+/**<br>
+ * Inline every call made by a function into it, where the callee's body<br>
+ * is available, whatever the callee's own inline annotation.<br>
+ *<br>
+ * Useful where a call inside a hot loop is costly in itself,<br>
+ * for example where values are held in registers that no call preserves.<br>
+ */<br>
+#ifdef RTE_TOOLCHAIN_MSVC<br>
+#define __rte_flatten<br>
+#else<br>
+#define __rte_flatten __attribute__((flatten))<br>
+#endif<br>
+<br>
 /**<br>
  * Hint function in the hot path<br>
  *<br>
-- <br>
2.56.0<br>
<br>
</blockquote></div>