DragonFly BSD

CVS log for src/sys/bus/usb/usb_ethersubr.c

[BACK] Up to [DragonFly] / src / sys / bus / usb

Request diff between arbitrary revisions


Keyword substitution: kv
Default branch: MAIN


Revision 1.21: download - view: text, markup, annotated - select for diffs
Wed Sep 24 14:26:38 2008 UTC (6 years, 2 months ago) by sephe
Branches: MAIN
CVS tags: HEAD
Diff to: previous 1.20: preferred, unified
Changes since revision 1.20: +2 -1 lines
Add NETISR_FLAG_NOTMPSAFE, which could be used as the last parameter to
netisr_register(), more expressive and less error-prone than 0.

Suggested-by: hsu@

Revision 1.20: download - view: text, markup, annotated - select for diffs
Tue Sep 23 11:28:49 2008 UTC (6 years, 2 months ago) by sephe
Branches: MAIN
Diff to: previous 1.19: preferred, unified
Changes since revision 1.19: +1 -1 lines
Add following three network protocol threads running mode:
1) BGL (default)
2) Adaptive BGL.  Protocol threads run without BGL by default.  BGL will be
   held if the received msg does not have MSGF_MPSAFE turned on the ms_flags
   field
3) No BGL (experimental)

The code on the main path is done by dillon@

Following three sysctls and tunables are added to adjust the "mode":
net.netisr.mpsafe_thread
net.inet.tcp.mpsafe_thread
net.inet.udp.mpsafe_thread

They have same set of values,
0 (default) -- BGL
1 	    -- Adaptive BGL
2 	    -- No BGL



NETISR_FLAG_MPSAFE is added (netisr.ni_flags), so that:
- netisr_queue() and schednetisr() could set MSGF_MPSAFE during msg
  initialization
- netisr_run() (called by ether_input_oncpu()) could hold BGL based on this flag
  before calling netisr's handler



PR_MPSAFE is added (protosw.pr_flags), so that tranport_processing_oncpu() could
hold BGL before calling protocol's input handler



Kernel API changes:
- The thread parameter to netmsg_service_loop() must be supplied (running mode)
  and it must have the type of "int *"
- netisr_register() takes additional flags parameter to indicate whether its
  handler is MPSAFE (NETISR_FLAG_MPSAFE) or not

Reviewed-by: dillon@

Revision 1.19: download - view: text, markup, annotated - select for diffs
Thu Jun 28 06:32:31 2007 UTC (7 years, 4 months ago) by hasso
Branches: MAIN
CVS tags: DragonFly_RELEASE_2_0_Slip, DragonFly_RELEASE_2_0, DragonFly_RELEASE_1_12_Slip, DragonFly_RELEASE_1_12, DragonFly_RELEASE_1_10_Slip, DragonFly_RELEASE_1_10, DragonFly_Preview
Diff to: previous 1.18: preferred, unified
Changes since revision 1.18: +2 -2 lines
Nuke device_ptr_t, USBBASEDEVICE, USBDEVNAME(), USBDEVUNIT(), USBGETSOFTC(),
USBDEVPTRNAME() and Static with help from sed(1).

Revision 1.18: download - view: text, markup, annotated - select for diffs
Wed May 23 08:57:10 2007 UTC (7 years, 6 months ago) by dillon
Branches: MAIN
Diff to: previous 1.17: preferred, unified
Changes since revision 1.17: +1 -2 lines
* Greatly reduce the complexity of the LWKT messaging and port abstraction.
  Significantly reduce the overhead of the subsystem.

* The message abort algorithm has been rewritten.  It now sends a
  separate message to issue the abort instead of trying to requeue
  the original message.  This also means the TAILQ embedded in the
  lwkt_msg structure can be used by unrelated code during processing
  of the message.

* Numerous MSGF_ flags have been removed, and all the LWKT msg/port
  algorithms have been rewritten and simplified.  The message structure
  is now only touched by the current owner in all situations.

* Numerous structural fields have been removed.  In particular, the
  fields used for message abort sequencing have been simplified and
  we do not try to embed a 'command' field in the base LWKT message
  any more.

* Clean up the netmsg abstraction, which is used all over the network stack.
  Instead of trying to overload fields in lwkt_msg we now simply extend
  the base lwkt_msg into struct netmsg.  The function dispatch now takes
  a netmsg and returns void (before we had to return EASYNC), and we no
  longer need weird casts.

  Accept/connect message aborts are now greatly simplified.

Revision 1.17: download - view: text, markup, annotated - select for diffs
Sun Dec 10 02:03:56 2006 UTC (7 years, 11 months ago) by sephe
Branches: MAIN
CVS tags: DragonFly_RELEASE_1_8_Slip, DragonFly_RELEASE_1_8
Diff to: previous 1.16: preferred, unified
Changes since revision 1.16: +0 -1 lines
Sync USB support (host controller part) with FreeBSD6.

Following changes on FreeBSD-CURRENT(by iedowse@freebsd.org) are merged:
ehci.c	rev 1.52
ohci.c	rev 1.167
uhci.c	rev 1.172
usb.c	rev 1.111
usbdi.h	rev 1.61
"Use a different task queue for host controller and peripheral driver
 tasks. Since the host controllers rely on tasks to process transfer
 timeouts, if a synchronous transfer from a driver was invoked from
 a task and timed out, it would never complete because the single
 task thread was stuck performing the synchronous transfer so couldn't
 process the timeout."

As of this commit, only following kernel APIs are changed:
- usbd_get_string_desc() takes one more argument which returns the actual
  size of the string description.
- usb_add_task() takes one more argument.  The extra arguemnt is used
  to specify to which task queue the task should be added.  There is
  two task queues defined, one for peripheral driver (USB_TASKQ_DRIVER),
  one for host controller (USB_TASKQ_HC).

ugen(4) is adapted according to the above kernel API changes.

Thank all of the folks for their work on the USB support.

Tested-by:
swildner@, vbd@, joerg@(1.6 backport), Max Herrgard <herrgard@gmail.com>

# Though VT6202 is supported by ehci(4), I still have problems with this
# chip, even with the updated ehci(4).

Revision 1.16: download - view: text, markup, annotated - select for diffs
Sat May 20 06:32:36 2006 UTC (8 years, 6 months ago) by dillon
Branches: MAIN
CVS tags: DragonFly_RELEASE_1_6_Slip, DragonFly_RELEASE_1_6
Diff to: previous 1.15: preferred, unified
Changes since revision 1.15: +1 -2 lines
Embed the netmsg in the mbuf itself rather than allocating one for
each received packet.  This greatly reduces the overhead in the
network receive path (removing a malloc() and free()).

Revision 1.15: download - view: text, markup, annotated - select for diffs
Sun Jan 22 14:03:51 2006 UTC (8 years, 10 months ago) by swildner
Branches: MAIN
Diff to: previous 1.14: preferred, unified
Changes since revision 1.14: +2 -1 lines
* Move function types to a separate line.

* Ansify function definitions.

* Remove (void) casts for discarded return values.

In collaboration with: Alexey Slynko <slynko@tronet.ru>

Revision 1.14: download - view: text, markup, annotated - select for diffs
Mon Nov 28 17:13:23 2005 UTC (8 years, 11 months ago) by dillon
Branches: MAIN
CVS tags: DragonFly_RELEASE_1_4_Slip, DragonFly_RELEASE_1_4
Diff to: previous 1.13: preferred, unified
Changes since revision 1.13: +2 -2 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.13: download - view: text, markup, annotated - select for diffs
Thu Jun 2 20:40:40 2005 UTC (9 years, 5 months ago) by dillon
Branches: MAIN
Diff to: previous 1.12: preferred, unified
Changes since revision 1.12: +15 -17 lines
Remove spl*() calls from the bus/ infrastructure, replacing them with
critical sections.  Remove splusb() from everywhere, replacing it with
critical sections.

Revision 1.12: download - view: text, markup, annotated - select for diffs
Wed Feb 16 22:50:28 2005 UTC (9 years, 9 months ago) by joerg
Branches: MAIN
CVS tags: DragonFly_Stable, DragonFly_RELEASE_1_2_Slip, DragonFly_RELEASE_1_2
Diff to: previous 1.11: preferred, unified
Changes since revision 1.11: +9 -42 lines
The old USB ethernet code utilized a netisr to hand packets over
the ether_input and cleanup after txeof. This was broken some
time ago and is a workaround for the different IPL of USB and
the network stack.

Reduce the amount of hacks by removing usb_tx_done, it can be
done mostly in-place with a slight race-condition in the enqueue
code. usb_ether_input now directly calls ether_input, the caller
is responsible for rearming the receiver. That's doesn't open
a race since the receiver doesn't have to handle the interface
queues, for the driver state is the driver responsible.

The IPL protection of the USB ethernet drivers has to be reviewed,
it's mostly not existing.

Revision 1.11: download - view: text, markup, annotated - select for diffs
Tue Feb 15 10:30:11 2005 UTC (9 years, 9 months ago) by joerg
Branches: MAIN
Diff to: previous 1.10: preferred, unified
Changes since revision 1.10: +3 -2 lines
Use ifq_is_empty to allow USB drivers to support ALTQ.

Revision 1.10: download - view: text, markup, annotated - select for diffs
Fri Jul 23 07:16:24 2004 UTC (10 years, 4 months ago) by joerg
Branches: MAIN
CVS tags: DragonFly_Snap29Sep2004, DragonFly_Snap13Sep2004
Diff to: previous 1.9: preferred, unified
Changes since revision 1.9: +1 -5 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.9: download - view: text, markup, annotated - select for diffs
Wed Apr 21 18:13:49 2004 UTC (10 years, 7 months ago) by dillon
Branches: MAIN
CVS tags: DragonFly_1_0_REL, DragonFly_1_0_RC1, DragonFly_1_0A_REL
Diff to: previous 1.8: preferred, unified
Changes since revision 1.8: +2 -2 lines
Fix a netmsg memory leak in the ARP code.  Adjust all ms_cmd function
dispatches to return a proper error code.

Reported-by: multiple people

Revision 1.8: download - view: text, markup, annotated - select for diffs
Fri Apr 9 22:34:09 2004 UTC (10 years, 7 months ago) by hsu
Branches: MAIN
Diff to: previous 1.7: preferred, unified
Changes since revision 1.7: +4 -0 lines
Push the lwkt_replymsg() up one level from netisr_service_loop() to
the message handler so we can explicitly reply or not reply as appropriate.

Revision 1.7: download - view: text, markup, annotated - select for diffs
Sat Mar 6 01:58:54 2004 UTC (10 years, 8 months ago) by hsu
Branches: MAIN
Diff to: previous 1.6: preferred, unified
Changes since revision 1.6: +2 -3 lines
Dispatch upper-half protocol request handling.

Revision 1.6: download - view: text, markup, annotated - select for diffs
Tue Dec 30 01:01:44 2003 UTC (10 years, 10 months ago) by dillon
Branches: MAIN
Diff to: previous 1.5: preferred, unified
Changes since revision 1.5: +13 -9 lines
Bring in the entire FreeBSD-5 USB infrastructure.  As of this commit my
USB camera, Hard Drive, Mouse, and Sony memory key all work and I can even
unplug and replug them in without crashing the port.

Not all drivers and subsystems compile as of this commit, but the ones that
do not are very close.

Revision 1.5: download - view: text, markup, annotated - select for diffs
Sat Nov 8 07:57:45 2003 UTC (11 years ago) by dillon
Branches: MAIN
Diff to: previous 1.4: preferred, unified
Changes since revision 1.4: +3 -13 lines
Network threading stage 1/3: netisrs are already software interrupts,
which means they alraedy run in their own thread.  This commit creates
multiple supporting threads for netisrs rather then just one and code
has been added to begin routing packets to particular threads based on
their content.  Eventually this will lead to us being able to isolate and
serialize PCBs in particular threads.  The tail end of the ip_input path's
protocol dispatch, the UIPC (user entry) code, and listen socket have not
been covered yet and still need to be serialized.

A new debugging sysctl, net.inet.ip.mthread_enable, has been added.  It
defaults to 1.  If you set this sysctl 0 netisr processing will revert to
the prior single-threaded behavior.

Submitted-by: Jeffrey Hsu <hsu@FreeBSD.org>
Additional-work-by: dillon

Revision 1.4: download - view: text, markup, annotated - select for diffs
Mon Sep 15 23:38:12 2003 UTC (11 years, 2 months ago) by hsu
Branches: MAIN
Diff to: previous 1.3: preferred, unified
Changes since revision 1.3: +4 -5 lines
Centralize if queue handling.

Original patch against FreeBSD submitted by Jonathan Lemon.
Reviewed by Matt Dillon.

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

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

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

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

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

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

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

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

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

    * Bump the config rev.

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

Revision 1.2: download - view: text, markup, annotated - select for diffs
Tue Jun 17 04:28:32 2003 UTC (11 years, 5 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:30 2003 UTC (11 years, 5 months ago) by dillon
Branches: MAIN
CVS tags: FREEBSD_4_FORK
import from FreeBSD RELENG_4 1.4.2.4

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