DragonFly BSD

CVS log for src/sys/netinet/in.c

[BACK] Up to [DragonFly] / src / sys / netinet

Request diff between arbitrary revisions


Keyword substitution: kv
Default branch: MAIN


Revision 1.41: download - view: text, markup, annotated - select for diffs
Sun Aug 17 05:20:10 2008 UTC (5 years, 11 months ago) by sephe
Branches: MAIN
CVS tags: HEAD
Diff to: previous 1.40: preferred, colored; selected 1.26: preferred, colored
Changes since revision 1.40: +4 -4 lines
Pass cpuid to ifa_domsg()

Revision 1.40: download - view: text, markup, annotated - select for diffs
Sat Jun 14 08:40:16 2008 UTC (6 years, 1 month ago) by sephe
Branches: MAIN
CVS tags: DragonFly_RELEASE_2_0_Slip, DragonFly_RELEASE_2_0, DragonFly_Preview
Diff to: previous 1.39: preferred, colored; selected 1.26: preferred, colored
Changes since revision 1.39: +21 -3 lines
In the final code block of in_control_internal, remove ia from the hash table
only if cmd is SIOCDIFADDR.  Add assertions and comment about it.

Revision 1.39: download - view: text, markup, annotated - select for diffs
Mon Jun 9 11:24:24 2008 UTC (6 years, 1 month ago) by sephe
Branches: MAIN
Diff to: previous 1.38: preferred, colored; selected 1.26: preferred, colored
Changes since revision 1.38: +97 -32 lines
Parallelize in_ifaddrhashtbl

Revision 1.38: download - view: text, markup, annotated - select for diffs
Mon Jun 9 04:59:22 2008 UTC (6 years, 1 month ago) by sephe
Branches: MAIN
Diff to: previous 1.37: preferred, colored; selected 1.26: preferred, colored
Changes since revision 1.37: +3 -1 lines
Move stack variable near its usage

Revision 1.37: download - view: text, markup, annotated - select for diffs
Sun Jun 8 08:38:05 2008 UTC (6 years, 1 month ago) by sephe
Branches: MAIN
Diff to: previous 1.36: preferred, colored; selected 1.26: preferred, colored
Changes since revision 1.36: +122 -8 lines
Parallelize in_ifaddrhead operation

Revision 1.36: download - view: text, markup, annotated - select for diffs
Sun Jun 8 03:58:03 2008 UTC (6 years, 1 month ago) by sephe
Branches: MAIN
Diff to: previous 1.35: preferred, colored; selected 1.26: preferred, colored
Changes since revision 1.35: +2 -2 lines
- oia is no longer used
- Tranform for(;;) loop into while() loop

Revision 1.35: download - view: text, markup, annotated - select for diffs
Mon May 26 13:29:33 2008 UTC (6 years, 2 months ago) by sephe
Branches: MAIN
Diff to: previous 1.34: preferred, colored; selected 1.26: preferred, colored
Changes since revision 1.34: +30 -22 lines
Fix following possible bugs for SIOCSIFADDR, if in_ifinit() fails
Conditions:
   o  ifaceX has an AF_INET ia
   o  SIOCSIFADDR is used to change address, and new address' hash value is
      different from ia's
   o  ia is currently in hash bucket B1
   o  ia is removed from B1 and installed into hash table using new address
      hash value, assume its new hash bucket is B2, and B1 != B2
1) Dangling ia reference in inaddr hash table
   o  ifnet.if_ioctl fails
   o  ia is reinstalled into hash bucket B1, but without being first removed
      from hash bucket B2
   Hash bucket B2 will have a dangling reference to ia
2) ia is left in wrong hash bucket
   o  rtinit fails
   o  ia's address is restored to oldaddr
   ia itself is left in hash bucket indexed by new address's hash value


- In in_ifinit(), if it fails, unlink ia from inaddr hash table instead of
  delaying the unlinking to in_control_internal().  If necessary reinstall
  ia into inaddr hash table with original address
- After the above fix, in_control_internal() needs to unlink ia from inaddr
  only if cmd is SIOCDIFADDR and ia resides in inaddr hash table.  Whether
  ia is in inaddr hash table or not, is currently indicated by ia address's
  family; add XXX comment that this assumption is not good
- Constfy 'sin' parameter to in_ifinit()

Reviewed-by: dillon@

Revision 1.34: download - view: text, markup, annotated - select for diffs
Sat May 24 08:04:42 2008 UTC (6 years, 2 months ago) by sephe
Branches: MAIN
Diff to: previous 1.33: preferred, colored; selected 1.26: preferred, colored
Changes since revision 1.33: +7 -2 lines
Avoid possible memory leakage.

Revision 1.33: download - view: text, markup, annotated - select for diffs
Sat May 24 07:41:25 2008 UTC (6 years, 2 months ago) by sephe
Branches: MAIN
Diff to: previous 1.32: preferred, colored; selected 1.26: preferred, colored
Changes since revision 1.32: +17 -11 lines
- Put inaddr hash table alterations in crit section
- Hold ifnet.if_serializer only around ifnet.if_ioctl

Revision 1.32: download - view: text, markup, annotated - select for diffs
Sat May 24 06:54:54 2008 UTC (6 years, 2 months ago) by sephe
Branches: MAIN
Diff to: previous 1.31: preferred, colored; selected 1.26: preferred, colored
Changes since revision 1.31: +15 -2 lines
- Add blank lines between code segments
- Add comment
- Minor style changes

Revision 1.31: download - view: text, markup, annotated - select for diffs
Sat May 24 06:03:23 2008 UTC (6 years, 2 months ago) by sephe
Branches: MAIN
Diff to: previous 1.30: preferred, colored; selected 1.26: preferred, colored
Changes since revision 1.30: +1 -1 lines
No need to cast

Revision 1.30: download - view: text, markup, annotated - select for diffs
Sat May 24 05:22:44 2008 UTC (6 years, 2 months ago) by sephe
Branches: MAIN
Diff to: previous 1.29: preferred, colored; selected 1.26: preferred, colored
Changes since revision 1.29: +8 -7 lines
Hold ifnet.if_serializer around ifnet.if_ioctl; rtinit() does not need
ifnet.if_serializer's protection.

Revision 1.29: download - view: text, markup, annotated - select for diffs
Sat May 24 04:59:14 2008 UTC (6 years, 2 months ago) by sephe
Branches: MAIN
Diff to: previous 1.28: preferred, colored; selected 1.26: preferred, colored
Changes since revision 1.28: +1 -1 lines
Minor style change.  Add blank line between two 'switch' code blocks.

Revision 1.28: download - view: text, markup, annotated - select for diffs
Sat May 24 04:19:31 2008 UTC (6 years, 2 months ago) by sephe
Branches: MAIN
Diff to: previous 1.27: preferred, colored; selected 1.26: preferred, colored
Changes since revision 1.27: +11 -11 lines
Minor white space and style changes

Revision 1.27: download - view: text, markup, annotated - select for diffs
Sat May 24 03:57:26 2008 UTC (6 years, 2 months ago) by sephe
Branches: MAIN
Diff to: previous 1.26: preferred, colored
Changes since revision 1.26: +3 -0 lines
Add comment

Revision 1.26: download - view: text, markup, annotated - [selected for diffs]
Fri Mar 7 11:34:20 2008 UTC (6 years, 4 months ago) by sephe
Branches: MAIN
Diff to: previous 1.25: preferred, colored
Changes since revision 1.25: +104 -27 lines
Parallelize ifnet.if_addrhead accessing by duplicating the list itself
on each CPU, each list element points to ifaddr:
- Add SI_SUB_PRE_DRIVERS before SI_SUB_DRIVERS, so action could be taken
  before drivers' initialization (mainly before NIC driver's if_attach())
- Move netisr_init() to the FIRST of SI_SUB_PRE_DRIVERS, so that
  netmsg_service_port_init() could be called in earlier stage of system
  initialization.
- Create one thread on each CPU to propagate changes to ifnet.if_addrhead.
  Their thread ports are registered with netmsg_service_port_init() for
  port syncing operation.
- Change to ifnet.if_addrhead begins in netisr0, i.e. serial of changes
  to ifnet.if_addrhead are serialized by netisr0
- ifaddr's refcnt is moved to its list elements, i.e. per-CPU refcnt.
  They are initialized to 1 instead of 0.
- A magic field is added to ifaddr list element to make sure that IFAREF
  and IFAFREE are called on valid ifaddr list element.  This field is
  initialized to a magic value and is wiped out once the list element's
  refcnt drops to 0
- To close the gap between testing and freeing, once the ifaddr list
  element's refcnt drops to 0, ifa_portfn(0) (a thread's port on CPU0) is
  poked to check whether ifaddr is referenced on other CPUs, if not, then
  ifaddr is freed on ifa_portfn(0)

Reviewed-by: dillon@ (earlier version)

Revision 1.25: download - view: text, markup, annotated - select for diffs
Thu Jan 3 11:41:05 2008 UTC (6 years, 6 months ago) by sephe
Branches: MAIN
CVS tags: DragonFly_RELEASE_1_12_Slip, DragonFly_RELEASE_1_12
Diff to: previous 1.24: preferred, colored; selected 1.26: preferred, colored
Changes since revision 1.24: +4 -4 lines
Use NULL for pointers

Revision 1.24: download - view: text, markup, annotated - select for diffs
Fri Dec 28 13:16:10 2007 UTC (6 years, 7 months ago) by sephe
Branches: MAIN
Diff to: previous 1.23: preferred, colored; selected 1.26: preferred, colored
Changes since revision 1.23: +1 -2 lines
kmalloc(M_WAITOK) will not return NULL

Revision 1.23: download - view: text, markup, annotated - select for diffs
Fri Dec 28 11:46:38 2007 UTC (6 years, 7 months ago) by sephe
Branches: MAIN
Diff to: previous 1.22: preferred, colored; selected 1.26: preferred, colored
Changes since revision 1.22: +2 -1 lines
- Use NULL
- Shut up gcc4 warning; it seems to be confused by the code path

Revision 1.22: download - view: text, markup, annotated - select for diffs
Fri Dec 28 11:37:08 2007 UTC (6 years, 7 months ago) by sephe
Branches: MAIN
Diff to: previous 1.21: preferred, colored; selected 1.26: preferred, colored
Changes since revision 1.21: +2 -4 lines
- Use M_ZERO
- Minor cleanup

Revision 1.21: download - view: text, markup, annotated - select for diffs
Fri Nov 16 05:07:36 2007 UTC (6 years, 8 months ago) by sephe
Branches: MAIN
Diff to: previous 1.20: preferred, colored; selected 1.26: preferred, colored
Changes since revision 1.20: +2 -2 lines
Nuke net/intrq.[ch] and ipintrq related bits; they were gone almost three
years ago.

Revision 1.20: download - view: text, markup, annotated - select for diffs
Sat Sep 30 22:38:21 2006 UTC (7 years, 9 months ago) by swildner
Branches: MAIN
CVS tags: DragonFly_RELEASE_1_8_Slip, DragonFly_RELEASE_1_8, DragonFly_RELEASE_1_10_Slip, DragonFly_RELEASE_1_10
Diff to: previous 1.19: preferred, colored; selected 1.26: preferred, colored
Changes since revision 1.19: +1 -1 lines
Fix redefinition of M_IPMADDR malloc type.

Revision 1.19: download - view: text, markup, annotated - select for diffs
Tue Sep 5 00:55:48 2006 UTC (7 years, 10 months ago) by dillon
Branches: MAIN
Diff to: previous 1.18: preferred, colored; selected 1.26: preferred, colored
Changes since revision 1.18: +3 -3 lines
Rename malloc->kmalloc, free->kfree, and realloc->krealloc.  Pass 1

Revision 1.18: download - view: text, markup, annotated - select for diffs
Sat Jan 14 11:33:50 2006 UTC (8 years, 6 months ago) by swildner
Branches: MAIN
CVS tags: DragonFly_RELEASE_1_6_Slip, DragonFly_RELEASE_1_6
Diff to: previous 1.17: preferred, colored; selected 1.26: preferred, colored
Changes since revision 1.17: +13 -36 lines
* Remove (void) casts for discarded return values.

* Put function types on separate lines.

* Ansify function definitions.

* Remove __P.

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

Revision 1.17: download - view: text, markup, annotated - select for diffs
Mon Nov 28 17:13:46 2005 UTC (8 years, 8 months ago) by dillon
Branches: MAIN
CVS tags: DragonFly_RELEASE_1_4_Slip, DragonFly_RELEASE_1_4
Diff to: previous 1.16: preferred, colored; selected 1.26: preferred, colored
Changes since revision 1.16: +14 -9 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.16: download - view: text, markup, annotated - select for diffs
Sat Jun 4 14:41:57 2005 UTC (9 years, 1 month ago) by joerg
Branches: MAIN
Diff to: previous 1.15: preferred, colored; selected 1.26: preferred, colored
Changes since revision 1.15: +7 -8 lines
Instead of checking for ifnet_addrs[ifp->index - 1] == NULL to detect
running from if_detach, introduce in_ifdetach and call that after the
address list has been processed. This reduces the differences between
IPv4 and IPv6 stack.

Revision 1.15: download - view: text, markup, annotated - select for diffs
Thu Jun 2 23:52:42 2005 UTC (9 years, 1 month ago) by dillon
Branches: MAIN
Diff to: previous 1.14: preferred, colored; selected 1.26: preferred, colored
Changes since revision 1.14: +19 -15 lines
Remove spl*() calls from netinet, replacing them with critical sections.
A slight rearrangement of COMMON_START() in tcp_usrreq.c was necessary to
ensure that the inp is loaded after  entering the critical section.

Revision 1.14: download - view: text, markup, annotated - select for diffs
Thu Jan 6 09:14:13 2005 UTC (9 years, 6 months ago) by hsu
Branches: MAIN
CVS tags: DragonFly_Stable, DragonFly_RELEASE_1_2_Slip, DragonFly_RELEASE_1_2
Diff to: previous 1.13: preferred, colored; selected 1.26: preferred, colored
Changes since revision 1.13: +12 -13 lines
Cosmetic cleanups.

Revision 1.13: download - view: text, markup, annotated - select for diffs
Tue Dec 21 02:54:15 2004 UTC (9 years, 7 months ago) by hsu
Branches: MAIN
Diff to: previous 1.12: preferred, colored; selected 1.26: preferred, colored
Changes since revision 1.12: +8 -10 lines
Clean up the routing and networking code before I parallelize routing.

Revision 1.12: download - view: text, markup, annotated - select for diffs
Fri Sep 10 14:02:01 2004 UTC (9 years, 10 months ago) by joerg
Branches: MAIN
CVS tags: DragonFly_Snap29Sep2004, DragonFly_Snap13Sep2004
Diff to: previous 1.11: preferred, colored; selected 1.26: preferred, colored
Changes since revision 1.11: +5 -0 lines
From FreeBSD 5:
  Bring eventhandler callbacks for pf.
  This enables pf to track dynamic address changes on interfaces (dailup) with
  the "on (<ifname>)"-syntax. This also brings hooks in anticipation of
  tracking cloned interfaces, which will be in future versions of pf.

The events are called attach and detach instead of arrival / departue.

Revision 1.11: download - view: text, markup, annotated - select for diffs
Mon Jun 7 02:36:22 2004 UTC (10 years, 1 month ago) by dillon
Branches: MAIN
CVS tags: DragonFly_1_0_REL, DragonFly_1_0_RC1, DragonFly_1_0A_REL
Diff to: previous 1.10: preferred, colored; selected 1.26: preferred, colored
Changes since revision 1.10: +2 -2 lines
Add in_pcbinfo_init() to encapsulate basic structural setup (right now just
the LIST_INIT).  Rename inpcbinfo->listhead to inpcbinfo->pcblisthead due
to changes in the API (addition of markers).

Add support for markers in the inpcbinfo->pcblisthead lists of INPCB
structures.  Use markers in sysctl output code to iterate through these lists
without losing its place or having to worry about structures being ripped out
from under it.  Scrap the original two-pass code.

Redo the sysctl INPCB output code for tcp, udp, and other protocols so we
always output the correct number of structures (as specified in xig_count).

Generate output for all cpus (for TCP).  This is accomplished by using
lwkt_setcpu_self() to migrate the kernel thread to each cpu, which allows us
to iterate the list(s) managed by that cpu without having to deal with mutexes
or other forms of locks.  Iterations always wind up on the same cpu they began
on.

Redo netstat to properly iterate across as many cpu chunks as the inpcb
sysctl's return, rather then just the first one.

Work-by: Hiten Pandya and Matthew Dillon

Revision 1.10: download - view: text, markup, annotated - select for diffs
Thu Apr 22 04:35:45 2004 UTC (10 years, 3 months ago) by dillon
Branches: MAIN
Diff to: previous 1.9: preferred, colored; selected 1.26: preferred, colored
Changes since revision 1.9: +1 -7 lines
M_NOWAIT to mostly M_INTWAIT conversions, with a splattering of
M_NULLOK to prevent exhaustion attacks from crashing the system.

Note in patricular that the MALLOC tseg_qent for the tcp reassembly
queue went from M_NOWAIT to M_INTWAIT | M_NULLOK.

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

Revision 1.8: download - view: text, markup, annotated - select for diffs
Sat Mar 6 05:00:41 2004 UTC (10 years, 4 months ago) by hsu
Branches: MAIN
Diff to: previous 1.7: preferred, colored; selected 1.26: preferred, colored
Changes since revision 1.7: +2 -2 lines
Change the "struct inpcbhead *listhead" field in "struct inpcbinfo"
to "struct inpcbhead listhead" so we can have a separate list per
"struct inpcbinfo" when it becomes per-cpu.

Revision 1.7: download - view: text, markup, annotated - select for diffs
Sat Aug 23 11:18:00 2003 UTC (10 years, 11 months ago) by rob
Branches: MAIN
Diff to: previous 1.6: preferred, colored; selected 1.26: preferred, colored
Changes since revision 1.6: +7 -7 lines
if ipv6 doesnt need oldstyle prototypes maybe its time we took them out
of ipv4's code

Revision 1.6: download - view: text, markup, annotated - select for diffs
Sat Jul 26 21:00:04 2003 UTC (11 years ago) by rob
Branches: MAIN
Diff to: previous 1.5: preferred, colored; selected 1.26: preferred, colored
Changes since revision 1.5: +16 -16 lines
Register keyword removal

Approved by: Matt Dillon

Revision 1.5: download - view: text, markup, annotated - select for diffs
Thu Jul 24 20:46:47 2003 UTC (11 years ago) by dillon
Branches: MAIN
Diff to: previous 1.4: preferred, colored; selected 1.26: preferred, colored
Changes since revision 1.4: +10 -5 lines
Fix NULL td crash in net/if.c when detaching a net interface.

Report-by: Joerg Sonnenberger <joerg@britannica.bec.de>

Revision 1.4: download - view: text, markup, annotated - select for diffs
Wed Jun 25 03:56:04 2003 UTC (11 years, 1 month ago) by dillon
Branches: MAIN
CVS tags: PRE_MP
Diff to: previous 1.3: preferred, colored; selected 1.26: preferred, colored
Changes since revision 1.3: +16 -16 lines
proc->thread stage 4: rework the VFS and DEVICE subsystems to take thread
pointers instead of process pointers as arguments, similar to what FreeBSD-5
did.  Note however that ultimately both APIs are going to be message-passing
which means the current thread context will not be useable for creds and
descriptor access.

Revision 1.3: download - view: text, markup, annotated - select for diffs
Mon Jun 23 17:55:46 2003 UTC (11 years, 1 month ago) by dillon
Branches: MAIN
Diff to: previous 1.2: preferred, colored; selected 1.26: preferred, colored
Changes since revision 1.2: +4 -4 lines
proc->thread stage 2: MAJOR revamping of system calls, ucred, jail API,
and some work on the low level device interface (proc arg -> thread arg).
As -current did, I have removed p_cred and incorporated its functions
into p_ucred.  p_prison has also been moved into p_ucred and adjusted
accordingly.  The jail interface tests now uses ucreds rather then processes.

The syscall(p,uap) interface has been changed to just (uap).  This is inclusive
of the emulation code.  It makes little sense to pass a proc pointer around
which confuses the MP readability of the code, because most system call code
will only work with the current process anyway.  Note that eventually
*ALL* syscall emulation code will be moved to a kernel-protected userland
layer because it really makes no sense whatsoever to implement these
emulations in the kernel.

suser() now takes no arguments and only operates with the current process.
The process argument has been removed from suser_xxx() so it now just takes
a ucred and flags.

The sysctl interface was adjusted somewhat.

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

Revision 1.1: download - view: text, markup, annotated - select for diffs
Tue Jun 17 02:55:33 2003 UTC (11 years, 1 month ago) by dillon
Branches: MAIN
CVS tags: FREEBSD_4_FORK
Diff to: selected 1.26: preferred, colored
import from FreeBSD RELENG_4 1.44.2.14

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