DragonFly BSD

CVS log for src/sys/dev/netif/em/if_em.c

[BACK] Up to [DragonFly] / src / sys / dev / netif / em

Request diff between arbitrary revisions


Keyword substitution: kv
Default branch: MAIN


Revision 1.80: download - view: text, markup, annotated - select for diffs
Wed Sep 17 08:51:29 2008 UTC (5 years, 10 months ago) by sephe
Branches: MAIN
CVS tags: HEAD
Diff to: previous 1.79: preferred, unified
Changes since revision 1.79: +0 -11 lines
Always enable ETHER_INPUT_CHAIN support

Revision 1.79: download - view: text, markup, annotated - select for diffs
Wed Sep 17 07:51:58 2008 UTC (5 years, 10 months ago) by sephe
Branches: MAIN
Diff to: previous 1.78: preferred, unified
Changes since revision 1.78: +1 -1 lines
Remove the '2' suffix from ether_input_chain and vlan_input; their counterparts
have gone for a long time.

Revision 1.78: download - view: text, markup, annotated - select for diffs
Sun Aug 17 04:32:33 2008 UTC (5 years, 11 months ago) by sephe
Branches: MAIN
Diff to: previous 1.77: preferred, unified
Changes since revision 1.77: +1 -1 lines
Nuke INTR_NETSAFE

Revision 1.77: download - view: text, markup, annotated - select for diffs
Sun Jul 27 10:06:55 2008 UTC (6 years ago) by sephe
Branches: MAIN
Diff to: previous 1.76: preferred, unified
Changes since revision 1.76: +0 -4 lines
Switch to ETHER_INPUT2 on ethernet input path by default:
- Nuke old ether_input_chain and ether_demux_chain
- Nuke old vlan_input
- Nuke ETHER_INPUT2 kernel option
- Adjust comment about functions on old ether input path
- Adjust NIC drivers which aware ETHER_INPUT2

vlan(4):
Clearing of ifnet.if_vlantrunks is now protected in the following way
    trunks = ifp->if_vlantrunks;
    ifp->if_vlantrunks = NULL;
    netmsg_service_sync();
    kfree(trunks);
Users of ifnet.if_vlantrunks have already been adjusted to aware of this.

bridge(4):
Clearing of ifnet.if_bridge is now protected in the following way
    ifp->if_bridge = NULL;
    netmsg_service_sync();
Users of ifnet.if_bridge have already been adjusted to aware of this.

carp(4):
Remove the LK_NOWAIT lockmgr lock flags; using LK_NOWAIT was actually a
workaround for that lockmgr lock was used in NIC's interrupt routine
(i.e. old ether_input)
Dragonfly-bug: <http://bugs.dragonflybsd.org/issue957>

ipflow:
- Now per-cpu ipflow hash table installs its own ipflow entry instead of
  having ipflow entry duplicated onto each cpu
- Remove the serializer parameter to ipflow_fastforward()
- Comment out ipflow_fastforward() in ef(4) and ppp(4), they need to be
  changed to fit the current ipflow cpu localization model

Revision 1.76: download - view: text, markup, annotated - select for diffs
Tue Jul 22 12:08:41 2008 UTC (6 years ago) by sephe
Branches: MAIN
CVS tags: DragonFly_Preview
Diff to: previous 1.75: preferred, unified
Changes since revision 1.75: +3 -19 lines
Don't let PROMISC interfere hardware vlan tagging operation.  Enable hardware
vlan tagging after this change.

Revision 1.75: download - view: text, markup, annotated - select for diffs
Tue Jun 24 13:32:27 2008 UTC (6 years, 1 month ago) by sephe
Branches: MAIN
CVS tags: DragonFly_RELEASE_2_0_Slip, DragonFly_RELEASE_2_0
Diff to: previous 1.74: preferred, unified
Changes since revision 1.74: +1 -3 lines
Move mbuf chain initialization into common place.

Revision 1.74: download - view: text, markup, annotated - select for diffs
Tue Jun 24 11:17:16 2008 UTC (6 years, 1 month ago) by sephe
Branches: MAIN
Diff to: previous 1.73: preferred, unified
Changes since revision 1.73: +0 -2 lines
VLAN_MTU works as expected on em(4)

Revision 1.73: download - view: text, markup, annotated - select for diffs
Mon Jun 23 11:57:19 2008 UTC (6 years, 1 month ago) by sephe
Branches: MAIN
Diff to: previous 1.72: preferred, unified
Changes since revision 1.72: +4 -0 lines
Add ether_input_chain2() which could be called by ethernet NIC drivers to
deliver packets into upper layer.  Unlike ether_input_chain(), this function
only locates the msgport for the input packets, rest of the functionalities
of ether_input_chain() are performed in the protocal threads, i.e. after
packets reaches target msgports.  This function and other related functions
are put under kernel option ETHER_INPUT2, which is _not_ enabled by default.
As of this commit, vlan(4) and ipflow don't work with ether_input_chain2().

em(4) is adapted to aware ETHER_INPUT2.

Reviewed-by: dillon@, aggelos@ (early version)

# Additional comments are added to the the reviewed patch.

Revision 1.72: download - view: text, markup, annotated - select for diffs
Fri May 16 13:19:11 2008 UTC (6 years, 2 months ago) by sephe
Branches: MAIN
Diff to: previous 1.71: preferred, unified
Changes since revision 1.71: +7 -8 lines
Unify vlan_input() and vlan_input_tag():
- For device drivers that support hardware vlan tag extraction, mbuf's
  M_VLANTAG is turned on and vlan tag is saved in mbuf.m_pkthdr.ether_vlantag
- At the very beginning of ether_input_chain(), if the packet's ether type is
  vlan and hardware does not extract vlan tag, vlan_ether_decap() is called to
  do software vlan tag extraction.
- Instead of BPF_MTAP(), ETHER_BPF_MTAP() is used in ether_input_chain() to
  deliver possible vlan tagging information to the bpf listeners.
- Ether header is restored before calling vlan_input(), so under most cases,
  extra ether header copy is avoided.  vlan_input() does nothing more than
  finding vlan interface and looping back the packet to ether_input_chain()
  with vlan interface as input interface.

Ideas-from: FreeBSD

Revision 1.71: download - view: text, markup, annotated - select for diffs
Wed May 14 11:59:19 2008 UTC (6 years, 2 months ago) by sephe
Branches: MAIN
Diff to: previous 1.70: preferred, unified
Changes since revision 1.70: +16 -11 lines
Reduce ifnet.if_serializer contention on output path:
- Push ifnet.if_serializer holding down into each ifnet.if_output implementation
- Add a serializer into ifaltq, which is used to protect send queue instead of
  its parent's if_serializer.  This change has following implication:
  o  On output path, enqueueing packets and calling ifnet.if_start are decoupled
  o  In device drivers, poll->dev_encap_ok->dequeue operation sequence is no
     longer safe, instead dequeue->dev_encap_fail->prepend should be used
  This serializer will be held by using lwkt_serialize_adaptive_enter()
- Add altq_started field into ifaltq, which is used to interlock the calling
  of its parent's if_start, to reduce ifnet.if_serializer contention.
  if_devstart(), a helper function which utilizes ifaltq.altq_started, is added
  to reduce code duplication in ethernet device drivers.
- Add if_cpuid into ifnet.  This field indicates on which CPU device driver's
  interrupt will happen.
- Add ifq_dispatch().  This function will try to hold ifnet.if_serializer in
  order to call ifnet.if_start.  If this attempt fails, this function will
  schedule ifnet.if_start to be called on CPU located by ifnet.if_start_cpuid
  if_start_nmsg, which is per-CPU netmsg, is added to ifnet to facilitate
  ifnet.if_start scheduling.  ifq_dispatch() is called by ether_output_frame()
  currently
- Use ifq_classic_ functions, if altq is not enabled
- Fix various device drivers bugs in their if_start implementation
- Add ktr for ifq classic enqueue and dequeue
- Add ktr for ifnet.if_start

Revision 1.70: download - view: text, markup, annotated - select for diffs
Fri May 2 07:40:32 2008 UTC (6 years, 2 months ago) by sephe
Branches: MAIN
Diff to: previous 1.69: preferred, unified
Changes since revision 1.69: +19 -0 lines
Introduce ETHER_INPUT_CHAIN option:
1) During RXEOF, we aggregate packets, which have same target CPU, instead of
   calling lwkt_sendmsg() for each input packet.
2) At the end of RXEOF, low level ipiq sending is used to dispatch mbuf chain
   to the target CPU.
3) On the target CPU, the ipi function puts mbuf to their belonging msgport.
   Note, though lwkt_sendmsg() is used in ipi function, no further ipi activity
   will happen, since we are on target CPU.

em(4) is made to aware of this option.
This option is off by default and has no effect on vlan(4) operation.

Revision 1.69: download - view: text, markup, annotated - select for diffs
Thu May 1 02:03:28 2008 UTC (6 years, 3 months ago) by sephe
Branches: MAIN
Diff to: previous 1.68: preferred, unified
Changes since revision 1.68: +0 -7 lines
- Promote em(4) polling begin/end ktr into polling(4)
- Add crit section around if_poll

Revision 1.68: download - view: text, markup, annotated - select for diffs
Thu Apr 3 12:55:15 2008 UTC (6 years, 3 months ago) by sephe
Branches: MAIN
Diff to: previous 1.67: preferred, unified
Changes since revision 1.67: +8 -0 lines
Add counters for serializer enter/try

Suggested-by: aggelos@

Revision 1.67: download - view: text, markup, annotated - select for diffs
Wed Apr 2 13:11:48 2008 UTC (6 years, 3 months ago) by sephe
Branches: MAIN
Diff to: previous 1.66: preferred, unified
Changes since revision 1.66: +12 -0 lines
- Add two fields in lwkt_serialize to profile serializer contention.
- Expose serializer contention data through em's private sysctl tree.

Revision 1.66: download - view: text, markup, annotated - select for diffs
Wed Apr 2 11:48:30 2008 UTC (6 years, 3 months ago) by sephe
Branches: MAIN
Diff to: previous 1.65: preferred, unified
Changes since revision 1.65: +4 -2 lines
Use sysctl_ctx in softc

Revision 1.65: download - view: text, markup, annotated - select for diffs
Mon Mar 10 12:59:51 2008 UTC (6 years, 4 months ago) by sephe
Branches: MAIN
Diff to: previous 1.64: preferred, unified
Changes since revision 1.64: +2 -1 lines
Add ETHER_BPF_MTAP() which will call vlan_ether_ptap() for packets whose vlan
tagging is offloaded to NIC.

Obtained-from: FreeBSD

Revision 1.64: download - view: text, markup, annotated - select for diffs
Mon Mar 10 10:47:57 2008 UTC (6 years, 4 months ago) by sephe
Branches: MAIN
Diff to: previous 1.63: preferred, unified
Changes since revision 1.63: +4 -9 lines
- Embed ether vlan tag in mbuf packet header.  Add an mbuf flag to mark that
  this field is valid.
- Hide ifvlan after the above change; drivers support hardware vlan tagging
  only need to check ether_vlantag in mbuf packet header.
- Convert all drivers that support hardware vlan tagging to use vlan tag field
  in mbug packet header.

Obtained-from: FreeBSD

Change the vlan/parent serializer releasing/holding sequences into mbuf
dispatching.  There are several reasons to do so:
- Avoid excessive vlan interface serializer releasing/holding
- Touching parent interface if_snd without holding parent's serializer is
  unsafe
- vlan's parent may disappear or be changed after vlan's serializer is released

# This dispatching could be further optimized by packing all mbufs into one
# netmsg using m_nextpkt to:
# - Amortize netmsg sending cost
# - Reduce the time that parent interface spends on serializer releasing/holding

Revision 1.63: download - view: text, markup, annotated - select for diffs
Tue Feb 5 11:12:27 2008 UTC (6 years, 5 months ago) by sephe
Branches: MAIN
CVS tags: DragonFly_RELEASE_1_12_Slip, DragonFly_RELEASE_1_12
Diff to: previous 1.62: preferred, unified
Changes since revision 1.62: +1 -1 lines
Set flow control pause time to 512us _again_ as it was two years ago
(if_em.c rev1.42).

Submitted-by: Gary Stanley <gary@velocity-servers.net>

Revision 1.62: download - view: text, markup, annotated - select for diffs
Thu Jan 10 10:44:28 2008 UTC (6 years, 6 months ago) by matthias
Branches: MAIN
Diff to: previous 1.61: preferred, unified
Changes since revision 1.61: +22 -1 lines
Add support for network devices found on Intel ICH9 hardware.  I have one
of these devices in a 3GHz Core 2 Duo.  More information can be found
here: http://download.intel.com/design/chipsets/datashts/31697202.pdf

The diff is rather trivial, but let me know if I broke something :)

em0@pci0:25:0:  class=0x020000 card=0x00018086 chip=0x10bd8086 rev=0x02 hdr=0x00
    vendor   = 'Intel Corporation'
    device   = '82566DM-2 Gigabit Network Connection'
    class    = network
    subclass = ethernet

em0: <Intel(R) PRO/1000 Network Connection, Version - 6.2.9> port 0x30e0-0x30ff
mem 0x93224000-0x93224fff,0x93200000-0x9321ffff irq 11 at device 25.0 on pci0

Reviewed-by: sephe@
Taken-in-pieces-from:  FreeBSD

Revision 1.61: download - view: text, markup, annotated - select for diffs
Mon Nov 26 11:05:58 2007 UTC (6 years, 8 months ago) by sephe
Branches: MAIN
Diff to: previous 1.60: preferred, unified
Changes since revision 1.60: +1 -1 lines
Use m_freem() instead of m_free()

Revision 1.60: download - view: text, markup, annotated - select for diffs
Tue Aug 14 13:30:35 2007 UTC (6 years, 11 months ago) by sephe
Branches: MAIN
Diff to: previous 1.59: preferred, unified
Changes since revision 1.59: +2 -1 lines
Add a new csum flag to tell IP defragmenter that csum_data does _not_
contain a valid IP fragment payload checksum.  This flag is only intented
to be used by IP defragmenter.

Currently only bce(4), bge(4) and ti(4) provide valid IP fragment payload
checksum.  Turn on the new csum flag for the rest of the drivers, which
support hardware TCP/UDP checksum offload but hard-wire csum_data to 0xffff,
to avoid bypassing verification of defragmented payload's checksum.

Discussed-with: dillon@, hsu@
Approved-by: dillon@

Revision 1.59: download - view: text, markup, annotated - select for diffs
Mon May 14 12:31:41 2007 UTC (7 years, 2 months ago) by sephe
Branches: MAIN
CVS tags: DragonFly_RELEASE_1_10_Slip, DragonFly_RELEASE_1_10
Diff to: previous 1.58: preferred, unified
Changes since revision 1.58: +1 -1 lines
Use M_DONTWAIT for mcluster allocation on em_init() path to prevent system
hanging, if user configures RX descriptors to the maximum allowable value,
but kern.ipc.nmbclusters tunable is forgotten to be adjusted accordingly.

System-Hanging-Experienced-by: hasso@ :P

# This commit can be reverted once object cache limit can grow automaticly.

Revision 1.58: download - view: text, markup, annotated - select for diffs
Tue May 1 00:05:17 2007 UTC (7 years, 3 months ago) by dillon
Branches: MAIN
Diff to: previous 1.57: preferred, unified
Changes since revision 1.57: +1 -0 lines
Implement kern.do_async_attach. default disabled.  To enable add
kern.do_async_attach="1" to your /boot/loader.conf.  This feature allows
conforming drivers to attach in their own thread, allowing multiple
drivers to attach in parallel.

Implement a new device state, DS_INPROGRESS.  Seems to work properly.
Implement device_set_async_attach(), which allows a device's probe
function to indicate that it is ok for its attach function to be run in
its own thread.

Split tsleep's enable out from the 'cold' variable. tsleep works earlier
then when cold is cleared.  Add a 'tsleep_now_works' variable to take
over the functionality.

Implement DRIVERSLEEP()... similar to DELAY(), this function works in
any context and will call lwkt_switch() in its spin loop.  It isn't perfect
yet.

ATA/NATA:
    * Uses the new async attach feature
    * Uses DRIVERSLEEP
    * No longer uses a configuration interrupt hook.  Interrupts are now
      available during device config.

    NOTE: atapicam does not seem to be scanning the 'bus' (from cam's point
    of view), so 'cd0' is not found until CAM scans the bus itself in the
    interrupt config hook code.

USB:
    * Uses the new async attach feature
    * Uses tsleep instead of DELAY

MISC:
    * IF_EM, IF_NFE also use the async attach feature as a test, but it
      doesn't seem to have a huge effect.

Revision 1.57: download - view: text, markup, annotated - select for diffs
Sun Apr 15 12:50:49 2007 UTC (7 years, 3 months ago) by sephe
Branches: MAIN
Diff to: previous 1.56: preferred, unified
Changes since revision 1.56: +5 -0 lines
Expose number of TX/RX descriptors through read-only sysctl hw.emX.{txd,rxd}.

Submitted-by: Hasso Tepper <hasso@estpak.ee>
Approved-by: dillon@

Revision 1.56: download - view: text, markup, annotated - select for diffs
Sat Mar 24 05:57:49 2007 UTC (7 years, 4 months ago) by sephe
Branches: MAIN
Diff to: previous 1.55: preferred, unified
Changes since revision 1.55: +7 -8 lines
Report link states changes (link up/down and braudrate changes) through
routing socket.

Miibus(4) aware network drivers can benifit from this change without
adapatation.  Em(4), which is not miibus(4) aware, is adapted to support
this change.

Submitted-by: Hasso Tepper <hasso@estpak.ee>
Obtained-from: OpenBSD w/ modification
Reviewed-by: dillon@

Revision 1.55: download - view: text, markup, annotated - select for diffs
Tue Jan 23 11:09:25 2007 UTC (7 years, 6 months ago) by sephe
Branches: MAIN
CVS tags: DragonFly_RELEASE_1_8_Slip, DragonFly_RELEASE_1_8
Diff to: previous 1.54: preferred, unified
Changes since revision 1.54: +5 -3 lines
Check EEPROM twice in em_hardware_init(), because for some PCIe em(4) first
checking will fail if link is down.  Add comment about it.

This should solve the problem for Lenovo/IBM laptop users: if link is down,
then em(4) will not be initialized properly.

Submitted-and-Tested-by: Michal Belczyk <belczyk@bsd.krakow.pl>
Obtained-from: FreeBSD current list, Jack Vogel <jfvogel@gmail.com>

Revision 1.54: download - view: text, markup, annotated - select for diffs
Sun Jan 21 10:44:45 2007 UTC (7 years, 6 months ago) by sephe
Branches: MAIN
Diff to: previous 1.53: preferred, unified
Changes since revision 1.53: +7 -0 lines
Add a workaround for some Lenovo/IBM laptops' onboard em(4).

Without this workaround, em(4) is extremely slow when TXing packets, though
polling(4) seems to make the situation better, the speed is still far from
expectation for 100BaseTX-FDX network.

Reported-by: Michal Belczyk <belczyk@bsd.krakow.pl>
Obtained-from: FreeBSD-current mail list, Jack Vogel <jfvogel@gmail.com>

# According to Jack Vogel:
# "saying its known to be a problem doesnt mean its cause is known"

Revision 1.53: download - view: text, markup, annotated - select for diffs
Sat Dec 23 10:39:16 2006 UTC (7 years, 7 months ago) by sephe
Branches: MAIN
Diff to: previous 1.52: preferred, unified
Changes since revision 1.52: +582 -490 lines
Sync with Intel's em-6.2.9
- Support more chips.
- Implement suspend/resume device methods.
- Correct promisc mode support.
- Code and comment clean up.
- Avoid reinitializing the hardware if only IP address is changed.  This is
  implemented in a different way from Intel's:
  If IFF_RUNNING is set, em_init() will return immediately.  So for some
  situation in which em_init() must run, IFF_RUNNING is cleared before calling
  em_init().
- Rework TX processing:
  In em_encap(), save the index of the packet's last TX descriptor (EOP) in
  the packet's first descriptor.  In em_txeof(), test E1000_TXD_STAT_DD bit
  only for last TX descriptor (EOP) of certain packet.  If it is set, then
  reap the TX descriptors of the packet in an inner loop.
  "This change is important for future chips, where DD bit is going
   to be set only on the EOP descriptors." -- Jack Vogel at Intel

Revision 1.52: download - view: text, markup, annotated - select for diffs
Wed Dec 20 18:14:39 2006 UTC (7 years, 7 months ago) by dillon
Branches: MAIN
Diff to: previous 1.51: preferred, unified
Changes since revision 1.51: +1 -1 lines
Rename sprintf  -> ksprintf
Rename snprintf -> knsprintf

Make allowances for source files that are compiled for both userland and
the kernel.

Revision 1.51: download - view: text, markup, annotated - select for diffs
Sat Dec 9 01:44:23 2006 UTC (7 years, 7 months ago) by swildner
Branches: MAIN
Diff to: previous 1.50: preferred, unified
Changes since revision 1.50: +2 -0 lines
Fix compilation warnings when compiling without DEVICE_POLLING.

Revision 1.46.2.2: download - view: text, markup, annotated - select for diffs
Mon Nov 27 13:18:11 2006 UTC (7 years, 8 months ago) by sephe
Branches: DragonFly_RELEASE_1_6
CVS tags: DragonFly_RELEASE_1_6_Slip
Diff to: previous 1.46.2.1: preferred, unified; next MAIN 1.47: preferred, unified
Changes since revision 1.46.2.1: +8 -4 lines
MFC if_em.c rev1.50:
In em_process_receive_interrupts(), keep processing RX ring, even if
em_get_buf() fails.  This prevents RX engine from stalling under
extreme load.

Revision 1.50: download - view: text, markup, annotated - select for diffs
Mon Nov 27 13:05:15 2006 UTC (7 years, 8 months ago) by sephe
Branches: MAIN
Diff to: previous 1.49: preferred, unified
Changes since revision 1.49: +8 -4 lines
The Problem [1]:
In em_process_receive_interrupts(), if em_get_buf() fails, which
may be a common case since it calls m_getcl() with MB_DONTWAIT,
then the rest of the RX ring are _not_ processed at all.  The RX
ring may contain many, or even worse is full of, ready RX descriptors.
RDT will not be updated too, in this case.  So hardware will take
this situation as there is _no_ free space in RX ring, and this
probably leads to following catastrophe:
too many RX engine overruns -> RX engine stalls -> interrupts stall [2]

The Fix:
If em_get_buf() fails then
- The current RX descriptor still will be reaped, but the frame,
  which belongs to the current RX descriptor, is not delivered to
  the upper layer.
- RX ring processing keeps going as if there is no failure happens.

Thank dillon@ to help diagnose the problem and give various hints [3]

Thank Mike Tancsa <mike@sentex.net> to provide enough information
to locate the problem.

Reviewed-by: dillon@
Reported-by: Mike Tancsa <mike@sentex.net>
Tested-by: Mike Tancsa <mike@sentex.net> (82571EB copper dual port)
           me (82540EM)

#
# [1] This problem unveiled itself when Mike tried to bench packet
#     forwarding performance.  The information he had provided that
#     is critical to locate the problem is:
#     1) Both polling(4) and normal mode (interrupt based) do not work.
#        This means that interrupt processing possibly not the root of
#        the problem (pointed out by dillon@)
#     2) One line in the output of sysctl hw.em0.debug_info=1:
#        ...
#        em0: Std mbuf cluster failed = 2
#        ...
#        This statistics is the value of adapter->mbuf_cluster_failed,
#        which is updated only when m_getcl() in em_get_buf() fails
#
# [2] This is just a guess from the output of 'vmstat -i' provided by Mike
#     Before his benching:
#     interrupt                   total       rate
#     ...
#     em0                            28          0
#     ...
#     After his benching (i.e. em0 choked):
#     interrupt                   total       rate
#     ...
#     em0                            62          0
#     ...
#     See, only 34 interrupts came o_O
#
# [3] There is still prossibility that RX engine gets confused by
#     the driver.  It is described by dillon@:
#     (I didn't find the URL in the archive, so it is pasted here)
#     "...
#      Clearly when that case occurs ALL the receive frames will be full.
#      Lets look at a degenerate case:
#
#      [0 ...................... N-1]
#      * RDH set to 0
#      * RDT set to N-1
#      * N frames come in  RDH is set to N-1 (??)
#      * We process N frames
#      * The frame at RING[N-1] is cleaned up
#      * i = N
#      * We set RDT to i-1 == N-1.  It's the same value it was set to before
#        we processed all N frames.  The receive engine will think that the
#        ring is still full when it is empty.
#
#      I Think what we need to do here is set RDT to N-2 (mod N of course) in
#      the case where we have processed ALL N frames.  I'll bet the firmware
#      is getting confused in the overrun case because we are setting RDT to
#      the same value it was set at before.
#      ..."
#

Revision 1.49: download - view: text, markup, annotated - select for diffs
Tue Sep 5 03:48:10 2006 UTC (7 years, 10 months ago) by dillon
Branches: MAIN
Diff to: previous 1.48: preferred, unified
Changes since revision 1.48: +1 -1 lines
Rename malloc->kmalloc, free->kfree, and realloc->krealloc.  Pass 2

Revision 1.48: download - view: text, markup, annotated - select for diffs
Tue Sep 5 00:55:40 2006 UTC (7 years, 10 months ago) by dillon
Branches: MAIN
Diff to: previous 1.47: preferred, unified
Changes since revision 1.47: +4 -4 lines
Rename malloc->kmalloc, free->kfree, and realloc->krealloc.  Pass 1

Revision 1.46.2.1: download - view: text, markup, annotated - select for diffs
Sun Aug 20 08:22:05 2006 UTC (7 years, 11 months ago) by sephe
Branches: DragonFly_RELEASE_1_6
Diff to: previous 1.46: preferred, unified
Changes since revision 1.46: +20 -4 lines
MFC part of if_em.c rev1.47:

- Properly serialize em_shutdown()
- (BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD) -> BUS_DMASYNC_PREWRITE
- Correct polling(4) support: disable interrupt if polling(4) is enabled.

Revision 1.47: download - view: text, markup, annotated - select for diffs
Sat Aug 12 13:03:44 2006 UTC (7 years, 11 months ago) by sephe
Branches: MAIN
Diff to: previous 1.46: preferred, unified
Changes since revision 1.46: +470 -187 lines
Sync with Intel's em(4) driver version 6.1.4
- Add support for new chipset revisions embedded in the ESB2 and ICH8 core
  logic chipsets.
- Add PCI id for the PCIe quad port copper adapter.	[*]
- Improve media support for fiber adapters.		[*]
- Instead of creating TX DMA map in em_encap(), create all of the during
  em_init().
  Fix a bug in Intel's code:
  The TX desc used to hold mbuf, does not necessarily have the DMA map
  that is used to load the mbuf, so in em_clean_transmit_interrupts() or
  during em_stop(), wrong DMA map may be used.
- Update README

Bug fixes:
- Properly serialize em_shutdown()
- (BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD) -> BUS_DMASYNC_PREWRITE
- Correct polling(4) support: disable interrupt if polling(4) is enabled.

Tested with an 82540EM.

# I have committed a slightly different version(6.1.4) than the version(6.0.5)
# posted to submit@, since 6.1.4 came immediately after my submission for
# testing/reviewing, and the difference between it and the submitted version
# is really very small (only added [*] part).

Revision 1.45.2.1: download - view: text, markup, annotated - select for diffs
Sun Jan 1 00:59:04 2006 UTC (8 years, 6 months ago) by dillon
Branches: DragonFly_RELEASE_1_4
CVS tags: DragonFly_RELEASE_1_4_Slip
Diff to: previous 1.45: preferred, unified; next MAIN 1.46: preferred, unified
Changes since revision 1.45: +9 -9 lines
MFC serializer fixes by Sepherosa Ziehau.  Primarily reorder the call to
ether_ifdetach and ieee80211_ifdetach and make the calls without holding the
serializer to avoid a panic.

Revision 1.46: download - view: text, markup, annotated - select for diffs
Sat Dec 31 14:07:59 2005 UTC (8 years, 7 months ago) by sephe
Branches: MAIN
Branch point for: DragonFly_RELEASE_1_6
Diff to: previous 1.45: preferred, unified
Changes since revision 1.45: +9 -9 lines
{ether,ieee80211}_ifdetach() can't be called with serializer being held, since
they will go through code which tries to hold serializer again, e.g.
ether_ifdetach() -> if_detach() -> in_control()

So in various NICs' xxx_detach():
- Move bus_teardown_intr() under "(device_is_attached())", whenever it is
  applicable.  Since it is not possible that intrhandle is NULL here, nuke
  original "(intrhandle != NULL)".  This can:
    1) Avoid holding serializer, if xxx_attach() fails
    2) Release serializer ASAP
    3) Ease following tasks
- Hold serializer only for xxx_stop()(or similar functions which stops NIC) and
  bus_teardown_intr()
- Call {ether,ieee80211}_ifdetach() after serializer is released

Other stuffs:
- Serialize xxx_detach() for awi(4), ep(4), sn(4) and xe(4)
- Release serializer before returning from {ed_pccard,ray}_detach()
- Make ipw(4)'s ipw_detach() suitable for error handling, adjust ipw_attach()
  accordingly
- Fix a bug in ex_pccard_detach(): instead of if_detach(), ether_ifdetach()
  should be used here
- For ndis(4), "ifp->serializer" ==> "ifp->if_serializer"
  Reported-by: esmith <esmith@postmark.net>

Discussed-with: dillon and joerg
Partially-Reviewed-by: dillon and joerg
Reported-by: Steve Mynott <steve.mynott@gmail.com> and me

Revision 1.45: download - view: text, markup, annotated - select for diffs
Sat Dec 10 18:28:18 2005 UTC (8 years, 7 months ago) by dillon
Branches: MAIN
Branch point for: DragonFly_RELEASE_1_4
Diff to: previous 1.44: preferred, unified
Changes since revision 1.44: +28 -1 lines
Add KTR logging for IF_EM to measure interrupt overhead and packet
receive / transmit / transmit-cleanup operations.

Revision 1.44: download - view: text, markup, annotated - select for diffs
Mon Nov 28 17:13:42 2005 UTC (8 years, 8 months ago) by dillon
Branches: MAIN
Diff to: previous 1.43: preferred, unified
Changes since revision 1.43: +130 -96 lines
Make all network interrupt service routines MPSAFE part 1/3.

Replace the critical section that was previously used to serialize access
with the LWKT serializer.  Integrate the serializer into the IFNET structure.
Note that kern.intr_mpsafe must be set to 1 for network interrupts to actually
run MPSAFE.  Also note that any interrupts shared with othre non-MP drivers
will cause all drivers on that interrupt to run with the Big Giant Lock.

Network interrupt - Each network driver then simply passes that serializer
to bus_setup_intr() so only a single serializer is required to process the
entire interrupt path.  LWKT serialization support is already 100% integrated
into the interrupt subsystem so it will already be held as of when the
registered interrupt procedure is called.

Ioctl and if_* functions - All callers of if_* functions (such as if_start,
if_ioctl, etc) now obtain the IFNET serializer before making the call.  Thus
all of these entry points into the driver will now be serialized.

if_input - All code that calls if_input now ensures that the serializer
is held.  It will either already be held (when called from a driver), or
the serializer will be wrapped around the call.  When packets are forwarded
or bridged between interfaces, the target interface serializer will be
dropped temporarily to avoid a deadlock.

Device Driver access - dev_* entry points into certain pseudo-network
devices now obtain and release the serializer.  This had to be done on
a device-by-device basis (but there are only a few such devices).

Thanks to several people for helping test the patch, in particular
Sepherosa Ziehau.

Revision 1.43: download - view: text, markup, annotated - select for diffs
Tue Nov 22 00:24:28 2005 UTC (8 years, 8 months ago) by dillon
Branches: MAIN
Diff to: previous 1.42: preferred, unified
Changes since revision 1.42: +1 -1 lines
Fix the design of ifq_dequeue/altq_dequeue by adding an mbuf pointer and
requiring that a polled mbuf be passed as an argument to the dequeue
function.  Assert that the passed argument matches the mbuf that is actually
dequeued.  Also remove assignments of the return value from ifq_dequeue()
in such cases which implied that the mbuf might be different when, in fact,
it had better not be.

Revision 1.42: download - view: text, markup, annotated - select for diffs
Tue Nov 8 12:48:18 2005 UTC (8 years, 8 months ago) by sephe
Branches: MAIN
Diff to: previous 1.41: preferred, unified
Changes since revision 1.41: +162 -101 lines
Sync with Intel's em(4) driver version 3.2.15
- Add support for 82571EB, 82572EI and 82573E adapters
- Nuke DBG_STATS related code and struct adapter's fields
- Flow control water marks are now calculated from hardware's register value
  instead of using hardwired values(FC_DEFAULT_{LOW, HIGH}_THRESH)
- Flow control pause time is bumped to 512us (old value is 131us) (*)
- In em_detach(), call bus_teardown_intr() if adapter.int_handler_tag != NULL
- Update Intel's LICENSE and README
- Update README to reflect recent changes to device polling
- Minor style changes

(*) Original code misuses 0x1000 (should be 1000) as em_hw.fc_pause_time

Revision 1.41: download - view: text, markup, annotated - select for diffs
Mon Oct 24 08:06:15 2005 UTC (8 years, 9 months ago) by sephe
Branches: MAIN
Diff to: previous 1.40: preferred, unified
Changes since revision 1.40: +2 -0 lines
- Move DEVICE_POLLING from opt_global.h to opt_polling.h(newly added),
  so that polling(4) can be enabled in modules that are not built
  during kernel building
- Add opt_polling.h to files that depend on DEVICE_POLLING
- Change related netif modules' Makefile to enable polling(4) support
- Add comment in net/if_var.h to prevent DEVICE_POLLING related
  incompatibilities from being introduced
  Suggested-by: dillon

NOTE: As of this commit, any file that will depend on DEVICE_POLLING
      *must* include opt_polling.h at its beginning

With-helps-from: joerg
Reviewed-by: dillon, submit@

Revision 1.40: download - view: text, markup, annotated - select for diffs
Mon Oct 17 06:18:36 2005 UTC (8 years, 9 months ago) by sephe
Branches: MAIN
Diff to: previous 1.39: preferred, unified
Changes since revision 1.39: +86 -29 lines
Sync with FreeBSD dev/em

if_em.c		rev 1.2.2.{20,21,22} 1.47 1.63
if_em.h		rev 1.1.2.17
if_em_hw.c	rev 1.1.2.12
if_em_hw.h	rev 1.1.2.12

- Add support for Intel PRO/1000 GT Desktop Adapter
- Add support for Intel 82546GB dual port PCIE adapter
- Add fix for 82547 which corrects an issue with Jumbo frames larger than 10k
- Add fix for vlan tagged frames not being properly bridged
- Correct TBI workaround
- Correct LED operation issues
- Do not count RNBC (internal buffer full) towards the RX error count,
  since it's not really an error
- Correct a workaround that should only be applied to one adapter.  Workaround
  was causing device hangs when incorrectly applied to other adapters (*)
- Run em_local_timer() once per second instead of running it once per 2 seconds.
  This makes gathering of stats more precise

(*) Detailed problem description is in FreeBSD's PR kern/66634

Revision 1.39: download - view: text, markup, annotated - select for diffs
Wed Oct 12 17:35:51 2005 UTC (8 years, 9 months ago) by dillon
Branches: MAIN
Diff to: previous 1.38: preferred, unified
Changes since revision 1.38: +1 -1 lines
Remove the INTR_TYPE_* flags.  The interrupt type is no longer used to
figure out which spl*() set an interrupt belongs to, because, well, spl's
no longer exist.

Revision 1.38: download - view: text, markup, annotated - select for diffs
Tue Oct 4 02:06:46 2005 UTC (8 years, 9 months ago) by sephe
Branches: MAIN
Diff to: previous 1.37: preferred, unified
Changes since revision 1.37: +19 -0 lines
add missing bus_dmamap_sync()

Obtained-from: FreeBSD dev/em/if_em.c rev1.50

Revision 1.37: download - view: text, markup, annotated - select for diffs
Sun Oct 2 13:19:55 2005 UTC (8 years, 9 months ago) by sephe
Branches: MAIN
Diff to: previous 1.36: preferred, unified
Changes since revision 1.36: +3 -2 lines
- In em_encap(), call seralized version of em_82547_move_tail(), since
  "serialize" is non-recursive and lwkt_serialize_enter() has been called
  before em_encap() (in em_start_serialized())
- minor style change

Revision 1.36: download - view: text, markup, annotated - select for diffs
Mon Aug 29 10:19:52 2005 UTC (8 years, 11 months ago) by sephe
Branches: MAIN
Diff to: previous 1.35: preferred, unified
Changes since revision 1.35: +0 -2 lines
Remove unnecessary bzero(softc).
With following exceptions:
  - ed(4) if_ed_cbus.c
  - snc(4)
They are PC-98 only.

Revision 1.35: download - view: text, markup, annotated - select for diffs
Thu Jun 9 02:03:38 2005 UTC (9 years, 1 month ago) by hsu
Branches: MAIN
Diff to: previous 1.34: preferred, unified
Changes since revision 1.34: +0 -1 lines
The header type of a mbuf doesn't change when appended onto a chain.

Revision 1.34: download - view: text, markup, annotated - select for diffs
Fri May 27 19:11:49 2005 UTC (9 years, 2 months ago) by joerg
Branches: MAIN
Diff to: previous 1.33: preferred, unified
Changes since revision 1.33: +5 -5 lines
Minor reorder of the code to make it easier to deal with capabilities.

Revision 1.33: download - view: text, markup, annotated - select for diffs
Thu May 26 09:10:36 2005 UTC (9 years, 2 months ago) by dillon
Branches: MAIN
Diff to: previous 1.32: preferred, unified
Changes since revision 1.32: +2 -0 lines
Properly initialize the serializer by calling lwkt_serialize_init().

Revision 1.32: download - view: text, markup, annotated - select for diffs
Wed May 25 01:44:21 2005 UTC (9 years, 2 months ago) by dillon
Branches: MAIN
Diff to: previous 1.31: preferred, unified
Changes since revision 1.31: +92 -82 lines
Rewrite the polling code.  Instead of trying to do fancy polling enablement
from inside the IF interrupt itself, which creates a headache in the code,
simply allow IFF_POLLING to be set and cleared via ifconfig.  This greatly
simplifies both the networking code and the polling code and allows polling
to be enabled and disabled at will on a per-network-interface basis.

* Drivers no longer have to have polling checks in the interrupt path.
* An if_poll function vector has been added.  Polling is supported if the
  driver initializes the vector.
* Registration command added to the poll function command list.
* Driver code for registration and deregistration is now greatly simplified.

The kernel polling code no longer randomly turns off the polling bit if an
interface goes down or is reset.

Remove IFCAP_POLLING, it serves no purpose.

Fix a couple of bugs in the serializer code.  Add a warning in
nexus_setup_intr if a driver tries to specify a serializer and an SPL.
A driver can specify one or the other, not both.

Convert the EM driver to use the new serializer API instead of SPLs.

Add ifconfig poll and ifconfig -poll support to ifconfig, and fix bugs
in the rtsock code that only returned the low 16 bits of the interface
flags so ifconfig properly reports when polling mode is turned on for an
interface.

NOTE to people using polling.  You must first enable polling via
kern.polling.enable, and then may specify the 'poll' directive in ifconfig
to enable it on a per interface basis.  If IFF_POLLING refuses to be set,
the device does not support polling.

Revision 1.31: download - view: text, markup, annotated - select for diffs
Tue May 24 20:59:01 2005 UTC (9 years, 2 months ago) by dillon
Branches: MAIN
Diff to: previous 1.30: preferred, unified
Changes since revision 1.30: +2 -2 lines
Get rid of bus_{disable,enable}_intr(), it wasn't generic enough for
our needs.

Implement some generic atomic.h functions to aid in the implementation of
a low level mutex.

Implement a generic low level sleep-mutex serializer, kern/lwkt_serialize.c.
The serializer is designed to be a replacement for SPL calls but may also
be used for other very low level work (e.g. lockmgr interlocks).

Add a serializer argument to BUS_SETUP_INTR().  When non-NULL, the interrupt
handler will no longer be protected by an SPL so e.g. spl*() will no
longer protect against that device's interrupts.

The IF queueing and dequeueing mechanisms may no longer depend on outside
SPL state because network driver interrupt handlers are no longer required to
enter splnet().  Use critical sections for the moment.  The IFQ and
IFF_OACTIVE interactions are not yet MP safe.

Revision 1.30: download - view: text, markup, annotated - select for diffs
Mon May 23 18:20:47 2005 UTC (9 years, 2 months ago) by dillon
Branches: MAIN
Diff to: previous 1.29: preferred, unified
Changes since revision 1.29: +8 -0 lines
Have the EM device call the new interrupt enablement and disablement
functions to avoid handler races.

Revision 1.29: download - view: text, markup, annotated - select for diffs
Mon Feb 14 17:11:12 2005 UTC (9 years, 5 months ago) by joerg
Branches: MAIN
CVS tags: DragonFly_Stable, DragonFly_RELEASE_1_2_Slip, DragonFly_RELEASE_1_2
Diff to: previous 1.28: preferred, unified
Changes since revision 1.28: +1 -0 lines
Set ALTQ ready.

Revision 1.28: download - view: text, markup, annotated - select for diffs
Mon Feb 14 17:09:58 2005 UTC (9 years, 5 months ago) by joerg
Branches: MAIN
Diff to: previous 1.27: preferred, unified
Changes since revision 1.27: +7 -6 lines
ALTQ support.

Revision 1.27: download - view: text, markup, annotated - select for diffs
Mon Feb 14 16:21:34 2005 UTC (9 years, 5 months ago) by joerg
Branches: MAIN
Diff to: previous 1.26: preferred, unified
Changes since revision 1.26: +4 -4 lines
Rename IFM_homePNA to IFM_HPNA_1 and IFM_1000_TX to IFM_1000_T.

Obtained-from: FreeBSD
Submitted-by: Andreas Hauser

Revision 1.26: download - view: text, markup, annotated - select for diffs
Sat Feb 5 23:23:25 2005 UTC (9 years, 5 months ago) by joerg
Branches: MAIN
Diff to: previous 1.25: preferred, unified
Changes since revision 1.25: +0 -29 lines
Remove the conditionalized FreeBSD 5 code. Keep the capability assignment,
even if we currently don't use it.

Revision 1.25: download - view: text, markup, annotated - select for diffs
Sat Feb 5 23:16:42 2005 UTC (9 years, 5 months ago) by joerg
Branches: MAIN
Diff to: previous 1.24: preferred, unified
Changes since revision 1.24: +7 -7 lines
During init time, we can savely allocate the mbuf cluster with
MB_WAIT. Pass the flag to em_get_buf to allow this.

Revision 1.24: download - view: text, markup, annotated - select for diffs
Fri Dec 24 02:19:45 2004 UTC (9 years, 7 months ago) by dillon
Branches: MAIN
Diff to: previous 1.23: preferred, unified
Changes since revision 1.23: +0 -1 lines
Remove now-unused loop_cnt variable.

Revision 1.23: download - view: text, markup, annotated - select for diffs
Fri Dec 24 01:27:08 2004 UTC (9 years, 7 months ago) by dillon
Branches: MAIN
Diff to: previous 1.22: preferred, unified
Changes since revision 1.22: +12 -7 lines
Do not loop 3 times in the interrupt processing code, it's an unnecessary
waste of time, especially when EM has a ton of interrupt enhancing sysctls.

Revision 1.22: download - view: text, markup, annotated - select for diffs
Mon Nov 22 00:46:14 2004 UTC (9 years, 8 months ago) by dillon
Branches: MAIN
Diff to: previous 1.21: preferred, unified
Changes since revision 1.21: +50 -7 lines
Add support for adjusting the interrupt throttling rate via
hw.emX.int_throttle_ceil, and change the default from 8000hz
to 10000hz to improve throughput with default TCP window sizes
through a GiGE switch in a LAN environment.

Note the following test results using iperf between two machines:

    * Shuttle Athlon 64 3200+ box, EM card in 32 bit PCI slot
    * 2 machines connected through a GiGE switch
    * All other hw.em0 delays set to 0 on both sides
    * throttle settings set on both sides
    * -w option set on iperf client AND server for 63.5KB window
    * software interrupt throttling has been turned off for these tests


    throttle    result          result
    freq        (32.5KB win)    (63.5KB win)
                (default)
    --------    --------------  -----------

  maxrate       481 MBit/s      533 MBit/s      (not sure what's going on here)
  120000        518 MBit/s      558 MBit/s      (not sure what's going on here)
  100000        613 MBit/s      667 MBit/s      (not sure what's going on here)
   70000        679 MBit/s      691 MBit/s
   60000        668 MBit/s      694 MBit/s
   50000        678 MBit/s      684 MBit/s
   40000        694 MBit/s      696 MBit/s
   30000        694 MBit/s      696 MBit/s
   20000        698 MBit/s      703 MBit/s
   10000        707 MBit/s      716 MBit/s
    9000        708 MBit/s      716 MBit/s
    8000        710 MBit/s      717 MBit/s      <--- drop off pt 32.5KB win
    7000        683 MBit/s      716 MBit/s
    6000        680 MBit/s      720 MBit/s
    5000        652 MBit/s      718 MBit/s      <--- drop off pt 63.5KB win
    4000        555 Mbit/s      695 MBit/s
    3000        522 MBit/s      533 MBit/s      <--- GiGE throttling likely
    2000        449 MBit/s      384 MBit/s      (256 ring descriptors =
    1000        260 MBit/s      193 MBit/s        2500 hz minimum)

Revision 1.21: download - view: text, markup, annotated - select for diffs
Wed Oct 20 09:17:22 2004 UTC (9 years, 9 months ago) by dillon
Branches: MAIN
Diff to: previous 1.20: preferred, unified
Changes since revision 1.20: +2 -2 lines
The last commit failed to adjust the alignment like it said it did.

Noticed-by: Hidetoshi Shimokawa <simokawa@freebsd.org>

Revision 1.20: download - view: text, markup, annotated - select for diffs
Tue Oct 19 05:47:52 2004 UTC (9 years, 9 months ago) by dillon
Branches: MAIN
Diff to: previous 1.19: preferred, unified
Changes since revision 1.19: +1 -11 lines
MFC FreeBSD if_em.c 1.48 and 1.49.

Remove an unnecessary bus_dmamap_create and destroy for the rx and tx
descriptor rings.  No bounce buffers are ever needed since bus_dmamem_alloc()
allocates the correct type of memory and never needs a bounce buffer.

Use an alignment of 1 instead of PAGE_SIZE for the rx and tx buffer tags.
Since the e1000 DMA engines hava no constraints on the alignment of buffer
transfers, there is no reason to tell busdma that there is.  This saves a
minimum of 1 malloc call per packet and avoids needless boucning.

Use BUS_DMA_WAITOK when allocating the receive descriptor ring.  It's really
silly to use BUS_DMA_NOWAIT here, it isn't all that much memory.

A simple cached NFS test did not result in any noticeable improvement in
cpu or packet efficiency but Scott's commit message indicated a significant
improvement in a larger FreeBSD machine setup, probably oweing more to the
locks eliminated in FreeBSD (which does not apply to DragonFly).

Suggested-by: David Rhodus
Obtained from: Sandvine, Inc.  via FreeBSD  if_em.c 1.48 and 1.49 (scottl)

Revision 1.19: download - view: text, markup, annotated - select for diffs
Fri Jul 23 07:16:25 2004 UTC (10 years ago) by joerg
Branches: MAIN
CVS tags: DragonFly_Snap29Sep2004, DragonFly_Snap13Sep2004
Diff to: previous 1.18: preferred, unified
Changes since revision 1.18: +2 -9 lines
Unify the input handling of the low-level network stack by introducing
a new field if_input in struct ifnet.

Initialize if_input and if_output in the low-level _ifattach routines.

Make the _output and _input routines static, they are now called via
(*ifp->if_input) and (*ifp->if_output) accordingly. The exception is
ether_input which is still used with the second argument, the pointer
to the Ethernet header instead of always taking it from the mbuf.

Move the if_attach and bpfattach from the devices into fddi_ifattach,
atm_ifattach.

Remove the first argument to VLAN_INPUT_TAG, the pointer to the
Ethernet header. Expect it at the beginning of the mbuf.

Adjust the network for the changed API. Exceptions are wl(4), le(4),
ie(4), el(4), ed(4) and de(4), because they use a on-stack Ethernet
header. Another exception is the ATM stack, which uses a fourth argument
to atm_input.

Inspired-by: NetBSd net/if.h, rev 1.36

Revision 1.18: download - view: text, markup, annotated - select for diffs
Sat Jun 5 13:52:29 2004 UTC (10 years, 1 month ago) by joerg
Branches: MAIN
CVS tags: DragonFly_1_0_REL, DragonFly_1_0_RC1, DragonFly_1_0A_REL
Diff to: previous 1.17: preferred, unified
Changes since revision 1.17: +2 -0 lines
em(4) assumes that bus_dmamap_destroy of bus_dmamap_load_mbuf maps
unconditionally succeds w/o previous bus_dmamap_unload. This assumption
is currently true because bus_dmamap_load_mbuf doesn't support bounce
pages. Nevertheless is that an implementation detail which em(4) should
not depend on.

Discussed-with: Hiten Pandya <hmp@backplane.com>

Revision 1.17: download - view: text, markup, annotated - select for diffs
Sat Jun 5 13:09:00 2004 UTC (10 years, 1 month ago) by joerg
Branches: MAIN
Diff to: previous 1.16: preferred, unified
Changes since revision 1.16: +1 -0 lines
Fix a small bug in the last commit. ether_ifdetach has to be called
explicitly if bus_setup_intr fails.

Revision 1.16: download - view: text, markup, annotated - select for diffs
Fri Jun 4 16:32:11 2004 UTC (10 years, 1 month ago) by joerg
Branches: MAIN
Diff to: previous 1.15: preferred, unified
Changes since revision 1.15: +93 -124 lines
Continue cleaning em(4).

Merge PCI resource allocation / deallocation into em_attach and em_detach.
Change the order of allocations in em_attach to work without splimp()
protection.
Remove adapter->unit, adapter->next and adapter->prev.
Use em_detach for the error handling in em_attach as well.
Move the reset of if_timer into em_stop.
Use adapter->hw.mac_addr instead of arpcom's entry.

Revision 1.15: download - view: text, markup, annotated - select for diffs
Wed Jun 2 14:42:51 2004 UTC (10 years, 1 month ago) by eirikn
Branches: MAIN
Diff to: previous 1.14: preferred, unified
Changes since revision 1.14: +1 -1 lines
Change mbug allocation flags from M_ to MB_ to avoid confusion with malloc
flags.

Requested by: Jeffrey Hsu

Revision 1.14: download - view: text, markup, annotated - select for diffs
Tue May 11 22:55:15 2004 UTC (10 years, 2 months ago) by joerg
Branches: MAIN
Diff to: previous 1.13: preferred, unified
Changes since revision 1.13: +16 -2 lines
Readd em_read_reg_io and em_write_reg_io for workarounds in various
chip revision. This is a newbusifyed version of the original code.

Revision 1.13: download - view: text, markup, annotated - select for diffs
Tue May 11 14:00:20 2004 UTC (10 years, 2 months ago) by joerg
Branches: MAIN
Diff to: previous 1.12: preferred, unified
Changes since revision 1.12: +738 -916 lines
- remove em_adapter_list, it was not used for anything beside adding and
  removing entries
- fix const warning for em_strings
- convert u_intXX_t to uintXX_t
- style(9) changes for whitespace e.g. consistent use of tabs
- use snprintf to build the adapter version string, we are embedding a
  string which could grow in size
- remove check for device_get_softc(dev) == NULL, this must not happen
- prefer device_printf and if_printf over printf("em0d: ...", addapter->unit)
- make some pointer checks explicit against NULL
- remove some of the #ifdef FreeBSD cases which are not interesting for us
- remove trailing return; in void functions
- use the pci accessor functions for the subsystem id and vendor
- start using bus_alloc_resource_any
- remove em_read_reg_io, em_write_reg_io, em_io_read and em_io_write,
  those are unused and doesn't fit into our newbus scheme.

Revision 1.12: download - view: text, markup, annotated - select for diffs
Mon May 10 10:36:25 2004 UTC (10 years, 2 months ago) by joerg
Branches: MAIN
Diff to: previous 1.11: preferred, unified
Changes since revision 1.11: +407 -256 lines
Sync em(4) with FreeBSD current. Most important is the initial bus DMA support.
Also use callout directly and not timeout.

Revision 1.11: download - view: text, markup, annotated - select for diffs
Fri Apr 16 14:21:57 2004 UTC (10 years, 3 months ago) by joerg
Branches: MAIN
Diff to: previous 1.10: preferred, unified
Changes since revision 1.10: +2 -2 lines
Move IFF_PROMISC and IFF_POLLING from ifnet.ipending to ifnet.if_flags,
where they belong. Consistently use the higher bits of if_flags, not ipending.

Revision 1.10: download - view: text, markup, annotated - select for diffs
Wed Apr 7 05:45:27 2004 UTC (10 years, 3 months ago) by dillon
Branches: MAIN
Diff to: previous 1.9: preferred, unified
Changes since revision 1.9: +2 -2 lines
General netif malloc() flags cleanup.  Use M_INTWAIT or M_WAITOK instead
of M_NOWAIT.  Generally use M_WAITOK in the attach code or ioctl code
typically called from userland, and M_INTWAIT for routines that might
be called during non-boot operations.  Since M*WAIT flags guarentee a
non-NULL result, also remove now-unnecessary NULL checks.

Revision 1.9: download - view: text, markup, annotated - select for diffs
Tue Mar 23 22:19:00 2004 UTC (10 years, 4 months ago) by hsu
Branches: MAIN
Diff to: previous 1.8: preferred, unified
Changes since revision 1.8: +2 -2 lines
Eliminate use of curthread in if_ioctl functions by passing down the
ucred structure.

Revision 1.8: download - view: text, markup, annotated - select for diffs
Wed Mar 17 04:59:41 2004 UTC (10 years, 4 months ago) by dillon
Branches: MAIN
Diff to: previous 1.7: preferred, unified
Changes since revision 1.7: +339 -50 lines
Update the 825xx GigE support.  Add a large number of new device id's and
support for the 82541 (e.g. Intel PRO/1000 MT DESKTOP ADAPTER) and 82544.
Also add sysctl support for various interrupt related delay parameters,
and add workarounds for chip issues.

In-Discussion-With: "Peter Avalos" <pavalos@theshell.com>
Submitted-by: Hiten Pandya <hmp@backplane.com>
Adapted-from: FreeBSD-5

Revision 1.7: download - view: text, markup, annotated - select for diffs
Sun Mar 14 15:36:49 2004 UTC (10 years, 4 months ago) by joerg
Branches: MAIN
Diff to: previous 1.6: preferred, unified
Changes since revision 1.6: +0 -8 lines
BPF has been in the kernel for ages and is supported by all NICs but I4B.

This removes the second argument of ether_ifattach and ether_ifdetach as
done by sam in FreeBSD's rev. 1.130 of net/if_ethersubr.c.

Add an argument for the link layer address to ether_ifattach as done by
is in NetBSD's rev 1.21.4.1 of the same file.

Adjust if_ef.c based on FreeBSD's version of that file.

Remove the now unused ETHER_BPF_[UN]SUPPORTED define from ethernet.h.

Revision 1.6: download - view: text, markup, annotated - select for diffs
Fri Feb 13 02:44:47 2004 UTC (10 years, 5 months ago) by joerg
Branches: MAIN
Diff to: previous 1.5: preferred, unified
Changes since revision 1.5: +13 -13 lines
Add __DragonFly__

Revision 1.5: download - view: text, markup, annotated - select for diffs
Tue Jan 6 01:40:47 2004 UTC (10 years, 6 months ago) by dillon
Branches: MAIN
Diff to: previous 1.4: preferred, unified
Changes since revision 1.4: +1 -2 lines
if_xname support Part 1/2: Convert most of the netif devices to use
if_initname().

Submitted-by: Max Laier <max@love2party.net>

Revision 1.4: download - view: text, markup, annotated - select for diffs
Thu Nov 20 22:07:27 2003 UTC (10 years, 8 months ago) by dillon
Branches: MAIN
Diff to: previous 1.3: preferred, unified
Changes since revision 1.3: +2 -0 lines
Add a DECLARE_DUMMY_MODULE() so we can get linker_set module names
for modules that normally use DRIVER_MODULE().  The problem is that
DRIVER_MODULE() will define names that do not match the module name,
so a DECLARE_DUMMY_MODULE() is needed for the kernel to be able to
figure out that a module has been statitically compiled in.

Revision 1.3: download - view: text, markup, annotated - select for diffs
Thu Aug 7 21:17:01 2003 UTC (10 years, 11 months ago) by dillon
Branches: MAIN
Diff to: previous 1.2: preferred, unified
Changes since revision 1.2: +2 -2 lines
kernel tree reorganization stage 1: Major cvs repository work (not logged as
commits) plus a major reworking of the #include's to accomodate the
relocations.

    * CVS repository files manually moved.  Old directories left intact
      and empty (temporary).

    * Reorganize all filesystems into vfs/, most devices into dev/,
      sub-divide devices by function.

    * Begin to move device-specific architecture files to the device
      subdirs rather then throwing them all into, e.g. i386/include

    * Reorganize files related to system busses, placing the related code
      in a new bus/ directory.  Also move cam to bus/cam though this may
      not have been the best idea in retrospect.

    * Reorganize emulation code and place it in a new emulation/ directory.

    * Remove the -I- compiler option in order to allow #include file
      localization, rename all config generated X.h files to use_X.h to
      clean up the conflicts.

    * Remove /usr/src/include (or /usr/include) dependancies during the
      kernel build, beyond what is normally needed to compile helper
      programs.

    * Make config create 'machine' softlinks for architecture specific
      directories outside of the standard <arch>/include.

    * Bump the config rev.

    WARNING! after this commit /usr/include and /usr/src/sys/compile/*
    should be regenerated from scratch.

Revision 1.2: download - view: text, markup, annotated - select for diffs
Tue Jun 17 04:28:24 2003 UTC (11 years, 1 month ago) by dillon
Branches: MAIN
CVS tags: PRE_MP
Diff to: previous 1.1: preferred, unified
Changes since revision 1.1: +1 -0 lines
Add the DragonFly cvs id and perform general cleanups on cvs/rcs/sccs ids.  Most
ids have been removed from !lint sections and moved into comment sections.

Revision 1.1: download - view: text, markup, annotated - select for diffs
Tue Jun 17 02:54:11 2003 UTC (11 years, 1 month ago) by dillon
Branches: MAIN
CVS tags: FREEBSD_4_FORK
import from FreeBSD RELENG_4 1.2.2.15

Diff request

This form allows you to request diffs between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.

Log view options