DragonFly BSD

CVS log for src/sys/dev/netif/re/if_re.c

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

Request diff between arbitrary revisions


Keyword substitution: kv
Default branch: MAIN


Revision 1.99: download - view: text, markup, annotated - select for diffs
Thu Oct 30 11:27:40 2008 UTC (5 years, 11 months ago) by sephe
Branches: MAIN
CVS tags: HEAD
Diff to: previous 1.98: preferred, colored
Changes since revision 1.98: +5 -2 lines
Put unknown hardware ids print back into bootverbose, mainly to suppress it
on a box with rl(4).

Revision 1.98: download - view: text, markup, annotated - select for diffs
Tue Oct 28 07:23:28 2008 UTC (5 years, 11 months ago) by sephe
Branches: MAIN
Diff to: previous 1.97: preferred, colored
Changes since revision 1.97: +20 -2 lines
Try recollecting RX/TX descriptors if we are going to switch back to TX/RX
interrupts.  There seems to be a race between turning on TX/RX interrupt and
asserting TX/RX interrupt by the hardware.  This fixes the poor performance
that I have seen when using single threaded remote cpdup.

Revision 1.97: download - view: text, markup, annotated - select for diffs
Tue Oct 21 12:31:00 2008 UTC (6 years ago) by sephe
Branches: MAIN
Diff to: previous 1.96: preferred, colored
Changes since revision 1.96: +27 -30 lines
- Move RX filter configuration from re_init() into re_setmulti()
- IFF_BROADCAST will never be set/cleared
- Fix SIOCSIFFLAGS support; it was really annoying that each time when I ran
  tcpdump, the NIC reinitialized itself.

Revision 1.96: download - view: text, markup, annotated - select for diffs
Sun Oct 19 09:13:58 2008 UTC (6 years ago) by sephe
Branches: MAIN
Diff to: previous 1.95: preferred, colored
Changes since revision 1.95: +4 -30 lines
Add pcie_set_max_readrq() to avoid code duplication between various network
device drivers.

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

Revision 1.94: download - view: text, markup, annotated - select for diffs
Sun Oct 19 06:00:24 2008 UTC (6 years ago) by sephe
Branches: MAIN
Diff to: previous 1.93: preferred, colored
Changes since revision 1.93: +22 -18 lines
- In re_stop(), call re_reset(), which is supposed to stop TX/RX engines.
- In re_reset(), don't touch 0x82 (a magic CSR), which seems to be 8110/8169
  specific.  Write 1 to it on attach path.
  According-to: RealTek r8169-6.007.00
- For certain chips (looks like all MAC2 chips), RE_CMD_RESET will not stop
  TX/RX engines, a seperate command (RE_CMD_STOPREQ) must be issued before
  RE_CMD_RESET.
  According-to: RealTek r8168-8.008.00

Revision 1.93: download - view: text, markup, annotated - select for diffs
Sun Oct 19 04:38:40 2008 UTC (6 years ago) by sephe
Branches: MAIN
Diff to: previous 1.92: preferred, colored
Changes since revision 1.92: +19 -24 lines
- Pack boolean fields into re_softc.re_flags
- Nuke some unused fields in re_softc

Revision 1.92: download - view: text, markup, annotated - select for diffs
Sun Oct 19 03:17:52 2008 UTC (6 years ago) by sephe
Branches: MAIN
Diff to: previous 1.91: preferred, colored
Changes since revision 1.91: +9 -8 lines
- Move PCIe chip detection into re_probe()
- Panic if the passed in "max read request size" exceeds limit

Revision 1.91: download - view: text, markup, annotated - select for diffs
Sat Oct 18 14:56:31 2008 UTC (6 years ago) by sephe
Branches: MAIN
Diff to: previous 1.90: preferred, colored
Changes since revision 1.90: +31 -4 lines
Try recollecting TX descriptors when we are short of them in re_start()

Revision 1.90: download - view: text, markup, annotated - select for diffs
Sat Oct 18 11:49:34 2008 UTC (6 years ago) by sephe
Branches: MAIN
Diff to: previous 1.89: preferred, colored
Changes since revision 1.89: +1 -1 lines
There are 4 fields in re_hwrev

Revision 1.89: download - view: text, markup, annotated - select for diffs
Sat Oct 18 11:26:52 2008 UTC (6 years ago) by sephe
Branches: MAIN
Diff to: previous 1.88: preferred, colored
Changes since revision 1.88: +38 -46 lines
- Don't claim 7422 MTU size is support by various 8111/8169 chips (PCI devices);
  6144 MTU size works reliably.
    Set MTU above 6144 (6 * 1024) on these chips and do following test:
    netperf -H host -l 30 -t UDP_STREAM -- -m (mtu-28)
    All kinds of wiredness will pop up on the test box.
- Set max supported MTU to 9216 for 8168D.
  Obtained-from: Realtek r8168-8.008.00
- Set max supported MTU to 6144 for non-8168D GigE chips.
- Cleanup jumbo frame/MTU size related macros.

# As usual, 8169(with 88E1000 PHY) does not seem to work well with any jumbo
# frame size

Revision 1.88: download - view: text, markup, annotated - select for diffs
Sat Oct 18 04:44:41 2008 UTC (6 years ago) by sephe
Branches: MAIN
Diff to: previous 1.87: preferred, colored
Changes since revision 1.87: +8 -13 lines
Fix hardware vlan tagging support by setting vlan information on all TX
descriptors for multi-segment packets.

# Even with this fix in place, 8169 still does not work reliably with vlan.
# Certain packets are never seen on the wire; maybe caused by the trailing
# ether frame CRC generated by the hardware?

Revision 1.87: download - view: text, markup, annotated - select for diffs
Sat Oct 18 03:00:29 2008 UTC (6 years ago) by sephe
Branches: MAIN
Diff to: previous 1.86: preferred, colored
Changes since revision 1.86: +15 -10 lines
Fix re_ioctl SIOCSIFCAP support, so that VLAN_HWTAGGING and VLAN_MTU could
be turned off.

Revision 1.86: download - view: text, markup, annotated - select for diffs
Fri Oct 17 14:12:23 2008 UTC (6 years ago) by sephe
Branches: MAIN
Diff to: previous 1.85: preferred, colored
Changes since revision 1.85: +265 -15 lines
Correct jumbo frame support for 8168C/CP/D.

These newer chips use ancient design, which does _not_ support gathering RX.
An even worse aspect of the new chips' design is that it does not compat
with old ones: the buffer length field in the RX descriptor seems to be
completely ignored by the hardware.  This means host memory will be trashed
by hardware if driver uses gathering RX.

Allocate a jumbo buffer pool for these chips and configure "max RX packet
size" register according to MTU.

Revision 1.85: download - view: text, markup, annotated - select for diffs
Thu Oct 16 14:58:50 2008 UTC (6 years ago) by sephe
Branches: MAIN
Diff to: previous 1.84: preferred, colored
Changes since revision 1.84: +45 -27 lines
Adjust max read request size according to MTU; 512 seems to be the only
value that works with jumbo frames without "watchdog timeout" during
UDP_STREAM netperf tests.

Revision 1.84: download - view: text, markup, annotated - select for diffs
Thu Oct 16 12:46:40 2008 UTC (6 years ago) by sephe
Branches: MAIN
Diff to: previous 1.83: preferred, colored
Changes since revision 1.83: +12 -7 lines
According to wpaul's comment, 8139C+ only support 64 TX/RX descriptors

Revision 1.83: download - view: text, markup, annotated - select for diffs
Thu Oct 16 12:29:13 2008 UTC (6 years ago) by sephe
Branches: MAIN
Diff to: previous 1.82: preferred, colored
Changes since revision 1.82: +103 -51 lines
Add hardware csum offload support for MAC style 2 chips, which include
8102E, 8102EL, 8168C, 8168CP and 8168D.

Obtained-from: RealTek r8101-1.009.00 r8168-8.008.00


Add RE_C_AUTOPAD capability to indicate hardware could correctly pad
short ether frames.  Turn it on for newer version of 8168B (0x38000000
and 0xb8000000) and MAC style 2 chips; manually padding short UDP packets
for newer version 8168B will result in incorrect UDP csum, while manually
padding short ICMP packets for MAC style 2 chips will result in both
incorrect IP header csum and incorrect IP length (o_O)

Revision 1.82: download - view: text, markup, annotated - select for diffs
Tue Oct 14 15:11:38 2008 UTC (6 years ago) by sephe
Branches: MAIN
Diff to: previous 1.81: preferred, colored
Changes since revision 1.81: +38 -28 lines
- Adjust PCI latency timer on all types of chips
- Adjust PCI cache line size for 8110/8169 chips
- For certain revision of 8101E, reading MAC address from IDRx may not
  work; read from EEPROM instead
- Add comment that adjusting config1 and config5 may cause unrecoverible
  disaster

Obtained-from: RealTek Linux drivers

Revision 1.81: download - view: text, markup, annotated - select for diffs
Tue Oct 14 10:42:35 2008 UTC (6 years ago) by sephe
Branches: MAIN
Diff to: previous 1.80: preferred, colored
Changes since revision 1.80: +3 -3 lines
0x28000000 is 8168D according to Realtek r8168-8.008.00 driver

Revision 1.80: download - view: text, markup, annotated - select for diffs
Mon Oct 13 14:10:42 2008 UTC (6 years ago) by sephe
Branches: MAIN
Diff to: previous 1.79: preferred, colored
Changes since revision 1.79: +22 -9 lines
Add some PHY fixups before we do mii_phy_probe()

Obtained-from: Realtek BSD driver v176

Revision 1.79: download - view: text, markup, annotated - select for diffs
Mon Oct 13 13:04:41 2008 UTC (6 years ago) by sephe
Branches: MAIN
Diff to: previous 1.78: preferred, colored
Changes since revision 1.78: +37 -6 lines
Bring in some PCI register settings from RealTek BSD driver v176.  Disable
the PCI register configuration for "style 2 MAC", add comment about it.

Revision 1.78: download - view: text, markup, annotated - select for diffs
Mon Oct 13 11:35:02 2008 UTC (6 years ago) by sephe
Branches: MAIN
Diff to: previous 1.77: preferred, colored
Changes since revision 1.77: +45 -23 lines
- Read ethernet address from IDRx registers.
  Obtained-from: RealTek BSD driver v176
  This eliminates the need to read/config EEPROM.  Put EEPROM related
  functions under RE_USE_EEPROM; disabled by default
- Maintain re_softc size no matter what kernel options we are using
- Remove RE_DISABLE_HWCSUM; we could do it by clearing RE_C_HWCUM

Revision 1.77: download - view: text, markup, annotated - select for diffs
Mon Oct 13 10:52:23 2008 UTC (6 years ago) by sephe
Branches: MAIN
Diff to: previous 1.76: preferred, colored
Changes since revision 1.76: +1 -0 lines
re_softc.re_swcum_lim is applied to ethernet frame without trailing CRC, so
it should include the size of ether header.

Revision 1.76: download - view: text, markup, annotated - select for diffs
Sun Oct 12 10:19:31 2008 UTC (6 years ago) by sephe
Branches: MAIN
Diff to: previous 1.75: preferred, colored
Changes since revision 1.75: +119 -55 lines
- Nuke re_type, add RE_C_8139CP to indicate the chip is 8139C+
- Change hardware revision mask from 0x7cc00000 to 0xfc800000
  Obtained-from: Realtek BSD driver v176
- Convert MAC mode to MAC version and save MAC version in softc
  Obtained-from: Realtek BSD driver v176
- Add hardware revision 0x34800000(8102E) and 0x28000000(chip name is unknown)
  Obtained-from: Realtek BSD driver v176

Revision 1.75: download - view: text, markup, annotated - select for diffs
Sun Oct 12 04:08:59 2008 UTC (6 years ago) by sephe
Branches: MAIN
Diff to: previous 1.74: preferred, colored
Changes since revision 1.74: +82 -105 lines
Rework re_probe()

Revision 1.74: download - view: text, markup, annotated - select for diffs
Thu Oct 9 14:30:48 2008 UTC (6 years ago) by sephe
Branches: MAIN
Diff to: previous 1.73: preferred, colored
Changes since revision 1.73: +11 -11 lines
Rename some HWREV

Revision 1.73: download - view: text, markup, annotated - select for diffs
Thu Oct 9 12:41:02 2008 UTC (6 years ago) by sephe
Branches: MAIN
Diff to: previous 1.72: preferred, colored
Changes since revision 1.72: +356 -89 lines
Use hardware timer to simulate interrupt moderation.  Old devices will no
longer be livelocked when they are receiving on GigE line.  Newer devices
also gain well controlled interrupt rate.

If hardware supports interrupt moderation (e.g. 8168B, 8168C), you could
also use hardware based interrupt moderation, however, due to lack of
necessary information it does not work as reliably as simulated interrupt
moderation.  It is _not_ recommended currently.

By default, PCI-E devices' simulated interrupt moderation timer is set to
75us, while PCI devices' is set to 125us.

Revision 1.72: download - view: text, markup, annotated - select for diffs
Tue Oct 7 12:49:05 2008 UTC (6 years ago) by sephe
Branches: MAIN
Diff to: previous 1.71: preferred, colored
Changes since revision 1.71: +46 -48 lines
- According to Realtek's BSD driver v176, we could always write to MISSEDPKT
- Use pci_get_pciecap_ptr() to decide whether a given chip is PCI-E or not
- Rename re_flags to re_caps; we will need a real re_flags soon

Revision 1.71: download - view: text, markup, annotated - select for diffs
Tue Oct 7 11:57:18 2008 UTC (6 years ago) by sephe
Branches: MAIN
Diff to: previous 1.70: preferred, colored
Changes since revision 1.70: +32 -77 lines
- It does not make sense to disable TX interrupt moderation
- Add field in softc to store RX related interrupt bits

This cleanup eases upcoming changes.

Revision 1.70: download - view: text, markup, annotated - select for diffs
Tue Oct 7 11:39:36 2008 UTC (6 years ago) by sephe
Branches: MAIN
Diff to: previous 1.69: preferred, colored
Changes since revision 1.69: +1 -3 lines
- Nuke interrupt bits definition which don't apply to 8169
- Don't test TX desc unavailable bit in re_intr, since it is never enabled

Revision 1.69: download - view: text, markup, annotated - select for diffs
Mon Oct 6 14:51:10 2008 UTC (6 years ago) by sephe
Branches: MAIN
Diff to: previous 1.68: preferred, colored
Changes since revision 1.68: +4 -4 lines
- Rearrange comment
- Reduce RX im timer from 125us to 50us

Revision 1.68: download - view: text, markup, annotated - select for diffs
Mon Oct 6 14:22:32 2008 UTC (6 years ago) by sephe
Branches: MAIN
Diff to: previous 1.67: preferred, colored
Changes since revision 1.67: +34 -4 lines
Add RX interrupt moderation suport for PCI-E GigaE chips.

Interrupt moderation register position is obtained from Realtek's
BSD driver v176.
The meaning of the IM register bits is partially reverse engineered:
RX timer position and unit.

This kind of interrupt moderation does not work on PCI GigaE chips.

Revision 1.67: download - view: text, markup, annotated - select for diffs
Sun Oct 5 08:28:32 2008 UTC (6 years ago) by sephe
Branches: MAIN
Diff to: previous 1.66: preferred, colored
Changes since revision 1.66: +1 -0 lines
re_freebufmem() may be re-entered, so set the mbuf tag to NULL after it is
destroyed.

Revision 1.66: download - view: text, markup, annotated - select for diffs
Sun Oct 5 07:57:45 2008 UTC (6 years ago) by sephe
Branches: MAIN
Diff to: previous 1.65: preferred, colored
Changes since revision 1.65: +39 -3 lines
- Set hardware timer according to bus clock.  Adjust hardware timer to 8000HZ
- For PCI-E device, increase "max read request size" from default value (512)
  to 4096.  With 512 TX descriptors, this change gives me additional +80-90Mbps
  during netperf stream tests on an 8168C.

Revision 1.65: download - view: text, markup, annotated - select for diffs
Sun Oct 5 06:15:36 2008 UTC (6 years ago) by sephe
Branches: MAIN
Diff to: previous 1.64: preferred, colored
Changes since revision 1.64: +29 -1 lines
Get bus clock, which will be used to fix broken TCTR setting (hardware timer,
interrupt moderation related)

Revision 1.64: download - view: text, markup, annotated - select for diffs
Sun Oct 5 05:00:58 2008 UTC (6 years ago) by sephe
Branches: MAIN
Diff to: previous 1.63: preferred, colored
Changes since revision 1.63: +6 -2 lines
Set ifq maxlen according to number of TX descriptors

Revision 1.63: download - view: text, markup, annotated - select for diffs
Sun Oct 5 04:54:51 2008 UTC (6 years ago) by sephe
Branches: MAIN
Diff to: previous 1.62: preferred, colored
Changes since revision 1.62: +82 -26 lines
Add tunable for RX/TX descriptor count

Revision 1.62: download - view: text, markup, annotated - select for diffs
Sun Oct 5 02:13:06 2008 UTC (6 years ago) by sephe
Branches: MAIN
Diff to: previous 1.61: preferred, colored
Changes since revision 1.61: +4 -4 lines
Don't assume that RE_RX_DESC_CNT and RE_TX_DESC_CNT are always same

Revision 1.61: download - view: text, markup, annotated - select for diffs
Sat Oct 4 10:36:21 2008 UTC (6 years ago) by sephe
Branches: MAIN
Diff to: previous 1.60: preferred, colored
Changes since revision 1.60: +59 -24 lines
- For relative newer parts (8168B), setting MTPS (max transmit packet size)
  according to MTU makes jumbo frame + TX csum offloading work.  However,
  for old ones (8169), setting MTPS does not have much effect.
- Reduce max jumbo frame size from 9018 to 7440 (according to DS)
- Fix MTU setting in re_ioctl

Revision 1.60: download - view: text, markup, annotated - select for diffs
Fri Oct 3 14:14:10 2008 UTC (6 years ago) by sephe
Branches: MAIN
Diff to: previous 1.59: preferred, colored
Changes since revision 1.59: +3 -0 lines
Free sysctl tree during detach

Revision 1.59: download - view: text, markup, annotated - select for diffs
Fri Oct 3 14:07:02 2008 UTC (6 years ago) by sephe
Branches: MAIN
Diff to: previous 1.58: preferred, colored
Changes since revision 1.58: +74 -14 lines
Transmit csum offload does not work at all on certain hardware revision
once frame length exceeds certain threshold (different parts seems to
have different thresholds).  Borrow code from ip_output to do software
csum, if transmit csum offloading is enabled and frame length exceeds
hardware's threshold.

8169, 8169S, 8169SB and 8168B are tested, while 8169S and 8169SB does not
seem to have this bug.

Revision 1.58: download - view: text, markup, annotated - select for diffs
Fri Oct 3 11:35:25 2008 UTC (6 years ago) by sephe
Branches: MAIN
Diff to: previous 1.57: preferred, colored
Changes since revision 1.57: +1 -0 lines
Print hardware revision during attach

Revision 1.57: download - view: text, markup, annotated - select for diffs
Fri Oct 3 10:12:35 2008 UTC (6 years ago) by sephe
Branches: MAIN
Diff to: previous 1.56: preferred, colored
Changes since revision 1.56: +22 -4 lines
- Don't substract ETHER_ALIGN from the fragment length, we don't do
  m_adj(ETHET_ALIGN) in re_newbuf()
- If one fragment of a multi-fragment packet recolletion fails, we
  drop will consecutive fragments of this packet.
- All of the TX descs in TX ring could be used; there is no need to
  reserve RE_TXDESC_SPARE TX descs

Revision 1.56: download - view: text, markup, annotated - select for diffs
Fri Oct 3 08:00:06 2008 UTC (6 years ago) by sephe
Branches: MAIN
Diff to: previous 1.55: preferred, colored
Changes since revision 1.55: +12 -12 lines
Factor out re_free_rxchain()

Revision 1.55: download - view: text, markup, annotated - select for diffs
Fri Oct 3 07:52:26 2008 UTC (6 years ago) by sephe
Branches: MAIN
Diff to: previous 1.54: preferred, colored
Changes since revision 1.54: +166 -126 lines
Rework DMA stuffs' allocation/free

Revision 1.54: download - view: text, markup, annotated - select for diffs
Fri Oct 3 05:47:07 2008 UTC (6 years ago) by sephe
Branches: MAIN
Diff to: previous 1.53: preferred, colored
Changes since revision 1.53: +11 -2 lines
If RX/TX ring initialization failed, then stop re(4) and return

Revision 1.53: download - view: text, markup, annotated - select for diffs
Fri Oct 3 05:09:18 2008 UTC (6 years ago) by sephe
Branches: MAIN
Diff to: previous 1.52: preferred, colored
Changes since revision 1.52: +249 -202 lines
Rework re_newbuf() and re_encap()

Revision 1.52: download - view: text, markup, annotated - select for diffs
Thu Oct 2 04:14:13 2008 UTC (6 years ago) by sephe
Branches: MAIN
Diff to: previous 1.51: preferred, colored
Changes since revision 1.51: +9 -10 lines
- Instead of using magic number 4 define it as RE_TXDESC_SPARE
- Clear if_timer only if all TX descs are free
- Clear IFF_OACTIVE only if more than RE_TXDESC_SPARE TX descs ar free

Revision 1.51: download - view: text, markup, annotated - select for diffs
Mon Sep 29 20:27:38 2008 UTC (6 years ago) by dillon
Branches: MAIN
Diff to: previous 1.50: preferred, colored
Changes since revision 1.50: +16 -1 lines
Add support for "RealTek 8102EL PCIe 10/100baseTX".  Checksum support
doesn't work yet for this card so disable hardware checksumming.

Submitted-by: "Mitja Horvat" <pinkfluid@gmail.com>

Revision 1.50: download - view: text, markup, annotated - select for diffs
Wed Sep 17 08:51:29 2008 UTC (6 years, 1 month ago) by sephe
Branches: MAIN
Diff to: previous 1.49: preferred, colored
Changes since revision 1.49: +0 -11 lines
Always enable ETHER_INPUT_CHAIN support

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

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

Revision 1.47: download - view: text, markup, annotated - select for diffs
Sun Aug 10 17:19:38 2008 UTC (6 years, 2 months ago) by swildner
Branches: MAIN
Diff to: previous 1.46: preferred, colored
Changes since revision 1.46: +0 -2 lines
Remove useless assignment.

Found-by: LLVM/Clang Static Analyzer

Revision 1.46: download - view: text, markup, annotated - select for diffs
Sun Jul 27 10:06:56 2008 UTC (6 years, 2 months ago) by sephe
Branches: MAIN
Diff to: previous 1.45: preferred, colored
Changes since revision 1.45: +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.45: download - view: text, markup, annotated - select for diffs
Sat Jul 26 16:12:06 2008 UTC (6 years, 2 months ago) by sephe
Branches: MAIN
CVS tags: DragonFly_Preview
Diff to: previous 1.44: preferred, colored
Changes since revision 1.44: +33 -3 lines
- Serialize re_{resume,suspend}()
- Add serializer assertion in all major NIC driver interfaces

Revision 1.44: download - view: text, markup, annotated - select for diffs
Wed Jun 25 11:02:33 2008 UTC (6 years, 3 months ago) by sephe
Branches: MAIN
CVS tags: DragonFly_RELEASE_2_0_Slip, DragonFly_RELEASE_2_0
Diff to: previous 1.43: preferred, colored
Changes since revision 1.43: +20 -0 lines
Make re(4) aware ETHER_INPUT_CHAIN and ETHER_INPUT2

Revision 1.43: download - view: text, markup, annotated - select for diffs
Fri May 16 13:19:12 2008 UTC (6 years, 5 months ago) by sephe
Branches: MAIN
Diff to: previous 1.42: preferred, colored
Changes since revision 1.42: +4 -4 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.42: download - view: text, markup, annotated - select for diffs
Wed May 14 11:59:21 2008 UTC (6 years, 5 months ago) by sephe
Branches: MAIN
Diff to: previous 1.41: preferred, colored
Changes since revision 1.41: +24 -14 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.41: download - view: text, markup, annotated - select for diffs
Sun Apr 27 15:10:37 2008 UTC (6 years, 5 months ago) by sephe
Branches: MAIN
Diff to: previous 1.40: preferred, colored
Changes since revision 1.40: +10 -3 lines
Add basic support for 8111C; hardware checksum offload does not seems to work
on 8111C yet.

Revision 1.40: download - view: text, markup, annotated - select for diffs
Sun Apr 27 14:18:16 2008 UTC (6 years, 5 months ago) by sephe
Branches: MAIN
Diff to: previous 1.39: preferred, colored
Changes since revision 1.39: +3 -0 lines
Print unknown hardware version.

Revision 1.39: download - view: text, markup, annotated - select for diffs
Sun Apr 20 13:44:25 2008 UTC (6 years, 6 months ago) by swildner
Branches: MAIN
Diff to: previous 1.38: preferred, colored
Changes since revision 1.38: +1 -1 lines
Another round of typo fixes (mostly in messages).

Revision 1.38: download - view: text, markup, annotated - select for diffs
Mon Mar 10 12:59:51 2008 UTC (6 years, 7 months ago) by sephe
Branches: MAIN
Diff to: previous 1.37: preferred, colored
Changes since revision 1.37: +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.37: download - view: text, markup, annotated - select for diffs
Mon Mar 10 10:47:57 2008 UTC (6 years, 7 months ago) by sephe
Branches: MAIN
Diff to: previous 1.36: preferred, colored
Changes since revision 1.36: +4 -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.36: download - view: text, markup, annotated - select for diffs
Tue Aug 14 13:30:35 2007 UTC (7 years, 2 months ago) by sephe
Branches: MAIN
CVS tags: DragonFly_RELEASE_1_12_Slip, DragonFly_RELEASE_1_12
Diff to: previous 1.35: preferred, colored
Changes since revision 1.35: +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.35: download - view: text, markup, annotated - select for diffs
Sun Aug 12 11:51:26 2007 UTC (7 years, 2 months ago) by sephe
Branches: MAIN
Diff to: previous 1.34: preferred, colored
Changes since revision 1.34: +14 -2 lines
PCI-E re(4) needs multi hash in reverse order.  Add comment about it.

Reported-by: Dennis den Brok <d.den.brok@uni-bonn.de>
Obtained-from: NetBSD (tsutsui@netbsd.org)

Revision 1.34: download - view: text, markup, annotated - select for diffs
Fri Aug 10 03:48:02 2007 UTC (7 years, 2 months ago) by dillon
Branches: MAIN
Diff to: previous 1.33: preferred, colored
Changes since revision 1.33: +3 -0 lines
Add support for a new revision of the RealTek 8168B/8111B called SPIN3.

Requested-by: d.den.brok@uni-bonn.de (Dennis den Brok)

Revision 1.33: download - view: text, markup, annotated - select for diffs
Tue Jun 26 07:47:28 2007 UTC (7 years, 3 months ago) by hasso
Branches: MAIN
CVS tags: DragonFly_RELEASE_1_10_Slip, DragonFly_RELEASE_1_10
Diff to: previous 1.32: preferred, colored
Changes since revision 1.32: +1 -1 lines
Nuke "is is" stammering.

Revision 1.32: download - view: text, markup, annotated - select for diffs
Fri Mar 30 14:15:58 2007 UTC (7 years, 6 months ago) by sephe
Branches: MAIN
Diff to: previous 1.31: preferred, colored
Changes since revision 1.31: +2 -0 lines
Yet another RTL8110SC

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

Revision 1.31: download - view: text, markup, annotated - select for diffs
Wed Feb 14 13:00:34 2007 UTC (7 years, 8 months ago) by sephe
Branches: MAIN
Diff to: previous 1.30: preferred, colored
Changes since revision 1.30: +9 -15 lines
PCIe re(4) can't handle TCP csum offloading well if short packets
are padded by the driver, which is intended to fix PCI re(4) csum
offloading bug.  It turns out both PCI and PCIe re(4) _can_ handle
short packets TCP csum offloading without driver's interferece, so
padding for short TCP packets is avoided.

Obtained-from: FreeBSD (wpaul@freebsd.org)
Tested-by: Joe Talbott <josepht@cstone.net> RTL8101E(PCIe)
	   me RTL8169S(PCI) RTL8169SB(PCI)

Revision 1.30: download - view: text, markup, annotated - select for diffs
Mon Jan 15 12:53:26 2007 UTC (7 years, 9 months ago) by sephe
Branches: MAIN
CVS tags: DragonFly_RELEASE_1_8_Slip, DragonFly_RELEASE_1_8
Diff to: previous 1.29: preferred, colored
Changes since revision 1.29: +17 -10 lines
By default do not enable hardware csum on PCIe re(4), which trashes
packets intermittently if csum offload is enabled.  This problem does
not seem to plague PCI re(4).

The pattern of trashed packets is not yet identified.  From the tcpdump
information provided by Joe, the packets' size should not be the direct
cause.  Hardware bug?

Reported-by: Joe Talbott <josepht@cstone.net> (RTL8101E, PCIe re(4))

# Same problem is reported to FreeBSD by two RTL8168B(PCIe re(4)) users.

Revision 1.29: download - view: text, markup, annotated - select for diffs
Sat Dec 23 03:41:55 2006 UTC (7 years, 10 months ago) by sephe
Branches: MAIN
Diff to: previous 1.28: preferred, colored
Changes since revision 1.28: +44 -40 lines
- Don't call m_adj() to make RX buffer's _payload_ on longword aligned,
  because some re(4) chips (e.g. RTL8101E) require RX buffer to be
  8-bytes aligned.  This change shows no noticeable performance change.
  Reported-by: Joe Talbott <josepht@cstone.net>
- Avoid writing extra hardware registers by writing 2 bytes to IDR4
  instead instead of writing 4 bytes, bacause:
  1) the extra two registers after IDR5 are reserved.
  2) accessing arpcom.ac_enaddr[6,7] should be invalid.
- Add a flag field in re_softc and re_hwrev.  Currently only one flag,
  RE_F_HASMPC, is defined.  This flag is used to indicate whether the
  hardware has MPC register or not, so we can avoid writing to MPC's
  position, if that position is reserved.
- Move descriptor ring address setting up before RX/TX enabling, since
  some re(4) chips (e.g. RTL8101E) will try accessing descriptor ring
  immediately after RX/TX is enabled, which results in intermittent
  kernel panic or system hanging.
  Paniced-by: Joe Talbott <josepht@cstone.net>
- Avoid calling re_init(), if hw.reX.tx_moderation is changed but NIC
  is not up yet.
- Const-fy global hardware id arrays and nuke unused macro while I'm here.

Thank Joe Talbott <josepht@cstone.net> to help debugging and provide
valuable information (esp. locating the problematic RX/TX enabling :)

Thank dillon@ to provide debugging hints.

Tested-by:
  Joe Talbott <josepht@cstone.net> (RTL8101E)
  swildner@ (onboard RTL8169S) (*)
  me (RTL8169S)

# (*) swildner@'s card is still half broken even after this commit :\

Revision 1.28: download - view: text, markup, annotated - select for diffs
Tue Nov 14 13:35:49 2006 UTC (7 years, 11 months ago) by sephe
Branches: MAIN
Diff to: previous 1.27: preferred, colored
Changes since revision 1.27: +281 -120 lines
Sync re(4) with FreeBSD:
- Add support for RealTek 8169SC/8110SC and RTL8101E devices.  The latter
  is a PCIe 10/100 chip.
- Add support for RealTek RTL8168(B?)
- Fix EEPROM reading code
- Disable diagnostic code in re_attach() by default.  It is almost useless
  and has caused much trouble.
- Manually padding small IP datagrams to work arround hardware checksum
  offload bug [1].  Enable IP/TCP/UDP checksum offload after this fix.
- Work arround hardware TX bug in some PCIe re(4) devices:
  The TX command, which is issued when there is transmission in progress,
  will get lost [2].
  So at the end of re_txeof(), if there are still packets sitting in the
  TX ring, we kick the TX engine again.
- Add a sysctl hw.reX.tx_moderation to turn on/off TX moderation.  It is
  on by default.
- Move softc related structs from if_rereg.h into newly created if_revar.h

Thank Bill Paul (wpaul@freebsd.org) and many other people for their work
on this driver.

#
# [1] Detailed description of this bug is at:
#     FreeBSD dev/re/if_re.c rev1.70 by wpaul@freebsd.org
#
# [2] Detailed description of this bug is at:
#     FreeBSD dev/re/if_re.c rev1.71 by wpaul@freebsd.org
#

Revision 1.27: download - view: text, markup, annotated - select for diffs
Wed Oct 25 20:55:58 2006 UTC (7 years, 11 months ago) by dillon
Branches: MAIN
Diff to: previous 1.26: preferred, colored
Changes since revision 1.26: +2 -7 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.26: download - view: text, markup, annotated - select for diffs
Mon Oct 16 14:15:51 2006 UTC (8 years ago) by sephe
Branches: MAIN
Diff to: previous 1.25: preferred, colored
Changes since revision 1.25: +11 -0 lines
Add support for Linksys EG1032 rev.3 GigE

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

Revision 1.25: download - view: text, markup, annotated - select for diffs
Mon Oct 16 13:32:02 2006 UTC (8 years ago) by sephe
Branches: MAIN
Diff to: previous 1.24: preferred, colored
Changes since revision 1.24: +6 -10 lines
- Use RE_RX_LIST_SIZE instead of RE_TX_LIST_SIZE while dealing with
  RX DMA stuffs, though current RE_RX_LIST_SIZE == RE_TX_LIST_SIZE
  Obtained-from: FreeBSD (jmg@freebsd.org)
- Use BUS_DMASYNC_PREWRITE instead of BUS_DMASYNC_PREWRITE|BUS_DMASYNC_PREREAD,
  the latter does not apply to DragonFly

Revision 1.24: download - view: text, markup, annotated - select for diffs
Mon Oct 16 13:19:08 2006 UTC (8 years ago) by sephe
Branches: MAIN
Diff to: previous 1.23: preferred, colored
Changes since revision 1.23: +2 -0 lines
Add support Corega CG-LAPCIGT Gigabit Ethernet(8169S)

Obtained-from: FreeBSD

Revision 1.23: download - view: text, markup, annotated - select for diffs
Tue Sep 5 00:55:40 2006 UTC (8 years, 1 month ago) by dillon
Branches: MAIN
Diff to: previous 1.22: preferred, colored
Changes since revision 1.22: +3 -3 lines
Rename malloc->kmalloc, free->kfree, and realloc->krealloc.  Pass 1

Revision 1.22: download - view: text, markup, annotated - select for diffs
Tue Aug 1 18:07:12 2006 UTC (8 years, 2 months ago) by swildner
Branches: MAIN
Diff to: previous 1.21: preferred, colored
Changes since revision 1.21: +6 -5 lines
Use pcidevs.h.

Revision 1.20.2.1: download - view: text, markup, annotated - select for diffs
Sun Jan 1 00:59:05 2006 UTC (8 years, 9 months ago) by dillon
Branches: DragonFly_RELEASE_1_4
CVS tags: DragonFly_RELEASE_1_4_Slip
Diff to: previous 1.20: preferred, colored; next MAIN 1.21: preferred, colored
Changes since revision 1.20: +6 -7 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.21: download - view: text, markup, annotated - select for diffs
Sat Dec 31 14:08:00 2005 UTC (8 years, 9 months ago) by sephe
Branches: MAIN
CVS tags: DragonFly_RELEASE_1_6_Slip, DragonFly_RELEASE_1_6
Diff to: previous 1.20: preferred, colored
Changes since revision 1.20: +6 -7 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.20: download - view: text, markup, annotated - select for diffs
Sun Dec 4 18:07:49 2005 UTC (8 years, 10 months ago) by dillon
Branches: MAIN
Branch point for: DragonFly_RELEASE_1_4
Diff to: previous 1.19: preferred, colored
Changes since revision 1.19: +4 -2 lines
Add support for DLink 528(T) Gigabit cards.

Submitted-by: Gary Allan <dragonfly@gallan.plus.com>
Taken-from: FreeBSD

Revision 1.19: download - view: text, markup, annotated - select for diffs
Mon Nov 28 17:13:43 2005 UTC (8 years, 10 months ago) by dillon
Branches: MAIN
Diff to: previous 1.18: preferred, colored
Changes since revision 1.18: +24 -37 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.18: download - view: text, markup, annotated - select for diffs
Tue Nov 22 00:24:33 2005 UTC (8 years, 11 months ago) by dillon
Branches: MAIN
Diff to: previous 1.17: preferred, colored
Changes since revision 1.17: +20 -8 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.17: download - view: text, markup, annotated - select for diffs
Mon Oct 24 08:06:15 2005 UTC (8 years, 11 months ago) by sephe
Branches: MAIN
Diff to: previous 1.16: preferred, colored
Changes since revision 1.16: +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.16: download - view: text, markup, annotated - select for diffs
Wed Oct 12 17:35:52 2005 UTC (9 years ago) by dillon
Branches: MAIN
Diff to: previous 1.15: preferred, colored
Changes since revision 1.15: +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.15: download - view: text, markup, annotated - select for diffs
Thu Sep 29 12:52:51 2005 UTC (9 years ago) by sephe
Branches: MAIN
Diff to: previous 1.14: preferred, colored
Changes since revision 1.14: +11 -1 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.14: download - view: text, markup, annotated - select for diffs
Thu Jun 9 20:04:44 2005 UTC (9 years, 4 months ago) by joerg
Branches: MAIN
Diff to: previous 1.13: preferred, colored
Changes since revision 1.13: +29 -29 lines
Convert to critical sections. No need to protect the interupt from racing
against itself.

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

Revision 1.12: download - view: text, markup, annotated - select for diffs
Wed May 25 01:44:27 2005 UTC (9 years, 4 months ago) by dillon
Branches: MAIN
Diff to: previous 1.11: preferred, colored
Changes since revision 1.11: +39 -46 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.11: download - view: text, markup, annotated - select for diffs
Tue May 24 20:59:02 2005 UTC (9 years, 4 months ago) by dillon
Branches: MAIN
Diff to: previous 1.10: preferred, colored
Changes since revision 1.10: +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.10: download - view: text, markup, annotated - select for diffs
Sun Feb 20 00:36:23 2005 UTC (9 years, 8 months ago) by joerg
Branches: MAIN
CVS tags: DragonFly_Stable, DragonFly_RELEASE_1_2_Slip, DragonFly_RELEASE_1_2
Diff to: previous 1.9: preferred, colored
Changes since revision 1.9: +34 -23 lines
Fix a bug introduced earlier. We can't put packets back into
the queue with ALTQ, so we have to handle the case of errors
after m_defrag has been called directly. We also have to remove
the packets from the queue before we free them to avoid races.
Same applies to calling bpf_mtap, which has to done on the
defragmented packet.

Revision 1.9: download - view: text, markup, annotated - select for diffs
Sat Feb 12 04:07:34 2005 UTC (9 years, 8 months ago) by joerg
Branches: MAIN
Diff to: previous 1.8: preferred, colored
Changes since revision 1.8: +6 -5 lines
ALTQ support.

Revision 1.8: download - view: text, markup, annotated - select for diffs
Fri Feb 11 22:25:56 2005 UTC (9 years, 8 months ago) by joerg
Branches: MAIN
Diff to: previous 1.7: preferred, colored
Changes since revision 1.7: +7 -2 lines
Import ALTQ support from KAME. This is based on the FreeBSD 4 snapshot.
This includes neither the ALTQ3 compat code nor the !DragonFly defines.
The macros have been replaced with inline functions in net/ifq_var.h.

This also renames pkthdr.pf_flags as it is intended as general flag bit.
Currently supported are ppp(4), sppp(4), tun(4) and wi(4), more drivers
are coming later.

Reviewed-by: corecode, dillon, hsu
Comments-from: hmp

Revision 1.7: download - view: text, markup, annotated - select for diffs
Tue Jan 25 19:35:11 2005 UTC (9 years, 8 months ago) by dillon
Branches: MAIN
Diff to: previous 1.6: preferred, colored
Changes since revision 1.6: +11 -1 lines
Disable hardware checksum support by default, it produces packet corruption.
It is unclear why the corruption occurs, but certain fragmented packets
consistently reproduce it so there's a good chance that there may be alignment
or length requirements that we don't know about, or just pure hardware
brokedness with certain packets.

The checksumming can be turned on again with ifconfig for testing purposes.

 EXTRACTION from Aggelos's packet dumps ]

CLIENT:  (RE0)

11:43:27.261710 192.168.2.2.183764104 > 192.168.2.4.nfs: 1472 write [|nfs] (frag 8031:1480@0+)
11:43:27.261718 192.168.2.2 > 192.168.2.4: udp (frag 8031:1480@1480+)
11:43:27.261729 192.168.2.2 > 192.168.2.4: udp (frag 8031:1480@2960+)
11:43:27.261743 192.168.2.2 > 192.168.2.4: udp (frag 8031:1480@4440+)
11:43:27.261756 192.168.2.2 > 192.168.2.4: udp (frag 8031:1480@5920+)
11:43:27.261767 192.168.2.2 > 192.168.2.4: udp (frag 8031:1480@7400+)
11:43:27.261781 192.168.2.2 > 192.168.2.4: udp (frag 8031:1480@8880+)
11:43:27.261793 192.168.2.2 > 192.168.2.4: udp (frag 8031:1480@10360+)
11:43:27.261807 192.168.2.2 > 192.168.2.4: udp (frag 8031:4@11840)

SERVER:  (RL0)

13:56:59.783671 192.168.2.2.183764104 > 192.168.2.4.nfs: 1472 write [|nfs] (frag 8031:1480@0+)
13:56:59.783785 192.168.2.2 > 192.168.2.4: udp (frag 8031:1480@1480+)
13:56:59.783915 192.168.2.2 > 192.168.2.4: udp (frag 8031:1480@2960+)
13:56:59.784037 192.168.2.2 > 192.168.2.4: udp (frag 8031:1480@4440+)
13:56:59.784159 192.168.2.2 > 192.168.2.4: udp (frag 8031:1480@5920+)
13:56:59.784283 192.168.2.2 > 192.168.2.4: udp (frag 8031:1480@7400+)
13:56:59.784407 192.168.2.2 > 192.168.2.4: udp (frag 8031:1480@8880+)
13:56:59.784527 192.168.2.2 > 192.168.2.4: udp (frag 8031:1480@10360+)
13:56:59.784532 0.0.0.0 > 0.0.2.4: udp (frag 8031:4@11840)

Reported-by: aoiko@cc.ece.ntua.gr (Aggelos)
Note-Also: also turned off in FreeBSD /usr/src/sys/dev/re/if_re.c:1.37

Revision 1.6: download - view: text, markup, annotated - select for diffs
Mon Aug 2 15:10:08 2004 UTC (10 years, 2 months ago) by joerg
Branches: MAIN
CVS tags: DragonFly_Snap29Sep2004, DragonFly_Snap13Sep2004
Diff to: previous 1.5: preferred, colored
Changes since revision 1.5: +1 -3 lines
Release to correct ressource in re_detach, this is PCI_LOIO now.
Remove a RE_DESC_INC from re_rxeof, a left-over from the while loop.

Revision 1.5: download - view: text, markup, annotated - select for diffs
Mon Aug 2 13:35:02 2004 UTC (10 years, 2 months ago) by joerg
Branches: MAIN
Diff to: previous 1.4: preferred, colored
Changes since revision 1.4: +0 -0 lines
Forced commit to annotate the (unrelated) changes from the last commit.

RealTek doesn't seem to support memory-mapped IO for re(4), the card
generates an interrupt storm under pretty low load. Therefore change
re(4) to the slower port-mapped IO.

Revision 1.4: download - view: text, markup, annotated - select for diffs
Mon Aug 2 13:22:32 2004 UTC (10 years, 2 months ago) by joerg
Branches: MAIN
Diff to: previous 1.3: preferred, colored
Changes since revision 1.3: +7 -7 lines
Change (almost) all references to tqh_first and tqe_next and tqe_prev
to the correct TAILQ macros. Exceptions are contrib/ipfilter, which will
be handled separately, and dev/misc/labpc, which makes some very wiered
things and therefore needs much more care.

Revision 1.3: download - view: text, markup, annotated - select for diffs
Fri Jul 23 07:16:28 2004 UTC (10 years, 3 months ago) by joerg
Branches: MAIN
Diff to: previous 1.2: preferred, colored
Changes since revision 1.2: +3 -7 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.2: download - view: text, markup, annotated - select for diffs
Wed Jul 14 07:40:26 2004 UTC (10 years, 3 months ago) by joerg
Branches: MAIN
CVS tags: DragonFly_1_0A_REL
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +0 -2 lines
Don't init sc->re_timer twice.

Revision 1.1: download - view: text, markup, annotated - select for diffs
Wed Jul 7 09:47:27 2004 UTC (10 years, 3 months ago) by joerg
Branches: MAIN
CVS tags: DragonFly_1_0_REL
Add re(4) as kernel module. After some feedback, this will be added to the
GENERIC.

Obtained-from: FreeBSD

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