Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 40182 - Briding on my Ultra 60 (Sparc64) with a qfe card using ebuild 0.9.3r1 or 0.9.6 (adding sparc to keywords) does not work
Summary: Briding on my Ultra 60 (Sparc64) with a qfe card using ebuild 0.9.3r1 or 0.9....
Status: RESOLVED TEST-REQUEST
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: Sparc Linux
: High normal
Assignee: Sparc Porters
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-02 08:20 UTC by Jim Small
Modified: 2006-02-04 06:05 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jim Small 2004-02-02 08:20:36 UTC
I just installed Gentoo 1.4 on my Ultra 60 (Sparc 64) build. I updated everything so it's all current as of yesterday. I also compiled in bridging support in the kernel and can see that the bridging module loads. 

I then did an emerge bridge-utils. When I try to add a bridge though I get this: 
# brctl addbr br0 
br_add_bridge: Operation not supported 

I noticed that bridge-utils was version 0.9.3-r1. On the web site: bridge.sourceforge.net, the version was 0.9.6. So I "unemerged" the bridge-utils, changed the 0.9.6 ebuild keywords to add sparc, and emerged using the 0.9.6 ebuild.  (suggested in forums)

Now when I try to do bridging, I get: 
# brctl addbr bridge0 
# brctl addif bridge0 hme0 
bridge bridge0 doesn't exist! 
# brctl show 
bridge name bridge id STP enabled interfaces 
(No bridges shown) 
# brctl addbr bridge0 
device bridge0 already exists; can't create bridge with the same name 

I have 5 hme ports on my Ultra 60 and I need bridging. I also need traffic shaping. FreeBSD panics when you turn on bridging, OpenBSD is pokey when you bridge through more than 2 ports and doesn't have sufficiently advanced traffic shaping. Linux is my last hope! Please help. 


Reproducible: Always
Steps to Reproduce:
1.  Make sure briding is enabled in the kernel.
2.  brctl addbr bridge0
3.  brctl show  (bridge0 does not show up)

Actual Results:  
Can't seem to add a bridge virtual interface.

Expected Results:  
Should have created a virtual bridge interface which you could then associate 
interfaces with.

The bridge module loads (can see it with lsmod).
Not sure why brctl can't create virtual bridge interface.

Hardware:  Ultra 60, 360MHz UltraSPARC II, 2GB RAM, 9 and 18GB SCSI HDDs, 
builtin hme port, qfe card with 4 "hme" ports, SCSI-CDROM

Note that briding works in OpenBSD (with same machine described above) albeit 
slowly so it is not a hardware problem or limitation.

I would be happy to try things, just let me know what to do.

Thanks--Jim
Comment 1 Jim Small 2004-02-02 10:43:48 UTC
straces (dev-util/strace-4.4.98):

Add new bridge:
test60{root}:/root<504>strace brctl addbr br10
execve("/sbin/brctl", ["brctl", "addbr", "br10"], [/* 28 vars */]) = 0
uname({sys="Linux", node="test60", ...}) = 0
brk(0)                                  = 0x25040
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7001a000
open("/etc/ld.so.preload", O_RDONLY)    = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=9986, ...}) = 0
mmap(NULL, 9986, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7001c000
close(3)                                = 0
open("/lib/libc.so.6", O_RDONLY)        = 3
read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\22\0\0\0\1\0\1\313"..., 1024) = 1024
fstat64(3, {st_mode=S_IFREG|0755, st_size=1583553, ...}) = 0
mmap(NULL, 1414760, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x7002c000
mprotect(0x70170000, 87656, PROT_NONE)  = 0
mmap(0x7017c000, 32768, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0x140000) = 0x7017c000
mmap(0x70184000, 5736, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x70184000
close(3)                                = 0
munmap(0x7001c000, 9986)                = 0
open("/dev/urandom", O_RDONLY)          = 3
read(3, "\307-\221\367\331\324\310{J\222F\3\330r\347\247\321<\274"..., 32) = 32
close(3)                                = 0
socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 3
uname({sys="Linux", node="test60", ...}) = 0
ioctl(3, 0x8940, 0xeffff900)            = 1
ioctl(3, 0x8940, 0xeffff868)            = 1
brk(0)                                  = 0x25040
brk(0x27040)                            = 0x27040
brk(0)                                  = 0x27040
brk(0x28000)                            = 0x28000
socket(PF_INET6, SOCK_DGRAM, 0)         = -1 EAFNOSUPPORT (Address family not supported by protocol)
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 4
ioctl(4, 0x8910, 0xeffff810)            = 0
close(4)                                = 0
ioctl(3, 0x89f3, 0xeffff790)            = -1 EOPNOTSUPP (Operation not supported)
ioctl(3, 0x8940, 0xeffff8f0)            = 0
exit(0)                                 = ?

Add same bridge:
test60{root}:/root<505>strace brctl addbr br10
execve("/sbin/brctl", ["brctl", "addbr", "br10"], [/* 28 vars */]) = 0
uname({sys="Linux", node="test60", ...}) = 0
brk(0)                                  = 0x25040
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7001a000
open("/etc/ld.so.preload", O_RDONLY)    = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=9986, ...}) = 0
mmap(NULL, 9986, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7001c000
close(3)                                = 0
open("/lib/libc.so.6", O_RDONLY)        = 3
read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\22\0\0\0\1\0\1\313"..., 1024) = 1024
fstat64(3, {st_mode=S_IFREG|0755, st_size=1583553, ...}) = 0
mmap(NULL, 1414760, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x7002c000
mprotect(0x70170000, 87656, PROT_NONE)  = 0
mmap(0x7017c000, 32768, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0x140000) = 0x7017c000
mmap(0x70184000, 5736, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x70184000
close(3)                                = 0
munmap(0x7001c000, 9986)                = 0
open("/dev/urandom", O_RDONLY)          = 3
read(3, "\333\325\275\344\v\264\\\210i\31\243\6\30R\243\311\256"..., 32) = 32
close(3)                                = 0
socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 3
uname({sys="Linux", node="test60", ...}) = 0
ioctl(3, 0x8940, 0xeffff900)            = 1
ioctl(3, 0x8940, 0xeffff868)            = 2
brk(0)                                  = 0x25040
brk(0x27040)                            = 0x27040
brk(0)                                  = 0x27040
brk(0x28000)                            = 0x28000
socket(PF_INET6, SOCK_DGRAM, 0)         = -1 EAFNOSUPPORT (Address family not supported by protocol)
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 4
ioctl(4, 0x8910, 0xeffff810)            = 0
close(4)                                = 0
ioctl(3, 0x89f3, 0xeffff790)            = -1 EOPNOTSUPP (Operation not supported)
ioctl(3, 0x8940, 0xeffff8f0)            = -1 EEXIST (File exists)
write(2, "device br10 already exists; can\'"..., 67device br10 already exists; can't create bridge with the same name
) = 67
exit(0)                                 = ?

Bridge status:
test60{root}:/root<506>strace brctl show
execve("/sbin/brctl", ["brctl", "show"], [/* 28 vars */]) = 0
uname({sys="Linux", node="test60", ...}) = 0
brk(0)                                  = 0x25040
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7001a000
open("/etc/ld.so.preload", O_RDONLY)    = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=9986, ...}) = 0
mmap(NULL, 9986, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7001c000
close(3)                                = 0
open("/lib/libc.so.6", O_RDONLY)        = 3
read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\22\0\0\0\1\0\1\313"..., 1024) = 1024
fstat64(3, {st_mode=S_IFREG|0755, st_size=1583553, ...}) = 0
mmap(NULL, 1414760, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x7002c000
mprotect(0x70170000, 87656, PROT_NONE)  = 0
mmap(0x7017c000, 32768, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0x140000) = 0x7017c000
mmap(0x70184000, 5736, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x70184000
close(3)                                = 0
munmap(0x7001c000, 9986)                = 0
open("/dev/urandom", O_RDONLY)          = 3
read(3, "C\374\303\246\324\364}\352\1779\335\266\24&\253\310\247"..., 32) = 32
close(3)                                = 0
socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 3
uname({sys="Linux", node="test60", ...}) = 0
ioctl(3, 0x8940, 0xeffff910)            = 1
ioctl(3, 0x8940, 0xeffff878)            = 2
brk(0)                                  = 0x25040
brk(0x27040)                            = 0x27040
brk(0)                                  = 0x27040
brk(0x28000)                            = 0x28000
socket(PF_INET6, SOCK_DGRAM, 0)         = -1 EAFNOSUPPORT (Address family not supported by protocol)
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 4
ioctl(4, 0x8910, 0xeffff820)            = 0
close(4)                                = 0
ioctl(3, 0x89f3, 0xeffff7a0)            = -1 EOPNOTSUPP (Operation not supported)
fstat64(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(3, 0), ...}) = 0
ioctl(1, SNDCTL_TMR_SELECT, {B38400 opost isig icanon echo ...}) = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7001c000
write(1, "bridge name\tbridge id\t\tSTP enabl"..., 46bridge name        bridge id               STP enabled     interfaces
) = 46
munmap(0x7001c000, 8192)                = 0
exit(0)                                 = ?
Comment 2 Jason Wever (RETIRED) gentoo-dev 2004-02-21 20:11:41 UTC
From the recent discussion on the sparclinux ml <http://marc.theaimsgroup.com/?t=107575522300004&r=1&w=2> (for others), bridge-utils needs 64 bit support to work.  This currently isn't available, but should be sometime before the 2004.1 release.
Comment 3 Gustavo Zacarias (RETIRED) gentoo-dev 2004-04-20 14:31:19 UTC
As the release of 2004.1 approaches we won't be addressing this (64 bit userland) just yet.
I'm lowering the severity to "normal" for the time being.
 
Comment 4 Jim Small 2004-04-22 11:40:18 UTC
Thanks to Santiago (Santi) Leon for providing the following fix to me to
enable bridging on the Sparc64 platform.  I have tested it under Debian
unstable, using Kernel 2.4.25, and bridge-utils-0.9.6.tar.gz.

The fix is as follows:
Download bridge-utils-0.9.6.tar.gz source from bridge.sourceforge.net, untar
it, edit 
bridge-utils/libbridge/libbridge_devif.c and search for a line that has
this:
  return ioctl(br_socket_fd, SIOCDEVPRIVATE + 3, &ifr);
and replace it with this:
  return ioctl(br_socket_fd, SIOCDEVPRIVATE, &ifr);
(basically just remove the +3)... run make and again and try:

(After you rebuild the bridge utilities, these should work beautifully!)
bridge-utils/brctl/brctl addbr br0
bridge-utils/brctl/brctl adddif br0 eth0
bridge-utils/brctl/brctl show

Santi mentioned that the newer kernels don't make SIOCDEVPRIVATE+3 a 64-bit
compatible 
ioctl and that's why it doesn't work on the Sparc64 architecture.  He also
mentioned that the same fix works for the PowerPC64 Architecture so it might
help for other 64bit architecture platforms.

Note also that this is not scheduled to be fixed in bridge-tuils-0.9.7, so
for now this seems to be the best work around for 64bit platforms.

Here is a diff too:
# diff -Nru bridge-utils/libbridge/libbridge_devif.c
bridge-utils/libbridge/libbridge_devif.c.orig 
--- bridge-utils/libbridge/libbridge_devif.c    2004-04-01
21:10:55.000000000 -0500
+++ bridge-utils/libbridge/libbridge_devif.c.orig       2002-01-16
07:04:45.000000000 -0500
@@ -56,7 +56,7 @@
        memcpy(ifr.ifr_name, br->ifname, IFNAMSIZ);
        ((unsigned long long *)(&ifr.ifr_data))[0] = (unsigned long
long)(unsigned long)args;
 
-       return ioctl(br_socket_fd, SIOCDEVPRIVATE, &ifr);
+       return ioctl(br_socket_fd, SIOCDEVPRIVATE + 3, &ifr);
 }
 #endif