arbitrary serial speeds

2002-02-28 Thread Luuk van Dijk

This is a multi-part message in MIME format.
--17932B47B695003DFEDACE26
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

L.S.

for a project in which I communicate with embedded controllers in cars I
need to read and write serial data at weird speeds of 5 and 10400 baud. 

the beauty of the freebsd interface to the serial ports is that the
speed
can be specified as an integer, i.e. not neccesarily as some predefined
constant
like B9600, but in src/sys/isa/sio.c the supplied value is looked up in
a table,
so using an arbitrary baudrate like 5 will return EINVAL.

(On linux there is an ugly way to set these weird baud rates by setting
the
baudrate to 38400, and using a special syscall to tell the kernel to use
some other divisor of 115200 to generate the uart speed. needless to
say, I prefer
the hygiene commonly observed in bsd's api's)

an easy way would be to add my special baudrates to the table
'comspeedtab' 
that maps speed to divisor, but it is even more flexible to calculate
the divisor
on the spot, with the same macro COMBRD() as used in the initializer of
'comspeedtab';
note that this macro will automatically round to the next higher
baudrate that is
a divisor of 115200.

The attached patch contains the neccesary changes.  It works well for
me,
but who knows what I broke

As far as I can tell, this renders the comspeedtab table, as well as the 
routine ttspeedtab in kern/tty.c superfluous, but as I'm not sure I
haven't
included their removal in the patch.

Whoever maintains isa/sio.c, feel free to use this.  I'd be very happy
if
in future versions of FreeBSD I could use baudrates of 5 and 10400
(actually the
latter is rounded to 10475 == 115200/11, but that's good enough for me),
without
recompiling.

Regards,
Luuk van Dijk

___
Mind over Matter  lvd at mndmttr.nl
The Netherlandstel +31 6 224 97 227
___
--17932B47B695003DFEDACE26
Content-Type: text/plain; charset=us-ascii;
 name=freebsd-src-sys-isa-sio-arbitrary-speed.patch
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename=freebsd-src-sys-isa-sio-arbitrary-speed.patch

--- isa.org/sio.c   Wed Feb  6 23:58:00 2002
+++ isa/sio.c   Thu Feb  7 00:08:25 2002
@@ -2153,7 +2153,7 @@
t-c_ispeed = t-c_ospeed;
 
/* check requested parameters */
-   divisor = ttspeedtab(t-c_ospeed, comspeedtab);
+   divisor = (t-c_ospeed) ? COMBRD(t-c_ospeed) : 0; /* was 
+ttspeedtab(t-c_ospeed, comspeedtab); lvd */
if (divisor  0 || (divisor  0  t-c_ispeed != t-c_ospeed))
return (EINVAL);
 
@@ -2794,7 +2794,7 @@
 * data input register.  This also reduces the effects of the
 * UMC8669F bug.
 */
-   divisor = ttspeedtab(speed, comspeedtab);
+   divisor = (speed) ? COMBRD(speed) : 0; /* was ttspeedtab(speed, comspeedtab); 
+lvd */
dlbl = divisor  0xFF;
if (sp-dlbl != dlbl)
outb(iobase + com_dlbl, dlbl);

--17932B47B695003DFEDACE26--


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message



oracle 8.1.7.0.1 installation successful, anyone?

2002-02-28 Thread Theodore Hope

We've tried installing Oracle 8.1.7.0.1 (for Linux) under
FreeBSD 4.5-release and end up with two jre processes
eating all the CPU and the infamous 
kernel trap 9 with interrupts disabled message scrolling on
the console.  This has been reported before by others, and
I'm wondering if anyone has successfully installed Oracle 
(8.1.x or 9.x) under 4.5-Release.  We can't tell if the
main problem is with the Linux emulation, or what; thus
my cross-posting.

Many folks (including the handbook) report successful installations
of Oracle 8.0.x under FreeBSD 3.2, but I haven't been able to find
any recent Oracle+FreeBSD combinations.

(If anyone could tell me how to download Oracle 8.0.x I'd
also like to give it a try, but the oldest one can download
for Linux from oracle.com is 8.1.7.0.1.)

Thanks, -Ted.


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message



Re: IPv6-over-IPv4 problems since the upgrade to 4.5

2002-02-28 Thread Hajimu UMEMOTO

Hi,

 On Thu, 28 Feb 2002 15:20:57 +1100
 Edwin Groothuis [EMAIL PROTECTED] said:

edwin On Tue, Feb 26, 2002 at 02:38:28PM +0900, JINMEI Tatuya / ?$B?@L@C#:H?(B wrote:
 Finally I figured out the problem.

edwin Thanks for these two patches, it works like a charm now!

I just committed both patches to -CURRENT.  I'll do MFC after 1 week.

--
Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan
[EMAIL PROTECTED]  [EMAIL PROTECTED]  ume@{,jp.}FreeBSD.org
http://www.imasy.org/~ume/

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message



RE: FreeBSD, SMP and Performance Speeds?

2002-02-28 Thread Frost, Stephen C


I'm crossposting to [EMAIL PROTECTED], as per suggestion.

My original post, edited:

  ... why any kernels compiled with SMP enabled seem
  to be slowing the whole system down?  Throughput goes down by 40%.
Tasks
  take twice as long to run, etc, etc...
  ... it appears to be system-wide.  And is directly linked to
  SMP: two kernels, identical EXCEPT that one has SMP enabled, the other
not.
  The enabled kernel that *should* be fully utilizing multi-procs is
suddenly
  effectively running at half speed.

Thanks to all for replies.

Regarding my SMP query, Doc asks:
 What sort of throughput? What sort of processes are you 
 running? Do you 
 actually have multiple processes fighting for CPU?

Yes, I'm using netperf, iperf or nttcp to measure TCP throughput using the
server (the box in question) in response to ten simultaneous clients.
Chariot allegedly did not show the performance hit.  But then, even
measuring the process time to run a single simple script shows ~half the
speed with SMP enabled.

Chris F. asks:
 Is this an old Pentium?  If so, update to a recent -stable;
 a fix was committed a few weeks ago fixing a problem where
 the caches on both processors were not enabled on Pentiums.
 Otherwise, we have a few PII and PIII boxes here that work
 quite under 4.5.

This includes multiple configurations, incl: dual PIII 700s, dual PIII 800s,
quad PIII Zeon 550s, etc...  No old procs, per se.  I'm running the released
version of 4.5.  Was a proc-specific fix implemented *after* its release?

Greg L states:
 It would also be interesting to see if you get the same results
 running 5-CURRENT.  While this version isn't suited to production use,
 it's based on a very different implementation, and the information
 would help us work out what's going on here.

Unfortunately, I do not get a whole lot of time to get experimental due to
compressed testing schedules but, if a hole opens up, I will attempt to get
some testing done using 5-CURRENT.  Will report any results to you.  Thanks
for your interest.

This scenario has been replicated on several (virtually any and all) test
boxes by multiple engineers.  Any other tips are greatly appreciated.

TIA -

-=C. Stephen Frost=-
   Intel Corp.
   ICG - Network Quality Labs
   Software Test Engineer
   503.264.8300

All opinions are my own, not those of Intel Corporation

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message



Re: Myson drivers for 4.x

2002-02-28 Thread Andre Oppermann

 On Tue, 26 Feb 2002, Julian Elischer wrote:
 I have been speaking with the author.
 he is adding a BSD copyright.
 also he  says we can KNFify (style(9)ify?) as it doesn't have to
 remain
 compatible with anything else.
 
 It might be nice if it could be folded into the driver it was copied from,
 if thats still possible.
 
 If its actually a Realtek clone with a few differences it wouldn't make
 sense to add a whole new driver to the system.

Just a side note; the Realtek driver isn't entirely up to date. The
chip has evolved quite a bit with it's current RTL8139C(L)+ revision and
now can do things like descriptor-base buffer management (one of the
major shortcomings of the first revisions and what wpaul was bitching
about), VLAN tagging, checksum offloading and some other stuff.

I haven't looked at the mys driver source but if that supports these
new features (which probably make this new chip rev fly) it should
be integrated also for if_rl.

-- 
Andre


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message



Re: Myson drivers for 4.x

2002-02-28 Thread Julian Elischer



On Thu, 28 Feb 2002, Andre Oppermann wrote:

  On Tue, 26 Feb 2002, Julian Elischer wrote:
  
  If its actually a Realtek clone with a few differences it wouldn't make
  sense to add a whole new driver to the system.
 
 Just a side note; the Realtek driver isn't entirely up to date. The
 chip has evolved quite a bit with it's current RTL8139C(L)+ revision and
 now can do things like descriptor-base buffer management (one of the
 major shortcomings of the first revisions and what wpaul was bitching
 about), VLAN tagging, checksum offloading and some other stuff.
 
 I haven't looked at the mys driver source but if that supports these
 new features (which probably make this new chip rev fly) it should
 be integrated also for if_rl.


Here's what teh author said about the driver:

---start quite:


 [Julian said:]

 Can you tell me if your driver was based upon an existing driver?
 If so, which one?


We have the driver for FreeBSD 3.X. I modified it for FreeBSD 4.X and 5.X.
Of course, when modified it for 4.X and 5.X. I refered the code of Intel
and
Realtek.

 does the hardware resemble the hardware used by that driver?
 how much?
 what is different?

Our chip is similar to Dec 21143. But they are different. We use the
concept
of descriptor, too.



 
 -- 
 Andre
 
 



To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message



Re: using vnconfig devices instead of partitions for jails ?

2002-02-28 Thread Patrick Thomas


thank you - I am glad to see that this is a good way of doing things.  Two
quick items:

1. How do I give each jail a 'proc' filesystem in its /proc using this
configuration ?

2. Is there any downside to this whatsoever ?  This seems infinitely
better than a new partition for each jail, so was I just silly for doing
it that way ?

thanks!

On Wed, 27 Feb 2002, Nik Clayton wrote:

 On Wed, Feb 27, 2002 at 03:03:11PM -0600, Kirk Strauser wrote:
  At 2002-02-27T20:49:18Z, Patrick Thomas [EMAIL PROTECTED] writes:
   I would like to put a large number of jails (16 or 20) on a server for
   testing purposes.
  
   I have two options so far: create 16 or 20 partitions OR just put them all
   in one partition, but the downside of that is that then I cannot enforce
   disk usage between jails.  So at this point, 16-20 partitions seems the
   safest route.
 
  Good question.  Is there any ability at all within the system to set a quota
  on a jail?

 Each vn* device has to be baced by a physical file on the system.
 Simply make sure that this physical device is the maximum size you want
 to allow in the jail.

 For example, on a server with 160GB of (RAID) disk, and 12 jails, each 10GB
 in size, I just have 12 jails;

 On the 'master' host for the jails.

 # cd /usr/local/jails/disk-images
 # ls -l
 totall 1758115
 drwxr-xr-x  2 root  wheel  512 Jan 23 00:40 .
 drwxr-xr-x  4 root  wheel  512 Jan 23 00:39 ..
 -rw-r--r--  1 root  wheel  136 Jan 22 18:45 README
 -rw-r--r--  1 root  wheel  10737418240 Feb 27 23:35 foo.com.vn
 -rw-r--r--  1 root  wheel  10737418240 Feb 27 23:35 bar.com.vn
 -rw-r--r--  1 root  wheel  10737418240 Feb 27 23:35 baz.com.vn
 ...

 These were created with truncate 10G file, and are then mounted
 configued on different vn* devices, which are then mounted as normal.

 # mount
 ...
 /dev/vn0a on /usr/local/jails/foo.com
 /dev/vn1a on /usr/local/jails/bar.com
 /dev/vn2a on /usr/local/jails/baz.com
 ...

 N
 --
 FreeBSD: The Power to Serve  http://www.freebsd.org/   (__)
 FreeBSD Documentation Projecthttp://www.freebsd.org/docproj/\\\'',)
   \/  \ ^
--- 15B8 3FFC DDB4 34B0 AA5F  94B7 93A8 0764 2C37 E375 --- .\._/_)



To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message



Acl patches

2002-02-28 Thread Jim Durham

I've looked over the mailing lists and google and I can't figure out 
if the patches to the 5.0 kernel to support ACLs in Samba ever made 
it into 4.4 or 4.5 Release ?
-- 
Jim

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message



Re: using vnconfig devices instead of partitions for jails ?

2002-02-28 Thread Patrick Thomas


one other thing:

How many mount points (jails, in this case) can I run ?  I see that there
are 8 existing vn0X device files in /dev - can I just create more of them
using MAKEDEV (or mknod) and keep going ?

What is the maximum ?  256 ?

also, do I need to alter the kernel to support more vn0X device files, or
does a stock kernel support all the way up to the maximum (whatever that
is - see previous question :)

thanks again - much appreciated.

--pt


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message



Realtek RTL8100B

2002-02-28 Thread Dan


Is this supported?
Cannot seem to find this version at
ftp://ftp.FreeBSD.org/pub/FreeBSD/releases/i386/4.5-RELEASE/HARDWARE.HTM




To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message



Re: oracle 8.1.7.0.1 installation successful, anyone?

2002-02-28 Thread Rogier R. Mulhuijzen

At 09:46 28-2-2002 -0600, Theodore Hope wrote:
We've tried installing Oracle 8.1.7.0.1 (for Linux) under
FreeBSD 4.5-release and end up with two jre processes
eating all the CPU and the infamous
kernel trap 9 with interrupts disabled message scrolling on
the console.  This has been reported before by others, and
I'm wondering if anyone has successfully installed Oracle
(8.1.x or 9.x) under 4.5-Release.  We can't tell if the
main problem is with the Linux emulation, or what; thus
my cross-posting.

I didn't succeed in installing 8.1.7 either, but I've been semi-succesful 
with 9.0.1 lately.

I had to pull a few tricks but I got it to install. However, the relinking 
of several binaries (like the RDBMS one) failed with some glibc errors, so 
there's something not completely right with my linux libs.

9.0.1's installer uses a JDK on the CD, but I ran it with the 
linux-jdk1.3.1 too. The Universal Installer is just very sensitive pacakge =(

I used the RedHat7.1 port and added some devel rpms, made the oracle user's 
shell /compat/linux/bin/bash (try a 'uname -a' when logged in with a user 
setup like that, it's freaky) and I had to make a /compat/linux/etc/mtab 
file to keep the installer from bombing when it tries to figure out which 
filesystems you have.

 Doc


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message



Re: using vnconfig devices instead of partitions for jails ?

2002-02-28 Thread Terry Lambert

Patrick Thomas wrote:
 How many mount points (jails, in this case) can I run ?  I see that there
 are 8 existing vn0X device files in /dev - can I just create more of them
 using MAKEDEV (or mknod) and keep going ?
 
 What is the maximum ?  256 ?

Depends.  Expect 256 to be available in all versions.

 also, do I need to alter the kernel to support more vn0X device files, or
 does a stock kernel support all the way up to the maximum (whatever that
 is - see previous question :)

They are allocated as they are configed, so the limitation
is the number of minor devices.

Note: I personally run 13 jails on the laptop from which I
am currently typing this.  I do *not* use seperate partitions
or vnconfig'ed devices; on the other hand, I don't have quota
enforecement issues.

-- Terry

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message



Re: Missing PT_READ_U

2002-02-28 Thread Julian Elischer



On Thu, 28 Feb 2002, Bakul Shah wrote:

  Zap 'ptrace(PT_READ_U, ...)' and 'ptrace(PT_WRITE_U, ...)' since they
  are a really nasty interface that should have been killed long ago
  when 'ptrace(PT_[SG]ETREGS' etc came along.  The entity that they
  operate on (struct user) will not be around much longer since it
  is part-per-process and part-per-thread in a post-KSE world.
 
 Yeah I saw that before sending out my query.  This should've
 waited until after KSE is in place.

The u-area is already gone really...


 
  the uarea is pretty much a shadow of its former self
  The fields have been scattered across two structures.
  
  What is ups trying to find out?
 
 Signal handling state of the process being debugged (whether
 ignored/caught etc).I haven't dug deeper into it so I
 don't know why it wants that but it seems to be pretty deeply
 wired in.
 
  There are other ways to get all the information in question.
 
 There isn't.  I don't think procfs will give me that either.
 May be PT_{SET,GET}SIGSTATE should be added?
 
 BTW, what is being added to allow debugging a post-KSE world
 process?
 
 -- bakul
 


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message



Re: Missing PT_READ_U

2002-02-28 Thread Julian Elischer



On Thu, 28 Feb 2002, Bakul Shah wrote:

  Zap 'ptrace(PT_READ_U, ...)' and 'ptrace(PT_WRITE_U, ...)' since they
  are a really nasty interface that should have been killed long ago
  when 'ptrace(PT_[SG]ETREGS' etc came along.  The entity that they
  operate on (struct user) will not be around much longer since it
  is part-per-process and part-per-thread in a post-KSE world.
 
 Yeah I saw that before sending out my query.  This should've
 waited until after KSE is in place.
 
  the uarea is pretty much a shadow of its former self
  The fields have been scattered across two structures.
  
  What is ups trying to find out?
 
 Signal handling state of the process being debugged (whether
 ignored/caught etc).I haven't dug deeper into it so I
 don't know why it wants that but it seems to be pretty deeply
 wired in.
 
  There are other ways to get all the information in question.
 
 There isn't.  I don't think procfs will give me that either.
 May be PT_{SET,GET}SIGSTATE should be added?
 
 BTW, what is being added to allow debugging a post-KSE world
 process?

I'm planning on extending Ptrace.
There will need to be a ptrace command to specify 
1/ which thread you want future ptrace commands to control
(e.g. single step),
2/ What you want the OTHER threads to do (e.g run as normal or stop)

The READ_U should be replaced by a specific SIGSTATE command as you
suggest I think.
It only reads it right?


 
 -- bakul
 


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message



Re: read-only root partition?

2002-02-28 Thread Brian Dean

On Thu, Feb 28, 2002 at 01:26:49AM -0500, Clark C . Evans wrote:
 
 | http://people.freebsd.org/~bsd/cdroot/
 
 Ok.  I've tried this route and it seems to be working,
 thank you all so much for your help and pointers.

Whoops, sorry.  I just replied to your earlier mail mentioning these
scripts, but I see now that you've already found them.  I really
should read everything through before responding.

 During burning the iso image, I get a message to my 
 console,  PREVENT_ALLOW - ILLEGAL REQUEST asc=64 ascq=0 error=04
 this occurs as burncd is fixing.

I've never seen that before so I don't know.

   acd0: CD-RW ...
   Mouning from root iso9660:cd0a
   no such device 'cd'
   setrootbyname failed
   iso_mountroot: can't find rootvp
   Root mount failed: 6
   Mounting root from iso9660:acd0

This is harmless ... the startup code is doing a boot -C which
instructions the kernel to mountroot from the CD drive.  It first
tries the scsi drive (cd0a), but not being there it failed, but then
moves on to the IDE cd drive (acd0) and succeeds.

 I also see a few drives complaining (like the mouse), 
 I think I know how to re-do the kernel to leave out
 the mouse driver though.  Is this a cd driver that
 needs to be removed?

I'm not sure what you mean by this question.  If your asking if the CD
should be removed, the answer is no.  In fact, you won't be able to
eject the CD while the system is running because it is mounted at the
root, and its not possible to unmount /.  To eject and switch to a new
cd, do a 'halt', wait until you get the message that says you can
press any key to reboot, then eject.

 Anyway, I log-in and everything works nicely.  Cool.
 Given that I've gotten this far with cdroot, I think
 I'm going to stick with this solution... and figure
 out how it works.   This kit makes three mfs for me: 
 tmp, var, etc, dev.   I'm wondering if the etc 
 and dev must be done as mfs?

I guess technically, /etc does not.  However, one feature of this
method (as I described in my earlier mail that I sent not knowing
you'd gotten this far) is that you can provide override files from a
floppy disk.  You wouldn't be able to do this if its not rw.

/dev needs to be rw.

 My next step is to make a custom boot process:
 
  1. Check to see if /dev/ad0s1b exists and is a
 swap partition, if so, load it.
 
  2. Check to see if /dev/ad0s1? exists and is
 a FreeBSD partition.  If so, see if it looks
 like a /tmp, /var, or /home partition.  If
 so mount as appropriate.
 
  3. Modify (2) above, to search on /ad?s1? for
 a similar structure.  If so, then mount it
 using vinum.
 
 If steps 1-3 above fail, then assume it is an
 uninitialized box.  Ask the user to verify
 this fact, and then create the partitions 
 automagically.   If there are two disks, ask
 the user if a software mirror is to be used,
 if so, then configure this as well.

All of these are doable and could reasonably go into the file that I
used to replace /etc/rc (rc.replacement, which gets installed as
/etc/rc on the CD).  Take a look at rc_hook variable in rc.replacement
(set this in /etc/rc.conf on the CD or on the floppy /etc/rc.conf).
This may be a good way to hook in your customizations.

As far as how to do what you want regarding the local disk, you could
simply run disklabel -r on ad0s1 and look at what partitions are
there.  In the CD based root, you have a full /usr/bin worth of tools
to work with very early on in the boot process.  #1 should be pretty
simple, just grep for it and if it is there issue a swapon.

For #2, you could mount each one in turn on /mnt, and do a spot check
for some identifying files or directories that would likely be in
/usr, or /var, or whatever.  Once you find a match, then unmount it
from /mnt and remount it where it should go.

I don't use vinum, so I'm not sure about #3, but that should probably
be similar.

These are just a few suggestions.  I'm sure there are many ways to
implement what you are wanting.

Good luck!

-Brian
-- 
Brian Dean
[EMAIL PROTECTED]
[EMAIL PROTECTED]

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message



Re: Realtek RTL8100B

2002-02-28 Thread M. Warner Losh

In message: [EMAIL PROTECTED]
Dan [EMAIL PROTECTED] writes:
: 
: Is this supported?
: Cannot seem to find this version at
: ftp://ftp.FreeBSD.org/pub/FreeBSD/releases/i386/4.5-RELEASE/HARDWARE.HTM

If this is a USB ethernet chip, then I just got done reviewing a
driver from someone in Japan that should be going into the tree soon.

Warner

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message



Re: Multicast problem with sis interface?

2002-02-28 Thread George V. Neville-Neil

 At 13:10 19/02/02 -0800, Doug Ambrisko wrote:
 Bob Bishop writes:
 | No dice with last night's -STABLE. And it's definitely the interface, I've
 | tried a variety and netatalk works with everything (including the dreaded
 | Via Rhine) except for the onboard sis0.
 |
 | I suppose it's time for some comparative tcpdumping...
 
 Pity that would have been an easy fix.  Doing tcpdump should help.
 I like Ethereal so I can drill down a little easier.
 
 This is what tcpdump (on a disinterested machine) sees:
 
 sis - fails:
 
 20:53:43.423585 255.0.158.nis  0.0.nis: nbp-lkup 1: =:=@*
 [addr=255.0.158.128]
    0308 0007 809b 001a 8369  ff00
   ff9e 0202 0221 01ff 009e 8000 013d 013d
   012a      
 
 vr - works:
 
 20:54:55.022827 255.0.158.nis  0.0.nis: nbp-lkup 1: =:=@*
 [addr=255.0.158.128]
    0308 0007 809b 001a 8369  ff00
   ff9e 0202 0221 01ff 009e 8000 013d 013d
   012a 0050 baec bd66 00ff 009e 
 
 Those trailing 1's look suspicious to me. The NBP lookup packet is only 48 
 bytes, so needs padding to the ethernet minimum 60 on the wire. I suspect 
 this isn't happening on the sis. The packets are otherwise well-formed (and 
 the ethernet headers (not shown above) are correct).

No need.  The problem seems to be that at least the National Semi
version of the chip does have Auto Padding which pads runt packets
out to the necessary 60 bytes for Ethernet but that the padding is 
1s and not 0s.  I seem to remember that according to the Ethernet
spec the pad bytes should be 0 but don't quote me.

I figured that Auto Padding was not on, but actually it is by default in the
driver.  

You can easily reproduce this bug by doing a 

ping -s 1 224.0.0.1

on the machine with the sis device.

To fix this someone would have to modify sis_encap to pad
to the minimum 60 bytes by hand.  I'll take a crack at that now.

Later,
George

-- 
George V. Neville-Neil  [EMAIL PROTECTED]
NIC:GN82 

Those who would trade liberty for temporary security deserve neither 
- Benjamin Franklin



To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message



Re: arbitrary serial speeds

2002-02-28 Thread John Hay

Don't the stuff I committed to current do what you guys want? I'm planning
to MFC it, but haven't asked Bruce yet. I'll need it before I MFC the puc
driver.

John
-- 
John Hay -- [EMAIL PROTECTED] / [EMAIL PROTECTED]

 I had changes to do this 
 BDE refused to commit them.
 
 
 On Thu, 28 Feb 2002, Luuk van Dijk wrote:
 
  This is a multi-part message in MIME format.
  --17932B47B695003DFEDACE26
  Content-Type: text/plain; charset=us-ascii
  Content-Transfer-Encoding: 7bit
  
  L.S.
  
  for a project in which I communicate with embedded controllers in cars I
  need to read and write serial data at weird speeds of 5 and 10400 baud. 
  
  the beauty of the freebsd interface to the serial ports is that the
  speed
  can be specified as an integer, i.e. not neccesarily as some predefined
  constant
  like B9600, but in src/sys/isa/sio.c the supplied value is looked up in
  a table,
  so using an arbitrary baudrate like 5 will return EINVAL.
  
  (On linux there is an ugly way to set these weird baud rates by setting
  the
  baudrate to 38400, and using a special syscall to tell the kernel to use
  some other divisor of 115200 to generate the uart speed. needless to
  say, I prefer
  the hygiene commonly observed in bsd's api's)
  
  an easy way would be to add my special baudrates to the table
  'comspeedtab' 
  that maps speed to divisor, but it is even more flexible to calculate
  the divisor
  on the spot, with the same macro COMBRD() as used in the initializer of
  'comspeedtab';
  note that this macro will automatically round to the next higher
  baudrate that is
  a divisor of 115200.
  
  The attached patch contains the neccesary changes.  It works well for
  me,
  but who knows what I broke
  
  As far as I can tell, this renders the comspeedtab table, as well as the 
  routine ttspeedtab in kern/tty.c superfluous, but as I'm not sure I
  haven't
  included their removal in the patch.
  
  Whoever maintains isa/sio.c, feel free to use this.  I'd be very happy
  if
  in future versions of FreeBSD I could use baudrates of 5 and 10400
  (actually the
  latter is rounded to 10475 == 115200/11, but that's good enough for me),
  without
  recompiling.
  
  Regards,
  Luuk van Dijk
  
  ___
  Mind over Matter  lvd at mndmttr.nl
  The Netherlandstel +31 6 224 97 227
  ___
  --17932B47B695003DFEDACE26
  Content-Type: text/plain; charset=us-ascii;
   name=freebsd-src-sys-isa-sio-arbitrary-speed.patch
  Content-Transfer-Encoding: 7bit
  Content-Disposition: inline;
   filename=freebsd-src-sys-isa-sio-arbitrary-speed.patch
  
  --- isa.org/sio.c   Wed Feb  6 23:58:00 2002
  +++ isa/sio.c   Thu Feb  7 00:08:25 2002
  @@ -2153,7 +2153,7 @@
  t-c_ispeed = t-c_ospeed;
   
  /* check requested parameters */
  -   divisor = ttspeedtab(t-c_ospeed, comspeedtab);
  +   divisor = (t-c_ospeed) ? COMBRD(t-c_ospeed) : 0; /* was 
ttspeedtab(t-c_ospeed, comspeedtab); lvd */
  if (divisor  0 || (divisor  0  t-c_ispeed != t-c_ospeed))
  return (EINVAL);
   
  @@ -2794,7 +2794,7 @@
   * data input register.  This also reduces the effects of the
   * UMC8669F bug.
   */
  -   divisor = ttspeedtab(speed, comspeedtab);
  +   divisor = (speed) ? COMBRD(speed) : 0; /* was ttspeedtab(speed, comspeedtab); 
lvd */
  dlbl = divisor  0xFF;
  if (sp-dlbl != dlbl)
  outb(iobase + com_dlbl, dlbl);
  
  --17932B47B695003DFEDACE26--
  
  
  To Unsubscribe: send mail to [EMAIL PROTECTED]
  with unsubscribe freebsd-hackers in the body of the message
  
 
 
 To Unsubscribe: send mail to [EMAIL PROTECTED]
 with unsubscribe freebsd-hackers in the body of the message
 



To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message



Re: Multicast problem with sis interface?

2002-02-28 Thread George V. Neville-Neil

Here is a context diff that fixes the driver.  Not the most performant solution
(it requires allocating a new, zero'd, mbuf) but it's the most straightforward
fix.  Auto Padding is still on in the driver.  I saw no reason to disable this 
even
though we're now go around it.

This fix is against -CURRENT of 20 Feb 2002 vintage.

I've submitted a PR with the patch in the comments.

Later,
George

Index: if_sis.c
===
RCS file: /music/FreeBSD-CVS/src/sys/pci/if_sis.c,v
retrieving revision 1.48
diff -c -r1.48 if_sis.c
*** if_sis.c6 Feb 2002 22:06:47 -   1.48
--- if_sis.c1 Mar 2002 06:51:46 -
***
*** 1665,1671 
struct ifnet*ifp;
  {
struct sis_softc*sc;
!   struct mbuf *m_head = NULL;
u_int32_t   idx;
  
sc = ifp-if_softc;
--- 1665,1671 
struct ifnet*ifp;
  {
struct sis_softc*sc;
!   struct mbuf *m_head = NULL, *m_zero = NULL;
u_int32_t   idx;
  
sc = ifp-if_softc;
***
*** 1687,1692 
--- 1687,1701 
IF_DEQUEUE(ifp-if_snd, m_head);
if (m_head == NULL)
break;
+ 
+   if (m_head-m_pkthdr.len  ETHER_MIN_LEN)   {
+   m_zero = m_get_clrd(M_DONTWAIT, MT_DATA);
+   if (m_zero == NULL)
+   break;
+   m_zero-m_len = ETHER_MIN_LEN - m_head-m_pkthdr.len;
+   m_cat(m_head, m_zero);
+   m_head-m_pkthdr.len = ETHER_MIN_LEN;
+   }
  
if (sis_encap(sc, m_head, idx)) {
IF_PREPEND(ifp-if_snd, m_head);

-- 
George V. Neville-Neil  [EMAIL PROTECTED]
NIC:GN82 

Those who would trade liberty for temporary security deserve neither 
- Benjamin Franklin



To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message



[no subject]

2002-02-28 Thread Balaji

Respected Sir,
I have two NFS servers acting as backups for each other. We are
working in FreeBSD. Now when a server fails, the other server takes
over the IP address of the failed server on a different Network
Interface. But, now the clients of the failed server are not able to
mount from the backup server inspite of the fact that the mountpoint
permissions are satisfied in /etc/exports. The NFS mountpoints are
shared by both servers. I cannot afford to kill and restart the nfsds.
I run a kill -s HUP 'cat /var/run/mountd.pid' after combining the
exports files of both the servers. But still this does not work. How
can I bind the nfsds to the new IP address without restarting them? If
I try to run more nfsds by binding them to the new IP address, it gives
me a can't bind udp adress: address already in use error. And still
the nfs clients cannot mount the NFS exported partitions.
Plz help.
Awaiting your reply.
Yours Sincerely,
Balaji.

__
Do You Yahoo!?
Yahoo! Greetings - Send FREE e-cards for every occasion!
http://greetings.yahoo.com

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message