home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / lan / driver6s / readme.521 < prev    next >
Internet Message Format  |  1990-03-27  |  4KB

  1. Date: Thu, 13 Jul 89 19:02:09 EDT
  2. From: ddl@harvard.harvard.edu (Dan Lanciani)
  3. To: nelson@sun.soe.clarkson.edu
  4. Subject: ni5210 driver
  5.  
  6.     Consider the following race condition.  Between the time
  7. you examine the receive frame list and the time the decision is made
  8. to restart the RU, a frame is completed.  In fact, since the interrupt
  9. routine handles only a single frame at a time (unless I am misreading
  10. it) there may be several completed frames.  You now restart the RU
  11. and return from the interrupt routine, immediately taking the interrupt
  12. again because of the received packet & no-resources conditions that
  13. occurred previously.  The interrupt routine finds what looks like
  14. a completed frame descriptor, adds up its length, and calls the
  15. primary receive hook.  Meanwhile, the 82586, which ignores the
  16. fact the the frame is already marked "complete" receives a new frame,
  17. possibly altering the length of the last buffer.  Bingo.
  18.     The sample driver in the Intel documentation has a check
  19. in the RU_START routine that refuses to start the RU if the C bit
  20. is set in the first frame descriptor on the list.  This suggests
  21. that the problem is real.  My preferred solution (and what I notice I
  22. did in another 82586 driver) is to run the buffer management code
  23. at least once after seeing that the RU has left the ready
  24. state.  Of course, this assumes that the buffer code will do multiple
  25. buffers.  I really think it should since, on a slow machine, it
  26. can get behind...
  27.  
  28.                 Dan
  29.  
  30. Return-Path: <ddl@husc6.harvard.edu>
  31. Date: Sun, 27 Aug 89 21:00:47 EDT
  32. From: ddl@husc6.harvard.edu (Dan Lanciani)
  33. To: lakesys!deanr@husc6.harvard.edu
  34. Subject: ni5210 packet driver
  35. Cc: nelson@sun.soe.clarkson.edu
  36.  
  37.     (I'm a little unsure of the version numbers at this point,
  38. but presumably the changes are mostly the ones I made.)  There
  39. were some severe problems in the old driver, especially on slower cpu's.
  40. I run a stock 4.77Mhz machine with an ni5210 24 hours/day 7 days/week
  41. on Harvard's rather dirty backbone.  The initial problem that
  42. I noticed was that the driver would overwrite more bytes in the
  43. supplied buffer than it indicated in the count.  This would have
  44. no effect on FTP Software's code since they always allocate a
  45. full-length buffer, but my own code uses two buffer sizes and
  46. this caused it to crash.
  47.     The second (related) problem was that after the driver had
  48. been running for a while, things became sluggish.  This was caused
  49. by the fact that the driver serviced at most one packet on each
  50. receiver interrupt and once it got behind, it stayed behind.  That
  51. is, if at some point in the past two receiver interrupts had been missed
  52. you would not see a new packet until two extra ones had been
  53. received.  This second problem provoked the first problem by
  54. frequently restarting the RU with completed frames still on
  55. the receive list.  At the next receiver (or other) interrupt the
  56. cpu could find what it thought was a completed frame which in
  57. reality was still in use by the RU.  Between the time that the
  58. cpu counted the bytes in the frame and the time that the buffer
  59. was copied, the lenght would change and...
  60.     The three main changes I made were:
  61.  
  62. 1.  Process all completed frames at each interrupt.
  63.  
  64. 2.  Before restarting the RU, look again for frames that
  65.     might have finished while you were deciding to restart the RU.
  66.  
  67. 3.  Firewall count of bytes copied to user buffer.
  68.  
  69.     Before these changes the dirver would not run for more than
  70. a few hours.  Now it runs for weeks.
  71.  
  72.                 Dan Lanciani
  73.                 ddl@harvard.*
  74.  
  75.