Comments (7)
Zaafar,
Could you show the exact steps you reach the problem? Where did you get the
kernel 4.2.0-999-generic (Build Date 03/Sep/2015)?
Multiple different ways exist for installation of bcc. More details will
enable us to reproduce/resolve the issue.
Thanks,
Yonghong
On Tue, Sep 8, 2015 at 1:34 AM, zaafar [email protected] wrote:
I am using Ubuntu 14.04 with kernel 4.2.0-999-generic (Build Date
03/Sep/2015) and when I try to execute the distributed-bridge code using
the root account I receive following error. Weird part about this error is
that if I reboot the machine and execute the distributed-bridge code it
will work fine in the first attempt only however, on all substituent
executions it will give following error./usr/share/bcc/examples/distributed_bridge/tunnel.c:31:25: error: variable
has incomplete type 'struct bpf_tunnel_key'
struct bpf_tunnel_key tkey = {};
^
/usr/share/bcc/examples/distributed_bridge/tunnel.c:31:10: note: forward
declaration of 'struct bpf_tunnel_key'
struct bpf_tunnel_key tkey = {};
^
/usr/share/bcc/examples/distributed_bridge/tunnel.c:32:3: warning:
implicit declaration of function 'bpf_skb_get_tunnel_key' is invalid in C99
[-Wimplicit-function-declaration]
bpf_skb_get_tunnel_key(skb, &tkey, sizeof(tkey), 0);
^
/usr/share/bcc/examples/distributed_bridge/tunnel.c:61:25: error: variable
has incomplete type 'struct bpf_tunnel_key'
struct bpf_tunnel_key tkey = {};
^
/usr/share/bcc/examples/distributed_bridge/tunnel.c:61:10: note: forward
declaration of 'struct bpf_tunnel_key'
struct bpf_tunnel_key tkey = {};
^
/usr/share/bcc/examples/distributed_bridge/tunnel.c:66:5: warning:
implicit declaration of function 'bpf_skb_set_tunnel_key' is invalid in C99
[-Wimplicit-function-declaration]
bpf_skb_set_tunnel_key(skb, &tkey, sizeof(tkey), 0);
^
/usr/share/bcc/examples/distributed_bridge/tunnel.c:69:27: error: variable
has incomplete type 'struct bpf_tunnel_key'
struct bpf_tunnel_key tkey = {};
^
/usr/share/bcc/examples/distributed_bridge/tunnel.c:61:10: note: forward
declaration of 'struct bpf_tunnel_key'
struct bpf_tunnel_key tkey = {};
^
2 warnings and 3 errors generated.
Traceback (most recent call last):
File "tunnel.py", line 18, in
b = BPF(src_file="tunnel.c")
File "/usr/lib/python3/dist-packages/bcc/init.py", line 298, in init
raise Exception("Failed to compile BPF module %s" % src_file)
Exception: Failed to compile BPF module tunnel.c
Validating connectivityAlso, where is the "struct bpf_tunnel_key" defined?
Zaafar
—
Reply to this email directly or view it on GitHub
#190.
from bcc.
Yonghong,
I installed "ubuntu-14.04.3-desktop-amd64" on the virtualbox vm and updated it fully using apt-get. After that I updated the kernel to 4.2.0-999 using following script.
rm -rf *.deb
PREFIX=http://kernel.ubuntu.com/~kernel-ppa/mainline/daily/2015-09-08-unstable/
VER=4.2.0-999
REL=201509072200
wget ${PREFIX}/linux-headers-${VER}-generic_${VER}.${REL}_amd64.deb
wget ${PREFIX}/linux-headers-${VER}_${VER}.${REL}_all.deb
wget ${PREFIX}/linux-image-${VER}-generic_${VER}.${REL}_amd64.deb
sudo dpkg -i linux-*${VER}.${REL}*.deb
After installing the kernel, it gives me following output with <uname -a>
command
Linux zaafar-VirtualBox 4.2.0-999-generic #201509072200 SMP Tue Sep 8 02:02:03 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
In order to install LLVM and bcc I followed the steps given in install.md (Ubuntu from source)
https://github.com/iovisor/bcc/blob/master/INSTALL.md#ubuntu---from-source
After installing bcc I installed the required python modules in order to run the distributed-bridge code via following commands
sudo pip install pyroute2
sudo pip install future
sudo pip install netaddr
After that I run following command in order to execute the distributed-bridge code
sudo python main.py
Following is the error i am getting
LLVM ERROR: Program used external function 'bpf_skb_get_tunnel_key' which could not be resolved!
from bcc.
Zaafar,
This is kernel version issue. In helpers.h
(/usr/share/bcc/include/bcc/helpers.h):
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)
static u64 (_bpf_get_cgroup_classid)(void *ctx) =
(void *) BPF_FUNC_get_cgroup_classid;
static u64 (_bpf_skb_vlan_push)(void _ctx, u16 proto, u16 vlan_tci) =
(void *) BPF_FUNC_skb_vlan_push;
static u64 (_bpf_skb_vlan_pop)(void _ctx) =
(void *) BPF_FUNC_skb_vlan_pop;
static int (_bpf_skb_get_tunnel_key)(void _ctx, void *to, u32 size, u64
flags) =
(void *) BPF_FUNC_skb_get_tunnel_key;
static int (_bpf_skb_set_tunnel_key)(void *ctx, void *from, u32 size, u64
flags) =
(void *) BPF_FUNC_skb_set_tunnel_key;
#endif
It is because of the kernel you downloaded do not support the above
functionality yet.
It will be available in 4.3.
If you want to experiment with the distributed bridge, you need to use the
latest net-next tree:
https://kernel.googlesource.com/pub/scm/linux/kernel/git/davem/net-next
(It still use version 4.2.0, you need manually change the above helpers.h
to check against 4.2.0,
but all the functionality is there.)
The change has also been pulled into latest Linus tree,
https://github.com/torvalds/linux
Let me know if you are not able to experiment.
On Wed, Sep 9, 2015 at 5:23 AM, zaafar [email protected] wrote:
Yonghong,
I installed "ubuntu-14.04.3-desktop-amd64" on the virtualbox vm and
updated it fully using apt-get. After that I updated the kernel to
4.2.0-999 using following script.rm -rf .deb
PREFIX=http://kernel.ubuntu.com/~kernel-ppa/mainline/daily/2015-09-08-unstable/
VER=4.2.0-999
REL=201509072200 http://kernel.ubuntu.com/~kernel-ppa/mainline/daily/2015-09-08-unstable/VER=4.2.0-999REL=201509072200
wget ${PREFIX}/linux-headers-${VER}-generic${VER}.${REL}amd64.deb
wget ${PREFIX}/linux-headers-${VER}${VER}.${REL}all.deb
wget ${PREFIX}/linux-image-${VER}-generic${VER}.${REL}amd64.deb
sudo dpkg -i linux-${VER}.${REL}*.debAfter installing the kernel, it gives me following output with <uname -a>
commandLinux zaafar-VirtualBox 4.2.0-999-generic #201509072200 SMP Tue Sep 8
02:02:03 UTC 2015 x86_64 x86_64 x86_64 GNU/LinuxIn order to install LLVM and bcc I followed the steps given in install.md
(Ubuntu from source)https://github.com/iovisor/bcc/blob/master/INSTALL.md#ubuntu---from-source
After installing bcc I installed the required python modules in order to
run the distributed-bridge code via following commandssudo pip install pyroute2
sudo pip install future
sudo pip install netaddrAfter that I run following command in order to execute the
distributed-bridge codesudo python main.py
Following is the error i am getting
LLVM ERROR: Program used external function 'bpf_skb_get_tunnel_key' which
could not be resolved!—
Reply to this email directly or view it on GitHub
#190 (comment).
from bcc.
Just to followup (and possibly I will try and update the bridge example with a README), with 4.2 kernel we cannot hope to run the distributed bridge example. (I also observed similar failure while running vlan learning example, and sure enough skb related bpf calls are present there as well).
In your comment above, when you say all the functionality is there, you mean to say we first download the kernel from latest net-next tree and then rebuild it first?
from bcc.
Yes. build the kernel and install it like the below:
make defconfig
make -j4
sudo make modules_install install
reboot
The following is a link which is useful to install or remove a new kernel
either through packaging or through manual install.
http://community.linuxmint.com/tutorial/view/1718
On Wed, Sep 9, 2015 at 10:52 AM, affansyed [email protected] wrote:
Just to followup (and possibly I will try and update the bridge example
with a README), with 4.2 kernel we cannot hope to run the distributed
bridge example. (I also observed similar failure while running vlan
learning example, and sure enough skb related bpf calls are present there
as well).In your comment above, when you say all the functionality is there, you
mean to say we first download the kernel from latest net-next tree and then
rebuild it first?—
Reply to this email directly or view it on GitHub
#190 (comment).
from bcc.
Thank you Yonghong, This does solve my issue.
Regards,
Zaafar
from bcc.
Just to further elaborate -- on investigating the following mainline kernel version supports both the bridge and vlan learning code.
PREFIX=http://kernel.ubuntu.com/~kernel-ppa/mainline/daily/2015-09-08-unstable/
VER=4.2.0-999
REL=201509072200
I am going to pull and put in a change request for the install.md to reflect this
from bcc.
Related Issues (20)
- Is there some mechanism for "sampling" tables at a periodic rate?
- Failed to build with LLVM 18 HOT 1
- BCC tool execute failed on Android by debianfs
- Failed to attach BPF program b'oncpu' to kprobe b'finish_task_switch' offcputime-bpfcc HOT 3
- bcc-tools: trace.py syscall trace not working for proccess in container(lxc) HOT 1
- question: `LLVM ERROR: ` error with no indication
- [question]: Run ebpf demo failed.
- zfsslower wrongly tries to attach to non-existant zpl_read (regression of #1248)
- memleak: the symbol of the function that calls `new` disappeared HOT 2
- some regex escape sequences broke after fixing SyntaxWarning HOT 1
- Just ran into this issue while building / testing on Debian 8 amd64.
- can't deny access to a specific file
- can't deny access to a specific file
- no matching member function for call to 'replace'
- fatal error: clang/Basic/FileManager.h: No such file or directory
- ImportError: cannot import name 'BPF' from 'bcc' (unknown location)
- python-bcc works only if clang-libs Installed, fails with only clang16-libs Installed
- libbpf javagc fails when no PID is provided
- bpflist doesn't show attached probes
- Build fail from source HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bcc.