On Fri, 7 Apr 2023 at 08:48, Wei Yongjun <weiyongjun@xxxxxxxxxxxxxxx> wrote: > > From: Wei Yongjun <weiyongjun1@xxxxxxxxxx> > > After commit d6e6286a12e7 ("libbpf: disassociate section handler on explicit > bpf_program__set_type() call"), bpf_program__set_type() will force cleanup > the program's SEC() definition, this commit fixed the test helper but missed > the bpftool, which leads to bpftool prog autoattach broken as follows: > > $ bpftool prog load spi-xfer-r1v1.o /sys/fs/bpf/test autoattach > Program spi_xfer_r1v1 does not support autoattach, falling back to pinning > > This patch fix bpftool to set program type only if it differs. > > Fixes: d6e6286a12e7 ("libbpf: disassociate section handler on explicit bpf_program__set_type() call") > Signed-off-by: Wei Yongjun <weiyongjun1@xxxxxxxxxx> I'm late, but for the record: Acked-by: Quentin Monnet <quentin@xxxxxxxxxxxxx> Thank you!