Netdev List
 help / color / mirror / Atom feed
* Re: [PATCHv2 net-next] vxlan: put UDP socket in correct namespace
From: David Miller @ 2012-10-02 18:39 UTC (permalink / raw)
  To: ebiederm; +Cc: shemminger, netdev
In-Reply-To: <87haqc7vii.fsf@xmission.com>

From: ebiederm@xmission.com (Eric W. Biederman)
Date: Tue, 02 Oct 2012 08:18:13 -0700

> Stephen Hemminger <shemminger@vyatta.com> writes:
> 
>> Move vxlan UDP socket to correct network namespace
>>
>> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
> 
> Looks good from here.
> 
> Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>

Applied, thanks.

^ permalink raw reply

* Re: [PATCH net-next,1/6] hyperv: Fix the max_xfer_size in RNDIS initialization
From: David Miller @ 2012-10-02 18:40 UTC (permalink / raw)
  To: haiyangz; +Cc: netdev, kys, olaf, jasowang, linux-kernel, devel
In-Reply-To: <1349191824-14001-1-git-send-email-haiyangz@microsoft.com>

From: Haiyang Zhang <haiyangz@microsoft.com>
Date: Tue,  2 Oct 2012 08:30:19 -0700

> According to RNDIS specs, Windows sets this size to
> 0x4000. I use the same value here.
> 
> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
> Reviewed-by: K. Y. Srinivasan <kys@microsoft.com>

Applied.

^ permalink raw reply

* Re: [PATCH net-next,2/6] hyperv: Fix the missing return value in rndis_filter_set_packet_filter()
From: David Miller @ 2012-10-02 18:42 UTC (permalink / raw)
  To: haiyangz; +Cc: netdev, kys, olaf, jasowang, linux-kernel, devel
In-Reply-To: <1349191824-14001-2-git-send-email-haiyangz@microsoft.com>

From: Haiyang Zhang <haiyangz@microsoft.com>
Date: Tue,  2 Oct 2012 08:30:20 -0700

> Return ETIMEDOUT when the reply message is not received in time.
> 
> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
> Reviewed-by: K. Y. Srinivasan <kys@microsoft.com>

Applied.

^ permalink raw reply

* Re: [PATCH net-next,3/6] hyperv: Fix page buffer handling in rndis_filter_send_request()
From: David Miller @ 2012-10-02 18:42 UTC (permalink / raw)
  To: haiyangz; +Cc: netdev, kys, olaf, jasowang, linux-kernel, devel
In-Reply-To: <1349191824-14001-3-git-send-email-haiyangz@microsoft.com>

From: Haiyang Zhang <haiyangz@microsoft.com>
Date: Tue,  2 Oct 2012 08:30:21 -0700

> To prevent possible data corruption in RNDIS requests, add another
> page buffer if the request message crossed page boundary.
> 
> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
> Reviewed-by: K. Y. Srinivasan <kys@microsoft.com>

Applied.

^ permalink raw reply

* Re: [PATCH net-next,4/6] hyperv: Remove extra allocated space for recv_pkt_list elements
From: David Miller @ 2012-10-02 18:42 UTC (permalink / raw)
  To: haiyangz; +Cc: netdev, kys, olaf, jasowang, linux-kernel, devel
In-Reply-To: <1349191824-14001-4-git-send-email-haiyangz@microsoft.com>

From: Haiyang Zhang <haiyangz@microsoft.com>
Date: Tue,  2 Oct 2012 08:30:22 -0700

> The receive code path doesn't use the page buffer, so remove the
> extra allocated space here.
> 
> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
> Reviewed-by: K. Y. Srinivasan <kys@microsoft.com>

Applied.

^ permalink raw reply

* Re: [PATCH net-next,5/6] hyperv: Report actual status in receive completion packet
From: David Miller @ 2012-10-02 18:42 UTC (permalink / raw)
  To: haiyangz; +Cc: netdev, kys, olaf, jasowang, linux-kernel, devel
In-Reply-To: <1349191824-14001-5-git-send-email-haiyangz@microsoft.com>

From: Haiyang Zhang <haiyangz@microsoft.com>
Date: Tue,  2 Oct 2012 08:30:23 -0700

> The existing code always reports NVSP_STAT_SUCCESS. This patch adds the
> mechanism to report failure when it happens.
> 
> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
> Reviewed-by: K. Y. Srinivasan <kys@microsoft.com>

Applied.

^ permalink raw reply

* Re: [PATCH net-next,6/6] hyperv: Add buffer for extended info after the RNDIS response message.
From: David Miller @ 2012-10-02 18:42 UTC (permalink / raw)
  To: haiyangz; +Cc: netdev, kys, olaf, jasowang, linux-kernel, devel
In-Reply-To: <1349191824-14001-6-git-send-email-haiyangz@microsoft.com>

From: Haiyang Zhang <haiyangz@microsoft.com>
Date: Tue,  2 Oct 2012 08:30:24 -0700

> In some response messages, there may be some extended info after the
> message.
> 
> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
> Reviewed-by: K. Y. Srinivasan <kys@microsoft.com>

Applied.

^ permalink raw reply

* Re: [PATCH net-next v6 1/1] ipv6: add support of equal cost multipath (ECMP)
From: David Miller @ 2012-10-02 18:43 UTC (permalink / raw)
  To: nicolas.dichtel; +Cc: joe, bernat, netdev, yoshfuji
In-Reply-To: <506B1104.7030908@6wind.com>

From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Date: Tue, 02 Oct 2012 18:06:28 +0200

> Le 02/10/2012 18:02, Nicolas Dichtel a écrit :
>> Each nexthop is added like a single route in the routing table. All
>> routes
>> that have the same metric/weight and destination but not the same
>> gateway
>> are considering as ECMP routes. They are linked together, through a
>> list called
>> rt6i_siblings.
>>
>> ECMP routes can be added in one shot, with RTA_MULTIPATH attribute or
>> one after
>> the other (in both case, the flag NLM_F_EXCL should not be set).
>>
>> The patch is based on a previous work from
>> Luc Saillard <luc.saillard@6wind.com>.
>>
>> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
> I forget to run checkpatch.pl, some lines are over 80 columns. I will
> fix it in the v7 with other comments (if any).

No rush as this is too late for this merge window anyways.

^ permalink raw reply

* Re: [PATCH 1/2] net: ethernet: clean out braces / old code (found via checkpatch)
From: David Miller @ 2012-10-02 18:46 UTC (permalink / raw)
  To: matthew; +Cc: linux-kernel, netdev
In-Reply-To: <1349178105-28269-2-git-send-email-matthew@walster.org>

From: matthew@walster.org
Date: Tue,  2 Oct 2012 12:41:44 +0100

> From: Matthew Walster <matthew@walster.org>
> 
> Remove an old commented out piece of code.
> Remove an if(true) statement.
> Remove a set of braces that weren't strictly necessary.
> 
> All found by running checkpatch.pl against the code.
> 
> Signed-off-by: Matthew Walster <matthew@walster.org>

That comment and that unconditional if() are documentation.

Don't be an automaton and blindly make changes based upon
checkpatch.pl output.

^ permalink raw reply

* Re: [PATCH 2/2] net: ethernet: Remove obsolete comment
From: David Miller @ 2012-10-02 18:46 UTC (permalink / raw)
  To: matthew; +Cc: linux-kernel, netdev
In-Reply-To: <1349178105-28269-3-git-send-email-matthew@walster.org>

From: matthew@walster.org
Date: Tue,  2 Oct 2012 12:41:45 +0100

> From: Matthew Walster <matthew@walster.org>
> 
> The deleted comment was related to code I've just removed in the previous patch.

The first change was wrong and therefore this change is also useless.

^ permalink raw reply

* Re: tg3 driver upgrade (Linux 2.6.32 -> 3.2) breaks IBM Bladecenter SoL
From: Ferenc Wagner @ 2012-10-02 18:49 UTC (permalink / raw)
  To: Michael Chan
  Cc: netdev, Matt Carlson, Grant Likely, Rob Herring, linux-kernel,
	wferi
In-Reply-To: <1349197607.5420.25.camel@LTIRV-MCHAN1.corp.ad.broadcom.com>

"Michael Chan" <mchan@broadcom.com> writes:

> On Tue, 2012-10-02 at 18:49 +0200, Ferenc Wagner wrote:
>
>> Going into the opposite direction: I found that Linux 3.6 does not
>> permanently break the SoL console on upping eth0!  I'll try to find
>> the commit which (sort of) fixed it.
>
> These are the likely fixes:
>
> commit cf9ecf4b631f649a964fa611f1a5e8874f2a76db 
> Author: Matt Carlson <mcarlson@broadcom.com>
> Date: Mon Nov 28 09:41:03 2011 +0000
>
> tg3: Fix TSO CAP for 5704 devs w / ASF enabled

You are exactly right: cf9ecf4b fixed the premanent SoL breakage
introduced by dabc5c67.  Looks like ASF utilizes similar technology to
that of the HS20 BMC.  Thanks for the tip, it greatly reduced our CPU
wear. :)  It's a pity ethtool -k did not give a hint.  Do you think it's
possible to work around in 3.2 by eg. fiddling some ethtool setting?
-- 
Thanks,
Feri.

^ permalink raw reply

* Re: tg3 driver upgrade (Linux 2.6.32 -> 3.2) breaks IBM Bladecenter SoL
From: Michael Tokarev @ 2012-10-02 19:06 UTC (permalink / raw)
  To: Ferenc Wagner
  Cc: Michael Chan, netdev, Matt Carlson, Grant Likely, Rob Herring,
	linux-kernel
In-Reply-To: <87626sd80j.fsf@lant.ki.iif.hu>

On 02.10.2012 22:49, Ferenc Wagner wrote:
> "Michael Chan" <mchan@broadcom.com> writes:
>> These are the likely fixes:
>>
>> commit cf9ecf4b631f649a964fa611f1a5e8874f2a76db 
>> Author: Matt Carlson <mcarlson@broadcom.com>
>> Date: Mon Nov 28 09:41:03 2011 +0000
>>
>> tg3: Fix TSO CAP for 5704 devs w / ASF enabled
> 
> You are exactly right: cf9ecf4b fixed the premanent SoL breakage
> introduced by dabc5c67.  Looks like ASF utilizes similar technology to
> that of the HS20 BMC.  Thanks for the tip, it greatly reduced our CPU
> wear. :)  It's a pity ethtool -k did not give a hint.  Do you think it's
> possible to work around in 3.2 by eg. fiddling some ethtool setting?

Maybe it's better to push this commit to -stable instead? (the commit
that broke things is part of 3.0 kernel so all current 3.x -stable
kernels are affected)

(Besides, that commit "This patch fixes the problem by revisiting and
reevaluating the decision after tg3_get_eeprom_hw_cfg() is called." -
merely copies a somewhat "twisted" chunk of code into another place,
which does not look optimal)

Thanks,

/mjt

^ permalink raw reply

* [GIT] Networking
From: David Miller @ 2012-10-02 19:42 UTC (permalink / raw)
  To: torvalds; +Cc: akpm, netdev, linux-kernel


There are a small number of minor conflicts to resolve in this pull:

1) An earlier point of Eric Biederman's userns tree was pulled into
   net-next to decrease the amount of conflict resolution we have
   to do now and it mostly worked out.

   There are some small, minor, merge hassles still to address though.

   For all of them you should basically take the hunk in your tree
   rather than the hunk in net-next.

2) The ath9k driver has a merge conflict with ASPM PCI changes.

   Retain the part from your tree the uses the new pci_*() interface
   instead of poking around directly in PCI space.

   Take the if() conditional from the net-next side, since that
   adds a chipset variant to the test.

3) feature-removal-schedule.txt removed from your tree, edited
   in net-next, retain the removal.

Notable changes this time around:

1) GRE now works over ipv6, from Dmitry Kozlov.

2) Make SCTP more network namespace aware, from Eric Biederman.

3) TEAM driver now works with non-ethernet devices, from Jiri Pirko.

4) Make openvswitch network namespace aware, from Pravin B. Shelar.

5) IPV6 NAT implementation, from Patrick McHardy.

6) Server side support for TCP Fast Open, from Jerry Chu and others.

7) Packet BPF filter supports MOD and XOR, from Eric Dumazet and
   Daniel Borkmann.

8) Increate the loopback default MTU to 64K, from Eric Dumazet.

9) Use a per-task rather than per-socket page fragment allocator
   for outgoing networking traffic.  This benefits processes that
   have very many mostly idle sockets, which is quite common.

   From Eric Dumazet.

10) Use up to 32K for page fragment allocations, with fallbacks
    to smaller sizes when higher order page allocations fail.
    Benefits are a) less segments for driver to process b)
    less calls to page allocator c) less waste of space.

    From Eric Dumazet.

11) Allow GRO to be used on GRE tunnels, from Eric Dumazet.

12) VXLAN device driver, one way to handle VLAN issues such as
    the limitation of 4096 VLAN IDs yet still have some level
    of isolation.  From Stephen Hemminger.

As usual there is a large boatload of driver changes, with the scale
perhaps tilted towards the wireless side this time around.

Please pull, thanks a lot!

The following changes since commit 6672d90fe779dc0dfffe027c3ede12609df091c2:

  Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net (2012-09-28 10:09:33 -0700)

are available in the git repository at:


  git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git master

for you to fetch changes up to a3a6cab5ea10cca64d036851fe0d932448f2fe4f:

  hyperv: Add buffer for extended info after the RNDIS response message. (2012-10-02 14:39:31 -0400)

----------------------------------------------------------------
AceLan Kao (1):
      Revert "rfkill: remove dead code"

Akeem G. Abodunrin (2):
      igb: Supported and Advertised Pause Frame
      igb: Support to enable EEE on all eee_supported devices

Alan Cox (3):
      af_unix: old_cred is surplus
      wireless: remove unreachable code
      tcp: Document use of undefined variable.

Alan Ott (3):
      6lowpan: Make a copy of skb's delivered to 6lowpan
      6lowpan: handle NETDEV_UNREGISTER event
      ieee802154: MRF24J40 driver

Alex Bergmann (1):
      tcp: Increase timeout for SYN segments

Alexander Duyck (24):
      ixgbe: Remove code that was initializing Rx page offset
      ixgbe: combine ixgbe_add_rx_frag and ixgbe_can_reuse_page
      ixgbe: Only use double buffering if page size is less than 8K
      ixgbe: Have the CPU take ownership of the buffers sooner
      ixgbe: Make pull tail function separate from rest of cleanup_headers
      ixgbe: Copybreak sooner to avoid get_page/put_page and offset change overhead
      ixgbe: Make allocating skb and placing data in it a separate function
      ixgbe: Roll RSC code into non-EOP code
      ixgbe: Rewrite code related to configuring IFCS bit in Tx descriptor
      ixgbevf: Add suspend and resume support to the VF
      ixgbevf: Cleanup handling of configuration for jumbo frames
      ipv4: Minor logic clean-up in ipv4_mtu
      ixgbe: Fix ordering of things so that PF correctly configures its VLANs
      ixgbe: Fix VF rate limiting to correctly account for more queues per VF
      igb: Remove artificial restriction on RQDPC stat reading
      ixgbevf: Add support for VF API negotiation
      igb: Remove logic that was doing NUMA pseudo-aware allocations
      igb: Change Tx cleanup loop to do/while instead of for
      igb: Change how we populate the RSS indirection table
      igb: Simplify how we populate the RSS key
      igb: Use dma_unmap_addr and dma_unmap_len defines
      ixgbevf: Fix code for handling timeout
      ixgbevf: Add fix to VF to handle multi-descriptor buffers
      ixgbevf: Return error on failure to enable VLAN

Allan, Bruce W (1):
      mdio: translation of MMD EEE registers to/from ethtool settings

Amerigo Wang (9):
      net: move and rename netif_notify_peers()
      net: remove netdev_bonding_change()
      ipv6: remove some useless RCU read lock
      netpoll: call ->ndo_select_queue() in tx path
      ipv6: add a new namespace for nf_conntrack_reasm
      ipv6: unify conntrack reassembly expire code with standard one
      ipv6: make ip6_frag_nqueues() and ip6_frag_mem() static inline
      ipv6: unify fragment thresh handling code
      l2tp: fix compile error when CONFIG_IPV6=m and CONFIG_L2TP=y

Amit Beka (1):
      iwlwifi: fix FW restart on init FW

Amitkumar Karwar (16):
      mwifiex: do le_to_cpu conversion for Rx packet header elements
      mwifiex: update max_chan_per_scan correctly for SSID scan
      mwifiex: improve scan delay logic during Tx traffic
      mwifiex: notify cfg80211 about MIC failures
      mwifiex: release semaphore acquired for internal scan operation
      mwifiex: don't disable wait_q_enabled flag
      mwifiex: remove get operation code for SUBSCRIBE EVENT command
      mwifiex: remove 11N_CFG command response handler
      mwifiex: remove AMSDU_AGGR_CTRL command response handler
      mwifiex: have same priority for AP and station traffic
      mwifiex: update adapter->bss_prio_tbl[j].bss_prio_cur correctly
      mwifiex: use country ie of requested AP while associating
      mwifiex: support custom world regulatory domain
      mwifiex: fix issue in resumed scan operation
      mwifiex: disconnect the device before entering suspend state
      mwifiex: block scan request during heavy Tx traffic

Andi Kleen (1):
      brcm80211: Remove bogus memcpy in ai_detach

Andre Guedes (17):
      Bluetooth: Remove missing code
      Bluetooth: Use lmp_bredr_capable where applicable
      Bluetooth: Use lmp_le_capable where applicable
      Bluetooth: Use lmp_ssp_capable where applicable
      Bluetooth: Use lmp_esco_capable where applicable
      Bluetooth: Use lmp_rswitch_capable where applicable
      Bluetooth: Use lmp_sniff_capable where applicable
      Bluetooth: Use lmp_sniffsubr_capable where applicable
      Bluetooth: Use lmp_no_flush_capable where applicable
      Bluetooth: Remove locking in hci_user_passkey_request_evt
      Bluetooth: Trivial refactoring
      Bluetooth: Fix hci_le_conn_complete_evt
      Bluetooth: Remove unneeded code
      Bluetooth: Refactor hci_cs_le_create_conn
      Bluetooth: Find hci_conn by BT_CONNECT state
      Bluetooth: Lookup hci_conn in hci_le_conn_complete_evt
      Bluetooth: Refactor in hci_le_conn_complete_evt

Andreas Larsson (1):
      can: sja1000: Add support for listen-only mode and one-shot mode

Andrei Emeltchenko (15):
      Bluetooth: mgmt: Managing only BR/EDR HCI controllers
      Bluetooth: debug: Fix printing A2MP cmd code format
      Bluetooth: debug: Fix printing refcnt for hci_conn
      Bluetooth: trivial: Fix mixing spaces and tabs in smp
      Bluetooth: Define AMP controller statuses
      Bluetooth: Do not shadow hdr variable
      Bluetooth: Fix processing A2MP chan in security_cfm
      Bluetooth: Make connect / disconnect cfm functions return void
      Bluetooth: trivial: Shorten variable scope
      Bluetooth: trivial: Use preferred method for NULL check
      Bluetooth: Remove unneeded zero init
      Bluetooth: trivial: Make hci_chan_del return void
      Bluetooth: trivial: Remove empty line
      Bluetooth: debug: Print refcnt for hci_dev
      Bluetooth: AMP: Add Read Data Block Size to amp_init

Andy Shevchenko (2):
      wireless: at76c50x: eliminate hex2str()
      ipconfig: fix trivial build error

AnilKumar Ch (6):
      can: c_can: Modify c_can device names
      can: c_can: Add device tree support to Bosch C_CAN/D_CAN controller
      can: c_can: Add runtime PM support to Bosch C_CAN/D_CAN controller
      can: c_can: Add d_can suspend resume support
      can: c_can: Adopt pinctrl support
      can: c_can: fix segfault during rmmod

Antonio Quartulli (9):
      mac80211: add supported rates change notification in IBSS
      ath9k_htc: implement sta_rc_update() mac80211 callback
      batman-adv: move function arguments on one line
      batman-adv: add reference counting for type batadv_tt_orig_list_entry
      batman-adv: fix typos in comments
      batman-adv: detect not yet announced clients
      batman-adv: change interface_rx to get orig node
      mac80211: move ieee80211_send_deauth_disassoc outside mlme code
      mac80211: reply to AUTH with DEAUTH if sta allocation fails in IBSS

Arend van Spriel (16):
      wext: include wireless event id when it has a size problem
      brcmfmac: add callback for nl80211 testmode command
      cfg80211: remove obsolete comment for .sched_scan_stop() callback
      brcmfmac: add parameter check in brcmf_c_mkiovar()
      brcmfmac: simplify handling e-scan result firmware event
      brcmfmac: fix sparse warnings in e-scan related code
      brcmfmac: extend brcmf_term_iscan() to abort e-scan
      brcmfmac: introduce scheduled scan support
      brcmfmac: change struct brcmf_cfg80211_priv comments to kernel-doc
      brcmfmac: get rid of void pointer in struct brcmf_cfg80211_priv
      brcmfmac: get rid of extern keyword in wl_cfg80211.h
      brcmfmac: use brcmf_cfg80211_priv to interface with wl_cfg80211 code
      brcmfmac: remove two obsolete structure definitions
      brcmfmac: rename structure brcmf_cfg80211_priv
      brcmfmac: remove brcmf_read_prof() function
      brcmfmac: remove brcmf_update_prof() function

Arik Nemtsov (11):
      wlcore: don't get the hlid from a queued skb
      wlcore: op_tx: pass sta explicitly when inferring frame hlid
      wlcore: AP mode - send non-data packets with basic rates
      wlcore: allow only the lowest OFDM rate for p2p setup frames
      wlcore: make Tx flush timings more verbose
      wlcore: tx_flush - optimize flow and force Tx during the flush
      wlcore/wl18xx/wl12xx: allow up to 3 mac addresses
      wlcore: make debug prints work without dynamic debug
      wlcore: allow up to 3 running STA interfaces in combinations
      wlcore: spi: use private max-buf-size limit
      wl18xx: default to siso40 in 2.4ghz with a single antenna

Avinash Patil (10):
      mwifiex: update 11n status as per start_ap IE
      mwifiex: separate file for handling AP events
      mwifiex: create list for associated stations in AP mode
      mwifiex: improve uAP RX handling
      mwifiex: support RX AMSDU aggregation for uAP
      mwifiex: add 11n Block Ack support for uAP
      mwifiex: cleanup TX/RX BA tables for uAP
      mwifiex: parse rate info for AP
      mwifiex: separate TxPD processing routine for AP
      mwifiex: enhance RX reordering to avoid packet drop during host sleep

Bala Shanmugam (1):
      ath9k: Enable MCI for AR9565

Ben Hutchings (36):
      net: Set device operstate at registration time
      sfc: Refactor struct efx_tx_buffer to use a flags field
      sfc: Stop TX queues before they fill up
      sfc: Simplify TSO header buffer allocation
      sfc: Replace tso_state::full_packet_space with ip_base_len
      sfc: Stash header offsets for TSO in struct tso_state
      sfc: Change state names to be clearer, and comment them
      sfc: Hold the RTNL lock for more of the suspend/resume cycle
      sfc: Keep disabled NICs quiescent during suspend/resume
      sfc: Hold RTNL lock (only) when calling efx_stop_interrupts()
      sfc: Never try to stop and start a NIC that is disabled
      sfc: Improve log messages in case we abort probe due to a pending reset
      sfc: Fix reset vs probe/remove/PM races involving efx_nic::state
      sfc: Remove overly paranoid locking assertions from netdev operations
      sfc: Remove bogus comment about MTU change and RX buffer overrun
      sfc: Assign efx and efx->type as early as possible in efx_pci_probe()
      sfc: Fix the initial device operstate
      pps/ptp: Allow PHC devices to adjust PPS events for known delay
      llc2: Remove pointless indirection through llc_stat_state_trans_end
      llc2: Remove dead code for state machine
      llc2: Collapse the station event receive path
      llc2: Remove the station send queue
      llc2: Remove explicit indexing of state action arrays
      llc2: Collapse remainder of state machine into simple if-else if-statement
      sfc: Fix maximum array sizes for various MCDI commands
      sfc: Convert firmware subtypes to native byte order in efx_mcdi_get_board_cfg()
      sfc: Support variable-length response to MCDI GET_BOARD_CFG
      sfc: Expose FPGA bitfile partition through MTD
      sfc: Bump version to 3.2
      sfc: Avoid generating over-length MC_CMD_FLUSH_RX_QUEUES request
      sfc: Fix null function pointer in efx_sriov_channel_type
      sfc: Add parentheses around use of bitfield macro arguments
      sfc: Fix MCDI structure field lookup
      sfc: Fix loopback self-test with separate_tx_channels=1
      sfc: Remove EFX_FILTER_FLAG_RX_OVERRIDE_IP
      sfc: Fix the reported priorities of different filter types

Bing Zhao (5):
      mwifiex: fix powerpc64-linux- compilation warnings
      mwifiex: fix 'smatch' warning in preparing key_material cmd
      mwifiex: make use of is_zero_ether_addr()
      mwifiex: do not hint regulatory domain with f/w country code
      mwifiex: disable WOW by default

Bjørn Mork (6):
      net: cx82310_eth: use common match macro
      net: sierra_net: make private symbols static
      net: sierra_net: rx_urb_size is constant
      net: qmi_wwan: increase max QMI message size to 4096
      net: qmi_wwan: use a single bind function for all device types
      net: qmi_wwan: adding Huawei E367, ZTE MF683 and Pantech P4200

Bruce Allan (6):
      e1000e: use correct type for read of 32-bit register
      e1000e: cleanup strict checkpatch MEMORY_BARRIER checks
      e1000e: cleanup strict checkpatch check
      e1000e: cleanup - remove inapplicable comment
      e1000e: cleanup - remove unnecessary variable
      e1000e: update driver version number

Bruce W Allan (1):
      e1000e: implement 82577/579 MDI setting support

Carolyn Wyborny (2):
      igb: Add loopback test support for i210
      igb: Fix stats output on i210/i211 parts.

Catherine Sullivan (3):
      ixgbe: add debugfs support
      ixgbe: added netdev_ops file to debugfs
      ixgbe: added reg_ops file to debugfs

Christian Lamparter (6):
      p54: parse output power table
      p54: fix powerpc gcc warnings
      carl9170: report A-MPDU status
      p54: fix off-by-one null pointer bug in p54_tx_80211
      p54: connect to 11w protected networks
      carl9170: connect to 11w protected networks

Christoph Fritz (1):
      ipconfig: add nameserver IPs to kernel-parameter ip=

Christoph Paasch (2):
      ipv4: Don't add TCP-code in inet_sock_destruct
      tcp: Remove unused parameter from tcp_v4_save_options

Chun-Yeow Yeoh (3):
      mac80211: don't re-init rate control when receiving mesh beacon
      mac80211: allow re-open the blocked peer link in mesh
      ath5k: disable HW crypto in management frame

Claudiu Ghioc (1):
      ipvs: fixed sparse warning

Claudiu Manoil (1):
      gianfar: Change default HW Tx queue scheduling mode

Cong Wang (3):
      sctp: fix a compile error in sctp.h
      netfilter: remove xt_NOTRACK
      NFC: Remove the pn544 raw driver

Dan Carpenter (7):
      mwifiex: use GFP_ATOMIC under spin lock
      sctp: fix bogus if statement in sctp_auth_recv_cid()
      ipv6: move dereference after check in fl_free()
      gre: information leak in ip6_tnl_ioctl()
      mwifiex: potential corruption in mwifiex_update_uap_custom_ie()
      brcmfmac: use kcalloc() to prevent integer overflow
      net/key/af_key.c: add range checks on ->sadb_x_policy_len

Daniel Borkmann (3):
      filter: add XOR instruction for use with X/K
      x86: bpf_jit_comp: add XOR instruction for BPF JIT
      sparc: bpf_jit_comp: add XOR instruction for BPF JIT JIT

Daniel Drake (1):
      libertas: set mac control synchronously during init

Daniel Golle (1):
      rt2x00: add MediaTek/RaLink Rt3352 WiSoC

Daniel Mack (2):
      net: ti cpsw ethernet: set IFCTL_A bit in MACCONTROL
      net: ti cpsw ethernet: allow reading phy interface mode from DT

David S. Miller (38):
      Merge branch 'master' of git://kernel.ubuntu.com/rtg/net-next
      Merge branch 'for-davem' of git://git.kernel.org/.../linville/wireless-next
      Merge branch 'master' of git://git.kernel.org/.../ppwaskie/net-next
      Merge git://git.kernel.org/.../davem/net
      Merge branch 'master' of git://git.kernel.org/.../jkirsher/net-next
      Merge git://1984.lsi.us.es/nf-next
      Merge tag 'batman-adv-for-davem' of git://git.open-mesh.org/linux-merge
      Merge branch 'for-davem' of git://git.kernel.org/.../linville/wireless-next
      Merge branch 'for-davem' of git://git.kernel.org/.../bwh/sfc-next
      Merge branch 'for-next' of git://git.kernel.org/.../ebiederm/user-namespace
      Merge git://git.kernel.org/.../davem/net
      Merge branch 'master' of git://git.kernel.org/.../jkirsher/net-next
      Merge branch 'tcp_fastopen_server'
      Merge branch 'master' of git://1984.lsi.us.es/nf-next
      net: Add INET dependency on aes crypto for the sake of TCP fastopen.
      Merge branch 'master' of git://git.kernel.org/.../jesse/openvswitch
      Merge branch 'master' of git://1984.lsi.us.es/nf-next
      Merge git://git.kernel.org/.../davem/net
      Merge branch 'master' of git://git.kernel.org/.../jkirsher/net-next
      Merge branch 'for-davem' of git://git.kernel.org/.../linville/wireless-next
      llc: Remove stray reference to sysctl_llc_station_ack_timeout.
      Merge branch 'for-davem' of git://git.kernel.org/.../bwh/sfc-next
      Merge branch 'master' of git://git.kernel.org/.../jkirsher/net-next
      sunbmac: Remove unused local variable.
      Merge branch 'master' of git://git.kernel.org/.../jkirsher/net-next
      net: Make ZNET driver config depend on X86.
      netlink: Rearrange netlink_kernel_cfg to save space on 64-bit.
      Merge branch 'master' of git://1984.lsi.us.es/nf-next
      net: Remove unnecessary NULL check in scm_destroy().
      bna: Fix warning false positive.
      pkt_sched: Fix warning false positives.
      Revert "be2net: fix vfs enumeration"
      Merge git://git.kernel.org/.../davem/net
      Merge branch 'for-davem' of git://gitorious.org/linux-can/linux-can-next
      Merge branch 'for-davem' of git://git.kernel.org/.../linville/wireless-next
      Revert "net: ti cpsw ethernet: allow reading phy interface mode from DT"
      Merge branch 'for-davem' of git://git.kernel.org/.../bwh/sfc-next
      vxlan: Depend on CONFIG_INET

David Spinadel (3):
      iwlwifi: remove radio_config from eeprom_data
      iwlwifi: don't reset interupts after disabling
      iwlwifi: stop interrupts before stopping device

Devendra Naga (1):
      wl18xx: use module_platform_driver

Duan Jiong (1):
      etherdevice: introduce help function eth_zero_addr()

Eliad Peller (12):
      mac80211: add PS flag to bss_conf
      mac80211: use synchronize_net() on key destroying
      mac80211: use call_rcu() on sta deletion
      wlcore: consider single fw case
      wlcore: cancel recovery_work on stop() instead of remove_interface()
      wlcore: resume() only if sta is associated
      wlcore: always use wlvif->role_id for scans
      wlcore: lazy-enable device roles
      wlcore: invalidate keep-alive template on disconnection
      wlcore: use dynamic keep-alive template ids
      wlcore: decrease elp timeout
      wlcore: protect wlcore_op_set_key with mutex

Eliezer Tamir (1):
      ixgbe: remove old init remnant

Emil Tantilov (1):
      ixgbe: fix reporting of spoofed packets

Emmanuel Grumbach (6):
      iwlwifi: s/iwl_ucode_callback/iwl_req_fw_callback
      iwlwifi: get the correct HCMD in the response handler
      mac80211: don't call mgd_prepare_tx when associated
      iwlwifi: fix the preparation of the card
      iwlwifi: some clean up in transport layer
      iwlwifi: don't access the HW when it is not available

Eric Dumazet (37):
      net: skb_share_check() should use consume_skb()
      ipv4: change inet_addr_hash()
      ipv4: Introduce IN_DEV_NET_ROUTE_LOCALNET
      net: avoid reloads in SNMP_UPD_PO_STATS
      net: reorganize IP MIB values
      net: tcp: GRO should be ECN friendly
      tcp: ecn: dont delay ACKS after CE
      net: output path optimizations
      fib: use __fls() on non null argument
      time: jiffies_delta_to_clock_t() helper to the rescue
      net: remove delay at device dismantle
      xfrm: fix RCU bugs
      ipv6: gre: fix ip6gre_err()
      net: reinstate rtnl in call_netdevice_notifiers()
      netpoll: provide an IP ident in UDP frames
      igb: reduce Rx header size
      net: qdisc busylock needs lockdep annotations
      tcp: fix TFO regression
      igmp: avoid drop_monitor false positives
      net: rt_cache_flush() cleanup
      filter: add MOD operation
      x86 bpf_jit: support MOD operation
      ipv6: route templates can be const
      net: more accurate network taps in transmit path
      net: provide a default dev->ethtool_ops
      gre: add GSO support
      net: loopback: set default mtu to 64K
      net: use a per task frag allocator
      net: raw: revert unrelated change
      net: remove sk_init() helper
      ipv6: gre: remove ip6gre_header_parse()
      net: use bigger pages in __netdev_alloc_frag
      net: struct napi_struct fields reordering
      tcp: gro: add checksuming helpers
      net: add gro_cells infrastructure
      ipv4: gre: add GRO capability
      mlx4: dont orphan skbs in mlx4_en_xmit()

Eric Lapuyade (9):
      NFC: Changed the HCI cmd execution callback prototype
      NFC: Add a public nfc_hci_send_cmd_async method
      NFC: Modified hci_transceive to become an asynchronous operation
      NFC: Add an LLC Core layer to HCI
      NFC: Add a nop (passthrough) llc module to llc core
      NFC: Add an shdlc llc module to llc core
      NFC: Changed HCI and PN544 HCI driver to use the new HCI LLC Core
      NFC: Fix LLC registration definitions for ANSI compliance
      NFC: Add HCI module description

Eric W. Biederman (43):
      userns: Allow the usernamespace support to build after the removal of usbfs
      userns:  Fix link restrictions to use uid_eq
      userns: Convert net/core/scm.c to use kuids and kgids
      userns: Convert __dev_set_promiscuity to use kuids in audit logs
      userns: Convert sock_i_uid to return a kuid_t
      userns: Allow USER_NS and NET simultaneously in Kconfig
      userns: Make seq_file's user namespace accessible
      userns: Print out socket uids in a user namespace aware fashion.
      userns: Use kgids for sysctl_ping_group_range
      net ip6 flowlabel: Make owner a union of struct pid * and kuid_t
      pidns: Export free_pid_ns
      userns: Convert net/ax25 to use kuid_t where appropriate
      netlink: Make the sending netlink socket availabe in NETLINK_CB
      userns: Implement sk_user_ns
      userns: Teach inet_diag to work with user namespaces
      userns: nfnetlink_log: Report socket uids in the log sockets user namespace
      net sched: Pass the skb into change so it can access NETLINK_CB
      userns: Convert cls_flow to work with user namespaces enabled
      userns: Convert xt_LOG to print socket kuids and kgids as uids and gids
      userns xt_recent: Specify the owner/group of ip_list_perms in the initial user namespace
      userns: xt_owner: Add basic user namespace support.
      userns: Make the airo wireless driver use kuids for proc uids and gids
      userns: Convert tun/tap to use kuid and kgid where appropriate
      sctp: Make the port hash table use struct net in it's key.
      sctp: Make the endpoint hashtable handle multiple network namespaces
      sctp: Make the association hashtable handle multiple network namespaces
      sctp: Make the address lists per network namespace
      sctp: Make the ctl_sock per network namespace
      sctp: Move the percpu sockets counter out of sctp_proc_init
      sctp: Make the proc files per network namespace.
      sctp: Enable sctp in all network namespaces
      sctp: Make the mib per network namespace
      sctp: Add infrastructure for per net sysctls
      sctp: Push struct net down to sctp_chunk_event_lookup
      sctp: Push struct net down into sctp_transport_init
      sctp: Push struct net down into sctp_in_scope
      sctp: Push struct net down into all of the state machine functions
      sctp: Push struct net down into sctp_verify_ext_param
      sctp: Make sysctl tunables per net
      scm: Don't use struct ucred in NETLINK_CB and struct scm_cookie.
      netlink: Rename pid to portid to avoid confusion
      xfrm: Report user triggered expirations against the users socket
      scsi_netlink: Remove dead and buggy code

Eyal Shapira (2):
      mac80211: avoid using synchronize_rcu in ieee80211_set_probe_resp
      wlcore: configure wowlan regardless of wakeup conditions

Fan Du (2):
      xfrm: remove redundant parameter "int dir" in struct xfrm_mgr.acquire
      xfrm: Use rcu_dereference_bh to deference pointer protected by rcu_read_lock_bh

Felix Fietkau (1):
      mac80211: validate skb->dev in the tx status path

Fengguang Wu (1):
      mwifiex: fix code mis-alignment after the if statement

Florian Westphal (2):
      netfilter: nf_nat: fix out-of-bounds access in address selection
      netfilter: xt_time: add support to ignore day transition

Francois Romieu (1):
      r8169: add D-Link DGE-560T identifiers.

Franky Lin (9):
      brcmfmac: add BCM43241 sdio interface driver support
      brcmfmac: absorb brcmf_sendpkt into brcmf_netdev_start_xmit
      brcmfmac: remove obsolete sdio bus sleep mechanism
      brcmfmac: use atomic variable for interrupt pending flag
      brcmfmac: convert SDIO dpc implementation to workqueue
      brcmfmac: streamline SDIO dpc
      brcmfmac: raise SDIO host lock to higher level
      brcmfmac: clear status for in-band interrupt in brcmf_sdbrcm_isr
      brcmfmac: streamline SDIO read frame routine

Gabor Juhos (2):
      ath9k: optimize power level initialization for CTL_[25]GHT20
      ath9k: fix indentation in ar9003_hw_set_power_per_rate_table

Gao feng (2):
      net: dev: fix the incorrect hold of net namespace's lo device
      net: dev: fix incorrect getting net device's name

Gertjan van Wingerde (10):
      rt2x00: Align GPIO register definitions with the datasheets.
      rt2x00: Unify GPIO register field namings
      rt2x00: rt2800 - Make probe_hw function common between PCI and USB.
      rt2x00: Code clean up in rt2800lib.
      rt2x00: rt2800 - Fix default vgc values for RT3572
      rt2x00: rt2800lib - code cleanup.
      rt2x00: Code style cleanup in rt2800lib.c
      rt2x00: Clean up RFCSR1 programming in rt2800_config_channel_rf3xxx.
      rt2x00: Deprecate max_sta_intf field of struct rt2x00_ops.
      rt2x00: Replace open coded interface checking with interface combinations.

Greg Kroah-Hartman (1):
      USB: remove dbg() usage in USB networking drivers

Greg Rose (2):
      ixgbe: Do not read the spoofed packets counter when not in IOV mode
      ixgbevf: Fix AIM (Adaptive Interrupt Moderation)

Gustavo Padovan (1):
      Bluetooth: Add USB_VENDOR_AND_INTERFACE_INFO() for Broadcom/Foxconn

Haiyang Zhang (7):
      hyperv: Add comments for the extended buffer after RNDIS message
      hyperv: Fix the max_xfer_size in RNDIS initialization
      hyperv: Fix the missing return value in rndis_filter_set_packet_filter()
      hyperv: Fix page buffer handling in rndis_filter_send_request()
      hyperv: Remove extra allocated space for recv_pkt_list elements
      hyperv: Report actual status in receive completion packet
      hyperv: Add buffer for extended info after the RNDIS response message.

Hante Meuleman (22):
      brcmfmac: prevent possible race condition on usb rx control.
      brcmfmac: Add 43242 USB support.
      brcmfmac: Add 43143 USB support.
      brcmfmac: Stop all net if queues on tx flow halt.
      brcmfmac: Add extra data support to firmware event queueing.
      brcmfmac: Add tx flow control on net if queue for USB.
      brcmfmac: Clean up scan related code.
      brcmfmac: refill buffers on rx protocol error.
      brcmfmac: avoid using local usb data.
      brcmfmac: add e-scan support.
      brcmfmac: fix bug causing errorneous free on exception.
      brcmfmac: fix debug printout of event data.
      brcmfmac: store usb fw images in local linked list.
      brcmfmac: remove unused function.
      brcmfmac: fix bug in determining phy bands.
      brcmfmac: remove unused usb bmac model code.
      brcmfmac: clear control lock on usb error.
      brcmfmac: use wait_event_timeout for fw control packets over usb.
      brcmfmac: use different fw api for encryption,auth. config
      brcmfmac: use define instead of hardcoded values.
      brcmfmac: notify common driver about usb tx completion.
      brcmfmac: add hostap supoort.

Hauke Mehrtens (1):
      bcma: make some functions static

Hila Gonen (1):
      cfg80211: fix indentation

Ido Reis (2):
      wl18xx: update default phy configuration for pg2
      wl18xx: increase rx_ba_win_size to 32

Ido Yariv (6):
      wlcore: Prevent interaction with HW after recovery is queued
      wlcore: Don't recover during boot
      wlcore: Fix unbalanced interrupts enablement
      wlcore: Allow memory access when the FW crashes
      wlcore: Refactor probe
      wlcore: Load the NVS file asynchronously

Igal Chernobelsky (2):
      wl18xx/wl12xx: defines for Tx/Rx descriptors num
      wlcore/wl18xx/wl12xx: aggregation buffer size set

Igor Maravic (1):
      net: ipv4: fib_trie: Don't unnecessarily search for already found fib leaf

Ilan Elias (3):
      NFC: Set local general bytes in nci_start_poll
      NFC: Parse NCI NFC-DEP activation params
      NFC: Implement NCI dep_link_up and dep_link_down

Ilan Peer (1):
      mac80211: Do not check for valid hw_queues for P2P_DEVICE

Ivan Vecera (2):
      be2net: fix vfs enumeration
      be2net: fix vfs enumeration

Jaganath Kanakkassery (2):
      Bluetooth: Move l2cap_chan_hold/put to l2cap_core.c
      Bluetooth: Free the l2cap channel list only when refcount is zero

Jan Beulich (1):
      netfilter: properly annotate ipv4_netfilter_{init,fini}()

Jan Engelhardt (2):
      netfilter: combine ipt_NETMAP and ip6t_NETMAP
      netfilter: combine ipt_REDIRECT and ip6t_REDIRECT

Jaroslav Resler (1):
      Bluetooth: Add support for BCM20702A0 [04ca, 2003]

Javier Lopez (1):
      carl9170: Add support for NL80211_IFTYPE_MESH_POINT interfaces

Jean Sacren (1):
      netfilter: remove unnecessary goto statement for error recovery

Jeff Disher (1):
      mwifiex: store mwifiex_ds_misc_subsc_evt in mwifiex_private

Jeff Mahoney (1):
      brcmsmac: document firmware dependencies

Jerry Chu (3):
      tcp: TCP Fast Open Server - header & support functions
      tcp: TCP Fast Open Server - support TFO listeners
      tcp: TCP Fast Open Server - main code path

Jesper Dangaard Brouer (1):
      ipvs: IPv6 MTU checking cleanup and bugfix

Jesse Brandeburg (5):
      ethtool.h: MDI setting support
      igb: implement 580 MDI setting support
      e1000: configure and read MDI settings
      e1000e: implement MDI/MDI-X control
      igb: update to allow reading/setting MDI state

Jiri Bohac (1):
      bonding: add some slack to arp monitoring time limits

Jiri Pirko (9):
      netlink: add signed types
      team: add signed 32-bit team option type
      team: add per port priority option
      team: add support for queue override by setting queue_id for port
      team: add support for non-ethernet devices
      team: don't print warn message on -ESRCH during event send
      vlan: add helper which can be called to see if device is used by vlan
      team: do not allow to add VLAN challenged port when vlan is used
      team: send port changed when added

Joe Perches (1):
      net1080: Neaten netdev_dbg use

Johan Hedberg (2):
      Bluetooth: mgmt: Implement support for passkey notification
      Bluetooth: Update management interface revision

Johannes Berg (67):
      iwlwifi: fix aggregation check indentation
      iwlwifi: reduce max remain-on-channel duration
      mac80211: don't react to beacon loss if HW monitoring
      mac80211: supress HT/VHT disable if not supported
      mac80211: rename sta to new_sta
      mac80211: set channel only once during auth/assoc
      mac80211: use oper_channel in mesh
      mac80211: use oper_channel in ibss
      mac80211: use oper_channel in managed mlme
      mac80211: use oper_channel in utils and config
      mac80211: fix current vs. operating channel in preq/beacon
      mac80211: use correct channel in TX
      mac80211: manage carrier state in mesh
      mac80211: enable WDS carrier only after adding station
      mac80211: use eth_broadcast_addr
      mac80211: reset station MLME flags upon new association
      brcmsmac: use ieee80211_channel_to_frequency
      iwlegacy: clean up suspend/resume
      wireless: add radiotap A-MPDU status field
      mac80211: support A-MPDU status reporting
      mac80211: remove unneeded 'bssid' variable
      mac80211: clean up CSA handling code
      mac80211: fix CSA handling timer
      mac80211: check size of channel switch IE when parsing
      mac80211: make ieee80211_beacon_connection_loss_work static
      cfg80211: add P2P Device abstraction
      mac80211: support P2P Device abstraction
      mac80211: add IEEE80211_HW_P2P_DEV_ADDR_FOR_INTF
      mac80211_hwsim: add support for P2P Device
      mac80211: simplify buffers in aes_128_cmac_vector
      mac80211: mesh: don't use global channel type
      mac80211: remove almost unused local variable
      mac80211: remove freq/chantype from debugfs
      mac80211: use oper_channel in rate init
      mac80211: don't assume channel is set in tracing
      mac80211: use RX status band instead of current band
      mac80211: check operating channel in scan
      mac80211: convert ops checks to WARN_ON
      mac80211: pass channel to ieee80211_send_probe_req
      mac80211: clean up ieee80211_subif_start_xmit
      iwlwifi: fix antenna bitmask
      mac80211: don't use kerneldoc for ieee80211_add_rx_radiotap_header
      Merge remote-tracking branch 'wireless-next/master' into iwlwifi-next
      iwlwifi: report A-MPDU status
      iwlwifi: reduce overhead if tracing disabled
      iwlwifi: remove unused IDI code stubs
      Merge remote-tracking branch 'mac80211/master' into mac80211-next
      mac80211: don't hang on to sched_scan_ies
      mac80211: disconnect if channel switch fails
      Merge remote-tracking branch 'wireless-next/master' into mac80211-next
      wireless: remove obsolete chan no/center freq conversion functions
      mac80211_hwsim: move module_init/exit
      mac80211: check power constraint IE size when parsing
      mac80211: add key flag for management keys
      iwlwifi: fix indentation in iwl_load_given_ucode
      iwlwifi: load firmware in chunks
      mac80211: remove unneeded CONFIG_PM ifdef
      mac80211: handle power constraint/country IE better
      mac80211: change locking around ieee80211_recalc_smps
      mac80211: make reset debugfs depend on CONFIG_PM
      cfg80211: constify name parameter to add_virtual_intf
      iwlwifi: use eth_broadcast_addr
      iwlwifi: fix async station command crash
      mac80211: don't send delBA before disassoc
      mac80211: don't send delBA when removing stations
      mac80211: don't send delBA on addBA failure
      iwlegacy: use eth_broadcast_addr

John Eaglesham (1):
      bonding: support for IPv6 transmit hashing

John Fastabend (1):
      ixgbevf: scheduling while atomic in reset hw path

John W. Linville (23):
      Merge branch 'master' of git://git.kernel.org/.../bluetooth/bluetooth-next
      Merge branch 'master' of git://git.kernel.org/.../linville/wireless-next into for-davem
      Merge branch 'for-john' of git://git.kernel.org/.../jberg/mac80211-next
      Merge branch 'for-john' of git://git.kernel.org/.../iwlwifi/iwlwifi-next
      Merge branch 'for-john' of git://git.kernel.org/.../jberg/mac80211-next
      Merge branch 'master' of git://git.kernel.org/.../linville/wireless-next into for-davem
      Merge branch 'for-john' of git://git.kernel.org/.../jberg/mac80211-next
      Merge branch 'for-john' of git://git.kernel.org/.../iwlwifi/iwlwifi-next
      Merge branch 'master' of git://git.kernel.org/.../linville/wireless
      Merge branch 'master' of git://git.kernel.org/.../linville/wireless-next into for-davem
      Merge branch 'for-john' of git://git.kernel.org/.../jberg/mac80211-next
      Merge branch 'for-john' of git://git.kernel.org/.../iwlwifi/iwlwifi-next
      Merge branch 'master' of git://git.kernel.org/.../bluetooth/bluetooth-next
      Merge tag 'nfc-next-3.7-1' of git://git.kernel.org/.../sameo/nfc-3.0
      Merge branch 'for-john' of git://git.kernel.org/.../jberg/mac80211-next
      Merge branch 'for-john' of git://git.kernel.org/.../iwlwifi/iwlwifi-next
      ath5k: add missing breaks in ath5k_hw_set_spur_mitigation_filter
      nfc: add dummy nfc_llc_shdlc_register definition
      NFC: Add dummy nfc_llc_shdlc_register definition
      Merge tag 'nfc-next-3.7-2' of git://git.kernel.org/.../sameo/nfc-3.0
      Merge branch 'master' of git://git.kernel.org/.../linville/wireless-next into for-davem
      Merge branch 'for-linville' of git://git.kernel.org/.../luca/wl12xx
      Merge branch 'master' of git://git.kernel.org/.../linville/wireless-next into for-davem

Jonathan Corbet (1):
      batman-adv: remove a misleading comment

Jozsef Kadlecsik (7):
      netfilter: ipset: Fix sparse warnings "incorrect type in assignment"
      netfilter: ipset: Check and reject crazy /0 input parameters
      netfilter: ipset: Rewrite cidr book keeping to handle /0
      netfilter: ipset: Add /0 network support to hash:net,iface type
      netfilter: ipset: Include supported revisions in module description
      netfilter: ipset: Coding style fixes
      netfilter: ipset: Support to match elements marked with "nomatch"

Julia Lawall (1):
      drivers/net/ethernet/tundra/tsi108_eth.c: delete double assignment

Julian Anastasov (6):
      ipvs: ip_vs_ftp depends on nf_conntrack_ftp helper
      ipvs: generalize app registration in netns
      ipvs: implement passive PMTUD for IPIP packets
      ipvs: add pmtu_disc option to disable IP DF for TUN packets
      netlink: add minlen validation for the new signed types
      tcp: add generic netlink support for tcp_metrics

Jussi Kivilinna (1):
      zd1211rw: enable support for MFP

Kevin Gan (1):
      mwifiex: add inactivity deauth support for ap

Kevin Groeneveld (1):
      ppp: add 64 bit stats

Konstantin Khlebnikov (1):
      nf_defrag_ipv6: fix oops on module unloading

LEROY Christophe (1):
      lxt PHY: Support for the buggy LXT973 rev A2

Larry Finger (6):
      p54pci: convert driver to use asynchronous firmware loading
      rtlwifi: rtl8192c: rtl8192de: Fix typo in cursta_connectctate
      rtlwifi: rtl8192c: rtl8192ce: rtl8192cu: rtl8192se: Remove sparse warnings
      rtlwifi: Update header file
      rtlwifi: Remove EXPERIMENTAL as pre-requisite for the drivers
      b43legacy: Fix crash on unload when firmware not available

Li RongQing (2):
      ipv6: replace write lock with read lock when get route info
      ipv6: recursive check rt->dst.from when call rt6_check_expired

Lin Ming (1):
      ipv6: return errno pointers consistently for fib6_add_1()

Luciano Coelho (1):
      wl12xx: use module_platform_driver

Mahesh Palivela (1):
      mac80211: VHT (11ac) association

Marco Porsch (1):
      mac80211: fix unnecessary beacon update after peering status change

Marek Lindner (1):
      batman-adv: convert remaining packet counters to per_cpu_ptr() infrastructure

Mark Rustad (1):
      ixgbe: Improve statistics accuracy for DDP traffic

Martin Hundebøll (2):
      batman-adv: Move batadv_check_unicast_packet()
      batman-adv: Drop tt queries with foreign dest

Masatake YAMATO (9):
      Bluetooth: /proc/net/ entries for bluetooth protocols
      Bluetooth: Added /proc/net/bnep via bt_procfs_init()
      Bluetooth: Added /proc/net/cmtp via bt_procfs_init()
      Bluetooth: Added /proc/net/hci via bt_procfs_init()
      Bluetooth: Added /proc/net/hidp via bt_procfs_init()
      Bluetooth: Added /proc/net/l2cap via bt_procfs_init()
      Bluetooth: Added /proc/net/rfcomm via bt_procfs_init()
      Bluetooth: Added /proc/net/sco via bt_procfs_init()
      net: Providing protocol type via system.sockprotoname xattr of /proc/PID/fd entries

Matthew Vick (6):
      igb: Tidy up wrapping for CONFIG_IGB_PTP.
      igb: Update PTP function names/variables and locations.
      igb: Correct PTP support query from ethtool.
      igb: Store the MAC address in the name in the PTP struct.
      igb: Prevent dropped Tx timestamps via work items and interrupts.
      igb: Add 1588 support to I210/I211.

Meenakshi Venkataraman (2):
      iwlwifi: clean up properly when registration with mac80211 fails
      iwlwifi: rework the iwlwifi debugfs structure

Merav Sicron (1):
      bnx2x: Improve code around bnx2x_tests_str_arr

Michael Chan (12):
      cnic: Add functions to allocate and free UIO rings
      cnic: Free UIO rings when the device is closed.
      cnic: Add function pointers to arm IRQ for different devices.
      cnic: Allocate kcq resource only on devices that support FCoE.
      cnic: Allocate UIO resources only on devices that support iSCSI.
      tg3: Introduce separate functions to allocate/free RX/TX rings.
      tg3: Allow number of rx and tx rings to be set independently.
      tg3: Separate coalescing setup for rx and tx
      tg3: Refactor tg3_open()
      tg3: Refactor tg3_close()
      tg3: Add support for ethtool -L|-l to get/set the number of rings.
      tg3: Disable multiple TX rings by default due to hardware flaw

Michael Wang (3):
      netfilter: replace list_for_each_continue_rcu with new interface
      netfilter: pass 'nf_hook_ops' instead of 'list_head' to nf_iterate()
      netfilter: pass 'nf_hook_ops' instead of 'list_head' to nf_queue()

Michal Kazior (1):
      mac80211: refactor set_channel_type

Michal Schmidt (1):
      r8169: use unlimited DMA burst for TX

Mika Westerberg (1):
      i825xx: znet: fix compiler warnings when building a 64-bit kernel

Mikel Astiz (3):
      Bluetooth: Add more HCI error codes
      Bluetooth: Fix minor coding style in hci_event.c
      Bluetooth: mgmt: Add device disconnect reason

Ming Lei (2):
      wireless: ath9k-htc: only load firmware in need
      wireless: ath9k-htc: fix possible use after free

Mohammed Shafi Shajakhan (11):
      ath9k_hw: small optimization
      ath9k_hw: Fix invalid MCI GPM index access/caching
      ath9k: Fix BTCOEX timer triggering comparision
      ath9k: Make use of ath_stop_ani wrapper
      ath9k: Remove an obselete function declaration
      ath9k: Cleanup add/change_interface callbacks
      ath9k_htc: minor cleanup in ath9k_htc_add_station
      ath9k_htc: Add a modparam to enable BTCOEX rather than default
      ath9k_htc: Cancel BTCOEX related work before disabling BTCOEX
      ath9k: Add Generic hardware timer interrupt in debugfs
      ath9k: update hw_timer_enabled to false when we stop generic timers

Mugunthan V N (4):
      drivers: net: ethernet: cpsw: Add SOC dependency support for cpsw dependent modules
      drivers: net: ethernet: cpsw: Add device tree support to CPSW
      drivers: net: ethernet: davince_mdio: device tree implementation
      documentation: dt: bindings: cpsw: fixing the examples for directly using it in dts file

Narendra K (1):
      ixgbevf - Remove unused parameter in ixgbevf_receive_skb

Neal Cardwell (5):
      tcp: extract code to compute SYNACK RTT
      tcp: TCP Fast Open Server - take SYNACK RTT after completing 3WHS
      tcp: TCP Fast Open Server - note timestamps and retransmits for SYNACK RTT
      tcp: TCP Fast Open Server - call tcp_validate_incoming() for all packets
      tcp: TCP Fast Open Server - record retransmits after 3WHS

Neil Horman (1):
      cls_cgroup: Allow classifier cgroups to have their classid reset to 0

Nick Kossifidis (4):
      ath5k: Use correct value for min_pwr and cur_pwr
      ath5k: Fix range scaling when setting rate power table
      ath5k: Preserve tx power level requested from above on phy_init
      ath5k: Put power_level where it belongs and rename it

Nicolas Dichtel (4):
      ipv6: fix handling of blackhole and prohibit routes
      ipv6: fix handling of throw routes
      ipv4/route: arg delay is useless in rt_cache_flush()
      ipv6: del unreachable route when an addr is deleted on lo

Nikolay Aleksandrov (1):
      net: add unknown state to sysfs NIC duplex export

Oliver Neukum (2):
      usbnet: drop unneeded check for NULL
      Revert "usbnet: drop unneeded check for NULL"

Or Gerlitz (2):
      IB/ipoib: Add rtnl_link_ops support
      IB/ipoib: Add more rtnl_link_ops callbacks

Otto Estuardo Solares Cabrera (1):
      e1000: add byte queue limits

Pablo Neira Ayuso (15):
      netfilter: nf_nat: support IPv6 in IRC NAT helper
      netfilter: nf_nat: support IPv6 in TFTP NAT helper
      netfilter: xt_socket: fix compilation warnings with gcc 4.7
      netfilter: xt_CT: refactorize xt_ct_tg_check
      netfilter: nf_conntrack: add nf_ct_timeout_lookup
      Merge git://git.kernel.org/.../davem/net-next
      netfilter: fix crash during boot if NAT has been compiled built-in
      netlink: kill netlink_set_nonroot
      netlink: hide struct module parameter in netlink_kernel_create
      netfilter: ctnetlink: fix module auto-load in ctnetlink_parse_nat
      netfilter: fix IPv6 NAT dependencies in Kconfig
      netlink: use <linux/export.h> instead of <linux/module.h>
      netfilter: nf_ct_ftp: add sequence tracking pickup facility for injected entries
      netfilter: nfnetlink_queue: fix maximum packet length to userspace
      netfilter: nfnetlink_queue: add NFQA_CAP_LEN attribute

Pandiyarajan Pitchaimuthu (1):
      cfg80211/nl80211: Notify connection request failure in AP mode

Patrick McHardy (19):
      netfilter: sparse endian fixes
      netfilter: nf_conntrack: remove unnecessary RTNL locking
      ipv4: fix path MTU discovery with connection tracking
      netfilter: nf_conntrack_ipv6: improve fragmentation handling
      netfilter: nf_conntrack_ipv6: fix tracking of ICMPv6 error messages containing fragments
      netfilter: nf_conntrack: restrict NAT helper invocation to IPv4
      netfilter: nf_nat: add protoff argument to packet mangling functions
      netfilter: add protocol independent NAT core
      netfilter: ipv6: expand skb head in ip6_route_me_harder after oif change
      net: core: add function for incremental IPv6 pseudo header checksum updates
      netfilter: ipv6: add IPv6 NAT support
      netfilter: ip6tables: add MASQUERADE target
      netfilter: ip6tables: add REDIRECT target
      netfilter: ip6tables: add NETMAP target
      netfilter: nf_nat: support IPv6 in FTP NAT helper
      netfilter: nf_nat: support IPv6 in amanda NAT helper
      netfilter: nf_nat: support IPv6 in SIP NAT helper
      netfilter: ip6tables: add stateless IPv6-to-IPv6 Network Prefix Translation target
      netfilter: nf_nat: fix oops when unloading protocol modules

Paul Bolle (1):
      ipw2x00: silence GCC warning for unused variable 'dev'

Paul Gortmaker (1):
      tg3: unconditionally select HWMON support when tg3 is enabled.

Pavel Emelyanov (12):
      net: Dont use ifindices in hash fns
      net: Allow to create links with given ifindex
      veth: Allow to create peer link with given ifindex
      net: Make ifindex generation per-net namespace
      net: Loopback ifindex is constant now
      packet: Introduce net/packet/internal.h header
      packet: Diag core and basic socket info dumping
      packet: Report more packet sk info via diag module
      packet: Report socket mclist info via diag module
      packet: Report rings cfg via diag engine
      packet: Report fanout status via diag engine
      packet: Protect packet sk list with mutex (v2)

Peter Senna Tschudin (15):
      net/mac80211/scan.c: removes unnecessary semicolon
      drivers/net/usb/sierra_net.c: removes unnecessary semicolon
      drivers/net/wireless/rtlwifi/rtl8192de/phy.c: removes unnecessary semicolon
      drivers/net/wireless/ath/ath9k/ar9003_mac.c: removes unnecessary semicolon
      drivers/isdn/gigaset/common.c: Remove useless kfree
      net/ieee802154/6lowpan.c: Remove unecessary semicolon
      net/openvswitch/vport.c: Remove unecessary semicolon
      net/tipc/name_table.c: Remove unecessary semicolon
      Bluetooth: bluecard_cs.c: removes unnecessary semicolon
      Bluetooth: hci_ldisc.c: removes unnecessary semicolon
      Bluetooth: hci_ll.c: removes unnecessary semicolon
      Bluetooth: hci_vhci.c: removes unnecessary semicolon
      Bluetooth: btuart_cs.c: removes unnecessary semicolon
      drivers/s390/net: removes unnecessary semicolon
      ctcm: fix error return code

Piotr Haber (1):
      brcmsmac: don't start device when RfKill is engaged

Pravin B Shelar (2):
      openvswitch: Add support for network namespaces.
      openvswitch: Increase maximum number of datapath ports.

Priyanka Jain (1):
      Replace rwlock on xfrm_policy_afinfo with rcu

Quinlan Pfiffer (1):
      asix: Adds support for Lenovo 10/100 USB dongle.

Rafał Miłecki (16):
      b43: N-PHY: update workarounds
      b43: N-PHY: add PHY rev7+ workarounds
      b43: rename host flags defines
      b43: add helper waiting for given value in radio reg
      b43: N-PHY: finish 0x2056 radio setup
      b43: N-PHY: init 0x2057 radio
      b43: be more user friendly with PHY info
      b43: N-PHY: add overriding RF control for rev7+
      bcma: add (mostly) NAND defines
      b43: N-PHY: fix 0x2057 radio calib copy/paste mistake
      b43legacy: fix logic in GPIO init
      ssb: check for flash presentence
      bcma: detect and register serial flash device
      bcma: detect and register NAND flash device
      bcma: handle BCM43227
      bcma: change delays to follow timers-howto guide

Rajkumar Manoharan (13):
      ath9k: tune rc_stats to display only valid rates
      ath9k_hw: Read and apply thermometer settings from EEPROM
      ath9k_hw: Read and configure thermocal for AR9462
      ath9k_hw: Wait BT calibration to complete
      ath9k_hw: use peak detection for 5GHz
      ath9k_hw: add 8 points for 5G temp slop
      ath9k_hw: move 2g5g switch before nfcal start
      ath9k_hw: fix ar9462 selfgen chainmask
      ath9k: flush bt profile whenever it is requested
      ath9k: move coex param updation within mci work
      ath9k: fill led_pin before drv_start
      ath9k: fix queuing MCI work twice
      ath9k_hw: fix BT sleep state on chip wakeup

Rami Rosen (2):
      packet: fix broken build.
      net: fix documentation of skb_needs_linearize().

Randy Dunlap (1):
      can: usb: peak: rename peak_usb dump_mem function

Razvan Ghitulete (1):
      net: remove wrong initialization for snd_wl1

Richard Cochran (4):
      ptp: remember the adjusted frequency
      ptp: provide the clock's adjusted frequency
      ptp: link the phc device to its parent device
      ptp: clarify the clock_name sysfs attribute

Robert P. J. Day (1):
      cfg80211: add kerneldoc entry for "vht_cap"

Sachin Kamat (12):
      Bluetooth: Use devm_kzalloc in bcm203x.c file.
      Bluetooth: Use devm_kzalloc in bfusb.c file
      Bluetooth: Use devm_kzalloc in bluecard_cs.c file
      Bluetooth: Use devm_kzalloc in bpa10x.c file
      Bluetooth: Use devm_kzalloc in bt3c_cs.c file
      Bluetooth: Use devm_kzalloc in btmrvl_sdio.c file
      Bluetooth: Use devm_kzalloc in btsdio.c file
      Bluetooth: Use devm_kzalloc in btuart_cs.c file
      Bluetooth: Use devm_kzalloc in btusb.c file
      Bluetooth: Use devm_kzalloc in btwilink.c file
      Bluetooth: Use devm_kzalloc in dtl1_cs.c file
      Bluetooth: Use module_platform_driver() in btwilink.c file

Samuel Ortiz (4):
      NFC: Queue pn533 commands
      NFC: Set the IRQF_ONESHOT flag from the pn544_hci IRQ handler request
      NFC: Remove unneeded LLC symbols export
      MAINTAINERS: Add NFC specific mailing list

Sathya Perla (7):
      be2net: create RSS rings even in multi-channel configs
      be2net: fixup malloc/free of adapter->pmac_id
      be2net: use PCIe AER capability
      be2net: remove type argument of be_cmd_mac_addr_query()
      be2net: fix wrong handling of be_setup() failure in be_probe()
      be2net: cleanup code related to be_link_status_query()
      be2net: fixup log messages

Saul St. John (1):
      bcma: don't leak memory for PCIE, MIPS, GBIT cores

Sebastian Ott (2):
      qeth: cleanup channel path descriptor function
      lcs: ensure proper ccw setup

Simon Wunderlich (4):
      batman-adv: Add the backbone gateway list to debugfs
      batman-adv: correct comments in bridge loop avoidance
      batman-adv: rename bridge loop avoidance claim types
      batman-adv: check batadv_orig_hash_add_if() return code

Sorin Dumitru (1):
      ipv6: remove some deadcode

Srinivas Kandagatla (6):
      of/mdio: Add dummy functions in of_mdio.h.
      of/mdio-gpio: Simplify the way device tree support is implemented.
      net:stmmac: Add check if mdiobus is registered in stmmac_mdio_unregister
      net:stmmac: fix broken stmmac_pltfr_remove.
      net:stmmac: Remove bus_id from mdio platform data.
      net:stmmac: convert driver to use devm_request_and_ioremap.

Srivatsa S. Bhat (2):
      netprio_cgroup: Remove update_netdev_tables() since it is unnecessary
      netprio_cgroup: Use memcpy instead of the for-loop to copy priomap

Stefan Assmann (1):
      igb: Change how we check for pre-existing and assigned VFs

Stephen Rothwell (1):
      netfilter: ipv6: using csum_ipv6_magic requires net/ip6_checksum.h

Steve Glendinning (9):
      smsc95xx: sleep before read for lengthy operations
      smsc95xx: remove unnecessary variables
      smsc95xx: check return code from control messages
      smsc95xx: fix resume when usb device is reset
      smsc95xx: enable power saving mode during system suspend
      smsc95xx: add wol magic packet support
      smsc75xx: add explicit test that device is READY
      smsc75xx: enable power saving mode during system suspend
      smsc75xx: add wol magic packet support

Steven J. Hill (1):
      net: mipsnet: Remove the MIPSsim Ethernet driver.

Stone Piao (14):
      mwifiex: fix coding style issue
      mwifiex: implement cfg80211 mgmt_tx handler
      mwifiex: advertise mgmt_stype to cfg80211
      mwifiex: implement cfg80211 mgmt_frame_register handler
      mwifiex: report received management frames to cfg80211
      mwifiex: implement remain_on_channel and cancel_remain_on_channel
      mwifiex: process remain on channel expired event
      mwifiex: append each IE into a seperate IE buffer
      mwifiex: send firmware initialization commands synchronously
      mwifiex: add P2P interface
      mwifiex: add support for P2P client in interface type change
      mwifiex: add support for P2P GO in interface type change
      mwifiex: parse P2P IEs from beacon_data
      mwifiex: set txpd when send a mgmt frame for AP and GO mode

Stuart Hodgson (4):
      sfc: Add explicit RX queue flag to channel
      sfc: Add channel specific receive_skb handler and post_remove callback
      sfc: Allow efx_mcdi_rpc to be called in two parts
      sfc: Add support for IEEE-1588 PTP

Sujith Manoharan (40):
      ath9k: Simplify rate table initialization
      ath9k: Cleanup RC init API
      ath9k: Cleanup ath_rc_setvalid_rates
      ath9k: Cleanup ath_rc_setvalid_htrates
      ath9k: Cleanup index retrieval routines
      ath9k: Change rateset calculation
      ath9k: Remove ath_rc_set_valid_rate_idx
      ath9k: Unify valid rate calculation routines
      ath9k: Do not set IEEE80211_TX_RC_USE_SHORT_PREAMBLE
      ath9k: Fix RTS/CTS rate selection
      ath9k: Bail out properly before calculating rate index
      ath9k: Cleanup TX status API
      ath9k: Remove MIMO-PS specific code
      ath9k: Trim rate table
      mac80211: Fix AP mode regression
      ath9k: Fix TX filter usage
      ath9k_hw: Add version/revision macros for AR9565
      ath9k_hw: Add AR9565 initvals
      ath9k_hw: Add AR9565 HW support
      ath9k: Set correct max streams for AR9565
      ath9k_hw: Fix spur mitigation for AR9565
      ath9k_hw: Program correct PLL value for AR9565
      ath9k: Add PCI ID for AR9565
      ath9k_hw: Handle gentimer termination properly
      ath9k_hw: Rename antenna diversity macros
      ath9k: Choose correct LED pin for AR9565
      ath9k: Enable SGI correctly
      ath9k_hw: Use HW cap ATH9K_HW_CAP_ANT_DIV_COMB
      ath9k: Remove redundant variable assignment
      ath9k: Remove a couple of unused variables
      ath9k_hw: Add antenna diversity group for AR9565
      ath9k_hw: Update AR9565 initvals
      ath9k_hw: Add a HW callback to set diversity
      ath9k: Add a module parameter to enable diversity
      ath9k_hw: Enable WLAN RX diversity for AR9565
      ath9k: Disable ASPM only for AR9285
      ath9k: Handle errors properly in MCI initialization
      ath9k: Add a debugfs file to adjust antenna diversity
      ath9k: Fix chainmask selection for AR9462
      ath9k: Fix BTCOEX weight initialization

Sven Eckelmann (6):
      batman-adv: Split batadv_priv in sub-structures for features
      batman-adv: Use BIT(x) macro to calculate bit positions
      batman-adv: Don't break statements after assignment operator
      batman-adv: Reduce accumulated length of simple statements
      batman-adv: Start new development cycle
      ath9k_hw: Handle AR_INTR_SYNC_HOST1_(FATAL|PERR) on AR9003

Syam Sidhardhan (4):
      Bluetooth: debug: Correct the PSM printing
      Bluetooth: Use kref for l2cap channel reference counting
      NFC: Use module_platform_driver macro for nfcwilink.c
      NFC: Remove repeated code for NULL check

Sylvain Roger Rieunier (1):
      mac80211: fix IBSS auth TX debug message

Szymon Janc (4):
      NFC: Use dynamic initialization for rwlocks
      NFC: Fix missing mutex unlock in pn533_send_cmd_frame_async
      NFC: Fix sleeping in invalid context when netlink socket is closed
      NFC: Fix sleeping in atomic when releasing socket

Tejun Heo (2):
      NFC: Use system_nrt_wq instead of custom ones
      NFC: Don't use WQ_MEM_RECLAIM for pn533

Thierry Escande (1):
      NFC: LLCP raw socket support

Thomas Huehn (1):
      mac80211: move TX station pointer and restructure TX

Thomas Pedersen (6):
      mac80211: improve cleanup when leaving mesh
      mac80211: remove ieee80211_clean_sdata()
      mac80211: don't request ack for peering close
      mac80211: skb leak in mesh_plink_frame_tx()
      mac80211: use skb_queue_walk() in mesh_path_assign_nexthop
      mac80211: clean up mpath_move_to_queue()

Thomas Wagner (1):
      ath9k: Fix rx filtering issue for older chips

Tim Gardner (2):
      firmware: Remove obsolete Chelsio cxgb3 firmware
      wlcore: Declare MODULE_FIRMWARE usage

Timur Tabi (10):
      net/fsl: introduce Freescale 10G MDIO driver
      netdev/phy: add MDIO bus multiplexer driven by a memory-mapped device
      net/freescale: do not export any functions from fsl_pq_mdio.c
      net/fsl_pq_mdio: trim #include statements
      net/fsl_pq_mdio: merge some functions together
      net/fsl_pq_mdio: various small fixes
      net/fsl_pq_mdio: streamline probing of MDIO nodes
      net/fsl-pq-mdio: coalesce multiple memory allocations into one
      net/fsl_pq_mdio: add support for the Fman 1G MDIO controller
      netdev/phy: mdio-mux-mmioreg.c should include of_address.h

Ulrich Weber (2):
      sctp: fix compile issue with disabled CONFIG_NET_NS
      netfilter: nf_nat: remove obsolete rcu_read_unlock call

Vasundhara Volam (3):
      be2net: fix max VFs reported by HW
      be2net: fix FW default for VF tx-rate
      be2net: modify log msg for lack of privilege error

Vinicius Costa Gomes (8):
      Bluetooth: Remove some functions from being exported
      Bluetooth: Rename LE and ACL connection functions
      Bluetooth: Refactor LE connection into its own function
      Bluetooth: Refactor ACL connection into its own function
      Bluetooth: Refactor SCO connection into its own function
      Bluetooth: Simplify a the connection type handling
      Bluetooth: Add type information to the hci_connect() debug statement
      Bluetooth: Fix establishing ESCO links

Vipul Pandya (9):
      RDMA/cxgb4: Update RDMA/cxgb4 due to macro definition removal in cxgb4 driver
      cxgb4: Remove duplicate register definitions
      cxgb4: Fix incorrect values for MEMWIN*_APERTURE and MEMWIN*_BASE
      cxgb4: Add functions to read memory via PCIE memory window
      cxgb4/cxgb4vf: Code cleanup to enable T4 Configuration File support
      cxgb4: Add support for T4 configuration file
      cxgb4: Add support for T4 hardwired driver configuration settings
      cxgb4: Inform caller if driver didn't upgrade firmware
      cxgb4: Don't attempt to upgrade T4 firmware when cxgb4 will end up as a slave

Vitaly Wool (1):
      rfkill: prevent unnecessary event generation

Vladimir Kondratiev (2):
      cfg80211: unify IE search
      cfg80211: Fix regulatory check for 60GHz band frequencies

Waldemar Rymarkiewicz (6):
      NFC: Remove crc generation from shdlc layer
      NFC: Correct outgoing frame before requeueing
      NFC: xmit from hci ops must return 0 or negative
      NFC: Handle RSET in SHDLC_CONNECTING state
      NFC: Don't handle consequent RSET frames after UA
      NFC: Fix typo negociating -> negotiating

Wanlong Gao (1):
      net:atm:fix up ENOIOCTLCMD error handling

Wei Yongjun (33):
      wimax/i2400m: use is_zero_ether_addr() instead of memcmp()
      w5100: using eth_hw_addr_random() for random MAC and set device flag
      w5300: using eth_hw_addr_random() for random MAC and set device flag
      openvswitch: using kfree_rcu() to simplify the code
      sctp: use list_move_tail instead of list_del/list_add_tail
      cfg80211: use list_move_tail instead of list_del/list_add_tail
      bnx2x: use list_move_tail instead of list_del/list_add_tail
      mac80211: use list_move instead of list_del/list_add
      ipw2100: use is_zero_ether_addr() and is_broadcast_ether_addr()
      ipw2200: use is_zero_ether_addr() and is_broadcast_ether_addr()
      orinoco: use is_zero_ether_addr() instead of memcmp()
      drivers/net: use is_zero_ether_addr() instead of memcmp()
      airo: use is_zero_ether_addr() and is_broadcast_ether_addr()
      mwifiex: use is_broadcast_ether_addr() instead of memcmp()
      mwifiex: use is_zero_ether_addr() instead of memcmp()
      wireless: use is_broadcast_ether_addr() instead of memcmp()
      wl3501_cs: use is_broadcast_ether_addr() instead of memcmp()
      wl18xx: remove duplicated include from main.c
      airo: remove duplicated include from airo.c
      rtlwifi: rtl8192de: remove pointless conditional before kfree_skb()
      rtlwifi: rtl8192c: remove pointless conditional before kfree_skb()
      Bluetooth: btmrvl: remove pointless conditional before kfree_skb()
      netfilter: nfnetlink_queue: remove pointless conditional before kfree_skb()
      ipvs: use list_del_init instead of list_del/INIT_LIST_HEAD
      rndis_wlan: remove pointless check from rndis_scan()
      can: mscan-mpc5xxx: fix return value check in mpc512x_can_get_clock()
      qeth: fix possible memory leak in qeth_l3_add_[vipa|rxip]()
      NFC: Remove pointless conditional before HCI kfree_skb()
      NFC: Fix possible LLCP memory leak
      NFC: Move the nfcwilink dereference below the NULL test
      NFC: Move the pn544_hci dereference below the NULL test
      wl12xx: remove duplicated include from main.c
      mwifiex: convert to use le16_add_cpu()

Weiping Pan (1):
      use skb_end_offset() in skb_try_coalesce()

Wolfgang Grandegger (1):
      flexcan: disable bus error interrupts for the i.MX28

Wu Fengguang (1):
      netfilter: PTR_RET can be used

Xi Wang (2):
      decnet: fix shutdown parameter checking
      af_unix: fix shutdown parameter checking

YOSHIFUJI Hideaki / 吉藤英明 (2):
      ipv6: Add labels for site-local and 6bone testing addresses (RFC6724)
      ipv6: Compare addresses only bits up to the prefix length (RFC6724).

Yair Shapira (2):
      wl18xx: number_of_assembled_ant5 indicates if A band is enabled
      wlcore/wl18xx: add phy_fw_version_str to debugfs driver_state

Yaniv Rosner (2):
      bnx2x: link code refactoring
      bnx2x: Link Flap Avoidance

Ying Luo (3):
      mwifiex: rename wapi_rxpn to pn
      mwifiex: pass key_params pointer in mwifiex_set_encode
      mwifiex: add AES_CMAC support in key_material cmd

Ying Xue (10):
      tipc: optimize the initialization of network device notifier
      tipc: fix lockdep warning during bearer initialization
      tipc: remove pointless name sanity check and tipc_alphabet array
      tipc: manually inline single use media_name_valid routine
      tipc: change tipc_net_start routine return value type
      tipc: convert tipc_nametbl_size type from variable to macro
      tipc: add __read_mostly annotations to several global variables
      tipc: eliminate configuration for maximum number of name subscriptions
      tipc: eliminate configuration for maximum number of name publications
      rds: Don't disable BH on BH context

Yogesh Ashok Powar (3):
      mwifiex: copy MSDU subframes correctly
      mwifiex: remove extra padding to AMSDU
      mwifiex: correction in MSDU padding logic

Yuchung Cheng (3):
      tcp: move tcp_enter_cwr()
      tcp: move tcp_update_cwnd_in_recovery
      tcp: use PRR to reduce cwin in CWR state

Yuval Mintz (8):
      bnx2x: EEE status is read locally
      bnx2x: add EEE support for 4-port devices
      bnx2x: EEE code refactoring
      bnx2x: correct & clean 10G EEE requirements
      bnx2x: use native EEE instead of auto-greeen
      bnx2x: Utilize Link Flap Avoidance
      bnx2x,cnic: use FW 7.8.2
      bnx2x: update version to 1.78.00-0.

alex.bluesman.smirnov@gmail.com (2):
      drivers/ieee802154/at86rf230: replace the code under _init and _exit by macro
      drivers/ieee802154: move ieee802154 drivers to net folder

danborkmann@iogearbox.net (1):
      af_packet: use define instead of constant

david decotigny (3):
      forcedeth: fix buffer overflow
      forcedeth: fix TX timeout caused by TX pause on down link
      forcedeth: prevent TX timeouts after reboot

stephen hemminger (10):
      netdev: make address const in device address management
      gre: fix handling of key 0
      gre: remove unnecessary rcu_read_lock/unlock
      xfrm: remove extranous rcu_read_lock
      tunnel: drop packet if ECN present with not-ECT
      gre: fix sparse warning
      netlink: add attributes to fdb interface
      igmp: export symbol ip_mc_leave_group
      vxlan: virtual extensible lan
      vxlan: put UDP socket in correct namespace

xeb@mail.ru (1):
      gre: Support GRE over IPv6

 Documentation/ABI/testing/sysfs-ptp                        |    6 +-
 Documentation/devicetree/bindings/net/can/c_can.txt        |   49 +
 Documentation/devicetree/bindings/net/cpsw.txt             |  109 +++
 Documentation/devicetree/bindings/net/davinci-mdio.txt     |   33 +
 Documentation/devicetree/bindings/net/mdio-mux-mmioreg.txt |   75 ++
 Documentation/feature-removal-schedule.txt                 |   20 -
 Documentation/filesystems/nfs/nfsroot.txt                  |   10 +-
 Documentation/infiniband/ipoib.txt                         |    3 +
 Documentation/networking/batman-adv.txt                    |    7 +-
 Documentation/networking/bonding.txt                       |   30 +-
 Documentation/networking/ip-sysctl.txt                     |   37 +-
 Documentation/networking/stmmac.txt                        |    5 -
 Documentation/networking/vxlan.txt                         |   47 +
 MAINTAINERS                                                |    1 +
 arch/m68k/configs/amiga_defconfig                          |    1 -
 arch/m68k/configs/apollo_defconfig                         |    1 -
 arch/m68k/configs/atari_defconfig                          |    1 -
 arch/m68k/configs/bvme6000_defconfig                       |    1 -
 arch/m68k/configs/hp300_defconfig                          |    1 -
 arch/m68k/configs/mac_defconfig                            |    1 -
 arch/m68k/configs/multi_defconfig                          |    1 -
 arch/m68k/configs/mvme147_defconfig                        |    1 -
 arch/m68k/configs/mvme16x_defconfig                        |    1 -
 arch/m68k/configs/q40_defconfig                            |    1 -
 arch/m68k/configs/sun3_defconfig                           |    1 -
 arch/m68k/configs/sun3x_defconfig                          |    1 -
 arch/mips/configs/ar7_defconfig                            |    1 -
 arch/mips/configs/bcm47xx_defconfig                        |    1 -
 arch/mips/configs/ip22_defconfig                           |    1 -
 arch/mips/configs/jazz_defconfig                           |    1 -
 arch/mips/configs/malta_defconfig                          |    1 -
 arch/mips/configs/markeins_defconfig                       |    1 -
 arch/mips/configs/nlm_xlp_defconfig                        |    1 -
 arch/mips/configs/nlm_xlr_defconfig                        |    1 -
 arch/mips/configs/rm200_defconfig                          |    1 -
 arch/powerpc/configs/pmac32_defconfig                      |    1 -
 arch/powerpc/configs/ppc64_defconfig                       |    1 -
 arch/powerpc/configs/ppc64e_defconfig                      |    1 -
 arch/powerpc/configs/ppc6xx_defconfig                      |    1 -
 arch/sparc/net/bpf_jit_comp.c                              |    4 +
 arch/tile/configs/tilegx_defconfig                         |    1 -
 arch/tile/configs/tilepro_defconfig                        |    1 -
 arch/x86/net/bpf_jit_comp.c                                |   34 +
 crypto/crypto_user.c                                       |    7 +-
 drivers/Makefile                                           |    1 -
 drivers/bcma/Kconfig                                       |    4 +-
 drivers/bcma/bcma_private.h                                |    2 +
 drivers/bcma/core.c                                        |    2 +-
 drivers/bcma/driver_chipcommon_nflash.c                    |   28 +-
 drivers/bcma/driver_chipcommon_pmu.c                       |    9 +-
 drivers/bcma/driver_chipcommon_sflash.c                    |  123 ++-
 drivers/bcma/driver_pci.c                                  |    6 +-
 drivers/bcma/driver_pci_host.c                             |    8 +-
 drivers/bcma/host_pci.c                                    |   12 +-
 drivers/bcma/host_soc.c                                    |    2 +-
 drivers/bcma/main.c                                        |   27 +
 drivers/bcma/sprom.c                                       |    2 +
 drivers/bluetooth/bcm203x.c                                |    8 +-
 drivers/bluetooth/bfusb.c                                  |   12 +-
 drivers/bluetooth/bluecard_cs.c                            |    7 +-
 drivers/bluetooth/bpa10x.c                                 |    8 +-
 drivers/bluetooth/bt3c_cs.c                                |    5 +-
 drivers/bluetooth/btmrvl_sdio.c                            |   18 +-
 drivers/bluetooth/btsdio.c                                 |    8 +-
 drivers/bluetooth/btuart_cs.c                              |    7 +-
 drivers/bluetooth/btusb.c                                  |   16 +-
 drivers/bluetooth/btwilink.c                               |   24 +-
 drivers/bluetooth/dtl1_cs.c                                |    3 +-
 drivers/bluetooth/hci_ldisc.c                              |    2 +-
 drivers/bluetooth/hci_ll.c                                 |    2 +-
 drivers/bluetooth/hci_vhci.c                               |    2 +-
 drivers/connector/connector.c                              |    3 +-
 drivers/infiniband/core/netlink.c                          |    2 +-
 drivers/infiniband/hw/cxgb4/qp.c                           |    2 +-
 drivers/infiniband/ulp/ipoib/Makefile                      |    3 +-
 drivers/infiniband/ulp/ipoib/ipoib.h                       |   16 +
 drivers/infiniband/ulp/ipoib/ipoib_cm.c                    |   34 +-
 drivers/infiniband/ulp/ipoib/ipoib_main.c                  |   41 +-
 drivers/infiniband/ulp/ipoib/ipoib_netlink.c               |  172 ++++
 drivers/infiniband/ulp/ipoib/ipoib_vlan.c                  |  124 +--
 drivers/isdn/gigaset/common.c                              |    1 -
 drivers/net/Kconfig                                        |   17 +-
 drivers/net/Makefile                                       |    2 +
 drivers/net/bonding/bond_main.c                            |  140 ++-
 drivers/net/can/c_can/c_can.c                              |  130 ++-
 drivers/net/can/c_can/c_can.h                              |   14 +-
 drivers/net/can/c_can/c_can_pci.c                          |    6 +-
 drivers/net/can/c_can/c_can_platform.c                     |  123 ++-
 drivers/net/can/flexcan.c                                  |   29 +-
 drivers/net/can/mscan/mpc5xxx_can.c                        |    4 +-
 drivers/net/can/sja1000/sja1000.c                          |   31 +-
 drivers/net/can/usb/peak_usb/pcan_usb_core.c               |    8 +-
 drivers/net/can/usb/peak_usb/pcan_usb_core.h               |    2 +-
 drivers/net/can/usb/peak_usb/pcan_usb_pro.c                |    8 +-
 drivers/net/ethernet/Kconfig                               |    9 -
 drivers/net/ethernet/Makefile                              |    1 -
 drivers/net/ethernet/broadcom/Kconfig                      |    1 +
 drivers/net/ethernet/broadcom/bnx2x/bnx2x.h                |    4 +-
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c            |   24 +-
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h            |   16 +-
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c            |   12 +-
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c        |   58 +-
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_fw_defs.h        |    3 -
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_hsi.h            |  109 ++-
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_init.h           |    2 +-
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c           | 1701 ++++++++++++++++----------------
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.h           |    7 +-
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c           |   34 +-
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h            |   14 +-
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c             |    5 +-
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c          |   35 +-
 drivers/net/ethernet/broadcom/cnic.c                       |  116 ++-
 drivers/net/ethernet/broadcom/cnic.h                       |    5 +
 drivers/net/ethernet/broadcom/cnic_defs.h                  |    2 +-
 drivers/net/ethernet/broadcom/cnic_if.h                    |    4 +-
 drivers/net/ethernet/broadcom/tg3.c                        |  534 ++++++----
 drivers/net/ethernet/broadcom/tg3.h                        |    9 +-
 drivers/net/ethernet/brocade/bna/bnad.c                    |    1 +
 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h                 |   51 +-
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c            |  954 +++++++++++++++---
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.h             |    2 +
 drivers/net/ethernet/chelsio/cxgb4/sge.c                   |  341 +++++--
 drivers/net/ethernet/chelsio/cxgb4/t4_hw.c                 |  734 +++++++++++++-
 drivers/net/ethernet/chelsio/cxgb4/t4_hw.h                 |   80 ++
 drivers/net/ethernet/chelsio/cxgb4/t4_regs.h               |  185 +++-
 drivers/net/ethernet/chelsio/cxgb4/t4fw_api.h              |   97 +-
 drivers/net/ethernet/chelsio/cxgb4vf/sge.c                 |    5 +-
 drivers/net/ethernet/emulex/benet/be.h                     |    2 +-
 drivers/net/ethernet/emulex/benet/be_cmds.c                |   55 +-
 drivers/net/ethernet/emulex/benet/be_cmds.h                |    6 +-
 drivers/net/ethernet/emulex/benet/be_ethtool.c             |   57 +-
 drivers/net/ethernet/emulex/benet/be_main.c                |   96 +-
 drivers/net/ethernet/freescale/Kconfig                     |    7 +
 drivers/net/ethernet/freescale/Makefile                    |    1 +
 drivers/net/ethernet/freescale/fsl_pq_mdio.c               |  549 ++++++-----
 drivers/net/ethernet/freescale/fsl_pq_mdio.h               |   52 -
 drivers/net/ethernet/freescale/gianfar.c                   |   12 +-
 drivers/net/ethernet/freescale/gianfar.h                   |   11 +-
 drivers/net/ethernet/freescale/gianfar_ptp.c               |    2 +-
 drivers/net/ethernet/freescale/ucc_geth.c                  |    1 -
 drivers/net/ethernet/freescale/xgmac_mdio.c                |  274 ++++++
 drivers/net/ethernet/i825xx/Kconfig                        |    2 +-
 drivers/net/ethernet/i825xx/znet.c                         |    4 +-
 drivers/net/ethernet/intel/e1000/e1000_ethtool.c           |   39 +
 drivers/net/ethernet/intel/e1000/e1000_main.c              |   14 +
 drivers/net/ethernet/intel/e1000e/82571.c                  |    4 +-
 drivers/net/ethernet/intel/e1000e/ethtool.c                |   44 +-
 drivers/net/ethernet/intel/e1000e/netdev.c                 |   19 +-
 drivers/net/ethernet/intel/e1000e/phy.c                    |   31 +-
 drivers/net/ethernet/intel/igb/e1000_82575.c               |   17 +-
 drivers/net/ethernet/intel/igb/e1000_defines.h             |   11 +-
 drivers/net/ethernet/intel/igb/e1000_phy.c                 |   29 +-
 drivers/net/ethernet/intel/igb/e1000_phy.h                 |    5 +-
 drivers/net/ethernet/intel/igb/e1000_regs.h                |    3 +
 drivers/net/ethernet/intel/igb/igb.h                       |   41 +-
 drivers/net/ethernet/intel/igb/igb_ethtool.c               |  198 ++--
 drivers/net/ethernet/intel/igb/igb_main.c                  |  711 ++++----------
 drivers/net/ethernet/intel/igb/igb_ptp.c                   |  677 ++++++++++---
 drivers/net/ethernet/intel/ixgbe/Makefile                  |    2 +-
 drivers/net/ethernet/intel/ixgbe/ixgbe.h                   |   35 +-
 drivers/net/ethernet/intel/ixgbe/ixgbe_debugfs.c           |  300 ++++++
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c              |  573 ++++++-----
 drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c               |    3 +-
 drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c             |  105 +-
 drivers/net/ethernet/intel/ixgbevf/defines.h               |    1 +
 drivers/net/ethernet/intel/ixgbevf/ixgbevf.h               |    9 +-
 drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c          |  272 ++++--
 drivers/net/ethernet/intel/ixgbevf/mbx.c                   |   15 +-
 drivers/net/ethernet/intel/ixgbevf/mbx.h                   |   21 +-
 drivers/net/ethernet/intel/ixgbevf/vf.c                    |  122 ++-
 drivers/net/ethernet/intel/ixgbevf/vf.h                    |    4 +
 drivers/net/ethernet/mellanox/mlx4/en_tx.c                 |    4 -
 drivers/net/ethernet/mipsnet.c                             |  345 -------
 drivers/net/ethernet/nvidia/forcedeth.c                    |   17 +-
 drivers/net/ethernet/realtek/r8169.c                       |    4 +-
 drivers/net/ethernet/sfc/Kconfig                           |    7 +
 drivers/net/ethernet/sfc/Makefile                          |    1 +
 drivers/net/ethernet/sfc/bitfield.h                        |   22 +-
 drivers/net/ethernet/sfc/efx.c                             |  250 +++--
 drivers/net/ethernet/sfc/efx.h                             |    1 +
 drivers/net/ethernet/sfc/ethtool.c                         |   16 +-
 drivers/net/ethernet/sfc/falcon_boards.c                   |    2 +-
 drivers/net/ethernet/sfc/filter.c                          |  108 +--
 drivers/net/ethernet/sfc/filter.h                          |    7 +-
 drivers/net/ethernet/sfc/mcdi.c                            |   49 +-
 drivers/net/ethernet/sfc/mcdi.h                            |   12 +-
 drivers/net/ethernet/sfc/mcdi_pcol.h                       |   29 +-
 drivers/net/ethernet/sfc/mtd.c                             |    7 +-
 drivers/net/ethernet/sfc/net_driver.h                      |   78 +-
 drivers/net/ethernet/sfc/nic.c                             |    6 +-
 drivers/net/ethernet/sfc/nic.h                             |   36 +
 drivers/net/ethernet/sfc/ptp.c                             | 1484 ++++++++++++++++++++++++++++
 drivers/net/ethernet/sfc/rx.c                              |   20 +-
 drivers/net/ethernet/sfc/selftest.c                        |    3 +-
 drivers/net/ethernet/sfc/siena.c                           |    1 +
 drivers/net/ethernet/sfc/siena_sriov.c                     |    8 +
 drivers/net/ethernet/sfc/tx.c                              |  627 +++++-------
 drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c          |   11 +-
 drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c           |    1 -
 drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c      |   39 +-
 drivers/net/ethernet/sun/sunbmac.c                         |    1 -
 drivers/net/ethernet/ti/Kconfig                            |    4 +-
 drivers/net/ethernet/ti/cpsw.c                             |  179 +++-
 drivers/net/ethernet/ti/davinci_mdio.c                     |   41 +-
 drivers/net/ethernet/tundra/tsi108_eth.c                   |    1 -
 drivers/net/ethernet/wiznet/w5100.c                        |    3 +-
 drivers/net/ethernet/wiznet/w5300.c                        |    3 +-
 drivers/net/hyperv/hyperv_net.h                            |    4 +-
 drivers/net/hyperv/netvsc.c                                |   22 +-
 drivers/net/hyperv/netvsc_drv.c                            |    4 +-
 drivers/net/hyperv/rndis_filter.c                          |   60 +-
 drivers/{ => net}/ieee802154/Kconfig                       |   11 +
 drivers/{ => net}/ieee802154/Makefile                      |    1 +
 drivers/{ => net}/ieee802154/at86rf230.c                   |   12 +-
 drivers/{ => net}/ieee802154/fakehard.c                    |    1 -
 drivers/{ => net}/ieee802154/fakelb.c                      |    0
 drivers/net/ieee802154/mrf24j40.c                          |  767 +++++++++++++++
 drivers/net/loopback.c                                     |    3 +-
 drivers/net/macvlan.c                                      |    6 +-
 drivers/net/phy/Kconfig                                    |   13 +
 drivers/net/phy/Makefile                                   |    1 +
 drivers/net/phy/dp83640.c                                  |    2 +-
 drivers/net/phy/lxt.c                                      |  127 +++
 drivers/net/phy/mdio-gpio.c                                |  132 +--
 drivers/net/phy/mdio-mux-mmioreg.c                         |  171 ++++
 drivers/net/phy/phy.c                                      |   74 +-
 drivers/net/ppp/ppp_generic.c                              |   58 +-
 drivers/net/team/Kconfig                                   |    4 +-
 drivers/net/team/team.c                                    |  342 ++++++-
 drivers/net/team/team_mode_broadcast.c                     |    8 +-
 drivers/net/team/team_mode_roundrobin.c                    |    8 +-
 drivers/net/tun.c                                          |   46 +-
 drivers/net/usb/asix_devices.c                             |   40 +-
 drivers/net/usb/catc.c                                     |   55 +-
 drivers/net/usb/cx82310_eth.c                              |   11 +-
 drivers/net/usb/gl620a.c                                   |   10 +-
 drivers/net/usb/kaweth.c                                   |  134 +--
 drivers/net/usb/net1080.c                                  |   51 +-
 drivers/net/usb/qmi_wwan.c                                 |   47 +-
 drivers/net/usb/rtl8150.c                                  |    6 +-
 drivers/net/usb/sierra_net.c                               |   25 +-
 drivers/net/usb/smsc75xx.c                                 |  240 ++++-
 drivers/net/usb/smsc95xx.c                                 |  560 +++++++----
 drivers/net/usb/smsc95xx.h                                 |   12 +-
 drivers/net/veth.c                                         |    3 +
 drivers/net/virtio_net.c                                   |    2 +-
 drivers/net/vxlan.c                                        | 1219 +++++++++++++++++++++++
 drivers/net/wimax/i2400m/driver.c                          |    3 +-
 drivers/net/wireless/adm8211.c                             |    4 +-
 drivers/net/wireless/airo.c                                |   55 +-
 drivers/net/wireless/at76c50x-usb.c                        |   58 +-
 drivers/net/wireless/ath/ath.h                             |    1 +
 drivers/net/wireless/ath/ath5k/ath5k.h                     |    2 +-
 drivers/net/wireless/ath/ath5k/base.c                      |    6 +-
 drivers/net/wireless/ath/ath5k/mac80211-ops.c              |   12 +-
 drivers/net/wireless/ath/ath5k/phy.c                       |   45 +-
 drivers/net/wireless/ath/ath6kl/cfg80211.c                 |    4 +-
 drivers/net/wireless/ath/ath6kl/cfg80211.h                 |    2 +-
 drivers/net/wireless/ath/ath9k/ani.c                       |    2 +-
 drivers/net/wireless/ath/ath9k/antenna.c                   |  117 ++-
 drivers/net/wireless/ath/ath9k/ar9003_eeprom.c             |  288 +++---
 drivers/net/wireless/ath/ath9k/ar9003_eeprom.h             |    3 +-
 drivers/net/wireless/ath/ath9k/ar9003_hw.c                 |   57 +-
 drivers/net/wireless/ath/ath9k/ar9003_mac.c                |   21 +-
 drivers/net/wireless/ath/ath9k/ar9003_mci.c                |   43 +-
 drivers/net/wireless/ath/ath9k/ar9003_mci.h                |   14 +-
 drivers/net/wireless/ath/ath9k/ar9003_phy.c                |  197 +++-
 drivers/net/wireless/ath/ath9k/ar9003_phy.h                |   95 +-
 drivers/net/wireless/ath/ath9k/ar9462_2p0_initvals.h       |    2 +-
 drivers/net/wireless/ath/ath9k/ar9565_1p0_initvals.h       | 1231 ++++++++++++++++++++++++
 drivers/net/wireless/ath/ath9k/ath9k.h                     |   12 +-
 drivers/net/wireless/ath/ath9k/btcoex.c                    |   65 +-
 drivers/net/wireless/ath/ath9k/btcoex.h                    |    3 +-
 drivers/net/wireless/ath/ath9k/debug.c                     |   58 +-
 drivers/net/wireless/ath/ath9k/debug.h                     |    4 +-
 drivers/net/wireless/ath/ath9k/eeprom.h                    |    3 +-
 drivers/net/wireless/ath/ath9k/gpio.c                      |   72 +-
 drivers/net/wireless/ath/ath9k/hif_usb.c                   |   38 +-
 drivers/net/wireless/ath/ath9k/hif_usb.h                   |    4 +-
 drivers/net/wireless/ath/ath9k/htc.h                       |    1 +
 drivers/net/wireless/ath/ath9k/htc_drv_beacon.c            |    2 +-
 drivers/net/wireless/ath/ath9k/htc_drv_gpio.c              |   13 +-
 drivers/net/wireless/ath/ath9k/htc_drv_init.c              |    5 +
 drivers/net/wireless/ath/ath9k/htc_drv_main.c              |   51 +-
 drivers/net/wireless/ath/ath9k/htc_drv_txrx.c              |    2 +-
 drivers/net/wireless/ath/ath9k/hw-ops.h                    |    7 +
 drivers/net/wireless/ath/ath9k/hw.c                        |   57 +-
 drivers/net/wireless/ath/ath9k/hw.h                        |    4 +-
 drivers/net/wireless/ath/ath9k/init.c                      |   15 +-
 drivers/net/wireless/ath/ath9k/main.c                      |   66 +-
 drivers/net/wireless/ath/ath9k/mci.c                       |   94 +-
 drivers/net/wireless/ath/ath9k/pci.c                       |    6 +-
 drivers/net/wireless/ath/ath9k/rc.c                        |  819 +++++++---------
 drivers/net/wireless/ath/ath9k/rc.h                        |    4 -
 drivers/net/wireless/ath/ath9k/recv.c                      |    4 +-
 drivers/net/wireless/ath/ath9k/reg.h                       |    9 +
 drivers/net/wireless/ath/ath9k/wow.c                       |    2 +-
 drivers/net/wireless/ath/ath9k/xmit.c                      |   15 +-
 drivers/net/wireless/ath/carl9170/carl9170.h               |    5 +-
 drivers/net/wireless/ath/carl9170/fw.c                     |    1 +
 drivers/net/wireless/ath/carl9170/mac.c                    |    5 +-
 drivers/net/wireless/ath/carl9170/main.c                   |    6 +-
 drivers/net/wireless/ath/carl9170/rx.c                     |   16 +-
 drivers/net/wireless/ath/carl9170/tx.c                     |   16 +-
 drivers/net/wireless/b43/Makefile                          |    1 +
 drivers/net/wireless/b43/b43.h                             |   10 +-
 drivers/net/wireless/b43/main.c                            |   54 +-
 drivers/net/wireless/b43/phy_common.c                      |   17 +-
 drivers/net/wireless/b43/phy_common.h                      |    6 +
 drivers/net/wireless/b43/phy_n.c                           |  668 ++++++++++++-
 drivers/net/wireless/b43/phy_n.h                           |    1 +
 drivers/net/wireless/b43/radio_2057.c                      |  141 +++
 drivers/net/wireless/b43/radio_2057.h                      |  430 +++++++++
 drivers/net/wireless/b43/tables_nphy.c                     |   75 ++
 drivers/net/wireless/b43/tables_nphy.h                     |   10 +
 drivers/net/wireless/b43legacy/main.c                      |    5 +-
 drivers/net/wireless/brcm80211/Kconfig                     |    8 +
 drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c           |   39 +-
 drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c     |   27 +-
 drivers/net/wireless/brcm80211/brcmfmac/dhd.h              |   62 +-
 drivers/net/wireless/brcm80211/brcmfmac/dhd_bus.h          |    2 +-
 drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c       |   73 +-
 drivers/net/wireless/brcm80211/brcmfmac/dhd_dbg.h          |    2 +
 drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c        |   65 +-
 drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c         | 1047 ++++++++------------
 drivers/net/wireless/brcm80211/brcmfmac/sdio_chip.c        |   17 +
 drivers/net/wireless/brcm80211/brcmfmac/sdio_host.h        |    2 +
 drivers/net/wireless/brcm80211/brcmfmac/usb.c              |  353 ++++---
 drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c      | 3425 ++++++++++++++++++++++++++++++++++++++++++++++++-----------------
 drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.h      |  296 ++++--
 drivers/net/wireless/brcm80211/brcmsmac/aiutils.c          |    3 -
 drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c      |   15 +-
 drivers/net/wireless/brcm80211/brcmsmac/main.c             |   13 +-
 drivers/net/wireless/brcm80211/include/brcm_hw_ids.h       |    1 +
 drivers/net/wireless/brcm80211/include/brcmu_wifi.h        |    5 -
 drivers/net/wireless/hostap/hostap_info.c                  |    4 +-
 drivers/net/wireless/hostap/hostap_ioctl.c                 |   15 +-
 drivers/net/wireless/hostap/hostap_main.c                  |    2 +-
 drivers/net/wireless/ipw2x00/ipw2100.c                     |   11 +-
 drivers/net/wireless/ipw2x00/ipw2200.c                     |   11 +-
 drivers/net/wireless/ipw2x00/libipw_wx.c                   |    2 +-
 drivers/net/wireless/iwlegacy/3945-mac.c                   |   12 +-
 drivers/net/wireless/iwlegacy/4965-mac.c                   |   26 +-
 drivers/net/wireless/iwlegacy/4965.h                       |    8 +-
 drivers/net/wireless/iwlegacy/common.c                     |   19 +-
 drivers/net/wireless/iwlegacy/common.h                     |    2 -
 drivers/net/wireless/iwlwifi/dvm/agn.h                     |   13 +-
 drivers/net/wireless/iwlwifi/dvm/commands.h                |    3 +-
 drivers/net/wireless/iwlwifi/dvm/debugfs.c                 |   56 +-
 drivers/net/wireless/iwlwifi/dvm/dev.h                     |    1 +
 drivers/net/wireless/iwlwifi/dvm/mac80211.c                |    8 +-
 drivers/net/wireless/iwlwifi/dvm/main.c                    |   24 +-
 drivers/net/wireless/iwlwifi/dvm/rx.c                      |   11 +
 drivers/net/wireless/iwlwifi/dvm/scan.c                    |    4 +-
 drivers/net/wireless/iwlwifi/dvm/sta.c                     |    9 +-
 drivers/net/wireless/iwlwifi/dvm/tx.c                      |   18 +-
 drivers/net/wireless/iwlwifi/dvm/ucode.c                   |    4 +-
 drivers/net/wireless/iwlwifi/iwl-devtrace.h                |   34 +-
 drivers/net/wireless/iwlwifi/iwl-drv.c                     |  167 +++-
 drivers/net/wireless/iwlwifi/iwl-drv.h                     |    6 +-
 drivers/net/wireless/iwlwifi/iwl-eeprom-parse.h            |    2 -
 drivers/net/wireless/iwlwifi/iwl-fw.h                      |    3 +-
 drivers/net/wireless/iwlwifi/iwl-op-mode.h                 |    3 +-
 drivers/net/wireless/iwlwifi/iwl-trans.h                   |   12 +-
 drivers/net/wireless/iwlwifi/pcie/drv.c                    |   19 +-
 drivers/net/wireless/iwlwifi/pcie/internal.h               |    3 +-
 drivers/net/wireless/iwlwifi/pcie/rx.c                     |   91 +-
 drivers/net/wireless/iwlwifi/pcie/trans.c                  |  112 ++-
 drivers/net/wireless/iwlwifi/pcie/tx.c                     |   51 +-
 drivers/net/wireless/libertas/cmd.c                        |   16 +
 drivers/net/wireless/libertas/cmd.h                        |    1 +
 drivers/net/wireless/libertas/main.c                       |    4 +-
 drivers/net/wireless/libertas_tf/main.c                    |    4 +-
 drivers/net/wireless/mac80211_hwsim.c                      |   59 +-
 drivers/net/wireless/mwifiex/11n.c                         |   64 +-
 drivers/net/wireless/mwifiex/11n.h                         |   20 +-
 drivers/net/wireless/mwifiex/11n_aggr.c                    |   14 +-
 drivers/net/wireless/mwifiex/11n_rxreorder.c               |  115 ++-
 drivers/net/wireless/mwifiex/11n_rxreorder.h               |   10 +
 drivers/net/wireless/mwifiex/Makefile                      |    2 +
 drivers/net/wireless/mwifiex/cfg80211.c                    |  460 ++++++++-
 drivers/net/wireless/mwifiex/cmdevt.c                      |    7 +-
 drivers/net/wireless/mwifiex/decl.h                        |    9 +-
 drivers/net/wireless/mwifiex/fw.h                          |   93 +-
 drivers/net/wireless/mwifiex/ie.c                          |   88 +-
 drivers/net/wireless/mwifiex/init.c                        |  126 ++-
 drivers/net/wireless/mwifiex/ioctl.h                       |   14 +-
 drivers/net/wireless/mwifiex/main.c                        |   39 +-
 drivers/net/wireless/mwifiex/main.h                        |   87 +-
 drivers/net/wireless/mwifiex/scan.c                        |   15 +-
 drivers/net/wireless/mwifiex/sta_cmd.c                     |  150 ++-
 drivers/net/wireless/mwifiex/sta_cmdresp.c                 |   77 +-
 drivers/net/wireless/mwifiex/sta_event.c                   |   74 +-
 drivers/net/wireless/mwifiex/sta_ioctl.c                   |  124 ++-
 drivers/net/wireless/mwifiex/sta_rx.c                      |   44 +-
 drivers/net/wireless/mwifiex/sta_tx.c                      |   12 +-
 drivers/net/wireless/mwifiex/txrx.c                        |   11 +-
 drivers/net/wireless/mwifiex/uap_cmd.c                     |   62 +-
 drivers/net/wireless/mwifiex/uap_event.c                   |  290 ++++++
 drivers/net/wireless/mwifiex/uap_txrx.c                    |  340 +++++++
 drivers/net/wireless/mwifiex/util.c                        |   40 +
 drivers/net/wireless/mwifiex/wmm.c                         |   77 +-
 drivers/net/wireless/mwl8k.c                               |   17 +-
 drivers/net/wireless/orinoco/wext.c                        |    7 +-
 drivers/net/wireless/p54/eeprom.c                          |  108 ++-
 drivers/net/wireless/p54/eeprom.h                          |   12 +
 drivers/net/wireless/p54/lmac.h                            |    4 +-
 drivers/net/wireless/p54/main.c                            |   15 +-
 drivers/net/wireless/p54/p54pci.c                          |   88 +-
 drivers/net/wireless/p54/p54pci.h                          |    1 +
 drivers/net/wireless/p54/txrx.c                            |   15 +-
 drivers/net/wireless/rndis_wlan.c                          |    3 -
 drivers/net/wireless/rt2x00/rt2400pci.c                    |    5 +-
 drivers/net/wireless/rt2x00/rt2400pci.h                    |   27 +-
 drivers/net/wireless/rt2x00/rt2500pci.c                    |    3 +-
 drivers/net/wireless/rt2x00/rt2500pci.h                    |   18 +-
 drivers/net/wireless/rt2x00/rt2500usb.c                    |    5 +-
 drivers/net/wireless/rt2x00/rt2500usb.h                    |   27 +-
 drivers/net/wireless/rt2x00/rt2800.h                       |   52 +-
 drivers/net/wireless/rt2x00/rt2800lib.c                    |  397 ++++++--
 drivers/net/wireless/rt2x00/rt2800lib.h                    |   22 +-
 drivers/net/wireless/rt2x00/rt2800pci.c                    |   83 +-
 drivers/net/wireless/rt2x00/rt2800usb.c                    |   62 +-
 drivers/net/wireless/rt2x00/rt2x00.h                       |   20 +-
 drivers/net/wireless/rt2x00/rt2x00dev.c                    |   35 +-
 drivers/net/wireless/rt2x00/rt2x00mac.c                    |   44 +-
 drivers/net/wireless/rt2x00/rt2x00queue.c                  |   20 +-
 drivers/net/wireless/rt2x00/rt61pci.c                      |   13 +-
 drivers/net/wireless/rt2x00/rt61pci.h                      |   28 +-
 drivers/net/wireless/rt2x00/rt73usb.c                      |    5 +-
 drivers/net/wireless/rt2x00/rt73usb.h                      |   34 +-
 drivers/net/wireless/rtl818x/rtl8180/dev.c                 |    6 +-
 drivers/net/wireless/rtl818x/rtl8187/dev.c                 |    6 +-
 drivers/net/wireless/rtlwifi/Kconfig                       |    8 +-
 drivers/net/wireless/rtlwifi/base.c                        |    3 +-
 drivers/net/wireless/rtlwifi/core.c                        |    8 +-
 drivers/net/wireless/rtlwifi/pci.c                         |   16 +-
 drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c          |   41 +-
 drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c          |    3 +-
 drivers/net/wireless/rtlwifi/rtl8192ce/hw.c                |    4 +-
 drivers/net/wireless/rtlwifi/rtl8192ce/sw.c                |    2 +-
 drivers/net/wireless/rtlwifi/rtl8192ce/trx.c               |    5 +-
 drivers/net/wireless/rtlwifi/rtl8192ce/trx.h               |    1 +
 drivers/net/wireless/rtlwifi/rtl8192cu/trx.c               |    7 +-
 drivers/net/wireless/rtlwifi/rtl8192cu/trx.h               |    4 +-
 drivers/net/wireless/rtlwifi/rtl8192de/dm.c                |   10 +-
 drivers/net/wireless/rtlwifi/rtl8192de/fw.c                |    3 +-
 drivers/net/wireless/rtlwifi/rtl8192de/phy.c               |    2 +-
 drivers/net/wireless/rtlwifi/rtl8192de/trx.c               |    5 +-
 drivers/net/wireless/rtlwifi/rtl8192de/trx.h               |    1 +
 drivers/net/wireless/rtlwifi/rtl8192se/trx.c               |   11 +-
 drivers/net/wireless/rtlwifi/rtl8192se/trx.h               |    1 +
 drivers/net/wireless/rtlwifi/usb.c                         |   17 +-
 drivers/net/wireless/rtlwifi/wifi.h                        |  121 ++-
 drivers/net/wireless/ti/wl1251/main.c                      |    4 +-
 drivers/net/wireless/ti/wl12xx/main.c                      |   79 +-
 drivers/net/wireless/ti/wl12xx/wl12xx.h                    |    7 +
 drivers/net/wireless/ti/wl18xx/debugfs.c                   |    2 +-
 drivers/net/wireless/ti/wl18xx/main.c                      |  129 ++-
 drivers/net/wireless/ti/wl18xx/wl18xx.h                    |    7 +
 drivers/net/wireless/ti/wlcore/cmd.c                       |   21 +-
 drivers/net/wireless/ti/wlcore/cmd.h                       |    5 -
 drivers/net/wireless/ti/wlcore/conf.h                      |    3 +-
 drivers/net/wireless/ti/wlcore/debug.h                     |   16 +-
 drivers/net/wireless/ti/wlcore/debugfs.c                   |   32 +-
 drivers/net/wireless/ti/wlcore/init.c                      |   12 +-
 drivers/net/wireless/ti/wlcore/io.h                        |    4 +-
 drivers/net/wireless/ti/wlcore/main.c                      |  372 ++++---
 drivers/net/wireless/ti/wlcore/ps.c                        |   10 +-
 drivers/net/wireless/ti/wlcore/rx.c                        |    2 +-
 drivers/net/wireless/ti/wlcore/scan.c                      |   20 +-
 drivers/net/wireless/ti/wlcore/spi.c                       |   10 +-
 drivers/net/wireless/ti/wlcore/testmode.c                  |    4 +-
 drivers/net/wireless/ti/wlcore/tx.c                        |  112 ++-
 drivers/net/wireless/ti/wlcore/tx.h                        |    4 +-
 drivers/net/wireless/ti/wlcore/wlcore.h                    |   23 +-
 drivers/net/wireless/ti/wlcore/wlcore_i.h                  |   13 +-
 drivers/net/wireless/wl3501_cs.c                           |    3 +-
 drivers/net/wireless/zd1211rw/zd_mac.c                     |    9 +-
 drivers/net/xen-netfront.c                                 |    2 +-
 drivers/nfc/Kconfig                                        |   14 +-
 drivers/nfc/Makefile                                       |    1 -
 drivers/nfc/nfcwilink.c                                    |   20 +-
 drivers/nfc/pn533.c                                        |  107 +-
 drivers/nfc/pn544.c                                        |  893 -----------------
 drivers/nfc/pn544_hci.c                                    |  177 ++--
 drivers/ptp/ptp_clock.c                                    |   16 +-
 drivers/ptp/ptp_ixp46x.c                                   |    2 +-
 drivers/ptp/ptp_pch.c                                      |    2 +-
 drivers/ptp/ptp_private.h                                  |    1 +
 drivers/s390/net/ctcm_fsms.c                               |    2 +-
 drivers/s390/net/ctcm_main.c                               |    2 +-
 drivers/s390/net/lcs.c                                     |    2 +-
 drivers/s390/net/qeth_core_main.c                          |   78 +-
 drivers/s390/net/qeth_l3_main.c                            |    2 +
 drivers/scsi/scsi_netlink.c                                |  557 +----------
 drivers/scsi/scsi_transport_iscsi.c                        |    7 +-
 drivers/ssb/driver_mipscore.c                              |   28 +-
 drivers/staging/gdm72xx/netlink_k.c                        |    4 +-
 drivers/staging/winbond/wbusb.c                            |    4 +-
 firmware/Makefile                                          |    1 -
 firmware/cxgb3/t3fw-7.10.0.bin.ihex                        | 1935 -------------------------------------
 fs/dlm/netlink.c                                           |    8 +-
 fs/namei.c                                                 |    6 +-
 fs/seq_file.c                                              |    4 +
 include/linux/Kbuild                                       |    2 +
 include/linux/bcma/bcma_driver_chipcommon.h                |  111 +++
 include/linux/bcma/bcma_regs.h                             |    4 +
 include/linux/etherdevice.h                                |   11 +
 include/linux/ethtool.h                                    |   17 +-
 include/linux/filter.h                                     |    7 +
 include/linux/hash.h                                       |   10 +
 include/linux/ieee80211.h                                  |   80 --
 include/linux/if_arp.h                                     |    1 +
 include/linux/if_link.h                                    |   34 +
 include/linux/if_team.h                                    |   11 +-
 include/linux/if_tunnel.h                                  |    3 +
 include/linux/if_vlan.h                                    |    9 +-
 include/linux/inet_diag.h                                  |    1 +
 include/linux/inetdevice.h                                 |   11 +-
 include/linux/ip6_tunnel.h                                 |   17 +
 include/linux/ipv6.h                                       |    1 +
 include/linux/jiffies.h                                    |    6 +
 include/linux/mdio.h                                       |   83 ++
 include/linux/netdevice.h                                  |   51 +-
 include/linux/netfilter.h                                  |   14 +-
 include/linux/netfilter/ipset/ip_set.h                     |   15 +-
 include/linux/netfilter/ipset/ip_set_ahash.h               |  106 +-
 include/linux/netfilter/nf_conntrack_amanda.h              |    1 +
 include/linux/netfilter/nf_conntrack_ftp.h                 |    7 +-
 include/linux/netfilter/nf_conntrack_h323.h                |   15 +-
 include/linux/netfilter/nf_conntrack_irc.h                 |    1 +
 include/linux/netfilter/nf_conntrack_pptp.h                |    2 +
 include/linux/netfilter/nf_conntrack_sip.h                 |   21 +-
 include/linux/netfilter/nf_nat.h                           |    8 +
 include/linux/netfilter/nfnetlink_conntrack.h              |    8 +-
 include/linux/netfilter/nfnetlink_queue.h                  |    1 +
 include/linux/netfilter/xt_time.h                          |    5 +
 include/linux/netfilter_ipv4.h                             |    1 -
 include/linux/netfilter_ipv6/Kbuild                        |    1 +
 include/linux/netfilter_ipv6/ip6t_NPT.h                    |   16 +
 include/linux/netlink.h                                    |   40 +-
 include/linux/nfc.h                                        |   11 +
 include/linux/nl80211.h                                    |   54 +-
 include/linux/of_mdio.h                                    |   33 +
 include/linux/packet_diag.h                                |   72 ++
 include/linux/pps_kernel.h                                 |    9 +
 include/linux/ptp_clock_kernel.h                           |   21 +-
 include/linux/rfkill.h                                     |   31 +
 include/linux/sched.h                                      |    3 +
 include/linux/seq_file.h                                   |   14 +
 include/linux/skbuff.h                                     |    9 +-
 include/linux/snmp.h                                       |   16 +-
 include/linux/ssb/ssb_driver_chipcommon.h                  |    4 +-
 include/linux/stmmac.h                                     |    1 -
 include/linux/tcp.h                                        |   49 +-
 include/linux/tcp_metrics.h                                |   54 ++
 include/linux/tipc_config.h                                |    8 +-
 include/net/addrconf.h                                     |    2 +-
 include/net/arp.h                                          |    3 +-
 include/net/ax25.h                                         |    4 +-
 include/net/bluetooth/bluetooth.h                          |   10 +
 include/net/bluetooth/hci.h                                |   32 +
 include/net/bluetooth/hci_core.h                           |   48 +-
 include/net/bluetooth/l2cap.h                              |   20 +-
 include/net/bluetooth/mgmt.h                               |   16 +
 include/net/bluetooth/smp.h                                |    8 +-
 include/net/cfg80211.h                                     |   68 +-
 include/net/checksum.h                                     |    3 +
 include/net/dst.h                                          |   10 +-
 include/net/genetlink.h                                    |   34 +-
 include/net/gro_cells.h                                    |  103 ++
 include/net/ieee80211_radiotap.h                           |   11 +
 include/net/inet_ecn.h                                     |   76 ++
 include/net/inet_frag.h                                    |    4 +-
 include/net/inet_sock.h                                    |    4 +-
 include/net/ip.h                                           |    2 +
 include/net/ip6_fib.h                                      |    1 +
 include/net/ip6_tunnel.h                                   |   41 +-
 include/net/ip_vs.h                                        |   16 +-
 include/net/ipip.h                                         |    3 +
 include/net/ipv6.h                                         |   38 +-
 include/net/llc.h                                          |    1 -
 include/net/mac80211.h                                     |   99 +-
 include/net/ndisc.h                                        |    3 +-
 include/net/neighbour.h                                    |   14 +-
 include/net/net_namespace.h                                |   15 +
 include/net/netfilter/nf_conntrack_ecache.h                |   32 +-
 include/net/netfilter/nf_conntrack_expect.h                |    2 +-
 include/net/netfilter/nf_conntrack_timeout.h               |   20 +
 include/net/netfilter/nf_nat.h                             |    6 +-
 include/net/netfilter/nf_nat_core.h                        |    5 +-
 include/net/netfilter/nf_nat_helper.h                      |   11 +-
 include/net/netfilter/nf_nat_l3proto.h                     |   52 +
 include/net/netfilter/nf_nat_l4proto.h                     |   72 ++
 include/net/netfilter/nf_nat_protocol.h                    |   67 --
 include/net/netfilter/nf_nat_rule.h                        |   15 -
 include/net/netlink.h                                      |  124 ++-
 include/net/netns/conntrack.h                              |    4 +
 include/net/netns/ipv4.h                                   |    5 +-
 include/net/netns/ipv6.h                                   |    9 +
 include/net/netns/packet.h                                 |    4 +-
 include/net/netns/sctp.h                                   |  131 +++
 include/net/nfc/hci.h                                      |   21 +-
 include/net/nfc/llc.h                                      |   54 ++
 include/net/nfc/nci.h                                      |   29 +
 include/net/nfc/nci_core.h                                 |    5 +
 include/net/nfc/nfc.h                                      |    4 +-
 include/net/nfc/shdlc.h                                    |  107 --
 include/net/request_sock.h                                 |   49 +-
 include/net/sch_generic.h                                  |    3 +-
 include/net/scm.h                                          |   25 +-
 include/net/sctp/sctp.h                                    |   69 +-
 include/net/sctp/sm.h                                      |    8 +-
 include/net/sctp/structs.h                                 |  154 +--
 include/net/snmp.h                                         |   10 +-
 include/net/sock.h                                         |   40 +-
 include/net/tcp.h                                          |   93 +-
 include/net/xfrm.h                                         |    8 +-
 include/scsi/scsi_netlink.h                                |   24 -
 init/Kconfig                                               |   19 -
 kernel/audit.c                                             |   23 +-
 kernel/exit.c                                              |    3 +
 kernel/fork.c                                              |    1 +
 kernel/pid.c                                               |    1 +
 kernel/pid_namespace.c                                     |    2 +
 kernel/taskstats.c                                         |    4 +-
 lib/kobject_uevent.c                                       |    5 +-
 lib/nlattr.c                                               |    4 +
 net/8021q/vlan_core.c                                      |    6 +
 net/Kconfig                                                |    2 +
 net/appletalk/atalk_proc.c                                 |    3 +-
 net/atm/resources.c                                        |    2 +-
 net/ax25/ax25_uid.c                                        |   21 +-
 net/batman-adv/bat_iv_ogm.c                                |   86 +-
 net/batman-adv/bridge_loop_avoidance.c                     |  214 ++--
 net/batman-adv/bridge_loop_avoidance.h                     |   11 +-
 net/batman-adv/debugfs.c                                   |   12 +
 net/batman-adv/gateway_client.c                            |   53 +-
 net/batman-adv/hard-interface.c                            |   13 +-
 net/batman-adv/main.c                                      |   27 +-
 net/batman-adv/main.h                                      |   29 +-
 net/batman-adv/packet.h                                    |   35 +-
 net/batman-adv/routing.c                                   |   85 +-
 net/batman-adv/send.c                                      |    8 +-
 net/batman-adv/soft-interface.c                            |   79 +-
 net/batman-adv/soft-interface.h                            |    5 +-
 net/batman-adv/translation-table.c                         |  416 +++++---
 net/batman-adv/translation-table.h                         |    4 +-
 net/batman-adv/types.h                                     |  120 ++-
 net/batman-adv/unicast.c                                   |   16 +-
 net/batman-adv/vis.c                                       |  144 +--
 net/batman-adv/vis.h                                       |    2 +-
 net/bluetooth/a2mp.c                                       |   16 +-
 net/bluetooth/af_bluetooth.c                               |  139 +++
 net/bluetooth/bnep/sock.c                                  |   22 +-
 net/bluetooth/cmtp/sock.c                                  |   23 +-
 net/bluetooth/hci_conn.c                                   |  100 +-
 net/bluetooth/hci_core.c                                   |   12 +-
 net/bluetooth/hci_event.c                                  |  190 ++--
 net/bluetooth/hci_sock.c                                   |   13 +-
 net/bluetooth/hidp/sock.c                                  |   22 +-
 net/bluetooth/l2cap_core.c                                 |   37 +-
 net/bluetooth/l2cap_sock.c                                 |   22 +-
 net/bluetooth/mgmt.c                                       |   62 +-
 net/bluetooth/rfcomm/sock.c                                |   14 +-
 net/bluetooth/sco.c                                        |   16 +-
 net/bridge/br_fdb.c                                        |   17 +-
 net/bridge/br_netlink.c                                    |    2 +-
 net/bridge/br_private.h                                    |    6 +-
 net/bridge/br_stp_timer.c                                  |    2 +-
 net/bridge/netfilter/ebt_ulog.c                            |    3 +-
 net/bridge/netfilter/ebtable_filter.c                      |    4 +-
 net/bridge/netfilter/ebtable_nat.c                         |    4 +-
 net/can/gw.c                                               |    2 +-
 net/core/dev.c                                             |  116 ++-
 net/core/dev_addr_lists.c                                  |   40 +-
 net/core/dst.c                                             |    2 +-
 net/core/ethtool.c                                         |   12 -
 net/core/fib_rules.c                                       |    6 +-
 net/core/filter.c                                          |   27 +-
 net/core/link_watch.c                                      |    8 +
 net/core/neighbour.c                                       |    8 +-
 net/core/net-sysfs.c                                       |   18 +-
 net/core/netpoll.c                                         |    5 +-
 net/core/netprio_cgroup.c                                  |   41 +-
 net/core/request_sock.c                                    |   95 ++
 net/core/rtnetlink.c                                       |   38 +-
 net/core/scm.c                                             |   44 +-
 net/core/secure_seq.c                                      |    1 +
 net/core/skbuff.c                                          |   86 +-
 net/core/sock.c                                            |   74 +-
 net/core/sock_diag.c                                       |    3 +-
 net/core/utils.c                                           |   20 +
 net/dcb/dcbnl.c                                            |   18 +-
 net/decnet/af_decnet.c                                     |    4 +-
 net/decnet/dn_dev.c                                        |    6 +-
 net/decnet/dn_route.c                                      |   16 +-
 net/decnet/dn_table.c                                      |   12 +-
 net/decnet/netfilter/dn_rtmsg.c                            |    3 +-
 net/ieee802154/6lowpan.c                                   |   53 +-
 net/ieee802154/nl-mac.c                                    |    6 +-
 net/ieee802154/nl-phy.c                                    |    6 +-
 net/ipv4/af_inet.c                                         |   27 +-
 net/ipv4/devinet.c                                         |   67 +-
 net/ipv4/fib_frontend.c                                    |   25 +-
 net/ipv4/fib_semantics.c                                   |    8 +-
 net/ipv4/fib_trie.c                                        |   15 +-
 net/ipv4/igmp.c                                            |   38 +-
 net/ipv4/inet_connection_sock.c                            |   57 +-
 net/ipv4/inet_diag.c                                       |   45 +-
 net/ipv4/inet_fragment.c                                   |    9 +-
 net/ipv4/ip_fragment.c                                     |   13 +-
 net/ipv4/ip_gre.c                                          |  128 ++-
 net/ipv4/ip_output.c                                       |   74 +-
 net/ipv4/ip_vti.c                                          |    5 -
 net/ipv4/ipconfig.c                                        |   43 +-
 net/ipv4/ipip.c                                            |   51 +-
 net/ipv4/ipmr.c                                            |   12 +-
 net/ipv4/netfilter.c                                       |   41 +-
 net/ipv4/netfilter/Kconfig                                 |   90 +-
 net/ipv4/netfilter/Makefile                                |   18 +-
 net/ipv4/netfilter/ipt_MASQUERADE.c                        |   18 +-
 net/ipv4/netfilter/ipt_NETMAP.c                            |   98 --
 net/ipv4/netfilter/ipt_REDIRECT.c                          |  110 ---
 net/ipv4/netfilter/ipt_ULOG.c                              |    3 +-
 net/ipv4/netfilter/ipt_rpfilter.c                          |    2 +-
 net/ipv4/netfilter/iptable_filter.c                        |   10 +-
 net/ipv4/netfilter/iptable_mangle.c                        |   10 +-
 net/ipv4/netfilter/{nf_nat_standalone.c => iptable_nat.c}  |  264 +++--
 net/ipv4/netfilter/iptable_raw.c                           |   10 +-
 net/ipv4/netfilter/iptable_security.c                      |    5 +-
 net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c             |    8 +-
 net/ipv4/netfilter/nf_nat_h323.c                           |   71 +-
 net/ipv4/netfilter/nf_nat_l3proto_ipv4.c                   |  281 ++++++
 net/ipv4/netfilter/nf_nat_pptp.c                           |   21 +-
 net/ipv4/netfilter/nf_nat_proto_gre.c                      |   30 +-
 net/ipv4/netfilter/nf_nat_proto_icmp.c                     |   24 +-
 net/ipv4/netfilter/nf_nat_rule.c                           |  214 ----
 net/ipv4/ping.c                                            |   22 +-
 net/ipv4/proc.c                                            |    4 +
 net/ipv4/raw.c                                             |    4 +-
 net/ipv4/route.c                                           |   30 +-
 net/ipv4/syncookies.c                                      |    1 +
 net/ipv4/sysctl_net_ipv4.c                                 |   87 +-
 net/ipv4/tcp.c                                             |  135 +--
 net/ipv4/tcp_fastopen.c                                    |   83 +-
 net/ipv4/tcp_input.c                                       |  281 +++---
 net/ipv4/tcp_ipv4.c                                        |  332 ++++++-
 net/ipv4/tcp_metrics.c                                     |  354 ++++++-
 net/ipv4/tcp_minisocks.c                                   |   75 +-
 net/ipv4/tcp_output.c                                      |   27 +-
 net/ipv4/tcp_timer.c                                       |   39 +-
 net/ipv4/udp.c                                             |    4 +-
 net/ipv4/udp_diag.c                                        |    9 +-
 net/ipv6/Kconfig                                           |   16 +
 net/ipv6/Makefile                                          |    1 +
 net/ipv6/addrconf.c                                        |   83 +-
 net/ipv6/addrlabel.c                                       |   24 +-
 net/ipv6/ip6_fib.c                                         |   20 +-
 net/ipv6/ip6_flowlabel.c                                   |   47 +-
 net/ipv6/ip6_gre.c                                         | 1770 ++++++++++++++++++++++++++++++++++
 net/ipv6/ip6_output.c                                      |   85 +-
 net/ipv6/ip6_tunnel.c                                      |   91 +-
 net/ipv6/ip6mr.c                                           |   10 +-
 net/ipv6/netfilter.c                                       |    8 +
 net/ipv6/netfilter/Kconfig                                 |   37 +-
 net/ipv6/netfilter/Makefile                                |    6 +
 net/ipv6/netfilter/ip6t_MASQUERADE.c                       |  135 +++
 net/ipv6/netfilter/ip6t_NPT.c                              |  165 ++++
 net/ipv6/netfilter/ip6table_filter.c                       |    4 +-
 net/ipv6/netfilter/ip6table_mangle.c                       |    4 +-
 net/ipv6/netfilter/ip6table_nat.c                          |  321 ++++++
 net/ipv6/netfilter/ip6table_raw.c                          |    4 +-
 net/ipv6/netfilter/ip6table_security.c                     |    5 +-
 net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c             |  137 +--
 net/ipv6/netfilter/nf_conntrack_reasm.c                    |  218 +++--
 net/ipv6/netfilter/nf_nat_l3proto_ipv6.c                   |  288 ++++++
 net/ipv6/netfilter/nf_nat_proto_icmpv6.c                   |   90 ++
 net/ipv6/raw.c                                             |    3 +-
 net/ipv6/reassembly.c                                      |   89 +-
 net/ipv6/route.c                                           |   96 +-
 net/ipv6/sit.c                                             |    6 -
 net/ipv6/syncookies.c                                      |    1 +
 net/ipv6/tcp_ipv6.c                                        |   46 +-
 net/ipv6/udp.c                                             |    3 +-
 net/ipx/ipx_proc.c                                         |    3 +-
 net/irda/irnetlink.c                                       |    2 +-
 net/key/af_key.c                                           |   41 +-
 net/l2tp/Kconfig                                           |    1 +
 net/l2tp/l2tp_eth.c                                        |    3 +-
 net/l2tp/l2tp_netlink.c                                    |   24 +-
 net/llc/llc_proc.c                                         |    2 +-
 net/llc/llc_station.c                                      |  600 +-----------
 net/llc/sysctl_net_llc.c                                   |    7 -
 net/mac80211/aes_cmac.c                                    |    6 +-
 net/mac80211/agg-tx.c                                      |    2 +-
 net/mac80211/cfg.c                                         |  103 +-
 net/mac80211/chan.c                                        |   67 +-
 net/mac80211/debugfs.c                                     |   36 +-
 net/mac80211/driver-ops.h                                  |   11 +-
 net/mac80211/ibss.c                                        |   50 +-
 net/mac80211/ieee80211_i.h                                 |   53 +-
 net/mac80211/iface.c                                       |  316 +++---
 net/mac80211/key.c                                         |    2 +-
 net/mac80211/main.c                                        |   31 +-
 net/mac80211/mesh.c                                        |   49 +-
 net/mac80211/mesh.h                                        |    5 +-
 net/mac80211/mesh_hwmp.c                                   |    2 -
 net/mac80211/mesh_pathtbl.c                                |   44 +-
 net/mac80211/mesh_plink.c                                  |   85 +-
 net/mac80211/mlme.c                                        |  443 +++++----
 net/mac80211/offchannel.c                                  |    9 +-
 net/mac80211/rate.h                                        |    2 +-
 net/mac80211/rx.c                                          |   60 +-
 net/mac80211/scan.c                                        |   53 +-
 net/mac80211/sta_info.c                                    |  123 +--
 net/mac80211/sta_info.h                                    |    2 +
 net/mac80211/status.c                                      |   42 +-
 net/mac80211/trace.h                                       |   11 +-
 net/mac80211/tx.c                                          |   73 +-
 net/mac80211/util.c                                        |  108 ++-
 net/netfilter/Kconfig                                      |   83 +-
 net/netfilter/Makefile                                     |   21 +-
 net/netfilter/core.c                                       |   21 +-
 net/netfilter/ipset/ip_set_bitmap_ip.c                     |   19 +-
 net/netfilter/ipset/ip_set_bitmap_ipmac.c                  |   18 +-
 net/netfilter/ipset/ip_set_bitmap_port.c                   |    9 +-
 net/netfilter/ipset/ip_set_core.c                          |   39 +-
 net/netfilter/ipset/ip_set_hash_ip.c                       |   15 +-
 net/netfilter/ipset/ip_set_hash_ipport.c                   |   24 +-
 net/netfilter/ipset/ip_set_hash_ipportip.c                 |   24 +-
 net/netfilter/ipset/ip_set_hash_ipportnet.c                |   47 +-
 net/netfilter/ipset/ip_set_hash_net.c                      |   25 +-
 net/netfilter/ipset/ip_set_hash_netiface.c                 |   66 +-
 net/netfilter/ipset/ip_set_hash_netport.c                  |   36 +-
 net/netfilter/ipset/ip_set_list_set.c                      |    9 +-
 net/netfilter/ipvs/Kconfig                                 |    3 +-
 net/netfilter/ipvs/ip_vs_app.c                             |   58 +-
 net/netfilter/ipvs/ip_vs_core.c                            |   76 +-
 net/netfilter/ipvs/ip_vs_ctl.c                             |   25 +-
 net/netfilter/ipvs/ip_vs_ftp.c                             |   22 +-
 net/netfilter/ipvs/ip_vs_xmit.c                            |  111 ++-
 net/netfilter/nf_conntrack_amanda.c                        |    5 +-
 net/netfilter/nf_conntrack_core.c                          |   15 +-
 net/netfilter/nf_conntrack_ecache.c                        |    2 +-
 net/netfilter/nf_conntrack_ftp.c                           |   24 +-
 net/netfilter/nf_conntrack_h323_main.c                     |  232 +++--
 net/netfilter/nf_conntrack_irc.c                           |    3 +-
 net/netfilter/nf_conntrack_netlink.c                       |  114 ++-
 net/netfilter/nf_conntrack_pptp.c                          |   18 +-
 net/netfilter/nf_conntrack_proto.c                         |    5 -
 net/netfilter/nf_conntrack_proto_tcp.c                     |    8 +-
 net/netfilter/nf_conntrack_sip.c                           |  143 +--
 net/netfilter/nf_internals.h                               |    4 +-
 net/{ipv4 => }/netfilter/nf_nat_amanda.c                   |    4 +-
 net/{ipv4 => }/netfilter/nf_nat_core.c                     |  679 +++++++------
 net/{ipv4 => }/netfilter/nf_nat_ftp.c                      |   34 +-
 net/{ipv4 => }/netfilter/nf_nat_helper.c                   |  109 +--
 net/{ipv4 => }/netfilter/nf_nat_irc.c                      |   10 +-
 net/{ipv4 => }/netfilter/nf_nat_proto_common.c             |   54 +-
 net/{ipv4 => }/netfilter/nf_nat_proto_dccp.c               |   56 +-
 net/{ipv4 => }/netfilter/nf_nat_proto_sctp.c               |   53 +-
 net/{ipv4 => }/netfilter/nf_nat_proto_tcp.c                |   40 +-
 net/{ipv4 => }/netfilter/nf_nat_proto_udp.c                |   42 +-
 net/{ipv4 => }/netfilter/nf_nat_proto_udplite.c            |   58 +-
 net/{ipv4 => }/netfilter/nf_nat_proto_unknown.c            |   16 +-
 net/{ipv4 => }/netfilter/nf_nat_sip.c                      |  270 +++---
 net/{ipv4 => }/netfilter/nf_nat_tftp.c                     |    1 -
 net/netfilter/nf_queue.c                                   |   10 +-
 net/netfilter/nfnetlink.c                                  |    2 +-
 net/netfilter/nfnetlink_acct.c                             |   16 +-
 net/netfilter/nfnetlink_cthelper.c                         |   17 +-
 net/netfilter/nfnetlink_cttimeout.c                        |   12 +-
 net/netfilter/nfnetlink_log.c                              |   27 +-
 net/netfilter/nfnetlink_queue_core.c                       |   50 +-
 net/netfilter/xt_CT.c                                      |  262 +++--
 net/netfilter/xt_LOG.c                                     |    8 +-
 net/netfilter/xt_NETMAP.c                                  |  165 ++++
 net/netfilter/xt_NFQUEUE.c                                 |    8 +-
 net/netfilter/xt_NOTRACK.c                                 |   53 -
 net/netfilter/xt_REDIRECT.c                                |  190 ++++
 net/netfilter/xt_nat.c                                     |  170 ++++
 net/netfilter/xt_osf.c                                     |    2 +-
 net/netfilter/xt_owner.c                                   |   30 +-
 net/netfilter/xt_recent.c                                  |   13 +-
 net/netfilter/xt_set.c                                     |   22 +
 net/netfilter/xt_socket.c                                  |   12 +-
 net/netfilter/xt_time.c                                    |   24 +-
 net/netlabel/netlabel_cipso_v4.c                           |    2 +-
 net/netlabel/netlabel_mgmt.c                               |    4 +-
 net/netlabel/netlabel_unlabeled.c                          |    2 +-
 net/netlink/af_netlink.c                                   |  216 ++---
 net/netlink/genetlink.c                                    |   48 +-
 net/nfc/core.c                                             |   13 +-
 net/nfc/hci/Makefile                                       |    4 +-
 net/nfc/hci/command.c                                      |   45 +-
 net/nfc/hci/core.c                                         |  336 ++++---
 net/nfc/hci/hci.h                                          |   15 +-
 net/nfc/hci/hcp.c                                          |    6 +-
 net/nfc/hci/llc.c                                          |  170 ++++
 net/nfc/hci/llc.h                                          |   69 ++
 net/nfc/hci/llc_nop.c                                      |   99 ++
 net/nfc/hci/{shdlc.c => llc_shdlc.c}                       |  544 +++++------
 net/nfc/llcp/commands.c                                    |    2 +
 net/nfc/llcp/llcp.c                                        |  131 +--
 net/nfc/llcp/llcp.h                                        |    6 +-
 net/nfc/llcp/sock.c                                        |   93 +-
 net/nfc/nci/core.c                                         |   91 +-
 net/nfc/nci/ntf.c                                          |   52 +
 net/nfc/nci/rsp.c                                          |   14 +
 net/nfc/netlink.c                                          |   68 +-
 net/openvswitch/actions.c                                  |    6 +-
 net/openvswitch/datapath.c                                 |  453 +++++----
 net/openvswitch/datapath.h                                 |   52 +-
 net/openvswitch/dp_notify.c                                |    8 +-
 net/openvswitch/flow.c                                     |   21 +-
 net/openvswitch/flow.h                                     |    3 +-
 net/openvswitch/vport-internal_dev.c                       |    7 +-
 net/openvswitch/vport-netdev.c                             |    2 +-
 net/openvswitch/vport.c                                    |   27 +-
 net/openvswitch/vport.h                                    |   13 +-
 net/packet/Kconfig                                         |    8 +
 net/packet/Makefile                                        |    2 +
 net/packet/af_packet.c                                     |  145 +--
 net/packet/diag.c                                          |  242 +++++
 net/packet/internal.h                                      |  121 +++
 net/phonet/pn_netlink.c                                    |   14 +-
 net/phonet/socket.c                                        |    6 +-
 net/rds/tcp_connect.c                                      |    4 +-
 net/rds/tcp_listen.c                                       |    4 +-
 net/rds/tcp_recv.c                                         |    4 +-
 net/rds/tcp_send.c                                         |    4 +-
 net/rfkill/core.c                                          |   22 +-
 net/sched/act_api.c                                        |   52 +-
 net/sched/cls_api.c                                        |   16 +-
 net/sched/cls_basic.c                                      |    3 +-
 net/sched/cls_cgroup.c                                     |    3 +-
 net/sched/cls_flow.c                                       |   19 +-
 net/sched/cls_fw.c                                         |    3 +-
 net/sched/cls_route.c                                      |    3 +-
 net/sched/cls_rsvp.h                                       |    3 +-
 net/sched/cls_tcindex.c                                    |    3 +-
 net/sched/cls_u32.c                                        |    3 +-
 net/sched/em_meta.c                                        |    2 +-
 net/sched/sch_api.c                                        |   44 +-
 net/sched/sch_drr.c                                        |    2 +-
 net/sched/sch_generic.c                                    |   27 +-
 net/sched/sch_qfq.c                                        |    2 +-
 net/sctp/associola.c                                       |   25 +-
 net/sctp/auth.c                                            |   20 +-
 net/sctp/bind_addr.c                                       |   20 +-
 net/sctp/chunk.c                                           |    2 +-
 net/sctp/endpointola.c                                     |   25 +-
 net/sctp/input.c                                           |  115 ++-
 net/sctp/ipv6.c                                            |   36 +-
 net/sctp/objcnt.c                                          |    8 +-
 net/sctp/output.c                                          |    2 +-
 net/sctp/outqueue.c                                        |   28 +-
 net/sctp/primitive.c                                       |    4 +-
 net/sctp/proc.c                                            |   61 +-
 net/sctp/protocol.c                                        |  454 ++++-----
 net/sctp/sm_make_chunk.c                                   |   61 +-
 net/sctp/sm_sideeffect.c                                   |   26 +-
 net/sctp/sm_statefuns.c                                    |  725 ++++++++------
 net/sctp/sm_statetable.c                                   |   17 +-
 net/sctp/socket.c                                          |  119 ++-
 net/sctp/sysctl.c                                          |  198 ++--
 net/sctp/transport.c                                       |   23 +-
 net/sctp/ulpqueue.c                                        |   18 +-
 net/socket.c                                               |   89 +-
 net/tipc/bearer.c                                          |   21 +-
 net/tipc/config.c                                          |   48 +-
 net/tipc/core.c                                            |   22 +-
 net/tipc/core.h                                            |   18 +-
 net/tipc/eth_media.c                                       |   29 +-
 net/tipc/handler.c                                         |    2 +-
 net/tipc/link.c                                            |    4 +-
 net/tipc/name_table.c                                      |   16 +-
 net/tipc/net.c                                             |    3 +-
 net/tipc/net.h                                             |    2 +-
 net/tipc/netlink.c                                         |    2 +-
 net/tipc/subscr.c                                          |    4 +-
 net/unix/af_unix.c                                         |   17 +-
 net/unix/diag.c                                            |   14 +-
 net/wireless/chan.c                                        |    7 +-
 net/wireless/core.c                                        |   53 +-
 net/wireless/core.h                                        |    2 +-
 net/wireless/mlme.c                                        |   37 +-
 net/wireless/nl80211.c                                     |  266 +++--
 net/wireless/nl80211.h                                     |    5 +
 net/wireless/radiotap.c                                    |    2 +
 net/wireless/reg.c                                         |   45 +-
 net/wireless/scan.c                                        |    2 +-
 net/wireless/util.c                                        |   36 +-
 net/wireless/wext-core.c                                   |    8 +-
 net/xfrm/xfrm_policy.c                                     |   83 +-
 net/xfrm/xfrm_state.c                                      |   12 +-
 net/xfrm/xfrm_user.c                                       |   77 +-
 security/selinux/netlink.c                                 |    5 +-
 1000 files changed, 43058 insertions(+), 22065 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/net/can/c_can.txt
 create mode 100644 Documentation/devicetree/bindings/net/cpsw.txt
 create mode 100644 Documentation/devicetree/bindings/net/davinci-mdio.txt
 create mode 100644 Documentation/devicetree/bindings/net/mdio-mux-mmioreg.txt
 create mode 100644 Documentation/networking/vxlan.txt
 create mode 100644 drivers/infiniband/ulp/ipoib/ipoib_netlink.c
 delete mode 100644 drivers/net/ethernet/freescale/fsl_pq_mdio.h
 create mode 100644 drivers/net/ethernet/freescale/xgmac_mdio.c
 create mode 100644 drivers/net/ethernet/intel/ixgbe/ixgbe_debugfs.c
 delete mode 100644 drivers/net/ethernet/mipsnet.c
 create mode 100644 drivers/net/ethernet/sfc/ptp.c
 rename drivers/{ => net}/ieee802154/Kconfig (76%)
 rename drivers/{ => net}/ieee802154/Makefile (74%)
 rename drivers/{ => net}/ieee802154/at86rf230.c (98%)
 rename drivers/{ => net}/ieee802154/fakehard.c (99%)
 rename drivers/{ => net}/ieee802154/fakelb.c (100%)
 create mode 100644 drivers/net/ieee802154/mrf24j40.c
 create mode 100644 drivers/net/phy/mdio-mux-mmioreg.c
 create mode 100644 drivers/net/vxlan.c
 create mode 100644 drivers/net/wireless/ath/ath9k/ar9565_1p0_initvals.h
 create mode 100644 drivers/net/wireless/b43/radio_2057.c
 create mode 100644 drivers/net/wireless/b43/radio_2057.h
 create mode 100644 drivers/net/wireless/mwifiex/uap_event.c
 create mode 100644 drivers/net/wireless/mwifiex/uap_txrx.c
 delete mode 100644 drivers/nfc/pn544.c
 delete mode 100644 firmware/cxgb3/t3fw-7.10.0.bin.ihex
 create mode 100644 include/linux/netfilter_ipv6/ip6t_NPT.h
 create mode 100644 include/linux/packet_diag.h
 create mode 100644 include/linux/tcp_metrics.h
 create mode 100644 include/net/gro_cells.h
 create mode 100644 include/net/netfilter/nf_nat_l3proto.h
 create mode 100644 include/net/netfilter/nf_nat_l4proto.h
 delete mode 100644 include/net/netfilter/nf_nat_protocol.h
 delete mode 100644 include/net/netfilter/nf_nat_rule.h
 create mode 100644 include/net/netns/sctp.h
 create mode 100644 include/net/nfc/llc.h
 delete mode 100644 include/net/nfc/shdlc.h
 delete mode 100644 net/ipv4/netfilter/ipt_NETMAP.c
 delete mode 100644 net/ipv4/netfilter/ipt_REDIRECT.c
 rename net/ipv4/netfilter/{nf_nat_standalone.c => iptable_nat.c} (52%)
 create mode 100644 net/ipv4/netfilter/nf_nat_l3proto_ipv4.c
 delete mode 100644 net/ipv4/netfilter/nf_nat_rule.c
 create mode 100644 net/ipv6/ip6_gre.c
 create mode 100644 net/ipv6/netfilter/ip6t_MASQUERADE.c
 create mode 100644 net/ipv6/netfilter/ip6t_NPT.c
 create mode 100644 net/ipv6/netfilter/ip6table_nat.c
 create mode 100644 net/ipv6/netfilter/nf_nat_l3proto_ipv6.c
 create mode 100644 net/ipv6/netfilter/nf_nat_proto_icmpv6.c
 rename net/{ipv4 => }/netfilter/nf_nat_amanda.c (96%)
 rename net/{ipv4 => }/netfilter/nf_nat_core.c (51%)
 rename net/{ipv4 => }/netfilter/nf_nat_ftp.c (79%)
 rename net/{ipv4 => }/netfilter/nf_nat_helper.c (82%)
 rename net/{ipv4 => }/netfilter/nf_nat_irc.c (89%)
 rename net/{ipv4 => }/netfilter/nf_nat_proto_common.c (62%)
 rename net/{ipv4 => }/netfilter/nf_nat_proto_dccp.c (61%)
 rename net/{ipv4 => }/netfilter/nf_nat_proto_sctp.c (61%)
 rename net/{ipv4 => }/netfilter/nf_nat_proto_tcp.c (65%)
 rename net/{ipv4 => }/netfilter/nf_nat_proto_udp.c (60%)
 rename net/{ipv4 => }/netfilter/nf_nat_proto_udplite.c (58%)
 rename net/{ipv4 => }/netfilter/nf_nat_proto_unknown.c (76%)
 rename net/{ipv4 => }/netfilter/nf_nat_sip.c (62%)
 rename net/{ipv4 => }/netfilter/nf_nat_tftp.c (97%)
 create mode 100644 net/netfilter/xt_NETMAP.c
 delete mode 100644 net/netfilter/xt_NOTRACK.c
 create mode 100644 net/netfilter/xt_REDIRECT.c
 create mode 100644 net/netfilter/xt_nat.c
 create mode 100644 net/nfc/hci/llc.c
 create mode 100644 net/nfc/hci/llc.h
 create mode 100644 net/nfc/hci/llc_nop.c
 rename net/nfc/hci/{shdlc.c => llc_shdlc.c} (54%)
 create mode 100644 net/packet/diag.c
 create mode 100644 net/packet/internal.h

^ permalink raw reply

* [PATCH v2] iproute2: add support for tcp_metrics
From: Julian Anastasov @ 2012-10-02 20:45 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev

	ip tcp_metrics/tcpmetrics

	We support get/del for single entry and dump for
show/flush.

Signed-off-by: Julian Anastasov <ja@ssi.bg>
---

	Sorry, forgot to test it with the latest GENL macros.
This version should work.

v2: put family in req.n.nlmsg_type

 include/linux/tcp_metrics.h |   54 ++++++
 ip/Makefile                 |    2 +-
 ip/ip.c                     |    4 +-
 ip/ip_common.h              |    1 +
 ip/tcp_metrics.c            |  427 +++++++++++++++++++++++++++++++++++++++++++
 man/man8/Makefile           |    3 +-
 man/man8/ip-tcp_metrics.8   |  143 +++++++++++++++
 man/man8/ip.8               |    7 +-
 8 files changed, 637 insertions(+), 4 deletions(-)
 create mode 100644 include/linux/tcp_metrics.h
 create mode 100644 ip/tcp_metrics.c
 create mode 100644 man/man8/ip-tcp_metrics.8

diff --git a/include/linux/tcp_metrics.h b/include/linux/tcp_metrics.h
new file mode 100644
index 0000000..cb5157b
--- /dev/null
+++ b/include/linux/tcp_metrics.h
@@ -0,0 +1,54 @@
+/* tcp_metrics.h - TCP Metrics Interface */
+
+#ifndef _LINUX_TCP_METRICS_H
+#define _LINUX_TCP_METRICS_H
+
+#include <linux/types.h>
+
+/* NETLINK_GENERIC related info
+ */
+#define TCP_METRICS_GENL_NAME		"tcp_metrics"
+#define TCP_METRICS_GENL_VERSION	0x1
+
+enum tcp_metric_index {
+	TCP_METRIC_RTT,
+	TCP_METRIC_RTTVAR,
+	TCP_METRIC_SSTHRESH,
+	TCP_METRIC_CWND,
+	TCP_METRIC_REORDERING,
+
+	/* Always last.  */
+	__TCP_METRIC_MAX,
+};
+
+#define TCP_METRIC_MAX	(__TCP_METRIC_MAX - 1)
+
+enum {
+	TCP_METRICS_ATTR_UNSPEC,
+	TCP_METRICS_ATTR_ADDR_IPV4,		/* u32 */
+	TCP_METRICS_ATTR_ADDR_IPV6,		/* binary */
+	TCP_METRICS_ATTR_AGE,			/* msecs */
+	TCP_METRICS_ATTR_TW_TSVAL,		/* u32, raw, rcv tsval */
+	TCP_METRICS_ATTR_TW_TS_STAMP,		/* s32, sec age */
+	TCP_METRICS_ATTR_VALS,			/* nested +1, u32 */
+	TCP_METRICS_ATTR_FOPEN_MSS,		/* u16 */
+	TCP_METRICS_ATTR_FOPEN_SYN_DROPS,	/* u16, count of drops */
+	TCP_METRICS_ATTR_FOPEN_SYN_DROP_TS,	/* msecs age */
+	TCP_METRICS_ATTR_FOPEN_COOKIE,		/* binary */
+
+	__TCP_METRICS_ATTR_MAX,
+};
+
+#define TCP_METRICS_ATTR_MAX	(__TCP_METRICS_ATTR_MAX - 1)
+
+enum {
+	TCP_METRICS_CMD_UNSPEC,
+	TCP_METRICS_CMD_GET,
+	TCP_METRICS_CMD_DEL,
+
+	__TCP_METRICS_CMD_MAX,
+};
+
+#define TCP_METRICS_CMD_MAX	(__TCP_METRICS_CMD_MAX - 1)
+
+#endif /* _LINUX_TCP_METRICS_H */
diff --git a/ip/Makefile b/ip/Makefile
index 6a518f8..e3c991f 100644
--- a/ip/Makefile
+++ b/ip/Makefile
@@ -3,7 +3,7 @@ IPOBJ=ip.o ipaddress.o ipaddrlabel.o iproute.o iprule.o ipnetns.o \
     ipmaddr.o ipmonitor.o ipmroute.o ipprefix.o iptuntap.o \
     ipxfrm.o xfrm_state.o xfrm_policy.o xfrm_monitor.o \
     iplink_vlan.o link_veth.o link_gre.o iplink_can.o \
-    iplink_macvlan.o iplink_macvtap.o ipl2tp.o link_vti.o
+    iplink_macvlan.o iplink_macvtap.o ipl2tp.o link_vti.o tcp_metrics.o
 
 RTMONOBJ=rtmon.o
 
diff --git a/ip/ip.c b/ip/ip.c
index df06d3e..e0f7e60 100644
--- a/ip/ip.c
+++ b/ip/ip.c
@@ -45,7 +45,7 @@ static void usage(void)
 "       ip [ -force ] -batch filename\n"
 "where  OBJECT := { link | addr | addrlabel | route | rule | neigh | ntable |\n"
 "                   tunnel | tuntap | maddr | mroute | mrule | monitor | xfrm |\n"
-"                   netns | l2tp }\n"
+"                   netns | l2tp | tcp_metrics }\n"
 "       OPTIONS := { -V[ersion] | -s[tatistics] | -d[etails] | -r[esolve] |\n"
 "                    -f[amily] { inet | inet6 | ipx | dnet | bridge | link } |\n"
 "                    -l[oops] { maximum-addr-flush-attempts } |\n"
@@ -78,6 +78,8 @@ static const struct cmd {
 	{ "tunl",	do_iptunnel },
 	{ "tuntap",	do_iptuntap },
 	{ "tap",	do_iptuntap },
+	{ "tcpmetrics",	do_tcp_metrics },
+	{ "tcp_metrics",do_tcp_metrics },
 	{ "monitor",	do_ipmonitor },
 	{ "xfrm",	do_xfrm },
 	{ "mroute",	do_multiroute },
diff --git a/ip/ip_common.h b/ip/ip_common.h
index 5fa2cc0..2fd66b7 100644
--- a/ip/ip_common.h
+++ b/ip/ip_common.h
@@ -42,6 +42,7 @@ extern int do_multirule(int argc, char **argv);
 extern int do_netns(int argc, char **argv);
 extern int do_xfrm(int argc, char **argv);
 extern int do_ipl2tp(int argc, char **argv);
+extern int do_tcp_metrics(int argc, char **argv);
 
 static inline int rtm_get_table(struct rtmsg *r, struct rtattr **tb)
 {
diff --git a/ip/tcp_metrics.c b/ip/tcp_metrics.c
new file mode 100644
index 0000000..1420d54
--- /dev/null
+++ b/ip/tcp_metrics.c
@@ -0,0 +1,427 @@
+/*
+ * tcp_metrics.c	"ip tcp_metrics/tcpmetrics"
+ *
+ *		This program is free software; you can redistribute it and/or
+ *		modify it under the terms of the GNU General Public License
+ *		version 2 as published by the Free Software Foundation;
+ *
+ * Authors:	Julian Anastasov <ja@ssi.bg>, August 2012
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <arpa/inet.h>
+#include <sys/ioctl.h>
+#include <linux/if.h>
+
+#include <linux/genetlink.h>
+#include <linux/tcp_metrics.h>
+
+#include "utils.h"
+#include "ip_common.h"
+#include "libgenl.h"
+
+static void usage(void)
+{
+	fprintf(stderr, "Usage: ip tcp_metrics/tcpmetrics { COMMAND | help }\n");
+	fprintf(stderr, "       ip tcp_metrics { show | flush } SELECTOR\n");
+	fprintf(stderr, "       ip tcp_metrics delete [ address ] ADDRESS\n");
+	fprintf(stderr, "SELECTOR := [ [ address ] PREFIX ]\n");
+	exit(-1);
+}
+
+/* netlink socket */
+static struct rtnl_handle grth = { .fd = -1 };
+static int genl_family = -1;
+
+#define TCPM_REQUEST(_req, _bufsiz, _cmd, _flags) \
+	GENL_REQUEST(_req, _bufsiz, genl_family, 0, \
+		     TCP_METRICS_GENL_VERSION, _cmd, _flags)
+
+#define CMD_LIST	0x0001	/* list, lst, show		*/
+#define CMD_DEL		0x0002	/* delete, remove		*/
+#define CMD_FLUSH	0x0004	/* flush			*/
+
+static struct {
+	char	*name;
+	int	code;
+} cmds[] = {
+	{	"list",		CMD_LIST	},
+	{	"lst",		CMD_LIST	},
+	{	"show",		CMD_LIST	},
+	{	"delete",	CMD_DEL		},
+	{	"remove",	CMD_DEL		},
+	{	"flush",	CMD_FLUSH	},
+};
+
+static char *metric_name[TCP_METRIC_MAX + 1] = {
+	[TCP_METRIC_RTT]		= "rtt",
+	[TCP_METRIC_RTTVAR]		= "rttvar",
+	[TCP_METRIC_SSTHRESH]		= "ssthresh",
+	[TCP_METRIC_CWND]		= "cwnd",
+	[TCP_METRIC_REORDERING]		= "reordering",
+};
+
+static struct
+{
+	int flushed;
+	char *flushb;
+	int flushp;
+	int flushe;
+	int cmd;
+	inet_prefix addr;
+} f;
+
+static int flush_update(void)
+{
+	if (rtnl_send_check(&grth, f.flushb, f.flushp) < 0) {
+		perror("Failed to send flush request\n");
+		return -1;
+	}
+	f.flushp = 0;
+	return 0;
+}
+
+static int process_msg(const struct sockaddr_nl *who, struct nlmsghdr *n,
+		       void *arg)
+{
+	FILE *fp = (FILE *) arg;
+	struct genlmsghdr *ghdr;
+	struct rtattr *attrs[TCP_METRICS_ATTR_MAX + 1], *a;
+	int len = n->nlmsg_len;
+	char abuf[256];
+	inet_prefix addr;
+	int family, i, atype;
+
+	if (n->nlmsg_type != genl_family)
+		return -1;
+
+	len -= NLMSG_LENGTH(GENL_HDRLEN);
+	if (len < 0)
+		return -1;
+
+	ghdr = NLMSG_DATA(n);
+	if (ghdr->cmd != TCP_METRICS_CMD_GET)
+		return 0;
+
+	parse_rtattr(attrs, TCP_METRICS_ATTR_MAX, (void *) ghdr + GENL_HDRLEN,
+		     len);
+
+	a = attrs[TCP_METRICS_ATTR_ADDR_IPV4];
+	if (a) {
+		if (f.addr.family && f.addr.family != AF_INET)
+			return 0;
+		memcpy(&addr.data, RTA_DATA(a), 4);
+		addr.bytelen = 4;
+		family = AF_INET;
+		atype = TCP_METRICS_ATTR_ADDR_IPV4;
+	} else {
+		a = attrs[TCP_METRICS_ATTR_ADDR_IPV6];
+		if (a) {
+			if (f.addr.family && f.addr.family != AF_INET6)
+				return 0;
+			memcpy(&addr.data, RTA_DATA(a), 16);
+			addr.bytelen = 16;
+			family = AF_INET6;
+			atype = TCP_METRICS_ATTR_ADDR_IPV6;
+		} else
+			return 0;
+	}
+
+	if (f.addr.family && f.addr.bitlen >= 0 &&
+	    inet_addr_match(&addr, &f.addr, f.addr.bitlen))
+		return 0;
+
+	if (f.flushb) {
+		struct nlmsghdr *fn;
+		TCPM_REQUEST(req2, 128, TCP_METRICS_CMD_DEL, NLM_F_REQUEST);
+
+		addattr_l(&req2.n, sizeof(req2), atype, &addr.data,
+			  addr.bytelen);
+
+		if (NLMSG_ALIGN(f.flushp) + req2.n.nlmsg_len > f.flushe) {
+			if (flush_update())
+				return -1;
+		}
+		fn = (struct nlmsghdr *) (f.flushb + NLMSG_ALIGN(f.flushp));
+		memcpy(fn, &req2.n, req2.n.nlmsg_len);
+		fn->nlmsg_seq = ++grth.seq;
+		f.flushp = (((char *) fn) + req2.n.nlmsg_len) - f.flushb;
+		f.flushed++;
+		if (show_stats < 2)
+			return 0;
+	}
+
+	if (f.cmd & (CMD_DEL | CMD_FLUSH))
+		fprintf(fp, "Deleted ");
+
+	fprintf(fp, "%s",
+		format_host(family, RTA_PAYLOAD(a), &addr.data,
+			    abuf, sizeof(abuf)));
+
+	a = attrs[TCP_METRICS_ATTR_AGE];
+	if (a) {
+		__u64 val = rta_getattr_u64(a);
+
+		fprintf(fp, " age %llu.%03llusec",
+			val / 1000, val % 1000);
+	}
+
+	a = attrs[TCP_METRICS_ATTR_TW_TS_STAMP];
+	if (a) {
+		__s32 val = (__s32) rta_getattr_u32(a);
+		__u32 tsval;
+
+		a = attrs[TCP_METRICS_ATTR_TW_TSVAL];
+		tsval = a ? rta_getattr_u32(a) : 0;
+		fprintf(fp, " tw_ts %u/%dsec ago", tsval, val);
+	}
+
+	a = attrs[TCP_METRICS_ATTR_VALS];
+	if (a) {
+		struct rtattr *m[TCP_METRIC_MAX + 1 + 1];
+
+		parse_rtattr_nested(m, TCP_METRIC_MAX + 1, a);
+
+		for (i = 0; i < TCP_METRIC_MAX + 1; i++) {
+			__u32 val;
+
+			a = m[i + 1];
+			if (!a)
+				continue;
+			if (metric_name[i])
+				fprintf(fp, " %s ", metric_name[i]);
+			else
+				fprintf(fp, " metric_%d ", i);
+			val = rta_getattr_u32(a);
+			switch (i) {
+			case TCP_METRIC_RTT:
+			case TCP_METRIC_RTTVAR:
+				fprintf(fp, "%ums", val);
+				break;
+			case TCP_METRIC_SSTHRESH:
+			case TCP_METRIC_CWND:
+			case TCP_METRIC_REORDERING:
+			default:
+				fprintf(fp, "%u", val);
+				break;
+			}
+		}
+	}
+
+	a = attrs[TCP_METRICS_ATTR_FOPEN_MSS];
+	if (a)
+		fprintf(fp, " fo_mss %u", rta_getattr_u16(a));
+
+	a = attrs[TCP_METRICS_ATTR_FOPEN_SYN_DROPS];
+	if (a) {
+		__u16 syn_loss = rta_getattr_u16(a);
+		__u64 ts;
+
+		a = attrs[TCP_METRICS_ATTR_FOPEN_SYN_DROP_TS];
+		ts = a ? rta_getattr_u64(a) : 0;
+
+		fprintf(fp, " fo_syn_drops %u/%llu.%03llusec ago",
+			syn_loss, ts / 1000, ts % 1000);
+	}
+
+	a = attrs[TCP_METRICS_ATTR_FOPEN_COOKIE];
+	if (a) {
+		char cookie[32 + 1];
+		unsigned char *ptr = RTA_DATA(a);
+		int i, max = RTA_PAYLOAD(a);
+
+		if (max > 16)
+			max = 16;
+		cookie[0] = 0;
+		for (i = 0; i < max; i++)
+			sprintf(cookie + i + i, "%02x", ptr[i]);
+		fprintf(fp, " fo_cookie %s", cookie);
+	}
+
+	fprintf(fp, "\n");
+
+	fflush(fp);
+	return 0;
+}
+
+static int tcpm_do_cmd(int cmd, int argc, char **argv)
+{
+	TCPM_REQUEST(req, 1024, TCP_METRICS_CMD_GET, NLM_F_REQUEST);
+	int atype = -1;
+	int ack;
+
+	memset(&f, 0, sizeof(f));
+	f.addr.bitlen = -1;
+	f.addr.family = preferred_family;
+
+	switch (preferred_family) {
+	case AF_UNSPEC:
+	case AF_INET:
+	case AF_INET6:
+		break;
+	default:
+		fprintf(stderr, "Unsupported family:%d\n", preferred_family);
+		return -1;
+	}
+
+	for (; argc > 0; argc--, argv++) {
+		char *who = "address";
+
+		if (strcmp(*argv, "addr") == 0 ||
+		    strcmp(*argv, "address") == 0) {
+			who = *argv;
+			NEXT_ARG();
+		}
+		if (matches(*argv, "help") == 0)
+			usage();
+		if (f.addr.bitlen >= 0)
+			duparg2(who, *argv);
+
+		get_prefix(&f.addr, *argv, preferred_family);
+		if (f.addr.bytelen && f.addr.bytelen * 8 == f.addr.bitlen) {
+			if (f.addr.family == AF_INET)
+				atype = TCP_METRICS_ATTR_ADDR_IPV4;
+			else if (f.addr.family == AF_INET6)
+				atype = TCP_METRICS_ATTR_ADDR_IPV6;
+		}
+		if ((CMD_DEL & cmd) && atype < 0) {
+			fprintf(stderr, "Error: a specific IP address is expected rather than \"%s\"\n",
+				*argv);
+			return -1;
+		}
+
+		argc--; argv++;
+	}
+
+	if (cmd == CMD_DEL && atype < 0)
+		missarg("address");
+
+	/* flush for exact address ? Single del */
+	if (cmd == CMD_FLUSH && atype >= 0)
+		cmd = CMD_DEL;
+
+	/* flush for all addresses ? Single del without address */
+	if (cmd == CMD_FLUSH && f.addr.bitlen <= 0 &&
+	    preferred_family == AF_UNSPEC) {
+		cmd = CMD_DEL;
+		req.g.cmd = TCP_METRICS_CMD_DEL;
+		ack = 1;
+	} else if (cmd == CMD_DEL) {
+		req.g.cmd = TCP_METRICS_CMD_DEL;
+		ack = 1;
+	} else {	/* CMD_FLUSH, CMD_LIST */
+		ack = 0;
+	}
+
+	if (genl_family < 0) {
+		if (rtnl_open_byproto(&grth, 0, NETLINK_GENERIC) < 0) {
+			fprintf(stderr, "Cannot open generic netlink socket\n");
+			exit(1);
+		}
+		genl_family = genl_resolve_family(&grth,
+						  TCP_METRICS_GENL_NAME);
+		if (genl_family < 0)
+			exit(1);
+		req.n.nlmsg_type = genl_family;
+	}
+
+	if (!(cmd & CMD_FLUSH) && (atype >= 0 || (cmd & CMD_DEL))) {
+		if (ack)
+			req.n.nlmsg_flags |= NLM_F_ACK;
+		if (atype >= 0)
+			addattr_l(&req.n, sizeof(req), atype, &f.addr.data,
+				  f.addr.bytelen);
+	} else {
+		req.n.nlmsg_flags |= NLM_F_DUMP;
+	}
+
+	f.cmd = cmd;
+	if (cmd & CMD_FLUSH) {
+		int round = 0;
+		char flushb[4096-512];
+
+		f.flushb = flushb;
+		f.flushp = 0;
+		f.flushe = sizeof(flushb);
+
+		for (;;) {
+			req.n.nlmsg_seq = grth.dump = ++grth.seq;
+			if (rtnl_send(&grth, &req, req.n.nlmsg_len) < 0) {
+				perror("Failed to send flush request");
+				exit(1);
+			}
+			f.flushed = 0;
+			if (rtnl_dump_filter(&grth, process_msg, stdout) < 0) {
+				fprintf(stderr, "Flush terminated\n");
+				exit(1);
+			}
+			if (f.flushed == 0) {
+				if (round == 0) {
+					fprintf(stderr, "Nothing to flush.\n");
+				} else if (show_stats)
+					printf("*** Flush is complete after %d round%s ***\n",
+					       round, round > 1 ? "s" : "");
+				fflush(stdout);
+				return 0;
+			}
+			round++;
+			if (flush_update() < 0)
+				exit(1);
+			if (show_stats) {
+				printf("\n*** Round %d, deleting %d entries ***\n",
+				       round, f.flushed);
+				fflush(stdout);
+			}
+		}
+		return 0;
+	}
+
+	if (ack) {
+		if (rtnl_talk(&grth, &req.n, 0, 0, NULL) < 0)
+			return -2;
+	} else if (atype >= 0) {
+		if (rtnl_talk(&grth, &req.n, 0, 0, &req.n) < 0)
+			return -2;
+		if (process_msg(NULL, &req.n, stdout) < 0) {
+			fprintf(stderr, "Dump terminated\n");
+			exit(1);
+		}
+	} else {
+		req.n.nlmsg_seq = grth.dump = ++grth.seq;
+		if (rtnl_send(&grth, &req, req.n.nlmsg_len) < 0) {
+			perror("Failed to send dump request");
+			exit(1);
+		}
+
+		if (rtnl_dump_filter(&grth, process_msg, stdout) < 0) {
+			fprintf(stderr, "Dump terminated\n");
+			exit(1);
+		}
+	}
+	return 0;
+}
+
+int do_tcp_metrics(int argc, char **argv)
+{
+	int i;
+
+	if (argc < 1)
+		return tcpm_do_cmd(CMD_LIST, 0, NULL);
+	for (i = 0; i < ARRAY_SIZE(cmds); i++) {
+		if (matches(argv[0], cmds[i].name) == 0)
+			return tcpm_do_cmd(cmds[i].code, argc-1, argv+1);
+	}
+	if (matches(argv[0], "help") == 0)
+		usage();
+
+	fprintf(stderr, "Command \"%s\" is unknown, "
+			"try \"ip tcp_metrics help\".\n", *argv);
+	exit(-1);
+}
+
diff --git a/man/man8/Makefile b/man/man8/Makefile
index 4ed3eab..aaf1729 100644
--- a/man/man8/Makefile
+++ b/man/man8/Makefile
@@ -8,7 +8,8 @@ MAN8PAGES = $(TARGETS) ip.8 arpd.8 lnstat.8 routel.8 rtacct.8 rtmon.8 ss.8 \
 	bridge.8 rtstat.8 ctstat.8 nstat.8 routef.8 \
 	ip-address.8 ip-addrlabel.8 ip-l2tp.8 ip-link.8 \
 	ip-maddress.8 ip-monitor.8 ip-mroute.8 ip-neighbour.8 \
-	ip-netns.8 ip-ntable.8 ip-route.8 ip-rule.8 ip-tunnel.8 ip-xfrm.8
+	ip-netns.8 ip-ntable.8 ip-route.8 ip-rule.8 ip-tunnel.8 ip-xfrm.8 \
+	ip-tcp_metrics.8
 
 all: $(TARGETS)
 
diff --git a/man/man8/ip-tcp_metrics.8 b/man/man8/ip-tcp_metrics.8
new file mode 100644
index 0000000..1aa4d45
--- /dev/null
+++ b/man/man8/ip-tcp_metrics.8
@@ -0,0 +1,143 @@
+.TH "IP\-TCP_METRICS" 8 "23 Aug 2012" "iproute2" "Linux"
+.SH "NAME"
+ip-tcp_metrics \- management for TCP Metrics
+.SH "SYNOPSIS"
+.sp
+.ad l
+.in +8
+.ti -8
+.B ip
+.RI "[ " OPTIONS " ]"
+.B tcp_metrics
+.RI "{ " COMMAND " | "
+.BR help " }"
+.sp
+
+.ti -8
+.BR "ip tcp_metrics" " { " show " | " flush " }
+.IR SELECTOR
+
+.ti -8
+.BR "ip tcp_metrics delete " [ " address " ]
+.IR ADDRESS
+
+.ti -8
+.IR SELECTOR " := "
+.RB "[ [ " address " ] "
+.IR PREFIX " ]"
+
+.SH "DESCRIPTION"
+.B ip tcp_metrics
+is used to manipulate entries in the kernel that keep TCP information
+for IPv4 and IPv6 destinations. The entries are created when
+TCP sockets want to share information for destinations and are
+stored in a cache keyed by the destination address. The saved
+information may include values for metrics (initially obtained from
+routes), recent TSVAL for TIME-WAIT recycling purposes, state for the
+Fast Open feature, etc.
+For performance reasons the cache can not grow above configured limit
+and the older entries are replaced with fresh information, sometimes
+reclaimed and used for new destinations. The kernel never removes
+entries, they can be flushed only with this tool.
+
+.SS ip tcp_metrics show - show cached entries
+
+.TP
+.BI address " PREFIX " (default)
+IPv4/IPv6 prefix or address. If no prefix is provided all entries are shown.
+
+.LP
+The output may contain the following information:
+
+.BI age " <S.MMM>" sec
+- time after the entry was created, reset or updated with metrics
+from sockets. The entry is reset and refreshed on use with metrics from
+route if the metrics are not updated in last hour. Not all cached values
+reset the age on update.
+
+.BI cwnd " <N>"
+- CWND metric value
+
+.BI fo_cookie " <HEX-STRING>"
+- Cookie value received in SYN-ACK to be used by Fast Open for next SYNs
+
+.BI fo_mss " <N>"
+- MSS value received in SYN-ACK to be used by Fast Open for next SYNs
+
+.BI fo_syn_drops " <N>/<S.MMM>" "sec ago"
+- Number of drops of initial outgoing Fast Open SYNs with data
+detected by monitoring the received SYN-ACK after SYN retransmission.
+The seconds show the time after last SYN drop and together with
+the drop count can be used to disable Fast Open for some time.
+
+.BI reordering " <N>"
+- Reordering metric value
+
+.BI rtt " <N>" ms
+- RTT metric value
+
+.BI rttvar " <N>" ms
+- RTTVAR metric value
+
+.BI ssthresh " <SSTHRESH>"
+- SSTHRESH metric value
+
+.BI tw_ts " <TSVAL>/<SEC>" "sec ago"
+- recent TSVAL and the seconds after saving it into TIME-WAIT socket
+
+.SS ip tcp_metrics delete - delete single entry
+
+.TP
+.BI address " ADDRESS " (default)
+IPv4/IPv6 address. The address is a required argument.
+
+.SS ip tcp_metrics flush - flush entries
+This command flushes the entries selected by some criteria.
+
+.PP
+This command has the same arguments as
+.B show.
+
+.SH "EXAMPLES"
+.PP
+ip tcp_metrics show address 192.168.0.0/24
+.RS 4
+Shows the entries for destinations from subnet
+.RE
+.PP
+ip tcp_metrics show 192.168.0.0/24
+.RS 4
+The same but address keyword is optional
+.RE
+.PP
+ip tcp_metrics
+.RS 4
+Show all is the default action
+.RE
+.PP
+ip tcp_metrics delete 192.168.0.1
+.RS 4
+Removes the entry for 192.168.0.1 from cache.
+.RE
+.PP
+ip tcp_metrics flush 192.168.0.0/24
+.RS 4
+Removes entries for destinations from subnet
+.RE
+.PP
+ip tcp_metrics flush all
+.RS 4
+Removes all entries from cache
+.RE
+.PP
+ip -6 tcp_metrics flush all
+.RS 4
+Removes all IPv6 entries from cache keeping the IPv4 entries.
+.RE
+
+.SH SEE ALSO
+.br
+.BR ip (8)
+
+.SH AUTHOR
+Original Manpage by Julian Anastasov <ja@ssi.bg>
diff --git a/man/man8/ip.8 b/man/man8/ip.8
index 4db8a67..9063049 100644
--- a/man/man8/ip.8
+++ b/man/man8/ip.8
@@ -15,7 +15,7 @@ ip \- show / manipulate routing, devices, policy routing and tunnels
 .IR OBJECT " := { "
 .BR link " | " addr " | " addrlabel " | " route " | " rule " | " neigh " | "\
  ntable " | " tunnel " | " tuntap " | " maddr " | "  mroute " | " mrule " | "\
- monitor " | " xfrm " | " netns " | "  l2tp " }"
+ monitor " | " xfrm " | " netns " | "  l2tp " | "  tcp_metrics " }"
 .sp
 
 .ti -8
@@ -161,6 +161,10 @@ host addresses.
 - rule in routing policy database.
 
 .TP
+.B tcp_metrics/tcpmetrics
+- manage TCP Metrics
+
+.TP
 .B tunnel
 - tunnel over IP.
 
@@ -220,6 +224,7 @@ was written by Alexey N. Kuznetsov and added in Linux 2.2.
 .BR ip-ntable (8),
 .BR ip-route (8),
 .BR ip-rule (8),
+.BR ip-tcp_metrics (8),
 .BR ip-tunnel (8),
 .BR ip-xfrm (8)
 .br
-- 
1.7.3.4

^ permalink raw reply related

* Re: [PATCH v2] iproute2: add support for tcp_metrics
From: Eric Dumazet @ 2012-10-02 21:04 UTC (permalink / raw)
  To: Julian Anastasov; +Cc: Stephen Hemminger, netdev
In-Reply-To: <1349210716-25509-1-git-send-email-ja@ssi.bg>

On Tue, 2012-10-02 at 23:45 +0300, Julian Anastasov wrote:
> 	ip tcp_metrics/tcpmetrics
> 
> 	We support get/del for single entry and dump for
> show/flush.
> 
> Signed-off-by: Julian Anastasov <ja@ssi.bg>
> ---

Thanks Julian, this version works

Acked-by: Eric Dumazet <edumazet@google.com>

^ permalink raw reply

* Re: Possible networking regression in 3.6.0
From: Alexander Duyck @ 2012-10-02 21:14 UTC (permalink / raw)
  To: David Miller; +Cc: eric.dumazet, chris2553, netdev, gpiez, davej
In-Reply-To: <20121002.142502.1702895723099297167.davem@davemloft.net>

On 10/02/2012 11:25 AM, David Miller wrote:
> From: Eric Dumazet <eric.dumazet@gmail.com>
> Date: Tue, 02 Oct 2012 17:48:39 +0200
>
>> [PATCH] ipv4: properly cache forward routes
>>
>> commit d2d68ba9fe8 (ipv4: Cache input routes in fib_info nexthops.)
>> introduced a regression for forwarding.
>>
>> This was hard to reproduce but the symptom was that packets were
>> delivered to local host instead of being forwarded.
>>
>> Add a separate cache (nh_rth_forward) to solve the problem.
>>
>> Many thanks to Chris Clayton for his patience and help.
>>
>> Reported-by: Chris Clayton <chris2553@googlemail.com>
>> Bisected-by: Chris Clayton <chris2553@googlemail.com>
>> Reported-by: Dave Jones <davej@redhat.com>
>> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Thanks for figuring this out, I'll think about this more
> deeply.
I think something may have been missed in this patch.

With it applied to net-next I am unable to remove the ixgbe driver after
running a routing traffic test.  The specific message I am getting is:
    unregister_netdevice: waiting for eth2 to become free. Usage count = -7

Thanks,

Alex

^ permalink raw reply

* Re: linux-next: Tree for Oct 2 (vxlan.c)
From: Stephen Hemminger @ 2012-10-02 21:21 UTC (permalink / raw)
  To: David Miller; +Cc: rdunlap, sfr, linux-next, linux-kernel, netdev
In-Reply-To: <20121002.143627.1565408497543880722.davem@davemloft.net>

On Tue, 02 Oct 2012 14:36:27 -0400 (EDT)
David Miller <davem@davemloft.net> wrote:

> From: Randy Dunlap <rdunlap@xenotime.net>
> Date: Tue, 02 Oct 2012 11:31:51 -0700
> 
> > on x86_64:
> > 
> > drivers/net/vxlan.c: In function 'vxlan_xmit':
> > drivers/net/vxlan.c:725:2: error: implicit declaration of function 'ip_select_ident'
> > 
> > That function is only defined when CONFIG_INET is enabled,
> > but it is disabled in this config.
> 
> This definitely depends upon INET, I'll add the Kconfig change
> to net-next, thanks.

Yup, thanks Dave.

^ permalink raw reply

* [PATCH 0/2] PCI-Express Non-Transparent Bridge Support
From: Jon Mason @ 2012-10-02 21:26 UTC (permalink / raw)
  To: linux-kernel; +Cc: netdev, linux-pci, Dave Jiang, Nicholas Bellinger

I am submitting version 4 of the PCI-Express Non-Transparent Bridge
patches for inclusion in 3.7.  All outstanding issues from the RFC
process have been addressed.

version 1
http://thread.gmane.org/gmane.linux.kernel.pci/16443

Version 2 incorporates numerous clean-ups 
http://thread.gmane.org/gmane.linux.kernel.pci/16696

Version 3 incorporates changes to conform NTB and client devices to the
Linux device model (per Greg KH's request).
http://thread.gmane.org/gmane.linux.kernel.pci/17808

Version 4 removes the transport transmit tasklet (per Dave Miller's
request).
http://thread.gmane.org/gmane.linux.network/244491

Thanks,
Jon

^ permalink raw reply

* [PATCH 1/2] PCI-Express Non-Transparent Bridge Support
From: Jon Mason @ 2012-10-02 21:26 UTC (permalink / raw)
  To: linux-kernel; +Cc: netdev, linux-pci, Dave Jiang, Nicholas Bellinger
In-Reply-To: <1349213177-9985-1-git-send-email-jon.mason@intel.com>

A PCI-Express non-transparent bridge (NTB) is a point-to-point PCIe bus
connecting 2 systems, providing electrical isolation between the two subsystems.
A non-transparent bridge is functionally similar to a transparent bridge except
that both sides of the bridge have their own independent address domains.  The
host on one side of the bridge will not have the visibility of the complete
memory or I/O space on the other side of the bridge.  To communicate across the
non-transparent bridge, each NTB endpoint has one (or more) apertures exposed to
the local system.  Writes to these apertures are mirrored to memory on the
remote system.  Communications can also occur through the use of doorbell
registers that initiate interrupts to the alternate domain, and scratch-pad
registers accessible from both sides.

The NTB device driver is needed to configure these memory windows, doorbell, and
scratch-pad registers as well as use them in such a way as they can be turned
into a viable communication channel to the remote system.  ntb_hw.[ch]
determines the usage model (NTB to NTB or NTB to Root Port) and abstracts away
the underlying hardware to provide access and a common interface to the doorbell
registers, scratch pads, and memory windows.  These hardware interfaces are
exported so that other, non-mainlined kernel drivers can access these.
ntb_transport.[ch] also uses the exported interfaces in ntb_hw.[ch] to setup a
communication channel(s) and provide a reliable way of transferring data from
one side to the other, which it then exports so that "client" drivers can access
them.  These client drivers are used to provide a standard kernel interface
(i.e., Ethernet device) to NTB, such that Linux can transfer data from one
system to the other in a standard way.

Signed-off-by: Jon Mason <jon.mason@intel.com>
---
 MAINTAINERS                 |    6 +
 drivers/Kconfig             |    2 +
 drivers/Makefile            |    1 +
 drivers/ntb/Kconfig         |   13 +
 drivers/ntb/Makefile        |    3 +
 drivers/ntb/ntb_hw.c        | 1167 +++++++++++++++++++++++++++++++++++
 drivers/ntb/ntb_hw.h        |  195 ++++++
 drivers/ntb/ntb_regs.h      |  139 +++++
 drivers/ntb/ntb_transport.c | 1401 +++++++++++++++++++++++++++++++++++++++++++
 include/linux/ntb.h         |   81 +++
 10 files changed, 3008 insertions(+)
 create mode 100644 drivers/ntb/Kconfig
 create mode 100644 drivers/ntb/Makefile
 create mode 100644 drivers/ntb/ntb_hw.c
 create mode 100644 drivers/ntb/ntb_hw.h
 create mode 100644 drivers/ntb/ntb_regs.h
 create mode 100644 drivers/ntb/ntb_transport.c
 create mode 100644 include/linux/ntb.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 9a6c4da..3c7e98d 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -4851,6 +4851,12 @@ S:	Maintained
 F:	Documentation/scsi/NinjaSCSI.txt
 F:	drivers/scsi/nsp32*
 
+NTB DRIVER
+M:	Jon Mason <jon.mason@intel.com>
+S:	Supported
+F:	drivers/ntb/
+F:	include/linux/ntb.h
+
 NTFS FILESYSTEM
 M:	Anton Altaparmakov <anton@tuxera.com>
 L:	linux-ntfs-dev@lists.sourceforge.net
diff --git a/drivers/Kconfig b/drivers/Kconfig
index ece958d..dccaa52 100644
--- a/drivers/Kconfig
+++ b/drivers/Kconfig
@@ -152,4 +152,6 @@ source "drivers/vme/Kconfig"
 
 source "drivers/pwm/Kconfig"
 
+source "drivers/ntb/Kconfig"
+
 endmenu
diff --git a/drivers/Makefile b/drivers/Makefile
index 5b42184..dfa5978 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -139,3 +139,4 @@ obj-$(CONFIG_EXTCON)		+= extcon/
 obj-$(CONFIG_MEMORY)		+= memory/
 obj-$(CONFIG_IIO)		+= iio/
 obj-$(CONFIG_VME_BUS)		+= vme/
+obj-$(CONFIG_NTB)		+= ntb/
diff --git a/drivers/ntb/Kconfig b/drivers/ntb/Kconfig
new file mode 100644
index 0000000..f69df793
--- /dev/null
+++ b/drivers/ntb/Kconfig
@@ -0,0 +1,13 @@
+config NTB
+       tristate "Intel Non-Transparent Bridge support"
+       depends on PCI
+       depends on X86
+       help
+        The PCI-E Non-transparent bridge hardware is a point-to-point PCI-E bus
+        connecting 2 systems.  When configured, writes to the device's PCI
+        mapped memory will be mirrored to a buffer on the remote system.  The
+        ntb Linux driver uses this point-to-point communication as a method to
+        transfer data from one system to the other.
+
+        If unsure, say N.
+
diff --git a/drivers/ntb/Makefile b/drivers/ntb/Makefile
new file mode 100644
index 0000000..15cb59f
--- /dev/null
+++ b/drivers/ntb/Makefile
@@ -0,0 +1,3 @@
+obj-$(CONFIG_NTB) += ntb.o
+
+ntb-objs := ntb_hw.o ntb_transport.o
diff --git a/drivers/ntb/ntb_hw.c b/drivers/ntb/ntb_hw.c
new file mode 100644
index 0000000..d6671f9
--- /dev/null
+++ b/drivers/ntb/ntb_hw.c
@@ -0,0 +1,1167 @@
+/*
+ * This file is provided under a dual BSD/GPLv2 license.  When using or
+ *   redistributing this file, you may do so under either license.
+ *
+ *   GPL LICENSE SUMMARY
+ *
+ *   Copyright(c) 2012 Intel Corporation. All rights reserved.
+ *
+ *   This program is free software; you can redistribute it and/or modify
+ *   it under the terms of version 2 of the GNU General Public License as
+ *   published by the Free Software Foundation.
+ *
+ *   BSD LICENSE
+ *
+ *   Copyright(c) 2012 Intel Corporation. All rights reserved.
+ *
+ *   Redistribution and use in source and binary forms, with or without
+ *   modification, are permitted provided that the following conditions
+ *   are met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copy
+ *       notice, this list of conditions and the following disclaimer in
+ *       the documentation and/or other materials provided with the
+ *       distribution.
+ *     * Neither the name of Intel Corporation nor the names of its
+ *       contributors may be used to endorse or promote products derived
+ *       from this software without specific prior written permission.
+ *
+ *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Intel PCIe NTB Linux driver
+ *
+ * Contact Information:
+ * Jon Mason <jon.mason@intel.com>
+ */
+#include <linux/debugfs.h>
+#include <linux/init.h>
+#include <linux/interrupt.h>
+#include <linux/module.h>
+#include <linux/pci.h>
+#include <linux/slab.h>
+#include "ntb_hw.h"
+#include "ntb_regs.h"
+
+#define NTB_NAME	"Intel(R) PCI-E Non-Transparent Bridge Driver"
+#define NTB_VER		"0.22"
+
+MODULE_DESCRIPTION(NTB_NAME);
+MODULE_VERSION(NTB_VER);
+MODULE_LICENSE("Dual BSD/GPL");
+MODULE_AUTHOR("Intel Corporation");
+
+enum {
+	NTB_CONN_CLASSIC = 0,
+	NTB_CONN_B2B,
+	NTB_CONN_RP,
+};
+
+enum {
+	NTB_DEV_USD = 0,
+	NTB_DEV_DSD,
+};
+
+enum {
+	SNB_HW = 0,
+	BWD_HW,
+};
+
+/* Translate memory window 0,1 to BAR 2,4 */
+#define MW_TO_BAR(mw)	(mw * 2 + 2)
+
+static DEFINE_PCI_DEVICE_TABLE(ntb_pci_tbl) = {
+	{PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_NTB_B2B_BWD)},
+	{PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_NTB_B2B_JSF)},
+	{PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_NTB_CLASSIC_JSF)},
+	{PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_NTB_RP_JSF)},
+	{PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_NTB_RP_SNB)},
+	{PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_NTB_B2B_SNB)},
+	{PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_NTB_CLASSIC_SNB)},
+	{0}
+};
+MODULE_DEVICE_TABLE(pci, ntb_pci_tbl);
+
+/**
+ * ntb_register_event_callback() - register event callback
+ * @ndev: pointer to ntb_device instance
+ * @func: callback function to register
+ *
+ * This function registers a callback for any HW driver events such as link
+ * up/down, power management notices and etc.
+ *
+ * RETURNS: An appropriate -ERRNO error value on error, or zero for success.
+ */
+int ntb_register_event_callback(struct ntb_device *ndev,
+				void (*func)(void *handle, unsigned int event))
+{
+	if (ndev->event_cb)
+		return -EINVAL;
+
+	ndev->event_cb = func;
+
+	return 0;
+}
+
+/**
+ * ntb_unregister_event_callback() - unregisters the event callback
+ * @ndev: pointer to ntb_device instance
+ *
+ * This function unregisters the existing callback from transport
+ */
+void ntb_unregister_event_callback(struct ntb_device *ndev)
+{
+	ndev->event_cb = NULL;
+}
+
+/**
+ * ntb_register_db_callback() - register a callback for doorbell interrupt
+ * @ndev: pointer to ntb_device instance
+ * @idx: doorbell index to register callback, zero based
+ * @func: callback function to register
+ *
+ * This function registers a callback function for the doorbell interrupt
+ * on the primary side. The function will unmask the doorbell as well to
+ * allow interrupt.
+ *
+ * RETURNS: An appropriate -ERRNO error value on error, or zero for success.
+ */
+int ntb_register_db_callback(struct ntb_device *ndev, unsigned int idx,
+			     void *data, void (*func)(void *data, int db_num))
+{
+	unsigned long mask;
+
+	if (idx >= ndev->max_cbs || ndev->db_cb[idx].callback) {
+		dev_warn(&ndev->pdev->dev, "Invalid Index.\n");
+		return -EINVAL;
+	}
+
+	ndev->db_cb[idx].callback = func;
+	ndev->db_cb[idx].data = data;
+
+	/* unmask interrupt */
+	mask = readw(ndev->reg_ofs.pdb_mask);
+	clear_bit(idx * ndev->bits_per_vector, &mask);
+	writew(mask, ndev->reg_ofs.pdb_mask);
+
+	return 0;
+}
+
+/**
+ * ntb_unregister_db_callback() - unregister a callback for doorbell interrupt
+ * @ndev: pointer to ntb_device instance
+ * @idx: doorbell index to register callback, zero based
+ *
+ * This function unregisters a callback function for the doorbell interrupt
+ * on the primary side. The function will also mask the said doorbell.
+ */
+void ntb_unregister_db_callback(struct ntb_device *ndev, unsigned int idx)
+{
+	unsigned long mask;
+
+	if (idx >= ndev->max_cbs || !ndev->db_cb[idx].callback)
+		return;
+
+	mask = readw(ndev->reg_ofs.pdb_mask);
+	set_bit(idx * ndev->bits_per_vector, &mask);
+	writew(mask, ndev->reg_ofs.pdb_mask);
+
+	ndev->db_cb[idx].callback = NULL;
+}
+
+/**
+ * ntb_find_transport() - find the transport pointer
+ * @transport: pointer to pci device
+ *
+ * Given the pci device pointer, return the transport pointer passed in when
+ * the transport attached when it was inited.
+ *
+ * RETURNS: pointer to transport.
+ */
+void *ntb_find_transport(struct pci_dev *pdev)
+{
+	struct ntb_device *ndev = pci_get_drvdata(pdev);
+	return ndev->ntb_transport;
+}
+
+/**
+ * ntb_register_transport() - Register NTB transport with NTB HW driver
+ * @transport: transport identifier
+ *
+ * This function allows a transport to reserve the hardware driver for
+ * NTB usage.
+ *
+ * RETURNS: pointer to ntb_device, NULL on error.
+ */
+struct ntb_device *ntb_register_transport(struct pci_dev *pdev, void *transport)
+{
+	struct ntb_device *ndev = pci_get_drvdata(pdev);
+
+	if (ndev->ntb_transport)
+		return NULL;
+
+	ndev->ntb_transport = transport;
+	return ndev;
+}
+
+/**
+ * ntb_unregister_transport() - Unregister the transport with the NTB HW driver
+ * @ndev - ntb_device of the transport to be freed
+ *
+ * This function unregisters the transport from the HW driver and performs any
+ * necessary cleanups.
+ */
+void ntb_unregister_transport(struct ntb_device *ndev)
+{
+	int i;
+
+	if (!ndev->ntb_transport)
+		return;
+
+	for (i = 0; i < ndev->max_cbs; i++)
+		ntb_unregister_db_callback(ndev, i);
+
+	ntb_unregister_event_callback(ndev);
+	ndev->ntb_transport = NULL;
+}
+
+/**
+ * ntb_get_max_spads() - get the total scratch regs usable
+ * @ndev: pointer to ntb_device instance
+ *
+ * This function returns the max 32bit scratchpad registers usable by the
+ * upper layer.
+ *
+ * RETURNS: total number of scratch pad registers available
+ */
+int ntb_get_max_spads(struct ntb_device *ndev)
+{
+	return ndev->limits.max_spads;
+}
+
+/**
+ * ntb_write_local_spad() - write to the secondary scratchpad register
+ * @ndev: pointer to ntb_device instance
+ * @idx: index to the scratchpad register, 0 based
+ * @val: the data value to put into the register
+ *
+ * This function allows writing of a 32bit value to the indexed scratchpad
+ * register. The register resides on the secondary (external) side.
+ *
+ * RETURNS: An appropriate -ERRNO error value on error, or zero for success.
+ */
+int ntb_write_local_spad(struct ntb_device *ndev, unsigned int idx, u32 val)
+{
+	if (idx >= ndev->limits.max_spads)
+		return -EINVAL;
+
+	dev_dbg(&ndev->pdev->dev, "Writing %x to local scratch pad index %d\n",
+		val, idx);
+	writel(val, ndev->reg_ofs.spad_read + idx * 4);
+
+	return 0;
+}
+
+/**
+ * ntb_read_local_spad() - read from the primary scratchpad register
+ * @ndev: pointer to ntb_device instance
+ * @idx: index to scratchpad register, 0 based
+ * @val: pointer to 32bit integer for storing the register value
+ *
+ * This function allows reading of the 32bit scratchpad register on
+ * the primary (internal) side.
+ *
+ * RETURNS: An appropriate -ERRNO error value on error, or zero for success.
+ */
+int ntb_read_local_spad(struct ntb_device *ndev, unsigned int idx, u32 *val)
+{
+	if (idx >= ndev->limits.max_spads)
+		return -EINVAL;
+
+	*val = readl(ndev->reg_ofs.spad_write + idx * 4);
+	dev_dbg(&ndev->pdev->dev,
+		"Reading %x from local scratch pad index %d\n", *val, idx);
+
+	return 0;
+}
+
+/**
+ * ntb_write_remote_spad() - write to the secondary scratchpad register
+ * @ndev: pointer to ntb_device instance
+ * @idx: index to the scratchpad register, 0 based
+ * @val: the data value to put into the register
+ *
+ * This function allows writing of a 32bit value to the indexed scratchpad
+ * register. The register resides on the secondary (external) side.
+ *
+ * RETURNS: An appropriate -ERRNO error value on error, or zero for success.
+ */
+int ntb_write_remote_spad(struct ntb_device *ndev, unsigned int idx, u32 val)
+{
+	if (idx >= ndev->limits.max_spads)
+		return -EINVAL;
+
+	dev_dbg(&ndev->pdev->dev, "Writing %x to remote scratch pad index %d\n",
+		val, idx);
+	writel(val, ndev->reg_ofs.spad_write + idx * 4);
+
+	return 0;
+}
+
+/**
+ * ntb_read_remote_spad() - read from the primary scratchpad register
+ * @ndev: pointer to ntb_device instance
+ * @idx: index to scratchpad register, 0 based
+ * @val: pointer to 32bit integer for storing the register value
+ *
+ * This function allows reading of the 32bit scratchpad register on
+ * the primary (internal) side.
+ *
+ * RETURNS: An appropriate -ERRNO error value on error, or zero for success.
+ */
+int ntb_read_remote_spad(struct ntb_device *ndev, unsigned int idx, u32 *val)
+{
+	if (idx >= ndev->limits.max_spads)
+		return -EINVAL;
+
+	*val = readl(ndev->reg_ofs.spad_read + idx * 4);
+	dev_dbg(&ndev->pdev->dev,
+		"Reading %x from remote scratch pad index %d\n", *val, idx);
+
+	return 0;
+}
+
+/**
+ * ntb_get_mw_vbase() - get virtual addr for the NTB memory window
+ * @ndev: pointer to ntb_device instance
+ * @mw: memory window number
+ *
+ * This function provides the base virtual address of the memory window
+ * specified.
+ *
+ * RETURNS: pointer to virtual address, or NULL on error.
+ */
+void *ntb_get_mw_vbase(struct ntb_device *ndev, unsigned int mw)
+{
+	if (mw > NTB_NUM_MW)
+		return NULL;
+
+	return ndev->mw[mw].vbase;
+}
+
+/**
+ * ntb_get_mw_size() - return size of NTB memory window
+ * @ndev: pointer to ntb_device instance
+ * @mw: memory window number
+ *
+ * This function provides the physical size of the memory window specified
+ *
+ * RETURNS: the size of the memory window or zero on error
+ */
+resource_size_t ntb_get_mw_size(struct ntb_device *ndev, unsigned int mw)
+{
+	if (mw > NTB_NUM_MW)
+		return 0;
+
+	return ndev->mw[mw].bar_sz;
+}
+
+/**
+ * ntb_set_mw_addr - set the memory window address
+ * @ndev: pointer to ntb_device instance
+ * @mw: memory window number
+ * @addr: base address for data
+ *
+ * This function sets the base physical address of the memory window.  This
+ * memory address is where data from the remote system will be transfered into
+ * or out of depending on how the transport is configured.
+ */
+void ntb_set_mw_addr(struct ntb_device *ndev, unsigned int mw, u64 addr)
+{
+	if (mw > NTB_NUM_MW)
+		return;
+
+	dev_dbg(&ndev->pdev->dev, "Writing addr %Lx to BAR %d\n", addr,
+		MW_TO_BAR(mw));
+
+	ndev->mw[mw].phys_addr = addr;
+
+	switch (MW_TO_BAR(mw)) {
+	case NTB_BAR_23:
+		writeq(addr, ndev->reg_ofs.sbar2_xlat);
+		break;
+	case NTB_BAR_45:
+		writeq(addr, ndev->reg_ofs.sbar4_xlat);
+		break;
+	}
+}
+
+/**
+ * ntb_ring_sdb() - Set the doorbell on the secondary/external side
+ * @ndev: pointer to ntb_device instance
+ * @db: doorbell to ring
+ *
+ * This function allows triggering of a doorbell on the secondary/external
+ * side that will initiate an interrupt on the remote host
+ *
+ * RETURNS: An appropriate -ERRNO error value on error, or zero for success.
+ */
+void ntb_ring_sdb(struct ntb_device *ndev, unsigned int db)
+{
+	dev_dbg(&ndev->pdev->dev, "%s: ringing doorbell %d\n", __func__, db);
+
+	if (ndev->hw_type == BWD_HW)
+		writeq((u64) 1 << db, ndev->reg_ofs.sdb);
+	else
+		writew(((1 << ndev->bits_per_vector) - 1) <<
+		       (db * ndev->bits_per_vector), ndev->reg_ofs.sdb);
+}
+
+static void ntb_link_event(struct ntb_device *ndev, int link_state)
+{
+	unsigned int event;
+
+	if (ndev->link_status == link_state)
+		return;
+
+	if (link_state == NTB_LINK_UP) {
+		u16 status;
+
+		dev_info(&ndev->pdev->dev, "Link Up\n");
+		ndev->link_status = NTB_LINK_UP;
+		event = NTB_EVENT_HW_LINK_UP;
+
+		if (ndev->hw_type == BWD_HW)
+			status = readw(ndev->reg_ofs.lnk_stat);
+		else {
+			int rc = pci_read_config_word(ndev->pdev,
+						      SNB_LINK_STATUS_OFFSET,
+						      &status);
+			if (rc)
+				return;
+		}
+		dev_info(&ndev->pdev->dev, "Link Width %d, Link Speed %d\n",
+			 (status & NTB_LINK_WIDTH_MASK) >> 4,
+			 (status & NTB_LINK_SPEED_MASK));
+	} else {
+		dev_info(&ndev->pdev->dev, "Link Down\n");
+		ndev->link_status = NTB_LINK_DOWN;
+		event = NTB_EVENT_HW_LINK_DOWN;
+	}
+
+	/* notify the upper layer if we have an event change */
+	if (ndev->event_cb)
+		ndev->event_cb(ndev->ntb_transport, event);
+}
+
+static int ntb_link_status(struct ntb_device *ndev)
+{
+	int link_state;
+
+	if (ndev->hw_type == BWD_HW) {
+		u32 ntb_cntl;
+
+		ntb_cntl = readl(ndev->reg_ofs.lnk_cntl);
+		if (ntb_cntl & BWD_CNTL_LINK_DOWN)
+			link_state = NTB_LINK_DOWN;
+		else
+			link_state = NTB_LINK_UP;
+	} else {
+		u16 status;
+		int rc;
+
+		rc = pci_read_config_word(ndev->pdev, SNB_LINK_STATUS_OFFSET,
+					  &status);
+		if (rc)
+			return rc;
+
+		if (status & NTB_LINK_STATUS_ACTIVE)
+			link_state = NTB_LINK_UP;
+		else
+			link_state = NTB_LINK_DOWN;
+	}
+
+	ntb_link_event(ndev, link_state);
+
+	return 0;
+}
+
+/* BWD doesn't have link status interrupt, poll on that platform */
+static void bwd_link_poll(struct work_struct *work)
+{
+	struct ntb_device *ndev = container_of(work, struct ntb_device,
+					       hb_timer.work);
+	unsigned long ts = jiffies;
+
+	/* If we haven't gotten an interrupt in a while, check the BWD link
+	 * status bit
+	 */
+	if (ts > ndev->last_ts + NTB_HB_TIMEOUT) {
+		int rc = ntb_link_status(ndev);
+		if (rc)
+			dev_err(&ndev->pdev->dev,
+				"Error determining link status\n");
+	}
+
+	schedule_delayed_work(&ndev->hb_timer, NTB_HB_TIMEOUT);
+}
+
+static int ntb_xeon_setup(struct ntb_device *ndev)
+{
+	int rc;
+	u8 val;
+
+	ndev->hw_type = SNB_HW;
+
+	rc = pci_read_config_byte(ndev->pdev, NTB_PPD_OFFSET, &val);
+	if (rc)
+		return rc;
+
+	switch (val & SNB_PPD_CONN_TYPE) {
+	case NTB_CONN_B2B:
+		ndev->conn_type = NTB_CONN_B2B;
+		break;
+	case NTB_CONN_CLASSIC:
+	case NTB_CONN_RP:
+	default:
+		dev_err(&ndev->pdev->dev, "Only B2B supported at this time\n");
+		return -EINVAL;
+	}
+
+	if (val & SNB_PPD_DEV_TYPE)
+		ndev->dev_type = NTB_DEV_DSD;
+	else
+		ndev->dev_type = NTB_DEV_USD;
+
+	ndev->reg_ofs.pdb = ndev->reg_base + SNB_PDOORBELL_OFFSET;
+	ndev->reg_ofs.pdb_mask = ndev->reg_base + SNB_PDBMSK_OFFSET;
+	ndev->reg_ofs.sbar2_xlat = ndev->reg_base + SNB_SBAR2XLAT_OFFSET;
+	ndev->reg_ofs.sbar4_xlat = ndev->reg_base + SNB_SBAR4XLAT_OFFSET;
+	ndev->reg_ofs.lnk_cntl = ndev->reg_base + SNB_NTBCNTL_OFFSET;
+	ndev->reg_ofs.lnk_stat = ndev->reg_base + SNB_LINK_STATUS_OFFSET;
+	ndev->reg_ofs.spad_read = ndev->reg_base + SNB_SPAD_OFFSET;
+	ndev->reg_ofs.spci_cmd = ndev->reg_base + SNB_PCICMD_OFFSET;
+
+	if (ndev->conn_type == NTB_CONN_B2B) {
+		ndev->reg_ofs.sdb = ndev->reg_base + SNB_B2B_DOORBELL_OFFSET;
+		ndev->reg_ofs.spad_write = ndev->reg_base + SNB_B2B_SPAD_OFFSET;
+		ndev->limits.max_spads = SNB_MAX_SPADS;
+	} else {
+		ndev->reg_ofs.sdb = ndev->reg_base + SNB_SDOORBELL_OFFSET;
+		ndev->reg_ofs.spad_write = ndev->reg_base + SNB_SPAD_OFFSET;
+		ndev->limits.max_spads = SNB_MAX_COMPAT_SPADS;
+	}
+
+	ndev->limits.max_db_bits = SNB_MAX_DB_BITS;
+	ndev->limits.msix_cnt = SNB_MSIX_CNT;
+	ndev->bits_per_vector = SNB_DB_BITS_PER_VEC;
+
+	return 0;
+}
+
+static int ntb_bwd_setup(struct ntb_device *ndev)
+{
+	int rc;
+	u32 val;
+
+	ndev->hw_type = BWD_HW;
+
+	rc = pci_read_config_dword(ndev->pdev, NTB_PPD_OFFSET, &val);
+	if (rc)
+		return rc;
+
+	switch ((val & BWD_PPD_CONN_TYPE) >> 8) {
+	case NTB_CONN_B2B:
+		ndev->conn_type = NTB_CONN_B2B;
+		break;
+	case NTB_CONN_RP:
+	default:
+		dev_err(&ndev->pdev->dev, "Only B2B supported at this time\n");
+		return -EINVAL;
+	}
+
+	if (val & BWD_PPD_DEV_TYPE)
+		ndev->dev_type = NTB_DEV_DSD;
+	else
+		ndev->dev_type = NTB_DEV_USD;
+
+	/* Initiate PCI-E link training */
+	rc = pci_write_config_dword(ndev->pdev, NTB_PPD_OFFSET,
+				    val | BWD_PPD_INIT_LINK);
+	if (rc)
+		return rc;
+
+	ndev->reg_ofs.pdb = ndev->reg_base + BWD_PDOORBELL_OFFSET;
+	ndev->reg_ofs.pdb_mask = ndev->reg_base + BWD_PDBMSK_OFFSET;
+	ndev->reg_ofs.sbar2_xlat = ndev->reg_base + BWD_SBAR2XLAT_OFFSET;
+	ndev->reg_ofs.sbar4_xlat = ndev->reg_base + BWD_SBAR4XLAT_OFFSET;
+	ndev->reg_ofs.lnk_cntl = ndev->reg_base + BWD_NTBCNTL_OFFSET;
+	ndev->reg_ofs.lnk_stat = ndev->reg_base + BWD_LINK_STATUS_OFFSET;
+	ndev->reg_ofs.spad_read = ndev->reg_base + BWD_SPAD_OFFSET;
+	ndev->reg_ofs.spci_cmd = ndev->reg_base + BWD_PCICMD_OFFSET;
+
+	if (ndev->conn_type == NTB_CONN_B2B) {
+		ndev->reg_ofs.sdb = ndev->reg_base + BWD_B2B_DOORBELL_OFFSET;
+		ndev->reg_ofs.spad_write = ndev->reg_base + BWD_B2B_SPAD_OFFSET;
+		ndev->limits.max_spads = BWD_MAX_SPADS;
+	} else {
+		ndev->reg_ofs.sdb = ndev->reg_base + BWD_PDOORBELL_OFFSET;
+		ndev->reg_ofs.spad_write = ndev->reg_base + BWD_SPAD_OFFSET;
+		ndev->limits.max_spads = BWD_MAX_COMPAT_SPADS;
+	}
+
+	ndev->limits.max_db_bits = BWD_MAX_DB_BITS;
+	ndev->limits.msix_cnt = BWD_MSIX_CNT;
+	ndev->bits_per_vector = BWD_DB_BITS_PER_VEC;
+
+	/* Since bwd doesn't have a link interrupt, setup a poll timer */
+	INIT_DELAYED_WORK(&ndev->hb_timer, bwd_link_poll);
+	schedule_delayed_work(&ndev->hb_timer, NTB_HB_TIMEOUT);
+
+	return 0;
+}
+
+static int __devinit ntb_device_setup(struct ntb_device *ndev)
+{
+	int rc;
+
+	switch (ndev->pdev->device) {
+	case PCI_DEVICE_ID_INTEL_NTB_2ND_SNB:
+	case PCI_DEVICE_ID_INTEL_NTB_RP_JSF:
+	case PCI_DEVICE_ID_INTEL_NTB_RP_SNB:
+	case PCI_DEVICE_ID_INTEL_NTB_CLASSIC_JSF:
+	case PCI_DEVICE_ID_INTEL_NTB_CLASSIC_SNB:
+	case PCI_DEVICE_ID_INTEL_NTB_B2B_JSF:
+	case PCI_DEVICE_ID_INTEL_NTB_B2B_SNB:
+		rc = ntb_xeon_setup(ndev);
+		break;
+	case PCI_DEVICE_ID_INTEL_NTB_B2B_BWD:
+		rc = ntb_bwd_setup(ndev);
+		break;
+	default:
+		rc = -ENODEV;
+	}
+
+	/* Enable Bus Master and Memory Space on the secondary side */
+	writew(PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER, ndev->reg_ofs.spci_cmd);
+
+	return rc;
+}
+
+static void ntb_device_free(struct ntb_device *ndev)
+{
+	if (ndev->hw_type == BWD_HW)
+		cancel_delayed_work_sync(&ndev->hb_timer);
+}
+
+static irqreturn_t bwd_callback_msix_irq(int irq, void *data)
+{
+	struct ntb_db_cb *db_cb = data;
+	struct ntb_device *ndev = db_cb->ndev;
+
+	dev_dbg(&ndev->pdev->dev, "MSI-X irq %d received for DB %d\n", irq,
+		db_cb->db_num);
+
+	if (db_cb->callback)
+		db_cb->callback(db_cb->data, db_cb->db_num);
+
+	/* No need to check for the specific HB irq, any interrupt means
+	 * we're connected.
+	 */
+	ndev->last_ts = jiffies;
+
+	writeq((u64) 1 << db_cb->db_num, ndev->reg_ofs.pdb);
+
+	return IRQ_HANDLED;
+}
+
+static irqreturn_t xeon_callback_msix_irq(int irq, void *data)
+{
+	struct ntb_db_cb *db_cb = data;
+	struct ntb_device *ndev = db_cb->ndev;
+
+	dev_dbg(&ndev->pdev->dev, "MSI-X irq %d received for DB %d\n", irq,
+		db_cb->db_num);
+
+	if (db_cb->callback)
+		db_cb->callback(db_cb->data, db_cb->db_num);
+
+	/* On Sandybridge, there are 16 bits in the interrupt register
+	 * but only 4 vectors.  So, 5 bits are assigned to the first 3
+	 * vectors, with the 4th having a single bit for link
+	 * interrupts.
+	 */
+	writew(((1 << ndev->bits_per_vector) - 1) <<
+	       (db_cb->db_num * ndev->bits_per_vector), ndev->reg_ofs.pdb);
+
+	return IRQ_HANDLED;
+}
+
+/* Since we do not have a HW doorbell in BWD, this is only used in JF/JT */
+static irqreturn_t xeon_event_msix_irq(int irq, void *dev)
+{
+	struct ntb_device *ndev = dev;
+	int rc;
+
+	dev_dbg(&ndev->pdev->dev, "MSI-X irq %d received for Events\n", irq);
+
+	rc = ntb_link_status(ndev);
+	if (rc)
+		dev_err(&ndev->pdev->dev, "Error determining link status\n");
+
+	/* bit 15 is always the link bit */
+	writew(1 << ndev->limits.max_db_bits, ndev->reg_ofs.pdb);
+
+	return IRQ_HANDLED;
+}
+
+static irqreturn_t ntb_interrupt(int irq, void *dev)
+{
+	struct ntb_device *ndev = dev;
+	unsigned int i = 0;
+
+	if (ndev->hw_type == BWD_HW) {
+		u64 pdb = readq(ndev->reg_ofs.pdb);
+
+		dev_dbg(&ndev->pdev->dev, "irq %d - pdb = %Lx\n", irq, pdb);
+
+		while (pdb) {
+			i = __ffs(pdb);
+			pdb &= pdb - 1;
+			bwd_callback_msix_irq(irq, &ndev->db_cb[i]);
+		}
+	} else {
+		u16 pdb = readw(ndev->reg_ofs.pdb);
+
+		dev_dbg(&ndev->pdev->dev, "irq %d - pdb = %x sdb %x\n", irq,
+			pdb, readw(ndev->reg_ofs.sdb));
+
+		if (pdb & SNB_DB_HW_LINK) {
+			xeon_event_msix_irq(irq, dev);
+			pdb &= ~SNB_DB_HW_LINK;
+		}
+
+		while (pdb) {
+			i = __ffs(pdb);
+			pdb &= pdb - 1;
+			xeon_callback_msix_irq(irq, &ndev->db_cb[i]);
+		}
+	}
+
+	return IRQ_HANDLED;
+}
+
+static int ntb_setup_msix(struct ntb_device *ndev)
+{
+	struct pci_dev *pdev = ndev->pdev;
+	struct msix_entry *msix;
+	int msix_entries;
+	int rc, i, pos;
+	u16 val;
+
+	pos = pci_find_capability(pdev, PCI_CAP_ID_MSIX);
+	if (!pos) {
+		rc = -EIO;
+		goto err;
+	}
+
+	rc = pci_read_config_word(pdev, pos + PCI_MSIX_FLAGS, &val);
+	if (rc)
+		goto err;
+
+	msix_entries = msix_table_size(val);
+	if (msix_entries > ndev->limits.msix_cnt) {
+		rc = -EINVAL;
+		goto err;
+	}
+
+	ndev->msix_entries = kmalloc(sizeof(struct msix_entry) * msix_entries,
+				     GFP_KERNEL);
+	if (!ndev->msix_entries) {
+		rc = -ENOMEM;
+		goto err;
+	}
+
+	for (i = 0; i < msix_entries; i++)
+		ndev->msix_entries[i].entry = i;
+
+	rc = pci_enable_msix(pdev, ndev->msix_entries, msix_entries);
+	if (rc < 0)
+		goto err1;
+	if (rc > 0) {
+		/* On SNB, the link interrupt is always tied to 4th vector.  If
+		 * we can't get all 4, then we can't use MSI-X.
+		 */
+		if (ndev->hw_type != BWD_HW) {
+			rc = -EIO;
+			goto err1;
+		}
+
+		dev_warn(&pdev->dev,
+			 "Only %d MSI-X vectors.  Limiting the number of queues to that number.\n",
+			 rc);
+		msix_entries = rc;
+	}
+
+	for (i = 0; i < msix_entries; i++) {
+		msix = &ndev->msix_entries[i];
+		WARN_ON(!msix->vector);
+
+		/* Use the last MSI-X vector for Link status */
+		if (ndev->hw_type == BWD_HW) {
+			rc = request_irq(msix->vector, bwd_callback_msix_irq, 0,
+					 "ntb-callback-msix", &ndev->db_cb[i]);
+			if (rc)
+				goto err2;
+		} else {
+			if (i == msix_entries - 1) {
+				rc = request_irq(msix->vector,
+						 xeon_event_msix_irq, 0,
+						 "ntb-event-msix", ndev);
+				if (rc)
+					goto err2;
+			} else {
+				rc = request_irq(msix->vector,
+						 xeon_callback_msix_irq, 0,
+						 "ntb-callback-msix",
+						 &ndev->db_cb[i]);
+				if (rc)
+					goto err2;
+			}
+		}
+	}
+
+	ndev->num_msix = msix_entries;
+	if (ndev->hw_type == BWD_HW)
+		ndev->max_cbs = msix_entries;
+	else
+		ndev->max_cbs = msix_entries - 1;
+
+	return 0;
+
+err2:
+	while (--i >= 0) {
+		msix = &ndev->msix_entries[i];
+		if (ndev->hw_type != BWD_HW && i == ndev->num_msix - 1)
+			free_irq(msix->vector, ndev);
+		else
+			free_irq(msix->vector, &ndev->db_cb[i]);
+	}
+	pci_disable_msix(pdev);
+err1:
+	kfree(ndev->msix_entries);
+	dev_err(&pdev->dev, "Error allocating MSI-X interrupt\n");
+err:
+	ndev->num_msix = 0;
+	return rc;
+}
+
+static int ntb_setup_msi(struct ntb_device *ndev)
+{
+	struct pci_dev *pdev = ndev->pdev;
+	int rc;
+
+	rc = pci_enable_msi(pdev);
+	if (rc)
+		return rc;
+
+	rc = request_irq(pdev->irq, ntb_interrupt, 0, "ntb-msi", ndev);
+	if (rc) {
+		pci_disable_msi(pdev);
+		dev_err(&pdev->dev, "Error allocating MSI interrupt\n");
+		return rc;
+	}
+
+	return 0;
+}
+
+static int ntb_setup_intx(struct ntb_device *ndev)
+{
+	struct pci_dev *pdev = ndev->pdev;
+	int rc;
+
+	pci_msi_off(pdev);
+
+	/* Verify intx is enabled */
+	pci_intx(pdev, 1);
+
+	rc = request_irq(pdev->irq, ntb_interrupt, IRQF_SHARED, "ntb-intx",
+			 ndev);
+	if (rc)
+		return rc;
+
+	return 0;
+}
+
+static int __devinit ntb_setup_interrupts(struct ntb_device *ndev)
+{
+	int rc;
+
+	/* On BWD, disable all interrupts.  On SNB, disable all but Link
+	 * Interrupt.  The rest will be unmasked as callbacks are registered.
+	 */
+	if (ndev->hw_type == BWD_HW)
+		writeq(~0, ndev->reg_ofs.pdb_mask);
+	else
+		writew(~(1 << ndev->limits.max_db_bits),
+		       ndev->reg_ofs.pdb_mask);
+
+	rc = ntb_setup_msix(ndev);
+	if (!rc)
+		goto done;
+
+	ndev->bits_per_vector = 1;
+	ndev->max_cbs = ndev->limits.max_db_bits;
+
+	rc = ntb_setup_msi(ndev);
+	if (!rc)
+		goto done;
+
+	rc = ntb_setup_intx(ndev);
+	if (rc) {
+		dev_err(&ndev->pdev->dev, "no usable interrupts\n");
+		return rc;
+	}
+
+done:
+	return 0;
+}
+
+static void __devexit ntb_free_interrupts(struct ntb_device *ndev)
+{
+	struct pci_dev *pdev = ndev->pdev;
+
+	/* mask interrupts */
+	if (ndev->hw_type == BWD_HW)
+		writeq(~0, ndev->reg_ofs.pdb_mask);
+	else
+		writew(~0, ndev->reg_ofs.pdb_mask);
+
+	if (ndev->num_msix) {
+		struct msix_entry *msix;
+		u32 i;
+
+		for (i = 0; i < ndev->num_msix; i++) {
+			msix = &ndev->msix_entries[i];
+			if (ndev->hw_type != BWD_HW && i == ndev->num_msix - 1)
+				free_irq(msix->vector, ndev);
+			else
+				free_irq(msix->vector, &ndev->db_cb[i]);
+		}
+		pci_disable_msix(pdev);
+	} else {
+		free_irq(pdev->irq, ndev);
+
+		if (pci_dev_msi_enabled(pdev))
+			pci_disable_msi(pdev);
+	}
+}
+
+static int __devinit ntb_create_callbacks(struct ntb_device *ndev)
+{
+	int i;
+
+	/* Checken-egg issue.  We won't know how many callbacks are necessary
+	 * until we see how many MSI-X vectors we get, but these pointers need
+	 * to be passed into the MSI-X register fucntion.  So, we allocate the
+	 * max, knowing that they might not all be used, to work around this.
+	 */
+	ndev->db_cb = kcalloc(ndev->limits.max_db_bits,
+			      sizeof(struct ntb_db_cb),
+			      GFP_KERNEL);
+	if (!ndev->db_cb)
+		return -ENOMEM;
+
+	for (i = 0; i < ndev->limits.max_db_bits; i++) {
+		ndev->db_cb[i].db_num = i;
+		ndev->db_cb[i].ndev = ndev;
+	}
+
+	return 0;
+}
+
+static void ntb_free_callbacks(struct ntb_device *ndev)
+{
+	int i;
+
+	for (i = 0; i < ndev->limits.max_db_bits; i++)
+		ntb_unregister_db_callback(ndev, i);
+
+	kfree(ndev->db_cb);
+}
+
+static int __devinit
+ntb_pci_probe(struct pci_dev *pdev,
+	      __attribute__((unused)) const struct pci_device_id *id)
+{
+	struct ntb_device *ndev;
+	int rc, i;
+
+	ndev = kzalloc(sizeof(struct ntb_device), GFP_KERNEL);
+	if (!ndev)
+		return -ENOMEM;
+
+	ndev->pdev = pdev;
+	ndev->link_status = NTB_LINK_DOWN;
+	pci_set_drvdata(pdev, ndev);
+
+	rc = pci_enable_device(pdev);
+	if (rc)
+		goto err;
+
+	pci_set_master(ndev->pdev);
+
+	rc = pci_request_selected_regions(pdev, NTB_BAR_MASK, KBUILD_MODNAME);
+	if (rc)
+		goto err1;
+
+	ndev->reg_base = pci_ioremap_bar(pdev, NTB_BAR_MMIO);
+	if (!ndev->reg_base) {
+		dev_warn(&pdev->dev, "Cannot remap BAR 0\n");
+		rc = -EIO;
+		goto err2;
+	}
+
+	for (i = 0; i < NTB_NUM_MW; i++) {
+		ndev->mw[i].bar_sz = pci_resource_len(pdev, MW_TO_BAR(i));
+		ndev->mw[i].vbase =
+		    ioremap_wc(pci_resource_start(pdev, MW_TO_BAR(i)),
+			       ndev->mw[i].bar_sz);
+		dev_info(&pdev->dev, "MW %d size %d\n", i,
+			 (u32) pci_resource_len(pdev, MW_TO_BAR(i)));
+		if (!ndev->mw[i].vbase) {
+			dev_warn(&pdev->dev, "Cannot remap BAR %d\n",
+				 MW_TO_BAR(i));
+			rc = -EIO;
+			goto err3;
+		}
+	}
+
+	rc = pci_set_dma_mask(pdev, DMA_BIT_MASK(64));
+	if (rc) {
+		rc = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
+		if (rc)
+			goto err3;
+
+		dev_warn(&pdev->dev, "Cannot DMA highmem\n");
+	}
+
+	rc = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64));
+	if (rc) {
+		rc = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32));
+		if (rc)
+			goto err3;
+
+		dev_warn(&pdev->dev, "Cannot DMA consistent highmem\n");
+	}
+
+	rc = ntb_device_setup(ndev);
+	if (rc)
+		goto err3;
+
+	rc = ntb_create_callbacks(ndev);
+	if (rc)
+		goto err4;
+
+	rc = ntb_setup_interrupts(ndev);
+	if (rc)
+		goto err5;
+
+	/* The scratchpad registers keep the values between rmmod/insmod,
+	 * blast them now
+	 */
+	for (i = 0; i < ndev->limits.max_spads; i++) {
+		ntb_write_local_spad(ndev, i, 0);
+		ntb_write_remote_spad(ndev, i, 0);
+	}
+
+	rc = ntb_transport_init(pdev);
+	if (rc)
+		goto err6;
+
+	/* Let's bring the NTB link up */
+	writel(NTB_CNTL_BAR23_SNOOP | NTB_CNTL_BAR45_SNOOP,
+	       ndev->reg_ofs.lnk_cntl);
+
+	return 0;
+
+err6:
+	ntb_free_interrupts(ndev);
+err5:
+	ntb_free_callbacks(ndev);
+err4:
+	ntb_device_free(ndev);
+err3:
+	for (i--; i >= 0; i--)
+		iounmap(ndev->mw[i].vbase);
+	iounmap(ndev->reg_base);
+err2:
+	pci_release_selected_regions(pdev, NTB_BAR_MASK);
+err1:
+	pci_disable_device(pdev);
+err:
+	kfree(ndev);
+
+	dev_err(&pdev->dev, "Error loading %s module\n", KBUILD_MODNAME);
+	return rc;
+}
+
+static void __devexit ntb_pci_remove(struct pci_dev *pdev)
+{
+	struct ntb_device *ndev = pci_get_drvdata(pdev);
+	int i;
+	u32 ntb_cntl;
+
+	/* Bring NTB link down */
+	ntb_cntl = readl(ndev->reg_ofs.lnk_cntl);
+	ntb_cntl |= NTB_LINK_DISABLE;
+	writel(ntb_cntl, ndev->reg_ofs.lnk_cntl);
+
+	ntb_transport_free(ndev->ntb_transport);
+
+	ntb_free_interrupts(ndev);
+	ntb_free_callbacks(ndev);
+	ntb_device_free(ndev);
+
+	for (i = 0; i < NTB_NUM_MW; i++)
+		iounmap(ndev->mw[i].vbase);
+
+	iounmap(ndev->reg_base);
+	pci_release_selected_regions(pdev, NTB_BAR_MASK);
+	pci_disable_device(pdev);
+	kfree(ndev);
+}
+
+static struct pci_driver ntb_pci_driver = {
+	.name = KBUILD_MODNAME,
+	.id_table = ntb_pci_tbl,
+	.probe = ntb_pci_probe,
+	.remove = __devexit_p(ntb_pci_remove),
+};
+
+static int __init ntb_init_module(void)
+{
+	pr_info("%s: %s, version %s\n", KBUILD_MODNAME, NTB_NAME, NTB_VER);
+
+	return pci_register_driver(&ntb_pci_driver);
+}
+module_init(ntb_init_module);
+
+static void __exit ntb_exit_module(void)
+{
+	pci_unregister_driver(&ntb_pci_driver);
+
+	pr_info("%s: Driver removed\n", KBUILD_MODNAME);
+}
+module_exit(ntb_exit_module);
diff --git a/drivers/ntb/ntb_hw.h b/drivers/ntb/ntb_hw.h
new file mode 100644
index 0000000..5b60b76
--- /dev/null
+++ b/drivers/ntb/ntb_hw.h
@@ -0,0 +1,195 @@
+/*
+ * This file is provided under a dual BSD/GPLv2 license.  When using or
+ *   redistributing this file, you may do so under either license.
+ *
+ *   GPL LICENSE SUMMARY
+ *
+ *   Copyright(c) 2012 Intel Corporation. All rights reserved.
+ *
+ *   This program is free software; you can redistribute it and/or modify
+ *   it under the terms of version 2 of the GNU General Public License as
+ *   published by the Free Software Foundation.
+ *
+ *   BSD LICENSE
+ *
+ *   Copyright(c) 2012 Intel Corporation. All rights reserved.
+ *
+ *   Redistribution and use in source and binary forms, with or without
+ *   modification, are permitted provided that the following conditions
+ *   are met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copy
+ *       notice, this list of conditions and the following disclaimer in
+ *       the documentation and/or other materials provided with the
+ *       distribution.
+ *     * Neither the name of Intel Corporation nor the names of its
+ *       contributors may be used to endorse or promote products derived
+ *       from this software without specific prior written permission.
+ *
+ *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Intel PCIe NTB Linux driver
+ *
+ * Contact Information:
+ * Jon Mason <jon.mason@intel.com>
+ */
+
+#define PCI_DEVICE_ID_INTEL_NTB_B2B_JSF		0x3725
+#define PCI_DEVICE_ID_INTEL_NTB_CLASSIC_JSF	0x3726
+#define PCI_DEVICE_ID_INTEL_NTB_RP_JSF		0x3727
+#define PCI_DEVICE_ID_INTEL_NTB_RP_SNB		0x3C08
+#define PCI_DEVICE_ID_INTEL_NTB_B2B_SNB		0x3C0D
+#define PCI_DEVICE_ID_INTEL_NTB_CLASSIC_SNB	0x3C0E
+#define PCI_DEVICE_ID_INTEL_NTB_2ND_SNB		0x3C0F
+#define PCI_DEVICE_ID_INTEL_NTB_B2B_BWD		0x0C4E
+
+#define msix_table_size(control)	((control & PCI_MSIX_FLAGS_QSIZE)+1)
+
+#define NTB_BAR_MMIO		0
+#define NTB_BAR_23		2
+#define NTB_BAR_45		4
+#define NTB_BAR_MASK		((1 << NTB_BAR_MMIO) | (1 << NTB_BAR_23) |\
+				 (1 << NTB_BAR_45))
+
+#define NTB_LINK_DOWN		0
+#define NTB_LINK_UP		1
+
+#define NTB_HB_TIMEOUT		msecs_to_jiffies(1000)
+
+#define NTB_NUM_MW		2
+
+enum ntb_hw_event {
+	NTB_EVENT_SW_EVENT0	= (1 << 0),
+	NTB_EVENT_SW_EVENT1	= (1 << 1),
+	NTB_EVENT_SW_EVENT2	= (1 << 2),
+	NTB_EVENT_HW_ERROR	= (1 << 3),
+	NTB_EVENT_HW_LINK_UP	= (1 << 4),
+	NTB_EVENT_HW_LINK_DOWN	= (1 << 5),
+};
+
+struct ntb_mw {
+	dma_addr_t phys_addr;
+	void __iomem *vbase;
+	resource_size_t bar_sz;
+};
+
+struct ntb_db_cb {
+	void (*callback) (void *data, int db_num);
+	unsigned int db_num;
+	void *data;
+	struct ntb_device *ndev;
+};
+
+struct ntb_device {
+	struct pci_dev *pdev;
+	struct msix_entry *msix_entries;
+	void __iomem *reg_base;
+	struct ntb_mw mw[NTB_NUM_MW];
+	struct {
+		unsigned int max_spads;
+		unsigned int max_db_bits;
+		unsigned int msix_cnt;
+	} limits;
+	struct {
+		void __iomem *pdb;
+		void __iomem *pdb_mask;
+		void __iomem *sdb;
+		void __iomem *sbar2_xlat;
+		void __iomem *sbar4_xlat;
+		void __iomem *spad_write;
+		void __iomem *spad_read;
+		void __iomem *lnk_cntl;
+		void __iomem *lnk_stat;
+		void __iomem *spci_cmd;
+	} reg_ofs;
+	void *ntb_transport;
+	void (*event_cb)(void *handle, enum ntb_hw_event event);
+
+	struct ntb_db_cb *db_cb;
+	unsigned char hw_type;
+	unsigned char conn_type;
+	unsigned char dev_type;
+	unsigned char num_msix;
+	unsigned char bits_per_vector;
+	unsigned char max_cbs;
+	unsigned char link_status;
+	struct delayed_work hb_timer;
+	unsigned long last_ts;
+};
+
+/**
+ * ntb_hw_link_status() - return the hardware link status
+ * @ndev: pointer to ntb_device instance
+ *
+ * Returns true if the hardware is connected to the remote system
+ *
+ * RETURNS: true or false based on the hardware link state
+ */
+static inline bool ntb_hw_link_status(struct ntb_device *ndev)
+{
+	return ndev->link_status == NTB_LINK_UP;
+}
+
+/**
+ * ntb_query_pdev() - return the pci_dev pointer
+ * @ndev: pointer to ntb_device instance
+ *
+ * Given the ntb pointer return the pci_dev pointerfor the NTB hardware device
+ *
+ * RETURNS: a pointer to the ntb pci_dev
+ */
+static inline struct pci_dev *ntb_query_pdev(struct ntb_device *ndev)
+{
+	return ndev->pdev;
+}
+
+/**
+ * ntb_query_max_cbs() - return the maximum number of callback tuples
+ * @ndev: pointer to ntb_device instance
+ *
+ * The number of callbacks can vary depending on the platform and MSI-X/MSI
+ * enablement
+ *
+ * RETURNS: the maximum number of callback tuples (3, 15, or 33)
+ */
+static inline unsigned int ntb_query_max_cbs(struct ntb_device *ndev)
+{
+	return ndev->max_cbs;
+}
+
+struct ntb_device *ntb_register_transport(struct pci_dev *pdev,
+					  void *transport);
+void ntb_unregister_transport(struct ntb_device *ndev);
+void ntb_set_mw_addr(struct ntb_device *ndev, unsigned int mw, u64 addr);
+int ntb_register_db_callback(struct ntb_device *ndev, unsigned int idx,
+			     void *data, void (*db_cb_func) (void *data,
+							     int db_num));
+void ntb_unregister_db_callback(struct ntb_device *ndev, unsigned int idx);
+int ntb_register_event_callback(struct ntb_device *ndev,
+				void (*event_cb_func) (void *handle,
+						       unsigned int event));
+void ntb_unregister_event_callback(struct ntb_device *ndev);
+int ntb_get_max_spads(struct ntb_device *ndev);
+int ntb_write_local_spad(struct ntb_device *ndev, unsigned int idx, u32 val);
+int ntb_read_local_spad(struct ntb_device *ndev, unsigned int idx, u32 *val);
+int ntb_write_remote_spad(struct ntb_device *ndev, unsigned int idx, u32 val);
+int ntb_read_remote_spad(struct ntb_device *ndev, unsigned int idx, u32 *val);
+void *ntb_get_mw_vbase(struct ntb_device *ndev, unsigned int mw);
+resource_size_t ntb_get_mw_size(struct ntb_device *ndev, unsigned int mw);
+void ntb_ring_sdb(struct ntb_device *ndev, unsigned int idx);
+void *ntb_find_transport(struct pci_dev *pdev);
+
+int ntb_transport_init(struct pci_dev *pdev);
+void ntb_transport_free(void *transport);
diff --git a/drivers/ntb/ntb_regs.h b/drivers/ntb/ntb_regs.h
new file mode 100644
index 0000000..0f97b03
--- /dev/null
+++ b/drivers/ntb/ntb_regs.h
@@ -0,0 +1,139 @@
+/*
+ * This file is provided under a dual BSD/GPLv2 license.  When using or
+ *   redistributing this file, you may do so under either license.
+ *
+ *   GPL LICENSE SUMMARY
+ *
+ *   Copyright(c) 2012 Intel Corporation. All rights reserved.
+ *
+ *   This program is free software; you can redistribute it and/or modify
+ *   it under the terms of version 2 of the GNU General Public License as
+ *   published by the Free Software Foundation.
+ *
+ *   BSD LICENSE
+ *
+ *   Copyright(c) 2012 Intel Corporation. All rights reserved.
+ *
+ *   Redistribution and use in source and binary forms, with or without
+ *   modification, are permitted provided that the following conditions
+ *   are met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copy
+ *       notice, this list of conditions and the following disclaimer in
+ *       the documentation and/or other materials provided with the
+ *       distribution.
+ *     * Neither the name of Intel Corporation nor the names of its
+ *       contributors may be used to endorse or promote products derived
+ *       from this software without specific prior written permission.
+ *
+ *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Intel PCIe NTB Linux driver
+ *
+ * Contact Information:
+ * Jon Mason <jon.mason@intel.com>
+ */
+
+#define NTB_LINK_ENABLE		0x0000
+#define NTB_LINK_DISABLE	0x0002
+#define NTB_LINK_STATUS_ACTIVE	0x2000
+#define NTB_LINK_SPEED_MASK	0x000f
+#define NTB_LINK_WIDTH_MASK	0x03f0
+
+#define SNB_MSIX_CNT		4
+#define SNB_MAX_SPADS		16
+#define SNB_MAX_COMPAT_SPADS	8
+/* Reserve the uppermost bit for link interrupt */
+#define SNB_MAX_DB_BITS		15
+#define SNB_DB_BITS_PER_VEC	5
+
+#define SNB_DB_HW_LINK		0x8000
+
+#define SNB_PCICMD_OFFSET	0x0504
+#define SNB_DEVCTRL_OFFSET	0x0598
+#define SNB_LINK_STATUS_OFFSET	0x01A2
+
+#define SNB_PBAR2LMT_OFFSET	0x0000
+#define SNB_PBAR4LMT_OFFSET	0x0008
+#define SNB_PBAR2XLAT_OFFSET	0x0010
+#define SNB_PBAR4XLAT_OFFSET	0x0018
+#define SNB_SBAR2LMT_OFFSET	0x0020
+#define SNB_SBAR4LMT_OFFSET	0x0028
+#define SNB_SBAR2XLAT_OFFSET	0x0030
+#define SNB_SBAR4XLAT_OFFSET	0x0038
+#define SNB_SBAR0BASE_OFFSET	0x0040
+#define SNB_SBAR2BASE_OFFSET	0x0048
+#define SNB_SBAR4BASE_OFFSET	0x0050
+#define SNB_NTBCNTL_OFFSET	0x0058
+#define SNB_SBDF_OFFSET		0x005C
+#define SNB_PDOORBELL_OFFSET	0x0060
+#define SNB_PDBMSK_OFFSET	0x0062
+#define SNB_SDOORBELL_OFFSET	0x0064
+#define SNB_SDBMSK_OFFSET	0x0066
+#define SNB_USMEMMISS		0x0070
+#define SNB_SPAD_OFFSET		0x0080
+#define SNB_SPADSEMA4_OFFSET	0x00c0
+#define SNB_WCCNTRL_OFFSET	0x00e0
+#define SNB_B2B_SPAD_OFFSET	0x0100
+#define SNB_B2B_DOORBELL_OFFSET	0x0140
+#define SNB_B2B_XLAT_OFFSET	0x0144
+
+#define BWD_MSIX_CNT		34
+#define BWD_MAX_SPADS		16
+#define BWD_MAX_COMPAT_SPADS	16
+#define BWD_MAX_DB_BITS		34
+#define BWD_DB_BITS_PER_VEC	1
+
+#define BWD_PCICMD_OFFSET	0xb004
+#define BWD_MBAR23_OFFSET	0xb018
+#define BWD_MBAR45_OFFSET	0xb020
+#define BWD_DEVCTRL_OFFSET	0xb048
+#define BWD_LINK_STATUS_OFFSET	0xb052
+
+#define BWD_SBAR2XLAT_OFFSET	0x0008
+#define BWD_SBAR4XLAT_OFFSET	0x0010
+#define BWD_PDOORBELL_OFFSET	0x0020
+#define BWD_PDBMSK_OFFSET	0x0028
+#define BWD_NTBCNTL_OFFSET	0x0060
+#define BWD_EBDF_OFFSET		0x0064
+#define BWD_SPAD_OFFSET		0x0080
+#define BWD_SPADSEMA_OFFSET	0x00c0
+#define BWD_STKYSPAD_OFFSET	0x00c4
+#define BWD_PBAR2XLAT_OFFSET	0x8008
+#define BWD_PBAR4XLAT_OFFSET	0x8010
+#define BWD_B2B_DOORBELL_OFFSET	0x8020
+#define BWD_B2B_SPAD_OFFSET	0x8080
+#define BWD_B2B_SPADSEMA_OFFSET	0x80c0
+#define BWD_B2B_STKYSPAD_OFFSET	0x80c4
+
+#define NTB_CNTL_BAR23_SNOOP	(1 << 2)
+#define NTB_CNTL_BAR45_SNOOP	(1 << 6)
+#define BWD_CNTL_LINK_DOWN	(1 << 16)
+
+#define NTB_PPD_OFFSET		0x00D4
+#define SNB_PPD_CONN_TYPE	0x0003
+#define SNB_PPD_DEV_TYPE	0x0010
+#define BWD_PPD_INIT_LINK	0x0004
+#define BWD_PPD_CONN_TYPE	0x0300
+#define BWD_PPD_DEV_TYPE	0x1000
+
+#define BWD_PBAR2XLAT_USD_ADDR	0x0000004000000000
+#define BWD_PBAR4XLAT_USD_ADDR	0x0000008000000000
+#define BWD_MBAR23_USD_ADDR	0x000000410000000C
+#define BWD_MBAR45_USD_ADDR	0x000000810000000C
+#define BWD_PBAR2XLAT_DSD_ADDR	0x0000004100000000
+#define BWD_PBAR4XLAT_DSD_ADDR	0x0000008100000000
+#define BWD_MBAR23_DSD_ADDR	0x000000400000000C
+#define BWD_MBAR45_DSD_ADDR	0x000000800000000C
diff --git a/drivers/ntb/ntb_transport.c b/drivers/ntb/ntb_transport.c
new file mode 100644
index 0000000..118a852
--- /dev/null
+++ b/drivers/ntb/ntb_transport.c
@@ -0,0 +1,1401 @@
+/*
+ * This file is provided under a dual BSD/GPLv2 license.  When using or
+ *   redistributing this file, you may do so under either license.
+ *
+ *   GPL LICENSE SUMMARY
+ *
+ *   Copyright(c) 2012 Intel Corporation. All rights reserved.
+ *
+ *   This program is free software; you can redistribute it and/or modify
+ *   it under the terms of version 2 of the GNU General Public License as
+ *   published by the Free Software Foundation.
+ *
+ *   BSD LICENSE
+ *
+ *   Copyright(c) 2012 Intel Corporation. All rights reserved.
+ *
+ *   Redistribution and use in source and binary forms, with or without
+ *   modification, are permitted provided that the following conditions
+ *   are met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copy
+ *       notice, this list of conditions and the following disclaimer in
+ *       the documentation and/or other materials provided with the
+ *       distribution.
+ *     * Neither the name of Intel Corporation nor the names of its
+ *       contributors may be used to endorse or promote products derived
+ *       from this software without specific prior written permission.
+ *
+ *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Intel PCIe NTB Linux driver
+ *
+ * Contact Information:
+ * Jon Mason <jon.mason@intel.com>
+ */
+#include <linux/debugfs.h>
+#include <linux/delay.h>
+#include <linux/dma-mapping.h>
+#include <linux/errno.h>
+#include <linux/export.h>
+#include <linux/interrupt.h>
+#include <linux/kthread.h>
+#include <linux/module.h>
+#include <linux/pci.h>
+#include <linux/slab.h>
+#include <linux/types.h>
+#include <linux/ntb.h>
+#include "ntb_hw.h"
+
+#define NTB_TRANSPORT_VERSION	1
+
+static int transport_mtu = 0x401E;
+module_param(transport_mtu, uint, 0644);
+MODULE_PARM_DESC(transport_mtu, "Maximum size of NTB transport packets");
+
+static unsigned int max_num_conns = 2;
+module_param(max_num_conns, uint, 0644);
+MODULE_PARM_DESC(max_num_conns, "Maximum number of NTB transport connections");
+
+struct ntb_queue_entry {
+	/* ntb_queue list reference */
+	struct list_head entry;
+	/* pointers to data to be transfered */
+	void *callback_data;
+	void *buf;
+	unsigned int len;
+	unsigned int flags;
+};
+
+struct ntb_transport;
+
+struct ntb_transport_qp {
+	struct ntb_transport *transport;
+	struct ntb_device *ndev;
+	void *cb_data;
+
+	bool client_ready;
+	bool qp_link;
+	u8 qp_num;	/* Only 64 QP's are allowed.  0-63 */
+
+	void (*tx_handler) (void *data, struct ntb_transport_qp *qp);
+	struct tasklet_struct tx_work;
+	struct list_head tx_comp_q;
+	struct list_head tx_free_q;
+	spinlock_t ntb_tx_comp_q_lock;
+	spinlock_t ntb_tx_free_q_lock;
+	void *tx_mw_begin;
+	void *tx_mw_end;
+	void *tx_offset;
+
+	void (*rx_handler) (void *data, struct ntb_transport_qp *qp);
+	struct tasklet_struct rx_work;
+	struct list_head rx_pend_q;
+	struct list_head rx_comp_q;
+	struct list_head rx_free_q;
+	spinlock_t ntb_rx_pend_q_lock;
+	spinlock_t ntb_rx_comp_q_lock;
+	spinlock_t ntb_rx_free_q_lock;
+	void *rx_buff_begin;
+	void *rx_buff_end;
+	void *rx_offset;
+
+	void (*event_handler) (void *data, int status);
+	struct delayed_work link_work;
+
+	struct dentry *debugfs_dir;
+	struct dentry *debugfs_stats;
+
+	/* Stats */
+	u64 rx_bytes;
+	u64 rx_pkts;
+	u64 rx_ring_empty;
+	u64 rx_err_no_buf;
+	u64 rx_err_oflow;
+	u64 rx_err_ver;
+	u64 tx_bytes;
+	u64 tx_pkts;
+	u64 tx_ring_full;
+};
+
+struct ntb_transport_mw {
+	size_t size;
+	void *virt_addr;
+	dma_addr_t dma_addr;
+};
+
+struct ntb_transport {
+	struct ntb_device *ndev;
+	struct ntb_transport_mw mw[NTB_NUM_MW];
+	struct ntb_transport_qp *qps;
+	unsigned int max_qps;
+	unsigned long qp_bitmap;
+	bool transport_link;
+	struct delayed_work link_work;
+	struct dentry *debugfs_dir;
+
+	struct device netdev;
+};
+
+enum {
+	DESC_DONE_FLAG = 1 << 0,
+	LINK_DOWN_FLAG = 1 << 1,
+	HW_ERROR_FLAG = 1 << 2,
+};
+
+struct ntb_payload_header {
+	u64 ver;
+	unsigned int len;
+	unsigned int flags;
+};
+
+enum {
+	VERSION = 0,
+	MW0_SZ,
+	MW1_SZ,
+	NUM_QPS,
+	QP_LINKS,
+	MAX_SPAD,
+};
+
+#define QP_TO_MW(qp)		((qp) % NTB_NUM_MW)
+#define NTB_QP_DEF_NUM_ENTRIES	100
+#define NTB_LINK_DOWN_TIMEOUT	10
+
+static int ntb_match_bus(struct device *dev, struct device_driver *drv)
+{
+	return !strncmp(dev_name(dev), drv->name, strlen(drv->name));
+}
+
+static int ntb_client_probe(struct device *dev)
+{
+	const struct ntb_client *drv = container_of(dev->driver,
+						    struct ntb_client, driver);
+	struct pci_dev *pdev = container_of(dev->parent, struct pci_dev, dev);
+	int rc = -EINVAL;
+
+	get_device(dev);
+	if (drv && drv->probe)
+		rc = drv->probe(pdev);
+	if (rc)
+		put_device(dev);
+
+	return rc;
+}
+
+static int ntb_client_remove(struct device *dev)
+{
+	const struct ntb_client *drv = container_of(dev->driver,
+						    struct ntb_client, driver);
+	struct pci_dev *pdev = container_of(dev->parent, struct pci_dev, dev);
+
+	if (drv && drv->remove)
+		drv->remove(pdev);
+
+	put_device(dev);
+
+	return 0;
+}
+
+static void ntb_client_release(struct device *dev)
+{
+}
+
+struct bus_type ntb_bus_type = {
+	.name = "ntb_bus",
+	.match = ntb_match_bus,
+	.probe = ntb_client_probe,
+	.remove = ntb_client_remove,
+};
+
+static int __devinit ntb_bus_init(struct ntb_transport *nt)
+{
+	struct device *dev = &nt->netdev;
+	int rc;
+
+	rc = bus_register(&ntb_bus_type);
+	if (rc)
+		goto err;
+
+	/* setup and register client devices */
+	dev_set_name(dev, "ntb_netdev");
+	dev->bus = &ntb_bus_type;
+	dev->release = ntb_client_release;
+	dev->parent = &ntb_query_pdev(nt->ndev)->dev;
+
+	rc = device_register(dev);
+	if (rc)
+		goto err1;
+
+	return 0;
+
+err1:
+	bus_unregister(&ntb_bus_type);
+err:
+	return rc;
+}
+
+static void __devexit ntb_bus_remove(struct ntb_transport *nt)
+{
+	device_unregister(&nt->netdev);
+
+	bus_unregister(&ntb_bus_type);
+}
+
+/**
+ * ntb_register_client - Register NTB client driver
+ * @drv: NTB client driver to be registered
+ *
+ * Register an NTB client driver with the NTB transport layer
+ *
+ * RETURNS: An appropriate -ERRNO error value on error, or zero for success.
+ */
+int ntb_register_client(struct ntb_client *drv)
+{
+	drv->driver.bus = &ntb_bus_type;
+
+	return driver_register(&drv->driver);
+}
+EXPORT_SYMBOL_GPL(ntb_register_client);
+
+/**
+ * ntb_unregister_client - Unregister NTB client driver
+ * @drv: NTB client driver to be unregistered
+ *
+ * Unregister an NTB client driver with the NTB transport layer
+ *
+ * RETURNS: An appropriate -ERRNO error value on error, or zero for success.
+ */
+void ntb_unregister_client(struct ntb_client *drv)
+{
+	driver_unregister(&drv->driver);
+}
+EXPORT_SYMBOL_GPL(ntb_unregister_client);
+
+static int debugfs_open(struct inode *inode, struct file *filp)
+{
+	filp->private_data = inode->i_private;
+	return 0;
+}
+
+static ssize_t debugfs_read(struct file *filp, char __user *ubuf, size_t count,
+			    loff_t *offp)
+{
+	struct ntb_transport_qp *qp;
+	char buf[512];
+	ssize_t ret, out_offset, out_count;
+
+	out_count = 512;
+
+	qp = filp->private_data;
+	out_offset = 0;
+	out_offset += snprintf(buf + out_offset, out_count - out_offset,
+			       "NTB Transport stats\n");
+	out_offset += snprintf(buf + out_offset, out_count - out_offset,
+			       "rx_bytes - %llu\n", qp->rx_bytes);
+	out_offset += snprintf(buf + out_offset, out_count - out_offset,
+			       "rx_pkts - %llu\n", qp->rx_pkts);
+	out_offset += snprintf(buf + out_offset, out_count - out_offset,
+			       "rx_ring_empty - %llu\n", qp->rx_ring_empty);
+	out_offset += snprintf(buf + out_offset, out_count - out_offset,
+			       "rx_err_no_buf - %llu\n", qp->rx_err_no_buf);
+	out_offset += snprintf(buf + out_offset, out_count - out_offset,
+			       "rx_er_oflow - %llu\n", qp->rx_err_oflow);
+	out_offset += snprintf(buf + out_offset, out_count - out_offset,
+			       "rx_err_ver - %llu\n", qp->rx_err_ver);
+	out_offset += snprintf(buf + out_offset, out_count - out_offset,
+			       "rx_offset - %p\n", qp->rx_offset);
+	out_offset += snprintf(buf + out_offset, out_count - out_offset,
+			       "tx_bytes - %llu\n", qp->tx_bytes);
+	out_offset += snprintf(buf + out_offset, out_count - out_offset,
+			       "tx_pkts - %llu\n", qp->tx_pkts);
+	out_offset += snprintf(buf + out_offset, out_count - out_offset,
+			       "tx_ring_full - %llu\n", qp->tx_ring_full);
+	out_offset += snprintf(buf + out_offset, out_count - out_offset,
+			       "tx_offset - %p\n", qp->tx_offset);
+
+	ret = simple_read_from_buffer(ubuf, count, offp, buf, out_offset);
+	return ret;
+}
+
+static const struct file_operations ntb_qp_debugfs_stats = {
+	.owner = THIS_MODULE,
+	.open = debugfs_open,
+	.read = debugfs_read,
+};
+
+static void ntb_list_add(spinlock_t *lock, struct list_head *entry,
+			 struct list_head *list)
+{
+	unsigned long flags;
+
+	spin_lock_irqsave(lock, flags);
+	list_add_tail(entry, list);
+	spin_unlock_irqrestore(lock, flags);
+}
+
+static struct ntb_queue_entry *ntb_list_rm(spinlock_t *lock,
+						struct list_head *list)
+{
+	struct ntb_queue_entry *entry;
+	unsigned long flags;
+
+	spin_lock_irqsave(lock, flags);
+	if (list_empty(list)) {
+		entry = NULL;
+		goto out;
+	}
+	entry = list_first_entry(list, struct ntb_queue_entry, entry);
+	list_del(&entry->entry);
+out:
+	spin_unlock_irqrestore(lock, flags);
+
+	return entry;
+}
+
+static int ntb_transport_setup_qp_mw(struct ntb_transport *nt,
+				     unsigned int qp_num)
+{
+	struct ntb_transport_qp *qp = &nt->qps[qp_num];
+	u8 mw_num = QP_TO_MW(qp_num);
+	unsigned int size, num_qps_mw;
+
+	WARN_ON(nt->mw[mw_num].virt_addr == 0);
+
+	if (nt->max_qps % NTB_NUM_MW && !mw_num)
+		num_qps_mw = nt->max_qps / NTB_NUM_MW +
+			     (nt->max_qps % NTB_NUM_MW - mw_num);
+	else
+		num_qps_mw = nt->max_qps / NTB_NUM_MW;
+
+	size = nt->mw[mw_num].size / num_qps_mw;
+	pr_debug("orig size = %d, num qps = %d, size = %d\n",
+		 (int) nt->mw[mw_num].size, nt->max_qps, size);
+
+	qp->rx_buff_begin = nt->mw[mw_num].virt_addr +
+			    (qp_num / NTB_NUM_MW * size);
+	qp->rx_buff_end = qp->rx_buff_begin + size;
+	pr_info("QP %d - RX Buff start %p end %p\n", qp->qp_num,
+		qp->rx_buff_begin, qp->rx_buff_end);
+	qp->rx_offset = qp->rx_buff_begin;
+
+	qp->tx_mw_begin = ntb_get_mw_vbase(nt->ndev, mw_num) +
+			  (qp_num / NTB_NUM_MW * size);
+	qp->tx_mw_end = qp->tx_mw_begin + size;
+	pr_info("QP %d - TX MW start %p end %p\n", qp->qp_num, qp->tx_mw_begin,
+		qp->tx_mw_end);
+	qp->tx_offset = qp->tx_mw_begin;
+
+	qp->rx_pkts = 0;
+	qp->tx_pkts = 0;
+
+	return 0;
+}
+
+static int ntb_set_mw(struct ntb_transport *nt, int num_mw, unsigned int size)
+{
+	struct ntb_transport_mw *mw = &nt->mw[num_mw];
+	struct pci_dev *pdev = ntb_query_pdev(nt->ndev);
+	void *offset;
+
+	/* Alloc memory for receiving data.  Must be 4k aligned */
+	mw->size = ALIGN(size, 4096);
+
+	mw->virt_addr = dma_alloc_coherent(&pdev->dev, mw->size, &mw->dma_addr,
+					   GFP_KERNEL);
+	if (!mw->virt_addr) {
+		pr_err("Unable to allocate MW buffer of size %d\n",
+		       (int) mw->size);
+		return -ENOMEM;
+	}
+
+	/* setup the hdr offsets with 0's */
+	for (offset = mw->virt_addr + transport_mtu -
+		      sizeof(struct ntb_payload_header);
+	     offset < mw->virt_addr + size; offset += transport_mtu)
+		memset(offset, 0, sizeof(struct ntb_payload_header));
+
+	/* Notify HW the memory location of the receive buffer */
+	ntb_set_mw_addr(nt->ndev, num_mw, mw->dma_addr);
+
+	return 0;
+}
+
+static void ntb_transport_event_callback(void *data, enum ntb_hw_event event)
+{
+	struct ntb_transport *nt = data;
+
+	if (event == NTB_EVENT_HW_ERROR)
+		BUG();
+
+	if (event == NTB_EVENT_HW_LINK_UP)
+		schedule_delayed_work(&nt->link_work, 0);
+
+	if (event == NTB_EVENT_HW_LINK_DOWN) {
+		int i;
+
+		nt->transport_link = NTB_LINK_DOWN;
+
+		/* Pass along the info to any clients */
+		for (i = 0; i < nt->max_qps; i++)
+			if (!test_bit(i, &nt->qp_bitmap)) {
+				struct ntb_transport_qp *qp = &nt->qps[i];
+
+				if (qp->event_handler &&
+				    qp->qp_link != NTB_LINK_DOWN)
+					qp->event_handler(qp->cb_data,
+							  NTB_LINK_DOWN);
+
+				qp->qp_link = NTB_LINK_DOWN;
+			}
+
+		/* The scratchpad registers keep the values if the remote side
+		 * goes down, blast them now to give them a sane value the next
+		 * time they are accessed
+		 */
+		for (i = 0; i < MAX_SPAD; i++) {
+			ntb_write_local_spad(nt->ndev, i, 0);
+			ntb_write_remote_spad(nt->ndev, i, 0);
+		}
+	}
+}
+
+static void ntb_transport_link_work(struct work_struct *work)
+{
+	struct ntb_transport *nt = container_of(work, struct ntb_transport,
+						link_work.work);
+	struct ntb_device *ndev = nt->ndev;
+	u32 val;
+	int rc, i;
+
+	/* send the local info */
+	rc = ntb_write_remote_spad(ndev, VERSION, NTB_TRANSPORT_VERSION);
+	if (rc) {
+		pr_err("Error writing %x to remote spad %d\n",
+		       0, VERSION);
+		goto out;
+	}
+
+	rc = ntb_write_remote_spad(ndev, MW0_SZ, ntb_get_mw_size(ndev, 0));
+	if (rc) {
+		pr_err("Error writing %x to remote spad %d\n",
+		       (u32) ntb_get_mw_size(ndev, 0), MW0_SZ);
+		goto out;
+	}
+
+	rc = ntb_write_remote_spad(ndev, MW1_SZ, ntb_get_mw_size(ndev, 1));
+	if (rc) {
+		pr_err("Error writing %x to remote spad %d\n",
+		       (u32) ntb_get_mw_size(ndev, 1), MW1_SZ);
+		goto out;
+	}
+
+	rc = ntb_write_remote_spad(ndev, NUM_QPS, nt->max_qps);
+	if (rc) {
+		pr_err("Error writing %x to remote spad %d\n",
+		       nt->max_qps, NUM_QPS);
+		goto out;
+	}
+
+	rc = ntb_write_remote_spad(ndev, QP_LINKS, 0);
+	if (rc) {
+		pr_err("Error writing %x to remote spad %d\n", 0, QP_LINKS);
+		goto out;
+	}
+
+	/* Query the remote side for its info */
+	rc = ntb_read_remote_spad(ndev, VERSION, &val);
+	if (rc) {
+		pr_err("Error reading remote spad %d\n", VERSION);
+		goto out;
+	}
+
+	if (val != NTB_TRANSPORT_VERSION)
+		goto out;
+	pr_info("Remote version = %d\n", val);
+
+	rc = ntb_read_remote_spad(ndev, NUM_QPS, &val);
+	if (rc) {
+		pr_err("Error reading remote spad %d\n", NUM_QPS);
+		goto out;
+	}
+
+	if (val != nt->max_qps)
+		goto out;
+	pr_info("Remote max number of qps = %d\n", val);
+
+	rc = ntb_read_remote_spad(ndev, MW0_SZ, &val);
+	if (rc) {
+		pr_err("Error reading remote spad %d\n", MW0_SZ);
+		goto out;
+	}
+
+	if (!val)
+		goto out;
+	pr_info("Remote MW0 size = %d\n", val);
+
+	rc = ntb_set_mw(nt, 0, val);
+	if (rc)
+		goto out;
+
+	rc = ntb_read_remote_spad(ndev, MW1_SZ, &val);
+	if (rc) {
+		pr_err("Error reading remote spad %d\n", MW1_SZ);
+		goto out;
+	}
+
+	if (!val)
+		goto out;
+	pr_info("Remote MW1 size = %d\n", val);
+
+	rc = ntb_set_mw(nt, 1, val);
+	if (rc)
+		goto out;
+
+	for (i = 0; i < nt->max_qps; i++) {
+		struct ntb_transport_qp *qp = &nt->qps[i];
+
+		rc = ntb_transport_setup_qp_mw(nt, i);
+		if (rc)
+			goto out;
+
+		if (qp->client_ready)
+			schedule_delayed_work(&qp->link_work, 0);
+	}
+
+	nt->transport_link = NTB_LINK_UP;
+
+	return;
+
+out:
+	if (ntb_hw_link_status(ndev))
+		schedule_delayed_work(&nt->link_work,
+				      msecs_to_jiffies(NTB_LINK_DOWN_TIMEOUT));
+}
+
+static void ntb_qp_link_work(struct work_struct *work)
+{
+	struct ntb_transport_qp *qp;
+	struct ntb_transport *nt;
+	int rc, val;
+
+	qp = container_of(work, struct ntb_transport_qp, link_work.work);
+	nt = qp->transport;
+
+	WARN_ON(nt->transport_link != NTB_LINK_UP);
+
+	rc = ntb_read_local_spad(nt->ndev, QP_LINKS, &val);
+	if (rc) {
+		pr_err("Error reading spad %d\n", QP_LINKS);
+		return;
+	}
+
+	rc = ntb_write_remote_spad(nt->ndev, QP_LINKS, val | 1 << qp->qp_num);
+	if (rc)
+		pr_err("Error writing %x to remote spad %d\n",
+		       val | 1 << qp->qp_num, QP_LINKS);
+
+	/* query remote spad for qp ready bits */
+	rc = ntb_read_remote_spad(nt->ndev, QP_LINKS, &val);
+	if (rc)
+		pr_err("Error reading remote spad %d\n", QP_LINKS);
+
+	pr_debug("Remote QP link status = %x\n", val);
+
+	/* See if the remote side is up */
+	if (1 << qp->qp_num & val) {
+		qp->qp_link = NTB_LINK_UP;
+
+		if (qp->event_handler)
+			qp->event_handler(qp->cb_data, NTB_LINK_UP);
+	} else if (ntb_hw_link_status(nt->ndev))
+		schedule_delayed_work(&qp->link_work,
+				      msecs_to_jiffies(NTB_LINK_DOWN_TIMEOUT));
+}
+
+static void ntb_transport_init_queue(struct ntb_transport *nt,
+				     unsigned int qp_num)
+{
+	struct ntb_transport_qp *qp;
+
+	qp = &nt->qps[qp_num];
+	qp->qp_num = qp_num;
+	qp->transport = nt;
+	qp->ndev = nt->ndev;
+	qp->qp_link = NTB_LINK_DOWN;
+
+	if (nt->debugfs_dir) {
+		char debugfs_name[4];
+
+		snprintf(debugfs_name, 4, "qp%d", qp_num);
+		qp->debugfs_dir = debugfs_create_dir(debugfs_name,
+						     nt->debugfs_dir);
+
+		qp->debugfs_stats = debugfs_create_file("stats", S_IRUSR,
+							qp->debugfs_dir, qp,
+							&ntb_qp_debugfs_stats);
+	}
+
+	INIT_DELAYED_WORK(&qp->link_work, ntb_qp_link_work);
+
+	spin_lock_init(&qp->ntb_rx_comp_q_lock);
+	spin_lock_init(&qp->ntb_rx_pend_q_lock);
+	spin_lock_init(&qp->ntb_rx_free_q_lock);
+	spin_lock_init(&qp->ntb_tx_comp_q_lock);
+	spin_lock_init(&qp->ntb_tx_free_q_lock);
+
+	INIT_LIST_HEAD(&qp->rx_pend_q);
+	INIT_LIST_HEAD(&qp->rx_comp_q);
+	INIT_LIST_HEAD(&qp->rx_free_q);
+	INIT_LIST_HEAD(&qp->tx_comp_q);
+	INIT_LIST_HEAD(&qp->tx_free_q);
+}
+
+int ntb_transport_init(struct pci_dev *pdev)
+{
+	struct ntb_transport *nt;
+	int rc, i;
+
+	nt = kzalloc(sizeof(struct ntb_transport), GFP_KERNEL);
+	if (!nt)
+		return -ENOMEM;
+
+	if (debugfs_initialized())
+		nt->debugfs_dir = debugfs_create_dir(KBUILD_MODNAME, NULL);
+	else
+		nt->debugfs_dir = NULL;
+
+	nt->ndev = ntb_register_transport(pdev, nt);
+	if (!nt->ndev) {
+		rc = -EIO;
+		goto err;
+	}
+
+	nt->max_qps = ntb_query_max_cbs(nt->ndev);
+	if (!nt->max_qps) {
+		rc = -EIO;
+		goto err1;
+	}
+	nt->max_qps = min(nt->max_qps, max_num_conns);
+
+	nt->qps = kcalloc(nt->max_qps, sizeof(struct ntb_transport_qp),
+			  GFP_KERNEL);
+	if (!nt->qps) {
+		rc = -ENOMEM;
+		goto err1;
+	}
+
+	nt->qp_bitmap = ((u64) 1 << nt->max_qps) - 1;
+
+	for (i = 0; i < nt->max_qps; i++)
+		ntb_transport_init_queue(nt, i);
+
+	rc = ntb_register_event_callback(nt->ndev,
+					 ntb_transport_event_callback);
+	if (rc)
+		goto err2;
+
+	ntb_bus_init(nt);
+
+	INIT_DELAYED_WORK(&nt->link_work, ntb_transport_link_work);
+
+	if (ntb_hw_link_status(nt->ndev))
+		schedule_delayed_work(&nt->link_work, 0);
+
+	return 0;
+
+err2:
+	kfree(nt->qps);
+err1:
+	ntb_unregister_transport(nt->ndev);
+err:
+	debugfs_remove_recursive(nt->debugfs_dir);
+	kfree(nt);
+	return rc;
+}
+
+void ntb_transport_free(void *transport)
+{
+	struct ntb_transport *nt = transport;
+	struct pci_dev *pdev;
+	int i;
+
+	nt->transport_link = NTB_LINK_DOWN;
+
+	/* verify that all the qp's are freed */
+	while (!nt->qp_bitmap) {
+		i = ffz(nt->qp_bitmap);
+		if (i == ((u64) 1 << nt->max_qps))
+			break;
+		ntb_transport_free_queue(&nt->qps[i]);
+	}
+
+	ntb_bus_remove(nt);
+
+	cancel_delayed_work_sync(&nt->link_work);
+
+	debugfs_remove_recursive(nt->debugfs_dir);
+
+	ntb_unregister_event_callback(nt->ndev);
+
+	pdev = ntb_query_pdev(nt->ndev);
+
+	for (i = 0; i < NTB_NUM_MW; i++)
+		if (nt->mw[i].virt_addr)
+			dma_free_coherent(&pdev->dev, nt->mw[i].size,
+					  nt->mw[i].virt_addr,
+					  nt->mw[i].dma_addr);
+
+	kfree(nt->qps);
+	ntb_unregister_transport(nt->ndev);
+	kfree(nt);
+}
+
+static void ntb_rx_copy_task(struct ntb_transport_qp *qp,
+			     struct ntb_queue_entry *entry, void *offset)
+{
+
+	struct ntb_payload_header *hdr;
+
+	hdr = offset + transport_mtu - sizeof(struct ntb_payload_header);
+	entry->len = hdr->len;
+
+	memcpy(entry->buf, offset, entry->len);
+
+	/* Ensure that the data is fully copied out before clearing the flag */
+	wmb();
+	hdr->flags = 0;
+	ntb_list_add(&qp->ntb_rx_comp_q_lock, &entry->entry,
+			  &qp->rx_comp_q);
+
+	if (qp->rx_handler && qp->client_ready)
+		qp->rx_handler(qp->cb_data, qp);
+}
+
+static int ntb_process_rxc(struct ntb_transport_qp *qp)
+{
+	struct ntb_payload_header *hdr;
+	struct ntb_queue_entry *entry;
+	void *offset;
+
+	entry = ntb_list_rm(&qp->ntb_rx_pend_q_lock, &qp->rx_pend_q);
+	if (!entry) {
+		hdr = qp->rx_offset;
+		pr_debug("no buffer - HDR ver %llu, len %d, flags %x\n",
+			 hdr->ver, hdr->len, hdr->flags);
+		qp->rx_err_no_buf++;
+		return -ENOMEM;
+	}
+
+	offset = qp->rx_offset;
+	hdr = offset + transport_mtu - sizeof(struct ntb_payload_header);
+
+	if (!(hdr->flags & DESC_DONE_FLAG)) {
+		ntb_list_add(&qp->ntb_rx_pend_q_lock, &entry->entry,
+				  &qp->rx_pend_q);
+		qp->rx_ring_empty++;
+		return -EAGAIN;
+	}
+
+	if (hdr->ver != qp->rx_pkts) {
+		pr_debug("qp %d: version mismatch, expected %llu - got %llu\n",
+			 qp->qp_num, qp->rx_pkts, hdr->ver);
+		ntb_list_add(&qp->ntb_rx_pend_q_lock, &entry->entry,
+				  &qp->rx_pend_q);
+		qp->rx_err_ver++;
+		return -EIO;
+	}
+
+	if (hdr->flags & NTB_LINK_DOWN) {
+		pr_info("qp %d: Link Down\n", qp->qp_num);
+		qp->qp_link = NTB_LINK_DOWN;
+		schedule_delayed_work(&qp->link_work,
+				      msecs_to_jiffies(NTB_LINK_DOWN_TIMEOUT));
+
+		if (qp->event_handler)
+			qp->event_handler(qp->cb_data, NTB_LINK_DOWN);
+
+		ntb_list_add(&qp->ntb_rx_pend_q_lock, &entry->entry,
+				  &qp->rx_pend_q);
+
+		/* Ensure that the data is fully copied out before clearing the
+		 * done flag
+		 */
+		wmb();
+		hdr->flags = 0;
+		goto out;
+	}
+
+	pr_debug("rx offset %p, ver %llu - %d payload received, buf size %d\n",
+		 qp->rx_offset, hdr->ver, hdr->len, entry->len);
+
+	if (hdr->len <= entry->len)
+		ntb_rx_copy_task(qp, entry, offset);
+	else {
+		ntb_list_add(&qp->ntb_rx_pend_q_lock, &entry->entry,
+				  &qp->rx_pend_q);
+
+		/* Ensure that the data is fully copied out before clearing the
+		 * done flag
+		 */
+		wmb();
+		hdr->flags = 0;
+		qp->rx_err_oflow++;
+		pr_err("RX overflow! Wanted %d got %d\n", hdr->len, entry->len);
+	}
+
+	qp->rx_bytes += hdr->len;
+	qp->rx_pkts++;
+
+out:
+	qp->rx_offset += transport_mtu;
+	if (qp->rx_offset + transport_mtu >= qp->rx_buff_end)
+		qp->rx_offset = qp->rx_buff_begin;
+
+	return 0;
+}
+
+static void ntb_transport_rx(unsigned long data)
+{
+	struct ntb_transport_qp *qp = (struct ntb_transport_qp *)data;
+	int rc;
+
+	do {
+		rc = ntb_process_rxc(qp);
+	} while (!rc);
+}
+
+static void ntb_transport_rxc_db(void *data, int db_num)
+{
+	struct ntb_transport_qp *qp = data;
+
+	pr_debug("%s: doorbell %d received\n", __func__, db_num);
+
+	tasklet_schedule(&qp->rx_work);
+}
+
+static void ntb_tx_copy_task(struct ntb_transport_qp *qp,
+			     struct ntb_queue_entry *entry,
+			     void *offset)
+{
+	struct ntb_payload_header *hdr;
+
+	memcpy_toio(offset, entry->buf, entry->len);
+
+	hdr = offset + transport_mtu - sizeof(struct ntb_payload_header);
+	hdr->len = entry->len;
+	hdr->ver = qp->tx_pkts;
+
+	/* Ensure that the data is fully copied out before setting the flag */
+	wmb();
+	hdr->flags = entry->flags | DESC_DONE_FLAG;
+
+	ntb_ring_sdb(qp->ndev, qp->qp_num);
+
+	/* The entry length can only be zero if the packet is intended to be a
+	 * "link down" or similar.  Since no payload is being sent in these
+	 * cases, there is nothing to add to the completion queue.
+	 */
+	if (entry->len > 0) {
+		qp->tx_bytes += entry->len;
+
+		/* Add fully transmitted data to completion queue */
+		ntb_list_add(&qp->ntb_tx_comp_q_lock, &entry->entry,
+				  &qp->tx_comp_q);
+
+		if (qp->tx_handler)
+			qp->tx_handler(qp->cb_data, qp);
+	} else
+		ntb_list_add(&qp->ntb_tx_free_q_lock, &entry->entry,
+				  &qp->tx_free_q);
+}
+
+static int ntb_process_tx(struct ntb_transport_qp *qp,
+			  struct ntb_queue_entry *entry)
+{
+	struct ntb_payload_header *hdr;
+	void *offset;
+
+	offset = qp->tx_offset;
+	hdr = offset + transport_mtu - sizeof(struct ntb_payload_header);
+
+	pr_debug("%lld - offset %p, tx %p, entry len %d flags %x buff %p\n",
+		 qp->tx_pkts, offset, qp->tx_offset, entry->len, entry->flags,
+		 entry->buf);
+	if (hdr->flags) {
+		qp->tx_ring_full++;
+		return -EAGAIN;
+	}
+
+	if (entry->len > transport_mtu) {
+		pr_err("Trying to send pkt size of %d\n", entry->len);
+		entry->flags = HW_ERROR_FLAG;
+
+		if (qp->tx_handler)
+			qp->tx_handler(qp->cb_data, qp);
+
+		return 0;
+	}
+
+	ntb_tx_copy_task(qp, entry, offset);
+
+	qp->tx_offset += transport_mtu;
+	if (qp->tx_offset + transport_mtu >= qp->tx_mw_end)
+		qp->tx_offset = qp->tx_mw_begin;
+
+	qp->tx_pkts++;
+
+	return 0;
+}
+
+static void ntb_send_link_down(struct ntb_transport_qp *qp)
+{
+	struct ntb_queue_entry *entry;
+	int i;
+
+	if (qp->qp_link == NTB_LINK_DOWN)
+		return;
+
+	qp->qp_link = NTB_LINK_DOWN;
+
+	/* Give Tx enough time to quiesce */
+	msleep(1000);
+
+	for (i = 0; i < NTB_LINK_DOWN_TIMEOUT; i++) {
+		entry = ntb_list_rm(&qp->ntb_tx_free_q_lock,
+					 &qp->tx_free_q);
+		if (entry)
+			break;
+		msleep(100);
+	}
+
+	entry->callback_data = NULL;
+	entry->buf = NULL;
+	entry->len = 0;
+	entry->flags = LINK_DOWN_FLAG;
+
+	ntb_process_tx(qp, entry);
+}
+
+/**
+ * ntb_transport_create_queue - Create a new NTB transport layer queue
+ * @rx_handler: receive callback function
+ * @tx_handler: transmit callback function
+ * @event_handler: event callback function
+ *
+ * Create a new NTB transport layer queue and provide the queue with a callback
+ * routine for both transmit and receive.  The receive callback routine will be
+ * used to pass up data when the transport has received it on the queue.   The
+ * transmit callback routine will be called when the transport has completed the
+ * transmission of the data on the queue and the data is ready to be freed.
+ *
+ * RETURNS: pointer to newly created ntb_queue, NULL on error.
+ */
+struct ntb_transport_qp *
+ntb_transport_create_queue(void *data, struct pci_dev *pdev,
+			   const struct ntb_queue_handlers *handlers)
+{
+	struct ntb_queue_entry *entry;
+	struct ntb_transport_qp *qp;
+	struct ntb_transport *nt;
+	unsigned int free_queue;
+	int rc, i;
+
+	nt = ntb_find_transport(pdev);
+	if (!nt)
+		goto err;
+
+	free_queue = ffs(nt->qp_bitmap);
+	if (!free_queue)
+		goto err;
+
+	/* decrement free_queue to make it zero based */
+	free_queue--;
+
+	clear_bit(free_queue, &nt->qp_bitmap);
+
+	qp = &nt->qps[free_queue];
+	qp->cb_data = data;
+	qp->rx_handler = handlers->rx_handler;
+	qp->tx_handler = handlers->tx_handler;
+	qp->event_handler = handlers->event_handler;
+
+	for (i = 0; i < NTB_QP_DEF_NUM_ENTRIES; i++) {
+		entry = kzalloc(sizeof(struct ntb_queue_entry), GFP_ATOMIC);
+		if (!entry)
+			goto err1;
+
+		ntb_list_add(&qp->ntb_rx_free_q_lock, &entry->entry,
+				  &qp->rx_free_q);
+	}
+
+	for (i = 0; i < NTB_QP_DEF_NUM_ENTRIES; i++) {
+		entry = kzalloc(sizeof(struct ntb_queue_entry), GFP_ATOMIC);
+		if (!entry)
+			goto err2;
+
+		ntb_list_add(&qp->ntb_tx_free_q_lock, &entry->entry,
+				  &qp->tx_free_q);
+	}
+
+	tasklet_init(&qp->rx_work, ntb_transport_rx, (unsigned long) qp);
+
+	rc = ntb_register_db_callback(qp->ndev, free_queue, qp,
+				      ntb_transport_rxc_db);
+	if (rc)
+		goto err3;
+
+	pr_info("NTB Transport QP %d created\n", qp->qp_num);
+
+	return qp;
+
+err3:
+	tasklet_disable(&qp->rx_work);
+	tasklet_disable(&qp->tx_work);
+err2:
+	while ((entry =
+		ntb_list_rm(&qp->ntb_tx_free_q_lock, &qp->tx_free_q)))
+		kfree(entry);
+err1:
+	while ((entry =
+		ntb_list_rm(&qp->ntb_rx_free_q_lock, &qp->rx_free_q)))
+		kfree(entry);
+	set_bit(free_queue, &nt->qp_bitmap);
+err:
+	return NULL;
+}
+EXPORT_SYMBOL_GPL(ntb_transport_create_queue);
+
+/**
+ * ntb_transport_free_queue - Frees NTB transport queue
+ * @qp: NTB queue to be freed
+ *
+ * Frees NTB transport queue
+ */
+void ntb_transport_free_queue(struct ntb_transport_qp *qp)
+{
+	struct ntb_queue_entry *entry;
+
+	if (!qp)
+		return;
+
+	cancel_delayed_work_sync(&qp->link_work);
+
+	ntb_unregister_db_callback(qp->ndev, qp->qp_num);
+	tasklet_disable(&qp->rx_work);
+	tasklet_disable(&qp->tx_work);
+
+	while ((entry =
+		ntb_list_rm(&qp->ntb_rx_free_q_lock, &qp->rx_free_q)))
+		kfree(entry);
+
+	while ((entry =
+		ntb_list_rm(&qp->ntb_rx_pend_q_lock, &qp->rx_pend_q))) {
+		pr_warn("Freeing item from a non-empty queue\n");
+		kfree(entry);
+	}
+
+	while ((entry =
+		ntb_list_rm(&qp->ntb_rx_comp_q_lock, &qp->rx_comp_q))) {
+		pr_warn("Freeing item from a non-empty queue\n");
+		kfree(entry);
+	}
+
+	while ((entry =
+		ntb_list_rm(&qp->ntb_tx_free_q_lock, &qp->tx_free_q)))
+		kfree(entry);
+
+	while ((entry =
+		ntb_list_rm(&qp->ntb_tx_comp_q_lock, &qp->tx_comp_q))) {
+		pr_warn("Freeing item from a non-empty queue\n");
+		kfree(entry);
+	}
+
+	set_bit(qp->qp_num, &qp->transport->qp_bitmap);
+
+	pr_info("NTB Transport QP %d freed\n", qp->qp_num);
+}
+EXPORT_SYMBOL_GPL(ntb_transport_free_queue);
+
+/**
+ * ntb_transport_rx_remove - Dequeues enqueued rx packet
+ * @qp: NTB queue to be freed
+ * @len: pointer to variable to write enqueued buffers length
+ *
+ * Dequeues unused buffers from receive queue.  Should only be used during
+ * shutdown of qp.
+ *
+ * RETURNS: NULL error value on error, or void* for success.
+ */
+void *ntb_transport_rx_remove(struct ntb_transport_qp *qp, unsigned int *len)
+{
+	struct ntb_queue_entry *entry;
+	void *buf;
+
+	if (!qp || qp->client_ready == NTB_LINK_UP)
+		return NULL;
+
+	entry = ntb_list_rm(&qp->ntb_rx_pend_q_lock, &qp->rx_pend_q);
+	if (!entry)
+		return NULL;
+
+	buf = entry->callback_data;
+	*len = entry->len;
+
+	ntb_list_add(&qp->ntb_rx_free_q_lock, &entry->entry,
+			  &qp->rx_free_q);
+
+	return buf;
+}
+EXPORT_SYMBOL_GPL(ntb_transport_rx_remove);
+
+/**
+ * ntb_transport_rx_enqueue - Enqueue a new NTB queue entry
+ * @qp: NTB transport layer queue the entry is to be enqueued on
+ * @cb: per buffer pointer for callback function to use
+ * @data: pointer to data buffer that incoming packets will be copied into
+ * @len: length of the data buffer
+ *
+ * Enqueue a new receive buffer onto the transport queue into which a NTB
+ * payload can be received into.
+ *
+ * RETURNS: An appropriate -ERRNO error value on error, or zero for success.
+ */
+int ntb_transport_rx_enqueue(struct ntb_transport_qp *qp, void *cb, void *data,
+			     unsigned int len)
+{
+	struct ntb_queue_entry *entry;
+
+	if (!qp)
+		return -EINVAL;
+
+	entry = ntb_list_rm(&qp->ntb_rx_free_q_lock, &qp->rx_free_q);
+	if (!entry)
+		return -ENOMEM;
+
+	entry->callback_data = cb;
+	entry->buf = data;
+	entry->len = len;
+
+	ntb_list_add(&qp->ntb_rx_pend_q_lock, &entry->entry,
+			  &qp->rx_pend_q);
+
+	return 0;
+}
+EXPORT_SYMBOL_GPL(ntb_transport_rx_enqueue);
+
+/**
+ * ntb_transport_tx_enqueue - Enqueue a new NTB queue entry
+ * @qp: NTB transport layer queue the entry is to be enqueued on
+ * @cb: per buffer pointer for callback function to use
+ * @data: pointer to data buffer that will be sent
+ * @len: length of the data buffer
+ *
+ * Enqueue a new transmit buffer onto the transport queue from which a NTB
+ * payload will be transmitted.
+ *
+ * RETURNS: An appropriate -ERRNO error value on error, or zero for success.
+ */
+int ntb_transport_tx_enqueue(struct ntb_transport_qp *qp, void *cb, void *data,
+			     unsigned int len)
+{
+	struct ntb_queue_entry *entry;
+
+	if (!qp || qp->qp_link != NTB_LINK_UP || !len)
+		return -EINVAL;
+
+	entry = ntb_list_rm(&qp->ntb_tx_free_q_lock, &qp->tx_free_q);
+	if (!entry) {
+		/* ring full, kick it */
+		tasklet_schedule(&qp->tx_work);
+		return -ENOMEM;
+	}
+
+	entry->callback_data = cb;
+	entry->buf = data;
+	entry->len = len;
+	entry->flags = 0;
+
+	return ntb_process_tx(qp, entry);
+}
+EXPORT_SYMBOL_GPL(ntb_transport_tx_enqueue);
+
+/**
+ * ntb_transport_tx_dequeue - Dequeue a NTB queue entry
+ * @qp: NTB transport layer queue to be dequeued from
+ * @len: length of the data buffer
+ *
+ * This function will dequeue a buffer from the transmit complete queue.
+ * Entries will only be enqueued on this queue after having been
+ * transfered to the remote side.
+ *
+ * RETURNS: callback pointer of the buffer from the transport queue, or NULL
+ * on empty
+ */
+void *ntb_transport_tx_dequeue(struct ntb_transport_qp *qp, unsigned int *len)
+{
+	struct ntb_queue_entry *entry;
+	void *buf;
+
+	if (!qp)
+		return NULL;
+
+	entry = ntb_list_rm(&qp->ntb_tx_comp_q_lock, &qp->tx_comp_q);
+	if (!entry)
+		return NULL;
+
+	buf = entry->callback_data;
+	if (entry->flags != HW_ERROR_FLAG)
+		*len = entry->len;
+	else
+		*len = -EIO;
+
+	ntb_list_add(&qp->ntb_tx_free_q_lock, &entry->entry,
+			  &qp->tx_free_q);
+
+	return buf;
+}
+EXPORT_SYMBOL_GPL(ntb_transport_tx_dequeue);
+
+/**
+ * ntb_transport_rx_dequeue - Dequeue a NTB queue entry
+ * @qp: NTB transport layer queue to be dequeued from
+ * @len: length of the data buffer
+ *
+ * This function will dequeue a buffer from the receive complete queue.
+ * Entries will only be enqueued on this queue after having been fully received.
+ *
+ * RETURNS: callback pointer of the buffer from the transport queue, or NULL
+ * on empty
+ */
+void *ntb_transport_rx_dequeue(struct ntb_transport_qp *qp, unsigned int *len)
+{
+	struct ntb_queue_entry *entry;
+	void *buf;
+
+	if (!qp)
+		return NULL;
+
+	entry = ntb_list_rm(&qp->ntb_rx_comp_q_lock, &qp->rx_comp_q);
+	if (!entry)
+		return NULL;
+
+	buf = entry->callback_data;
+	*len = entry->len;
+
+	ntb_list_add(&qp->ntb_rx_free_q_lock, &entry->entry,
+			  &qp->rx_free_q);
+
+	return buf;
+}
+EXPORT_SYMBOL_GPL(ntb_transport_rx_dequeue);
+
+/**
+ * ntb_transport_link_up - Notify NTB transport of client readiness to use queue
+ * @qp: NTB transport layer queue to be enabled
+ *
+ * Notify NTB transport layer of client readiness to use queue
+ */
+void ntb_transport_link_up(struct ntb_transport_qp *qp)
+{
+	if (!qp)
+		return;
+
+	qp->client_ready = NTB_LINK_UP;
+
+	if (qp->transport->transport_link == NTB_LINK_UP)
+		schedule_delayed_work(&qp->link_work, 0);
+}
+EXPORT_SYMBOL_GPL(ntb_transport_link_up);
+
+/**
+ * ntb_transport_link_down - Notify NTB transport to no longer enqueue data
+ * @qp: NTB transport layer queue to be disabled
+ *
+ * Notify NTB transport layer of client's desire to no longer receive data on
+ * transport queue specified.  It is the client's responsibility to ensure all
+ * entries on queue are purged or otherwise handled appropraitely.
+ */
+void ntb_transport_link_down(struct ntb_transport_qp *qp)
+{
+	int rc, val;
+
+	if (!qp)
+		return;
+
+	qp->client_ready = NTB_LINK_DOWN;
+
+	cancel_delayed_work_sync(&qp->link_work);
+	qp->qp_link = NTB_LINK_DOWN;
+
+	rc = ntb_read_local_spad(qp->ndev, QP_LINKS, &val);
+	if (rc) {
+		pr_err("Error reading spad %d\n", QP_LINKS);
+		return;
+	}
+
+	rc = ntb_write_remote_spad(qp->ndev, QP_LINKS,
+				   val & ~(1 << qp->qp_num));
+	if (rc)
+		pr_err("Error writing %x to remote spad %d\n",
+		       val & ~(1 << qp->qp_num), QP_LINKS);
+
+	if (qp->transport->transport_link == NTB_LINK_UP)
+		ntb_send_link_down(qp);
+}
+EXPORT_SYMBOL_GPL(ntb_transport_link_down);
+
+/**
+ * ntb_transport_link_query - Query transport link state
+ * @qp: NTB transport layer queue to be queried
+ *
+ * Query connectivity to the remote system of the NTB transport queue
+ *
+ * RETURNS: true for link up or false for link down
+ */
+bool ntb_transport_link_query(struct ntb_transport_qp *qp)
+{
+	return qp->qp_link == NTB_LINK_UP;
+}
+EXPORT_SYMBOL_GPL(ntb_transport_link_query);
+
+/**
+ * ntb_transport_qp_num - Query the qp number
+ * @qp: NTB transport layer queue to be queried
+ *
+ * Query qp number of the NTB transport queue
+ *
+ * RETURNS: a zero based number specifying the qp number
+ */
+unsigned char ntb_transport_qp_num(struct ntb_transport_qp *qp)
+{
+	return qp->qp_num;
+}
+EXPORT_SYMBOL_GPL(ntb_transport_qp_num);
+
+/**
+ * ntb_transport_max_size - Query the max payload size of a qp
+ * @qp: NTB transport layer queue to be queried
+ *
+ * Query the maximum payload size permissible on the given qp
+ *
+ * RETURNS: the max payload size of a qp
+ */
+unsigned int
+ntb_transport_max_size(__attribute__((unused)) struct ntb_transport_qp *qp)
+{
+	return transport_mtu - sizeof(struct ntb_payload_header);
+}
+EXPORT_SYMBOL_GPL(ntb_transport_max_size);
diff --git a/include/linux/ntb.h b/include/linux/ntb.h
new file mode 100644
index 0000000..01c2651
--- /dev/null
+++ b/include/linux/ntb.h
@@ -0,0 +1,81 @@
+/*
+ * This file is provided under a dual BSD/GPLv2 license.  When using or
+ *   redistributing this file, you may do so under either license.
+ *
+ *   GPL LICENSE SUMMARY
+ *
+ *   Copyright(c) 2012 Intel Corporation. All rights reserved.
+ *
+ *   This program is free software; you can redistribute it and/or modify
+ *   it under the terms of version 2 of the GNU General Public License as
+ *   published by the Free Software Foundation.
+ *
+ *   BSD LICENSE
+ *
+ *   Copyright(c) 2012 Intel Corporation. All rights reserved.
+ *
+ *   Redistribution and use in source and binary forms, with or without
+ *   modification, are permitted provided that the following conditions
+ *   are met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copy
+ *       notice, this list of conditions and the following disclaimer in
+ *       the documentation and/or other materials provided with the
+ *       distribution.
+ *     * Neither the name of Intel Corporation nor the names of its
+ *       contributors may be used to endorse or promote products derived
+ *       from this software without specific prior written permission.
+ *
+ *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Intel PCIe NTB Linux driver
+ *
+ * Contact Information:
+ * Jon Mason <jon.mason@intel.com>
+ */
+
+struct ntb_transport_qp;
+
+struct ntb_client {
+	struct device_driver driver;
+	int (*probe) (struct pci_dev *pdev);
+	void (*remove) (struct pci_dev *pdev);
+};
+
+int ntb_register_client(struct ntb_client *drvr);
+void ntb_unregister_client(struct ntb_client *drvr);
+
+struct ntb_queue_handlers {
+	void (*tx_handler) (void *data, struct ntb_transport_qp *qp);
+	void (*rx_handler) (void *data, struct ntb_transport_qp *qp);
+	void (*event_handler) (void *data, int status);
+};
+
+unsigned char ntb_transport_qp_num(struct ntb_transport_qp *qp);
+unsigned int ntb_transport_max_size(struct ntb_transport_qp *qp);
+struct ntb_transport_qp *
+ntb_transport_create_queue(void *data, struct pci_dev *pdev,
+			   const struct ntb_queue_handlers *handlers);
+void ntb_transport_free_queue(struct ntb_transport_qp *qp);
+int ntb_transport_rx_enqueue(struct ntb_transport_qp *qp, void *cb, void *data,
+			     unsigned int len);
+int ntb_transport_tx_enqueue(struct ntb_transport_qp *qp, void *cb, void *data,
+			     unsigned int len);
+void *ntb_transport_tx_dequeue(struct ntb_transport_qp *qp, unsigned int *len);
+void *ntb_transport_rx_dequeue(struct ntb_transport_qp *qp, unsigned int *len);
+void *ntb_transport_rx_remove(struct ntb_transport_qp *qp, unsigned int *len);
+void ntb_transport_link_up(struct ntb_transport_qp *qp);
+void ntb_transport_link_down(struct ntb_transport_qp *qp);
+bool ntb_transport_link_query(struct ntb_transport_qp *qp);
-- 
1.7.9.5

^ permalink raw reply related

* [PATCH 2/2] net: Add support for NTB virtual ethernet device
From: Jon Mason @ 2012-10-02 21:26 UTC (permalink / raw)
  To: linux-kernel; +Cc: netdev, linux-pci, Dave Jiang, Nicholas Bellinger
In-Reply-To: <1349213177-9985-1-git-send-email-jon.mason@intel.com>

A virtual ethernet device that uses the NTB transport API to send/receive data.

Signed-off-by: Jon Mason <jon.mason@intel.com>
---
 drivers/net/Kconfig      |    4 +
 drivers/net/Makefile     |    1 +
 drivers/net/ntb_netdev.c |  407 ++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 412 insertions(+)
 create mode 100644 drivers/net/ntb_netdev.c

diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 0c2bd80..9bf8a71 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -178,6 +178,10 @@ config NETPOLL_TRAP
 config NET_POLL_CONTROLLER
 	def_bool NETPOLL
 
+config NTB_NETDEV
+	tristate "Virtual Ethernet over NTB"
+	depends on NTB
+
 config RIONET
 	tristate "RapidIO Ethernet over messaging driver support"
 	depends on RAPIDIO
diff --git a/drivers/net/Makefile b/drivers/net/Makefile
index 3d375ca..9890148 100644
--- a/drivers/net/Makefile
+++ b/drivers/net/Makefile
@@ -69,3 +69,4 @@ obj-$(CONFIG_USB_IPHETH)        += usb/
 obj-$(CONFIG_USB_CDC_PHONET)   += usb/
 
 obj-$(CONFIG_HYPERV_NET) += hyperv/
+obj-$(CONFIG_NTB_NETDEV) += ntb_netdev.o
diff --git a/drivers/net/ntb_netdev.c b/drivers/net/ntb_netdev.c
new file mode 100644
index 0000000..bc76c63
--- /dev/null
+++ b/drivers/net/ntb_netdev.c
@@ -0,0 +1,407 @@
+/*
+ * This file is provided under a dual BSD/GPLv2 license.  When using or
+ *   redistributing this file, you may do so under either license.
+ *
+ *   GPL LICENSE SUMMARY
+ *
+ *   Copyright(c) 2012 Intel Corporation. All rights reserved.
+ *
+ *   This program is free software; you can redistribute it and/or modify
+ *   it under the terms of version 2 of the GNU General Public License as
+ *   published by the Free Software Foundation.
+ *
+ *   BSD LICENSE
+ *
+ *   Copyright(c) 2012 Intel Corporation. All rights reserved.
+ *
+ *   Redistribution and use in source and binary forms, with or without
+ *   modification, are permitted provided that the following conditions
+ *   are met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copy
+ *       notice, this list of conditions and the following disclaimer in
+ *       the documentation and/or other materials provided with the
+ *       distribution.
+ *     * Neither the name of Intel Corporation nor the names of its
+ *       contributors may be used to endorse or promote products derived
+ *       from this software without specific prior written permission.
+ *
+ *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Intel PCIe NTB Network Linux driver
+ *
+ * Contact Information:
+ * Jon Mason <jon.mason@intel.com>
+ */
+#include <linux/etherdevice.h>
+#include <linux/ethtool.h>
+#include <linux/module.h>
+#include <linux/pci.h>
+#include <linux/ntb.h>
+
+#define NTB_NETDEV_VER	"0.5"
+
+MODULE_DESCRIPTION(KBUILD_MODNAME);
+MODULE_VERSION(NTB_NETDEV_VER);
+MODULE_LICENSE("Dual BSD/GPL");
+MODULE_AUTHOR("Intel Corporation");
+
+struct ntb_netdev {
+	struct list_head list;
+	struct pci_dev *pdev;
+	struct net_device *ndev;
+	struct ntb_transport_qp *qp;
+};
+
+#define	NTB_TX_TIMEOUT_MS	1000
+#define	NTB_RXQ_SIZE		100
+
+static LIST_HEAD(dev_list);
+
+static void ntb_netdev_event_handler(void *data, int status)
+{
+	struct net_device *ndev = data;
+	struct ntb_netdev *dev = netdev_priv(ndev);
+
+	netdev_dbg(ndev, "Event %x, Link %x\n", status,
+		   ntb_transport_link_query(dev->qp));
+
+	/* Currently, only link status event is supported */
+	if (status)
+		netif_carrier_on(ndev);
+	else
+		netif_carrier_off(ndev);
+}
+
+static void ntb_netdev_rx_handler(void *data, struct ntb_transport_qp *qp)
+{
+	struct net_device *ndev = data;
+	struct sk_buff *skb;
+	int len, rc;
+
+	while ((skb = ntb_transport_rx_dequeue(qp, &len))) {
+		netdev_dbg(ndev, "%s: %d byte payload received\n", __func__,
+			   len);
+
+		skb_put(skb, len);
+		skb->protocol = eth_type_trans(skb, ndev);
+		skb->ip_summed = CHECKSUM_NONE;
+
+		if (netif_rx(skb) == NET_RX_DROP) {
+			ndev->stats.rx_errors++;
+			ndev->stats.rx_dropped++;
+		} else {
+			ndev->stats.rx_packets++;
+			ndev->stats.rx_bytes += len;
+		}
+
+		skb = netdev_alloc_skb(ndev, ndev->mtu + ETH_HLEN);
+		if (!skb) {
+			ndev->stats.rx_errors++;
+			ndev->stats.rx_frame_errors++;
+			break;
+		}
+
+		rc = ntb_transport_rx_enqueue(qp, skb, skb->data,
+					      ndev->mtu + ETH_HLEN);
+		if (rc) {
+			ndev->stats.rx_errors++;
+			ndev->stats.rx_fifo_errors++;
+			break;
+		}
+	}
+}
+
+static void ntb_netdev_tx_handler(void *data, struct ntb_transport_qp *qp)
+{
+	struct net_device *ndev = data;
+	struct sk_buff *skb;
+	int len;
+
+	while ((skb = ntb_transport_tx_dequeue(qp, &len))) {
+		ndev->stats.tx_packets++;
+		ndev->stats.tx_bytes += skb->len;
+		dev_kfree_skb(skb);
+	}
+
+	if (ndev && netif_queue_stopped(ndev))
+		netif_wake_queue(ndev);
+}
+
+static netdev_tx_t ntb_netdev_start_xmit(struct sk_buff *skb,
+					 struct net_device *ndev)
+{
+	struct ntb_netdev *dev = netdev_priv(ndev);
+	int rc;
+
+	netdev_dbg(ndev, "ntb_transport_tx_enqueue\n");
+
+	rc = ntb_transport_tx_enqueue(dev->qp, skb, skb->data, skb->len);
+	if (rc)
+		goto err;
+
+	return NETDEV_TX_OK;
+
+err:
+	ndev->stats.tx_dropped++;
+	ndev->stats.tx_errors++;
+	netif_stop_queue(ndev);
+	return NETDEV_TX_BUSY;
+}
+
+static int ntb_netdev_open(struct net_device *ndev)
+{
+	struct ntb_netdev *dev = netdev_priv(ndev);
+	struct sk_buff *skb;
+	int rc, i, len;
+
+	/* Add some empty rx bufs */
+	for (i = 0; i < NTB_RXQ_SIZE; i++) {
+		skb = netdev_alloc_skb(ndev, ndev->mtu + ETH_HLEN);
+		if (!skb) {
+			rc = -ENOMEM;
+			goto err;
+		}
+
+		rc = ntb_transport_rx_enqueue(dev->qp, skb, skb->data,
+					      ndev->mtu + ETH_HLEN);
+		if (rc == -EINVAL)
+			goto err;
+	}
+
+	netif_carrier_off(ndev);
+	ntb_transport_link_up(dev->qp);
+
+	return 0;
+
+err:
+	while ((skb = ntb_transport_rx_remove(dev->qp, &len)))
+		dev_kfree_skb(skb);
+	return rc;
+}
+
+static int ntb_netdev_close(struct net_device *ndev)
+{
+	struct ntb_netdev *dev = netdev_priv(ndev);
+	struct sk_buff *skb;
+	int len;
+
+	ntb_transport_link_down(dev->qp);
+
+	while ((skb = ntb_transport_rx_remove(dev->qp, &len)))
+		dev_kfree_skb(skb);
+
+	return 0;
+}
+
+static int ntb_netdev_change_mtu(struct net_device *ndev, int new_mtu)
+{
+	struct ntb_netdev *dev = netdev_priv(ndev);
+	struct sk_buff *skb;
+	int len, rc;
+
+	if (new_mtu > ntb_transport_max_size(dev->qp) - ETH_HLEN)
+		return -EINVAL;
+
+	if (!netif_running(ndev)) {
+		ndev->mtu = new_mtu;
+		return 0;
+	}
+
+	/* Bring down the link and dispose of posted rx entries */
+	ntb_transport_link_down(dev->qp);
+
+	if (ndev->mtu < new_mtu) {
+		int i;
+
+		for (i = 0; (skb = ntb_transport_rx_remove(dev->qp, &len)); i++)
+			dev_kfree_skb(skb);
+
+		for (; i; i--) {
+			skb = netdev_alloc_skb(ndev, new_mtu + ETH_HLEN);
+			if (!skb) {
+				rc = -ENOMEM;
+				goto err;
+			}
+
+			rc = ntb_transport_rx_enqueue(dev->qp, skb, skb->data,
+						      new_mtu + ETH_HLEN);
+			if (rc) {
+				dev_kfree_skb(skb);
+				goto err;
+			}
+		}
+	}
+
+	ndev->mtu = new_mtu;
+
+	ntb_transport_link_up(dev->qp);
+
+	return 0;
+
+err:
+	ntb_transport_link_down(dev->qp);
+
+	while ((skb = ntb_transport_rx_remove(dev->qp, &len)))
+		dev_kfree_skb(skb);
+
+	netdev_err(ndev, "Error changing MTU, device inoperable\n");
+	return rc;
+}
+
+static void ntb_netdev_tx_timeout(struct net_device *ndev)
+{
+	if (netif_running(ndev))
+		netif_wake_queue(ndev);
+}
+
+static const struct net_device_ops ntb_netdev_ops = {
+	.ndo_open = ntb_netdev_open,
+	.ndo_stop = ntb_netdev_close,
+	.ndo_start_xmit = ntb_netdev_start_xmit,
+	.ndo_change_mtu = ntb_netdev_change_mtu,
+	.ndo_tx_timeout = ntb_netdev_tx_timeout,
+	.ndo_set_mac_address = eth_mac_addr,
+};
+
+static void ntb_get_drvinfo(struct net_device *ndev,
+			    struct ethtool_drvinfo *info)
+{
+	struct ntb_netdev *dev = netdev_priv(ndev);
+
+	strlcpy(info->driver, KBUILD_MODNAME, sizeof(info->driver));
+	strlcpy(info->version, NTB_NETDEV_VER, sizeof(info->version));
+	strlcpy(info->bus_info, pci_name(dev->pdev), sizeof(info->bus_info));
+}
+
+static int ntb_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
+{
+	cmd->supported = SUPPORTED_Backplane;
+	cmd->advertising = ADVERTISED_Backplane;
+	cmd->speed = SPEED_UNKNOWN;
+	ethtool_cmd_speed_set(cmd, SPEED_UNKNOWN);
+	cmd->duplex = DUPLEX_FULL;
+	cmd->port = PORT_OTHER;
+	cmd->phy_address = 0;
+	cmd->transceiver = XCVR_DUMMY1;
+	cmd->autoneg = AUTONEG_ENABLE;
+	cmd->maxtxpkt = 0;
+	cmd->maxrxpkt = 0;
+
+	return 0;
+}
+
+static const struct ethtool_ops ntb_ethtool_ops = {
+	.get_drvinfo = ntb_get_drvinfo,
+	.get_link = ethtool_op_get_link,
+	.get_settings = ntb_get_settings,
+};
+
+static const struct ntb_queue_handlers ntb_netdev_handlers = {
+	.tx_handler = ntb_netdev_tx_handler,
+	.rx_handler = ntb_netdev_rx_handler,
+	.event_handler = ntb_netdev_event_handler,
+};
+
+static int __devinit ntb_netdev_probe(struct pci_dev *pdev)
+{
+	struct net_device *ndev;
+	struct ntb_netdev *dev;
+	int rc;
+
+	ndev = alloc_etherdev(sizeof(struct ntb_netdev));
+	if (!ndev)
+		return -ENOMEM;
+
+	dev = netdev_priv(ndev);
+	dev->ndev = ndev;
+	dev->pdev = pdev;
+	BUG_ON(!dev->pdev);
+	ndev->features = NETIF_F_HIGHDMA;
+
+	ndev->priv_flags |= IFF_LIVE_ADDR_CHANGE;
+
+	ndev->hw_features = ndev->features;
+	ndev->watchdog_timeo = msecs_to_jiffies(NTB_TX_TIMEOUT_MS);
+
+	random_ether_addr(ndev->perm_addr);
+	memcpy(ndev->dev_addr, ndev->perm_addr, ndev->addr_len);
+
+	ndev->netdev_ops = &ntb_netdev_ops;
+	SET_ETHTOOL_OPS(ndev, &ntb_ethtool_ops);
+
+	dev->qp = ntb_transport_create_queue(ndev, pdev, &ntb_netdev_handlers);
+	if (!dev->qp) {
+		rc = -EIO;
+		goto err;
+	}
+
+	ndev->mtu = ntb_transport_max_size(dev->qp) - ETH_HLEN;
+
+	rc = register_netdev(ndev);
+	if (rc)
+		goto err1;
+
+	list_add(&dev->list, &dev_list);
+	pr_info("%s: %s created\n", KBUILD_MODNAME, ndev->name);
+	return 0;
+
+err1:
+	ntb_transport_free_queue(dev->qp);
+err:
+	free_netdev(ndev);
+	return rc;
+}
+
+static void __exit ntb_netdev_remove(struct pci_dev *pdev)
+{
+	struct net_device *ndev;
+	struct ntb_netdev *dev;
+
+	list_for_each_entry(dev, &dev_list, list) {
+		if (dev->pdev == pdev)
+			break;
+	}
+	if (dev == NULL)
+		return;
+
+	ndev = dev->ndev;
+
+	unregister_netdev(ndev);
+	ntb_transport_free_queue(dev->qp);
+	free_netdev(ndev);
+}
+
+static struct ntb_client ntb_netdev_client = {
+	.driver.name = KBUILD_MODNAME,
+	.driver.owner = THIS_MODULE,
+	.probe = ntb_netdev_probe,
+	.remove = ntb_netdev_remove,
+};
+
+static int __init ntb_netdev_init_module(void)
+{
+	return ntb_register_client(&ntb_netdev_client);
+}
+
+module_init(ntb_netdev_init_module);
+
+static void __exit ntb_netdev_exit_module(void)
+{
+	ntb_unregister_client(&ntb_netdev_client);
+	pr_info("%s: Driver removed\n", KBUILD_MODNAME);
+}
+
+module_exit(ntb_netdev_exit_module);
-- 
1.7.9.5

^ permalink raw reply related

* Re: [PATCH v2] iproute2: add support for tcp_metrics
From: Eric Dumazet @ 2012-10-02 21:27 UTC (permalink / raw)
  To: Julian Anastasov; +Cc: Stephen Hemminger, netdev
In-Reply-To: <1349211876.12401.1101.camel@edumazet-glaptop>

On Tue, 2012-10-02 at 23:04 +0200, Eric Dumazet wrote:
> On Tue, 2012-10-02 at 23:45 +0300, Julian Anastasov wrote:
> > 	ip tcp_metrics/tcpmetrics
> > 
> > 	We support get/del for single entry and dump for
> > show/flush.
> > 
> > Signed-off-by: Julian Anastasov <ja@ssi.bg>
> > ---
> 
> Thanks Julian, this version works
> 
> Acked-by: Eric Dumazet <edumazet@google.com>

By the way, it seems kernel exports scaled srtt by 8, and rttvar by 4.

And tcp_get_info() correctly exports us, not ms.

info->tcpi_rtt = jiffies_to_usecs(tp->srtt)>>3;
info->tcpi_rttvar = jiffies_to_usecs(tp->mdev)>>2;

IMHO we should use same unit than TCP_INFO (us for these values)

^ permalink raw reply

* Re: Possible networking regression in 3.6.0
From: Eric Dumazet @ 2012-10-02 21:35 UTC (permalink / raw)
  To: Alexander Duyck; +Cc: David Miller, chris2553, netdev, gpiez, davej
In-Reply-To: <506B5918.605@intel.com>

On Tue, 2012-10-02 at 14:14 -0700, Alexander Duyck wrote:

> I think something may have been missed in this patch.
> 
> With it applied to net-next I am unable to remove the ixgbe driver after
> running a routing traffic test.  The specific message I am getting is:
>     unregister_netdevice: waiting for eth2 to become free. Usage count = -7

Yes, I realized later that rt_set_nexthop(), called from
__mkroute_input() was responsible to do the caching...

So another version is needed, I'll do that tomorrow unless David can fix
the problem while I sleep a bit ;)

^ permalink raw reply

* Re: Possible networking regression in 3.6.0
From: Julian Anastasov @ 2012-10-02 23:24 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: David Miller, chris2553, netdev, gpiez, Dave Jones
In-Reply-To: <1349192919.12401.778.camel@edumazet-glaptop>


	Hello,

On Tue, 2 Oct 2012, Eric Dumazet wrote:

> > David, shouldnt we use a nh_rth_forward instead of a nh_rth_input in
> > __mkroute_input() ?
> > 
> > (And change rt_cache_route() as well ?)
> > 
> > I am testing a patch right now.
> 
> Yeah, this patch seems to fix the bug for me.
> 
> [PATCH] ipv4: properly cache forward routes
> 
> commit d2d68ba9fe8 (ipv4: Cache input routes in fib_info nexthops.)
> introduced a regression for forwarding.
> 
> This was hard to reproduce but the symptom was that packets were
> delivered to local host instead of being forwarded.
> 
> Add a separate cache (nh_rth_forward) to solve the problem.

	Can it be a problem related to fib_info reuse
from different routes. For example, when local IP address
is created for subnet we have:

broadcast 192.168.0.255 dev DEV  proto kernel  scope link  src 192.168.0.1
192.168.0.0/24 dev DEV  proto kernel  scope link  src 192.168.0.1
local 192.168.0.1 dev DEV  proto kernel  scope host  src 192.168.0.1

	The "dev DEV  proto kernel  scope link  src 192.168.0.1" is
a reused fib_info structure where we put cached routes.
The result can be same fib_info for 192.168.0.255 and
192.168.0.0/24. RTN_BROADCAST is cached only for input
routes. Incoming broadcast to 192.168.0.255 can be cached
and can cause problems for traffic forwarded to 192.168.0.0/24.
So, this patch should solve the problem because it
separates the broadcast from unicast traffic.

	And the ip_route_input_slow caching will work for
local and broadcast input routes (above routes 1 and 3) just
because they differ in scope and use different fib_info.

	Another possible failure is for output routes:

multicast 224.0.0.0/4 fib_info
with unicast
192.168.0.0/24 fib_info

	The multicast sets RTCF_MULTICAST | RTCF_LOCAL
and can cause problems for generated unicast traffic on
fib_info reuse. Depends on the scope, for multicast it is
usually scope global, so may be it is difficult to happen
in practice.

	__mkroute_output works for local/unicast routes
because they differ in scope.

> Many thanks to Chris Clayton for his patience and help.
> 
> Reported-by: Chris Clayton <chris2553@googlemail.com>
> Bisected-by: Chris Clayton <chris2553@googlemail.com>
> Reported-by: Dave Jones <davej@redhat.com>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> ---
>  include/net/ip_fib.h     |    1 +
>  net/ipv4/fib_semantics.c |    1 +
>  net/ipv4/route.c         |   16 ++++++++--------
>  3 files changed, 10 insertions(+), 8 deletions(-)

Regards

--
Julian Anastasov <ja@ssi.bg>

^ permalink raw reply

* Re: [PATCH v2] iproute2: add support for tcp_metrics
From: Julian Anastasov @ 2012-10-03  0:21 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: Stephen Hemminger, netdev
In-Reply-To: <1349213229.12401.1130.camel@edumazet-glaptop>


	Hello,

On Tue, 2 Oct 2012, Eric Dumazet wrote:

> By the way, it seems kernel exports scaled srtt by 8, and rttvar by 4.
> 
> And tcp_get_info() correctly exports us, not ms.
> 
> info->tcpi_rtt = jiffies_to_usecs(tp->srtt)>>3;
> info->tcpi_rttvar = jiffies_to_usecs(tp->mdev)>>2;
> 
> IMHO we should use same unit than TCP_INFO (us for these values)

	Something like this in process_msg?:

case TCP_METRIC_RTT:
	fprintf(fp, "%lluus",
		((__u64) val * 1000) >> 3);
	break;
case TCP_METRIC_RTTVAR:
	fprintf(fp, "%lluus",
		((__u64) val * 1000) >> 2);
	break;

	And may be variant without __u64 should be fine?

Regards

--
Julian Anastasov <ja@ssi.bg>

^ permalink raw reply

* Re: tg3 driver upgrade (Linux 2.6.32 -> 3.2) breaks IBM Bladecenter SoL
From: Ben Hutchings @ 2012-10-03  0:17 UTC (permalink / raw)
  To: Michael Tokarev, David Miller
  Cc: Ferenc Wagner, Michael Chan, netdev, Matt Carlson, Grant Likely,
	Rob Herring, linux-kernel, stable
In-Reply-To: <506B3B52.7080001@msgid.tls.msk.ru>

[-- Attachment #1: Type: text/plain, Size: 1319 bytes --]

On Tue, 2012-10-02 at 23:06 +0400, Michael Tokarev wrote:
> On 02.10.2012 22:49, Ferenc Wagner wrote:
> > "Michael Chan" <mchan@broadcom.com> writes:
> >> These are the likely fixes:
> >>
> >> commit cf9ecf4b631f649a964fa611f1a5e8874f2a76db 
> >> Author: Matt Carlson <mcarlson@broadcom.com>
> >> Date: Mon Nov 28 09:41:03 2011 +0000
> >>
> >> tg3: Fix TSO CAP for 5704 devs w / ASF enabled
> > 
> > You are exactly right: cf9ecf4b fixed the premanent SoL breakage
> > introduced by dabc5c67.  Looks like ASF utilizes similar technology to
> > that of the HS20 BMC.  Thanks for the tip, it greatly reduced our CPU
> > wear. :)  It's a pity ethtool -k did not give a hint.  Do you think it's
> > possible to work around in 3.2 by eg. fiddling some ethtool setting?
> 
> Maybe it's better to push this commit to -stable instead?

But that will take time, so I imagine a temporary workaround would be
useful to Ferenc.

> (the commit
> that broke things is part of 3.0 kernel so all current 3.x -stable
> kernels are affected)
[...]

The fix went into 3.3, so only 3.0 and 3.2 need it.

David, please can you include the above commit in your next batches for
these stable series?

Ben.

-- 
Ben Hutchings
For every complex problem
there is a solution that is simple, neat, and wrong.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox