Extending the ddb command set

2008-08-16 Thread Guillaume Ballet
Hello hackers,

I am currently working on a small project and would like to add a few
commands to the set that is available in ddb.

I found that very interesting albeit succinct presentation:
http://people.freebsd.org/~jhb/papers/bsdcan/2008/slides.odphttp://people.freebsd.org/%7Ejhb/papers/bsdcan/2008/slides.odp

where the author hints that I should use DB_COMMAND, which I did. Yet when
invoking ddb, the command does not appear in the help list. I have taken a
look at the source code and was expecting set_db_cmd_set to appear in my
module's section list when calling objdump -h

Is DB_COMMAND only working within the kernel itself, and not modules?

Guillaume
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Building custom kernel with new files

2008-08-16 Thread Ryan French
Hi All,

I am currently trying to build a custom kernel for my Google Summer of Code, 
and am running into a bit of a problem. I have all of my code compiling, but 
when I get to the linking stage as soon as it comes to the new files I have 
installed it says the *.o does not exist. I have added the files 
to /conf/files, and well as added the files to /conf/options and /conf/NOTES, 
and the option is set in my Makefile for the kernel. Is there another step I 
need to do before I can build the kernel?

Thanks for any help.

Ryan French.
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Building custom kernel with new files

2008-08-16 Thread Roman Divacky
On Sat, Aug 16, 2008 at 10:10:02PM +1200, Ryan French wrote:
 Hi All,
 
 I am currently trying to build a custom kernel for my Google Summer of Code, 
 and am running into a bit of a problem. I have all of my code compiling, but 
 when I get to the linking stage as soon as it comes to the new files I have 
 installed it says the *.o does not exist. I have added the files 
 to /conf/files, and well as added the files to /conf/options and /conf/NOTES, 
 and the option is set in my Makefile for the kernel. Is there another step I 
 need to do before I can build the kernel?

how do you build the kernel? adding to conf/files and conf/options should
be sufficient...
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Building custom kernel with new files

2008-08-16 Thread Attilio Rao
2008/8/16, Ryan French [EMAIL PROTECTED]:
 Hi All,

 I am currently trying to build a custom kernel for my Google Summer of Code,
 and am running into a bit of a problem. I have all of my code compiling, but
 when I get to the linking stage as soon as it comes to the new files I have
 installed it says the *.o does not exist. I have added the files
 to /conf/files, and well as added the files to /conf/options and /conf/NOTES,
 and the option is set in my Makefile for the kernel. Is there another step I
 need to do before I can build the kernel?

Ryan,
can you please past the error message?
More specifically, missing .o are about your newly included files or other?
This can happen, for example, if the consumer of a subsystem wants to
use it and the subsystem is not compiled (the stack(9) without STACK
option, for example).

Thanks,
Attilio


-- 
Peace can only be achieved by understanding - A. Einstein
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: startup options

2008-08-16 Thread Stefan Sperling
On Fri, Aug 15, 2008 at 02:52:21PM -0700, Sam Leffler wrote:
 Stefan Sperling wrote:
  That page pretty much summarises the state of affairs, yes.
 
  Basically, you need a VIA-based ethernet card card (vr driver)
  and -CURRENT, or a vr card with 7.0 and patches from here:
  http://www.stsp.name/wol/FreeBSD-8-CURRENT-wol-backported-to-7.0/
  All of those. Except the patch for pxe.c, that's there by accident.
 
  If you don't have a vr card, you will likely need to do some
  hacking. Follow the links from the wiki page for more information.
 

 trouble% cd sys/dev/
 trouble% grep -l IFCAP_WOL */*.c
 age/if_age.c
 jme/if_jme.c
 re/if_re.c
 stge/if_stge.c
 vr/if_vr.c
 
 So 5 drivers right now support WOL.  Jack said em had support a while 
 back but he seems to have not hooked it up.

Nice! I'll update the wiki page accordingly.

What's with if_sis? Isn't it in yet because my patch only
supports the NatSemi variant? (I have no idea whether the
other variants work alike or not.)

Stefan
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Extending the ddb command set

2008-08-16 Thread Sam Leffler

Guillaume Ballet wrote:

Hello hackers,

I am currently working on a small project and would like to add a few
commands to the set that is available in ddb.

I found that very interesting albeit succinct presentation:
http://people.freebsd.org/~jhb/papers/bsdcan/2008/slides.odphttp://people.freebsd.org/%7Ejhb/papers/bsdcan/2008/slides.odp

where the author hints that I should use DB_COMMAND, which I did. Yet when
invoking ddb, the command does not appear in the help list. I have taken a
look at the source code and was expecting set_db_cmd_set to appear in my
module's section list when calling objdump -h

Is DB_COMMAND only working within the kernel itself, and not modules?

  
That is correct; you can't add ddb cmds from modules.  It should be 
doable; just hasn't been done yet.


   Sam

___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


local network throughput issues

2008-08-16 Thread Rick C. Petty
Hello.  I've been having some serious network throughput issues recently.
Prior to these issues, I was running 7.0-STABLE from a few months back.  I
recently build a world/kernel from csup(1) on 2008-Jul-25 and started
noticing the issues.  I'm currently on a RELENG_7 from 2008-Aug-02 and am
building another one today.

The server is running samba, dnsmasq, an NFS server, and is the gateway for
a couple of freebsd machines.  I first noticed the issue when I was unable
to play mp3s served over samba.  I was getting a throughput of about 3
KBytes/sec over my gigabit switched network.  After a few weeks of trying
different versions of samba and watching tcpdump/trafshow, I decided to try
another test:

% ssh gateway cat /dev/zero | dd of=/dev/null
load: 0.00  cmd: dd 68286 [runnable] 0.00u 0.00s 0% 844k
3680+0 records in
3680+0 records out
1884160 bytes transferred in 512.856684 secs (3674 bytes/sec)
^C3680+0 records in
3680+0 records out
1884160 bytes transferred in 513.392858 secs (3670 bytes/sec)
Killed by signal 2.

Again, not even 4 KB/s throughput over ssh.  What's weird is that not all
network traffic is slow.  I'm able to download at almost my full DSL speed
(7168 Kbps) and here's the strange bit:  NFS is fast!  From the same
machine as above, I have an NFS mountpoint:

% dd if=/nfs/some_large_file of=/dev/null
55980+0 records in
55980+0 records out
28661760 bytes transferred in 0.147159 secs (194767476 bytes/sec)

Which is what I would expect for a gigabit network.  Even if I perform the
same test over ssh:

% ssh workstation cat /nfs/some_large_file | dd of=/dev/null
55980+0 records in
55980+0 records out
28661760 bytes transferred in 2.791392 secs (10267909 bytes/sec)

This is reasonable considering ssh overhead.  The kernel config for the
server contains:

include GENERIC
ident   DDB
options KDB
options KDB_TRACE
options DDB
options DDB_NUMSYM

My internal network is on 172.23.20.x and the DSL modem is connected to the
same NIC on 192.168.0.1:

# ifconfig nfe0
nfe0: flags=8843UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST metric 0 mtu 1500
options=10bRXCSUM,TXCSUM,VLAN_MTU,TSO4
ether 00:15:f2:17:0c:20
inet 172.23.20.1 netmask 0xff00 broadcast 172.23.20.255
inet 192.168.0.3 netmask 0xff00 broadcast 192.168.0.255
media: Ethernet autoselect (1000baseTX full-duplex,flag0,flag1)
status: active

# ipfw show
0010062968 8170100 allow ip from any to any via lo0
001100   0 deny ip from any to 127.0.0.0/8
001200   0 deny ip from 127.0.0.0/8 to any
00130 25444031 23419621364 divert 8668 ip from any to any via 192.168.0.3
001400   0 deny ip from not 172.23.20.0/24 to 172.23.20.0/24 
dst-port 137-149,445
00150 20639141 15067620538 allow tcp from any to any established
00160   21   10683 allow ip from any to any frag
0017079791 4696696 allow tcp from any to any setup
65530  5713367  8864760207 allow ip from any to any
655350   0 deny ip from any to any

Other than that, I'm not doing anything out of the ordinary.  Why is NFS
behaving correctly and why are ssh/smbd connections so slow?  I've pasted
my dmesg output below.  I've used this configuration for years and it
wasn't until a recent RELENG_7 upgrade that I've had any problems.  The box
was 99-100% idle during those tests and I don't see an interrupt storm or
anything funny like that.  Any ideas?

-- Rick C. Petty


From /var/run/dmesg.boot:


Copyright (c) 1992-2008 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 7.0-STABLE #5: Sat Aug  2 19:43:25 CDT 2008
[EMAIL PROTECTED]:/usr/obj/usr/src/sys/DDB
module_register: module sk/miibus already exists!
Module sk/miibus failed to register: 17
module_register: module skc/sk already exists!
Module skc/sk failed to register: 17
module_register: module pci/skc already exists!
Module pci/skc failed to register: 17
module_register: module rl/miibus already exists!
Module rl/miibus failed to register: 17
module_register: module cardbus/rl already exists!
Module cardbus/rl failed to register: 17
module_register: module pci/rl already exists!
Module pci/rl failed to register: 17
Timecounter i8254 frequency 1193182 Hz quality 0
CPU: AMD Athlon(tm) 64 X2 Dual Core Processor 4400+ (2211.34-MHz 686-class CPU)
  Origin = AuthenticAMD  Id = 0x20f32  Stepping = 2
  
Features=0x178bfbffFPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,MMX,FXSR,SSE,SSE2,HTT
  Features2=0x1SSE3
  AMD Features=0xe2500800SYSCALL,NX,MMX+,FFXSR,LM,3DNow!+,3DNow!
  AMD Features2=0x3LAHF,CMP
  Cores per package: 2
real memory  = 1073676288 (1023 MB)
avail memory = 1037037568 (988 MB)
ACPI APIC Table: Nvidia AWRDACPI
FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs
 cpu0 (BSP): APIC ID:  0
 

Re: local network throughput issues

2008-08-16 Thread Rick C. Petty
On Sat, Aug 16, 2008 at 10:31:31PM +0200, [EMAIL PROTECTED] wrote:
 
 i immediatly think dns issues if samba and ssh are slow. are your
 hosts reverse lookup-able?

Yes.  DNS problems usually affect the time to connect, and those are fast.
It's just the throughput I'm seeing a problem with.

In fact in each sshd_config, I have:

UseDNS no

In dnsmasq, I have each host listed in /etc/hosts which is used by dnsmasq
for forward and reverse DNS.  No this problem started when I updated the OS
on my gateway.

-- Rick C. Petty
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Building custom kernel with new files

2008-08-16 Thread Ryan French
On Sat, 16 Aug 2008 10:33:09 pm you wrote:
 On Sat, Aug 16, 2008 at 10:10:02PM +1200, Ryan French wrote:
  Hi All,
 
  I am currently trying to build a custom kernel for my Google Summer of
  Code, and am running into a bit of a problem. I have all of my code
  compiling, but when I get to the linking stage as soon as it comes to the
  new files I have installed it says the *.o does not exist. I have added
  the files to /conf/files, and well as added the files to /conf/options
  and /conf/NOTES, and the option is set in my Makefile for the kernel. Is
  there another step I need to do before I can build the kernel?

 how do you build the kernel? adding to conf/files and conf/options should
 be sufficient...

I build the file using

make buildkernel KERNCONF=MPLSKERNEL

while in the /usr/src/ directory.
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: local network throughput issues

2008-08-16 Thread usleepless
On 8/16/08, Rick C. Petty [EMAIL PROTECTED] wrote:
 Hello.  I've been having some serious network throughput issues recently.
  Prior to these issues, I was running 7.0-STABLE from a few months back.  I
  recently build a world/kernel from csup(1) on 2008-Jul-25 and started
  noticing the issues.  I'm currently on a RELENG_7 from 2008-Aug-02 and am
  building another one today.

  The server is running samba, dnsmasq, an NFS server, and is the gateway for
  a couple of freebsd machines.  I first noticed the issue when I was unable
  to play mp3s served over samba.  I was getting a throughput of about 3
  KBytes/sec over my gigabit switched network.  After a few weeks of trying
  different versions of samba and watching tcpdump/trafshow, I decided to try
  another test:

  % ssh gateway cat /dev/zero | dd of=/dev/null
  load: 0.00  cmd: dd 68286 [runnable] 0.00u 0.00s 0% 844k
  3680+0 records in
  3680+0 records out
  1884160 bytes transferred in 512.856684 secs (3674 bytes/sec)
  ^C3680+0 records in
  3680+0 records out
  1884160 bytes transferred in 513.392858 secs (3670 bytes/sec)
  Killed by signal 2.

  Again, not even 4 KB/s throughput over ssh.  What's weird is that not all
  network traffic is slow.  I'm able to download at almost my full DSL speed
  (7168 Kbps) and here's the strange bit:  NFS is fast!  From the same
  machine as above, I have an NFS mountpoint:

  % dd if=/nfs/some_large_file of=/dev/null
  55980+0 records in
  55980+0 records out
  28661760 bytes transferred in 0.147159 secs (194767476 bytes/sec)

  Which is what I would expect for a gigabit network.  Even if I perform the
  same test over ssh:

  % ssh workstation cat /nfs/some_large_file | dd of=/dev/null
  55980+0 records in
  55980+0 records out
  28661760 bytes transferred in 2.791392 secs (10267909 bytes/sec)

  This is reasonable considering ssh overhead.  The kernel config for the
  server contains:

  include GENERIC
  ident   DDB
  options KDB
  options KDB_TRACE
  options DDB
  options DDB_NUMSYM

  My internal network is on 172.23.20.x and the DSL modem is connected to the
  same NIC on 192.168.0.1:

  # ifconfig nfe0
  nfe0: flags=8843UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST metric 0 mtu 1500
 options=10bRXCSUM,TXCSUM,VLAN_MTU,TSO4
 ether 00:15:f2:17:0c:20
 inet 172.23.20.1 netmask 0xff00 broadcast 172.23.20.255
 inet 192.168.0.3 netmask 0xff00 broadcast 192.168.0.255
 media: Ethernet autoselect (1000baseTX full-duplex,flag0,flag1)
 status: active

  # ipfw show
  0010062968 8170100 allow ip from any to any via lo0
  001100   0 deny ip from any to 127.0.0.0/8
  001200   0 deny ip from 127.0.0.0/8 to any
  00130 25444031 23419621364 divert 8668 ip from any to any via 192.168.0.3
  001400   0 deny ip from not 172.23.20.0/24 to 172.23.20.0/24 
 dst-port 137-149,445
  00150 20639141 15067620538 allow tcp from any to any established
  00160   21   10683 allow ip from any to any frag
  0017079791 4696696 allow tcp from any to any setup
  65530  5713367  8864760207 allow ip from any to any
  655350   0 deny ip from any to any

  Other than that, I'm not doing anything out of the ordinary.  Why is NFS
  behaving correctly and why are ssh/smbd connections so slow?  I've pasted
  my dmesg output below.  I've used this configuration for years and it
  wasn't until a recent RELENG_7 upgrade that I've had any problems.  The box
  was 99-100% idle during those tests and I don't see an interrupt storm or
  anything funny like that.  Any ideas?

  -- Rick C. Petty


  From /var/run/dmesg.boot:


  Copyright (c) 1992-2008 The FreeBSD Project.
  Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
 The Regents of the University of California. All rights reserved.
  FreeBSD is a registered trademark of The FreeBSD Foundation.
  FreeBSD 7.0-STABLE #5: Sat Aug  2 19:43:25 CDT 2008
 [EMAIL PROTECTED]:/usr/obj/usr/src/sys/DDB
  module_register: module sk/miibus already exists!
  Module sk/miibus failed to register: 17
  module_register: module skc/sk already exists!
  Module skc/sk failed to register: 17
  module_register: module pci/skc already exists!
  Module pci/skc failed to register: 17
  module_register: module rl/miibus already exists!
  Module rl/miibus failed to register: 17
  module_register: module cardbus/rl already exists!
  Module cardbus/rl failed to register: 17
  module_register: module pci/rl already exists!
  Module pci/rl failed to register: 17
  Timecounter i8254 frequency 1193182 Hz quality 0
  CPU: AMD Athlon(tm) 64 X2 Dual Core Processor 4400+ (2211.34-MHz 686-class 
 CPU)
   Origin = AuthenticAMD  Id = 0x20f32  Stepping = 2
   
 Features=0x178bfbffFPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,MMX,FXSR,SSE,SSE2,HTT
   Features2=0x1SSE3
   AMD Features=0xe2500800SYSCALL,NX,MMX+,FFXSR,LM,3DNow!+,3DNow!
  

Re: Building custom kernel with new files

2008-08-16 Thread Ryan French
On Sat, 16 Aug 2008 10:38:24 pm you wrote:
 2008/8/16, Ryan French [EMAIL PROTECTED]:
  Hi All,
 
  I am currently trying to build a custom kernel for my Google Summer of
  Code, and am running into a bit of a problem. I have all of my code
  compiling, but when I get to the linking stage as soon as it comes to the
  new files I have installed it says the *.o does not exist. I have added
  the files to /conf/files, and well as added the files to /conf/options
  and /conf/NOTES, and the option is set in my Makefile for the kernel. Is
  there another step I need to do before I can build the kernel?

 Ryan,
 can you please past the error message?
 More specifically, missing .o are about your newly included files or other?
 This can happen, for example, if the consumer of a subsystem wants to
 use it and the subsystem is not compiled (the stack(9) without STACK
 option, for example).

 Thanks,
 Attilio

The missing .o is about my own files that I have included in the kernel. More 
specifically I have a file 'mpls.h' and as it is the first one in the 
directory as soon as it gets to linking the file I get the error

ld: mpls.o: No such file: No such file or directory
*** Error code 1

This occurs right after the command 

MAKE=make sh /usr/src/sys/conf/newvers.sh MPLSKERNEL

Sorry I cant copy the whole error but I am running the development in a VM and 
I cant copy and paste between the VM and my host machine.
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Building custom kernel with new files

2008-08-16 Thread Attilio Rao
2008/8/16, Ryan French [EMAIL PROTECTED]:
 On Sat, 16 Aug 2008 10:38:24 pm you wrote:
  2008/8/16, Ryan French [EMAIL PROTECTED]:
   Hi All,
  
   I am currently trying to build a custom kernel for my Google Summer of
   Code, and am running into a bit of a problem. I have all of my code
   compiling, but when I get to the linking stage as soon as it comes to the
   new files I have installed it says the *.o does not exist. I have added
   the files to /conf/files, and well as added the files to /conf/options
   and /conf/NOTES, and the option is set in my Makefile for the kernel. Is
   there another step I need to do before I can build the kernel?
 
  Ryan,
  can you please past the error message?
  More specifically, missing .o are about your newly included files or other?
  This can happen, for example, if the consumer of a subsystem wants to
  use it and the subsystem is not compiled (the stack(9) without STACK
  option, for example).
 
  Thanks,
  Attilio

 The missing .o is about my own files that I have included in the kernel. More
 specifically I have a file 'mpls.h' and as it is the first one in the
 directory as soon as it gets to linking the file I get the error

 ld: mpls.o: No such file: No such file or directory
 *** Error code 1

 This occurs right after the command

 MAKE=make sh /usr/src/sys/conf/newvers.sh MPLSKERNEL

 Sorry I cant copy the whole error but I am running the development in a VM and
 I cant copy and paste between the VM and my host machine.

Can you please paste your diff against src/sys/conf/files* ?

Thanks,
Attilio


-- 
Peace can only be achieved by understanding - A. Einstein
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: local network throughput issues

2008-08-16 Thread Jeremy Chadwick
On Sat, Aug 16, 2008 at 02:43:11PM -0500, Rick C. Petty wrote:
 Hello.  I've been having some serious network throughput issues recently.
 Prior to these issues, I was running 7.0-STABLE from a few months back.  I
 recently build a world/kernel from csup(1) on 2008-Jul-25 and started
 noticing the issues.  I'm currently on a RELENG_7 from 2008-Aug-02 and am
 building another one today.
 
 The server is running samba, dnsmasq, an NFS server, and is the gateway for
 a couple of freebsd machines.  I first noticed the issue when I was unable
 to play mp3s served over samba.  I was getting a throughput of about 3
 KBytes/sec over my gigabit switched network.  After a few weeks of trying
 different versions of samba and watching tcpdump/trafshow, I decided to try
 another test:
 
 % ssh gateway cat /dev/zero | dd of=/dev/null
 load: 0.00  cmd: dd 68286 [runnable] 0.00u 0.00s 0% 844k
 3680+0 records in
 3680+0 records out
 1884160 bytes transferred in 512.856684 secs (3674 bytes/sec)
 ^C3680+0 records in
 3680+0 records out
 1884160 bytes transferred in 513.392858 secs (3670 bytes/sec)
 Killed by signal 2.
 
 Again, not even 4 KB/s throughput over ssh.  What's weird is that not all
 network traffic is slow.  I'm able to download at almost my full DSL speed
 (7168 Kbps) and here's the strange bit:  NFS is fast!  From the same
 machine as above, I have an NFS mountpoint:
 
 % dd if=/nfs/some_large_file of=/dev/null
 55980+0 records in
 55980+0 records out
 28661760 bytes transferred in 0.147159 secs (194767476 bytes/sec)
 
 Which is what I would expect for a gigabit network.  Even if I perform the
 same test over ssh:
 
 % ssh workstation cat /nfs/some_large_file | dd of=/dev/null
 55980+0 records in
 55980+0 records out
 28661760 bytes transferred in 2.791392 secs (10267909 bytes/sec)
 
 This is reasonable considering ssh overhead.  The kernel config for the
 server contains:
 
 include GENERIC
 ident   DDB
 options KDB
 options KDB_TRACE
 options DDB
 options DDB_NUMSYM
 
 My internal network is on 172.23.20.x and the DSL modem is connected to the
 same NIC on 192.168.0.1:
 
 # ifconfig nfe0
 nfe0: flags=8843UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST metric 0 mtu 1500
 options=10bRXCSUM,TXCSUM,VLAN_MTU,TSO4
 ether 00:15:f2:17:0c:20
 inet 172.23.20.1 netmask 0xff00 broadcast 172.23.20.255
 inet 192.168.0.3 netmask 0xff00 broadcast 192.168.0.255
 media: Ethernet autoselect (1000baseTX full-duplex,flag0,flag1)
 status: active
 
 # ipfw show
 0010062968 8170100 allow ip from any to any via lo0
 001100   0 deny ip from any to 127.0.0.0/8
 001200   0 deny ip from 127.0.0.0/8 to any
 00130 25444031 23419621364 divert 8668 ip from any to any via 192.168.0.3
 001400   0 deny ip from not 172.23.20.0/24 to 172.23.20.0/24 
 dst-port 137-149,445
 00150 20639141 15067620538 allow tcp from any to any established
 00160   21   10683 allow ip from any to any frag
 0017079791 4696696 allow tcp from any to any setup
 65530  5713367  8864760207 allow ip from any to any
 655350   0 deny ip from any to any
 
 Other than that, I'm not doing anything out of the ordinary.  Why is NFS
 behaving correctly and why are ssh/smbd connections so slow?  I've pasted
 my dmesg output below.  I've used this configuration for years and it
 wasn't until a recent RELENG_7 upgrade that I've had any problems.  The box
 was 99-100% idle during those tests and I don't see an interrupt storm or
 anything funny like that.  Any ideas?

1) Please provide netstat -in output.

2) NFS (unless you're explicitly disabling it) is UDP-based, while SSH
and Samba are TCP-based.  Your nfe0 device has TSO4 enabled on it, so
I'm left wondering if the TCP offloading support for your nfe(4) device
is broken.

Can you try disabling it by adding -tso to your ifconfig_nfe0 line in
/etc/rc.conf?  If you're using DHCP on that interface, that may pose
somewhat of a problem.

3) Can you disable the firewall (disable ipfw entirely) and see if the
problem continues?

-- 
| Jeremy Chadwickjdc at parodius.com |
| Parodius Networking   http://www.parodius.com/ |
| UNIX Systems Administrator  Mountain View, CA, USA |
| Making life hard for others since 1977.  PGP: 4BD6C0CB |

___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: local network throughput issues

2008-08-16 Thread Rick C. Petty
On Sat, Aug 16, 2008 at 03:15:35PM -0700, Jeremy Chadwick wrote:
 
 1) Please provide netstat -in output.

NameMtu Network   Address  Ipkts IerrsOpkts Oerrs  Coll
nfe0   1500 Link#1  00:15:f2:17:0c:20 14714298 0 14821857 0 0
nfe0   1500 172.23.20.0/2 172.23.20.12144815 - 12438012 - -
nfe0   1500 192.168.0.0/2 192.168.0.39502416 -  2357751 - -
lo0   16384 Link#2   31707 031707 0 0
lo0   16384 fe80:2::1/64  fe80:2::10 -0 - -
lo0   16384 ::1/128   ::1  6 -6 - -
lo0   16384 127.0.0.0/8   127.0.0.131588 -31588 - -
tun11  1500 Link#3  985877 0   890589 0 0
tun11  1500 172.23.23.20/ 172.23.23.20714240 -   713237 - -
tun0   1500 Link#4   22456 021872 0 0
tun0   1500 172.16.1.0/32 172.16.1.0   0 -0 - -

 2) NFS (unless you're explicitly disabling it) is UDP-based, while SSH
 and Samba are TCP-based.  Your nfe0 device has TSO4 enabled on it, so
 I'm left wondering if the TCP offloading support for your nfe(4) device
 is broken.
 
 Can you try disabling it by adding -tso to your ifconfig_nfe0 line in
 /etc/rc.conf?  If you're using DHCP on that interface, that may pose
 somewhat of a problem.

Yes, that seems to have made all the difference in the world:

% ssh gateway cat /dev/zero | dd of=/dev/null
load: 0.08  cmd: ssh 68698 [runnable] 1.20u 0.25s 11% 3020k
94384+0 records in
94384+0 records out
48324608 bytes transferred in 5.314707 secs (9092619 bytes/sec)
load: 0.08  cmd: ssh 68698 [runnable] 1.81u 0.33s 15% 3020k
147664+0 records in
147664+0 records out
75603968 bytes transferred in 7.652768 secs (9879297 bytes/sec)

So I'm thinking TSO wasn't an option in the older 7-stable I was running
and now it is, but the support for it is broken.

Your comment about DHCP, would that affect dhcpd or dhclient?  This is my
server machine so I don't run dhclient on it.  I hardcode the IP
connecting to the DSL modem.  I'm currently hardcoding all the other
machines also so I should be okay.

 3) Can you disable the firewall (disable ipfw entirely) and see if the
 problem continues?

Well the firewall is primarily for NAT and port forwarding.  There's
nothing special about it.  It looks like the TSO disabling fixed my
problems.  Thank you for the suggestion!

-- Rick C. Petty
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: local network throughput issues

2008-08-16 Thread Jeremy Chadwick
On Sat, Aug 16, 2008 at 05:28:31PM -0500, Rick C. Petty wrote:
  2) NFS (unless you're explicitly disabling it) is UDP-based, while SSH
  and Samba are TCP-based.  Your nfe0 device has TSO4 enabled on it, so
  I'm left wondering if the TCP offloading support for your nfe(4) device
  is broken.
  
  Can you try disabling it by adding -tso to your ifconfig_nfe0 line in
  /etc/rc.conf?  If you're using DHCP on that interface, that may pose
  somewhat of a problem.
 
 Yes, that seems to have made all the difference in the world:
 
 % ssh gateway cat /dev/zero | dd of=/dev/null
 load: 0.08  cmd: ssh 68698 [runnable] 1.20u 0.25s 11% 3020k
 94384+0 records in
 94384+0 records out
 48324608 bytes transferred in 5.314707 secs (9092619 bytes/sec)
 load: 0.08  cmd: ssh 68698 [runnable] 1.81u 0.33s 15% 3020k
 147664+0 records in
 147664+0 records out
 75603968 bytes transferred in 7.652768 secs (9879297 bytes/sec)
 
 So I'm thinking TSO wasn't an option in the older 7-stable I was running
 and now it is, but the support for it is broken.

TSO support is something that's implemented in each network driver.  TSO
in nfe(4) was commited to HEAD (CURRENT) on June 12th 2007.  See
revision 1.17 below:

http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/dev/nfe/if_nfe.c

That would have been what is now considered RELENG_7 (since FreeBSD
7.0-RELEASE was announced and made available on February 27th, 2008).

I'm under the impression that TSO was available/enabled for you before,
but I'm not sure because there's not a lot of historic data available
here.  I don't know why/how it broke, or what has changed.

I've CC'd one of the nfe(4) maintainers, PYUN Yong-Hyeon, who should be
able to help determine what's going on.  Yong-Hyeon, his dmesg output is
available here, but you'll probably need more than that:

http://lists.freebsd.org/pipermail/freebsd-hackers/2008-August/025706.html

 Your comment about DHCP, would that affect dhcpd or dhclient?  This is my
 server machine so I don't run dhclient on it.  I hardcode the IP
 connecting to the DSL modem.  I'm currently hardcoding all the other
 machines also so I should be okay.

My comment about DHCP is WRT to the FreeBSD box acting as a DHCP client
(e.g. fetching an IP from your ISP).  I believe dhclient (when getting a
new IP) might override any interface options you set in rc.conf; purely
speculative on my part, but I wanted to mention it in the case you
didn't have a static IP configured in rc.conf.

  3) Can you disable the firewall (disable ipfw entirely) and see if the
  problem continues?
 
 Well the firewall is primarily for NAT and port forwarding.  There's
 nothing special about it.  It looks like the TSO disabling fixed my
 problems.  Thank you for the suggestion!

No problem.

-- 
| Jeremy Chadwickjdc at parodius.com |
| Parodius Networking   http://www.parodius.com/ |
| UNIX Systems Administrator  Mountain View, CA, USA |
| Making life hard for others since 1977.  PGP: 4BD6C0CB |

___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]