Ephemeral port selection (patch)

2008-02-25 Thread Fernando Gont

Folks,

This patch simply eliminates duplicated code in the in_pcb_bind() function.

Index: in_pcb.c
===
RCS file: /home/ncvs/src/sys/netinet/in_pcb.c,v
retrieving revision 1.198
diff -u -r1.198 in_pcb.c
--- in_pcb.c22 Dec 2007 10:06:11 -  1.198
+++ in_pcb.c25 Feb 2008 06:10:04 -
@@ -393,7 +393,7 @@
if (*lportp != 0)
lport = *lportp;
if (lport == 0) {
-   u_short first, last;
+   u_short first, last, aux;
int count;

if (laddr.s_addr != INADDR_ANY)
@@ -440,47 +440,28 @@
/*
 * Simple check to ensure all ports are not used up causing
 * a deadlock here.
-*
-* We split the two cases (up and down) so that the direction
-* is not being tested on each round of the loop.
 */
if (first > last) {
-   /*
-* counting down
-*/
-   if (dorandom)
-   *lastport = first -
-   (arc4random() % (first - last));
-   count = first - last;
-
-   do {
-   if (count-- < 0)/* completely used? */
-   return (EADDRNOTAVAIL);
-   --*lastport;
-   if (*lastport > first || *lastport < last)
-   *lastport = first;
-   lport = htons(*lastport);
-   } while (in_pcblookup_local(pcbinfo, laddr, lport,
-   wild));
-   } else {
-   /*
-* counting up
-*/
-   if (dorandom)
-   *lastport = first +
-   (arc4random() % (last - first));
-   count = last - first;
-
-   do {
-   if (count-- < 0)/* completely used? */
-   return (EADDRNOTAVAIL);
-   ++*lastport;
-   if (*lastport < first || *lastport > last)
-   *lastport = first;
-   lport = htons(*lastport);
-   } while (in_pcblookup_local(pcbinfo, laddr, lport,
-   wild));
+   aux = first;
+   first = last;
+   last = aux;
}
+
+   if (dorandom)
+   *lastport = first +
+   (arc4random() % (last - first));
+
+   count = last - first;
+
+   do {
+   if (count-- < 0)/* completely used? */
+   return (EADDRNOTAVAIL);
+   ++*lastport;
+   if (*lastport < first || *lastport > last)
+   *lastport = first;
+   lport = htons(*lastport);
+   } while (in_pcblookup_local(pcbinfo, laddr, lport,
+   wild));
}
if (prison_ip(cred, 0, &laddr.s_addr))
return (EINVAL);


--
Fernando Gont
e-mail: [EMAIL PROTECTED] || [EMAIL PROTECTED]
PGP Fingerprint: 7809 84F5 322E 45C7 F1C9 3945 96EE A9EF D076 FFF1




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


vlan issues with 7.0-RC3

2008-02-25 Thread Christopher Cowart
Hello,

I have a mac mini running 7.0-RC3, which I'm trying to turn it into a
router. I have a Linksys SRW2008 "fully managed" (via an IE only web
interface, ick) switch. 

Switch:
  Port 1 - Trunk vlans 10,60,98 - FreeBSD Box
  Port 7 - Access vlan 98 - Existing LAN (192.168.1.0/24)

OpenWRT (192.168.1.1):
  WRT54G box on the Existing LAN

FreeBSD Box:
  ifconfig msk0 up
  ifconfig vlan98 create vlan 98 vlandev msk0 inet 192.168.1.67/24

With this configuration, I can ping hosts on the other lan segment (Port
7). Arp and icmp seem to be quite happy. Unfortunately, I'm not having
any luck with tcp and udp. Any attempt to ssh to OpenWRT or dig
@OpenWRT hangs indefinitely. If I do a tcpdump, I see the SYN or A?
leaving and absolutely no response returning. If I run a tcpdump on
OpenWRT, I see no incoming traffic.

When I try to connect *to* the FreeBSD box from the other lan segment, I
continue to have problems. tcpdump shows the SYNs arriving via vlan98
and the FreeBSD box responding with SYN-ACK. OpenWRT receives the SYNACK.

I disabled ipfw just to be sure (sysctl -w net.inet.ip.fw.enable=0), but
it had no effect on the problem. If I connect the FreeBSD box to a vlan
98 access port and assign the address to msk0, my connectivity problems
go away. This leads me to believe that the firewall on OpenWRT is not
the problem and the problem is related to vlans.

Thinking it was a problem with the not-so-cheap Linksys POS (bitterness
about the IE web interface again), I plugged my MacBook (running
Leopard, not FreeBSD) into the trunk port. Running the ifconfig commands
above (s/msk0/en0/), I got up and running without any problems. This
causes me to suspect the FreeBSD box.

Does anyone have any idea what's going on here? Any suggestions for
further troubleshooting?

Thanks,

-- 
Chris Cowart
Network Technical Lead
Network & Infrastructure Services, RSSP-IT
UC Berkeley


pgpguNiR91bhu.pgp
Description: PGP signature


Capturing dmesg upon system crash on 6.3

2008-02-25 Thread Yehonatan Yossef
Hello,
 
I'm a freebsd newbee, trying to port an ethernet driver from Linux to
FreeBSD 6.3.
I'm facing a system reboot upon loading of the driver, and I could use a
tool for capturing dmesg upon system crash (such as netconsole on
Linux).
 
Can anyone link me to an appropriate tool?
Sorry for sending this to three mailing lists, but I don't really know
which one is active and relevant to this question.
 
 
Cheers,
 
Yehonatan Yossef
Mellanox Technologies INC
Office: +972-4-9097200 ext. 301 
Cell: +972-54-2345031 ([EMAIL PROTECTED]  )
 
___
freebsd-net@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Current problem reports assigned to freebsd-net@FreeBSD.org

2008-02-25 Thread FreeBSD bugmaster
Current FreeBSD problem reports
Critical problems
Serious problems

S Tracker  Resp.  Description

a kern/38554   netchanging interface ipaddress doesn't seem to work
s kern/39937   netipstealth issue
f kern/62374   netpanic: free: multiple frees
s kern/81147   net[net] [patch] em0 reinitialization while adding aliase
o kern/92552   netA serious bug in most network drivers from 5.X to 6.X 
s kern/95665   net[if_tun] "ping: sendto: No buffer space available" wit
s kern/105943  netNetwork stack may modify read-only mbuf chain copies
o kern/106316  net[dummynet] dummynet with multipass ipfw drops packets 
o kern/108542  net[bce]: Huge network latencies with 6.2-RELEASE / STABL
o kern/112528  net[nfs] NFS over TCP under load hangs with "impossible p
o kern/112686  net[patm] patm driver freezes System (FreeBSD 6.2-p4) i38
o kern/112722  net[udp] IP v4 udp fragmented packet reject
o kern/113457  net[ipv6] deadlock occurs if a tunnel goes down while the
o kern/113842  net[ipv6] PF_INET6 proto domain state can't be cleared wi
o kern/114714  net[gre][patch] gre(4) is not MPSAFE and does not support
o kern/114839  net[fxp] fxp looses ability to speak with traffic
o kern/115239  net[ipnat] panic with 'kmem_map too small' using ipnat
o kern/116077  net[ip] [patch] 6.2-STABLE panic during use of multi-cast
o kern/116172  net[tun] [panic] Network / ipv6 recursive mutex panic
o kern/116185  net[iwi] if_iwi driver leads system to reboot
o kern/116328  net[bge]: Solid hang with bge interface
o kern/116747  net[ndis] FreeBSD 7.0-CURRENT crash with Dell TrueMobile 
o kern/116837  net[tun] [panic] [patch] ifconfig tunX destroy: panic
o kern/117043  net[em] Intel PWLA8492MT Dual-Port Network adapter EEPROM
o kern/117271  net[tap] OpenVPN TAP uses 99% CPU on releng_6 when if_tap
o kern/117423  net[vlan] Duplicate IP on different interfaces
o kern/117448  net[carp] 6.2 kernel crash (regression)
o kern/118880  net[ipv6] IP_RECVDSTADDR & IP_SENDSRCADDR not implemented
o kern/119225  net[wi] 7.0-RC1 no carrier with Prism 2.5 wifi card (regr
o kern/119345  net[ath] Unsuported Atheros 5424/2424 and CPU speedstep n
o kern/119361  net[bge] bge(4) transmit performance problem
o kern/119548  net[pf] [ath] [patch] PF Altq with ath hostap problem
o kern/119945  net[rum] [panic] rum device in hostap mode, cause kernel 
o kern/120130  net[carp] [panic] carp causes kernel panics in any conste
o kern/120266  net[panic] gnugk causes kernel panic when closing UDP soc
o kern/120304  net[netgraph] [patch] netgraph source assumes 32-bit time
f kern/120725  net[bce] On board second lan port 'bce1' with Broadcom Ne
f kern/120966  net[rum]: kernel panic with if_rum and WPA encryption
o kern/121063  net[ath]: High wireless traffic on ATH causes high tx fai

39 problems total.

Non-critical problems

S Tracker  Resp.  Description

o conf/23063   net[PATCH] for static ARP tables in rc.network
s bin/41647netifconfig(8) doesn't accept lladdr along with inet addr
o kern/54383   net[nfs] [patch] NFS root configurations without dynamic 
s kern/60293   netFreeBSD arp poison patch
o kern/64556   net[sis] if_sis short cable fix problems with NetGear FA3
o kern/95267   netpacket drops periodically appear
f kern/95277   net[netinet] [patch] IP Encapsulation mask_match() return
o kern/100519  net[netisr] suggestion to fix suboptimal network polling
o kern/102035  net[plip] plip networking disables parallel port printing
o conf/102502  net[patch] ifconfig name does't rename netgraph node in n
o conf/107035  net[patch] bridge interface given in rc.conf not taking a
o kern/109470  net[wi] Orinoco Classic Gold PC Card Can't Channel Hop
o kern/112179  net[sis] [patch] sis driver for natsemi DP83815D autonego
o kern/114915  net[patch] [pcn] pcn (sys/pci/if_pcn.c) ethernet driver f
o bin/116643   net[patch] [request] fstat(1): add INET/INET6 socket deta
o bin/117339   net[patch] route(8): loading routing management commands 
o kern/118727  net[ng] [patch] [request] add new ng_pf module
a kern/118879  net[bge] [patch] bge has checksum problems on the 5703 ch
o kern/118975  net[bge] [patch] Broadcom 5906 not handled by FreeBSD
o bin/118987   netifconfig(8): ifconfig -l (address_family) does not wor
o kern/119432  net[arp] route add -host  -iface  causes arp e
o kern/119617  net[nfs] nfs error on wpa network when reseti

Re: Capturing dmesg upon system crash on 6.3

2008-02-25 Thread Eygene Ryabinkin
Yehonatan, good day.

Mon, Feb 25, 2008 at 11:28:12AM +0200, Yehonatan Yossef wrote:
> I'm a freebsd newbee, trying to port an ethernet driver from Linux to
> FreeBSD 6.3.
> I'm facing a system reboot upon loading of the driver, and I could use a
> tool for capturing dmesg upon system crash (such as netconsole on
> Linux).

May be serial console will help you?
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/serialconsole-setup.html

Out of curiosity: are you porting some InfiniBand drivers to FreeBSD?
-- 
Eygene
___
freebsd-net@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


RE: Capturing dmesg upon system crash on 6.3

2008-02-25 Thread Yehonatan Yossef
I'm looking into the syslogd capabilities at the moment, it might be
enough.
I've tried following the serial console setup you've pointed, but when I
added the 'console="comconsole"' to loader.conf the OS hanged during
boot time, had to re-install the system.

I'm currently porting Mellanox ethernet driver, InfiniBand will be
probably next. Mail me outside this list if you're interested in
InfiniBand.

Yehonatan Yossef
Mellanox Technologies INC
Office: +972-4-9097200 ext. 301 
Cell: +972-54-2345031 ([EMAIL PROTECTED])
 

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> Sent: Monday, February 25, 2008 3:29 PM
> To: Yehonatan Yossef
> Cc: [EMAIL PROTECTED]; freebsd-net@freebsd.org; 
> [EMAIL PROTECTED]
> Subject: Re: Capturing dmesg upon system crash on 6.3
> 
> Yehonatan, good day.
> 
> Mon, Feb 25, 2008 at 11:28:12AM +0200, Yehonatan Yossef wrote:
> > I'm a freebsd newbee, trying to port an ethernet driver 
> from Linux to 
> > FreeBSD 6.3.
> > I'm facing a system reboot upon loading of the driver, and 
> I could use 
> > a tool for capturing dmesg upon system crash (such as netconsole on 
> > Linux).
> 
> May be serial console will help you?
> http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/seri
> alconsole-setup.html
> 
> Out of curiosity: are you porting some InfiniBand drivers to FreeBSD?
> --
> Eygene
> 
___
freebsd-net@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: FBSD 1GBit router?

2008-02-25 Thread Daniel Dias Gonçalves

Bc. Radek Krejca escreveu:

Hi,

ZB> - upgrade at least to 6.3.  upgrading to 7.0 might also be better, depending
ZB> on hardware choices
ZB> - ensure your ethernet cards are on fast enough busses.  'em' (Intel Ether
ZB> Express 1000) flavor ports are my personal favorite
ZB> - enable polling (this will make a _huge_ difference by itself)
ZB> - your hardware is (likely) dual core.  Make sure every piece of hardware in
ZB> use doesn't involve any giant locks.  Under 6.x consider the mpsafenet
ZB> sysctl.  This is also a point on which 7.0 will shine.

I upgrade to 7.0RC3 but still the same. 418Mbit is the roof.

  
Is recommendable set MPSAFENET to 1 in versions 6.x to improve the 
performance?

and POLLING in the following system with 8 interfaces IF_EM ??

CPU: Intel(R) Xeon(TM) CPU 3.20GHz (3200.13-MHz 686-class CPU)
Logical CPUs per core: 2
FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs
SMP: AP CPU #1 Launched!

Interfaces if_em:
  vendor = 'Intel Corporation'
  device = '82546EB Dual Port Gigabit Ethernet Controller'

--
Daniel

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


Re: Capturing dmesg upon system crash on 6.3

2008-02-25 Thread Eygene Ryabinkin
Mon, Feb 25, 2008 at 03:41:03PM +0200, Yehonatan Yossef wrote:
> I'm looking into the syslogd capabilities at the moment, it might be
> enough.

Syslog can die too early to spot everything.  But your mileage may vary.

> I've tried following the serial console setup you've pointed, but when I
> added the 'console="comconsole"' to loader.conf the OS hanged during
> boot time, had to re-install the system.

You mean that nothing were seen on the other end of the serial cable?
I had not used serial console in FreeBSD for a while, so maybe others
can tell if the Handbook is still correct?

And if the only change that was made to make the OS hang was the
change in the loader.conf, then you could just use LiveFS CD and
edit loader.conf at your system -- there is no point in wasting
time reinstalling the whole system.
-- 
Eygene
___
freebsd-net@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: FBSD 1GBit router?

2008-02-25 Thread Ingo Flaschberger

Hi,

ZB> - upgrade at least to 6.3.  upgrading to 7.0 might also be better, 
depending

ZB> on hardware choices
ZB> - ensure your ethernet cards are on fast enough busses.  'em' (Intel 
Ether

ZB> Express 1000) flavor ports are my personal favorite
ZB> - enable polling (this will make a _huge_ difference by itself)
ZB> - your hardware is (likely) dual core.  Make sure every piece of 
hardware in

ZB> use doesn't involve any giant locks.  Under 6.x consider the mpsafenet
ZB> sysctl.  This is also a point on which 7.0 will shine.

I upgrade to 7.0RC3 but still the same. 418Mbit is the roof.


older fbsd's are faster than newer.

How are the nic's connected to the cpu?

lspci -v

Kind regards,
Ingo Flaschberger

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


Re: kern/121063: [ath]: High wireless traffic on ATH causes high tx failed 'cuz FIFO underrun

2008-02-25 Thread sam
Synopsis: [ath]: High wireless traffic on ATH causes high tx failed 'cuz FIFO 
underrun

Responsible-Changed-From-To: freebsd-net->sam
Responsible-Changed-By: sam
Responsible-Changed-When: Mon Feb 25 17:18:49 UTC 2008
Responsible-Changed-Why: 
assign to the correct person

http://www.freebsd.org/cgi/query-pr.cgi?pr=121063
___
freebsd-net@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: kern/121061: [ath] [panic] panic while ejecting ath(4)-adapter during shutdown

2008-02-25 Thread sam
Synopsis: [ath] [panic] panic while ejecting ath(4)-adapter during shutdown

Responsible-Changed-From-To: freebsd-net->sam
Responsible-Changed-By: sam
Responsible-Changed-When: Mon Feb 25 17:19:23 UTC 2008
Responsible-Changed-Why: 
assign to the correct person

http://www.freebsd.org/cgi/query-pr.cgi?pr=121061
___
freebsd-net@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Capturing dmesg upon system crash on 6.3

2008-02-25 Thread Dieter
> I'm looking into the syslogd capabilities at the moment, it might be
> enough.
> I've tried following the serial console setup you've pointed, but when I
> added the 'console=3D"comconsole"' to loader.conf the OS hanged during
> boot time, had to re-install the system.

I assume the info you need is not getting captured in /var/log?

Perhaps your system needs a firmware setting changed to use a RS-232 console?

I assume it is not waiting for a control line, e.g. carrier detect, to go high?

Some systems have buggy firmware and still read from the ps2 keyboard
even though they are printing to the RS-232 console.

If all else fails there is the aim a video camera at the screen method.  :-(
___
freebsd-net@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: kern/116077: [ip] [patch] 6.2-STABLE panic during use of multi-cast networking client

2008-02-25 Thread John Baldwin
The following reply was made to PR kern/116077; it has been noted by GNATS.

From: John Baldwin <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED], [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: kern/116077: [ip] [patch] 6.2-STABLE panic during use of 
multi-cast networking client
Date: Mon, 25 Feb 2008 14:13:30 -0500

 Try applying the changes from this commit to fix this:
 
 ups 2008-02-22 19:13:57 UTC
 
   FreeBSD src repository
 
   Modified files:(Branch: RELENG_6)
 sys/netinet  in.c 
   Log:
   Fix reference counting for already existing addresses in in_addmulti()
   
   Reviewed by:gnn@
   
   Revision   ChangesPath
   1.85.2.10  +0 -1  src/sys/netinet/in.c
 
 -- 
 John Baldwin
___
freebsd-net@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: kern/120266: [panic] gnugk causes kernel panic when closing UDP sockets

2008-02-25 Thread John Baldwin
The following reply was made to PR kern/120266; it has been noted by GNATS.

From: John Baldwin <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED], [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: kern/120266: [panic] gnugk causes kernel panic when closing UDP 
sockets
Date: Mon, 25 Feb 2008 14:14:00 -0500

 Try this fix:
 
 ups 2008-02-22 19:13:57 UTC
 
   FreeBSD src repository
 
   Modified files:(Branch: RELENG_6)
 sys/netinet  in.c 
   Log:
   Fix reference counting for already existing addresses in in_addmulti()
   
   Reviewed by:gnn@
   
   Revision   ChangesPath
   1.85.2.10  +0 -1  src/sys/netinet/in.c
 
 -- 
 John Baldwin
___
freebsd-net@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: kern/116172: [tun] [panic] Network / ipv6 recursive mutex panic

2008-02-25 Thread Bruce Cran
The following reply was made to PR kern/116172; it has been noted by GNATS.

From: Bruce Cran <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED], [EMAIL PROTECTED]
Cc:  
Subject: Re: kern/116172: [tun] [panic] Network / ipv6 recursive mutex panic
Date: Mon, 25 Feb 2008 20:54:01 +

 Hi,
 
 Some changes were made to sys/net/route.c and sys/netinet6/nd6.c in 
 October to fix some routing related panics that were occurring on 
 7-CURRENT and 6.3.  I know this fixed an issue where the system would 
 panic when the gateway disappeared, but I think it may also have fixed 
 the recursive mutex panic too.  Are you still seeing this panic with 
 more recent sources (e.g 7.0-RC2)?
 
 Cheers,
 Bruce
___
freebsd-net@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: kern/116172: [tun] [panic] Network / ipv6 recursive mutex panic

2008-02-25 Thread remko
Synopsis: [tun] [panic] Network / ipv6 recursive mutex panic

State-Changed-From-To: open->feedback
State-Changed-By: remko
State-Changed-When: Mon Feb 25 21:07:53 UTC 2008
State-Changed-Why: 
Bruce asked for feedback

http://www.freebsd.org/cgi/query-pr.cgi?pr=116172
___
freebsd-net@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: FBSD 1GBit router?

2008-02-25 Thread Kevin Oberman
> Date: Mon, 25 Feb 2008 15:05:18 +0100 (CET)
> From: Ingo Flaschberger <[EMAIL PROTECTED]>
> Sender: [EMAIL PROTECTED]
> 
> Hi,
> 
> >> ZB> - upgrade at least to 6.3.  upgrading to 7.0 might also be better, 
> >> depending
> >> ZB> on hardware choices
> >> ZB> - ensure your ethernet cards are on fast enough busses.  'em' (Intel 
> >> Ether
> >> ZB> Express 1000) flavor ports are my personal favorite
> >> ZB> - enable polling (this will make a _huge_ difference by itself)
> >> ZB> - your hardware is (likely) dual core.  Make sure every piece of 
> >> hardware in
> >> ZB> use doesn't involve any giant locks.  Under 6.x consider the mpsafenet
> >> ZB> sysctl.  This is also a point on which 7.0 will shine.
> >> 
> >> I upgrade to 7.0RC3 but still the same. 418Mbit is the roof.
> 
> older fbsd's are faster than newer.
> 
> How are the nic's connected to the cpu?
> 
> lspci -v

V7 is not (in my experience) slower than V4, v5, or v6. I have run a lot
of tests at speeds MUCH higher than 1Gb. With 10Gb cards, I can sustain
transfer rates of over 9Gbps (assuming low RTT and suitable
hardware). 1Gbps is not even a challenge...even over a 100 ms. RTT.

Note that high throughput may require some tuning. Transmit and receive
windows need to be rather large if the RTT is very long at all. (See
"bandwidth-delay product" in Stevens or some other TCP reference.)
-- 
R. Kevin Oberman, Network Engineer
Energy Sciences Network (ESnet)
Ernest O. Lawrence Berkeley National Laboratory (Berkeley Lab)
E-mail: [EMAIL PROTECTED]   Phone: +1 510 486-8634
Key fingerprint:059B 2DDF 031C 9BA3 14A4  EADA 927D EBB3 987B 3751


pgpbeX86KiMkh.pgp
Description: PGP signature


Re: FBSD 1GBit router?

2008-02-25 Thread Ingo Flaschberger

Dear Kevin,


I upgrade to 7.0RC3 but still the same. 418Mbit is the roof.


older fbsd's are faster than newer.

How are the nic's connected to the cpu?

lspci -v


V7 is not (in my experience) slower than V4, v5, or v6.


v6 is at least slower than v4.
http://www.tancsa.com/blast.html
(look at the table at the end)


I have run a lot
of tests at speeds MUCH higher than 1Gb. With 10Gb cards, I can sustain
transfer rates of over 9Gbps (assuming low RTT and suitable
hardware). 1Gbps is not even a challenge...even over a 100 ms. RTT.


You can route 9Gbps - or only source or sink 9gbps?
What packet size?
Whats the maximum pps (with 64byte packets)? (Thats the real interesting 
value, not mbps)


I have a 1.2Ghz Pentium-M appliance, with 4x 32bit, 33MHz pci intel e1000 
cards.
With maximum tuning I can "route" ~400mbps with big packets and ~80mbps 
with 64byte packets.

around 100kpps, whats not bad for a pci architecture.

To reach higher bandwiths, better busses are needed.
pci-express cards are currently the best choice.
one dedicated pci-express lane (1.25gbps) has more bandwith than a whole 
32bit, 33mhz pci-bus.



Note that high throughput may require some tuning. Transmit and receive
windows need to be rather large if the RTT is very long at all. (See
"bandwidth-delay product" in Stevens or some other TCP reference.)


I'm not shure if he's using the nic for a server or for a router?

Kind regards,
Ingo Flaschberger

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


Re: FBSD 1GBit router?

2008-02-25 Thread Andrew Snow


I can confirm that FreeBSD 7.0-RC1 can route packets at 1gbps.  I used a
late-model Supermicro Xeon server which has two gigabit NICs on a
PCI-express "4x" lane.

With the new em driver improvements in 7 it uses very little CPU time, I
would recommend using Pro/1000 on 7.0 with a decent server motherboard
if you want to achieve this speed.

- Andrew


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


Re: question about change in inet_ntoa.c

2008-02-25 Thread Giorgos Keramidas
On 2008-02-23 02:37, ithilgore <[EMAIL PROTECTED]> wrote:
>ithilgore wrote:
>> I was looking at the differences between some old FreeBSD code
>> and the one of 7.0-RC1 and was wondering about a change
>> in inet_ntoa.c
>> 
>> /* 7.0-RC1 **/
>> 
>>sprintf(buf, "%d.%d.%d.%d",
>>ucp[0] & 0xff,
>>ucp[1] & 0xff,
>>ucp[2] & 0xff,
>>ucp[3] & 0xff);
>> 
>> 
>> /** 4.11-RELEASE ***/
>> 
>> 
>> static const char fmt[] = "%u.%u.%u%u";
>> if ((size_t)snprintf(dst, size, fmt, src[0], src[1], src[2], src[3])
>>>= size) {
>> 
>> 
>> 
>> Was there a specific purpose of changing the more easy and simple way
>> of %u  instead of the combination of %d and and-ing with 0xff  ??
>> It essentially gives the same result but increases overhead (i think) in 
>> the more
>> recent version.
> 
> I just noticed I made a mistake. The second code is libc's version of
> inet_ntoa.  But the question still counts. Why not use the plain
> simpler version of libc ?

I don't see ucp[] in RELENG_6, RELENG_7 or CURRENT.  Where did you get
the version shown as `7.0-RC1' above?

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


Re: vlan issues with 7.0-RC3

2008-02-25 Thread Pyun YongHyeon
On Mon, Feb 25, 2008 at 01:17:12AM -0800, Christopher Cowart wrote:
 > Hello,
 > 
 > I have a mac mini running 7.0-RC3, which I'm trying to turn it into a
 > router. I have a Linksys SRW2008 "fully managed" (via an IE only web
 > interface, ick) switch. 
 > 
 > Switch:
 >   Port 1 - Trunk vlans 10,60,98 - FreeBSD Box
 >   Port 7 - Access vlan 98 - Existing LAN (192.168.1.0/24)
 > 
 > OpenWRT (192.168.1.1):
 >   WRT54G box on the Existing LAN
 > 
 > FreeBSD Box:
 >   ifconfig msk0 up
 >   ifconfig vlan98 create vlan 98 vlandev msk0 inet 192.168.1.67/24
 > 
 > With this configuration, I can ping hosts on the other lan segment (Port
 > 7). Arp and icmp seem to be quite happy. Unfortunately, I'm not having
 > any luck with tcp and udp. Any attempt to ssh to OpenWRT or dig
 > @OpenWRT hangs indefinitely. If I do a tcpdump, I see the SYN or A?
 > leaving and absolutely no response returning. If I run a tcpdump on
 > OpenWRT, I see no incoming traffic.
 > 
 > When I try to connect *to* the FreeBSD box from the other lan segment, I
 > continue to have problems. tcpdump shows the SYNs arriving via vlan98
 > and the FreeBSD box responding with SYN-ACK. OpenWRT receives the SYNACK.
 > 
 > I disabled ipfw just to be sure (sysctl -w net.inet.ip.fw.enable=0), but
 > it had no effect on the problem. If I connect the FreeBSD box to a vlan
 > 98 access port and assign the address to msk0, my connectivity problems
 > go away. This leads me to believe that the firewall on OpenWRT is not
 > the problem and the problem is related to vlans.
 > 
 > Thinking it was a problem with the not-so-cheap Linksys POS (bitterness
 > about the IE web interface again), I plugged my MacBook (running
 > Leopard, not FreeBSD) into the trunk port. Running the ifconfig commands
 > above (s/msk0/en0/), I got up and running without any problems. This
 > causes me to suspect the FreeBSD box.
 > 
 > Does anyone have any idea what's going on here? Any suggestions for
 > further troubleshooting?
 > 

Try disabling hardware features one by one in msk(4) and see how
it goes.
 o Disable TSO.
 o Disable Tx checksum offload.
 o Disable VLAN hardware tagging.

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