DragonFly BSD

CVS log for src/sys/dev/netif/bge/if_bge.c

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

Request diff between arbitrary revisions


Keyword substitution: kv
Default branch: MAIN


Revision 1.111: download - view: text, markup, annotated - select for diffs
Wed Oct 22 14:24:24 2008 UTC (5 years, 10 months ago) by sephe
Branches: MAIN
CVS tags: HEAD
Diff to: previous 1.110: preferred, unified
Changes since revision 1.110: +262 -54 lines
Add 5906/5906M support.  Based on my old patch with some additional work from
FreeBSD.

Tested-by: Petr Janda <elekktretterr@exemail.com.au>

Revision 1.110: download - view: text, markup, annotated - select for diffs
Sun Oct 19 09:13:58 2008 UTC (5 years, 10 months ago) by sephe
Branches: MAIN
Diff to: previous 1.109: preferred, unified
Changes since revision 1.109: +2 -31 lines
Add pcie_set_max_readrq() to avoid code duplication between various network
device drivers.

Revision 1.109: download - view: text, markup, annotated - select for diffs
Sun Oct 19 08:39:55 2008 UTC (5 years, 10 months ago) by sephe
Branches: MAIN
Diff to: previous 1.108: preferred, unified
Changes since revision 1.108: +1 -44 lines
Add m_devpad() to avoid code duplication in various network device drivers

Revision 1.108: download - view: text, markup, annotated - select for diffs
Sun Oct 19 08:11:35 2008 UTC (5 years, 10 months ago) by sephe
Branches: MAIN
Diff to: previous 1.107: preferred, unified
Changes since revision 1.107: +1 -1 lines
Reduce RX coal ticks to 100us (favors performance a little bit)

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

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

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

Revision 1.104: 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.103: preferred, unified
Changes since revision 1.103: +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.103: download - view: text, markup, annotated - select for diffs
Tue Jul 22 11:55:01 2008 UTC (6 years, 1 month ago) by sephe
Branches: MAIN
CVS tags: DragonFly_Preview
Diff to: previous 1.102: preferred, unified
Changes since revision 1.102: +53 -25 lines
- Add bge_cksum_pad() to assist hardware csum offloading on runts
  Obtained-from: NetBSD
- If bge_encap() fails, increase ifnet.if_oerrors

Revision 1.102: download - view: text, markup, annotated - select for diffs
Sun Jul 13 11:02:50 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.101: preferred, unified
Changes since revision 1.101: +11 -1 lines
Unload the bus dmamap, which was successfully loaded

Revision 1.101: download - view: text, markup, annotated - select for diffs
Sun Jul 13 03:57:41 2008 UTC (6 years, 1 month ago) by sephe
Branches: MAIN
Diff to: previous 1.100: preferred, unified
Changes since revision 1.100: +1 -1 lines
Increate receive max coalesced bds to 80 to prevent system from being
livelocked when 64bytes packets are injected @1.48Mpps.

It's RX side interrupt moderation logic is quite similar to et(4)'s:
(# recved packets > recv max coalesced bds) || (ticks > recv coalescing ticks)

# The 5750A1 I have tested could only sink packets @1.26Mpps

Revision 1.100: download - view: text, markup, annotated - select for diffs
Sun Jul 6 09:17:12 2008 UTC (6 years, 1 month ago) by sephe
Branches: MAIN
Diff to: previous 1.99: preferred, unified
Changes since revision 1.99: +0 -8 lines
Nuke unused macro and comment

Revision 1.99: download - view: text, markup, annotated - select for diffs
Sun Jul 6 08:46:33 2008 UTC (6 years, 1 month ago) by sephe
Branches: MAIN
Diff to: previous 1.98: preferred, unified
Changes since revision 1.98: +13 -19 lines
Print chip informantion in bge_attach() instead of bge_probe()

Revision 1.98: download - view: text, markup, annotated - select for diffs
Sun Jul 6 08:13:46 2008 UTC (6 years, 1 month ago) by sephe
Branches: MAIN
Diff to: previous 1.97: preferred, unified
Changes since revision 1.97: +2 -2 lines
Adjust default interrupt moderation variables

Revision 1.97: download - view: text, markup, annotated - select for diffs
Sun Jul 6 06:47:10 2008 UTC (6 years, 1 month ago) by sephe
Branches: MAIN
Diff to: previous 1.96: preferred, unified
Changes since revision 1.96: +38 -6 lines
For PCI Express devices:
1) Adjust max read request size to 4Kbytes
2) Turn on FIFO_LONG_BURST in RDMA during bge_blockinit()

Though 1) does not seem to have much to do with the poor TX performance (*)
observed on PCI Express bge(4), 2) does fix the problem.

Obtained-from: tg3

# (*)
# http://lists.freebsd.org/pipermail/freebsd-net/2007-June/014373.html
# FreeBSD kern/119361

Revision 1.96: download - view: text, markup, annotated - select for diffs
Sun Jul 6 05:54:09 2008 UTC (6 years, 1 month ago) by sephe
Branches: MAIN
Diff to: previous 1.95: preferred, unified
Changes since revision 1.95: +1 -1 lines
TX coalesce ticks can't be more than 1023

Obtained-from: tg3

Revision 1.95: download - view: text, markup, annotated - select for diffs
Sat Jul 5 13:37:17 2008 UTC (6 years, 1 month ago) by sephe
Branches: MAIN
Diff to: previous 1.94: preferred, unified
Changes since revision 1.94: +7 -0 lines
If boot verbose, print asicrev, chiprev and bus type.

Revision 1.94: download - view: text, markup, annotated - select for diffs
Sat Jul 5 12:22:37 2008 UTC (6 years, 1 month ago) by sephe
Branches: MAIN
Diff to: previous 1.93: preferred, unified
Changes since revision 1.93: +19 -10 lines
- Add delay in MII registers reading
- Minor style changes

Revision 1.93: download - view: text, markup, annotated - select for diffs
Wed Jun 25 13:00:09 2008 UTC (6 years, 1 month ago) by sephe
Branches: MAIN
Diff to: previous 1.92: preferred, unified
Changes since revision 1.92: +21 -0 lines
Make bge(4) aware ETHER_INPUT_CHAIN and ETHER_INPUT2

Revision 1.92: download - view: text, markup, annotated - select for diffs
Fri May 16 13:19:11 2008 UTC (6 years, 3 months ago) by sephe
Branches: MAIN
Diff to: previous 1.91: preferred, unified
Changes since revision 1.91: +3 -3 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.91: download - view: text, markup, annotated - select for diffs
Wed May 14 11:59:18 2008 UTC (6 years, 3 months ago) by sephe
Branches: MAIN
Diff to: previous 1.90: preferred, unified
Changes since revision 1.90: +14 -13 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.90: download - view: text, markup, annotated - select for diffs
Mon Mar 10 12:59:51 2008 UTC (6 years, 5 months ago) by sephe
Branches: MAIN
Diff to: previous 1.89: preferred, unified
Changes since revision 1.89: +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.89: download - view: text, markup, annotated - select for diffs
Mon Mar 10 10:47:57 2008 UTC (6 years, 5 months ago) by sephe
Branches: MAIN
Diff to: previous 1.88: preferred, unified
Changes since revision 1.88: +2 -8 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.88: download - view: text, markup, annotated - select for diffs
Sun Dec 2 07:41:10 2007 UTC (6 years, 8 months ago) by sephe
Branches: MAIN
CVS tags: DragonFly_RELEASE_1_12_Slip, DragonFly_RELEASE_1_12
Diff to: previous 1.87: preferred, unified
Changes since revision 1.87: +5 -1 lines
In bge_stop():
- Avoid dereferencing 'mii', if it is NULL
- Add comment about it

Revision 1.87: download - view: text, markup, annotated - select for diffs
Sat Aug 11 05:27:35 2007 UTC (7 years ago) by sephe
Branches: MAIN
Diff to: previous 1.86: preferred, unified
Changes since revision 1.86: +3 -2 lines
Re-enable hardware UDP/TCP checksum calculation with pseudo header on
RX path.  It turns out the original problem was caused by a hidden bug
fixed in netinet/ip_input.c rev 1.68

Revision 1.85.2.1: download - view: text, markup, annotated - select for diffs
Thu Aug 9 14:23:35 2007 UTC (7 years ago) by sephe
Branches: DragonFly_RELEASE_1_10
CVS tags: DragonFly_RELEASE_1_10_Slip
Diff to: previous 1.85: preferred, unified; next MAIN 1.86: preferred, unified
Changes since revision 1.85: +8 -4 lines
MFC if_bge.c rev 1.86:
  Pass address of mbuf pointer to bge_encap(), so the caller could know
  mbuf is changed due to the defragmentation or error in bge_encap().

  Reported-by: km b <kmb810@gmail.com>

Revision 1.86: download - view: text, markup, annotated - select for diffs
Thu Aug 9 14:17:51 2007 UTC (7 years ago) by sephe
Branches: MAIN
Diff to: previous 1.85: preferred, unified
Changes since revision 1.85: +8 -4 lines
Pass address of mbuf pointer to bge_encap(), so the caller could know
mbuf is changed due to the defragmentation or error in bge_encap().

Reported-by: km b <kmb810@gmail.com>

Revision 1.85: download - view: text, markup, annotated - select for diffs
Tue Jun 26 15:10:23 2007 UTC (7 years, 1 month ago) by sephe
Branches: MAIN
Branch point for: DragonFly_RELEASE_1_10
Diff to: previous 1.84: preferred, unified
Changes since revision 1.84: +4 -5 lines
If RX csum calculation with pseudo header is enabled, bge(4)'s will
miscalculate csum of frames carrying UDP datagrams.  If UDP datagrams
are not fragmented by IP, then the rate of miscalculation is low, but
if UDP datagrams are fragmented by IP, then most of the frames will be
delivered to the upper layer with wrong hardware csum, which is quite
common for NFS.

Disable hardware RX csum calculation with pseudo header; it will be
better than doing software csum if hardware csum error happens, since
the error rate is too high.

Reported-by: Thomas Nikolajsen <thomas.nikolajsen@mail.dk>

Revision 1.84: download - view: text, markup, annotated - select for diffs
Fri Jun 22 15:26:18 2007 UTC (7 years, 2 months ago) by sephe
Branches: MAIN
Diff to: previous 1.83: preferred, unified
Changes since revision 1.83: +55 -16 lines
- Factor out bge_{disable,enable}_intr().
- In bge_enable_intr(), trigger another hardware interrupt after clearing
  interrupt mask, since any writing to BGE_MBX_IRQ0_LO will acknowledge
  interrupts.  Add comment about it.
- In bge_disable_intr(), acknowledge and disable interrupt by writing 1 to
  BGE_MBX_IRQ0_LO, since setting interrupt mask itself does not de-assert
  a currently asserted interrupt.  Add comment about it.
- Since we have explicitly disabled interrupt using BGE_MBX_IRQ0_LO, set
  "RX/TX coalesced BD count during interrupt" to 1.  In this way, RX/TX
  coalescing engine will properly update status block, which contains RX/TX
  descriptor index.  This only affects polling(4) operation, since we don't
  have a "during interrupt" period in our interrupt handler.
- Fix comment.

Tested-with: 5751, 5701(altima)

Revision 1.83: download - view: text, markup, annotated - select for diffs
Fri Jun 22 11:53:40 2007 UTC (7 years, 2 months ago) by sephe
Branches: MAIN
Diff to: previous 1.82: preferred, unified
Changes since revision 1.82: +1 -2 lines
Drain packets even if link is down.

Suggested-by: joerg@
Obtained-from: NetBSD (mlelstv@netbsd.org)

Revision 1.82: download - view: text, markup, annotated - select for diffs
Thu Jun 21 15:00:18 2007 UTC (7 years, 2 months ago) by sephe
Branches: MAIN
Diff to: previous 1.81: preferred, unified
Changes since revision 1.81: +15 -1 lines
Add some KTRs in bge(4) to count RX/TX packets per interrupt.

Revision 1.81: download - view: text, markup, annotated - select for diffs
Tue Jun 19 14:59:41 2007 UTC (7 years, 2 months ago) by sephe
Branches: MAIN
Diff to: previous 1.80: preferred, unified
Changes since revision 1.80: +194 -4 lines
Add sysctl/tunable for TX/RX interrupt coalescing variables.  Default
values are obtained from empirical measurement on bcm5751(PCIe).
Inspired-by: Bruce Evans <brde@optusnet.com.au> on freebsd-net mail list

For a running bge(4), setting these sysctl variables will not take
effect immediately; they are committed to device in the upcoming
interrupt handler.
Adapted-from: NetBSD if_bge.c 1.58 (jonathan@netbsd.org)

# On Altima AC9100 (bcm5701 based), TX/RX interrupt coalescing values
# seem to have no effect at all :(

Revision 1.80: download - view: text, markup, annotated - select for diffs
Thu Jun 7 20:30:20 2007 UTC (7 years, 2 months ago) by dillon
Branches: MAIN
Diff to: previous 1.79: preferred, unified
Changes since revision 1.79: +57 -1 lines
Add polling support to BGE.

Revision 1.79: download - view: text, markup, annotated - select for diffs
Wed May 16 14:37:55 2007 UTC (7 years, 3 months ago) by sephe
Branches: MAIN
Diff to: previous 1.78: preferred, unified
Changes since revision 1.78: +3 -3 lines
E2BIG -> EFBIG

Revision 1.78: download - view: text, markup, annotated - select for diffs
Tue May 15 12:58:45 2007 UTC (7 years, 3 months ago) by sephe
Branches: MAIN
Diff to: previous 1.77: preferred, unified
Changes since revision 1.77: +10 -13 lines
- Fix a typo which may leave promisc/allmulti mode mis-configured.
- Clean up bge_ioctl() a little bit:
  o  Nuke unnecessay local variable 'flags', use 'mask' instead.
  o  Move 'mii' declaration near its usage.
  o  Nuke redundant 'error' resetting.
- Minor style changes.

Revision 1.77: download - view: text, markup, annotated - select for diffs
Sat May 12 08:39:56 2007 UTC (7 years, 3 months ago) by sephe
Branches: MAIN
Diff to: previous 1.76: preferred, unified
Changes since revision 1.76: +1 -0 lines
Reset ifnet.if_timer in bge_stop()

Revision 1.76: download - view: text, markup, annotated - select for diffs
Sat May 12 04:05:35 2007 UTC (7 years, 3 months ago) by sephe
Branches: MAIN
Diff to: previous 1.75: preferred, unified
Changes since revision 1.75: +8 -17 lines
- Merge bge_release_resources() into bge_detach().  This funcion is only used
  by bge_detach() and is quite simple.
- Minor style changes.

Revision 1.75: download - view: text, markup, annotated - select for diffs
Mon May 7 04:54:32 2007 UTC (7 years, 3 months ago) by sephe
Branches: MAIN
Diff to: previous 1.74: preferred, unified
Changes since revision 1.74: +333 -179 lines
Add new devices support for bge(4)
- Recognize more devices, including PCI ids, chip ids and asic ids.
- Use meaningful macros to distinguish chip family and capability, instead of
  test against chip id or asic id directly.
- Pack bool fields of bge_softc into bge_softc.bge_flags,
  o  bge_softc.bge_extram is gone, which was never adopted.
  o  Add flags for jumbo frame capability.
  o  Add flags for various chip families.
  o  Add flags for the bus types (PCI-e/PCI-X).
  o  Add flags for various PHY bugs, which will be used by brgphy.
- Fix the detection of the bus type (PCI-e/PCI-X). (*)
- Properly initialize PCI-X bge(4).
- Fix support for certain 575x/578x chips (*):
  o  Correct bge_{read,write}mem_ind() by clearing BGE_PCI_MEMWIN_BASEADDR
     before returning.
  o  Use the appropriate register writing method when reseting the chip.
  o  Program the descriptor DMA engine correctly.
  o  Disable fastboot if the chips support it.
  o  Add some 'magical' magics on chip resetting path.
Obtained-from: FreeBSD
# (*) are done in if_bge.c rev 1.159 and 1.178 by scottl@freebsd.org and
# jkim@freebsd.org, based on code provided by David Christenson from Broadcom.


Adapt brgphy to work with the changes in bge(4)
- Recognize Broadcom 5755/5787 PHY.
- Add DSP code for various PHY bug workarounds.
- Detect PHY bugs based on the flags passed by bge(4) and load corresponding
  workaround DSP code.
Obtained-from: OpenBSD

- Set PHY jumbo frame settings.
Obtained-from: FreeBSD

Revision 1.74: download - view: text, markup, annotated - select for diffs
Thu May 3 14:09:22 2007 UTC (7 years, 3 months ago) by sephe
Branches: MAIN
Diff to: previous 1.73: preferred, unified
Changes since revision 1.73: +2 -1 lines
Restore part of old behaviour of bge_tick() -- if link is up, then don't
call mii_tick().  Mii_tick() will read and write various PHY registers.
For bge(4), PHY accessing registers normally involves flipping AUTOPOLL
bit of BGE_MI_MODE, which trigers interrupts about link state changing.

# This changing restores netperf UDP_RR

Revision 1.73: download - view: text, markup, annotated - select for diffs
Wed May 2 14:34:10 2007 UTC (7 years, 3 months ago) by sephe
Branches: MAIN
Diff to: previous 1.72: preferred, unified
Changes since revision 1.72: +202 -129 lines
- Merge following link state detection fixes from FreeBSD:
  if_bge.c rev 1.{102, 104, 113, 120, 124} (mainly oleg@freebsd.org)
  Local modifications:
  o  Split bge_link_upd() into
     bge_bcm5700_link_upd() -- for 5700 chips, except B2
     bge_tbi_link_upd()     -- for fiber interface
     bge_copper_link_upd()  -- for the rest for the bge(4) chips
     Assign one of them to bge_softc.bge_link_upd based on chip type
     in attach routine.
  o  Add bge_softc.bge_link_chg, which is setup based on chip type in
     attach routine.  It is used to check against MAC_STS to determine
     whether link state is changed or not.
  o  We always trust that "link state changed" bit in MAC_STS is correct.
  o  Keep the PCS error checks for fiber interface during link state
     changing detection.
- After above change, bge_tick() is used to drive mii_tick(), so cleanup
  brgphy_mii_phy_auto().
- In brgphy_status(), use temporary variable to hold BRGPHY_MII_AUXSTS,
  so it is not accessed twice.
- For fiber interface, correct media status reporting if link is down.
  Obtained-from: OpenBSD (brad@openbsd.org)
- Correct chip id for 5700 B1 and 5700 B2.
- Minor style changes.

Revision 1.72: download - view: text, markup, annotated - select for diffs
Mon Apr 30 14:05:22 2007 UTC (7 years, 3 months ago) by sephe
Branches: MAIN
Diff to: previous 1.71: preferred, unified
Changes since revision 1.71: +4 -10 lines
- Don't use the status block's link state change bit to micro-optimize
  performance, instead, read MAC_STS which always contains the correct
  value about link state changing.  Enormous amount of superflucious
  link up events, which keep coming originally when the interface is
  brought up before cable is plugged in, disappear after this change.
- Nuke the no longer needed PCI bridge cache flush.
- Minor style change.

Revision 1.71: download - view: text, markup, annotated - select for diffs
Thu Apr 26 11:58:10 2007 UTC (7 years, 3 months ago) by sephe
Branches: MAIN
Diff to: previous 1.70: preferred, unified
Changes since revision 1.70: +25 -13 lines
- Don't disable interrupt in bge_intr(), just acknowledge it.  This avoids
  potential lose of interrupt when interrupt gets re-enabled, since writing
  to BGE_MBX_IRQ0_LO also serves as interrupt acknowledgment.
- Move interrupt acknowledgment before reading status block.  This lets us
  read the correct/complete status block.
- Reset ifnet.if_timer, only if there is nothing pending to be TXed.

Obtained-from: FreeBSD (bde@freebsd.org)

Revision 1.70: download - view: text, markup, annotated - select for diffs
Tue Apr 24 11:06:46 2007 UTC (7 years, 4 months ago) by sephe
Branches: MAIN
Diff to: previous 1.69: preferred, unified
Changes since revision 1.69: +12 -134 lines
- Cleanup header file inclusion.
- Nuke no longer needed functions.
- Nuke no longer needed fields in bge_softc.

Revision 1.69: download - view: text, markup, annotated - select for diffs
Mon Apr 23 15:14:37 2007 UTC (7 years, 4 months ago) by sephe
Branches: MAIN
Diff to: previous 1.68: preferred, unified
Changes since revision 1.68: +66 -18 lines
Correct hardware csum offload support for bge(4)

Obtained-from: FreeBSD (w/ modification)

Revision 1.68: download - view: text, markup, annotated - select for diffs
Sun Apr 22 04:16:26 2007 UTC (7 years, 4 months ago) by sephe
Branches: MAIN
Diff to: previous 1.67: preferred, unified
Changes since revision 1.67: +695 -213 lines
Busdma(9)-fy, mainly obtained from FreeBSD:
if_bge.c	rev 1.{45,76,81,85,101,105,106,109,151}
if_bgereg.h	rev 1.{19,40}

Local changes:
- Factor out bge_dma_block_{alloc,free}() to avoid code duplication.
- Move jumbo buffer pool allocation/free into bge_dma_{alloc,free}().
- In bge_newbuf_std(), use bus_dmamap_load_mbuf() instead of bus_dmamap_load().
- Nuke vm header files inclusion.
- In bge_start():
  o   Bail out if OACTIVE is turned on or if bge(4) is not running yet.
  o   Move ifq_dequeue() before bge_encap(), since m_defrag() in bge_encap()
      will trash the mbuf parameter passed in.
  o   Make sure there are enough TX descriptors, before dequeuing mbuf and
      calling bge_encap().
- Don't call ifnet.if_start() on very interrupt, but at the end of bge_txeof().
- In bge_txeof(), if there are not enough TX descriptors, then don't clear
  OACTIVE.
- Minor style changes.

Revision 1.67: download - view: text, markup, annotated - select for diffs
Sat Apr 14 05:14:40 2007 UTC (7 years, 4 months ago) by sephe
Branches: MAIN
Diff to: previous 1.66: preferred, unified
Changes since revision 1.66: +8 -0 lines
For bge_rxeof(), return immediately if no RX descs need to be processed, this
optimization avoids two unnecessary register accessing and increase performance
a lot.  Same optimization is applied to bge_txeof(), but it will not have
real effect until bge(4) uses busdma(4) (i.e. will avoid extra sync)

Obtained-from: FreeBSD (oleg@freebsd.org)

Revision 1.66: download - view: text, markup, annotated - select for diffs
Sat Apr 14 04:35:10 2007 UTC (7 years, 4 months ago) by sephe
Branches: MAIN
Diff to: previous 1.65: preferred, unified
Changes since revision 1.65: +7 -6 lines
- Return error if reading eeprom times out.
  Obtained-from: FreeBSD
- Strip extra blank lines in bge_attach().

Revision 1.65: download - view: text, markup, annotated - select for diffs
Sat Apr 14 04:22:14 2007 UTC (7 years, 4 months ago) by sephe
Branches: MAIN
Diff to: previous 1.64: preferred, unified
Changes since revision 1.64: +7 -2 lines
BGE_MBX_TX_HOST_PROD0_LO is write-only, avoid reading it.

Obtained-from: NetBSD via FreeBSD

Revision 1.64: download - view: text, markup, annotated - select for diffs
Sat Mar 31 09:31:57 2007 UTC (7 years, 4 months ago) by sephe
Branches: MAIN
Diff to: previous 1.63: preferred, unified
Changes since revision 1.63: +31 -24 lines
- Call bge_setmulti(), if bge(4) is up and running and IFF_ALLMULTI is to
  be set.
  Obtained-from: FreeBSD (ru@freebsd.org)
- Cleanup the logic of SIOCSIFFLAGS.
- Factor out bge_setpromisc(), use it in bge_{init,ioctl}().

Revision 1.63: download - view: text, markup, annotated - select for diffs
Sat Mar 31 07:24:34 2007 UTC (7 years, 4 months ago) by sephe
Branches: MAIN
Diff to: previous 1.62: preferred, unified
Changes since revision 1.62: +5 -2 lines
Add support for BCM5752.

Obtained-from: FreeBSD

Revision 1.59.2.1: download - view: text, markup, annotated - select for diffs
Sat Mar 31 06:14:50 2007 UTC (7 years, 4 months ago) by sephe
Branches: DragonFly_RELEASE_1_8
CVS tags: DragonFly_RELEASE_1_8_Slip
Diff to: previous 1.59: preferred, unified; next MAIN 1.60: preferred, unified
Changes since revision 1.59: +3 -0 lines
MFC part of if_bge.c rev1.62
  Properly serialize bge_shutdown().

Revision 1.62: download - view: text, markup, annotated - select for diffs
Sat Mar 31 06:07:16 2007 UTC (7 years, 4 months ago) by sephe
Branches: MAIN
Diff to: previous 1.61: preferred, unified
Changes since revision 1.61: +49 -5 lines
- Add suspend and resume device methods support.
  Obtained-from: FreeBSD (pjd@freebsd.org)
- Add serializer assertion in bge_{init,ioctl,stop}()
- Properly serialize bge_shutdown()

Revision 1.61: download - view: text, markup, annotated - select for diffs
Sat Mar 31 05:12:24 2007 UTC (7 years, 4 months ago) by sephe
Branches: MAIN
Diff to: previous 1.60: preferred, unified
Changes since revision 1.60: +2 -2 lines
- Correctly configure BGE_RX_MTU register.  Since we set the IFCAP_VLAN_MTU
  flag, we must allow reception of frames up to 1522 bytes in size rather
  than 1518.
- Update FreeBSD's RCSIDs.

Obtained-from: FreeBSD (wpaul@freebsd.org)

Revision 1.60: download - view: text, markup, annotated - select for diffs
Mon Mar 26 12:13:58 2007 UTC (7 years, 4 months ago) by sephe
Branches: MAIN
Diff to: previous 1.59: preferred, unified
Changes since revision 1.59: +2 -1 lines
Turn on hardware vlan tagging and vlan mtu for NICs which have these
capabilities.

Submitted-by: Gary Allan <dragonfly@gallan.plus.com>
Reviewed-by: dillon@

Revision 1.59: download - view: text, markup, annotated - select for diffs
Wed Dec 20 18:14:39 2006 UTC (7 years, 8 months ago) by dillon
Branches: MAIN
Branch point for: DragonFly_RELEASE_1_8
Diff to: previous 1.58: preferred, unified
Changes since revision 1.58: +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.58: download - view: text, markup, annotated - select for diffs
Sun Nov 26 07:30:06 2006 UTC (7 years, 8 months ago) by sephe
Branches: MAIN
Diff to: previous 1.57: preferred, unified
Changes since revision 1.57: +1 -2 lines
Use LIST_FOREACH()

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

Revision 1.53.2.1: download - view: text, markup, annotated - select for diffs
Sat Oct 28 12:33:47 2006 UTC (7 years, 9 months ago) by sephe
Branches: DragonFly_RELEASE_1_6
CVS tags: DragonFly_RELEASE_1_6_Slip
Diff to: previous 1.53: preferred, unified; next MAIN 1.54: preferred, unified
Changes since revision 1.53: +1 -1 lines
MFC rev1.57
  Bug fixing:
  device_delete_child() is called unconditionally in bge_detach(), due to the
  ';' after 'if()'.  It is dangerous here, since bge_detach() serves as failure
  cleanup routine too.

Revision 1.57: download - view: text, markup, annotated - select for diffs
Sat Oct 28 12:28:25 2006 UTC (7 years, 9 months ago) by sephe
Branches: MAIN
Diff to: previous 1.56: preferred, unified
Changes since revision 1.56: +1 -1 lines
Bug fixing:
device_delete_child() is called unconditionally in bge_detach(), due to the
';' after 'if()'.  It is dangerous here, since bge_detach() serves as failure
cleanup routine too.

Revision 1.56: download - view: text, markup, annotated - select for diffs
Wed Oct 25 20:55:56 2006 UTC (7 years, 9 months ago) by dillon
Branches: MAIN
Diff to: previous 1.55: preferred, unified
Changes since revision 1.55: +0 -1 lines
Do a major clean-up of the BUSDMA architecture.  A large number of
essentially machine-independant drivers use the structures and definitions
in machine-dependant directories that are really machine-independant in
nature.

Split <machine/bus_dma.h> into machine-depdendant and machine-independant parts
and make the primary access run through <sys/bus_dma.h>.

Remove <machine/bus.h>, <machine/bus_memio.h> and <machine/bus_pio.h>.  The
optimizations related to bus_memio.h and bus_pio.h made a huge mess,
introduced machine-specific knowledge into essentially machine-independant
drivers, and required specific #include file orderings to do their job.
They may be reintroduced in some other form later on.

Move <machine/resource.h> to <sys/bus_resource.h>.  The contents of the file
is machine-independant or can be made a superset across many platforms.

Make <sys/bus.h> include <sys/bus_dma.h> and <sys/bus_resource.h> and
include <sys/bus.h> where necessary. Remove all #include's of
<machine/resource.h> and <machine/bus.h>.  That is, make the BUSDMA
infrastructure integral to I/O-mapped and memory-mapped accesses to devices
and remove a large chunk of machine-specific dependancies from drivers.
bus_if.h and device_if.h are now required to be present when using <sys/bus.h>.

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

Revision 1.54: download - view: text, markup, annotated - select for diffs
Sat Aug 12 05:17:03 2006 UTC (8 years ago) by swildner
Branches: MAIN
Diff to: previous 1.53: preferred, unified
Changes since revision 1.53: +1 -1 lines
Use pcidevs.h's definition of the BCM5714 id.

Revision 1.53: download - view: text, markup, annotated - select for diffs
Thu Mar 23 13:45:12 2006 UTC (8 years, 5 months ago) by sephe
Branches: MAIN
Branch point for: DragonFly_RELEASE_1_6
Diff to: previous 1.52: preferred, unified
Changes since revision 1.52: +9 -5 lines
Add a new tunable "hw.bge.fake_autoneg", get rid of BGE_FAKE_AUTONEG kernel
option.  This lets GENERIC kernel work with some broken "bge(4) + switch
modules" configurations.

By default this tunable is set to 0, if autonegociation breakage happens
for certain switch modules shipped with IBM/Intel blades, set this tunable
to 1.

Thank Devon H. O'Dell <devon.odell at gmail.com> for confirming this is
useful.

Initial-idea-from: hmp
Reminded-by: Devon H. O'Dell <devon.odell at gmail.com>

Revision 1.51.2.1: download - view: text, markup, annotated - select for diffs
Sun Jan 1 00:59:03 2006 UTC (8 years, 7 months ago) by dillon
Branches: DragonFly_RELEASE_1_4
CVS tags: DragonFly_RELEASE_1_4_Slip
Diff to: previous 1.51: preferred, unified; next MAIN 1.52: preferred, unified
Changes since revision 1.51: +5 -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.52: 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
Diff to: previous 1.51: preferred, unified
Changes since revision 1.51: +5 -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.51: download - view: text, markup, annotated - select for diffs
Tue Nov 29 19:56:50 2005 UTC (8 years, 8 months ago) by dillon
Branches: MAIN
Branch point for: DragonFly_RELEASE_1_4
Diff to: previous 1.50: preferred, unified
Changes since revision 1.50: +28 -14 lines
Jumbo mbuf mangement's extbuf callbacks must be MPSAFE.  Use a serializer
to accomplish the task.  This is a workaround until we create a generic
mbuf management API for jumbo frames.

Revision 1.50: download - view: text, markup, annotated - select for diffs
Mon Nov 28 17:13:41 2005 UTC (8 years, 8 months ago) by dillon
Branches: MAIN
Diff to: previous 1.49: preferred, unified
Changes since revision 1.49: +24 -29 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.49: download - view: text, markup, annotated - select for diffs
Tue Nov 22 00:24:20 2005 UTC (8 years, 9 months ago) by dillon
Branches: MAIN
Diff to: previous 1.48: preferred, unified
Changes since revision 1.48: +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.48: download - view: text, markup, annotated - select for diffs
Wed Oct 12 17:35:51 2005 UTC (8 years, 10 months ago) by dillon
Branches: MAIN
Diff to: previous 1.47: preferred, unified
Changes since revision 1.47: +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.47: download - view: text, markup, annotated - select for diffs
Thu Sep 29 12:52:51 2005 UTC (8 years, 10 months ago) by sephe
Branches: MAIN
Diff to: previous 1.46: preferred, unified
Changes since revision 1.46: +9 -0 lines
For bge(4), dc(4), lge(4), ndis(4), nge(4), pcn(4), re(4), sis(4), sk(4), ti(4)
- Do not start tx engine or set if_timer, if there is nothing to be sent
- Let if_watchdog() kick if_start().  This may avoid a possible race (in the
  future) between testing/setting if_timer and calling if_watchdog().  Only
  bge(4), re(4), sk(4) and ti(4) require this change.  The rest drivers
  affected by this commit already have this in place.

Discussed-with: joerg
Reviewed-by: joerg

Revision 1.46: download - view: text, markup, annotated - select for diffs
Mon Aug 22 18:29:52 2005 UTC (9 years ago) by joerg
Branches: MAIN
Diff to: previous 1.45: preferred, unified
Changes since revision 1.45: +40 -0 lines
Create a kernel option BGE_FAKE_AUTONEG for IBM/Intel blade servers,
which should make the DNLK switch module work.  IBM/Intel blade server
with Intel or AD switch modules should work without the kernel options

Obtained-from: FreeBSD
Submitted-by: Sepherosa Ziehau <sepherosa@gmail.com>

Revision 1.45: download - view: text, markup, annotated - select for diffs
Fri Aug 19 14:43:30 2005 UTC (9 years ago) by joerg
Branches: MAIN
Diff to: previous 1.44: preferred, unified
Changes since revision 1.44: +12 -3 lines
Prevent spurious link state changes.

Obtained-from: FreeBSD
Submitted-by: Sepherosa Ziehau <sepherosa@gmail.com>

Revision 1.44: download - view: text, markup, annotated - select for diffs
Fri Aug 19 14:42:19 2005 UTC (9 years ago) by joerg
Branches: MAIN
Diff to: previous 1.43: preferred, unified
Changes since revision 1.43: +4 -5 lines
Enable the memory arbiter before turning off the PXE restart.  This
prevents NMI's from happening when resetting the chip on some hardware
I have seen.

Obtained-from: FreeBSD
Submitted-by: Sepherosa Ziehau <sepherosa@gmail.com>

Revision 1.43: download - view: text, markup, annotated - select for diffs
Fri Aug 19 14:41:07 2005 UTC (9 years ago) by joerg
Branches: MAIN
Diff to: previous 1.42: preferred, unified
Changes since revision 1.42: +5 -8 lines
Atomically load and clear the status block.  This makes the bge
devices work much better when interrupts are shared.

Obtained-from: FreeBSD
Submitted-by: Sepherosa Ziehau <sepherosa@gmail.com>

Revision 1.42: download - view: text, markup, annotated - select for diffs
Fri Aug 19 14:40:03 2005 UTC (9 years ago) by joerg
Branches: MAIN
Diff to: previous 1.41: preferred, unified
Changes since revision 1.41: +145 -51 lines
5705K, 5714C, 5721, 5750, 5750M, 5751M, 5789 support.
Add some hacks from the Broadcom Linux driver. Reorder initialisation to
give bge_reset / bge_chipinit what it needs.

Obtained-from: FreeBSD
Submitted-by: Sepherosa Ziehau <sepherosa@gmail.com>

Revision 1.41: download - view: text, markup, annotated - select for diffs
Tue Jun 21 15:27:55 2005 UTC (9 years, 2 months ago) by joerg
Branches: MAIN
Diff to: previous 1.40: preferred, unified
Changes since revision 1.40: +2 -0 lines
Add BCM5751.

Submitted-by: Pablo Méndez Hernández <pablomh@gmail.com>

Revision 1.40: download - view: text, markup, annotated - select for diffs
Tue Jun 14 14:19:22 2005 UTC (9 years, 2 months ago) by joerg
Branches: MAIN
Diff to: previous 1.39: preferred, unified
Changes since revision 1.39: +0 -9 lines
Resource allocate now turns on port / memory bit in the PCI command reg,
so stop doing it by hand.

Revision 1.39: download - view: text, markup, annotated - select for diffs
Mon Jun 13 21:24:03 2005 UTC (9 years, 2 months ago) by joerg
Branches: MAIN
Diff to: previous 1.38: preferred, unified
Changes since revision 1.38: +46 -54 lines
Convert to critical sections. Use bge_detach as common error path
in bge_attach and fix some bugs on the way. Use M_WAITOK now
that interrupts are no longer an issue there. Allow this by hooking
up the interrupt last.

Revision 1.38: download - view: text, markup, annotated - select for diffs
Tue May 31 14:11:42 2005 UTC (9 years, 2 months ago) by joerg
Branches: MAIN
Diff to: previous 1.37: preferred, unified
Changes since revision 1.37: +2 -2 lines
Remove M_EXT_OLD, rename m_ext.ext_nref.new to m_ext.ext_ref and
m_ext.ext_nfree.new to m_ext.ext_free.

Revision 1.37: download - view: text, markup, annotated - select for diffs
Fri May 27 15:36:09 2005 UTC (9 years, 2 months ago) by joerg
Branches: MAIN
Diff to: previous 1.36: preferred, unified
Changes since revision 1.36: +1 -5 lines
Use ether_ioctl for the default case and merge the cases which just
call it.

Revision 1.36: download - view: text, markup, annotated - select for diffs
Wed May 25 21:35:51 2005 UTC (9 years, 3 months ago) by hsu
Branches: MAIN
Diff to: previous 1.35: preferred, unified
Changes since revision 1.35: +2 -8 lines
Prefer m_getcl() to separate calls to MGETHDR() and MCLGET() in order to
take advantage of cluster caching.

Revision 1.35: download - view: text, markup, annotated - select for diffs
Tue May 24 20:59:00 2005 UTC (9 years, 3 months ago) by dillon
Branches: MAIN
Diff to: previous 1.34: preferred, unified
Changes since revision 1.34: +1 -1 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.34: download - view: text, markup, annotated - select for diffs
Mon May 23 07:00:36 2005 UTC (9 years, 3 months ago) by joerg
Branches: MAIN
Diff to: previous 1.33: preferred, unified
Changes since revision 1.33: +1 -1 lines
Spurious semicolon broke gcc2 build.

Revision 1.33: download - view: text, markup, annotated - select for diffs
Sun May 22 16:14:04 2005 UTC (9 years, 3 months ago) by joerg
Branches: MAIN
Diff to: previous 1.32: preferred, unified
Changes since revision 1.32: +40 -91 lines
Convert bge(4) to the new M_EXT API. This allows merging the dynamic
state back into the softc and saves a small malloc per jumbo buffer
in the rx ring.

Revision 1.32: download - view: text, markup, annotated - select for diffs
Sat May 21 09:07:52 2005 UTC (9 years, 3 months ago) by joerg
Branches: MAIN
Diff to: previous 1.31: preferred, unified
Changes since revision 1.31: +3 -21 lines
Use ether_crc32_le instead of local hack.

Revision 1.31: download - view: text, markup, annotated - select for diffs
Sat May 21 09:05:05 2005 UTC (9 years, 3 months ago) by joerg
Branches: MAIN
Diff to: previous 1.30: preferred, unified
Changes since revision 1.30: +228 -401 lines
style(9)

Revision 1.30: download - view: text, markup, annotated - select for diffs
Sat May 21 07:38:41 2005 UTC (9 years, 3 months ago) by joerg
Branches: MAIN
Diff to: previous 1.29: preferred, unified
Changes since revision 1.29: +6 -8 lines
Use bus_alloc_resource_any. Use pci helper functions, don't roll them
by hand.

Revision 1.29: download - view: text, markup, annotated - select for diffs
Sat May 21 07:28:04 2005 UTC (9 years, 3 months ago) by joerg
Branches: MAIN
Diff to: previous 1.28: preferred, unified
Changes since revision 1.28: +40 -45 lines
if_printf/device_printf cleanup. Remove minor junk.

Submitted-by: Sepherosa Ziehau <sepherosa@gmail.com>

Revision 1.28: download - view: text, markup, annotated - select for diffs
Thu May 5 22:57:44 2005 UTC (9 years, 3 months ago) by swildner
Branches: MAIN
Diff to: previous 1.27: preferred, unified
Changes since revision 1.27: +0 -27 lines
Remove DEC Alpha support.

Revision 1.27: download - view: text, markup, annotated - select for diffs
Mon Feb 14 17:45:08 2005 UTC (9 years, 6 months ago) by joerg
Branches: MAIN
CVS tags: DragonFly_Stable, DragonFly_RELEASE_1_2_Slip, DragonFly_RELEASE_1_2
Diff to: previous 1.26: preferred, unified
Changes since revision 1.26: +9 -8 lines
ALTQ support. Remove bogus check of ifq max len.

Revision 1.26: download - view: text, markup, annotated - select for diffs
Mon Feb 14 16:21:34 2005 UTC (9 years, 6 months ago) by joerg
Branches: MAIN
Diff to: previous 1.25: preferred, unified
Changes since revision 1.25: +2 -2 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.25: download - view: text, markup, annotated - select for diffs
Sun Jan 23 20:21:30 2005 UTC (9 years, 7 months ago) by joerg
Branches: MAIN
Diff to: previous 1.24: preferred, unified
Changes since revision 1.24: +1 -6 lines
Use BPF_TAP and BPF_MTAP instead of the expanded versions where possible.

Revision 1.24: download - view: text, markup, annotated - select for diffs
Tue Sep 14 22:31:01 2004 UTC (9 years, 11 months ago) by joerg
Branches: MAIN
CVS tags: DragonFly_Snap29Sep2004
Diff to: previous 1.23: preferred, unified
Changes since revision 1.23: +7 -9 lines
timeout/untimeout ==> callout_*

Revision 1.23: download - view: text, markup, annotated - select for diffs
Thu Jul 29 08:46:22 2004 UTC (10 years ago) by dillon
Branches: MAIN
CVS tags: DragonFly_Snap13Sep2004
Diff to: previous 1.22: preferred, unified
Changes since revision 1.22: +3 -3 lines
Stage 1/many: mbuf/cluster accounting rewrite and mbuf allocator rewrite.

Implement 'new' style mbuf m_ext buffers where the callbacks are called with
a custom argument instead of with (buf, size).  Old style m_ext buffers have
to jump through loops to properly track reference counters in a manner that
is tightly integrated with the old mbuf/cluster KVA allocation array.

The old clustering methodology is going to have to be converted to the new
methodology before we can rip out the old mbuf allocator, plus we want to
use the new mechanism anyway because it is a whole lot cleaner and because
it's easier to import driver code (aka NDIS) from FreeBSD-5 with the new
mechanism.

This commit still supports the old mechanism via M_EXT_OLD, and all
existing function-based M_EXT's have been converted to use M_EXT_OLD.  The
old mechanism (and M_EXT_OLD) will be removed in later stages.

Revision 1.22: download - view: text, markup, annotated - select for diffs
Fri Jul 23 07:16:24 2004 UTC (10 years, 1 month ago) by joerg
Branches: MAIN
Diff to: previous 1.21: preferred, unified
Changes since revision 1.21: +2 -8 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.21: download - view: text, markup, annotated - select for diffs
Fri Jul 2 17:42:16 2004 UTC (10 years, 1 month ago) by joerg
Branches: MAIN
CVS tags: DragonFly_1_0_REL, DragonFly_1_0A_REL
Diff to: previous 1.20: preferred, unified
Changes since revision 1.20: +0 -6 lines
Announce MAC address in ether_ifattach, not in each NIC indepently.

aue(4), axe(4), cue(4), kue(4), pcn(4):
- Don't bcopy the MAC address, ether_ifattach does it.
lnc(4):
- sc->arpcom.ac_if ==> ifp in lnc_attach_common, more changes coming.
awi(4):
- Nuke local copy of ether_sprintf, use %6D directly.
- Use if_printf instead of printf("%s: ...", sc->sc_dev.dv_xname, ...).

Revision 1.20: download - view: text, markup, annotated - select for diffs
Wed Jun 2 14:42:49 2004 UTC (10 years, 2 months ago) by eirikn
Branches: MAIN
CVS tags: DragonFly_1_0_RC1
Diff to: previous 1.19: preferred, unified
Changes since revision 1.19: +3 -3 lines
Change mbug allocation flags from M_ to MB_ to avoid confusion with malloc
flags.

Requested by: Jeffrey Hsu

Revision 1.19: download - view: text, markup, annotated - select for diffs
Wed Apr 7 05:45:27 2004 UTC (10 years, 4 months ago) by dillon
Branches: MAIN
Diff to: previous 1.18: preferred, unified
Changes since revision 1.18: +4 -14 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.18: download - view: text, markup, annotated - select for diffs
Tue Mar 23 22:18:59 2004 UTC (10 years, 5 months ago) by hsu
Branches: MAIN
Diff to: previous 1.17: preferred, unified
Changes since revision 1.17: +4 -2 lines
Eliminate use of curthread in if_ioctl functions by passing down the
ucred structure.

Revision 1.17: download - view: text, markup, annotated - select for diffs
Mon Mar 22 13:33:34 2004 UTC (10 years, 5 months ago) by joerg
Branches: MAIN
Diff to: previous 1.16: preferred, unified
Changes since revision 1.16: +1 -1 lines
Change to PCI_VENDOR_DELL

Revision 1.16: download - view: text, markup, annotated - select for diffs
Mon Mar 22 10:22:26 2004 UTC (10 years, 5 months ago) by joerg
Branches: MAIN
Diff to: previous 1.15: preferred, unified
Changes since revision 1.15: +33 -25 lines
Add device IDs of BCM5788, BCM5901 and BCM5901A2. Fix some spelling mistakes.

Obtained from FreeBSD.

Convert most PCI IDs to the pcidevs.h constants and leave only the BCM5788,
which isn't there, and alternative IDs for the BCM5702X and BCM5703X, which
couldn't be verified with www.pcidatabase.com.

Revision 1.15: download - view: text, markup, annotated - select for diffs
Sun Mar 14 15:36:48 2004 UTC (10 years, 5 months ago) by joerg
Branches: MAIN
Diff to: previous 1.14: preferred, unified
Changes since revision 1.14: +10 -9 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.14: download - view: text, markup, annotated - select for diffs
Tue Feb 10 21:14:14 2004 UTC (10 years, 6 months ago) by hmp
Branches: MAIN
Diff to: previous 1.13: preferred, unified
Changes since revision 1.13: +251 -117 lines
Update the Broadcom Gigabit Ethernet driver and the Broadcom
Gigabit PHY.  Revision numbers that appear below are taken from
if_bge.c.

ChangeLog:

Changes taken from FreeBSD RELENG_4:

	* (1.3.2.23) distinguish PCS encoding error events
	  from actual link state change events.

	* (1.3.2.24) support for the Broadcom 5705.
	  Please lookup the FreeBSD CVS Logs for if_bge.c
	  for more information about this change.  This
	  requires update of ``miidevs''.

	* (1.3.2.25) properly set the mbuf space size for
	  the BCM5704 NICs to fix watchdog timeouts on Dell
	  1750 servers, and fix spurious 'gigabit link up'
	  messages due to not ignoring the 'MI_COMPLETE' bit
	  in the MAC status register.

	* (1.3.2.26) BGE_HCC_TX_MAX_COAL_BDS_INT is at offset
	  0x3C24, not at 0x3C34.

	* (1.3.2.27 and 1.3.2.28 already merged by me in
	   previous commits to if_bge.c).

	* (1.3.2.29) Dell 2650 no link led problem.  This
	  requires update to the PHY (brgphy.c).

	* (1.3.2.30 was committed by me, which was fix to
	  typo in a comment).

Changes from FreeBSD HEAD:

	* Fix a typo when setting wirespeed in the Broadcom
	  PHY module (rev. 1.27 HEAD of brgphy.c).

	* Add PCI ID for yet another bge chip; the Altima 1002
	  (rev 1.62 HEAD of if_bge.c).

	* Update for if_xname (if_name -> if_dname).

All of the changes highlighted above are taken from FreeBSD
and the $FreeBSD$ tag was updated accordingly.  This should
fix most of the annoying Broadcom Gig-E bugs as of this date.

Tested by:	dillon, drhodus

Revision 1.13: download - view: text, markup, annotated - select for diffs
Sun Feb 8 07:03:17 2004 UTC (10 years, 6 months ago) by hmp
Branches: MAIN
Diff to: previous 1.12: preferred, unified
Changes since revision 1.12: +1 -2 lines
Merge from FreeBSD:

	Do not set the No_CRC bit in the Mode Control Register.

Revision 1.12: download - view: text, markup, annotated - select for diffs
Sun Feb 8 06:51:54 2004 UTC (10 years, 6 months ago) by hmp
Branches: MAIN
Diff to: previous 1.11: preferred, unified
Changes since revision 1.11: +1 -1 lines
Merge from FreeBSD:

	By not setting No CRC in the Mode Control Register, we must
	also reduce the size of the packet by 4 bytes to remvoe the
	Ethernet CRC.

Revision 1.11: download - view: text, markup, annotated - select for diffs
Sun Jan 25 12:30:08 2004 UTC (10 years, 6 months ago) by hmp
Branches: MAIN
Diff to: previous 1.10: preferred, unified
Changes since revision 1.10: +2 -2 lines
Fix typo in a comment.

Submitted by:	Christian Brueffer <chris@unixpages.org>

Revision 1.10: download - view: text, markup, annotated - select for diffs
Tue Jan 6 01:40:46 2004 UTC (10 years, 7 months ago) by dillon
Branches: MAIN
Diff to: previous 1.9: preferred, unified
Changes since revision 1.9: +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.9: download - view: text, markup, annotated - select for diffs
Thu Nov 20 22:07:26 2003 UTC (10 years, 9 months ago) by dillon
Branches: MAIN
Diff to: previous 1.8: preferred, unified
Changes since revision 1.8: +1 -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.8: download - view: text, markup, annotated - select for diffs
Wed Nov 5 05:30:29 2003 UTC (10 years, 9 months ago) by drhodus
Branches: MAIN
Diff to: previous 1.7: preferred, unified
Changes since revision 1.7: +2 -3 lines

*	Temporarily back out last change because of a problem reported
	by Kennth Culver until I can look into it more.

Revision 1.7: download - view: text, markup, annotated - select for diffs
Tue Nov 4 17:29:33 2003 UTC (10 years, 9 months ago) by drhodus
Branches: MAIN
Diff to: previous 1.6: preferred, unified
Changes since revision 1.6: +2 -2 lines

*	Do not set the No_CRC bit in the Mode Control Register.
	Setting the NO_CRC bit can cause data write errors.

*	By not setting NO_CRC in the Mode Control Register, we must
	also reduce the size of the packet by 4 bytes to remove the
	ethernet crc.


Obtained from: FreeBSD

Revision 1.6: download - view: text, markup, annotated - select for diffs
Wed Aug 27 09:38:30 2003 UTC (10 years, 11 months ago) by rob
Branches: MAIN
Diff to: previous 1.5: preferred, unified
Changes since revision 1.5: +57 -57 lines
__P!= wanted

Revision 1.5: download - view: text, markup, annotated - select for diffs
Thu Aug 7 21:17:00 2003 UTC (11 years ago) by dillon
Branches: MAIN
Diff to: previous 1.4: preferred, unified
Changes since revision 1.4: +8 -8 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.4: download - view: text, markup, annotated - select for diffs
Wed Jul 30 01:34:49 2003 UTC (11 years ago) by drhodus
Branches: MAIN
Diff to: previous 1.3: preferred, unified
Changes since revision 1.3: +19 -0 lines

Try to distinguish PCS encoding error events
from actual link state change events.

Obtained from: FreeBSD

Revision 1.3: download - view: text, markup, annotated - select for diffs
Sat Jul 26 14:25:20 2003 UTC (11 years, 1 month ago) by rob
Branches: MAIN
Diff to: previous 1.2: preferred, unified
Changes since revision 1.2: +3 -3 lines
Register keyword removal

Approved by: Matt Dillon

Revision 1.2: download - view: text, markup, annotated - select for diffs
Tue Jun 17 04:28:22 2003 UTC (11 years, 2 months ago) by dillon
Branches: MAIN
CVS tags: PRE_MP
Diff to: previous 1.1: preferred, unified
Changes since revision 1.1: +3 -5 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:05 2003 UTC (11 years, 2 months ago) by dillon
Branches: MAIN
CVS tags: FREEBSD_4_FORK
import from FreeBSD RELENG_4 1.3.2.22

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