Bug 23620

Summary: Fore PCA200E ATM driver problems with FreeBSD 4.1
Product: Base System Reporter: rh <rh>
Component: kernAssignee: Jim Pirzyk <pirzyk>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.1-RELEASE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description rh 2000-12-18 20:00:03 UTC
When using HARP and the Fore PCA200E driver (hfa), severe packet
loss occurs.  This will result in very low performance.

Fix: There are two problems in the Fore driver code.  The first is an offset
that became negative with the new 4.1 mbuf size, and an expedient fix
was suggested by Joseph Thomas on 09/01/2000.  This is the first part
of the patch.

The other problem is that the Fore driver uses the m_pkthdr field in
the mbuf chain for its own private data, but does not clear it before
handing the mbuf chain to the HARP layer.  With the pre-4.1 mbufs, this
did not (apparently) cause any harm, but the new mbuf structure adds
new fields, which now contain corrupted data.  The solution is to
clear these fields before the Fore driver passes the mbuf chain up
to the HARP layer.

A better solution might be to clear the entire mbuf m_pkthdr structure
so that future changes to the mbuf structure will not expose any new
problems with the driver's private data.  Such a change might look
like this:  bzero(mhead->m_pkthdr, sizeof(struct pkthdr));
The best solution is probably to rewrite the driver so that it does
not use the m_pkthdr field for its private data.  From the way the
#defines are written, it seems that this may have been the intention
of the author.

A working patch for the driver follows:
How-To-Repeat: 
Compile kernel with the following ATM options:
  device          hfa
  options         ATM_CORE                #core ATM protocol family
  options         ATM_IP                  #IP over ATM support
  options         ATM_SIGPVC              #SIGPVC signalling manager
  options         ATM_UNI                 #UNI signalling manager

Initialize ATM normally:
  /sbin/fore_dnld
  /sbin/atm set netif hfa0 atm 1
  /sbin/atm attach hfa0 uni31
  /sbin/ilmid
  /sbin/atm set arpserver atm0 <arpserver address>

Now ping another host on the ATM network.  Example:
  --- 192.168.100.18 ping statistics ---
  11 packets transmitted, 8 packets received, 27% packet loss
  round-trip min/avg/max/stddev = 0.617/0.870/1.161/0.146 ms
Comment 1 Poul-Henning Kamp 2000-12-18 21:21:30 UTC
In message <200012181955.LAA00400@ts7.matriplex.com>, rh writes:
>
>>Number:         23620
>>Category:       kern
>>Synopsis:       Fore PCA200E ATM driver problems with FreeBSD 4.1

Can I get you to submit a patch relative to -current ?

--
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk@FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.
Comment 2 Jim Pirzyk freebsd_committer freebsd_triage 2001-05-31 22:36:44 UTC
Responsible Changed
From-To: freebsd-bugs->pirzyk

I am one of the few interested in HARP ATM code working again.
Comment 3 Jim Pirzyk freebsd_committer freebsd_triage 2001-06-20 21:48:22 UTC
State Changed
From-To: open->closed

Applied the patch.  Thanks