-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
variable has incomplete type Error #190
Comments
Zaafar, Could you show the exact steps you reach the problem? Where did you get the Thanks, Yonghong On Tue, Sep 8, 2015 at 1:34 AM, zaafar notifications@github.com 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
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 In order to install LLVM and bcc I followed the steps given in 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 Following is the error i am getting |
Zaafar, This is kernel version issue. In helpers.h #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0) It is because of the kernel you downloaded do not support the above If you want to experiment with the distributed bridge, you need to use the The change has also been pulled into latest Linus tree, Let me know if you are not able to experiment. On Wed, Sep 9, 2015 at 5:23 AM, zaafar notifications@github.com 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? |
Yes. build the kernel and install it like the below: The following is a link which is useful to install or remove a new kernel On Wed, Sep 9, 2015 at 10:52 AM, affansyed notifications@github.com wrote:
|
Thank you Yonghong, This does solve my issue. Regards, |
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/ I am going to pull and put in a change request for the install.md to reflect this |
I am using Ubuntu 14.04 with kernel 4.2.0-999-generic (Build Date 03/Sep/2015) as a VM on the virtual box 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 connectivity
Also, where is the "struct bpf_tunnel_key" defined?
Zaafar
The text was updated successfully, but these errors were encountered: