[PATCH] ebpf: fix swapped toeplitz/indirection args in set_data trace

yujun posted 1 patch 3 weeks, 6 days ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260629090116.266561-1-yujun@kylinos.cn
Maintainers: Jason Wang <jasowangio@gmail.com>, Yuri Benditovich <ybendito@redhat.com>
ebpf/ebpf_rss.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] ebpf: fix swapped toeplitz/indirection args in set_data trace
Posted by yujun 3 weeks, 6 days ago
trace_ebpf_rss_set_data() passes its third and fourth arguments to
the toeplitz-ptr and indirection-ptr fields defined in trace-events.
ebpf_rss_set_all() passed indirections_table and toeplitz_key in the
opposite order, so tracing mislabeled the two pointers.

Match the argument order already used by trace_ebpf_rss_mmap().

Fixes: f5cae19d10 ("ebpf: improve trace event coverage to all key operations")
Signed-off-by: yujun <yujun@kylinos.cn>
---
 ebpf/ebpf_rss.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ebpf/ebpf_rss.c b/ebpf/ebpf_rss.c
index 926392b3c5..6650d0daef 100644
--- a/ebpf/ebpf_rss.c
+++ b/ebpf/ebpf_rss.c
@@ -270,7 +270,7 @@ bool ebpf_rss_set_all(struct EBPFRSSContext *ctx, struct EBPFRSSConfig *config,
 
     ebpf_rss_set_toepliz_key(ctx, toeplitz_key);
 
-    trace_ebpf_rss_set_data(ctx, config, indirections_table, toeplitz_key);
+    trace_ebpf_rss_set_data(ctx, config, toeplitz_key, indirections_table);
 
     return true;
 }
-- 
2.25.1
Re: [PATCH] ebpf: fix swapped toeplitz/indirection args in set_data trace
Posted by Philippe Mathieu-Daudé 2 weeks, 5 days ago
On 29/6/26 11:01, yujun wrote:
> trace_ebpf_rss_set_data() passes its third and fourth arguments to
> the toeplitz-ptr and indirection-ptr fields defined in trace-events.
> ebpf_rss_set_all() passed indirections_table and toeplitz_key in the
> opposite order, so tracing mislabeled the two pointers.
> 
> Match the argument order already used by trace_ebpf_rss_mmap().
> 
> Fixes: f5cae19d10 ("ebpf: improve trace event coverage to all key operations")
> Signed-off-by: yujun <yujun@kylinos.cn>
> ---
>   ebpf/ebpf_rss.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>