GithubHelp home page GithubHelp logo

Comments (4)

marshalWS avatar marshalWS commented on June 3, 2024

what's mean with Note: 8 bytes struct bpf_elf_map fixup performed due to size mismatch!?

root@xxx:/home/tttt/bin# ip link set dev ens3 xdp obj xdp-pass-ebpf.o
Note: 8 bytes struct bpf_elf_map fixup performed due to size mismatch!
root@xxx:/home/tttt/bin#

from xdpcap.

arthurfabre avatar arthurfabre commented on June 3, 2024

Thanks for the example, I didn't realize that maps could be pinned with ip link set xdp.

The only problem I can spot is that your program doesn't tail_call into the map. Instead of:

    return XDP_PASS;

You need to:

#include "hook.h"

...

    return xdpcap_exit(ctx, &bpf_elf_map, XDP_PASS);

You also don't need max_elem to be 100, there are only 5 possible actions (but it should work with 100 too).

from xdpcap.

marshalWS avatar marshalWS commented on June 3, 2024

Thanks for the example, I didn't realize that maps could be pinned with ip link set xdp.

The only problem I can spot is that your program doesn't tail_call into the map. Instead of:

    return XDP_PASS;

You need to:

#include "hook.h"

...

    return xdpcap_exit(ctx, &bpf_elf_map, XDP_PASS);

You also don't need max_elem to be 100, there are only 5 possible actions (but it should work with 100 too).

thanks very much ! I get it. xdpcap run successfully
Best wishes ~~.
root@xxx:/home/tttt/bin# ./xdpcap /sys/fs/bpf/xdp/globals/action_map dump-new.pcap
ws----- os.Args[0]= ./xdpcap [1:]= [/sys/fs/bpf/xdp/globals/action_map dump-new.pcap]
************ write packet pkt.data
aborted: 0/0 drop: 0/0 pass: 1/1 tx: 0/0 redirect: 0/0 (received/matched packets)
************ write packet pkt.data
aborted: 0/0 drop: 0/0 pass: 2/2 tx: 0/0 redirect: 0/0 (received/matched packets)
************ write packet pkt.data
aborted: 0/0 drop: 0/0 pass: 3/3 tx: 0/0 redirect: 0/0 (received/matched packets)
************ write packet pkt.data
aborted: 0/0 drop: 0/0 pass: 4/4 tx: 0/0 redirect: 0/0 (received/matched packets)
************ write packet pkt.data

from xdpcap.

marshalWS avatar marshalWS commented on June 3, 2024

This problem has been solved perfectly!

from xdpcap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.