Bug#1023555: fastnetmon: FTBFS with libbpf 1.0

2022-11-09 Thread Patrick Matthäi


Am 08.11.2022 um 17:55 schrieb Pavel Odintsov:

Hello!

Added copy to all.

I think I fixed it with these commits: 
https://github.com/pavel-odintsov/fastnetmon/commit/c48497a6f109fc1a9f5da596b055c3b7cffb96d4 
and 
https://github.com/pavel-odintsov/fastnetmon/commit/c718e88d0b25dcfbd724e9820f592fd5782eca6c
Thank you, I have uploaded a package with both patches and it builds 
fine again:


https://buildd.debian.org/status/package.php?p=fastnetmon




I've used 
https://lore.kernel.org/bpf/20220202225916.3313522-7-and...@kernel.org/ 
and 
https://lxr.missinglinkelectronics.com/linux+v5.19/samples/bpf/xdp1_user.c 
as examples as this code was my reference during implementation.


Would be great if you could review it a second time.

Thank you!

On Mon, 7 Nov 2022 at 11:59, Sudip Mukherjee 
 wrote:


Hi Pavel,

On Mon, Nov 7, 2022 at 11:53 AM Pavel Odintsov
 wrote:
>
> Hello!
>
> Thank you for reaching me.
>
> Sure, I'll be happy to check.
>
> May I kindly ask what exactly changed to trigger these errors? I
believe it was successfully built previously.

Its the update of libbpf to v1.0.1 which removed some of the
deprecated API.


-- 
Regards

Sudip



--
Sincerely yours, Pavel Odintsov

Bug#1023555: fastnetmon: FTBFS with libbpf 1.0

2022-11-08 Thread Sudip Mukherjee
On Tue, Nov 8, 2022 at 6:06 PM Pavel Odintsov  wrote:
>
> Hello!
>
> I think I have one more question.
>
> For most of the platforms we support libbpf 1.0.1 works fine but I noticed 
> issues with Debian 11 and Ubuntu 20 about enum declarations:

Can you please give me the steps to reproduce this enum error. libbpf
1.0.1 is not available in Debian-11, so I built a backport package for
libbpf/1.0.1 and then tried building fastnetmon with the backported
libbpf in a Bullseye chroot. I did not see the enum issue, but I got a
different error:

/<>/src/fastnetmon.cpp: In function ‘int main(int, char**)’:
/<>/src/fastnetmon.cpp:1540:14: error: ‘std::filesystem’
has not been declared
 1540 | if (std::filesystem::exists(backtrace_path)) {
  |  ^~
/<>/src/fastnetmon.cpp:1550:14: error: ‘std::filesystem’
has not been declared
 1550 | std::filesystem::remove(backtrace_path);
  |  ^~
make[3]: *** [CMakeFiles/fastnetmon.dir/build.make:85:
CMakeFiles/fastnetmon.dir/fastnetmon.cpp.o] Error 1

Note: I saw that you have commented on the upstream issue about the
enum problem and noticed you are using "latest C++ compiler (not from
Linux distro) and C++ 2022."

-- 
Regards
Sudip



Bug#1023555: fastnetmon: FTBFS with libbpf 1.0

2022-11-08 Thread Sudip Mukherjee
On Tue, Nov 8, 2022 at 4:55 PM Pavel Odintsov  wrote:
>
> Hello!
>
> Added copy to all.
>
> I think I fixed it with these commits: 
> https://github.com/pavel-odintsov/fastnetmon/commit/c48497a6f109fc1a9f5da596b055c3b7cffb96d4
>  and 
> https://github.com/pavel-odintsov/fastnetmon/commit/c718e88d0b25dcfbd724e9820f592fd5782eca6c

Thanks.

>
> I've used 
> https://lore.kernel.org/bpf/20220202225916.3313522-7-and...@kernel.org/ and 
> https://lxr.missinglinkelectronics.com/linux+v5.19/samples/bpf/xdp1_user.c as 
> examples as this code was my reference during implementation.
>
> Would be great if you could review it a second time.

lgtm.


-- 
Regards
Sudip



Bug#1023555: fastnetmon: FTBFS with libbpf 1.0

2022-11-08 Thread Pavel Odintsov
Hello!

I think I have one more question.

For most of the platforms we support libbpf 1.0.1 works fine but I noticed
issues with Debian 11 and Ubuntu 20 about enum declarations:

In file included from
/tmp/fastnetmon.build.dir.i2Ak87Hs7Y/fastnetmon/src/xdp_plugin/xdp_collector.cpp:14:
/opt/fastnetmon-community/libraries/libbpf_1_0_1/include/bpf/bpf.h:396:6:
error: use of enum 'bpf_stats_type' without previous declaration
  396 | enum bpf_stats_type; /* defined in up-to-date linux/bpf.h */
  |  ^~
/opt/fastnetmon-community/libraries/libbpf_1_0_1/include/bpf/bpf.h:397:38:
error: use of enum 'bpf_stats_type' without previous declaration
  397 | LIBBPF_API int bpf_enable_stats(enum bpf_stats_type type);
  |  ^~
In file included from
/tmp/fastnetmon.build.dir.i2Ak87Hs7Y/fastnetmon/src/xdp_plugin/xdp_collector.cpp:15:
/opt/fastnetmon-community/libraries/libbpf_1_0_1/include/bpf/libbpf.h:70:54:
error: use of enum 'bpf_link_type' without previous declaration
   70 | LIBBPF_API const char *libbpf_bpf_link_type_str(enum bpf_link_type
t);
  |  ^~~~

Did you experience similar errors previously by any chance?

Thank you!


On Tue, 8 Nov 2022 at 16:55, Pavel Odintsov 
wrote:

> Hello!
>
> Added copy to all.
>
> I think I fixed it with these commits:
> https://github.com/pavel-odintsov/fastnetmon/commit/c48497a6f109fc1a9f5da596b055c3b7cffb96d4
> and
> https://github.com/pavel-odintsov/fastnetmon/commit/c718e88d0b25dcfbd724e9820f592fd5782eca6c
>
> I've used
> https://lore.kernel.org/bpf/20220202225916.3313522-7-and...@kernel.org/
> and
> https://lxr.missinglinkelectronics.com/linux+v5.19/samples/bpf/xdp1_user.c
> as examples as this code was my reference during implementation.
>
> Would be great if you could review it a second time.
>
> Thank you!
>
> On Mon, 7 Nov 2022 at 11:59, Sudip Mukherjee 
> wrote:
>
>> Hi Pavel,
>>
>> On Mon, Nov 7, 2022 at 11:53 AM Pavel Odintsov 
>> wrote:
>> >
>> > Hello!
>> >
>> > Thank you for reaching me.
>> >
>> > Sure, I'll be happy to check.
>> >
>> > May I kindly ask what exactly changed to trigger these errors? I
>> believe it was successfully built previously.
>>
>> Its the update of libbpf to v1.0.1 which removed some of the deprecated
>> API.
>>
>>
>> --
>> Regards
>> Sudip
>>
>
>
> --
> Sincerely yours, Pavel Odintsov
>


-- 
Sincerely yours, Pavel Odintsov


Bug#1023555: fastnetmon: FTBFS with libbpf 1.0

2022-11-08 Thread Pavel Odintsov
Hello!

Added copy to all.

I think I fixed it with these commits:
https://github.com/pavel-odintsov/fastnetmon/commit/c48497a6f109fc1a9f5da596b055c3b7cffb96d4
and
https://github.com/pavel-odintsov/fastnetmon/commit/c718e88d0b25dcfbd724e9820f592fd5782eca6c

I've used
https://lore.kernel.org/bpf/20220202225916.3313522-7-and...@kernel.org/ and
https://lxr.missinglinkelectronics.com/linux+v5.19/samples/bpf/xdp1_user.c
as examples as this code was my reference during implementation.

Would be great if you could review it a second time.

Thank you!

On Mon, 7 Nov 2022 at 11:59, Sudip Mukherjee 
wrote:

> Hi Pavel,
>
> On Mon, Nov 7, 2022 at 11:53 AM Pavel Odintsov 
> wrote:
> >
> > Hello!
> >
> > Thank you for reaching me.
> >
> > Sure, I'll be happy to check.
> >
> > May I kindly ask what exactly changed to trigger these errors? I believe
> it was successfully built previously.
>
> Its the update of libbpf to v1.0.1 which removed some of the deprecated
> API.
>
>
> --
> Regards
> Sudip
>


-- 
Sincerely yours, Pavel Odintsov


Bug#1023555: fastnetmon: FTBFS with libbpf 1.0

2022-11-07 Thread Sudip Mukherjee
Hi Pavel,

On Mon, Nov 7, 2022 at 11:53 AM Pavel Odintsov  wrote:
>
> Hello!
>
> Thank you for reaching me.
>
> Sure, I'll be happy to check.
>
> May I kindly ask what exactly changed to trigger these errors? I believe it 
> was successfully built previously.

Its the update of libbpf to v1.0.1 which removed some of the deprecated API.


-- 
Regards
Sudip



Bug#1023555: fastnetmon: FTBFS with libbpf 1.0

2022-11-07 Thread Pavel Odintsov
Hello!

Thank you for reaching me.

Sure, I'll be happy to check.

May I kindly ask what exactly changed to trigger these errors? I believe it
was successfully built previously.


On Mon, 7 Nov 2022 at 10:55, Patrick Matthäi  wrote:

> Hey,
>
> Am 06.11.2022 um 19:32 schrieb Sudip Mukherjee:
> > On Sun, Nov 6, 2022 at 3:51 PM Sebastian Ramacher 
> wrote:
> >> Source: fastnetmon
> >> Version: 1.2.3-1
> >> Severity: serious
> >> Tags: ftbfs
> >> Justification: fails to build from source (but built successfully in
> the past)
> >> X-Debbugs-Cc: sramac...@debian.org, sudipm.mukher...@gmail.com
> >>
> >>
> https://buildd.debian.org/status/fetch.php?pkg=fastnetmon=amd64=1.2.3-1%2Bb1=1667748889=0
> > oops, sorry I missed it in my list of packages depending on libbpf. It
> > seems "fastnetmon" added the dependency on libbpf with the last upload
> > and I generated my list before that.   :(
> >
> > Please let me know if you want me to help with a patch to port the
> > code to libbpf.
> >
> >
> Yeah it is a new feature and was just added, dont worry :-)
>
> @Pavel: This is for you, if you need help maybe dont hestiate to ask
> Sudip (thanks for your offer!)
>
> --
> /*
> Mit freundlichem Gruß / With kind regards,
>   Patrick Matthäi
>   GNU/Linux Debian Developer
>
>Blog: https://www.linux-dev.org/
> E-Mail: pmatth...@debian.org
>  patr...@linux-dev.org
> */
>
>

-- 
Sincerely yours, Pavel Odintsov


Bug#1023555: fastnetmon: FTBFS with libbpf 1.0

2022-11-07 Thread Patrick Matthäi

Hey,

Am 06.11.2022 um 19:32 schrieb Sudip Mukherjee:

On Sun, Nov 6, 2022 at 3:51 PM Sebastian Ramacher  wrote:

Source: fastnetmon
Version: 1.2.3-1
Severity: serious
Tags: ftbfs
Justification: fails to build from source (but built successfully in the past)
X-Debbugs-Cc: sramac...@debian.org, sudipm.mukher...@gmail.com

https://buildd.debian.org/status/fetch.php?pkg=fastnetmon=amd64=1.2.3-1%2Bb1=1667748889=0

oops, sorry I missed it in my list of packages depending on libbpf. It
seems "fastnetmon" added the dependency on libbpf with the last upload
and I generated my list before that.   :(

Please let me know if you want me to help with a patch to port the
code to libbpf.



Yeah it is a new feature and was just added, dont worry :-)

@Pavel: This is for you, if you need help maybe dont hestiate to ask 
Sudip (thanks for your offer!)


--
/*
Mit freundlichem Gruß / With kind regards,
 Patrick Matthäi
 GNU/Linux Debian Developer

  Blog: https://www.linux-dev.org/
E-Mail: pmatth...@debian.org
patr...@linux-dev.org
*/



Bug#1023555: fastnetmon: FTBFS with libbpf 1.0

2022-11-06 Thread Sudip Mukherjee
On Sun, Nov 6, 2022 at 3:51 PM Sebastian Ramacher  wrote:
>
> Source: fastnetmon
> Version: 1.2.3-1
> Severity: serious
> Tags: ftbfs
> Justification: fails to build from source (but built successfully in the past)
> X-Debbugs-Cc: sramac...@debian.org, sudipm.mukher...@gmail.com
>
> https://buildd.debian.org/status/fetch.php?pkg=fastnetmon=amd64=1.2.3-1%2Bb1=1667748889=0

oops, sorry I missed it in my list of packages depending on libbpf. It
seems "fastnetmon" added the dependency on libbpf with the last upload
and I generated my list before that.   :(

Please let me know if you want me to help with a patch to port the
code to libbpf.


-- 
Regards
Sudip



Bug#1023555: fastnetmon: FTBFS with libbpf 1.0

2022-11-06 Thread Sebastian Ramacher
Source: fastnetmon
Version: 1.2.3-1
Severity: serious
Tags: ftbfs
Justification: fails to build from source (but built successfully in the past)
X-Debbugs-Cc: sramac...@debian.org, sudipm.mukher...@gmail.com

https://buildd.debian.org/status/fetch.php?pkg=fastnetmon=amd64=1.2.3-1%2Bb1=1667748889=0

/<>/src/xdp_plugin/xdp_collector.cpp: In function ‘void 
start_xdp_collection(process_packet_pointer)’:
/<>/src/xdp_plugin/xdp_collector.cpp:522:5: error: 
‘bpf_prog_load_attr’ was not declared in this scope; did you mean 
‘bpf_prog_load_opts’?
  522 | bpf_prog_load_attr prog_load_attr;
  | ^~
  | bpf_prog_load_opts
/<>/src/xdp_plugin/xdp_collector.cpp:523:5: error: 
‘prog_load_attr’ was not declared in this scope
  523 | prog_load_attr.prog_type = BPF_PROG_TYPE_XDP;
  | ^~
/<>/src/xdp_plugin/xdp_collector.cpp:529:24: error: 
‘bpf_prog_load_xattr’ was not declared in this scope; did you mean 
‘bpf_prog_load_opts’?
  529 | int bpf_load_res = bpf_prog_load_xattr(_load_attr, , 
_fd);
  |^~~
  |bpf_prog_load_opts
/<>/src/xdp_plugin/xdp_collector.cpp:594:28: error: 
‘bpf_set_link_xdp_fd’ was not declared in this scope; did you mean 
‘set_link_xdp_res’?
  594 | int set_link_xdp_res = bpf_set_link_xdp_fd(ifindex, prog_fd, 
opt_xdp_flags);
  |^~~
  |set_link_xdp_res
make[3]: *** [CMakeFiles/xdp_plugin.dir/build.make:79: 
CMakeFiles/xdp_plugin.dir/xdp_plugin/xdp_collector.cpp.o] Error 1
make[3]: Leaving directory '/<>/obj-x86_64-linux-gnu'
make[2]: *** [CMakeFiles/Makefile2:456: CMakeFiles/xdp_plugin.dir/all] Error 2

Cheers
-- 
Sebastian Ramacher