Merge r244633, r250246.

Use unified IP_FW_ARG_TABLEARG() macro for most tablearg checks.
Log real value instead of IP_FW_TABLEARG (65535) in ipfw_log().

Use unified method for accessing / updating cached rule pointers.


git-svn-id: svn://svn.freebsd.org/base/stable/9@250760 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r243711.

Use common macros for working with rule/dynamic counters.
This is done as preparation to introduce per-cpu ipfw counters.


git-svn-id: svn://svn.freebsd.org/base/stable/9@250761 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r248552, r248971

Add ipfw support for setting/matching DiffServ codepoints (DSCP).

Setting DSCP support is done via O_SETDSCP which works for both
IPv4 and IPv6 packets. Fast checksum recalculation (RFC 1624) is done for IPv4.
Dscp can be specified by name (AFXY, CSX, BE, EF), by value
(0..63) or via tablearg.

Matching DSCP is done via another opcode (O_DSCP) which accepts several
classes at once (af11,af22,be). Classes are stored in bitmask (2 u32 words).

Many people made their variants of this patch, the ones I'm aware of are
(in alphabetic order):

Dmitrii Tejblum
Marcelo Araujo
Roman Bogorodskiy (novel)
Sergey Matveichuk (sem)
Sergey Ryabin

PR:		kern/102471, kern/121122

Fix ipfw rule validation partially broken by r248552.


git-svn-id: svn://svn.freebsd.org/base/stable/9@250762 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r249625:
Introduce kern.timecounter.smp_tsc_adjust tunable (disabled by default) and
respective functionality, allowing to synchronize TSC on APs to match BSP's
during boot.  It may be unsafe in general case due to theoretical chance of
later drift if CPUs are using different clock rate or source, but it allows
to use TSC in some cases when difference caused by some initialization bug,
while TSCs are known to increment synchronously.


git-svn-id: svn://svn.freebsd.org/base/stable/9@250772 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r250423:

Retire write-only PCB_GS32BIT pcb flag on amd64.


git-svn-id: svn://svn.freebsd.org/base/stable/9@250785 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Direct commit to update ports INDEX location.

PR:		bin/164561
Approved by:	bapt


git-svn-id: svn://svn.freebsd.org/base/stable/9@250787 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r250290:
Only check fan type once. Not only is continuously rechecking pointless, a
single random failure can reprogram what control mechanism we try to use.


git-svn-id: svn://svn.freebsd.org/base/stable/9@250798 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFH r242738:

  Clarify that the ' flag is an apostrophe.


git-svn-id: svn://svn.freebsd.org/base/stable/9@250799 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Merge remote-tracking branch 'upstream/svn_stable_9' into svn_stable_9