ifq/staging: Initial implementation of IFQ packet staging mechanism

The packets enqueued into IFQ are staged to a certain amount before the
ifnet's if_start is called.  In this way, the driver could avoid writing
to hardware registers upon every packet, instead, hardware registers
could be written when certain amount of packets are put onto hardware
TX ring.  The measurement on several modern NICs (emx(4), igb(4), bnx(4),
bge(4), jme(4)) shows that the hardware registers writing aggregation
could save ~20% CPU time when 18bytes UDP datagrams are transmitted at
1.48Mpps.

IFQ packets staging is performed for direct ifnet's if_start calling,
i.e. ifq_try_ifstart()

IFQ packets staging will be stopped upon any of the following conditions:
- If the count of packets enqueued on the current CPU is great than or
  equal to ifq_stage_cntmax.
- If the total length of packets enqueued on the current CPU is great
  than or equal to the hardware's MTU - max_protohdr.  max_protohdr is
  cut from the hardware's MTU mainly bacause a full TCP segment's size
  is usually less than hardware's MTU.
- if_start interlock (if_snd.altq_started) is not released.
- The if_start_rollup(), which is registered as low priority netisr
  rollup function, is called; probably because no more work is pending
  for netisr.

Currently IFQ packet staging is only performed in netisr threads.

Inspired-by: Luigi Rizzo's netmap paper
    (http://info.iet.unipi.it/~luigi/netmap/)
Also-Suggested-by: dillon@
polling: Perform RX polling before TX polling
if_start: Use if_start_schedule in if_start_dispatch

Ease further optimization.
ifq/staging: Perform IFQ packet staging for if_start scheduling

IFQ packets staging is now performed for ifnet's if_start scheduling,
i.e. if_start_schedule(), in addition to direct ifnet's if_start calling.

IFQ packets staging stopping condition
- if_start interlock (if_snd.altq_started) is not released.
is now changed to
- if_start_schedule() is not pending on the current CPU and if_start
  interlock (if_snd.altq_started) is not released.

By setting net.link.stage_cntmax to 8 and hw.igbX.tx_wreg_nsegs to 16,
following performance improvement is gained:
+80Kpps for normal IP forwarding
+30Kpps for fast IP forwarding
ifq/staging: Increase ifq_maxlen a little bit for packets get staged

Increase ifq_maxlen by the amount that IFQ packet staging will take.

There are several places in the tree that if_snd.ifq_maxlen is set
directly instead of using ifq_set_maxlen().  These will be fixed in
some later commits.
ifq/staging: Clean up IFQ packet staging resources

- Make sure pending if_start scheduling IPIs are synchronized
- Make sure IFQ packets are no longer staged on any CPUs
- Free IFQ packet staging bookkeeping memory
ifq/staging: Remove debug code
ifq/staging: Add comment about IFQ packet staging mechanism
ifq: Use ifq_set_maxlen for ifnet.if_snd
sctp: Don't test ifq_len against ifq_maxlen; let IFQ make the decision
ip6: Don't test ifq_len against ifq_maxlen; let IFQ make the decision
ifq: Move ifq_set_maxlen declaration to the declaration code block
Add native dports support

DPorts, the ports building system tailored for Dragonfly,  requires
five bsd.*.mk scripts to be placed at /usr/share/mk in order to work
on DragonFly without any type of bootstrapping.

After installing dports using the /usr/Makefile script, any dport can
be built using the same instructions as FreeBSD (e.g. make install clean)

The resulting packages will be handled by "pkg", which will also be used
in the future for downloading prebuild binaries from an official
repository.
/usr/Makefile: Support dports and add error checking

* Check for git before issuing git command
* Check if directories existing when expected for a target
* Check if directories do not exist when they shouldn't for a target
* Issue error messages when above criteria are not met
* Convert to prinf to make spacing changes easier in future
* Remove options from help screen that are currently invalid
  ("make" by itself now reflects only options that are valid at the time)
* Remove reference to cvs repositories, that's obsolete now
* Add "dports-create" option (full git repository cloned from github)
* Add "dports-create-shallow" option (Depth=1 repository github clone)
* Add "dports-update" option to pull latest from git repository
* Add "dports-download" option (Download tarball from github, extract)
  (Has benefit that dports can be installed without git on system).
* Add "dports-replace" option (When dports was previously installed from
  tarball, use the option to replace it by downloading and extracting
  newer tarball)
* general cleanup
ifq: Add ifq_purge_all(); currently it's same as ifq_purge()

This paves the way for the multiple transmission queues support.

ifq_purge_all() is used when ALTQ packet scheduler is changed,
interface routing is changed and pseudo devices are closed.
atm: Use ifq_dispatch() instead of ifq_handoff()
vlan: Use ifq_dispatch() instead of ifq_handoff()
netgraph7/iface: Use ifq_dispatch() instead of ifq_handoff()
emx: Fix comment
igb: Fix comment