Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[rdy]iproute: allow to load ebpf programs #44598

Merged
merged 1 commit into from Aug 7, 2018
Merged

Conversation

teto
Copy link
Member

@teto teto commented Aug 7, 2018

...via passing libelf as a buildinput.

Motivation for this change

I want to attach some filters to my interfaces via tc

IF="enp4s0"
sudo tc qdisc add dev "$IF" clsact
sudo tc filter add dev "$IF" ingress bpf obj test_ebpf_tc.o section action direct-action

but this failed with

No ELF library support compiled in.
Unable to load program
Things done

just passed libelf as a buildinput then iproute's ./configure scripts picks it up.

I can make it optional if need be.

  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: iproute

Partial log (click to expand)

shrinking /nix/store/gqlsqb71hk1i0xl9drjxxr2f4s64sgcj-iproute2-4.17.0/sbin/nstat
shrinking /nix/store/gqlsqb71hk1i0xl9drjxxr2f4s64sgcj-iproute2-4.17.0/sbin/tc
shrinking /nix/store/gqlsqb71hk1i0xl9drjxxr2f4s64sgcj-iproute2-4.17.0/sbin/rtmon
gzipping man pages under /nix/store/gqlsqb71hk1i0xl9drjxxr2f4s64sgcj-iproute2-4.17.0/share/man/
strip is /nix/store/1hi76hr87bd1y1q1qjk0lv8nmcjip1c8-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/gqlsqb71hk1i0xl9drjxxr2f4s64sgcj-iproute2-4.17.0/lib  /nix/store/gqlsqb71hk1i0xl9drjxxr2f4s64sgcj-iproute2-4.17.0/sbin
patching script interpreter paths in /nix/store/gqlsqb71hk1i0xl9drjxxr2f4s64sgcj-iproute2-4.17.0
checking for references to /build in /nix/store/gqlsqb71hk1i0xl9drjxxr2f4s64sgcj-iproute2-4.17.0...
moving /nix/store/gqlsqb71hk1i0xl9drjxxr2f4s64sgcj-iproute2-4.17.0/sbin/* to /nix/store/gqlsqb71hk1i0xl9drjxxr2f4s64sgcj-iproute2-4.17.0/bin
/nix/store/gqlsqb71hk1i0xl9drjxxr2f4s64sgcj-iproute2-4.17.0

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: iproute

Partial log (click to expand)

shrinking /nix/store/73qbjdzj16jmsxk4kzjxiz7hn98s8law-iproute2-4.17.0/sbin/tc
shrinking /nix/store/73qbjdzj16jmsxk4kzjxiz7hn98s8law-iproute2-4.17.0/sbin/rtmon
shrinking /nix/store/73qbjdzj16jmsxk4kzjxiz7hn98s8law-iproute2-4.17.0/sbin/ip
gzipping man pages under /nix/store/73qbjdzj16jmsxk4kzjxiz7hn98s8law-iproute2-4.17.0/share/man/
strip is /nix/store/zrs21zqcchgyabjf4xfimncdq16njizc-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/73qbjdzj16jmsxk4kzjxiz7hn98s8law-iproute2-4.17.0/lib  /nix/store/73qbjdzj16jmsxk4kzjxiz7hn98s8law-iproute2-4.17.0/sbin
patching script interpreter paths in /nix/store/73qbjdzj16jmsxk4kzjxiz7hn98s8law-iproute2-4.17.0
checking for references to /build in /nix/store/73qbjdzj16jmsxk4kzjxiz7hn98s8law-iproute2-4.17.0...
moving /nix/store/73qbjdzj16jmsxk4kzjxiz7hn98s8law-iproute2-4.17.0/sbin/* to /nix/store/73qbjdzj16jmsxk4kzjxiz7hn98s8law-iproute2-4.17.0/bin
/nix/store/73qbjdzj16jmsxk4kzjxiz7hn98s8law-iproute2-4.17.0

@xeji
Copy link
Contributor

xeji commented Aug 7, 2018

large number of rebuilds, please rebase this on staging.

@teto teto changed the base branch from master to staging August 7, 2018 16:09
...via passing libelf as a buildinput.
@teto
Copy link
Member Author

teto commented Aug 7, 2018

done :)

@GrahamcOfBorg
Copy link

Failure on x86_64-linux (full log)

Attempted: iproute

Partial log (click to expand)

cannot build derivation '/nix/store/zf5j3k9hvqpsrja8x5qdkdjhw6bq56dg-libnftnl-1.1.1.drv': 4 dependencies couldn't be built
cannot build derivation '/nix/store/arwnrb7cqmr6y8sw6ws4vdq5yxh2iic3-perl5.28.0-gettext-1.07.drv': 4 dependencies couldn't be built
cannot build derivation '/nix/store/yqjsskzcpy39lm33184hp3zy5fmld3ay-automake-1.16.1.drv': 4 dependencies couldn't be built
cannot build derivation '/nix/store/br51zr3vwdbh6frcf65x9zx9d7ihzvwj-help2man-1.47.6.drv': 5 dependencies couldn't be built
cannot build derivation '/nix/store/svjah6a7fzxx0j2b27jsjn2l3p0g8pxh-libtool-2.4.6.drv': 5 dependencies couldn't be built
cannot build derivation '/nix/store/f2ybi2inv6a68x7djq8ywill7lhxwdxx-hook.drv': 6 dependencies couldn't be built
cannot build derivation '/nix/store/ls7g56il1y7iqwmwhpwcp5lhcmdcmij5-flex-2.6.4.drv': 7 dependencies couldn't be built
cannot build derivation '/nix/store/92ipibnkxsv93krjly6998m2pb4yfc6g-iptables-1.6.2.drv': 8 dependencies couldn't be built
cannot build derivation '/nix/store/5ah1bmnrd4fpbknfaa40816c1gagqd3p-iproute2-4.17.0.drv': 8 dependencies couldn't be built
error: build of '/nix/store/5ah1bmnrd4fpbknfaa40816c1gagqd3p-iproute2-4.17.0.drv' failed

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: iproute

Partial log (click to expand)

shrinking /nix/store/j4nms43ykr7pncx1dyg2im9nwd50cl4h-iproute2-4.17.0/sbin/tc
shrinking /nix/store/j4nms43ykr7pncx1dyg2im9nwd50cl4h-iproute2-4.17.0/sbin/rtmon
shrinking /nix/store/j4nms43ykr7pncx1dyg2im9nwd50cl4h-iproute2-4.17.0/sbin/ip
gzipping man pages under /nix/store/j4nms43ykr7pncx1dyg2im9nwd50cl4h-iproute2-4.17.0/share/man/
strip is /nix/store/k8p81w07kmi2rx1fms516kd28h058wk6-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/j4nms43ykr7pncx1dyg2im9nwd50cl4h-iproute2-4.17.0/lib  /nix/store/j4nms43ykr7pncx1dyg2im9nwd50cl4h-iproute2-4.17.0/sbin
patching script interpreter paths in /nix/store/j4nms43ykr7pncx1dyg2im9nwd50cl4h-iproute2-4.17.0
checking for references to /build in /nix/store/j4nms43ykr7pncx1dyg2im9nwd50cl4h-iproute2-4.17.0...
moving /nix/store/j4nms43ykr7pncx1dyg2im9nwd50cl4h-iproute2-4.17.0/sbin/* to /nix/store/j4nms43ykr7pncx1dyg2im9nwd50cl4h-iproute2-4.17.0/bin
/nix/store/j4nms43ykr7pncx1dyg2im9nwd50cl4h-iproute2-4.17.0

@xeji
Copy link
Contributor

xeji commented Aug 7, 2018

x86_64-linux failure is a timeout building gcc. Let's ignore it since this built fine on master.

@xeji xeji merged commit 82f338b into NixOS:staging Aug 7, 2018
@teto teto deleted the iproute_libelf branch August 8, 2018 02:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants