Commit Graph

147311 Commits

Author SHA1 Message Date
Christian Brueffer
7406bf9f51 nge(4) should work on all archs now. 2009-05-21 10:04:51 +00:00
Robert Watson
62e1ba833c Consolidate and clean up the first section of ip_output.c in light of the
last year or two's work on routing:

- Combine iproute initialization and flowtable lookup blocks, eliminating
  unnecessary tests for known-zero'd iproute fields.

- Add a comment indicating (a) why the route entry returned by the
  flowtable is considered stable and (b) that the flowtable lookup must
  occur after the setup of the mbuf flow ID.

- Assert the inpcb lock before any use of inpcb fields.

Reviewed by:	kmacy
2009-05-21 09:45:47 +00:00
Sam Leffler
c3e8a58723 force type match 2009-05-21 04:00:31 +00:00
Pyun YongHyeon
d4cb58f64c Add nge(4) to the list of drivers supporting ALTQ. 2009-05-21 02:47:46 +00:00
Pyun YongHyeon
fe06074870 nge(4) supports altq(4). Xr altq 2009-05-21 02:44:32 +00:00
Pyun YongHyeon
e222fbb65c DP83821 also supports jumbo frames. 2009-05-21 02:42:15 +00:00
Pyun YongHyeon
ecf900c60c Document sysctl variable dev.nge.%d.int_holdoff. 2009-05-21 02:39:47 +00:00
Andrew Thompson
88f3df72ef Print out device attachment. 2009-05-21 02:26:51 +00:00
Pyun YongHyeon
460da49973 Add nge(4), nge(4) should work on all architectures. 2009-05-21 02:19:01 +00:00
Pyun YongHyeon
f6bc943047 bus_dma(9) conversion and make nge(4) work on all architectures.
o Header file cleanup.
o bus_dma(9) conversion.
  - Removed all consumers of vtophys(9) and converted to use
    bus_dma(9).
  - 64bit DMA support was disabled because DP83821 is not capable
    of handling the DMA request. 64bit DMA request on DP83820
    requires different descriptor structures and it's hard to
    dynamically change descriptor format at run time so I disabled
    it. Note, this is the same behavior as previous one but
    previously nge(4) didn't explicitly disable 64bit mode on
    DP83820.
  - Added Tx/Rx descriptor ring alignment requirements(8 bytes
    alignment).
  - Limit maximum number of Tx DMA segments to 16. In fact,
    controller does not seem to have limitations on number of Tx
    DMA segments but 16 should be enough for most cases and
    m_collapse(9) will handle highly fragmented frames without
    consuming a lot of CPU cycles.
  - Added Rx buffer alignment requirements(8 bytes alignment). This
    means driver should fixup received frames to align on 16bits
    boundary on strict-alignment architectures.
  - Nuked driver private data structure in descriptor ring.
  - Added endianness support code in Tx/Rx descriptor access.
o Prefer faster memory mapped register access to I/O mapped access.
   Added fall-back mechanism to use alternative register access.
   The hardware supports both memory and I/O mapped access.
o Added suspend/resume methods but it wasn't tested as controller I
  have does not support PCI PME.
o Removed swap argument in nge_read_eeprom() since endianness
  should be handled after reading EEPROM.
o Implemented experimental 802.3x full-duplex flow-control. ATM
  it was commented out but will be activated after we have generic
  flow-control framework in mii(4) layer.
o Rearranged promiscuous mode settings and simplified logic.
o Always disable Rx filter prior to changing Rx filter functions as
  indicated in DP83820/DP83821 datasheet.
o Added an explicit DELAY in timeout loop of nge_reset().
o Added a sysctl variable dev.nge.%d.int_holdoff to control
  interrupt moderation. Valid ranges are 1 to 255(default 1) in
  units of 100us. The actual delivery of interrupt would be delayed
  based on the sysctl value. The interface has to be brought down
  and up again before a change takes effect. With proper tuning
  value, users do not need to resort to polling(4) anymore.
o Added ALTQ(4) support.
o Added missing IFCAP_VLAN_HWCSUM as nge(4) can offload Tx/Rx
  checksum calculation on VLAN tagged frames as well as VLAN tag
  insertion/stripping. Also add IFCAP_VLAN_MTU capability as nge(4)
  can handle VLAN tagged oversized frames.
o Fixed media header length for VLAN.
o Rearranged nge_detach routine such that it's now used for general
  clean-up routine.
o Enabled MWI.
o Accessing EEPROM takes very long time so read 6 bytes ethernet
  address with one call instead of 3 separate accesses.
o Don't set if_mtu in device attach, it's already set in
  ether_ifattach().
o Don't do any special things for TBI interface. Remove TBI
  specific media handling in the driver and have gentbi(4) handle
  it. Add glue code to read/write TBI PHY registers in miibus
  method. This change removes a lot of PHY handling code in driver
  and now its functionality is handled by mii(4).
o Alignment fixup code is now applied only for strict-alignment
  architectures. Previously the code was applied for all
  architectures except i386. With this change amd64 will get
  instant Rx performance boost.
o When driver fails to allocate a new mbuf, update if_qdrops so
  users can see what was wrong in Rx path.
o Added a workaround for a hardware bug which resulted in short
  VLAN tagged frames(e.g. ARP) was rejected as if runt frame was
  received. With this workaround nge(4) now accepts the short VLAN
  tagged frame and nge(4) can take full advantage of hardware VLAN
  tag stripping. I have no idea how this bug wasn't known so far,
  without the workaround nge(4) may never work on VLAN
  environments.
o Fixed Rx checksum offload logic such that it now honors active
  interface capability configured with ifconfig(8).
o In nge_start()/nge_txencap(), always leave at least one free
  descriptor as indicated in datasheet. Without this the hardware
  would be confused with ring descriptor structure(e.g. no clue
  for the end of descriptor ring).
o Removed dead-code that checks interrupts on PHY hardware. The
  code was designed to detect link state changes but it was
  disabled as driving nge_tick clock would break auto-negotiation
  timer. This code is no longer needed as nge(4) now uses mii(4)
  and link state change handling is done with mii callback.
o Rearranged ethernet address programming logic such that it works
   on strict-alignment architectures.
o Added IFCAP_VLAN_HWTAGGING/IFCAP_VLAN_HWCSUM handler in
   nge_ioctl() such that the functionality is configurable with
   ifconfig(8). DP83820/DP83821 can do checksum offload for VLAN
   tagged frames so enable Tx/Rx checksum offload for VLAN
   interfaces.
o Simplified IFCAP_POLLING selection logic in nge_ioctl().
o Fixed module unload panic when bpf listeners are active.
o Tx/Rx descriptor ring address uses 64bit DMA address for
   readability. High address part of DMA would be 0 as nge(4)
   disabled 64bit DMA transfers so it's ok for DP83821.
o Removed volatile keyword in softc as bus_dmamap_sync(9) should
   take care of this.
o Removed extra driver private structures in descriptor ring. These
   extra elements are not part of descriptor structure. Embedding
   private driver structure into descriptor ring is not good idea
   as its size may be different on 32bit/64bit architectures.
o Added miibus_linkchg method handler to catch link state changes.
o Removed unneeded nge_ifmedia in softc. All TBI access is handled
  in gentbi(4). There is no difference between TBI and non-TBI case
  now.
o Removed "gigabit link up" message handling in nge_tick. Link
  state change notification is already performed by mii(4) and
  checking link state by accessing PHY registers in periodic timer
  handler of driver is wrong. All link state and speed/duplex
  monitoring should be handled in PHY driver.
o Use our own timer for watchdog instead of if_watchdog/if_timer
  interface.
o Added hardware MAC statistics counter, users canget current MAC
  statistics from dev.nge.%d.stats sysctl node(%d is unit number of
  a device).
o Removed unused macros, NGE_LASTDESC, NGE_MODE, NGE_OWNDESC,
  NGE_RXBYTES.
o Increased number of Tx/Rx descriptors from 128 to 256. From my
  experience on gigabit ethernet controllers, number of descriptors
  should be 256 or higher to get an optimal performance on gigabit
  link.
o Increased jumbo frame length to 9022 bytes to cope with other
  gigabit ethernet drivers. Experimentation shows no problems with
  9022 bytes.
o Removed unused member variables in softc.
o Switched from bus_space_{read|write}_4 to bus_{read|write}_4.
o Added support for WOL.
2009-05-21 02:12:10 +00:00
Andrew Thompson
fadc970b77 Fix a few variable renames of usb2_mode outside dev/usb. 2009-05-21 02:09:12 +00:00
Rick Macklem
b839e625b0 Modify sys/fs/nfsserver/nfs_nfsdport.c to use nlm_acquire_next_sysid()
to set the l_sysid for locks correctly.

Approved by:	kib (mentor)
2009-05-21 01:50:27 +00:00
Andrew Thompson
9360ae4073 Rename the usb sysctl tree from hw.usb2.* back to hw.usb.*.
Submitted by:	Hans Petter Selasky
2009-05-21 01:48:42 +00:00
Rick Macklem
596c08801d Add a function to sys/nlm/nlm_prot_impl.c that returns a unique
lock sysid to be used for non-nlm remote locking. This is required
for the experimental nfsv4 server, so that it can acquire byte
range locks correctly on behalf of nfsv4 clients.

Reviewed by:	dfr
Approved by:	kib (mentor)
2009-05-21 01:14:12 +00:00
Andrew Thompson
8d2dd5dd85 Use enums for speed and rev data types. 2009-05-21 01:05:21 +00:00
Andrew Thompson
f29a072444 - rename usb2_mode to usb_mode [1]
- change variable types to use the enum

Submitted by:	Hans Petter Selasky [1]
2009-05-21 00:04:17 +00:00
Sam Leffler
74904f7d58 update for net80211 rx api change 2009-05-20 23:33:40 +00:00
Warner Losh
68fc5ce70b Revert last junk... 2009-05-20 22:28:55 +00:00
George V. Neville-Neil
1fdc45cd2e A few more style changes as well as a more broad allowance for
errors to be given by the caller.  Change output to be easier
for use in scripts.

Submitted by:	bce
2009-05-20 22:19:22 +00:00
Edwin Groothuis
a2f237f8b7 Add regression tests for the date(1) + argument for user-defined
format strings.

PR:		bin/127514
Submitted by:	edwin@
MFC after:	1 week
2009-05-20 22:01:43 +00:00
Warner Losh
89c81b88f1 Revert junk from last commit. These are WIP and not ready (and don't
match the description of the last commit).
2009-05-20 22:00:39 +00:00
Warner Losh
9e31449738 Last commit was in error, revert. 2009-05-20 21:31:47 +00:00
Qing Li
c9d763bf41 When an interface address is removed and the last prefix
route is also being deleted, the link-layer address table
(arp or nd6) will flush those L2 llinfo entries that match
the removed prefix.

Reviewed by:	kmacy
2009-05-20 21:07:15 +00:00
Sam Leffler
f6ac50113f Prepare to distribute sysctl code to reduce global definitions:
o expose net.wlan sysctl node
o expose ieee80211_sysctl_msecs_ticks

Reviewed by:	rpaulo, thompsa
2009-05-20 20:18:01 +00:00
Sam Leffler
23790ac0d7 bump for net80211 monitor mode changes 2009-05-20 20:05:56 +00:00
Sam Leffler
5463c4a485 Overhaul monitor mode handling:
o replace DLT_IEEE802_11 support in net80211 with DLT_IEEE802_11_RADIO
  and remove explicit bpf support from wireless drivers; drivers now
  use ieee80211_radiotap_attach to setup shared data structures that
  hold the radiotap header for each packet tx/rx
o remove rx timestamp from the rx path; it was used only by the tdma support
  for debugging and was mostly useless due to it being 32-bits and mostly
  unavailable
o track DLT_IEEE80211_RADIO bpf attachments and maintain per-vap and
  per-com state when there are active taps
o track the number of monitor mode vaps
o use bpf tap and monitor mode vap state to decide when to collect radiotap
  state and dispatch frames; drivers no longer explicitly directly check
  bpf state or use bpf calls to tap frames
o handle radiotap state updates on channel change in net80211; drivers
  should not do this (unless they bypass net80211 which is almost always
  a mistake)
o update various drivers to be more consistent/correct in handling radiotap
o update ral to include TSF in radiotap'd frames
o add promisc mode callback to wi

Reviewed by:	cbzimmer, rpaulo, thompsa
2009-05-20 20:00:40 +00:00
Rick Macklem
29e890f126 Although it should never happen, all the nfsv4 server can do
when it runs out of clientids is reboot. I had replaced cpu_reboot()
with printf(), since cpu_reboot() doesn't exist for sparc64.
This change replaces the printf() with panic(), so the reboot
would occur for this highly unlikely occurrence.

Approved by:	kib (mentor)
2009-05-20 18:58:07 +00:00
John Baldwin
85de716af3 Add a new locking note for p_aioinfo as it is not a normal PROC_LOCK field. 2009-05-20 18:45:49 +00:00
John Baldwin
6ca33ea345 Set the umask in a new file descriptor table earlier in fdcopy() to remove
two lock operations.
2009-05-20 18:42:04 +00:00
Joel Dahl
498a9afee2 Slightly adjust copyright text.
Approved by:	matk
2009-05-20 18:38:43 +00:00
John Baldwin
31bd8c7dcf Comment nits. 2009-05-20 18:36:17 +00:00
Joel Dahl
e05a128eb7 Remove license clauses 3 and 4 as per rev. 1.65 of midi.c in NetBSD.
Approved by:	matk
2009-05-20 18:34:26 +00:00
Joel Dahl
4367b59545 Remove license clauses 3 and 4 as per rev. 1.65 of auvia.c in NetBSD. 2009-05-20 18:31:11 +00:00
John Baldwin
583220dc4c Remove an obsolete assertion. We always wake up all waiters when unlocking
a mutex and never set the lock cookie == MTX_CONTESTED.
2009-05-20 18:29:14 +00:00
John Baldwin
63ba66086a Put the vnode returned from namei() immediately after namei() returns in
svr4_sys_resolvepath().
2009-05-20 18:25:16 +00:00
Joel Dahl
1d631ee69a Remove license clauses 3 and 4 as per rev. 1.112 of uaudio.c and rev. 1.15 of
uaudioreg.h in NetBSD.
2009-05-20 18:15:13 +00:00
Joel Dahl
ba55ca9732 Remove license clauses 3 and 4 as per rev. 1.12 of cs4231reg.h in NetBSD. 2009-05-20 18:04:56 +00:00
John Baldwin
e57c620d84 Tweak some comments. 2009-05-20 17:59:49 +00:00
Warner Losh
00b4e54ae7 We no longer need to use d_thread_t, migrate to struct thread *. 2009-05-20 17:29:21 +00:00
John Baldwin
4ab9c8af92 Fix a typo. 2009-05-20 17:19:30 +00:00
Andrew Thompson
6f6932dc0b Use defines for register offsets that do not change.
Submitted by:	Hans Petter Selasky
2009-05-20 17:03:12 +00:00
Warner Losh
8060a8933e Use struct thread instead of d_thread_t. 2009-05-20 17:01:40 +00:00
Andrew Thompson
7eaa41aed8 - Add new register definitions
- Enable the controller and wait for the PLL to start

Submitted by:	Hans Petter Selasky
2009-05-20 17:00:55 +00:00
Warner Losh
78bf597bb3 Replace d_thread_t * with struct thread *. 2009-05-20 17:00:16 +00:00
Andrew Thompson
b28838a861 The register shift is not needed on this controller.
Submitted by:	Hans Petter Selasky
2009-05-20 16:58:53 +00:00
Warner Losh
248343f9d1 We no longer need to use d_thread_t for portability here, switch to
struct thread *.
2009-05-20 16:58:16 +00:00
Warner Losh
1de9b53249 We don't need d_thread_t for cross-branch portability here anymore.
Move do struct thread * instead.
2009-05-20 16:47:40 +00:00
Warner Losh
09605c1806 Some minor style changes:
o Convert K&R function definitions to ANSI
o Eliminate spaces/tabs that should have been deleted as part of the de__P
  efforts
o Use struct thread * in preference to d_thread_t *.
2009-05-20 16:29:22 +00:00
John Baldwin
515c5b1ede Don't bother reading the initial value of the machine check banks during
startup on Pentium 4 CPUs.  This wasn't safe to do on APs during AP startup,
was of limited value, and won't be used for future processors.
2009-05-20 16:11:22 +00:00
Alexander Motin
74150c398a Fix NULL dereference on Promise SX4 controllers, while executing commands
that do not require data transfer (FLUSHCACHE).

Tested by:	Magnus Kling <klingfon@gmail.com>
MFC after:	1 week
2009-05-20 09:44:32 +00:00