Netdev List
 help / color / mirror / Atom feed
* [PATCH] Unix socket buffer attribution
From: Yannick Koehler @ 2013-01-25 15:32 UTC (permalink / raw)
  To: netdev

This patch should fix an issue where unix socket buffer remains
accounted as part of the socket sndbuf (sk_wmem_alloc) instead of
being accounted as part of the receiving socket rcvbuf
(sk_rmem_alloc), leading to a situation where if one of the receiving
socket isn't calling recvfrom() the sending socket can no more send to
any of its listeners, even those which properly behave.  This could
create a DOS situation where the unix socket is reachable by many
users on the same linux machine.

Signed-off-by: Yannick Koehler <yannick@koehler.name>

diff -uprN -X linux-3.6/Documentation/dontdiff
linux-3.6-vanilla/include/net/af_unix.h
linux-3.6/include/net/af_unix.h
--- linux-3.6-vanilla/include/net/af_unix.h 2012-09-30 19:47:46.000000000 -0400
+++ linux-3.6/include/net/af_unix.h 2013-01-24 15:26:20.000000000 -0500
@@ -34,6 +34,7 @@ struct unix_skb_parms {
 #ifdef CONFIG_SECURITY_NETWORK
  u32 secid; /* Security ID */
 #endif
+ struct sock *peer; /* Skb's peer sk */
 };

 #define UNIXCB(skb) (*(struct unix_skb_parms *)&((skb)->cb))
diff -uprN -X linux-3.6/Documentation/dontdiff
linux-3.6-vanilla/net/unix/af_unix.c linux-3.6/net/unix/af_unix.c
--- linux-3.6-vanilla/net/unix/af_unix.c 2012-09-30 19:47:46.000000000 -0400
+++ linux-3.6/net/unix/af_unix.c 2013-01-24 15:24:57.000000000 -0500
@@ -1426,6 +1426,35 @@ static void maybe_add_creds(struct sk_bu
 }

 /*
+ * Reduce the refcount from sk_wmem_alloc on the peer sk.
+ * Then remove invoke sock_rfree to release the memory
+ * from the current sock sk_rmem_alloc.
+ */
+static void unix_sock_wrfree(struct sk_buff *skb)
+{
+ struct sock *sk = UNIXCB(skb).peer;
+
+ if (sk)
+ sk_free(sk);
+
+ sock_rfree(skb);
+}
+
+static inline void unix_set_owner_r(struct sk_buff *skb, struct sock *sk,
+     struct sock *other)
+{
+ /* This operation garantee the peer sk isn't freed. */
+ atomic_add(1, &sk->sk_wmem_alloc);
+
+ skb_orphan(skb);
+ skb->sk = other;
+ skb->destructor = unix_sock_wrfree;
+ atomic_add(skb->truesize, &other->sk_rmem_alloc);
+ sk_mem_charge(other, skb->truesize);
+ UNIXCB(skb).peer = sk;
+}
+
+/*
  * Send AF_UNIX data.
  */

@@ -1579,9 +1607,16 @@ restart:
  goto restart;
  }

+ if (atomic_read(&other->sk_rmem_alloc) + skb->truesize >=
+    (unsigned)other->sk_rcvbuf) {
+ err = -EAGAIN;
+ goto out_unlock;
+ }
+
  if (sock_flag(other, SOCK_RCVTSTAMP))
  __net_timestamp(skb);
  maybe_add_creds(skb, sock, other);
+ unix_set_owner_r(skb, sk, other);
  skb_queue_tail(&other->sk_receive_queue, skb);
  if (max_level > unix_sk(other)->recursion_level)
  unix_sk(other)->recursion_level = max_level;
@@ -1696,7 +1731,14 @@ static int unix_stream_sendmsg(struct ki
     (other->sk_shutdown & RCV_SHUTDOWN))
  goto pipe_err_free;

+ if (atomic_read(&other->sk_rmem_alloc) + skb->truesize >=
+    (unsigned)other->sk_rcvbuf) {
+ err = -EAGAIN;
+ goto pipe_err_free;
+ }
+
  maybe_add_creds(skb, sock, other);
+ unix_set_owner_r(skb, sk, other);
  skb_queue_tail(&other->sk_receive_queue, skb);
  if (max_level > unix_sk(other)->recursion_level)
  unix_sk(other)->recursion_level = max_level;
@@ -1807,7 +1849,7 @@ static int unix_dgram_recvmsg(struct kio
  POLLOUT | POLLWRNORM | POLLWRBAND);

  if (msg->msg_name)
- unix_copy_addr(msg, skb->sk);
+ unix_copy_addr(msg, UNIXCB(skb).peer);

  if (size > skb->len - skip)
  size = skb->len - skip;
@@ -2007,7 +2049,7 @@ again:

  /* Copy address just once */
  if (sunaddr) {
- unix_copy_addr(msg, skb->sk);
+ unix_copy_addr(msg, UNIXCB(skb).peer);
  sunaddr = NULL;
  }

^ permalink raw reply

* [patch] ipvs: freeing uninitialized pointer on error
From: Dan Carpenter @ 2013-01-25 15:44 UTC (permalink / raw)
  To: Wensong Zhang
  Cc: Simon Horman, Julian Anastasov, Pablo Neira Ayuso,
	Patrick McHardy, David S. Miller, netdev, lvs-devel,
	netfilter-devel, netfilter, coreteam, kernel-janitors

If state != IP_VS_STATE_BACKUP then tinfo->buf is uninitialized.  If
kthread_run() fails then it means we free random memory resulting in an
oops.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/net/netfilter/ipvs/ip_vs_sync.c b/net/netfilter/ipvs/ip_vs_sync.c
index effa10c..44fd10c 100644
--- a/net/netfilter/ipvs/ip_vs_sync.c
+++ b/net/netfilter/ipvs/ip_vs_sync.c
@@ -1795,6 +1795,8 @@ int start_sync_thread(struct net *net, int state, char *mcast_ifn, __u8 syncid)
 					     GFP_KERNEL);
 			if (!tinfo->buf)
 				goto outtinfo;
+		} else {
+			tinfo->buf = NULL;
 		}
 		tinfo->id = id;
 

^ permalink raw reply related

* Re: [PATCH v3 1/1 net-next] net: fec: enable pause frame to improve rx prefomance for 1G network
From: Ben Hutchings @ 2013-01-25 17:33 UTC (permalink / raw)
  To: Frank Li
  Cc: Frank Li, shawn.guo, B38611, davem, linux-arm-kernel, netdev,
	s.hauer
In-Reply-To: <CAHrpEqRKhXRg-SsigWdnfV-RBWSc=OH9ECqQnKHDvmbn8e4a2A@mail.gmail.com>

On Fri, 2013-01-25 at 09:50 +0800, Frank Li wrote:
> 2013/1/25 Ben Hutchings <bhutchings@solarflare.com>:
> > On Thu, 2013-01-24 at 10:16 +0800, Frank Li wrote:
> >> 2013/1/24 Ben Hutchings <bhutchings@solarflare.com>:
> >> > On Thu, 2013-01-17 at 10:55 +0800, Frank Li wrote:
> >> >> The limition of imx6 internal bus cause fec can't achieve 1G perfomance.
> >> >> There will be many packages lost because FIFO over run.
> >> >>
> >> >> This patch enable pause frame flow control.
> >> > [...]
> >> >> --- a/drivers/net/ethernet/freescale/fec.c
> >> >> +++ b/drivers/net/ethernet/freescale/fec.c
> >> > [...]
> >> >> +static int fec_enet_set_pauseparam(struct net_device *ndev,
> >> >> +                                struct ethtool_pauseparam *pause)
> >> >> +{
> >> >> +     struct fec_enet_private *fep = netdev_priv(ndev);
> >> >> +
> >> >> +     if (pause->tx_pause != pause->rx_pause) {
> >> >> +             netdev_info(ndev,
> >> >> +                     "hardware only support enable/disable both tx and rx");
> >> >> +             return -EINVAL;
> >> >> +     }
> >> >> +
> >> >> +     fep->pause_flag = 0;
> >> >> +
> >> >> +     /* tx pause must be same as rx pause */
> >> >> +     fep->pause_flag |= pause->rx_pause ? FEC_PAUSE_FLAG_ENABLE : 0;
> >> >> +     fep->pause_flag |= pause->autoneg ? FEC_PAUSE_FLAG_AUTONEG : 0;
> >> >> +
> >> >> +     if (pause->rx_pause || pause->autoneg) {
> >> >> +             fep->phy_dev->supported |= ADVERTISED_Pause;
> >> >> +             fep->phy_dev->advertising |= ADVERTISED_Pause;
> >> >> +     } else {
> >> >> +             fep->phy_dev->supported &= ~ADVERTISED_Pause;
> >> >> +             fep->phy_dev->advertising &= ~ADVERTISED_Pause;
> >> >> +     }
> >> > [...]
> >> >
> >> > Why is this changing the supported flags, i.e. device capabilities?  You
> >> > need to leave those flags alone and reject an attempt to enable pause
> >> > frames on a device that doesn't support them.
> >>
> >> I go through phylib, I have not found good place set ADVERTISED_Pause
> >> capabilities.
> >> genphy_config_init never check Pause capabilities.
> >
> > I agree that phylib can't initialise pause capabilities because those
> > depend on the MAC.  But look at which function I'm quoting: this is the
> > ethtool operation, which shouldn't change capabilities.
> 
> Where is good place do you think? in probe function?

You're already setting the supported flag in fec_enet_mii_probe().  I
assume (without great familiarity with phylib) that that's the right
place to do it.

Ben.

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

^ permalink raw reply

* [PATCH 0/1] VM Sockets for Linux upstreaming
From: acking @ 2013-01-25 17:37 UTC (permalink / raw)
  To: netdev, linux-kernel, virtualization; +Cc: pv-drivers, gregkh, acking, davem

From: Andy King <acking@vmware.com>

** Introduce VM Sockets ***

In an effort to improve the out-of-the-box experience with Linux kernels for
VMware users, VMware is working on readying the VM Sockets (VSOCK, formerly
VMCI Sockets) (vmw_vsock) kernel module for inclusion in the Linux kernel. The
purpose of this post is to acquire feedback on the vmw_vsock kernel module.

Unlike previous submissions, where the new socket family was entirely reliant
on VMware's VMCI PCI device (and thus VMware's hypervisor), VM Sockets is now
_mostly_ separated out into two parts:

o Core socket code, which is transport-neutral and invokes transport
  callbacks to communicate with the hypervisor.
o A VMCI transport, which communicates over VMCI with the VMware hypervisor.

This should provide a path to introducing additional transports, for example
virtio, with the ultimate goal being to make this new socket family
hypervisor-neutral.

Andy King (1):
  VSOCK: Introduce VM Sockets

 include/linux/socket.h                       |    4 +-
 include/uapi/linux/vm_sockets.h              |  169 +++
 net/Kconfig                                  |    1 +
 net/Makefile                                 |    1 +
 net/vmw_vsock/Kconfig                        |   14 +
 net/vmw_vsock/Makefile                       |    4 +
 net/vmw_vsock/af_vsock.c                     | 1983 ++++++++++++++++++++++++++
 net/vmw_vsock/af_vsock.h                     |  256 ++++
 net/vmw_vsock/vmci_transport.c               | 1863 ++++++++++++++++++++++++
 net/vmw_vsock/vmci_transport.h               |   90 ++
 net/vmw_vsock/vmci_transport_notify.c        |  677 +++++++++
 net/vmw_vsock/vmci_transport_notify.h        |  126 ++
 net/vmw_vsock/vmci_transport_notify_qstate.c |  411 ++++++
 net/vmw_vsock/vsock_addr.c                   |  118 ++
 net/vmw_vsock/vsock_addr.h                   |   36 +
 net/vmw_vsock/vsock_version.h                |   22 +
 16 files changed, 5774 insertions(+), 1 deletions(-)
 create mode 100644 include/uapi/linux/vm_sockets.h
 create mode 100644 net/vmw_vsock/Kconfig
 create mode 100644 net/vmw_vsock/Makefile
 create mode 100644 net/vmw_vsock/af_vsock.c
 create mode 100644 net/vmw_vsock/af_vsock.h
 create mode 100644 net/vmw_vsock/vmci_transport.c
 create mode 100644 net/vmw_vsock/vmci_transport.h
 create mode 100644 net/vmw_vsock/vmci_transport_notify.c
 create mode 100644 net/vmw_vsock/vmci_transport_notify.h
 create mode 100644 net/vmw_vsock/vmci_transport_notify_qstate.c
 create mode 100644 net/vmw_vsock/vsock_addr.c
 create mode 100644 net/vmw_vsock/vsock_addr.h
 create mode 100644 net/vmw_vsock/vsock_version.h

-- 
1.7.4.1

^ permalink raw reply

* [PATCH 1/1] VSOCK: Introduce VM Sockets
From: acking @ 2013-01-25 17:37 UTC (permalink / raw)
  To: netdev, linux-kernel, virtualization; +Cc: pv-drivers, gregkh, acking, davem
In-Reply-To: <1359135470-30677-1-git-send-email-acking@vmware.com>

From: Andy King <acking@vmware.com>

VM Sockets allows communication between virtual machines and the hypervisor.
User level applications both in a virtual machine and on the host can use the
VM Sockets API, which facilitates fast and efficient communication between
guest virtual machines and their host.  A socket address family, designed to be
compatible with UDP and TCP at the interface level, is provided.

Today, VM Sockets is used by various VMware Tools components inside the guest
for zero-config, network-less access to VMware host services.  In addition to
this, VMware's users are using VM Sockets for various applications, where
network access of the virtual machine is restricted or non-existent.  Examples
of this are VMs communicating with device proxies for proprietary hardware
running as host applications and automated testing of applications running
within virtual machines.

The VMware VM Sockets are similar to other socket types, like Berkeley UNIX
socket interface.  The VM Sockets module supports both connection-oriented
stream sockets like TCP, and connectionless datagram sockets like UDP. The VM
Sockets protocol family is defined as "AF_VSOCK" and the socket operations
split for SOCK_DGRAM and SOCK_STREAM.

For additional information about the use of VM Sockets, please refer to the VM
Sockets Programming Guide available at:

https://www.vmware.com/support/developer/vmci-sdk/

Signed-off-by: George Zhang <georgezhang@vmware.com>
Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
Signed-off-by: Andy king <acking@vmware.com>
---
 include/linux/socket.h                       |    4 +-
 include/uapi/linux/vm_sockets.h              |  169 +++
 net/Kconfig                                  |    1 +
 net/Makefile                                 |    1 +
 net/vmw_vsock/Kconfig                        |   14 +
 net/vmw_vsock/Makefile                       |    4 +
 net/vmw_vsock/af_vsock.c                     | 1983 ++++++++++++++++++++++++++
 net/vmw_vsock/af_vsock.h                     |  256 ++++
 net/vmw_vsock/vmci_transport.c               | 1863 ++++++++++++++++++++++++
 net/vmw_vsock/vmci_transport.h               |   90 ++
 net/vmw_vsock/vmci_transport_notify.c        |  677 +++++++++
 net/vmw_vsock/vmci_transport_notify.h        |  126 ++
 net/vmw_vsock/vmci_transport_notify_qstate.c |  411 ++++++
 net/vmw_vsock/vsock_addr.c                   |  118 ++
 net/vmw_vsock/vsock_addr.h                   |   36 +
 net/vmw_vsock/vsock_version.h                |   22 +
 16 files changed, 5774 insertions(+), 1 deletions(-)
 create mode 100644 include/uapi/linux/vm_sockets.h
 create mode 100644 net/vmw_vsock/Kconfig
 create mode 100644 net/vmw_vsock/Makefile
 create mode 100644 net/vmw_vsock/af_vsock.c
 create mode 100644 net/vmw_vsock/af_vsock.h
 create mode 100644 net/vmw_vsock/vmci_transport.c
 create mode 100644 net/vmw_vsock/vmci_transport.h
 create mode 100644 net/vmw_vsock/vmci_transport_notify.c
 create mode 100644 net/vmw_vsock/vmci_transport_notify.h
 create mode 100644 net/vmw_vsock/vmci_transport_notify_qstate.c
 create mode 100644 net/vmw_vsock/vsock_addr.c
 create mode 100644 net/vmw_vsock/vsock_addr.h
 create mode 100644 net/vmw_vsock/vsock_version.h

diff --git a/include/linux/socket.h b/include/linux/socket.h
index 9a546ff..2b9f74b 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -178,7 +178,8 @@ struct ucred {
 #define AF_CAIF		37	/* CAIF sockets			*/
 #define AF_ALG		38	/* Algorithm sockets		*/
 #define AF_NFC		39	/* NFC sockets			*/
-#define AF_MAX		40	/* For now.. */
+#define AF_VSOCK	40	/* vSockets			*/
+#define AF_MAX		41	/* For now.. */
 
 /* Protocol families, same as address families. */
 #define PF_UNSPEC	AF_UNSPEC
@@ -221,6 +222,7 @@ struct ucred {
 #define PF_CAIF		AF_CAIF
 #define PF_ALG		AF_ALG
 #define PF_NFC		AF_NFC
+#define PF_VSOCK	AF_VSOCK
 #define PF_MAX		AF_MAX
 
 /* Maximum queue length specifiable by listen.  */
diff --git a/include/uapi/linux/vm_sockets.h b/include/uapi/linux/vm_sockets.h
new file mode 100644
index 0000000..8fd3a44
--- /dev/null
+++ b/include/uapi/linux/vm_sockets.h
@@ -0,0 +1,169 @@
+/*
+ * VMware vSockets Driver
+ *
+ * Copyright (C) 2007-2013 VMware, Inc. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation version 2 and no later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ */
+
+#ifndef _VM_SOCKETS_H_
+#define _VM_SOCKETS_H_
+
+#if !defined(__KERNEL__)
+#include <sys/socket.h>
+#endif
+
+/* Option name for STREAM socket buffer size.  Use as the option name in
+ * setsockopt(3) or getsockopt(3) to set or get an unsigned long long that
+ * specifies the size of the buffer underlying a vSockets STREAM socket.
+ * Value is clamped to the MIN and MAX.
+ */
+
+#define SO_VM_SOCKETS_BUFFER_SIZE 0
+
+/* Option name for STREAM socket minimum buffer size.  Use as the option name
+ * in setsockopt(3) or getsockopt(3) to set or get an unsigned long long that
+ * specifies the minimum size allowed for the buffer underlying a vSockets
+ * STREAM socket.
+ */
+
+#define SO_VM_SOCKETS_BUFFER_MIN_SIZE 1
+
+/* Option name for STREAM socket maximum buffer size.  Use as the option name
+ * in setsockopt(3) or getsockopt(3) to set or get an unsigned long long
+ * that specifies the maximum size allowed for the buffer underlying a
+ * vSockets STREAM socket.
+ */
+
+#define SO_VM_SOCKETS_BUFFER_MAX_SIZE 2
+
+/* Option name for socket peer's host-specific VM ID.  Use as the option name
+ * in getsockopt(3) to get a host-specific identifier for the peer endpoint's
+ * VM.  The identifier is a signed integer.
+ * Only available for hypervisor endpoints.
+ */
+
+#define SO_VM_SOCKETS_PEER_HOST_VM_ID 3
+
+/* Option name for socket's service label.  Use as the option name in
+ * setsockopt(3) or getsockopt(3) to set or get the service label for a socket.
+ * The service label is a C-style NUL-terminated string.  Only available for
+ * hypervisor endpoints.
+ */
+
+#define SO_VM_SOCKETS_SERVICE_LABEL 4
+
+/* Option name for determining if a socket is trusted.  Use as the option name
+ * in getsockopt(3) to determine if a socket is trusted.  The value is a
+ * signed integer.
+ */
+
+#define SO_VM_SOCKETS_TRUSTED 5
+
+/* Option name for STREAM socket connection timeout.  Use as the option name
+ * in setsockopt(3) or getsockopt(3) to set or get the connection
+ * timeout for a STREAM socket.
+ */
+
+#define SO_VM_SOCKETS_CONNECT_TIMEOUT 6
+
+/* Option name for using non-blocking send/receive.  Use as the option name
+ * for setsockopt(3) or getsockopt(3) to set or get the non-blocking
+ * transmit/receive flag for a STREAM socket.  This flag determines whether
+ * send() and recv() can be called in non-blocking contexts for the given
+ * socket.  The value is a signed integer.
+ *
+ * This option is only relevant to kernel endpoints, where descheduling the
+ * thread of execution is not allowed, for example, while holding a spinlock.
+ * It is not to be confused with conventional non-blocking socket operations.
+ *
+ * Only available for hypervisor endpoints.
+ */
+
+#define SO_VM_SOCKETS_NONBLOCK_TXRX 7
+
+/* The vSocket equivalent of INADDR_ANY.  This works for the svm_cid field of
+ * sockaddr_vm and indicates the context ID of the current endpoint.
+ */
+
+#define VMADDR_CID_ANY -1U
+
+/* Bind to any available port.  Works for the svm_port field of
+ * sockaddr_vm.
+ */
+
+#define VMADDR_PORT_ANY -1U
+
+/* Use this as the destination CID in an address when referring to the
+ * hypervisor.  VMCI relies on it being 0, but this would be useful for other
+ * transports too.
+ */
+
+#define VMADDR_CID_HYPERVISOR 0
+
+/* This CID is specific to VMCI and can be considered reserved (even VMCI
+ * doesn't use it anymore, it's a legacy value from an older release).
+ */
+
+#define VMADDR_CID_RESERVED 1
+
+/* Use this as the destination CID in an address when referring to the host
+ * (any process other than the hypervisor).  VMCI relies on it being 2, but
+ * this would be useful for other transports too.
+ */
+
+#define VMADDR_CID_HOST 2
+
+/* Invalid vSockets version. */
+
+#define VM_SOCKETS_INVALID_VERSION -1U
+
+/* The epoch (first) component of the vSockets version.  A single byte
+ * representing the epoch component of the vSockets version.
+ */
+
+#define VM_SOCKETS_VERSION_EPOCH(_v) (((_v) & 0xFF000000) >> 24)
+
+/* The major (second) component of the vSockets version.   A single byte
+ * representing the major component of the vSockets version.  Typically
+ * changes for every major release of a product.
+ */
+
+#define VM_SOCKETS_VERSION_MAJOR(_v) (((_v) & 0x00FF0000) >> 16)
+
+/* The minor (third) component of the vSockets version.  Two bytes representing
+ * the minor component of the vSockets version.
+ */
+
+#define VM_SOCKETS_VERSION_MINOR(_v) (((_v) & 0x0000FFFF))
+
+/* Address structure for vSockets.   The address family should be set to
+ * whatever vmci_sock_get_af_value_fd() returns.  The structure members should
+ * all align on their natural boundaries without resorting to compiler packing
+ * directives.  The total size of this structure should be exactly the same as
+ * that of struct sockaddr.
+ */
+
+struct sockaddr_vm {
+	sa_family_t svm_family;
+	unsigned short svm_reserved1;
+	unsigned int svm_port;
+	unsigned int svm_cid;
+	unsigned char svm_zero[sizeof(struct sockaddr) -
+			       sizeof(sa_family_t) -
+			       sizeof(unsigned short) -
+			       sizeof(unsigned int) - sizeof(unsigned int)];
+};
+
+#if defined(__KERNEL__)
+int vm_sockets_get_local_cid(void);
+#endif
+
+#endif
diff --git a/net/Kconfig b/net/Kconfig
index 30b48f5..f143ac3 100644
--- a/net/Kconfig
+++ b/net/Kconfig
@@ -218,6 +218,7 @@ source "net/dcb/Kconfig"
 source "net/dns_resolver/Kconfig"
 source "net/batman-adv/Kconfig"
 source "net/openvswitch/Kconfig"
+source "net/vmw_vsock/Kconfig"
 
 config RPS
 	boolean
diff --git a/net/Makefile b/net/Makefile
index 4f4ee08..cae59f4 100644
--- a/net/Makefile
+++ b/net/Makefile
@@ -70,3 +70,4 @@ obj-$(CONFIG_CEPH_LIB)		+= ceph/
 obj-$(CONFIG_BATMAN_ADV)	+= batman-adv/
 obj-$(CONFIG_NFC)		+= nfc/
 obj-$(CONFIG_OPENVSWITCH)	+= openvswitch/
+obj-$(CONFIG_VMWARE_VSOCK)	+= vmw_vsock/
diff --git a/net/vmw_vsock/Kconfig b/net/vmw_vsock/Kconfig
new file mode 100644
index 0000000..95e2568
--- /dev/null
+++ b/net/vmw_vsock/Kconfig
@@ -0,0 +1,14 @@
+#
+# Vsock protocol
+#
+
+config VMWARE_VSOCK
+	tristate "Virtual Socket protocol"
+	depends on VMWARE_VMCI
+	help
+	  Virtual Socket Protocol is a socket protocol similar to TCP/IP
+	  allowing comunication between Virtual Machines and VMware
+	  hypervisor.
+
+	  To compile this driver as a module, choose M here: the module
+	  will be called vsock. If unsure, say N.
diff --git a/net/vmw_vsock/Makefile b/net/vmw_vsock/Makefile
new file mode 100644
index 0000000..086dc27
--- /dev/null
+++ b/net/vmw_vsock/Makefile
@@ -0,0 +1,4 @@
+obj-$(CONFIG_VMWARE_VSOCK) += vmw_vsock.o
+
+vmw_vsock-y += af_vsock.o vmci_transport.o vmci_transport_notify.o \
+	vmci_transport_notify_qstate.o vsock_addr.o
diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c
new file mode 100644
index 0000000..a957585
--- /dev/null
+++ b/net/vmw_vsock/af_vsock.c
@@ -0,0 +1,1983 @@
+/*
+ * VMware vSockets Driver
+ *
+ * Copyright (C) 2007-2013 VMware, Inc. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation version 2 and no later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ */
+
+/* Implementation notes:
+ *
+ * - There are two kinds of sockets: those created by user action (such as
+ * calling socket(2)) and those created by incoming connection request packets.
+ *
+ * - There are two "global" tables, one for bound sockets (sockets that have
+ * specified an address that they are responsible for) and one for connected
+ * sockets (sockets that have established a connection with another socket).
+ * These tables are "global" in that all sockets on the system are placed
+ * within them. - Note, though, that the bound table contains an extra entry
+ * for a list of unbound sockets and SOCK_DGRAM sockets will always remain in
+ * that list. The bound table is used solely for lookup of sockets when packets
+ * are received and that's not necessary for SOCK_DGRAM sockets since we create
+ * a datagram handle for each and need not perform a lookup.  Keeping SOCK_DGRAM
+ * sockets out of the bound hash buckets will reduce the chance of collisions
+ * when looking for SOCK_STREAM sockets and prevents us from having to check the
+ * socket type in the hash table lookups.
+ *
+ * - Sockets created by user action will either be "client" sockets that
+ * initiate a connection or "server" sockets that listen for connections; we do
+ * not support simultaneous connects (two "client" sockets connecting).
+ *
+ * - "Server" sockets are referred to as listener sockets throughout this
+ * implementation because they are in the SS_LISTEN state.  When a connection
+ * request is received (the second kind of socket mentioned above), we create a
+ * new socket and refer to it as a pending socket.  These pending sockets are
+ * placed on the pending connection list of the listener socket.  When future
+ * packets are received for the address the listener socket is bound to, we
+ * check if the source of the packet is from one that has an existing pending
+ * connection.  If it does, we process the packet for the pending socket.  When
+ * that socket reaches the connected state, it is removed from the listener
+ * socket's pending list and enqueued in the listener socket's accept queue.
+ * Callers of accept(2) will accept connected sockets from the listener socket's
+ * accept queue.  If the socket cannot be accepted for some reason then it is
+ * marked rejected.  Once the connection is accepted, it is owned by the user
+ * process and the responsibility for cleanup falls with that user process.
+ *
+ * - It is possible that these pending sockets will never reach the connected
+ * state; in fact, we may never receive another packet after the connection
+ * request.  Because of this, we must schedule a cleanup function to run in the
+ * future, after some amount of time passes where a connection should have been
+ * established.  This function ensures that the socket is off all lists so it
+ * cannot be retrieved, then drops all references to the socket so it is cleaned
+ * up (sock_put() -> sk_free() -> our sk_destruct implementation).  Note this
+ * function will also cleanup rejected sockets, those that reach the connected
+ * state but leave it before they have been accepted.
+ *
+ * - Sockets created by user action will be cleaned up when the user process
+ * calls close(2), causing our release implementation to be called. Our release
+ * implementation will perform some cleanup then drop the last reference so our
+ * sk_destruct implementation is invoked.  Our sk_destruct implementation will
+ * perform additional cleanup that's common for both types of sockets.
+ *
+ * - A socket's reference count is what ensures that the structure won't be
+ * freed.  Each entry in a list (such as the "global" bound and connected tables
+ * and the listener socket's pending list and connected queue) ensures a
+ * reference.  When we defer work until process context and pass a socket as our
+ * argument, we must ensure the reference count is increased to ensure the
+ * socket isn't freed before the function is run; the deferred function will
+ * then drop the reference.
+ */
+
+#include <linux/types.h>
+
+#define EXPORT_SYMTAB
+#include <linux/bitops.h>
+#include <linux/cred.h>
+#include <linux/init.h>
+#include <linux/io.h>
+#include <linux/kernel.h>
+#include <linux/kmod.h>
+#include <linux/list.h>
+#include <linux/miscdevice.h>
+#include <linux/module.h>
+#include <linux/mutex.h>
+#include <linux/net.h>
+#include <linux/poll.h>
+#include <linux/skbuff.h>
+#include <linux/smp.h>
+#include <linux/socket.h>
+#include <linux/stddef.h>
+#include <linux/unistd.h>
+#include <linux/wait.h>
+#include <linux/workqueue.h>
+#include <net/sock.h>
+
+#include "af_vsock.h"
+#include "vsock_version.h"
+
+static int __vsock_bind(struct sock *sk, struct sockaddr_vm *addr);
+static void vsock_sk_destruct(struct sock *sk);
+static int vsock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb);
+
+/* Protocol family. */
+static struct proto vsock_proto = {
+	.name = "AF_VMCI",
+	.owner = THIS_MODULE,
+	.obj_size = sizeof(struct vsock_sock),
+};
+
+/* The default peer timeout indicates how long we will wait for a peer response
+ * to a control message.
+ */
+#define VSOCK_DEFAULT_CONNECT_TIMEOUT (2 * HZ)
+
+#define SS_LISTEN 255
+
+static struct vsock_transport *transport;
+
+/**** EXPORTS ****/
+
+/* Get the ID of the local context.  This might be transport-dependent in the
+ * future.  For now, it is just the VM's VMCI Context ID.
+ */
+
+int vm_sockets_get_local_cid(void)
+{
+	return vmci_get_context_id();
+}
+EXPORT_SYMBOL_GPL(vm_sockets_get_local_cid);
+
+/**** UTILS ****/
+
+struct list_head vsock_bind_table[VSOCK_HASH_SIZE + 1];
+struct list_head vsock_connected_table[VSOCK_HASH_SIZE];
+
+DEFINE_SPINLOCK(vsock_table_lock);
+
+static __init void vsock_init_tables(void)
+{
+	int i;
+
+	for (i = 0; i < ARRAY_SIZE(vsock_bind_table); i++)
+		INIT_LIST_HEAD(&vsock_bind_table[i]);
+
+	for (i = 0; i < ARRAY_SIZE(vsock_connected_table); i++)
+		INIT_LIST_HEAD(&vsock_connected_table[i]);
+}
+
+void __vsock_insert_bound(struct list_head *list, struct sock *sk)
+{
+	struct vsock_sock *vsk = vsock_sk(sk);
+
+	sock_hold(sk);
+	list_add(&vsk->bound_table, list);
+}
+
+void __vsock_insert_connected(struct list_head *list, struct sock *sk)
+{
+	struct vsock_sock *vsk = vsock_sk(sk);
+
+	sock_hold(sk);
+	list_add(&vsk->connected_table, list);
+}
+
+void __vsock_remove_bound(struct sock *sk)
+{
+	struct vsock_sock *vsk;
+
+	vsk = vsock_sk(sk);
+
+	list_del_init(&vsk->bound_table);
+	sock_put(sk);
+}
+
+void __vsock_remove_connected(struct sock *sk)
+{
+	struct vsock_sock *vsk;
+
+	vsk = vsock_sk(sk);
+
+	list_del_init(&vsk->connected_table);
+	sock_put(sk);
+}
+
+struct sock *__vsock_find_bound_socket(struct sockaddr_vm *addr)
+{
+	struct vsock_sock *vsk;
+
+	list_for_each_entry(vsk, vsock_bound_sockets(addr), bound_table) {
+		if (vsock_addr_equals_addr_any(addr, &vsk->local_addr))
+			return sk_vsock(vsk);
+	}
+
+	return NULL;
+}
+
+struct sock *__vsock_find_connected_socket(struct sockaddr_vm *src,
+					   struct sockaddr_vm *dst)
+{
+	struct vsock_sock *vsk;
+
+	list_for_each_entry(vsk, vsock_connected_sockets(src, dst),
+			    connected_table) {
+		if (vsock_addr_equals_addr(src, &vsk->remote_addr)
+		    && vsock_addr_equals_addr(dst, &vsk->local_addr)) {
+			return sk_vsock(vsk);
+		}
+	}
+
+	return NULL;
+}
+
+bool __vsock_in_bound_table(struct sock *sk)
+{
+	struct vsock_sock *vsk = vsock_sk(sk);
+
+	return !list_empty(&vsk->bound_table);
+}
+
+bool __vsock_in_connected_table(struct sock *sk)
+{
+	struct vsock_sock *vsk = vsock_sk(sk);
+
+	return !list_empty(&vsk->connected_table);
+}
+
+void vsock_add_pending(struct sock *listener, struct sock *pending)
+{
+	struct vsock_sock *vlistener;
+	struct vsock_sock *vpending;
+
+	vlistener = vsock_sk(listener);
+	vpending = vsock_sk(pending);
+
+	sock_hold(pending);
+	sock_hold(listener);
+	list_add_tail(&vpending->pending_links, &vlistener->pending_links);
+}
+
+void vsock_remove_pending(struct sock *listener, struct sock *pending)
+{
+	struct vsock_sock *vpending = vsock_sk(pending);
+
+	list_del_init(&vpending->pending_links);
+	sock_put(listener);
+	sock_put(pending);
+}
+
+void vsock_enqueue_accept(struct sock *listener, struct sock *connected)
+{
+	struct vsock_sock *vlistener;
+	struct vsock_sock *vconnected;
+
+	vlistener = vsock_sk(listener);
+	vconnected = vsock_sk(connected);
+
+	sock_hold(connected);
+	sock_hold(listener);
+	list_add_tail(&vconnected->accept_queue, &vlistener->accept_queue);
+}
+
+struct sock *vsock_dequeue_accept(struct sock *listener)
+{
+	struct vsock_sock *vlistener;
+	struct vsock_sock *vconnected;
+
+	vlistener = vsock_sk(listener);
+
+	if (list_empty(&vlistener->accept_queue))
+		return NULL;
+
+	vconnected = list_entry(vlistener->accept_queue.next,
+				struct vsock_sock, accept_queue);
+
+	list_del_init(&vconnected->accept_queue);
+	sock_put(listener);
+	/* The caller will need a reference on the connected socket so we let
+	 * it call sock_put().
+	 */
+
+	return sk_vsock(vconnected);
+}
+
+void vsock_remove_accept(struct sock *listener, struct sock *connected)
+{
+	struct vsock_sock *vconnected;
+
+	if (!vsock_in_accept_queue(connected))
+		return;
+
+	vconnected = vsock_sk(connected);
+
+	list_del_init(&vconnected->accept_queue);
+	sock_put(listener);
+	sock_put(connected);
+}
+
+bool vsock_in_accept_queue(struct sock *sk)
+{
+	/* If our accept queue isn't empty, it means we're linked into some
+	 * listener socket's accept queue.
+	 */
+	return !vsock_is_accept_queue_empty(sk);
+}
+
+bool vsock_is_accept_queue_empty(struct sock *sk)
+{
+	struct vsock_sock *vsk = vsock_sk(sk);
+	return list_empty(&vsk->accept_queue);
+}
+
+bool vsock_is_pending(struct sock *sk)
+{
+	struct vsock_sock *vsk = vsock_sk(sk);
+	return !list_empty(&vsk->pending_links);
+}
+static int vsock_send_shutdown(struct sock *sk, int mode)
+{
+	return transport->send_shutdown(sk, mode);
+}
+
+void vsock_pending_work(struct work_struct *work)
+{
+	struct sock *sk;
+	struct sock *listener;
+	struct vsock_sock *vsk;
+	bool cleanup;
+
+	vsk = container_of(work, struct vsock_sock, dwork.work);
+	sk = sk_vsock(vsk);
+	listener = vsk->listener;
+	cleanup = true;
+
+	lock_sock(listener);
+	lock_sock(sk);
+
+	if (vsock_is_pending(sk)) {
+		vsock_remove_pending(listener, sk);
+	} else if (!vsk->rejected) {
+		/* We are not on the pending list and accept() did not reject
+		 * us, so we must have been accepted by our user process.  We
+		 * just need to drop our references to the sockets and be on
+		 * our way.
+		 */
+		cleanup = false;
+		goto out;
+	}
+
+	listener->sk_ack_backlog--;
+
+	/* We need to remove ourself from the global connected sockets list so
+	 * incoming packets can't find this socket, and to reduce the reference
+	 * count.
+	 */
+	if (vsock_in_connected_table(sk))
+		vsock_remove_connected(sk);
+
+	sk->sk_state = SS_FREE;
+
+out:
+	release_sock(sk);
+	release_sock(listener);
+	if (cleanup)
+		sock_put(sk);
+
+	sock_put(sk);
+	sock_put(listener);
+}
+
+/**** SOCKET OPERATIONS ****/
+
+static int __vsock_bind_stream(struct vsock_sock *vsk,
+			       struct sockaddr_vm *addr)
+{
+	static u32 port = LAST_RESERVED_PORT + 1;
+	struct sockaddr_vm new_addr;
+
+	vsock_addr_init(&new_addr, addr->svm_cid, addr->svm_port);
+
+	if (addr->svm_port == VMADDR_PORT_ANY) {
+		bool found = false;
+		unsigned int i;
+
+		for (i = 0; i < MAX_PORT_RETRIES; i++) {
+			if (port <= LAST_RESERVED_PORT)
+				port = LAST_RESERVED_PORT + 1;
+
+			new_addr.svm_port = port++;
+
+			if (!__vsock_find_bound_socket(&new_addr)) {
+				found = true;
+				break;
+			}
+		}
+
+		if (!found)
+			return -EADDRNOTAVAIL;
+	} else {
+		/* If port is in reserved range, ensure caller
+		 * has necessary privileges.
+		 */
+		if (addr->svm_port <= LAST_RESERVED_PORT &&
+		    !capable(CAP_NET_BIND_SERVICE)) {
+			return -EACCES;
+		}
+
+		if (__vsock_find_bound_socket(&new_addr))
+			return -EADDRINUSE;
+	}
+
+	vsock_addr_init(&vsk->local_addr, new_addr.svm_cid, new_addr.svm_port);
+
+	/* Remove stream sockets from the unbound list and add them to the hash
+	 * table for easy lookup by its address.  The unbound list is simply an
+	 * extra entry at the end of the hash table, a trick used by AF_UNIX.
+	 */
+	__vsock_remove_bound(&vsk->sk);
+	__vsock_insert_bound(vsock_bound_sockets(&vsk->local_addr),
+			     &vsk->sk);
+
+	return 0;
+}
+
+static int __vsock_bind_dgram(struct vsock_sock *vsk,
+			      struct sockaddr_vm *addr)
+{
+	return transport->bind_dgram(vsk, addr);
+}
+
+static int __vsock_bind(struct sock *sk, struct sockaddr_vm *addr)
+{
+	struct vsock_sock *vsk = vsock_sk(sk);
+	u32 cid;
+	int retval;
+
+	/* First ensure this socket isn't already bound. */
+	if (vsock_addr_bound(&vsk->local_addr))
+		return -EINVAL;
+
+	/* Now bind to the provided address or select appropriate values if
+	 * none are provided (VMADDR_CID_ANY and VMADDR_PORT_ANY).  Note that
+	 * like AF_INET prevents binding to a non-local IP address (in most
+	 * cases), we only allow binding to the local CID.
+	 */
+	cid = vmci_get_context_id();
+	if (addr->svm_cid != cid && addr->svm_cid != VMADDR_CID_ANY)
+		return -EADDRNOTAVAIL;
+
+	switch (sk->sk_socket->type) {
+	case SOCK_STREAM:
+		spin_lock_bh(&vsock_table_lock);
+		retval = __vsock_bind_stream(vsk, addr);
+		spin_unlock_bh(&vsock_table_lock);
+		break;
+
+	case SOCK_DGRAM:
+		retval = __vsock_bind_dgram(vsk, addr);
+		break;
+
+	default:
+		retval = -EINVAL;
+		break;
+	}
+
+	return retval;
+}
+
+struct sock *__vsock_create(struct net *net,
+			    struct socket *sock,
+			    struct sock *parent,
+			    gfp_t priority,
+			    unsigned short type)
+{
+	struct sock *sk;
+	struct vsock_sock *psk;
+	struct vsock_sock *vsk;
+
+	vsk = NULL;
+
+	sk = sk_alloc(net, AF_VSOCK, priority, &vsock_proto);
+	if (!sk)
+		return NULL;
+
+	sock_init_data(sock, sk);
+
+	/* sk->sk_type is normally set in sock_init_data, but only if sock is
+	 * non-NULL. We make sure that our sockets always have a type by
+	 * setting it here if needed.
+	 */
+	if (!sock)
+		sk->sk_type = type;
+
+	vsk = vsock_sk(sk);
+	vsock_addr_init(&vsk->local_addr, VMADDR_CID_ANY, VMADDR_PORT_ANY);
+	vsock_addr_init(&vsk->remote_addr, VMADDR_CID_ANY, VMADDR_PORT_ANY);
+
+	sk->sk_destruct = vsock_sk_destruct;
+	sk->sk_backlog_rcv = vsock_queue_rcv_skb;
+	sk->sk_state = 0;
+	sock_reset_flag(sk, SOCK_DONE);
+
+	INIT_LIST_HEAD(&vsk->bound_table);
+	INIT_LIST_HEAD(&vsk->connected_table);
+	vsk->listener = NULL;
+	INIT_LIST_HEAD(&vsk->pending_links);
+	INIT_LIST_HEAD(&vsk->accept_queue);
+	vsk->rejected = false;
+	vsk->sent_request = false;
+	vsk->ignore_connecting_rst = false;
+	vsk->peer_shutdown = 0;
+
+	psk = parent ? vsock_sk(parent) : NULL;
+	if (parent) {
+		vsk->trusted = psk->trusted;
+		vsk->owner = get_cred(psk->owner);
+		vsk->connect_timeout = psk->connect_timeout;
+	} else {
+		vsk->trusted = capable(CAP_NET_ADMIN);
+		vsk->owner = get_current_cred();
+		vsk->connect_timeout = VSOCK_DEFAULT_CONNECT_TIMEOUT;
+	}
+
+	transport->init(vsk, psk);
+
+	if (sock)
+		vsock_insert_bound(vsock_unbound_sockets, sk);
+
+	return sk;
+}
+
+static void __vsock_release(struct sock *sk)
+{
+	if (sk) {
+		struct sk_buff *skb;
+		struct sock *pending;
+		struct vsock_sock *vsk;
+
+		vsk = vsock_sk(sk);
+		pending = NULL;	/* Compiler warning. */
+
+		if (vsock_in_bound_table(sk))
+			vsock_remove_bound(sk);
+
+		if (vsock_in_connected_table(sk))
+			vsock_remove_connected(sk);
+
+		transport->release(vsk);
+		lock_sock(sk);
+		sock_orphan(sk);
+		sk->sk_shutdown = SHUTDOWN_MASK;
+
+		while ((skb = skb_dequeue(&sk->sk_receive_queue)))
+			kfree_skb(skb);
+
+		/* Clean up any sockets that never were accepted. */
+		while ((pending = vsock_dequeue_accept(sk)) != NULL) {
+			__vsock_release(pending);
+			sock_put(pending);
+		}
+
+		release_sock(sk);
+		sock_put(sk);
+	}
+}
+
+static void vsock_sk_destruct(struct sock *sk)
+{
+	struct vsock_sock *vsk = vsock_sk(sk);
+
+	transport->destruct(vsk);
+
+	/* When clearing these addresses, there's no need to set the family and
+	 * possibly register the address family with the kernel.
+	 */
+	vsock_addr_init(&vsk->local_addr, VMADDR_CID_ANY, VMADDR_PORT_ANY);
+	vsock_addr_init(&vsk->remote_addr, VMADDR_CID_ANY, VMADDR_PORT_ANY);
+
+	NOTIFYCALL(vsk, socket_destruct, sk);
+
+	put_cred(vsk->owner);
+}
+
+static int vsock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
+{
+	int err;
+
+	err = sock_queue_rcv_skb(sk, skb);
+	if (err)
+		kfree_skb(skb);
+
+	return err;
+}
+
+s64 vsock_stream_has_data(struct vsock_sock *vsk)
+{
+	return transport->stream_has_data(vsk);
+}
+
+s64 vsock_stream_has_space(struct vsock_sock *vsk)
+{
+	return transport->stream_has_space(vsk);
+}
+
+static int vsock_release(struct socket *sock)
+{
+	__vsock_release(sock->sk);
+	sock->sk = NULL;
+	sock->state = SS_FREE;
+
+	return 0;
+}
+
+static int
+vsock_bind(struct socket *sock, struct sockaddr *addr, int addr_len)
+{
+	int err;
+	struct sock *sk;
+	struct sockaddr_vm *vm_addr;
+
+	sk = sock->sk;
+
+	if (vsock_addr_cast(addr, addr_len, &vm_addr) != 0)
+		return -EINVAL;
+
+	lock_sock(sk);
+	err = __vsock_bind(sk, vm_addr);
+	release_sock(sk);
+
+	return err;
+}
+
+static int vsock_getname(struct socket *sock,
+			 struct sockaddr *addr, int *addr_len, int peer)
+{
+	int err;
+	struct sock *sk;
+	struct vsock_sock *vsk;
+	struct sockaddr_vm *vm_addr;
+
+	sk = sock->sk;
+	vsk = vsock_sk(sk);
+	err = 0;
+
+	lock_sock(sk);
+
+	if (peer) {
+		if (sock->state != SS_CONNECTED) {
+			err = -ENOTCONN;
+			goto out;
+		}
+		vm_addr = &vsk->remote_addr;
+	} else {
+		vm_addr = &vsk->local_addr;
+	}
+
+	if (!vm_addr) {
+		err = -EINVAL;
+		goto out;
+	}
+
+	/* sys_getsockname() and sys_getpeername() pass us a
+	 * MAX_SOCK_ADDR-sized buffer and don't set addr_len.  Unfortunately
+	 * that macro is defined in socket.c instead of .h, so we hardcode its
+	 * value here.
+	 */
+	BUILD_BUG_ON(sizeof(*vm_addr) > 128);
+	memcpy(addr, vm_addr, sizeof(*vm_addr));
+	*addr_len = sizeof(*vm_addr);
+
+out:
+	release_sock(sk);
+	return err;
+}
+
+static int vsock_shutdown(struct socket *sock, int mode)
+{
+	int err;
+	struct sock *sk;
+
+	/* User level uses SHUT_RD (0) and SHUT_WR (1), but the kernel uses
+	 * RCV_SHUTDOWN (1) and SEND_SHUTDOWN (2), so we must increment mode
+	 * here like the other address families do.  Note also that the
+	 * increment makes SHUT_RDWR (2) into RCV_SHUTDOWN | SEND_SHUTDOWN (3),
+	 * which is what we want.
+	 */
+	mode++;
+
+	if ((mode & ~SHUTDOWN_MASK) || !mode)
+		return -EINVAL;
+
+	/* If this is a STREAM socket and it is not connected then bail out
+	 * immediately.  If it is a DGRAM socket then we must first kick the
+	 * socket so that it wakes up from any sleeping calls, for example
+	 * recv(), and then afterwards return the error.
+	 */
+
+	sk = sock->sk;
+	if (sock->state == SS_UNCONNECTED) {
+		err = -ENOTCONN;
+		if (sk->sk_type == SOCK_STREAM)
+			return err;
+	} else {
+		sock->state = SS_DISCONNECTING;
+		err = 0;
+	}
+
+	/* Receive and send shutdowns are treated alike. */
+	mode = mode & (RCV_SHUTDOWN | SEND_SHUTDOWN);
+	if (mode) {
+		lock_sock(sk);
+		sk->sk_shutdown |= mode;
+		sk->sk_state_change(sk);
+		release_sock(sk);
+
+		if (sk->sk_type == SOCK_STREAM) {
+			sock_reset_flag(sk, SOCK_DONE);
+			vsock_send_shutdown(sk, mode);
+		}
+	}
+
+	return err;
+}
+
+static unsigned int vsock_poll(struct file *file, struct socket *sock,
+			       poll_table *wait)
+{
+	struct sock *sk;
+	unsigned int mask;
+	struct vsock_sock *vsk;
+
+	sk = sock->sk;
+	vsk = vsock_sk(sk);
+
+	poll_wait(file, sk_sleep(sk), wait);
+	mask = 0;
+
+	if (sk->sk_err)
+		/* Signify that there has been an error on this socket. */
+		mask |= POLLERR;
+
+	/* INET sockets treat local write shutdown and peer write shutdown as a
+	 * case of POLLHUP set.
+	 */
+	if ((sk->sk_shutdown == SHUTDOWN_MASK) ||
+	    ((sk->sk_shutdown & SEND_SHUTDOWN) &&
+	     (vsk->peer_shutdown & SEND_SHUTDOWN))) {
+		mask |= POLLHUP;
+	}
+
+	if (sk->sk_shutdown & RCV_SHUTDOWN ||
+	    vsk->peer_shutdown & SEND_SHUTDOWN) {
+		mask |= POLLRDHUP;
+	}
+
+	if (sock->type == SOCK_DGRAM) {
+		/* For datagram sockets we can read if there is something in
+		 * the queue and write as long as the socket isn't shutdown for
+		 * sending.
+		 */
+		if (!skb_queue_empty(&sk->sk_receive_queue) ||
+		    (sk->sk_shutdown & RCV_SHUTDOWN)) {
+			mask |= POLLIN | POLLRDNORM;
+		}
+
+		if (!(sk->sk_shutdown & SEND_SHUTDOWN))
+			mask |= POLLOUT | POLLWRNORM | POLLWRBAND;
+
+	} else if (sock->type == SOCK_STREAM) {
+		lock_sock(sk);
+
+		/* Listening sockets that have connections in their accept
+		 * queue can be read.
+		 */
+		if (sk->sk_state == SS_LISTEN
+		    && !vsock_is_accept_queue_empty(sk))
+			mask |= POLLIN | POLLRDNORM;
+
+		/* If there is something in the queue then we can read. */
+		if (!vmci_handle_is_invalid(vsk->trans.qp_handle) &&
+		    !(sk->sk_shutdown & RCV_SHUTDOWN)) {
+			bool data_ready_now = false;
+			int ret = 0;
+			NOTIFYCALLRET(vsk, ret, poll_in, sk, 1,
+				      &data_ready_now);
+			if (ret < 0) {
+				mask |= POLLERR;
+			} else {
+				if (data_ready_now)
+					mask |= POLLIN | POLLRDNORM;
+
+			}
+		}
+
+		/* Sockets whose connections have been closed, reset, or
+		 * terminated should also be considered read, and we check the
+		 * shutdown flag for that.
+		 */
+		if (sk->sk_shutdown & RCV_SHUTDOWN ||
+		    vsk->peer_shutdown & SEND_SHUTDOWN) {
+			mask |= POLLIN | POLLRDNORM;
+		}
+
+		/* Connected sockets that can produce data can be written. */
+		if (sk->sk_state == SS_CONNECTED) {
+			if (!(sk->sk_shutdown & SEND_SHUTDOWN)) {
+				bool space_avail_now = false;
+				int ret = 0;
+
+				NOTIFYCALLRET(vsk, ret, poll_out, sk, 1,
+					      &space_avail_now);
+				if (ret < 0) {
+					mask |= POLLERR;
+				} else {
+					if (space_avail_now)
+						/* Remove POLLWRBAND since INET
+						 * sockets are not setting it.
+						 */
+						mask |= POLLOUT | POLLWRNORM;
+
+				}
+			}
+		}
+
+		/* Simulate INET socket poll behaviors, which sets
+		 * POLLOUT|POLLWRNORM when peer is closed and nothing to read,
+		 * but local send is not shutdown.
+		 */
+		if (sk->sk_state == SS_UNCONNECTED) {
+			if (!(sk->sk_shutdown & SEND_SHUTDOWN))
+				mask |= POLLOUT | POLLWRNORM;
+
+		}
+
+		release_sock(sk);
+	}
+
+	return mask;
+}
+
+static int vsock_dgram_sendmsg(struct kiocb *kiocb, struct socket *sock,
+			       struct msghdr *msg, size_t len)
+{
+	int err;
+	struct sock *sk;
+	struct vsock_sock *vsk;
+	struct sockaddr_vm *remote_addr;
+
+	if (msg->msg_flags & MSG_OOB)
+		return -EOPNOTSUPP;
+
+	if (len > VMCI_MAX_DG_PAYLOAD_SIZE)
+		return -EMSGSIZE;
+
+	/* For now, MSG_DONTWAIT is always assumed... */
+	err = 0;
+	sk = sock->sk;
+	vsk = vsock_sk(sk);
+
+	lock_sock(sk);
+
+	if (!vsock_addr_bound(&vsk->local_addr)) {
+		struct sockaddr_vm local_addr;
+
+		vsock_addr_init(&local_addr, VMADDR_CID_ANY, VMADDR_PORT_ANY);
+		err = __vsock_bind(sk, &local_addr);
+		if (err != 0)
+			goto out;
+
+	}
+
+	/* If the provided message contains an address, use that.  Otherwise
+	 * fall back on the socket's remote handle (if it has been connected).
+	 */
+	if (msg->msg_name &&
+	    vsock_addr_cast(msg->msg_name, msg->msg_namelen,
+			    &remote_addr) == 0) {
+		/* Ensure this address is of the right type and is a valid
+		 * destination.
+		 */
+
+		if (remote_addr->svm_cid == VMADDR_CID_ANY)
+			remote_addr->svm_cid = vmci_get_context_id();
+
+		if (!vsock_addr_bound(remote_addr)) {
+			err = -EINVAL;
+			goto out;
+		}
+	} else if (sock->state == SS_CONNECTED) {
+		remote_addr = &vsk->remote_addr;
+
+		if (remote_addr->svm_cid == VMADDR_CID_ANY)
+			remote_addr->svm_cid = vmci_get_context_id();
+
+		/* XXX Should connect() or this function ensure remote_addr is
+		 * bound?
+		 */
+		if (!vsock_addr_bound(&vsk->remote_addr)) {
+			err = -EINVAL;
+			goto out;
+		}
+	} else {
+		err = -EINVAL;
+		goto out;
+	}
+
+	/* Make sure that we don't allow a userlevel app to send datagrams to
+	 * the hypervisor that modify VMCI device state.
+	 */
+	if (!vsock_addr_socket_context_dgram(remote_addr->svm_cid,
+					     remote_addr->svm_port)) {
+		err = -EINVAL;
+		goto out;
+	}
+
+	err = transport->send_dgram(vsk, remote_addr, msg->msg_iov, len);
+
+out:
+	release_sock(sk);
+	return err;
+}
+
+static int vsock_dgram_connect(struct socket *sock,
+			       struct sockaddr *addr, int addr_len, int flags)
+{
+	int err;
+	struct sock *sk;
+	struct vsock_sock *vsk;
+	struct sockaddr_vm *remote_addr;
+
+	sk = sock->sk;
+	vsk = vsock_sk(sk);
+
+	err = vsock_addr_cast(addr, addr_len, &remote_addr);
+	if (err == -EAFNOSUPPORT && remote_addr->svm_family == AF_UNSPEC) {
+		lock_sock(sk);
+		vsock_addr_init(&vsk->remote_addr, VMADDR_CID_ANY,
+				VMADDR_PORT_ANY);
+		sock->state = SS_UNCONNECTED;
+		release_sock(sk);
+		return 0;
+	} else if (err != 0)
+		return -EINVAL;
+
+	lock_sock(sk);
+
+	if (!vsock_addr_bound(&vsk->local_addr)) {
+		struct sockaddr_vm local_addr;
+
+		vsock_addr_init(&local_addr, VMADDR_CID_ANY, VMADDR_PORT_ANY);
+		err = __vsock_bind(sk, &local_addr);
+		if (err != 0)
+			goto out;
+
+	}
+
+	if (!vsock_addr_socket_context_dgram(remote_addr->svm_cid,
+					     remote_addr->svm_port)) {
+		err = -EINVAL;
+		goto out;
+	}
+
+	memcpy(&vsk->remote_addr, remote_addr, sizeof(vsk->remote_addr));
+	sock->state = SS_CONNECTED;
+
+out:
+	release_sock(sk);
+	return err;
+}
+
+
+static int vsock_dgram_recvmsg(struct kiocb *kiocb, struct socket *sock,
+			       struct msghdr *msg, size_t len, int flags)
+{
+	int err;
+	int noblock;
+	struct sock *sk;
+	struct vmci_datagram *dg;
+	size_t payload_len;
+	struct sk_buff *skb;
+
+	sk = sock->sk;
+	noblock = flags & MSG_DONTWAIT;
+
+	if (flags & MSG_OOB || flags & MSG_ERRQUEUE)
+		return -EOPNOTSUPP;
+
+	/* Retrieve the head sk_buff from the socket's receive queue. */
+	err = 0;
+	skb = skb_recv_datagram(sk, flags, noblock, &err);
+	if (err)
+		return err;
+
+	if (!skb)
+		return -EAGAIN;
+
+	dg = (struct vmci_datagram *)skb->data;
+	if (!dg)
+		/* err is 0, meaning we read zero bytes. */
+		goto out;
+
+	payload_len = dg->payload_size;
+	/* Ensure the sk_buff matches the payload size claimed in the packet. */
+	if (payload_len != skb->len - sizeof(*dg)) {
+		err = -EINVAL;
+		goto out;
+	}
+
+	if (payload_len > len) {
+		payload_len = len;
+		msg->msg_flags |= MSG_TRUNC;
+	}
+
+	/* Place the datagram payload in the user's iovec. */
+	err = skb_copy_datagram_iovec(skb, sizeof(*dg), msg->msg_iov,
+		payload_len);
+	if (err)
+		goto out;
+
+	msg->msg_namelen = 0;
+	if (msg->msg_name) {
+		struct sockaddr_vm *vm_addr;
+
+		/* Provide the address of the sender. */
+		vm_addr = (struct sockaddr_vm *)msg->msg_name;
+		vsock_addr_init(vm_addr, dg->src.context, dg->src.resource);
+		msg->msg_namelen = sizeof(*vm_addr);
+	}
+	err = payload_len;
+
+out:
+	skb_free_datagram(sk, skb);
+	return err;
+}
+
+static const struct proto_ops vsock_dgram_ops = {
+	.family = PF_VSOCK,
+	.owner = THIS_MODULE,
+	.release = vsock_release,
+	.bind = vsock_bind,
+	.connect = vsock_dgram_connect,
+	.socketpair = sock_no_socketpair,
+	.accept = sock_no_accept,
+	.getname = vsock_getname,
+	.poll = vsock_poll,
+	.ioctl = sock_no_ioctl,
+	.listen = sock_no_listen,
+	.shutdown = vsock_shutdown,
+	.setsockopt = sock_no_setsockopt,
+	.getsockopt = sock_no_getsockopt,
+	.sendmsg = vsock_dgram_sendmsg,
+	.recvmsg = vsock_dgram_recvmsg,
+	.mmap = sock_no_mmap,
+	.sendpage = sock_no_sendpage,
+};
+
+static void vsock_connect_timeout(struct work_struct *work)
+{
+	struct sock *sk;
+	struct vsock_sock *vsk;
+
+	vsk = container_of(work, struct vsock_sock, dwork.work);
+	sk = sk_vsock(vsk);
+
+	lock_sock(sk);
+	if (sk->sk_state == SS_CONNECTING &&
+	    (sk->sk_shutdown != SHUTDOWN_MASK)) {
+		sk->sk_state = SS_UNCONNECTED;
+		sk->sk_err = ETIMEDOUT;
+		sk->sk_error_report(sk);
+	}
+	release_sock(sk);
+
+	sock_put(sk);
+}
+
+static int vsock_stream_connect(struct socket *sock, struct sockaddr *addr,
+				int addr_len, int flags)
+{
+	int err;
+	struct sock *sk;
+	struct vsock_sock *vsk;
+	struct sockaddr_vm *remote_addr;
+	long timeout;
+	DEFINE_WAIT(wait);
+
+	err = 0;
+	sk = sock->sk;
+	vsk = vsock_sk(sk);
+
+	lock_sock(sk);
+
+	/* XXX AF_UNSPEC should make us disconnect like AF_INET. */
+	switch (sock->state) {
+	case SS_CONNECTED:
+		err = -EISCONN;
+		goto out;
+	case SS_DISCONNECTING:
+		err = -EINVAL;
+		goto out;
+	case SS_CONNECTING:
+		/* This continues on so we can move sock into the SS_CONNECTED
+		 * state once the connection has completed (at which point err
+		 * will be set to zero also).  Otherwise, we will either wait
+		 * for the connection or return -EALREADY should this be a
+		 * non-blocking call.
+		 */
+		err = -EALREADY;
+		break;
+	default:
+		if ((sk->sk_state == SS_LISTEN) ||
+		    vsock_addr_cast(addr, addr_len, &remote_addr) != 0) {
+			err = -EINVAL;
+			goto out;
+		}
+
+		/* The hypervisor and well-known contexts do not have socket
+		 * endpoints.
+		 */
+		if (!vsock_addr_socket_context_stream(remote_addr->svm_cid)) {
+			err = -ENETUNREACH;
+			goto out;
+		}
+
+		/* Set the remote address that we are connecting to. */
+		memcpy(&vsk->remote_addr, remote_addr,
+		       sizeof(vsk->remote_addr));
+
+		/* Autobind this socket to the local address if necessary. */
+		if (!vsock_addr_bound(&vsk->local_addr)) {
+			struct sockaddr_vm local_addr;
+
+			vsock_addr_init(&local_addr, VMADDR_CID_ANY,
+					VMADDR_PORT_ANY);
+			err = __vsock_bind(sk, &local_addr);
+			if (err != 0)
+				goto out;
+
+		}
+
+		sk->sk_state = SS_CONNECTING;
+
+		err = transport->connect(vsk);
+		if (err < 0)
+			goto out;
+
+		/* Mark sock as connecting and set the error code to in
+		 * progress in case this is a non-blocking connect.
+		 */
+		sock->state = SS_CONNECTING;
+		err = -EINPROGRESS;
+	}
+
+	/* The receive path will handle all communication until we are able to
+	 * enter the connected state.  Here we wait for the connection to be
+	 * completed or a notification of an error.
+	 */
+	timeout = vsk->connect_timeout;
+	prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
+
+	while (sk->sk_state != SS_CONNECTED && sk->sk_err == 0) {
+		if (flags & O_NONBLOCK) {
+			/* If we're not going to block, we schedule a timeout
+			 * function to generate a timeout on the connection
+			 * attempt, in case the peer doesn't respond in a
+			 * timely manner. We hold on to the socket until the
+			 * timeout fires.
+			 */
+			sock_hold(sk);
+			INIT_DELAYED_WORK(&vsk->dwork,
+					  vsock_connect_timeout);
+			schedule_delayed_work(&vsk->dwork, timeout);
+
+			/* Skip ahead to preserve error code set above. */
+			goto out_wait;
+		}
+
+		release_sock(sk);
+		timeout = schedule_timeout(timeout);
+		lock_sock(sk);
+
+		if (signal_pending(current)) {
+			err = sock_intr_errno(timeout);
+			goto out_wait_error;
+		} else if (timeout == 0) {
+			err = -ETIMEDOUT;
+			goto out_wait_error;
+		}
+
+		prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
+	}
+
+	if (sk->sk_err) {
+		err = -sk->sk_err;
+		goto out_wait_error;
+	} else
+		err = 0;
+
+out_wait:
+	finish_wait(sk_sleep(sk), &wait);
+out:
+	release_sock(sk);
+	return err;
+
+out_wait_error:
+	sk->sk_state = SS_UNCONNECTED;
+	sock->state = SS_UNCONNECTED;
+	goto out_wait;
+}
+
+static int vsock_accept(struct socket *sock, struct socket *newsock, int flags)
+{
+	struct sock *listener;
+	int err;
+	struct sock *connected;
+	struct vsock_sock *vconnected;
+	long timeout;
+	DEFINE_WAIT(wait);
+
+	err = 0;
+	listener = sock->sk;
+
+	lock_sock(listener);
+
+	if (sock->type != SOCK_STREAM) {
+		err = -EOPNOTSUPP;
+		goto out;
+	}
+
+	if (listener->sk_state != SS_LISTEN) {
+		err = -EINVAL;
+		goto out;
+	}
+
+	/* Wait for children sockets to appear; these are the new sockets
+	 * created upon connection establishment.
+	 */
+	timeout = sock_sndtimeo(listener, flags & O_NONBLOCK);
+	prepare_to_wait(sk_sleep(listener), &wait, TASK_INTERRUPTIBLE);
+
+	while ((connected = vsock_dequeue_accept(listener)) == NULL &&
+	       listener->sk_err == 0) {
+		release_sock(listener);
+		timeout = schedule_timeout(timeout);
+		lock_sock(listener);
+
+		if (signal_pending(current)) {
+			err = sock_intr_errno(timeout);
+			goto out_wait;
+		} else if (timeout == 0) {
+			err = -EAGAIN;
+			goto out_wait;
+		}
+
+		prepare_to_wait(sk_sleep(listener), &wait, TASK_INTERRUPTIBLE);
+	}
+
+	if (listener->sk_err)
+		err = -listener->sk_err;
+
+	if (connected) {
+		listener->sk_ack_backlog--;
+
+		lock_sock(connected);
+		vconnected = vsock_sk(connected);
+
+		/* If the listener socket has received an error, then we should
+		 * reject this socket and return.  Note that we simply mark the
+		 * socket rejected, drop our reference, and let the cleanup
+		 * function handle the cleanup; the fact that we found it in
+		 * the listener's accept queue guarantees that the cleanup
+		 * function hasn't run yet.
+		 */
+		if (err) {
+			vconnected->rejected = true;
+			release_sock(connected);
+			sock_put(connected);
+			goto out_wait;
+		}
+
+		newsock->state = SS_CONNECTED;
+		sock_graft(connected, newsock);
+		release_sock(connected);
+		sock_put(connected);
+	}
+
+out_wait:
+	finish_wait(sk_sleep(listener), &wait);
+out:
+	release_sock(listener);
+	return err;
+}
+
+static int vsock_listen(struct socket *sock, int backlog)
+{
+	int err;
+	struct sock *sk;
+	struct vsock_sock *vsk;
+
+	sk = sock->sk;
+
+	lock_sock(sk);
+
+	if (sock->type != SOCK_STREAM) {
+		err = -EOPNOTSUPP;
+		goto out;
+	}
+
+	if (sock->state != SS_UNCONNECTED) {
+		err = -EINVAL;
+		goto out;
+	}
+
+	vsk = vsock_sk(sk);
+
+	if (!vsock_addr_bound(&vsk->local_addr)) {
+		err = -EINVAL;
+		goto out;
+	}
+
+	sk->sk_max_ack_backlog = backlog;
+	sk->sk_state = SS_LISTEN;
+
+	err = 0;
+
+out:
+	release_sock(sk);
+	return err;
+}
+
+static int vsock_stream_setsockopt(struct socket *sock,
+				   int level,
+				   int optname,
+				   char __user *optval,
+				   unsigned int optlen)
+{
+	int err;
+	struct sock *sk;
+	struct vsock_sock *vsk;
+	u64 val;
+
+	if (level != AF_VSOCK)
+		return -ENOPROTOOPT;
+
+#define COPY_IN(_v)                                       \
+	do {						  \
+		if (optlen < sizeof(_v)) {		  \
+			err = -EINVAL;			  \
+			goto exit;			  \
+		}					  \
+		if (copy_from_user(&_v, optval, sizeof(_v)) != 0) {	\
+			err = -EFAULT;					\
+			goto exit;					\
+		}							\
+	} while (0)
+
+	err = 0;
+	sk = sock->sk;
+	vsk = vsock_sk(sk);
+
+	lock_sock(sk);
+
+	switch (optname) {
+	case SO_VM_SOCKETS_BUFFER_SIZE:
+		COPY_IN(val);
+		if (val < vsk->trans.queue_pair_min_size)
+			vsk->trans.queue_pair_min_size = val;
+
+		if (val > vsk->trans.queue_pair_max_size)
+			vsk->trans.queue_pair_max_size = val;
+
+		vsk->trans.queue_pair_size = val;
+		break;
+
+	case SO_VM_SOCKETS_BUFFER_MAX_SIZE:
+		COPY_IN(val);
+		if (val < vsk->trans.queue_pair_size)
+			vsk->trans.queue_pair_size = val;
+
+		vsk->trans.queue_pair_max_size = val;
+		break;
+
+	case SO_VM_SOCKETS_BUFFER_MIN_SIZE:
+		COPY_IN(val);
+		if (val > vsk->trans.queue_pair_size)
+			vsk->trans.queue_pair_size = val;
+
+		vsk->trans.queue_pair_min_size = val;
+		break;
+
+	case SO_VM_SOCKETS_CONNECT_TIMEOUT: {
+		struct timeval tv;
+		COPY_IN(tv);
+		if (tv.tv_sec >= 0 && tv.tv_usec < USEC_PER_SEC &&
+		    tv.tv_sec < (MAX_SCHEDULE_TIMEOUT / HZ - 1)) {
+			vsk->connect_timeout = tv.tv_sec * HZ +
+			    DIV_ROUND_UP(tv.tv_usec, (1000000 / HZ));
+			if (vsk->connect_timeout == 0)
+				vsk->connect_timeout =
+				    VSOCK_DEFAULT_CONNECT_TIMEOUT;
+
+		} else {
+			err = -ERANGE;
+		}
+		break;
+	}
+
+	default:
+		err = -ENOPROTOOPT;
+		break;
+	}
+
+#undef COPY_IN
+
+exit:
+	release_sock(sk);
+	return err;
+}
+
+static int vsock_stream_getsockopt(struct socket *sock,
+				   int level, int optname,
+				   char __user *optval,
+				   int __user *optlen)
+{
+	int err;
+	int len;
+	struct sock *sk;
+	struct vsock_sock *vsk;
+
+	if (level != AF_VSOCK)
+		return -ENOPROTOOPT;
+
+	err = get_user(len, optlen);
+	if (err != 0)
+		return err;
+
+#define COPY_OUT(_v)                            \
+	do {					\
+		if (len < sizeof(_v))		\
+			return -EINVAL;		\
+						\
+		len = sizeof(_v);		\
+		if (copy_to_user(optval, &_v, len) != 0)	\
+			return -EFAULT;				\
+								\
+	} while (0)
+
+	err = 0;
+	sk = sock->sk;
+	vsk = vsock_sk(sk);
+
+	switch (optname) {
+	case SO_VM_SOCKETS_BUFFER_SIZE:
+		COPY_OUT(vsk->trans.queue_pair_size);
+		break;
+
+	case SO_VM_SOCKETS_BUFFER_MAX_SIZE:
+		COPY_OUT(vsk->trans.queue_pair_max_size);
+		break;
+
+	case SO_VM_SOCKETS_BUFFER_MIN_SIZE:
+		COPY_OUT(vsk->trans.queue_pair_min_size);
+		break;
+
+	case SO_VM_SOCKETS_CONNECT_TIMEOUT: {
+		struct timeval tv;
+		tv.tv_sec = vsk->connect_timeout / HZ;
+		tv.tv_usec =
+		    (vsk->connect_timeout -
+		     tv.tv_sec * HZ) * (1000000 / HZ);
+		COPY_OUT(tv);
+		break;
+	}
+	default:
+		return -ENOPROTOOPT;
+	}
+
+	err = put_user(len, optlen);
+	if (err != 0)
+		return -EFAULT;
+
+#undef COPY_OUT
+
+	return 0;
+}
+
+static int vsock_stream_sendmsg(struct kiocb *kiocb, struct socket *sock,
+				struct msghdr *msg, size_t len)
+{
+	struct sock *sk;
+	struct vsock_sock *vsk;
+	ssize_t total_written;
+	long timeout;
+	int err;
+	struct vmci_transport_send_notify_data send_data;
+
+	DEFINE_WAIT(wait);
+
+	sk = sock->sk;
+	vsk = vsock_sk(sk);
+	total_written = 0;
+	err = 0;
+
+	if (msg->msg_flags & MSG_OOB)
+		return -EOPNOTSUPP;
+
+	lock_sock(sk);
+
+	/* Callers should not provide a destination with stream sockets. */
+	if (msg->msg_namelen) {
+		err = sk->sk_state == SS_CONNECTED ? -EISCONN : -EOPNOTSUPP;
+		goto out;
+	}
+
+	/* Send data only if both sides are not shutdown in the direction. */
+	if (sk->sk_shutdown & SEND_SHUTDOWN ||
+	    vsk->peer_shutdown & RCV_SHUTDOWN) {
+		err = -EPIPE;
+		goto out;
+	}
+
+	if (sk->sk_state != SS_CONNECTED ||
+	    !vsock_addr_bound(&vsk->local_addr)) {
+		err = -ENOTCONN;
+		goto out;
+	}
+
+	if (!vsock_addr_bound(&vsk->remote_addr)) {
+		err = -EDESTADDRREQ;
+		goto out;
+	}
+
+	/* Wait for room in the produce queue to enqueue our user's data. */
+	timeout = sock_sndtimeo(sk, msg->msg_flags & MSG_DONTWAIT);
+
+	NOTIFYCALLRET(vsk, err, send_init, sk, &send_data);
+	if (err < 0)
+		goto out;
+
+	prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
+
+	while (total_written < len) {
+		ssize_t written;
+
+		while (vsock_stream_has_space(vsk) == 0 &&
+		       sk->sk_err == 0 &&
+		       !(sk->sk_shutdown & SEND_SHUTDOWN) &&
+		       !(vsk->peer_shutdown & RCV_SHUTDOWN)) {
+
+			/* Don't wait for non-blocking sockets. */
+			if (timeout == 0) {
+				err = -EAGAIN;
+				goto out_wait;
+			}
+
+			NOTIFYCALLRET(vsk, err, send_pre_block, sk, &send_data);
+
+			if (err < 0)
+				goto out_wait;
+
+			release_sock(sk);
+			timeout = schedule_timeout(timeout);
+			lock_sock(sk);
+			if (signal_pending(current)) {
+				err = sock_intr_errno(timeout);
+				goto out_wait;
+			} else if (timeout == 0) {
+				err = -EAGAIN;
+				goto out_wait;
+			}
+
+			prepare_to_wait(sk_sleep(sk), &wait,
+					TASK_INTERRUPTIBLE);
+		}
+
+		/* These checks occur both as part of and after the loop
+		 * conditional since we need to check before and after
+		 * sleeping.
+		 */
+		if (sk->sk_err) {
+			err = -sk->sk_err;
+			goto out_wait;
+		} else if ((sk->sk_shutdown & SEND_SHUTDOWN) ||
+			   (vsk->peer_shutdown & RCV_SHUTDOWN)) {
+			err = -EPIPE;
+			goto out_wait;
+		}
+
+		NOTIFYCALLRET(vsk, err, send_pre_enqueue, sk, &send_data);
+		if (err < 0)
+			goto out_wait;
+
+		/* Note that enqueue will only write as many bytes as are free
+		 * in the produce queue, so we don't need to ensure len is
+		 * smaller than the queue size.  It is the caller's
+		 * responsibility to check how many bytes we were able to send.
+		 */
+
+		written = transport->send_stream(vsk, msg->msg_iov,
+						 len - total_written);
+		if (written < 0) {
+			err = -ENOMEM;
+			goto out_wait;
+		}
+
+		total_written += written;
+
+		NOTIFYCALLRET(vsk, err, send_post_enqueue, sk, written,
+			      &send_data);
+		if (err < 0)
+			goto out_wait;
+
+	}
+
+out_wait:
+	if (total_written > 0)
+		err = total_written;
+	finish_wait(sk_sleep(sk), &wait);
+out:
+	release_sock(sk);
+	return err;
+}
+
+
+static int
+vsock_stream_recvmsg(struct kiocb *kiocb,
+		     struct socket *sock,
+		     struct msghdr *msg, size_t len, int flags)
+{
+	struct sock *sk;
+	struct vsock_sock *vsk;
+	int err;
+	size_t target;
+	ssize_t copied;
+	long timeout;
+	struct vmci_transport_recv_notify_data recv_data;
+
+	DEFINE_WAIT(wait);
+
+	sk = sock->sk;
+	vsk = vsock_sk(sk);
+	err = 0;
+
+	lock_sock(sk);
+
+	if (sk->sk_state != SS_CONNECTED) {
+		/* Recvmsg is supposed to return 0 if a peer performs an
+		 * orderly shutdown. Differentiate between that case and when a
+		 * peer has not connected or a local shutdown occured with the
+		 * SOCK_DONE flag.
+		 */
+		if (sock_flag(sk, SOCK_DONE))
+			err = 0;
+		else
+			err = -ENOTCONN;
+
+		goto out;
+	}
+
+	if (flags & MSG_OOB) {
+		err = -EOPNOTSUPP;
+		goto out;
+	}
+
+	/* We don't check peer_shutdown flag here since peer may actually shut
+	 * down, but there can be data in the VMCI queue that local socket can
+	 * receive.
+	 */
+	if (sk->sk_shutdown & RCV_SHUTDOWN) {
+		err = 0;
+		goto out;
+	}
+
+	/* It is valid on Linux to pass in a zero-length receive buffer.  This
+	 * is not an error.  We may as well bail out now.
+	 */
+	if (!len) {
+		err = 0;
+		goto out;
+	}
+
+	/* We must not copy less than target bytes into the user's buffer
+	 * before returning successfully, so we wait for the consume queue to
+	 * have that much data to consume before dequeueing.  Note that this
+	 * makes it impossible to handle cases where target is greater than the
+	 * queue size.
+	 */
+	target = sock_rcvlowat(sk, flags & MSG_WAITALL, len);
+	if (target >= vsk->trans.consume_size) {
+		err = -ENOMEM;
+		goto out;
+	}
+	timeout = sock_rcvtimeo(sk, flags & MSG_DONTWAIT);
+	copied = 0;
+
+	NOTIFYCALLRET(vsk, err, recv_init, sk, target, &recv_data);
+	if (err < 0)
+		goto out;
+
+	prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
+
+	while (1) {
+		s64 ready = vsock_stream_has_data(vsk);
+
+		if (ready < 0) {
+			/* Invalid queue pair content. XXX This should be
+			 * changed to a connection reset in a later change.
+			 */
+
+			err = -ENOMEM;
+			goto out_wait;
+		} else if (ready > 0) {
+			ssize_t read;
+
+			NOTIFYCALLRET(vsk, err, recv_pre_dequeue, sk, target,
+				      &recv_data);
+			if (err < 0)
+				break;
+
+			read = transport->recv_stream(vsk, msg->msg_iov,
+						      len - copied, flags);
+			if (read < 0) {
+				err = -ENOMEM;
+				break;
+			}
+
+			copied += read;
+
+			NOTIFYCALLRET(vsk, err, recv_post_dequeue, sk, target,
+				      read, !(flags & MSG_PEEK), &recv_data);
+			if (err < 0)
+				goto out_wait;
+
+			if (read >= target || flags & MSG_PEEK)
+				break;
+
+			target -= read;
+		} else {
+			if (sk->sk_err != 0 || (sk->sk_shutdown & RCV_SHUTDOWN)
+			    || (vsk->peer_shutdown & SEND_SHUTDOWN)) {
+				break;
+			}
+			/* Don't wait for non-blocking sockets. */
+			if (timeout == 0) {
+				err = -EAGAIN;
+				break;
+			}
+
+			NOTIFYCALLRET(vsk, err, recv_pre_block, sk, target,
+				      &recv_data);
+			if (err < 0)
+				break;
+
+			release_sock(sk);
+			timeout = schedule_timeout(timeout);
+			lock_sock(sk);
+
+			if (signal_pending(current)) {
+				err = sock_intr_errno(timeout);
+				break;
+			} else if (timeout == 0) {
+				err = -EAGAIN;
+				break;
+			}
+
+			prepare_to_wait(sk_sleep(sk), &wait,
+					TASK_INTERRUPTIBLE);
+		}
+	}
+
+	if (sk->sk_err)
+		err = -sk->sk_err;
+	else if (sk->sk_shutdown & RCV_SHUTDOWN)
+		err = 0;
+
+	if (copied > 0) {
+		/* We only do these additional bookkeeping/notification steps
+		 * if we actually copied something out of the queue pair
+		 * instead of just peeking ahead.
+		 */
+
+		if (!(flags & MSG_PEEK)) {
+			/* If the other side has shutdown for sending and there
+			 * is nothing more to read, then modify the socket
+			 * state.
+			 */
+			if (vsk->peer_shutdown & SEND_SHUTDOWN) {
+				if (vsock_stream_has_data(vsk) <= 0) {
+					sk->sk_state = SS_UNCONNECTED;
+					sock_set_flag(sk, SOCK_DONE);
+					sk->sk_state_change(sk);
+				}
+			}
+		}
+		err = copied;
+	}
+
+out_wait:
+	finish_wait(sk_sleep(sk), &wait);
+out:
+	release_sock(sk);
+	return err;
+}
+
+static const struct proto_ops vsock_stream_ops = {
+	.family = PF_VSOCK,
+	.owner = THIS_MODULE,
+	.release = vsock_release,
+	.bind = vsock_bind,
+	.connect = vsock_stream_connect,
+	.socketpair = sock_no_socketpair,
+	.accept = vsock_accept,
+	.getname = vsock_getname,
+	.poll = vsock_poll,
+	.ioctl = sock_no_ioctl,
+	.listen = vsock_listen,
+	.shutdown = vsock_shutdown,
+	.setsockopt = vsock_stream_setsockopt,
+	.getsockopt = vsock_stream_getsockopt,
+	.sendmsg = vsock_stream_sendmsg,
+	.recvmsg = vsock_stream_recvmsg,
+	.mmap = sock_no_mmap,
+	.sendpage = sock_no_sendpage,
+};
+
+static int vsock_create(struct net *net, struct socket *sock,
+			int protocol, int kern)
+{
+	if (!sock)
+		return -EINVAL;
+
+	if (protocol)
+		return -EPROTONOSUPPORT;
+
+	switch (sock->type) {
+	case SOCK_DGRAM:
+		sock->ops = &vsock_dgram_ops;
+		break;
+	case SOCK_STREAM:
+		sock->ops = &vsock_stream_ops;
+		break;
+	default:
+		return -ESOCKTNOSUPPORT;
+	}
+
+	sock->state = SS_UNCONNECTED;
+
+	return __vsock_create(net, sock, NULL, GFP_KERNEL, 0) ? 0 : -ENOMEM;
+}
+
+static const struct net_proto_family vsock_family_ops = {
+	.family = AF_VSOCK,
+	.create = vsock_create,
+	.owner = THIS_MODULE,
+};
+
+static long vsock_dev_do_ioctl(struct file *filp,
+			       unsigned int cmd, void __user *ptr)
+{
+	static const u16 parts[4] = VSOCK_DRIVER_VERSION_PARTS;
+	u32 __user *p = ptr;
+	int retval = 0;
+	u32 version;
+
+	switch (cmd) {
+	case IOCTL_VMCI_SOCKETS_VERSION:
+		version = VMCI_SOCKETS_MAKE_VERSION(parts);
+		if (put_user(version, p) != 0)
+			retval = -EFAULT;
+		break;
+
+	case IOCTL_VMCI_SOCKETS_GET_AF_VALUE:
+		if (put_user(AF_VSOCK, p) != 0)
+			retval = -EFAULT;
+
+		break;
+
+	case IOCTL_VMCI_SOCKETS_GET_LOCAL_CID:
+		if (put_user(vmci_get_context_id(), p) != 0)
+			retval = -EFAULT;
+
+		break;
+
+	default:
+		pr_err("Unknown ioctl %d\n", cmd);
+		retval = -EINVAL;
+	}
+
+	return retval;
+}
+
+static long vsock_dev_ioctl(struct file *filp,
+			    unsigned int cmd, unsigned long arg)
+{
+	return vsock_dev_do_ioctl(filp, cmd, (void __user *)arg);
+}
+
+#ifdef CONFIG_COMPAT
+static long vsock_dev_compat_ioctl(struct file *filp,
+				   unsigned int cmd, unsigned long arg)
+{
+	return vsock_dev_do_ioctl(filp, cmd, compat_ptr(arg));
+}
+#endif
+
+static const struct file_operations vsock_device_ops = {
+	.owner		= THIS_MODULE,
+	.unlocked_ioctl	= vsock_dev_ioctl,
+#ifdef CONFIG_COMPAT
+	.compat_ioctl	= vsock_dev_compat_ioctl,
+#endif
+	.open		= nonseekable_open,
+};
+
+static struct miscdevice vsock_device = {
+	.name		= "vsock",
+	.minor		= MISC_DYNAMIC_MINOR,
+	.fops		= &vsock_device_ops,
+};
+
+static int __init vsock_init(void)
+{
+	int err;
+
+	vsock_init_tables();
+
+	err = misc_register(&vsock_device);
+	if (err) {
+		pr_err("Failed to register misc device\n");
+		return -ENOENT;
+	}
+
+	err = vmci_transport_register(&transport);
+	if (err) {
+		pr_err("Cannot register with VMCI device\n");
+		goto err_misc_deregister;
+	}
+
+	err = proto_register(&vsock_proto, 1);	/* we want our slab */
+	if (err) {
+		pr_err("Cannot register vsock protocol\n");
+		goto err_unregister_with_vmci;
+	}
+
+	err = sock_register(&vsock_family_ops);
+	if (err) {
+		pr_err("could not register af_vsock (%d) address family: %d\n",
+		       AF_VSOCK, err);
+		goto err_unregister_proto;
+	}
+
+	return 0;
+
+err_unregister_proto:
+	proto_unregister(&vsock_proto);
+err_unregister_with_vmci:
+	transport->unregister();
+err_misc_deregister:
+	misc_deregister(&vsock_device);
+	return err;
+}
+
+static void __exit vsock_exit(void)
+{
+	misc_deregister(&vsock_device);
+	sock_unregister(AF_VSOCK);
+	proto_unregister(&vsock_proto);
+	transport->unregister();
+}
+
+module_init(vsock_init);
+module_exit(vsock_exit);
+
+MODULE_AUTHOR("VMware, Inc.");
+MODULE_DESCRIPTION("VMware Virtual Socket Family");
+MODULE_VERSION(VSOCK_DRIVER_VERSION_STRING);
+MODULE_LICENSE("GPL v2");
+MODULE_ALIAS("vmware_vsock");
diff --git a/net/vmw_vsock/af_vsock.h b/net/vmw_vsock/af_vsock.h
new file mode 100644
index 0000000..497f39f
--- /dev/null
+++ b/net/vmw_vsock/af_vsock.h
@@ -0,0 +1,256 @@
+/*
+ * VMware vSockets Driver
+ *
+ * Copyright (C) 2007-2013 VMware, Inc. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation version 2 and no later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ */
+
+#ifndef __AF_VSOCK_H__
+#define __AF_VSOCK_H__
+
+#include <linux/kernel.h>
+#include <linux/workqueue.h>
+#include <linux/vmw_vmci_defs.h>
+#include <linux/vmw_vmci_api.h>
+#include <linux/vm_sockets.h>
+
+#include "vmci_transport_notify.h"
+
+#define vsock_sk(__sk)    ((struct vsock_sock *)__sk)
+#define sk_vsock(__vsk)   (&(__vsk)->sk)
+
+struct vsock_sock {
+	/* sk must be the first member. */
+	struct sock sk;
+	struct sockaddr_vm local_addr;
+	struct sockaddr_vm remote_addr;
+	/* Links for the global tables of bound and connected sockets. */
+	struct list_head bound_table;
+	struct list_head connected_table;
+	/* Accessed without the socket lock held. This means it can never be
+	 * modified outsided of socket create or destruct.
+	 */
+	bool trusted;
+	bool cached_peer_allow_dgram;	/* Dgram communication allowed to
+					 * cached peer?
+					 */
+	u32 cached_peer;  /* Context ID of last dgram destination check. */
+	const struct cred *owner;
+	/* Rest are SOCK_STREAM only. */
+	long connect_timeout;
+	/* Listening socket that this came from. */
+	struct sock *listener;
+	/* Used for pending list and accept queue during connection handshake.
+	 * The listening socket is the head for both lists.  Sockets created
+	 * for connection requests are placed in the pending list until they
+	 * are connected, at which point they are put in the accept queue list
+	 * so they can be accepted in accept().  If accept() cannot accept the
+	 * connection, it is marked as rejected so the cleanup function knows
+	 * to clean up the socket.
+	 */
+	struct list_head pending_links;
+	struct list_head accept_queue;
+	bool rejected;
+	struct delayed_work dwork;
+	u32 peer_shutdown;
+	bool sent_request;
+	bool ignore_connecting_rst;
+
+	/* The rest is transport-specific: this is the stuff we need to pull
+	 * out to make it work with something other than VMCI.
+	 */
+	struct {
+		/* For DGRAMs. */
+		struct vmci_handle dg_handle;
+		/* For STREAMs. */
+		struct vmci_handle qp_handle;
+		struct vmci_qp *qpair;
+		u64 produce_size;
+		u64 consume_size;
+		u64 queue_pair_size;
+		u64 queue_pair_min_size;
+		u64 queue_pair_max_size;
+		u32 attach_sub_id;
+		u32 detach_sub_id;
+		union vmci_transport_notify notify;
+		struct vmci_transport_notify_ops *notify_ops;
+	} trans;
+};
+
+s64 vsock_stream_has_data(struct vsock_sock *vsk);
+s64 vsock_stream_has_space(struct vsock_sock *vsk);
+void vsock_pending_work(struct work_struct *work);
+struct sock *__vsock_create(struct net *net,
+			    struct socket *sock,
+			    struct sock *parent,
+			    gfp_t priority, unsigned short type);
+
+/**** TRANSPORT ****/
+
+struct vsock_transport {
+	void (*init)(struct vsock_sock *, struct vsock_sock *);
+	void (*destruct)(struct vsock_sock *);
+	void (*release)(struct vsock_sock *);
+	int (*connect)(struct vsock_sock *);
+	int (*bind_dgram)(struct vsock_sock *, struct sockaddr_vm *);
+	int (*send_dgram)(struct vsock_sock *, struct sockaddr_vm *,
+			  struct iovec *, size_t len);
+	ssize_t (*recv_stream)(struct vsock_sock *, struct iovec *,
+			       size_t len, int flags);
+	ssize_t (*send_stream)(struct vsock_sock *, struct iovec *,
+			       size_t len);
+	s64 (*stream_has_data)(struct vsock_sock *);
+	s64 (*stream_has_space)(struct vsock_sock *);
+	int (*send_shutdown)(struct sock *sk, int mode);
+	void (*unregister)(void);
+};
+
+/**** UTILS ****/
+
+/* Each bound VSocket is stored in the bind hash table and each connected
+ * VSocket is stored in the connected hash table.
+ *
+ * Unbound sockets are all put on the same list attached to the end of the hash
+ * table (vsock_unbound_sockets).  Bound sockets are added to the hash table in
+ * the bucket that their local address hashes to (vsock_bound_sockets(addr)
+ * represents the list that addr hashes to).
+ *
+ * Specifically, we initialize the vsock_bind_table array to a size of
+ * VSOCK_HASH_SIZE + 1 so that vsock_bind_table[0] through
+ * vsock_bind_table[VSOCK_HASH_SIZE - 1] are for bound sockets and
+ * vsock_bind_table[VSOCK_HASH_SIZE] is for unbound sockets.  The hash function
+ * mods with VSOCK_HASH_SIZE - 1 to ensure this.
+ */
+#define VSOCK_HASH_SIZE         251
+#define LAST_RESERVED_PORT      1023
+#define MAX_PORT_RETRIES        24
+
+extern struct list_head vsock_bind_table[VSOCK_HASH_SIZE + 1];
+extern struct list_head vsock_connected_table[VSOCK_HASH_SIZE];
+
+extern spinlock_t vsock_table_lock;
+
+#define VSOCK_HASH(addr)        ((addr)->svm_port % (VSOCK_HASH_SIZE - 1))
+#define vsock_bound_sockets(addr) (&vsock_bind_table[VSOCK_HASH(addr)])
+#define vsock_unbound_sockets     (&vsock_bind_table[VSOCK_HASH_SIZE])
+
+/* XXX This can probably be implemented in a better way. */
+#define VSOCK_CONN_HASH(src, dst)				\
+	(((src)->svm_cid ^ (dst)->svm_port) % (VSOCK_HASH_SIZE - 1))
+#define vsock_connected_sockets(src, dst)		\
+	(&vsock_connected_table[VSOCK_CONN_HASH(src, dst)])
+#define vsock_connected_sockets_vsk(vsk)				\
+	vsock_connected_sockets(&(vsk)->remote_addr, &(vsk)->local_addr)
+
+void __vsock_insert_bound(struct list_head *list, struct sock *sk);
+void __vsock_insert_connected(struct list_head *list, struct sock *sk);
+void __vsock_remove_bound(struct sock *sk);
+void __vsock_remove_connected(struct sock *sk);
+struct sock *__vsock_find_bound_socket(struct sockaddr_vm *addr);
+struct sock *__vsock_find_connected_socket(struct sockaddr_vm *src,
+						struct sockaddr_vm *dst);
+bool __vsock_in_bound_table(struct sock *sk);
+bool __vsock_in_connected_table(struct sock *sk);
+
+void vsock_release_pending(struct sock *pending);
+void vsock_add_pending(struct sock *listener, struct sock *pending);
+void vsock_remove_pending(struct sock *listener, struct sock *pending);
+void vsock_enqueue_accept(struct sock *listener, struct sock *connected);
+struct sock *vsock_dequeue_accept(struct sock *listener);
+void vsock_remove_accept(struct sock *listener, struct sock *connected);
+bool vsock_in_accept_queue(struct sock *sk);
+bool vsock_is_accept_queue_empty(struct sock *sk);
+bool vsock_is_pending(struct sock *sk);
+
+static inline void
+vsock_insert_bound(struct list_head *list, struct sock *sk)
+{
+	spin_lock_bh(&vsock_table_lock);
+	__vsock_insert_bound(list, sk);
+	spin_unlock_bh(&vsock_table_lock);
+}
+
+static inline void
+vsock_insert_connected(struct list_head *list, struct sock *sk)
+{
+	spin_lock_bh(&vsock_table_lock);
+	__vsock_insert_connected(list, sk);
+	spin_unlock_bh(&vsock_table_lock);
+}
+
+static inline void vsock_remove_bound(struct sock *sk)
+{
+	spin_lock_bh(&vsock_table_lock);
+	__vsock_remove_bound(sk);
+	spin_unlock_bh(&vsock_table_lock);
+}
+
+static inline void vsock_remove_connected(struct sock *sk)
+{
+	spin_lock_bh(&vsock_table_lock);
+	__vsock_remove_connected(sk);
+	spin_unlock_bh(&vsock_table_lock);
+}
+
+static inline struct sock *vsock_find_bound_socket(struct sockaddr_vm *addr)
+{
+	struct sock *sk;
+
+	spin_lock_bh(&vsock_table_lock);
+	sk = __vsock_find_bound_socket(addr);
+	if (sk)
+		sock_hold(sk);
+
+	spin_unlock_bh(&vsock_table_lock);
+
+	return sk;
+}
+
+static inline struct sock *vsock_find_connected_socket(struct sockaddr_vm
+						       *src,
+						       struct sockaddr_vm
+						       *dst)
+{
+	struct sock *sk;
+
+	spin_lock_bh(&vsock_table_lock);
+	sk = __vsock_find_connected_socket(src, dst);
+	if (sk)
+		sock_hold(sk);
+
+	spin_unlock_bh(&vsock_table_lock);
+
+	return sk;
+}
+
+static inline bool vsock_in_bound_table(struct sock *sk)
+{
+	bool ret;
+
+	spin_lock_bh(&vsock_table_lock);
+	ret = __vsock_in_bound_table(sk);
+	spin_unlock_bh(&vsock_table_lock);
+
+	return ret;
+}
+
+static inline bool vsock_in_connected_table(struct sock *sk)
+{
+	bool ret;
+
+	spin_lock_bh(&vsock_table_lock);
+	ret = __vsock_in_connected_table(sk);
+	spin_unlock_bh(&vsock_table_lock);
+
+	return ret;
+}
+
+#endif /* __AF_VSOCK_H__ */
diff --git a/net/vmw_vsock/vmci_transport.c b/net/vmw_vsock/vmci_transport.c
new file mode 100644
index 0000000..89e3ff2
--- /dev/null
+++ b/net/vmw_vsock/vmci_transport.c
@@ -0,0 +1,1863 @@
+/*
+ * VMware vSockets Driver
+ *
+ * Copyright (C) 2007-2013 VMware, Inc. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation version 2 and no later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ */
+
+#include <linux/types.h>
+
+#define EXPORT_SYMTAB
+#include <linux/bitops.h>
+#include <linux/cred.h>
+#include <linux/init.h>
+#include <linux/io.h>
+#include <linux/kernel.h>
+#include <linux/kmod.h>
+#include <linux/list.h>
+#include <linux/miscdevice.h>
+#include <linux/module.h>
+#include <linux/mutex.h>
+#include <linux/net.h>
+#include <linux/poll.h>
+#include <linux/skbuff.h>
+#include <linux/smp.h>
+#include <linux/socket.h>
+#include <linux/stddef.h>
+#include <linux/unistd.h>
+#include <linux/wait.h>
+#include <linux/workqueue.h>
+#include <net/sock.h>
+
+#include "af_vsock.h"
+#include "vsock_version.h"
+
+static int vmci_transport_recv_dgram_cb(void *data, struct vmci_datagram *dg);
+static int vmci_transport_recv_stream_cb(void *data, struct vmci_datagram *dg);
+static void vmci_transport_peer_attach_cb(u32 sub_id,
+					  const struct vmci_event_data *ed,
+					  void *client_data);
+static void vmci_transport_peer_detach_cb(u32 sub_id,
+					  const struct vmci_event_data *ed,
+					  void *client_data);
+static void vmci_transport_recv_pkt_work(struct work_struct *work);
+static int vmci_transport_recv_listen(struct sock *sk,
+				      struct vmci_transport_packet *pkt);
+static int vmci_transport_recv_connecting_server(
+					struct sock *sk,
+					struct sock *pending,
+					struct vmci_transport_packet *pkt);
+static int vmci_transport_recv_connecting_client(
+					struct sock *sk,
+					struct vmci_transport_packet *pkt);
+static int vmci_transport_recv_connecting_client_negotiate(
+					struct sock *sk,
+					struct vmci_transport_packet *pkt);
+static int vmci_transport_recv_connecting_client_invalid(
+					struct sock *sk,
+					struct vmci_transport_packet *pkt);
+static int vmci_transport_recv_connected(struct sock *sk,
+					 struct vmci_transport_packet *pkt);
+static bool vmci_transport_old_proto_override(bool *old_pkt_proto);
+static u16 vmci_transport_new_proto_supported_versions(void);
+static bool vmci_transport_proto_to_notify_struct(struct sock *sk, u16 *proto,
+						  bool old_pkt_proto);
+
+struct vmci_transport_recv_pkt_info {
+	struct work_struct work;
+	struct sock *sk;
+	struct vmci_transport_packet pkt;
+};
+
+static struct vmci_handle vmci_transport_stream_handle = { VMCI_INVALID_ID,
+							   VMCI_INVALID_ID };
+static u32 vmci_transport_qp_resumed_sub_id = VMCI_INVALID_ID;
+
+static int PROTOCOL_OVERRIDE = -1;
+
+#define VMCI_TRANSPORT_DEFAULT_QP_SIZE_MIN   128
+#define VMCI_TRANSPORT_DEFAULT_QP_SIZE       262144
+#define VMCI_TRANSPORT_DEFAULT_QP_SIZE_MAX   262144
+
+/* The default peer timeout indicates how long we will wait for a peer response
+ * to a control message.
+ */
+#define VSOCK_DEFAULT_CONNECT_TIMEOUT (2 * HZ)
+
+#define SS_LISTEN 255
+
+/* Helper function to convert from a VMCI error code to a VSock error code. */
+
+static s32 vmci_transport_error_to_vsock_error(s32 vmci_error)
+{
+	int err;
+
+	switch (vmci_error) {
+	case VMCI_ERROR_NO_MEM:
+		err = ENOMEM;
+		break;
+	case VMCI_ERROR_DUPLICATE_ENTRY:
+	case VMCI_ERROR_ALREADY_EXISTS:
+		err = EADDRINUSE;
+		break;
+	case VMCI_ERROR_NO_ACCESS:
+		err = EPERM;
+		break;
+	case VMCI_ERROR_NO_RESOURCES:
+		err = ENOBUFS;
+		break;
+	case VMCI_ERROR_INVALID_RESOURCE:
+		err = EHOSTUNREACH;
+		break;
+	case VMCI_ERROR_INVALID_ARGS:
+	default:
+		err = EINVAL;
+	}
+
+	return err > 0 ? -err : err;
+}
+
+static inline void
+vmci_transport_packet_init(struct vmci_transport_packet *pkt,
+			   struct sockaddr_vm *src,
+			   struct sockaddr_vm *dst,
+			   u8 type,
+			   u64 size,
+			   u64 mode,
+			   struct vmci_transport_waiting_info *wait,
+			   u16 proto,
+			   struct vmci_handle handle)
+{
+	/* We register the stream control handler as an any cid handle so we
+	 * must always send from a source address of VMADDR_CID_ANY
+	 */
+	pkt->dg.src = vmci_make_handle(VMADDR_CID_ANY,
+				       VMCI_TRANSPORT_PACKET_RID);
+	pkt->dg.dst = vmci_make_handle(dst->svm_cid,
+				       VMCI_TRANSPORT_PACKET_RID);
+	pkt->dg.payload_size = sizeof(*pkt) - sizeof(pkt->dg);
+	pkt->version = VMCI_TRANSPORT_PACKET_VERSION;
+	pkt->type = type;
+	pkt->src_port = src->svm_port;
+	pkt->dst_port = dst->svm_port;
+	memset(&pkt->proto, 0, sizeof(pkt->proto));
+	memset(&pkt->_reserved2, 0, sizeof(pkt->_reserved2));
+
+	switch (pkt->type) {
+	case VMCI_TRANSPORT_PACKET_TYPE_INVALID:
+		pkt->u.size = 0;
+		break;
+
+	case VMCI_TRANSPORT_PACKET_TYPE_REQUEST:
+	case VMCI_TRANSPORT_PACKET_TYPE_NEGOTIATE:
+		pkt->u.size = size;
+		break;
+
+	case VMCI_TRANSPORT_PACKET_TYPE_OFFER:
+	case VMCI_TRANSPORT_PACKET_TYPE_ATTACH:
+		pkt->u.handle = handle;
+		break;
+
+	case VMCI_TRANSPORT_PACKET_TYPE_WROTE:
+	case VMCI_TRANSPORT_PACKET_TYPE_READ:
+	case VMCI_TRANSPORT_PACKET_TYPE_RST:
+		pkt->u.size = 0;
+		break;
+
+	case VMCI_TRANSPORT_PACKET_TYPE_SHUTDOWN:
+		pkt->u.mode = mode;
+		break;
+
+	case VMCI_TRANSPORT_PACKET_TYPE_WAITING_READ:
+	case VMCI_TRANSPORT_PACKET_TYPE_WAITING_WRITE:
+		memcpy(&pkt->u.wait, wait, sizeof(pkt->u.wait));
+		break;
+
+	case VMCI_TRANSPORT_PACKET_TYPE_REQUEST2:
+	case VMCI_TRANSPORT_PACKET_TYPE_NEGOTIATE2:
+		pkt->u.size = size;
+		pkt->proto = proto;
+		break;
+	}
+}
+
+static inline void
+vmci_transport_packet_get_addresses(struct vmci_transport_packet *pkt,
+				    struct sockaddr_vm *local,
+				    struct sockaddr_vm *remote)
+{
+	vsock_addr_init(local, pkt->dg.dst.context, pkt->dst_port);
+	vsock_addr_init(remote, pkt->dg.src.context, pkt->src_port);
+}
+
+static int
+__vmci_transport_send_control_pkt(struct vmci_transport_packet *pkt,
+				  struct sockaddr_vm *src,
+				  struct sockaddr_vm *dst,
+				  enum vmci_transport_packet_type type,
+				  u64 size,
+				  u64 mode,
+				  struct vmci_transport_waiting_info *wait,
+				  u16 proto,
+				  struct vmci_handle handle,
+				  bool convert_error)
+{
+	int err;
+
+	vmci_transport_packet_init(pkt, src, dst, type, size, mode, wait,
+				   proto, handle);
+	err = vmci_datagram_send(&pkt->dg);
+	if (convert_error && (err < 0))
+		return vmci_transport_error_to_vsock_error(err);
+
+	return err;
+}
+
+static int
+vmci_transport_reply_control_pkt_fast(struct vmci_transport_packet *pkt,
+				      enum vmci_transport_packet_type type,
+				      u64 size,
+				      u64 mode,
+				      struct vmci_transport_waiting_info *wait,
+				      struct vmci_handle handle)
+{
+	struct vmci_transport_packet reply;
+	struct sockaddr_vm src, dst;
+
+	if (pkt->type == VMCI_TRANSPORT_PACKET_TYPE_RST) {
+		return 0;
+	} else {
+		vmci_transport_packet_get_addresses(pkt, &src, &dst);
+		return __vmci_transport_send_control_pkt(&reply, &src, &dst,
+							 type,
+							 size, mode, wait,
+							 VSOCK_PROTO_INVALID,
+							 handle, true);
+	}
+}
+
+static int
+vmci_transport_send_control_pkt_bh(struct sockaddr_vm *src,
+				   struct sockaddr_vm *dst,
+				   enum vmci_transport_packet_type type,
+				   u64 size,
+				   u64 mode,
+				   struct vmci_transport_waiting_info *wait,
+				   struct vmci_handle handle)
+{
+	/* Note that it is safe to use a single packet across all CPUs since
+	 * two tasklets of the same type are guaranteed to not ever run
+	 * simultaneously. If that ever changes, or VMCI stops using tasklets,
+	 * we can use per-cpu packets.
+	 */
+	static struct vmci_transport_packet pkt;
+
+	return __vmci_transport_send_control_pkt(&pkt, src, dst, type,
+						 size, mode, wait,
+						 VSOCK_PROTO_INVALID, handle,
+						 false);
+}
+
+static int
+vmci_transport_send_control_pkt(struct sock *sk,
+				enum vmci_transport_packet_type type,
+				u64 size,
+				u64 mode,
+				struct vmci_transport_waiting_info *wait,
+				u16 proto,
+				struct vmci_handle handle)
+{
+	struct vmci_transport_packet *pkt;
+	struct vsock_sock *vsk;
+	int err;
+
+	vsk = vsock_sk(sk);
+
+	if (!vsock_addr_bound(&vsk->local_addr))
+		return -EINVAL;
+
+	if (!vsock_addr_bound(&vsk->remote_addr))
+		return -EINVAL;
+
+	pkt = kmalloc(sizeof(*pkt), GFP_KERNEL);
+	if (!pkt)
+		return -ENOMEM;
+
+	err = __vmci_transport_send_control_pkt(pkt, &vsk->local_addr,
+						&vsk->remote_addr, type, size,
+						mode, wait, proto, handle,
+						true);
+	kfree(pkt);
+
+	return err;
+}
+
+static int vmci_transport_send_reset_bh(struct sockaddr_vm *dst,
+					struct sockaddr_vm *src,
+					struct vmci_transport_packet *pkt)
+{
+	if (pkt->type == VMCI_TRANSPORT_PACKET_TYPE_RST)
+		return 0;
+	return vmci_transport_send_control_pkt_bh(
+					dst, src,
+					VMCI_TRANSPORT_PACKET_TYPE_RST, 0,
+					0, NULL, VMCI_INVALID_HANDLE);
+}
+
+static int vmci_transport_send_reset(struct sock *sk,
+				     struct vmci_transport_packet *pkt)
+{
+	if (pkt->type == VMCI_TRANSPORT_PACKET_TYPE_RST)
+		return 0;
+	return vmci_transport_send_control_pkt(sk,
+					VMCI_TRANSPORT_PACKET_TYPE_RST,
+					0, 0, NULL, VSOCK_PROTO_INVALID,
+					VMCI_INVALID_HANDLE);
+}
+
+static int vmci_transport_send_negotiate(struct sock *sk, size_t size)
+{
+	return vmci_transport_send_control_pkt(
+					sk,
+					VMCI_TRANSPORT_PACKET_TYPE_NEGOTIATE,
+					size, 0, NULL,
+					VSOCK_PROTO_INVALID,
+					VMCI_INVALID_HANDLE);
+}
+
+static int vmci_transport_send_negotiate2(struct sock *sk, size_t size,
+					  u16 version)
+{
+	return vmci_transport_send_control_pkt(
+					sk,
+					VMCI_TRANSPORT_PACKET_TYPE_NEGOTIATE2,
+					size, 0, NULL, version,
+					VMCI_INVALID_HANDLE);
+}
+
+static int vmci_transport_send_qp_offer(struct sock *sk,
+					struct vmci_handle handle)
+{
+	return vmci_transport_send_control_pkt(
+					sk, VMCI_TRANSPORT_PACKET_TYPE_OFFER, 0,
+					0, NULL,
+					VSOCK_PROTO_INVALID, handle);
+}
+
+static int vmci_transport_send_attach(struct sock *sk,
+				      struct vmci_handle handle)
+{
+	return vmci_transport_send_control_pkt(
+					sk, VMCI_TRANSPORT_PACKET_TYPE_ATTACH,
+					0, 0, NULL, VSOCK_PROTO_INVALID,
+					handle);
+}
+
+static int vmci_transport_reply_reset(struct vmci_transport_packet *pkt)
+{
+	return vmci_transport_reply_control_pkt_fast(
+						pkt,
+						VMCI_TRANSPORT_PACKET_TYPE_RST,
+						0, 0, NULL,
+						VMCI_INVALID_HANDLE);
+}
+
+static int vmci_transport_send_invalid_bh(struct sockaddr_vm *dst,
+					  struct sockaddr_vm *src)
+{
+	return vmci_transport_send_control_pkt_bh(
+					dst, src,
+					VMCI_TRANSPORT_PACKET_TYPE_INVALID,
+					0, 0, NULL, VMCI_INVALID_HANDLE);
+}
+
+int vmci_transport_send_wrote_bh(struct sockaddr_vm *dst,
+				 struct sockaddr_vm *src)
+{
+	return vmci_transport_send_control_pkt_bh(
+					dst, src,
+					VMCI_TRANSPORT_PACKET_TYPE_WROTE, 0,
+					0, NULL, VMCI_INVALID_HANDLE);
+}
+
+int vmci_transport_send_read_bh(struct sockaddr_vm *dst,
+				struct sockaddr_vm *src)
+{
+	return vmci_transport_send_control_pkt_bh(
+					dst, src,
+					VMCI_TRANSPORT_PACKET_TYPE_READ, 0,
+					0, NULL, VMCI_INVALID_HANDLE);
+}
+
+int vmci_transport_send_wrote(struct sock *sk)
+{
+	return vmci_transport_send_control_pkt(
+					sk, VMCI_TRANSPORT_PACKET_TYPE_WROTE, 0,
+					0, NULL, VSOCK_PROTO_INVALID,
+					VMCI_INVALID_HANDLE);
+}
+
+int vmci_transport_send_read(struct sock *sk)
+{
+	return vmci_transport_send_control_pkt(
+					sk, VMCI_TRANSPORT_PACKET_TYPE_READ, 0,
+					0, NULL, VSOCK_PROTO_INVALID,
+					VMCI_INVALID_HANDLE);
+}
+
+int vmci_transport_send_waiting_write(struct sock *sk,
+				      struct vmci_transport_waiting_info *wait)
+{
+	return vmci_transport_send_control_pkt(
+				sk, VMCI_TRANSPORT_PACKET_TYPE_WAITING_WRITE,
+				0, 0, wait, VSOCK_PROTO_INVALID,
+				VMCI_INVALID_HANDLE);
+}
+
+int vmci_transport_send_waiting_read(struct sock *sk,
+				     struct vmci_transport_waiting_info *wait)
+{
+	return vmci_transport_send_control_pkt(
+				sk, VMCI_TRANSPORT_PACKET_TYPE_WAITING_READ,
+				0, 0, wait, VSOCK_PROTO_INVALID,
+				VMCI_INVALID_HANDLE);
+}
+
+static int vmci_transport_send_shutdown(struct sock *sk, int mode)
+{
+	return vmci_transport_send_control_pkt(
+					sk, VMCI_TRANSPORT_PACKET_TYPE_SHUTDOWN,
+					0, mode, NULL,
+					VSOCK_PROTO_INVALID,
+					VMCI_INVALID_HANDLE);
+}
+
+static int vmci_transport_send_conn_request(struct sock *sk, size_t size)
+{
+	return vmci_transport_send_control_pkt(sk,
+					VMCI_TRANSPORT_PACKET_TYPE_REQUEST,
+					size, 0, NULL,
+					VSOCK_PROTO_INVALID,
+					VMCI_INVALID_HANDLE);
+}
+
+static int vmci_transport_send_conn_request2(struct sock *sk, size_t size,
+					     u16 version)
+{
+	return vmci_transport_send_control_pkt(
+					sk, VMCI_TRANSPORT_PACKET_TYPE_REQUEST2,
+					size, 0, NULL, version,
+					VMCI_INVALID_HANDLE);
+}
+
+static struct sock *vmci_transport_get_pending(
+					struct sock *listener,
+					struct vmci_transport_packet *pkt)
+{
+	struct vsock_sock *vlistener;
+	struct vsock_sock *vpending;
+	struct sock *pending;
+
+	vlistener = vsock_sk(listener);
+
+	list_for_each_entry(vpending, &vlistener->pending_links,
+			    pending_links) {
+		struct sockaddr_vm src;
+		struct sockaddr_vm dst;
+
+		vsock_addr_init(&src, pkt->dg.src.context, pkt->src_port);
+		vsock_addr_init(&dst, pkt->dg.dst.context, pkt->dst_port);
+
+		if (vsock_addr_equals_addr(&src, &vpending->remote_addr) &&
+		    vsock_addr_equals_addr(&dst, &vpending->local_addr)) {
+			pending = sk_vsock(vpending);
+			sock_hold(pending);
+			goto found;
+		}
+	}
+
+	pending = NULL;
+found:
+	return pending;
+
+}
+
+static void vmci_transport_release_pending(struct sock *pending)
+{
+	sock_put(pending);
+}
+
+/* We allow two kinds of sockets to communicate with a restricted VM: 1)
+ * trusted sockets 2) sockets from applications running as the same user as the
+ * VM (this is only true for the host side and only when using hosted products)
+ */
+
+static bool vmci_transport_is_trusted(struct vsock_sock *vsock, u32 peer_cid)
+{
+	return vsock->trusted ||
+	       vmci_is_context_owner(peer_cid, vsock->owner->uid);
+}
+
+/* We allow sending datagrams to and receiving datagrams from a restricted VM
+ * only if it is trusted as described in vmci_transport_is_trusted.
+ */
+
+static bool vmci_transport_allow_dgram(struct vsock_sock *vsock, u32 peer_cid)
+{
+	if (vsock->cached_peer != peer_cid) {
+		vsock->cached_peer = peer_cid;
+		if (!vmci_transport_is_trusted(vsock, peer_cid) &&
+		    (vmci_context_get_priv_flags(peer_cid) &
+		     VMCI_PRIVILEGE_FLAG_RESTRICTED)) {
+			vsock->cached_peer_allow_dgram = false;
+		} else {
+			vsock->cached_peer_allow_dgram = true;
+		}
+	}
+
+	return vsock->cached_peer_allow_dgram;
+}
+
+static int
+vmci_transport_queue_pair_alloc(struct vmci_qp **qpair,
+				struct vmci_handle *handle,
+				u64 produce_size,
+				u64 consume_size,
+				u32 peer, u32 flags, bool trusted)
+{
+	int err = 0;
+
+	if (trusted) {
+		/* Try to allocate our queue pair as trusted. This will only
+		 * work if vsock is running in the host.
+		 */
+
+		err = vmci_qpair_alloc(qpair, handle, produce_size,
+				       consume_size,
+				       peer, flags,
+				       VMCI_PRIVILEGE_FLAG_TRUSTED);
+		if (err != VMCI_ERROR_NO_ACCESS)
+			goto out;
+
+	}
+
+	err = vmci_qpair_alloc(qpair, handle, produce_size, consume_size,
+			       peer, flags, VMCI_NO_PRIVILEGE_FLAGS);
+out:
+	if (err < 0) {
+		pr_err("Could not attach to queue pair with %d\n",
+		       err);
+		err = vmci_transport_error_to_vsock_error(err);
+	}
+
+	return err;
+}
+
+static int
+vmci_transport_datagram_create_hnd(u32 resource_id,
+				   u32 flags,
+				   vmci_datagram_recv_cb recv_cb,
+				   void *client_data,
+				   struct vmci_handle *out_handle)
+{
+	int err = 0;
+
+	/* Try to allocate our datagram handler as trusted. This will only work
+	 * if vsock is running in the host.
+	 */
+
+	err = vmci_datagram_create_handle_priv(resource_id, flags,
+					       VMCI_PRIVILEGE_FLAG_TRUSTED,
+					       recv_cb,
+					       client_data, out_handle);
+
+	if (err == VMCI_ERROR_NO_ACCESS)
+		err = vmci_datagram_create_handle(resource_id, flags,
+						  recv_cb, client_data,
+						  out_handle);
+
+	return err;
+}
+
+/* This is invoked as part of a tasklet that's scheduled when the VMCI
+ * interrupt fires.  This is run in bottom-half context and if it ever needs to
+ * sleep it should defer that work to a work queue.
+ */
+
+static int vmci_transport_recv_dgram_cb(void *data, struct vmci_datagram *dg)
+{
+	struct sock *sk;
+	size_t size;
+	struct sk_buff *skb;
+	struct vsock_sock *vsk;
+
+	sk = (struct sock *)data;
+
+	/* This handler is privileged when this module is running on the host.
+	 * We will get datagrams from all endpoints (even VMs that are in a
+	 * restricted context). If we get one from a restricted context then
+	 * the destination socket must be trusted.
+	 *
+	 * NOTE: We access the socket struct without holding the lock here.
+	 * This is ok because the field we are interested is never modified
+	 * outside of the create and destruct socket functions.
+	 */
+	vsk = vsock_sk(sk);
+	if (!vmci_transport_allow_dgram(vsk, dg->src.context))
+		return VMCI_ERROR_NO_ACCESS;
+
+	size = VMCI_DG_SIZE(dg);
+
+	/* Attach the packet to the socket's receive queue as an sk_buff. */
+	skb = alloc_skb(size, GFP_ATOMIC);
+	if (skb) {
+		/* sk_receive_skb() will do a sock_put(), so hold here. */
+		sock_hold(sk);
+		skb_put(skb, size);
+		memcpy(skb->data, dg, size);
+		sk_receive_skb(sk, skb, 0);
+	}
+
+	return VMCI_SUCCESS;
+}
+
+/* This is invoked as part of a tasklet that's scheduled when the VMCI
+ * interrupt fires.  This is run in bottom-half context but it defers most of
+ * its work to the packet handling work queue.
+ */
+
+static int vmci_transport_recv_stream_cb(void *data, struct vmci_datagram *dg)
+{
+	struct sock *sk;
+	struct sockaddr_vm dst;
+	struct sockaddr_vm src;
+	struct vmci_transport_packet *pkt;
+	struct vsock_sock *vsk;
+	bool bh_process_pkt;
+	int err;
+
+	sk = NULL;
+	err = VMCI_SUCCESS;
+	bh_process_pkt = false;
+
+	/* Ignore incoming packets from contexts without sockets, or resources
+	 * that aren't vsock implementations.
+	 */
+
+	if (!vsock_addr_socket_context_stream(dg->src.context)
+	    || VMCI_TRANSPORT_PACKET_RID != dg->src.resource)
+		return VMCI_ERROR_NO_ACCESS;
+
+	if (VMCI_DG_SIZE(dg) < sizeof(*pkt))
+		/* Drop datagrams that do not contain full VSock packets. */
+		return VMCI_ERROR_INVALID_ARGS;
+
+	pkt = (struct vmci_transport_packet *)dg;
+
+	/* Find the socket that should handle this packet.  First we look for a
+	 * connected socket and if there is none we look for a socket bound to
+	 * the destintation address.
+	 */
+	vsock_addr_init(&src, pkt->dg.src.context, pkt->src_port);
+	vsock_addr_init(&dst, pkt->dg.dst.context, pkt->dst_port);
+
+	sk = vsock_find_connected_socket(&src, &dst);
+	if (!sk) {
+		sk = vsock_find_bound_socket(&dst);
+		if (!sk) {
+			/* We could not find a socket for this specified
+			 * address.  If this packet is a RST, we just drop it.
+			 * If it is another packet, we send a RST.  Note that
+			 * we do not send a RST reply to RSTs so that we do not
+			 * continually send RSTs between two endpoints.
+			 *
+			 * Note that since this is a reply, dst is src and src
+			 * is dst.
+			 */
+			if (vmci_transport_send_reset_bh(&dst, &src, pkt) < 0)
+				pr_err("unable to send reset\n");
+
+			err = VMCI_ERROR_NOT_FOUND;
+			goto out;
+		}
+	}
+
+	/* If the received packet type is beyond all types known to this
+	 * implementation, reply with an invalid message.  Hopefully this will
+	 * help when implementing backwards compatibility in the future.
+	 */
+	if (pkt->type >= VMCI_TRANSPORT_PACKET_TYPE_MAX) {
+		vmci_transport_send_invalid_bh(&dst, &src);
+		err = VMCI_ERROR_INVALID_ARGS;
+		goto out;
+	}
+
+	/* This handler is privileged when this module is running on the host.
+	 * We will get datagram connect requests from all endpoints (even VMs
+	 * that are in a restricted context). If we get one from a restricted
+	 * context then the destination socket must be trusted.
+	 *
+	 * NOTE: We access the socket struct without holding the lock here.
+	 * This is ok because the field we are interested is never modified
+	 * outside of the create and destruct socket functions.
+	 */
+	vsk = vsock_sk(sk);
+	if (!vmci_transport_allow_dgram(vsk, pkt->dg.src.context)) {
+		err = VMCI_ERROR_NO_ACCESS;
+		goto out;
+	}
+
+	/* We do most everything in a work queue, but let's fast path the
+	 * notification of reads and writes to help data transfer performance.
+	 * We can only do this if there is no process context code executing
+	 * for this socket since that may change the state.
+	 */
+	bh_lock_sock(sk);
+
+	if (!sock_owned_by_user(sk) && sk->sk_state == SS_CONNECTED)
+		NOTIFYCALL(vsk, handle_notify_pkt, sk, pkt, true, &dst, &src,
+			   &bh_process_pkt);
+
+	bh_unlock_sock(sk);
+
+	if (!bh_process_pkt) {
+		struct vmci_transport_recv_pkt_info *recv_pkt_info;
+
+		recv_pkt_info = kmalloc(sizeof(*recv_pkt_info), GFP_ATOMIC);
+		if (!recv_pkt_info) {
+			if (vmci_transport_send_reset_bh(&dst, &src, pkt) < 0)
+				pr_err("unable to send reset\n");
+
+			err = VMCI_ERROR_NO_MEM;
+			goto out;
+		}
+
+		recv_pkt_info->sk = sk;
+		memcpy(&recv_pkt_info->pkt, pkt, sizeof(recv_pkt_info->pkt));
+		INIT_WORK(&recv_pkt_info->work, vmci_transport_recv_pkt_work);
+
+		schedule_work(&recv_pkt_info->work);
+		/* Clear sk so that the reference count incremented by one of
+		 * the Find functions above is not decremented below.  We need
+		 * that reference count for the packet handler we've scheduled
+		 * to run.
+		 */
+		sk = NULL;
+	}
+
+out:
+	if (sk)
+		sock_put(sk);
+
+	return err;
+}
+
+static void vmci_transport_peer_attach_cb(u32 sub_id,
+					  const struct vmci_event_data *e_data,
+					  void *client_data)
+{
+	struct sock *sk = client_data;
+	const struct vmci_event_payload_qp *e_payload;
+	struct vsock_sock *vsk;
+
+	e_payload = vmci_event_data_const_payload(e_data);
+
+	vsk = vsock_sk(sk);
+
+	/* We don't ask for delayed CBs when we subscribe to this event (we
+	 * pass 0 as flags to vmci_event_subscribe()).  VMCI makes no
+	 * guarantees in that case about what context we might be running in,
+	 * so it could be BH or process, blockable or non-blockable.  So we
+	 * need to account for all possible contexts here.
+	 */
+	local_bh_disable();
+	bh_lock_sock(sk);
+
+	/* XXX This is lame, we should provide a way to lookup sockets by
+	 * qp_handle.
+	 */
+	if (vmci_handle_is_equal(vsk->trans.qp_handle, e_payload->handle)) {
+		/* XXX This doesn't do anything, but in the future we may want
+		 * to set a flag here to verify the attach really did occur and
+		 * we weren't just sent a datagram claiming it was.
+		 */
+		goto out;
+	}
+
+out:
+	bh_unlock_sock(sk);
+	local_bh_enable();
+}
+
+static void vmci_transport_handle_detach(struct sock *sk)
+{
+	struct vsock_sock *vsk;
+
+	vsk = vsock_sk(sk);
+	if (!vmci_handle_is_invalid(vsk->trans.qp_handle)) {
+		sock_set_flag(sk, SOCK_DONE);
+
+		/* On a detach the peer will not be sending or receiving
+		 * anymore.
+		 */
+		vsk->peer_shutdown = SHUTDOWN_MASK;
+
+		/* We should not be sending anymore since the peer won't be
+		 * there to receive, but we can still receive if there is data
+		 * left in our consume queue.
+		 */
+		if (vsock_stream_has_data(vsk) <= 0) {
+			if (sk->sk_state == SS_CONNECTING) {
+				/* The peer may detach from a queue pair while
+				 * we are still in the connecting state, i.e.,
+				 * if the peer VM is killed after attaching to
+				 * a queue pair, but before we complete the
+				 * handshake. In that case, we treat the detach
+				 * event like a reset.
+				 */
+
+				sk->sk_state = SS_UNCONNECTED;
+				sk->sk_err = ECONNRESET;
+				sk->sk_error_report(sk);
+				return;
+			}
+			sk->sk_state = SS_UNCONNECTED;
+		}
+		sk->sk_state_change(sk);
+	}
+}
+
+static void vmci_transport_peer_detach_cb(u32 sub_id,
+					  const struct vmci_event_data *e_data,
+					  void *client_data)
+{
+	struct sock *sk = client_data;
+	const struct vmci_event_payload_qp *e_payload;
+	struct vsock_sock *vsk;
+
+	e_payload = vmci_event_data_const_payload(e_data);
+	vsk = vsock_sk(sk);
+	if (vmci_handle_is_invalid(e_payload->handle))
+		return;
+
+	/* Same rules for locking as for peer_attach_cb(). */
+	local_bh_disable();
+	bh_lock_sock(sk);
+
+	/* XXX This is lame, we should provide a way to lookup sockets by
+	 * qp_handle.
+	 */
+	if (vmci_handle_is_equal(vsk->trans.qp_handle, e_payload->handle))
+		vmci_transport_handle_detach(sk);
+
+	bh_unlock_sock(sk);
+	local_bh_enable();
+}
+
+static void vmci_transport_qp_resumed_cb(u32 sub_id,
+					 const struct vmci_event_data *e_data,
+					 void *client_data)
+{
+	int i;
+
+	spin_lock_bh(&vsock_table_lock);
+
+	for (i = 0; i < ARRAY_SIZE(vsock_connected_table); i++) {
+		struct vsock_sock *vsk;
+
+		list_for_each_entry(vsk, &vsock_connected_table[i],
+				    connected_table) {
+			struct sock *sk = sk_vsock(vsk);
+			vmci_transport_handle_detach(sk);
+		}
+	}
+
+	spin_unlock_bh(&vsock_table_lock);
+}
+
+static void vmci_transport_recv_pkt_work(struct work_struct *work)
+{
+	struct vmci_transport_recv_pkt_info *recv_pkt_info;
+	struct vmci_transport_packet *pkt;
+	struct sock *sk;
+
+	recv_pkt_info =
+		container_of(work, struct vmci_transport_recv_pkt_info, work);
+	sk = recv_pkt_info->sk;
+	pkt = &recv_pkt_info->pkt;
+
+	lock_sock(sk);
+
+	switch (sk->sk_state) {
+	case SS_LISTEN:
+		vmci_transport_recv_listen(sk, pkt);
+		break;
+	case SS_CONNECTING:
+		/* Processing of pending connections for servers goes through
+		 * the listening socket, so see vmci_transport_recv_listen()
+		 * for that path.
+		 */
+		vmci_transport_recv_connecting_client(sk, pkt);
+		break;
+	case SS_CONNECTED:
+		vmci_transport_recv_connected(sk, pkt);
+		break;
+	default:
+		/* Because this function does not run in the same context as
+		 * vmci_transport_recv_stream_cb it is possible that the
+		 * socket has closed. We need to let the other side know or it
+		 * could be sitting in a connect and hang forever. Send a
+		 * reset to prevent that.
+		 */
+		vmci_transport_send_reset(sk, pkt);
+		goto out;
+	}
+
+out:
+	release_sock(sk);
+	kfree(recv_pkt_info);
+	/* Release reference obtained in the stream callback when we fetched
+	 * this socket out of the bound or connected list.
+	 */
+	sock_put(sk);
+}
+
+static int vmci_transport_recv_listen(struct sock *sk,
+				      struct vmci_transport_packet *pkt)
+{
+	struct sock *pending;
+	struct vsock_sock *vpending;
+	int err;
+	u64 qp_size;
+	bool old_request = false;
+	bool old_pkt_proto = false;
+
+	err = 0;
+
+	/* Because we are in the listen state, we could be receiving a packet
+	 * for ourself or any previous connection requests that we received.
+	 * If it's the latter, we try to find a socket in our list of pending
+	 * connections and, if we do, call the appropriate handler for the
+	 * state that that socket is in.  Otherwise we try to service the
+	 * connection request.
+	 */
+	pending = vmci_transport_get_pending(sk, pkt);
+	if (pending) {
+		lock_sock(pending);
+		switch (pending->sk_state) {
+		case SS_CONNECTING:
+			err = vmci_transport_recv_connecting_server(sk,
+								    pending,
+								    pkt);
+			break;
+		default:
+			vmci_transport_send_reset(pending, pkt);
+			err = -EINVAL;
+		}
+
+		if (err < 0)
+			vsock_remove_pending(sk, pending);
+
+		release_sock(pending);
+		vmci_transport_release_pending(pending);
+
+		return err;
+	}
+
+	/* The listen state only accepts connection requests.  Reply with a
+	 * reset unless we received a reset.
+	 */
+
+	if (!(pkt->type == VMCI_TRANSPORT_PACKET_TYPE_REQUEST ||
+	      pkt->type == VMCI_TRANSPORT_PACKET_TYPE_REQUEST2)) {
+		vmci_transport_reply_reset(pkt);
+		return -EINVAL;
+	}
+
+	if (pkt->u.size == 0) {
+		vmci_transport_reply_reset(pkt);
+		return -EINVAL;
+	}
+
+	/* If this socket can't accommodate this connection request, we send a
+	 * reset.  Otherwise we create and initialize a child socket and reply
+	 * with a connection negotiation.
+	 */
+	if (sk->sk_ack_backlog >= sk->sk_max_ack_backlog) {
+		vmci_transport_reply_reset(pkt);
+		return -ECONNREFUSED;
+	}
+
+	pending = __vsock_create(sock_net(sk), NULL, sk, GFP_KERNEL,
+				 sk->sk_type);
+	if (!pending) {
+		vmci_transport_send_reset(sk, pkt);
+		return -ENOMEM;
+	}
+
+	vpending = vsock_sk(pending);
+
+	vsock_addr_init(&vpending->local_addr, pkt->dg.dst.context,
+			pkt->dst_port);
+	vsock_addr_init(&vpending->remote_addr, pkt->dg.src.context,
+			pkt->src_port);
+
+	/* If the proposed size fits within our min/max, accept it. Otherwise
+	 * propose our own size.
+	 */
+	if (pkt->u.size >= vpending->trans.queue_pair_min_size &&
+	    pkt->u.size <= vpending->trans.queue_pair_max_size) {
+		qp_size = pkt->u.size;
+	} else {
+		qp_size = vpending->trans.queue_pair_size;
+	}
+
+	/* Figure out if we are using old or new requests based on the
+	 * overrides pkt types sent by our peer.
+	 */
+	if (vmci_transport_old_proto_override(&old_pkt_proto)) {
+		old_request = old_pkt_proto;
+	} else {
+		if (pkt->type == VMCI_TRANSPORT_PACKET_TYPE_REQUEST)
+			old_request = true;
+		else if (pkt->type == VMCI_TRANSPORT_PACKET_TYPE_REQUEST2)
+			old_request = false;
+
+	}
+
+	if (old_request) {
+		/* Handle a REQUEST (or override) */
+		u16 version = VSOCK_PROTO_INVALID;
+		if (vmci_transport_proto_to_notify_struct(
+			pending, &version, true))
+			err = vmci_transport_send_negotiate(pending, qp_size);
+		else
+			err = -EINVAL;
+
+	} else {
+		/* Handle a REQUEST2 (or override) */
+		int proto_int = pkt->proto;
+		int pos;
+		u16 active_proto_version = 0;
+
+		/* The list of possible protocols is the intersection of all
+		 * protocols the client supports ... plus all the protocols we
+		 * support.
+		 */
+		proto_int &= vmci_transport_new_proto_supported_versions();
+
+		/* We choose the highest possible protocol version and use that
+		 * one.
+		 */
+		pos = fls(proto_int);
+		if (pos) {
+			active_proto_version = (1 << (pos - 1));
+			if (vmci_transport_proto_to_notify_struct(
+				pending, &active_proto_version, false))
+				err = vmci_transport_send_negotiate2(pending,
+							qp_size,
+							active_proto_version);
+			else
+				err = -EINVAL;
+
+		} else {
+			err = -EINVAL;
+		}
+	}
+
+	if (err < 0) {
+		vmci_transport_send_reset(sk, pkt);
+		sock_put(pending);
+		err = vmci_transport_error_to_vsock_error(err);
+		goto out;
+	}
+
+	vsock_add_pending(sk, pending);
+	sk->sk_ack_backlog++;
+
+	pending->sk_state = SS_CONNECTING;
+	vpending->trans.produce_size = vpending->trans.consume_size = qp_size;
+	vpending->trans.queue_pair_size = qp_size;
+
+	NOTIFYCALL(vpending, process_request, pending);
+
+	/* We might never receive another message for this socket and it's not
+	 * connected to any process, so we have to ensure it gets cleaned up
+	 * ourself.  Our delayed work function will take care of that.  Note
+	 * that we do not ever cancel this function since we have few
+	 * guarantees about its state when calling cancel_delayed_work().
+	 * Instead we hold a reference on the socket for that function and make
+	 * it capable of handling cases where it needs to do nothing but
+	 * release that reference.
+	 */
+	vpending->listener = sk;
+	sock_hold(sk);
+	sock_hold(pending);
+	INIT_DELAYED_WORK(&vpending->dwork, vsock_pending_work);
+	schedule_delayed_work(&vpending->dwork, HZ);
+
+out:
+	return err;
+}
+
+static int
+vmci_transport_recv_connecting_server(struct sock *listener,
+				      struct sock *pending,
+				      struct vmci_transport_packet *pkt)
+{
+	struct vsock_sock *vpending;
+	struct vmci_handle handle;
+	struct vmci_qp *qpair;
+	bool is_local;
+	u32 flags;
+	u32 detach_sub_id;
+	int err;
+	int skerr;
+
+	vpending = vsock_sk(pending);
+	detach_sub_id = VMCI_INVALID_ID;
+
+	switch (pkt->type) {
+	case VMCI_TRANSPORT_PACKET_TYPE_OFFER:
+		if (vmci_handle_is_invalid(pkt->u.handle)) {
+			vmci_transport_send_reset(pending, pkt);
+			skerr = EPROTO;
+			err = -EINVAL;
+			goto destroy;
+		}
+		break;
+	default:
+		/* Close and cleanup the connection. */
+		vmci_transport_send_reset(pending, pkt);
+		skerr = EPROTO;
+		err = pkt->type == VMCI_TRANSPORT_PACKET_TYPE_RST ? 0 : -EINVAL;
+		goto destroy;
+	}
+
+	/* In order to complete the connection we need to attach to the offered
+	 * queue pair and send an attach notification.  We also subscribe to the
+	 * detach event so we know when our peer goes away, and we do that
+	 * before attaching so we don't miss an event.  If all this succeeds,
+	 * we update our state and wakeup anything waiting in accept() for a
+	 * connection.
+	 */
+
+	/* We don't care about attach since we ensure the other side has
+	 * attached by specifying the ATTACH_ONLY flag below.
+	 */
+	err = vmci_event_subscribe(VMCI_EVENT_QP_PEER_DETACH,
+				   vmci_transport_peer_detach_cb,
+				   pending, &detach_sub_id);
+	if (err < VMCI_SUCCESS) {
+		vmci_transport_send_reset(pending, pkt);
+		err = vmci_transport_error_to_vsock_error(err);
+		skerr = -err;
+		goto destroy;
+	}
+
+	vpending->trans.detach_sub_id = detach_sub_id;
+
+	/* Now attach to the queue pair the client created. */
+	handle = pkt->u.handle;
+
+	/* vpending->local_addr always has a context id so we do not need to
+	 * worry about VMADDR_CID_ANY in this case.
+	 */
+	is_local =
+	    vpending->remote_addr.svm_cid == vpending->local_addr.svm_cid;
+	flags = VMCI_QPFLAG_ATTACH_ONLY;
+	flags |= is_local ? VMCI_QPFLAG_LOCAL : 0;
+
+	err = vmci_transport_queue_pair_alloc(&qpair,
+					      &handle,
+					      vpending->trans.produce_size,
+					      vpending->trans.consume_size,
+					      pkt->dg.src.context,
+					      flags,
+					      vmci_transport_is_trusted(
+						vpending,
+						vpending->remote_addr.svm_cid));
+	if (err < 0) {
+		vmci_transport_send_reset(pending, pkt);
+		skerr = -err;
+		goto destroy;
+	}
+
+	vpending->trans.qp_handle = handle;
+	vpending->trans.qpair = qpair;
+
+	/* When we send the attach message, we must be ready to handle incoming
+	 * control messages on the newly connected socket. So we move the
+	 * pending socket to the connected state before sending the attach
+	 * message. Otherwise, an incoming packet triggered by the attach being
+	 * received by the peer may be processed concurrently with what happens
+	 * below after sending the attach message, and that incoming packet
+	 * will find the listening socket instead of the (currently) pending
+	 * socket. Note that enqueueing the socket increments the reference
+	 * count, so even if a reset comes before the connection is accepted,
+	 * the socket will be valid until it is removed from the queue.
+	 *
+	 * If we fail sending the attach below, we remove the socket from the
+	 * connected list and move the socket to SS_UNCONNECTED before
+	 * releasing the lock, so a pending slow path processing of an incoming
+	 * packet will not see the socket in the connected state in that case.
+	 */
+	pending->sk_state = SS_CONNECTED;
+
+	vsock_insert_connected(vsock_connected_sockets_vsk(vpending),
+			       pending);
+
+	/* Notify our peer of our attach. */
+	err = vmci_transport_send_attach(pending, handle);
+	if (err < 0) {
+		vsock_remove_connected(pending);
+		pr_err("Could not send attach\n");
+		vmci_transport_send_reset(pending, pkt);
+		err = vmci_transport_error_to_vsock_error(err);
+		skerr = -err;
+		goto destroy;
+	}
+
+	/* We have a connection. Move the now connected socket from the
+	 * listener's pending list to the accept queue so callers of accept()
+	 * can find it.
+	 */
+	vsock_remove_pending(listener, pending);
+	vsock_enqueue_accept(listener, pending);
+
+	/* Callers of accept() will be be waiting on the listening socket, not
+	 * the pending socket.
+	 */
+	listener->sk_state_change(listener);
+
+	return 0;
+
+destroy:
+	pending->sk_err = skerr;
+	pending->sk_state = SS_UNCONNECTED;
+	/* As long as we drop our reference, all necessary cleanup will handle
+	 * when the cleanup function drops its reference and our destruct
+	 * implementation is called.  Note that since the listen handler will
+	 * remove pending from the pending list upon our failure, the cleanup
+	 * function won't drop the additional reference, which is why we do it
+	 * here.
+	 */
+	sock_put(pending);
+
+	return err;
+}
+
+static int
+vmci_transport_recv_connecting_client(struct sock *sk,
+				      struct vmci_transport_packet *pkt)
+{
+	struct vsock_sock *vsk;
+	int err;
+	int skerr;
+
+	vsk = vsock_sk(sk);
+
+	switch (pkt->type) {
+	case VMCI_TRANSPORT_PACKET_TYPE_ATTACH:
+		if (vmci_handle_is_invalid(pkt->u.handle) ||
+		    !vmci_handle_is_equal(pkt->u.handle,
+					  vsk->trans.qp_handle)) {
+			skerr = EPROTO;
+			err = -EINVAL;
+			goto destroy;
+		}
+
+		/* Signify the socket is connected and wakeup the waiter in
+		 * connect(). Also place the socket in the connected table for
+		 * accounting (it can already be found since it's in the bound
+		 * table).
+		 */
+		sk->sk_state = SS_CONNECTED;
+		sk->sk_socket->state = SS_CONNECTED;
+		vsock_insert_connected(vsock_connected_sockets_vsk(vsk),
+				       sk);
+		sk->sk_state_change(sk);
+
+		break;
+	case VMCI_TRANSPORT_PACKET_TYPE_NEGOTIATE:
+	case VMCI_TRANSPORT_PACKET_TYPE_NEGOTIATE2:
+		if (pkt->u.size == 0
+		    || pkt->dg.src.context != vsk->remote_addr.svm_cid
+		    || pkt->src_port != vsk->remote_addr.svm_port
+		    || !vmci_handle_is_invalid(vsk->trans.qp_handle)
+		    || vsk->trans.qpair
+		    || vsk->trans.produce_size != 0
+		    || vsk->trans.consume_size != 0
+		    || vsk->trans.attach_sub_id != VMCI_INVALID_ID
+		    || vsk->trans.detach_sub_id != VMCI_INVALID_ID) {
+			skerr = EPROTO;
+			err = -EINVAL;
+
+			goto destroy;
+		}
+
+		err = vmci_transport_recv_connecting_client_negotiate(sk, pkt);
+		if (err) {
+			skerr = -err;
+			goto destroy;
+		}
+
+		break;
+	case VMCI_TRANSPORT_PACKET_TYPE_INVALID:
+		err = vmci_transport_recv_connecting_client_invalid(sk, pkt);
+		if (err) {
+			skerr = -err;
+			goto destroy;
+		}
+
+		break;
+	case VMCI_TRANSPORT_PACKET_TYPE_RST:
+		/* Older versions of the linux code (WS 6.5 / ESX 4.0) used to
+		 * continue processing here after they sent an INVALID packet.
+		 * This meant that we got a RST after the INVALID. We ignore a
+		 * RST after an INVALID. The common code doesn't send the RST
+		 * ... so we can hang if an old version of the common code
+		 * fails between getting a REQUEST and sending an OFFER back.
+		 * Not much we can do about it... except hope that it doesn't
+		 * happen.
+		 */
+		if (vsk->ignore_connecting_rst) {
+			vsk->ignore_connecting_rst = false;
+		} else {
+			skerr = ECONNRESET;
+			err = 0;
+			goto destroy;
+		}
+
+		break;
+	default:
+		/* Close and cleanup the connection. */
+		skerr = EPROTO;
+		err = -EINVAL;
+		goto destroy;
+	}
+
+	return 0;
+
+destroy:
+	vmci_transport_send_reset(sk, pkt);
+
+	sk->sk_state = SS_UNCONNECTED;
+	sk->sk_err = skerr;
+	sk->sk_error_report(sk);
+	return err;
+}
+
+static int vmci_transport_recv_connecting_client_negotiate(
+					struct sock *sk,
+					struct vmci_transport_packet *pkt)
+{
+	int err;
+	struct vsock_sock *vsk;
+	struct vmci_handle handle;
+	struct vmci_qp *qpair;
+	u32 attach_sub_id;
+	u32 detach_sub_id;
+	bool is_local;
+	u32 flags;
+	bool old_proto = true;
+	bool old_pkt_proto;
+	u16 version;
+
+	vsk = vsock_sk(sk);
+	handle = VMCI_INVALID_HANDLE;
+	attach_sub_id = VMCI_INVALID_ID;
+	detach_sub_id = VMCI_INVALID_ID;
+
+	/* If we have gotten here then we should be past the point where old
+	 * linux vsock could have sent the bogus rst.
+	 */
+	vsk->sent_request = false;
+	vsk->ignore_connecting_rst = false;
+
+	/* Verify that we're OK with the proposed queue pair size */
+	if (pkt->u.size < vsk->trans.queue_pair_min_size ||
+	    pkt->u.size > vsk->trans.queue_pair_max_size) {
+		err = -EINVAL;
+		goto destroy;
+	}
+
+	/* At this point we know the CID the peer is using to talk to us. */
+
+	if (vsk->local_addr.svm_cid == VMADDR_CID_ANY)
+		vsk->local_addr.svm_cid = pkt->dg.dst.context;
+
+	/* Setup the notify ops to be the highest supported version that both
+	 * the server and the client support.
+	 */
+
+	if (vmci_transport_old_proto_override(&old_pkt_proto)) {
+		old_proto = old_pkt_proto;
+	} else {
+		if (pkt->type == VMCI_TRANSPORT_PACKET_TYPE_NEGOTIATE)
+			old_proto = true;
+		else if (pkt->type == VMCI_TRANSPORT_PACKET_TYPE_NEGOTIATE2)
+			old_proto = false;
+
+	}
+
+	if (old_proto)
+		version = VSOCK_PROTO_INVALID;
+	else
+		version = pkt->proto;
+
+	if (!vmci_transport_proto_to_notify_struct(sk, &version, old_proto)) {
+		err = -EINVAL;
+		goto destroy;
+	}
+
+	/* Subscribe to attach and detach events first.
+	 *
+	 * XXX We attach once for each queue pair created for now so it is easy
+	 * to find the socket (it's provided), but later we should only
+	 * subscribe once and add a way to lookup sockets by queue pair handle.
+	 */
+	err = vmci_event_subscribe(VMCI_EVENT_QP_PEER_ATTACH,
+				   vmci_transport_peer_attach_cb,
+				   sk, &attach_sub_id);
+	if (err < VMCI_SUCCESS) {
+		err = vmci_transport_error_to_vsock_error(err);
+		goto destroy;
+	}
+
+	err = vmci_event_subscribe(VMCI_EVENT_QP_PEER_DETACH,
+				   vmci_transport_peer_detach_cb,
+				   sk, &detach_sub_id);
+	if (err < VMCI_SUCCESS) {
+		err = vmci_transport_error_to_vsock_error(err);
+		goto destroy;
+	}
+
+	/* Make VMCI select the handle for us. */
+	handle = VMCI_INVALID_HANDLE;
+	is_local = vsk->remote_addr.svm_cid == vsk->local_addr.svm_cid;
+	flags = is_local ? VMCI_QPFLAG_LOCAL : 0;
+
+	err = vmci_transport_queue_pair_alloc(&qpair,
+					      &handle,
+					      pkt->u.size,
+					      pkt->u.size,
+					      vsk->remote_addr.svm_cid,
+					      flags,
+					      vmci_transport_is_trusted(
+						  vsk,
+						  vsk->
+						  remote_addr.svm_cid));
+	if (err < 0)
+		goto destroy;
+
+	err = vmci_transport_send_qp_offer(sk, handle);
+	if (err < 0) {
+		err = vmci_transport_error_to_vsock_error(err);
+		goto destroy;
+	}
+
+	vsk->trans.qp_handle = handle;
+	vsk->trans.qpair = qpair;
+
+	vsk->trans.produce_size = vsk->trans.consume_size = pkt->u.size;
+
+	vsk->trans.attach_sub_id = attach_sub_id;
+	vsk->trans.detach_sub_id = detach_sub_id;
+
+	NOTIFYCALL(vsk, process_negotiate, sk);
+
+	return 0;
+
+destroy:
+	if (attach_sub_id != VMCI_INVALID_ID)
+		vmci_event_unsubscribe(attach_sub_id);
+
+	if (detach_sub_id != VMCI_INVALID_ID)
+		vmci_event_unsubscribe(detach_sub_id);
+
+	if (!vmci_handle_is_invalid(handle))
+		vmci_qpair_detach(&qpair);
+
+	return err;
+}
+
+static int
+vmci_transport_recv_connecting_client_invalid(struct sock *sk,
+					      struct vmci_transport_packet *pkt)
+{
+	int err = 0;
+	struct vsock_sock *vsk = vsock_sk(sk);
+
+	if (vsk->sent_request) {
+		vsk->sent_request = false;
+		vsk->ignore_connecting_rst = true;
+
+		err = vmci_transport_send_conn_request(
+			sk, vsk->trans.queue_pair_size);
+		if (err < 0)
+			err = vmci_transport_error_to_vsock_error(err);
+		else
+			err = 0;
+
+	}
+
+	return err;
+}
+
+static int vmci_transport_recv_connected(struct sock *sk,
+					 struct vmci_transport_packet *pkt)
+{
+	struct vsock_sock *vsk;
+	bool pkt_processed = false;
+
+	/* In cases where we are closing the connection, it's sufficient to
+	 * mark the state change (and maybe error) and wake up any waiting
+	 * threads. Since this is a connected socket, it's owned by a user
+	 * process and will be cleaned up when the failure is passed back on
+	 * the current or next system call.  Our system call implementations
+	 * must therefore check for error and state changes on entry and when
+	 * being awoken.
+	 */
+	switch (pkt->type) {
+	case VMCI_TRANSPORT_PACKET_TYPE_SHUTDOWN:
+		if (pkt->u.mode) {
+			vsk = vsock_sk(sk);
+
+			vsk->peer_shutdown |= pkt->u.mode;
+			sk->sk_state_change(sk);
+		}
+		break;
+
+	case VMCI_TRANSPORT_PACKET_TYPE_RST:
+		vsk = vsock_sk(sk);
+		/* It is possible that we sent our peer a message (e.g a
+		 * WAITING_READ) right before we got notified that the peer had
+		 * detached. If that happens then we can get a RST pkt back
+		 * from our peer even though there is data available for us to
+		 * read. In that case, don't shutdown the socket completely but
+		 * instead allow the local client to finish reading data off
+		 * the queuepair. Always treat a RST pkt in connected mode like
+		 * a clean shutdown.
+		 */
+		sock_set_flag(sk, SOCK_DONE);
+		vsk->peer_shutdown = SHUTDOWN_MASK;
+		if (vsock_stream_has_data(vsk) <= 0)
+			sk->sk_state = SS_DISCONNECTING;
+
+		sk->sk_state_change(sk);
+		break;
+
+	default:
+		vsk = vsock_sk(sk);
+		NOTIFYCALL(vsk, handle_notify_pkt, sk, pkt, false, NULL, NULL,
+			   &pkt_processed);
+		if (!pkt_processed)
+			return -EINVAL;
+
+		break;
+	}
+
+	return 0;
+}
+
+static void vmci_transport_init(struct vsock_sock *vsk, struct vsock_sock *psk)
+{
+	vsk->trans.dg_handle = VMCI_INVALID_HANDLE;
+	vsk->trans.qp_handle = VMCI_INVALID_HANDLE;
+	vsk->trans.qpair = NULL;
+	vsk->trans.produce_size = vsk->trans.consume_size = 0;
+	vsk->trans.attach_sub_id = vsk->trans.detach_sub_id = VMCI_INVALID_ID;
+	vsk->trans.notify_ops = NULL;
+	if (psk) {
+		vsk->trans.queue_pair_size = psk->trans.queue_pair_size;
+		vsk->trans.queue_pair_min_size =
+			psk->trans.queue_pair_min_size;
+		vsk->trans.queue_pair_max_size =
+			psk->trans.queue_pair_max_size;
+	} else {
+		vsk->trans.queue_pair_size = VMCI_TRANSPORT_DEFAULT_QP_SIZE;
+		vsk->trans.queue_pair_min_size =
+			 VMCI_TRANSPORT_DEFAULT_QP_SIZE_MIN;
+		vsk->trans.queue_pair_max_size =
+			VMCI_TRANSPORT_DEFAULT_QP_SIZE_MAX;
+	}
+}
+
+static void vmci_transport_destruct(struct vsock_sock *vsk)
+{
+	if (vsk->trans.attach_sub_id != VMCI_INVALID_ID) {
+		vmci_event_unsubscribe(vsk->trans.attach_sub_id);
+		vsk->trans.attach_sub_id = VMCI_INVALID_ID;
+	}
+
+	if (vsk->trans.detach_sub_id != VMCI_INVALID_ID) {
+		vmci_event_unsubscribe(vsk->trans.detach_sub_id);
+		vsk->trans.detach_sub_id = VMCI_INVALID_ID;
+	}
+
+	if (!vmci_handle_is_invalid(vsk->trans.qp_handle)) {
+		vmci_qpair_detach(&vsk->trans.qpair);
+		vsk->trans.qp_handle = VMCI_INVALID_HANDLE;
+		vsk->trans.produce_size = vsk->trans.consume_size = 0;
+	}
+}
+
+static void vmci_transport_release(struct vsock_sock *vsk)
+{
+	if (!vmci_handle_is_invalid(vsk->trans.dg_handle)) {
+		vmci_datagram_destroy_handle(vsk->trans.dg_handle);
+		vsk->trans.dg_handle = VMCI_INVALID_HANDLE;
+	}
+}
+
+static int vmci_transport_bind_dgram(struct vsock_sock *vsk,
+				     struct sockaddr_vm *addr)
+{
+	u32 port;
+	u32 flags;
+	int err;
+
+	/* VMCI will select a resource ID for us if we provide
+	 * VMCI_INVALID_ID.
+	 */
+	port = addr->svm_port == VMADDR_PORT_ANY ?
+			VMCI_INVALID_ID : addr->svm_port;
+
+	if (port <= LAST_RESERVED_PORT && !capable(CAP_NET_BIND_SERVICE))
+		return -EACCES;
+
+	flags = addr->svm_cid == VMADDR_CID_ANY ?
+				VMCI_FLAG_ANYCID_DG_HND : 0;
+
+	err = vmci_transport_datagram_create_hnd(port, flags,
+						 vmci_transport_recv_dgram_cb,
+						 &vsk->sk,
+						 &vsk->trans.dg_handle);
+	if (err < VMCI_SUCCESS)
+		return vmci_transport_error_to_vsock_error(err);
+	vsock_addr_init(&vsk->local_addr, addr->svm_cid,
+			vsk->trans.dg_handle.resource);
+
+	return 0;
+}
+
+static int vmci_transport_send_dgram(struct vsock_sock *vsk,
+				     struct sockaddr_vm *remote_addr,
+				     struct iovec *iov, size_t len)
+{
+	int err;
+	struct vmci_datagram *dg;
+
+	if (!vmci_transport_allow_dgram(vsk, remote_addr->svm_cid))
+		return -EPERM;
+
+	/* Allocate a buffer for the user's message and our packet header. */
+	dg = kmalloc(len + sizeof(*dg), GFP_KERNEL);
+	if (!dg)
+		return -ENOMEM;
+
+	memcpy_fromiovec(VMCI_DG_PAYLOAD(dg), iov, len);
+
+	dg->dst = vmci_make_handle(remote_addr->svm_cid,
+				   remote_addr->svm_port);
+	dg->src = vmci_make_handle(vsk->local_addr.svm_cid,
+				   vsk->local_addr.svm_port);
+	dg->payload_size = len;
+
+	err = vmci_datagram_send(dg);
+	kfree(dg);
+	if (err < 0)
+		return vmci_transport_error_to_vsock_error(err);
+
+	return err - sizeof(*dg);
+}
+
+static int vmci_transport_connect(struct vsock_sock *vsk)
+{
+	int err;
+	bool old_pkt_proto = false;
+	struct sock *sk = &vsk->sk;
+
+	if (vmci_transport_old_proto_override(&old_pkt_proto) &&
+		old_pkt_proto) {
+		err = vmci_transport_send_conn_request(
+			sk, vsk->trans.queue_pair_size);
+		if (err < 0) {
+			sk->sk_state = SS_UNCONNECTED;
+			return err;
+		}
+	} else {
+		int supported_proto_versions =
+			vmci_transport_new_proto_supported_versions();
+		err = vmci_transport_send_conn_request2(
+				sk, vsk->trans.queue_pair_size,
+				supported_proto_versions);
+		if (err < 0) {
+			sk->sk_state = SS_UNCONNECTED;
+			return err;
+		}
+
+		vsk->sent_request = true;
+	}
+
+	return err;
+}
+
+static ssize_t vmci_transport_recv_stream_data(struct vsock_sock *vsk,
+					       struct iovec *iov,
+					       size_t len,
+					       int flags)
+{
+	if (flags & MSG_PEEK)
+		return vmci_qpair_peekv(vsk->trans.qpair, iov, len, 0);
+	else
+		return vmci_qpair_dequev(vsk->trans.qpair, iov, len, 0);
+}
+
+static ssize_t vmci_transport_send_stream_data(struct vsock_sock *vsk,
+					       struct iovec *iov,
+					       size_t len)
+{
+	return vmci_qpair_enquev(vsk->trans.qpair, iov, len, 0);
+}
+
+static s64 vmci_transport_stream_has_data(struct vsock_sock *vsk)
+{
+	return vmci_qpair_consume_buf_ready(vsk->trans.qpair);
+}
+
+static s64 vmci_transport_stream_has_space(struct vsock_sock *vsk)
+{
+	return vmci_qpair_produce_free_space(vsk->trans.qpair);
+}
+
+static void vmci_transport_unregister(void)
+{
+	if (!vmci_handle_is_invalid(vmci_transport_stream_handle)) {
+		if (vmci_datagram_destroy_handle(
+			vmci_transport_stream_handle) != VMCI_SUCCESS)
+			pr_err("Couldn't destroy datagram handle\n");
+		vmci_transport_stream_handle = VMCI_INVALID_HANDLE;
+	}
+
+	if (vmci_transport_qp_resumed_sub_id != VMCI_INVALID_ID) {
+		vmci_event_unsubscribe(vmci_transport_qp_resumed_sub_id);
+		vmci_transport_qp_resumed_sub_id = VMCI_INVALID_ID;
+	}
+}
+
+static struct vsock_transport vmci_transport = {
+	.init = vmci_transport_init,
+	.destruct = vmci_transport_destruct,
+	.release = vmci_transport_release,
+	.connect = vmci_transport_connect,
+	.bind_dgram = vmci_transport_bind_dgram,
+	.send_dgram = vmci_transport_send_dgram,
+	.recv_stream = vmci_transport_recv_stream_data,
+	.send_stream = vmci_transport_send_stream_data,
+	.stream_has_data = vmci_transport_stream_has_data,
+	.stream_has_space = vmci_transport_stream_has_space,
+	.send_shutdown = vmci_transport_send_shutdown,
+	.unregister = vmci_transport_unregister,
+};
+
+int vmci_transport_register(struct vsock_transport **transport)
+{
+	int err = 0;
+
+	*transport = &vmci_transport;
+
+	/* Create the datagram handle that we will use to send and receive all
+	 * VSocket control messages for this context.
+	 */
+	err = vmci_transport_datagram_create_hnd(VMCI_TRANSPORT_PACKET_RID,
+						 VMCI_FLAG_ANYCID_DG_HND,
+						 vmci_transport_recv_stream_cb,
+						 NULL,
+						 &vmci_transport_stream_handle);
+	if (err < VMCI_SUCCESS) {
+		pr_err("Unable to create datagram handle. (%d)\n",
+		       err);
+		err = vmci_transport_error_to_vsock_error(err);
+		goto out;
+	}
+
+	err = vmci_event_subscribe(VMCI_EVENT_QP_RESUMED,
+				   vmci_transport_qp_resumed_cb,
+				   NULL, &vmci_transport_qp_resumed_sub_id);
+	if (err < VMCI_SUCCESS) {
+		pr_err("Unable to subscribe to resumed event. (%d)\n",
+		       err);
+		err = vmci_transport_error_to_vsock_error(err);
+		vmci_transport_qp_resumed_sub_id = VMCI_INVALID_ID;
+		goto out;
+	}
+
+out:
+	if (err != 0)
+		vmci_transport_unregister();
+
+	return err;
+}
+
+static bool vmci_transport_old_proto_override(bool *old_pkt_proto)
+{
+	if (PROTOCOL_OVERRIDE != -1) {
+		if (PROTOCOL_OVERRIDE == 0)
+			*old_pkt_proto = true;
+		else
+			*old_pkt_proto = false;
+
+		pr_info("Proto override in use\n");
+		return true;
+	}
+
+	return false;
+}
+
+static bool vmci_transport_proto_to_notify_struct(struct sock *sk,
+						  u16 *proto,
+						  bool old_pkt_proto)
+{
+	struct vsock_sock *vsk = vsock_sk(sk);
+
+	if (old_pkt_proto) {
+		if (*proto != VSOCK_PROTO_INVALID) {
+			pr_err("Can't set both an old and new protocol\n");
+			return false;
+		}
+		vsk->trans.notify_ops = &vmci_transport_notify_pkt_ops;
+		goto exit;
+	}
+
+	switch (*proto) {
+	case VSOCK_PROTO_PKT_ON_NOTIFY:
+		vsk->trans.notify_ops = &vmci_transport_notify_pkt_q_state_ops;
+		break;
+	default:
+		pr_err("Unknown notify protocol version\n");
+		return false;
+	}
+
+exit:
+	NOTIFYCALL(vsk, socket_init, sk);
+	return true;
+}
+
+static u16 vmci_transport_new_proto_supported_versions(void)
+{
+	if (PROTOCOL_OVERRIDE != -1)
+		return PROTOCOL_OVERRIDE;
+
+	return VSOCK_PROTO_ALL_SUPPORTED;
+}
+
diff --git a/net/vmw_vsock/vmci_transport.h b/net/vmw_vsock/vmci_transport.h
new file mode 100644
index 0000000..8369a61
--- /dev/null
+++ b/net/vmw_vsock/vmci_transport.h
@@ -0,0 +1,90 @@
+/*
+ * VMware vSockets Driver
+ *
+ * Copyright (C) 2013 VMware, Inc. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation version 2 and no later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ */
+
+#ifndef _VMCI_TRANSPORT_H_
+#define _VMCI_TRANSPORT_H_
+
+#include <linux/vmw_vmci_defs.h>
+#include <linux/vmw_vmci_api.h>
+
+/* If the packet format changes in a release then this should change too. */
+#define VMCI_TRANSPORT_PACKET_VERSION 1
+
+/* The resource ID on which control packets are sent. */
+#define VMCI_TRANSPORT_PACKET_RID 1
+
+enum vmci_transport_packet_type {
+	VMCI_TRANSPORT_PACKET_TYPE_INVALID = 0,
+	VMCI_TRANSPORT_PACKET_TYPE_REQUEST,
+	VMCI_TRANSPORT_PACKET_TYPE_NEGOTIATE,
+	VMCI_TRANSPORT_PACKET_TYPE_OFFER,
+	VMCI_TRANSPORT_PACKET_TYPE_ATTACH,
+	VMCI_TRANSPORT_PACKET_TYPE_WROTE,
+	VMCI_TRANSPORT_PACKET_TYPE_READ,
+	VMCI_TRANSPORT_PACKET_TYPE_RST,
+	VMCI_TRANSPORT_PACKET_TYPE_SHUTDOWN,
+	VMCI_TRANSPORT_PACKET_TYPE_WAITING_WRITE,
+	VMCI_TRANSPORT_PACKET_TYPE_WAITING_READ,
+	VMCI_TRANSPORT_PACKET_TYPE_REQUEST2,
+	VMCI_TRANSPORT_PACKET_TYPE_NEGOTIATE2,
+	VMCI_TRANSPORT_PACKET_TYPE_MAX
+};
+
+#define VSOCK_PROTO_INVALID        0
+#define VSOCK_PROTO_PKT_ON_NOTIFY (1 << 0)
+#define VSOCK_PROTO_ALL_SUPPORTED (VSOCK_PROTO_PKT_ON_NOTIFY)
+
+struct vmci_transport_waiting_info {
+	u64 generation;
+	u64 offset;
+};
+
+/* Control packet type for STREAM sockets.  DGRAMs have no control packets nor
+ * special packet header for data packets, they are just raw VMCI DGRAM
+ * messages.  For STREAMs, control packets are sent over the control channel
+ * while data is written and read directly from queue pairs with no packet
+ * format.
+ */
+struct vmci_transport_packet {
+	struct vmci_datagram dg;
+	u8 version;
+	u8 type;
+	u16 proto;
+	u32 src_port;
+	u32 dst_port;
+	u32 _reserved2;
+	union {
+		u64 size;
+		u64 mode;
+		struct vmci_handle handle;
+		struct vmci_transport_waiting_info wait;
+	} u;
+};
+
+struct vsock_transport;
+
+int vmci_transport_register(struct vsock_transport **transport);
+int vmci_transport_send_wrote_bh(struct sockaddr_vm *dst,
+				 struct sockaddr_vm *src);
+int vmci_transport_send_read_bh(struct sockaddr_vm *dst,
+				struct sockaddr_vm *src);
+int vmci_transport_send_wrote(struct sock *sk);
+int vmci_transport_send_read(struct sock *sk);
+int vmci_transport_send_waiting_write(struct sock *sk,
+				      struct vmci_transport_waiting_info *wait);
+int vmci_transport_send_waiting_read(struct sock *sk,
+				     struct vmci_transport_waiting_info *wait);
+
+#endif
diff --git a/net/vmw_vsock/vmci_transport_notify.c b/net/vmw_vsock/vmci_transport_notify.c
new file mode 100644
index 0000000..6738a29
--- /dev/null
+++ b/net/vmw_vsock/vmci_transport_notify.c
@@ -0,0 +1,677 @@
+/*
+ * VMware vSockets Driver
+ *
+ * Copyright (C) 2009-2013 VMware, Inc. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation version 2 and no later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ */
+
+#include <linux/types.h>
+#include <linux/socket.h>
+#include <linux/stddef.h>
+#include <net/sock.h>
+
+#include "vmci_transport_notify.h"
+#include "af_vsock.h"
+
+#define PKT_FIELD(vsk, field_name) ((vsk)->trans.notify.pkt.field_name)
+
+static bool vmci_transport_notify_waiting_write(struct vsock_sock *vsk)
+{
+#if defined(VSOCK_OPTIMIZATION_WAITING_NOTIFY)
+	bool retval;
+	u64 notify_limit;
+
+	if (!PKT_FIELD(vsk, peer_waiting_write))
+		return false;
+
+#ifdef VSOCK_OPTIMIZATION_FLOW_CONTROL
+	/* When the sender blocks, we take that as a sign that the sender is
+	 * faster than the receiver. To reduce the transmit rate of the sender,
+	 * we delay the sending of the read notification by decreasing the
+	 * write_notify_window. The notification is delayed until the number of
+	 * bytes used in the queue drops below the write_notify_window.
+	 */
+
+	if (!PKT_FIELD(vsk, peer_waiting_write_detected)) {
+		PKT_FIELD(vsk, peer_waiting_write_detected) = true;
+		if (PKT_FIELD(vsk, write_notify_window) < PAGE_SIZE) {
+			PKT_FIELD(vsk, write_notify_window) =
+			    PKT_FIELD(vsk, write_notify_min_window);
+		} else {
+			PKT_FIELD(vsk, write_notify_window) -= PAGE_SIZE;
+			if (PKT_FIELD(vsk, write_notify_window) <
+			    PKT_FIELD(vsk, write_notify_min_window))
+				PKT_FIELD(vsk, write_notify_window) =
+				    PKT_FIELD(vsk, write_notify_min_window);
+
+		}
+	}
+	notify_limit = vsk->trans.consume_size -
+		PKT_FIELD(vsk, write_notify_window);
+#else
+	notify_limit = 0;
+#endif
+
+	/* For now we ignore the wait information and just see if the free
+	 * space exceeds the notify limit.  Note that improving this function
+	 * to be more intelligent will not require a protocol change and will
+	 * retain compatibility between endpoints with mixed versions of this
+	 * function.
+	 *
+	 * The notify_limit is used to delay notifications in the case where
+	 * flow control is enabled. Below the test is expressed in terms of
+	 * free space in the queue: if free_space > ConsumeSize -
+	 * write_notify_window then notify An alternate way of expressing this
+	 * is to rewrite the expression to use the data ready in the receive
+	 * queue: if write_notify_window > bufferReady then notify as
+	 * free_space == ConsumeSize - bufferReady.
+	 */
+	retval = vmci_qpair_consume_free_space(vsk->trans.qpair) > notify_limit;
+#ifdef VSOCK_OPTIMIZATION_FLOW_CONTROL
+	if (retval) {
+		/*
+		 * Once we notify the peer, we reset the detected flag so the
+		 * next wait will again cause a decrease in the window size.
+		 */
+
+		PKT_FIELD(vsk, peer_waiting_write_detected) = false;
+	}
+#endif
+	return retval;
+#else
+	return true;
+#endif
+}
+
+static bool vmci_transport_notify_waiting_read(struct vsock_sock *vsk)
+{
+#if defined(VSOCK_OPTIMIZATION_WAITING_NOTIFY)
+	if (!PKT_FIELD(vsk, peer_waiting_read))
+		return false;
+
+	/* For now we ignore the wait information and just see if there is any
+	 * data for our peer to read.  Note that improving this function to be
+	 * more intelligent will not require a protocol change and will retain
+	 * compatibility between endpoints with mixed versions of this
+	 * function.
+	 */
+	return vmci_qpair_produce_buf_ready(vsk->trans.qpair) > 0;
+#else
+	return true;
+#endif
+}
+
+static void
+vmci_transport_handle_waiting_read(struct sock *sk,
+				   struct vmci_transport_packet *pkt,
+				   bool bottom_half,
+				   struct sockaddr_vm *dst,
+				   struct sockaddr_vm *src)
+{
+#if defined(VSOCK_OPTIMIZATION_WAITING_NOTIFY)
+	struct vsock_sock *vsk;
+
+	vsk = vsock_sk(sk);
+
+	PKT_FIELD(vsk, peer_waiting_read) = true;
+	memcpy(&PKT_FIELD(vsk, peer_waiting_read_info), &pkt->u.wait,
+	       sizeof(PKT_FIELD(vsk, peer_waiting_read_info)));
+
+	if (vmci_transport_notify_waiting_read(vsk)) {
+		bool sent;
+
+		if (bottom_half)
+			sent = vmci_transport_send_wrote_bh(dst, src) > 0;
+		else
+			sent = vmci_transport_send_wrote(sk) > 0;
+
+		if (sent)
+			PKT_FIELD(vsk, peer_waiting_read) = false;
+	}
+#endif
+}
+
+static void
+vmci_transport_handle_waiting_write(struct sock *sk,
+				    struct vmci_transport_packet *pkt,
+				    bool bottom_half,
+				    struct sockaddr_vm *dst,
+				    struct sockaddr_vm *src)
+{
+#if defined(VSOCK_OPTIMIZATION_WAITING_NOTIFY)
+	struct vsock_sock *vsk;
+
+	vsk = vsock_sk(sk);
+
+	PKT_FIELD(vsk, peer_waiting_write) = true;
+	memcpy(&PKT_FIELD(vsk, peer_waiting_write_info), &pkt->u.wait,
+	       sizeof(PKT_FIELD(vsk, peer_waiting_write_info)));
+
+	if (vmci_transport_notify_waiting_write(vsk)) {
+		bool sent;
+
+		if (bottom_half)
+			sent = vmci_transport_send_read_bh(dst, src) > 0;
+		else
+			sent = vmci_transport_send_read(sk) > 0;
+
+		if (sent)
+			PKT_FIELD(vsk, peer_waiting_write) = false;
+	}
+#endif
+}
+
+static void
+vmci_transport_handle_read(struct sock *sk,
+			   struct vmci_transport_packet *pkt,
+			   bool bottom_half,
+			   struct sockaddr_vm *dst, struct sockaddr_vm *src)
+{
+#if defined(VSOCK_OPTIMIZATION_WAITING_NOTIFY)
+	struct vsock_sock *vsk;
+
+	vsk = vsock_sk(sk);
+	PKT_FIELD(vsk, sent_waiting_write) = false;
+#endif
+
+	sk->sk_write_space(sk);
+}
+
+static bool send_waiting_read(struct sock *sk, u64 room_needed)
+{
+#if defined(VSOCK_OPTIMIZATION_WAITING_NOTIFY)
+	struct vsock_sock *vsk;
+	struct vmci_transport_waiting_info waiting_info;
+	u64 tail;
+	u64 head;
+	u64 room_left;
+	bool ret;
+
+	vsk = vsock_sk(sk);
+
+	if (PKT_FIELD(vsk, sent_waiting_read))
+		return true;
+
+	if (PKT_FIELD(vsk, write_notify_window) < vsk->trans.consume_size)
+		PKT_FIELD(vsk, write_notify_window) =
+		    min(PKT_FIELD(vsk, write_notify_window) + PAGE_SIZE,
+			vsk->trans.consume_size);
+
+	vmci_qpair_get_consume_indexes(vsk->trans.qpair, &tail, &head);
+	room_left = vsk->trans.consume_size - head;
+	if (room_needed >= room_left) {
+		waiting_info.offset = room_needed - room_left;
+		waiting_info.generation =
+		    PKT_FIELD(vsk, consume_q_generation) + 1;
+	} else {
+		waiting_info.offset = head + room_needed;
+		waiting_info.generation = PKT_FIELD(vsk, consume_q_generation);
+	}
+
+	ret = vmci_transport_send_waiting_read(sk, &waiting_info) > 0;
+	if (ret)
+		PKT_FIELD(vsk, sent_waiting_read) = true;
+
+	return ret;
+#else
+	return true;
+#endif
+}
+
+static bool send_waiting_write(struct sock *sk, u64 room_needed)
+{
+#if defined(VSOCK_OPTIMIZATION_WAITING_NOTIFY)
+	struct vsock_sock *vsk;
+	struct vmci_transport_waiting_info waiting_info;
+	u64 tail;
+	u64 head;
+	u64 room_left;
+	bool ret;
+
+	vsk = vsock_sk(sk);
+
+	if (PKT_FIELD(vsk, sent_waiting_write))
+		return true;
+
+	vmci_qpair_get_produce_indexes(vsk->trans.qpair, &tail, &head);
+	room_left = vsk->trans.produce_size - tail;
+	if (room_needed + 1 >= room_left) {
+		/* Wraps around to current generation. */
+		waiting_info.offset = room_needed + 1 - room_left;
+		waiting_info.generation = PKT_FIELD(vsk, produce_q_generation);
+	} else {
+		waiting_info.offset = tail + room_needed + 1;
+		waiting_info.generation =
+		    PKT_FIELD(vsk, produce_q_generation) - 1;
+	}
+
+	ret = vmci_transport_send_waiting_write(sk, &waiting_info) > 0;
+	if (ret)
+		PKT_FIELD(vsk, sent_waiting_write) = true;
+
+	return ret;
+#else
+	return true;
+#endif
+}
+
+static int vmci_transport_send_read_notification(struct sock *sk)
+{
+	struct vsock_sock *vsk;
+	bool sent_read;
+	unsigned int retries;
+	int err;
+
+	vsk = vsock_sk(sk);
+	sent_read = false;
+	retries = 0;
+	err = 0;
+
+	if (vmci_transport_notify_waiting_write(vsk)) {
+		/* Notify the peer that we have read, retrying the send on
+		 * failure up to our maximum value.  XXX For now we just log
+		 * the failure, but later we should schedule a work item to
+		 * handle the resend until it succeeds.  That would require
+		 * keeping track of work items in the vsk and cleaning them up
+		 * upon socket close.
+		 */
+		while (!(vsk->peer_shutdown & RCV_SHUTDOWN) &&
+		       !sent_read &&
+		       retries < VMCI_TRANSPORT_MAX_DGRAM_RESENDS) {
+			err = vmci_transport_send_read(sk);
+			if (err >= 0)
+				sent_read = true;
+
+			retries++;
+		}
+
+		if (retries >= VMCI_TRANSPORT_MAX_DGRAM_RESENDS)
+			pr_err("%p unable to send read notify to peer\n", sk);
+		else
+#if defined(VSOCK_OPTIMIZATION_WAITING_NOTIFY)
+			PKT_FIELD(vsk, peer_waiting_write) = false;
+#endif
+
+	}
+	return err;
+}
+
+static void
+vmci_transport_handle_wrote(struct sock *sk,
+			    struct vmci_transport_packet *pkt,
+			    bool bottom_half,
+			    struct sockaddr_vm *dst, struct sockaddr_vm *src)
+{
+#if defined(VSOCK_OPTIMIZATION_WAITING_NOTIFY)
+	struct vsock_sock *vsk = vsock_sk(sk);
+	PKT_FIELD(vsk, sent_waiting_read) = false;
+#endif
+	sk->sk_data_ready(sk, 0);
+}
+
+static void vmci_transport_notify_pkt_socket_init(struct sock *sk)
+{
+	struct vsock_sock *vsk = vsock_sk(sk);
+
+	PKT_FIELD(vsk, write_notify_window) = PAGE_SIZE;
+	PKT_FIELD(vsk, write_notify_min_window) = PAGE_SIZE;
+	PKT_FIELD(vsk, peer_waiting_read) = false;
+	PKT_FIELD(vsk, peer_waiting_write) = false;
+	PKT_FIELD(vsk, peer_waiting_write_detected) = false;
+	PKT_FIELD(vsk, sent_waiting_read) = false;
+	PKT_FIELD(vsk, sent_waiting_write) = false;
+	PKT_FIELD(vsk, produce_q_generation) = 0;
+	PKT_FIELD(vsk, consume_q_generation) = 0;
+
+	memset(&PKT_FIELD(vsk, peer_waiting_read_info), 0,
+	       sizeof(PKT_FIELD(vsk, peer_waiting_read_info)));
+	memset(&PKT_FIELD(vsk, peer_waiting_write_info), 0,
+	       sizeof(PKT_FIELD(vsk, peer_waiting_write_info)));
+}
+
+static void vmci_transport_notify_pkt_socket_destruct(struct sock *sk)
+{
+	return;
+}
+
+static int
+vmci_transport_notify_pkt_poll_in(struct sock *sk,
+				  size_t target, bool *data_ready_now)
+{
+	struct vsock_sock *vsk = vsock_sk(sk);
+
+	if (vsock_stream_has_data(vsk)) {
+		*data_ready_now = true;
+	} else {
+		/* We can't read right now because there is nothing in the
+		 * queue. Ask for notifications when there is something to
+		 * read.
+		 */
+		if (sk->sk_state == SS_CONNECTED) {
+			if (!send_waiting_read(sk, 1))
+				return -1;
+
+		}
+		*data_ready_now = false;
+	}
+
+	return 0;
+}
+
+static int
+vmci_transport_notify_pkt_poll_out(struct sock *sk,
+				   size_t target, bool *space_avail_now)
+{
+	s64 produce_q_free_space;
+	struct vsock_sock *vsk = vsock_sk(sk);
+
+	produce_q_free_space = vsock_stream_has_space(vsk);
+	if (produce_q_free_space > 0) {
+		*space_avail_now = true;
+		return 0;
+	} else if (produce_q_free_space == 0) {
+		/* This is a connected socket but we can't currently send data.
+		 * Notify the peer that we are waiting if the queue is full. We
+		 * only send a waiting write if the queue is full because
+		 * otherwise we end up in an infinite WAITING_WRITE, READ,
+		 * WAITING_WRITE, READ, etc. loop. Treat failing to send the
+		 * notification as a socket error, passing that back through
+		 * the mask.
+		 */
+		if (!send_waiting_write(sk, 1))
+			return -1;
+
+		*space_avail_now = false;
+	}
+
+	return 0;
+}
+
+static int
+vmci_transport_notify_pkt_recv_init(
+			struct sock *sk,
+			size_t target,
+			struct vmci_transport_recv_notify_data *data)
+{
+	struct vsock_sock *vsk = vsock_sk(sk);
+
+#ifdef VSOCK_OPTIMIZATION_WAITING_NOTIFY
+	data->consume_head = 0;
+	data->produce_tail = 0;
+#ifdef VSOCK_OPTIMIZATION_FLOW_CONTROL
+	data->notify_on_block = false;
+
+	if (PKT_FIELD(vsk, write_notify_min_window) < target + 1) {
+		PKT_FIELD(vsk, write_notify_min_window) = target + 1;
+		if (PKT_FIELD(vsk, write_notify_window) <
+		    PKT_FIELD(vsk, write_notify_min_window)) {
+			/* If the current window is smaller than the new
+			 * minimal window size, we need to reevaluate whether
+			 * we need to notify the sender. If the number of ready
+			 * bytes are smaller than the new window, we need to
+			 * send a notification to the sender before we block.
+			 */
+
+			PKT_FIELD(vsk, write_notify_window) =
+			    PKT_FIELD(vsk, write_notify_min_window);
+			data->notify_on_block = true;
+		}
+	}
+#endif
+#endif
+
+	return 0;
+}
+
+static int
+vmci_transport_notify_pkt_recv_pre_block(
+				struct sock *sk,
+				size_t target,
+				struct vmci_transport_recv_notify_data *data)
+{
+	int err = 0;
+
+	/* Notify our peer that we are waiting for data to read. */
+	if (!send_waiting_read(sk, target)) {
+		err = -EHOSTUNREACH;
+		return err;
+	}
+#ifdef VSOCK_OPTIMIZATION_FLOW_CONTROL
+	if (data->notify_on_block) {
+		err = vmci_transport_send_read_notification(sk);
+		if (err < 0)
+			return err;
+
+		data->notify_on_block = false;
+	}
+#endif
+
+	return err;
+}
+
+static int
+vmci_transport_notify_pkt_recv_pre_dequeue(
+				struct sock *sk,
+				size_t target,
+				struct vmci_transport_recv_notify_data *data)
+{
+	struct vsock_sock *vsk = vsock_sk(sk);
+
+	/* Now consume up to len bytes from the queue.  Note that since we have
+	 * the socket locked we should copy at least ready bytes.
+	 */
+#if defined(VSOCK_OPTIMIZATION_WAITING_NOTIFY)
+	vmci_qpair_get_consume_indexes(vsk->trans.qpair,
+				       &data->produce_tail,
+				       &data->consume_head);
+#endif
+
+	return 0;
+}
+
+static int
+vmci_transport_notify_pkt_recv_post_dequeue(
+				struct sock *sk,
+				size_t target,
+				ssize_t copied,
+				bool data_read,
+				struct vmci_transport_recv_notify_data *data)
+{
+	struct vsock_sock *vsk;
+	int err;
+
+	vsk = vsock_sk(sk);
+	err = 0;
+
+	if (data_read) {
+#if defined(VSOCK_OPTIMIZATION_WAITING_NOTIFY)
+		/* Detect a wrap-around to maintain queue generation.  Note
+		 * that this is safe since we hold the socket lock across the
+		 * two queue pair operations.
+		 */
+		if (copied >= vsk->trans.consume_size - data->consume_head)
+			PKT_FIELD(vsk, consume_q_generation)++;
+#endif
+
+		err = vmci_transport_send_read_notification(sk);
+		if (err < 0)
+			return err;
+
+	}
+	return err;
+}
+
+static int
+vmci_transport_notify_pkt_send_init(
+			struct sock *sk,
+			struct vmci_transport_send_notify_data *data)
+{
+#ifdef VSOCK_OPTIMIZATION_WAITING_NOTIFY
+	data->consume_head = 0;
+	data->produce_tail = 0;
+#endif
+
+	return 0;
+}
+
+static int
+vmci_transport_notify_pkt_send_pre_block(
+				struct sock *sk,
+				struct vmci_transport_send_notify_data *data)
+{
+	/* Notify our peer that we are waiting for room to write. */
+	if (!send_waiting_write(sk, 1))
+		return -EHOSTUNREACH;
+
+	return 0;
+}
+
+static int
+vmci_transport_notify_pkt_send_pre_enqueue(
+				struct sock *sk,
+				struct vmci_transport_send_notify_data *data)
+{
+	struct vsock_sock *vsk = vsock_sk(sk);
+
+#if defined(VSOCK_OPTIMIZATION_WAITING_NOTIFY)
+	vmci_qpair_get_produce_indexes(vsk->trans.qpair,
+				       &data->produce_tail,
+				       &data->consume_head);
+#endif
+
+	return 0;
+}
+
+static int
+vmci_transport_notify_pkt_send_post_enqueue(
+				struct sock *sk,
+				ssize_t written,
+				struct vmci_transport_send_notify_data *data)
+{
+	int err = 0;
+	struct vsock_sock *vsk;
+	bool sent_wrote = false;
+	int retries = 0;
+
+	vsk = vsock_sk(sk);
+
+#if defined(VSOCK_OPTIMIZATION_WAITING_NOTIFY)
+	/* Detect a wrap-around to maintain queue generation.  Note that this
+	 * is safe since we hold the socket lock across the two queue pair
+	 * operations.
+	 */
+	if (written >= vsk->trans.produce_size - data->produce_tail)
+		PKT_FIELD(vsk, produce_q_generation)++;
+
+#endif
+
+	if (vmci_transport_notify_waiting_read(vsk)) {
+		/* Notify the peer that we have written, retrying the send on
+		 * failure up to our maximum value. See the XXX comment for the
+		 * corresponding piece of code in StreamRecvmsg() for potential
+		 * improvements.
+		 */
+		while (!(vsk->peer_shutdown & RCV_SHUTDOWN) &&
+		       !sent_wrote &&
+		       retries < VMCI_TRANSPORT_MAX_DGRAM_RESENDS) {
+			err = vmci_transport_send_wrote(sk);
+			if (err >= 0)
+				sent_wrote = true;
+
+			retries++;
+		}
+
+		if (retries >= VMCI_TRANSPORT_MAX_DGRAM_RESENDS) {
+			pr_err("%p unable to send wrote notify to peer\n", sk);
+			return err;
+		} else {
+#if defined(VSOCK_OPTIMIZATION_WAITING_NOTIFY)
+			PKT_FIELD(vsk, peer_waiting_read) = false;
+#endif
+		}
+	}
+	return err;
+}
+
+static void
+vmci_transport_notify_pkt_handle_pkt(
+			struct sock *sk,
+			struct vmci_transport_packet *pkt,
+			bool bottom_half,
+			struct sockaddr_vm *dst,
+			struct sockaddr_vm *src, bool *pkt_processed)
+{
+	bool processed = false;
+
+	switch (pkt->type) {
+	case VMCI_TRANSPORT_PACKET_TYPE_WROTE:
+		vmci_transport_handle_wrote(sk, pkt, bottom_half, dst, src);
+		processed = true;
+		break;
+	case VMCI_TRANSPORT_PACKET_TYPE_READ:
+		vmci_transport_handle_read(sk, pkt, bottom_half, dst, src);
+		processed = true;
+		break;
+	case VMCI_TRANSPORT_PACKET_TYPE_WAITING_WRITE:
+		vmci_transport_handle_waiting_write(sk, pkt, bottom_half,
+						    dst, src);
+		processed = true;
+		break;
+
+	case VMCI_TRANSPORT_PACKET_TYPE_WAITING_READ:
+		vmci_transport_handle_waiting_read(sk, pkt, bottom_half,
+						   dst, src);
+		processed = true;
+		break;
+	}
+
+	if (pkt_processed)
+		*pkt_processed = processed;
+}
+
+static void vmci_transport_notify_pkt_process_request(struct sock *sk)
+{
+	struct vsock_sock *vsk = vsock_sk(sk);
+
+	PKT_FIELD(vsk, write_notify_window) = vsk->trans.consume_size;
+	if (vsk->trans.consume_size < PKT_FIELD(vsk, write_notify_min_window))
+		PKT_FIELD(vsk, write_notify_min_window) =
+			vsk->trans.consume_size;
+}
+
+static void vmci_transport_notify_pkt_process_negotiate(struct sock *sk)
+{
+	struct vsock_sock *vsk = vsock_sk(sk);
+
+	PKT_FIELD(vsk, write_notify_window) = vsk->trans.consume_size;
+	if (vsk->trans.consume_size < PKT_FIELD(vsk, write_notify_min_window))
+		PKT_FIELD(vsk, write_notify_min_window) =
+			vsk->trans.consume_size;
+}
+
+/* Socket control packet based operations. */
+struct vmci_transport_notify_ops vmci_transport_notify_pkt_ops = {
+	vmci_transport_notify_pkt_socket_init,
+	vmci_transport_notify_pkt_socket_destruct,
+	vmci_transport_notify_pkt_poll_in,
+	vmci_transport_notify_pkt_poll_out,
+	vmci_transport_notify_pkt_handle_pkt,
+	vmci_transport_notify_pkt_recv_init,
+	vmci_transport_notify_pkt_recv_pre_block,
+	vmci_transport_notify_pkt_recv_pre_dequeue,
+	vmci_transport_notify_pkt_recv_post_dequeue,
+	vmci_transport_notify_pkt_send_init,
+	vmci_transport_notify_pkt_send_pre_block,
+	vmci_transport_notify_pkt_send_pre_enqueue,
+	vmci_transport_notify_pkt_send_post_enqueue,
+	vmci_transport_notify_pkt_process_request,
+	vmci_transport_notify_pkt_process_negotiate,
+};
diff --git a/net/vmw_vsock/vmci_transport_notify.h b/net/vmw_vsock/vmci_transport_notify.h
new file mode 100644
index 0000000..c9652e0
--- /dev/null
+++ b/net/vmw_vsock/vmci_transport_notify.h
@@ -0,0 +1,126 @@
+/*
+ * VMware vSockets Driver
+ *
+ * Copyright (C) 2009-2013 VMware, Inc. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation version 2 and no later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ */
+
+#ifndef __VMCI_TRANSPORT_NOTIFY_H__
+#define __VMCI_TRANSPORT_NOTIFY_H__
+
+#include <linux/types.h>
+#include <linux/vmw_vmci_defs.h>
+#include <linux/vmw_vmci_api.h>
+#include <linux/vm_sockets.h>
+
+#include "vmci_transport.h"
+#include "vsock_addr.h"
+
+/* Comment this out to compare with old protocol. */
+#define VSOCK_OPTIMIZATION_WAITING_NOTIFY 1
+#if defined(VSOCK_OPTIMIZATION_WAITING_NOTIFY)
+/* Comment this out to remove flow control for "new" protocol */
+#define VSOCK_OPTIMIZATION_FLOW_CONTROL 1
+#endif
+
+#define VMCI_TRANSPORT_MAX_DGRAM_RESENDS       10
+
+#define NOTIFYCALLRET(vsk, rv, mod_fn, args...) \
+	do { \
+		if (vsk->trans.notify_ops && \
+		    vsk->trans.notify_ops->mod_fn != NULL) \
+			rv = (vsk->trans.notify_ops->mod_fn)(args); \
+		else \
+			rv = 0; \
+	} while (0)
+
+#define NOTIFYCALL(vsk, mod_fn, args...) \
+	do { \
+		if (vsk->trans.notify_ops && \
+		    vsk->trans.notify_ops->mod_fn != NULL) \
+			(vsk->trans.notify_ops->mod_fn)(args); \
+	} while (0)
+
+struct vmci_transport_notify_pkt {
+	u64 write_notify_window;
+	u64 write_notify_min_window;
+	bool peer_waiting_read;
+	bool peer_waiting_write;
+	bool peer_waiting_write_detected;
+	bool sent_waiting_read;
+	bool sent_waiting_write;
+	struct vmci_transport_waiting_info peer_waiting_read_info;
+	struct vmci_transport_waiting_info peer_waiting_write_info;
+	u64 produce_q_generation;
+	u64 consume_q_generation;
+};
+
+struct vmci_transport_notify_pkt_q_state {
+	u64 write_notify_window;
+	u64 write_notify_min_window;
+	bool peer_waiting_write;
+	bool peer_waiting_write_detected;
+};
+
+union vmci_transport_notify {
+	struct vmci_transport_notify_pkt pkt;
+	struct vmci_transport_notify_pkt_q_state pkt_q_state;
+};
+
+struct vmci_transport_recv_notify_data {
+	u64 consume_head;
+	u64 produce_tail;
+	bool notify_on_block;
+};
+
+struct vmci_transport_send_notify_data {
+	u64 consume_head;
+	u64 produce_tail;
+};
+
+/* Socket notification callbacks. */
+struct vmci_transport_notify_ops {
+	void (*socket_init) (struct sock *sk);
+	void (*socket_destruct) (struct sock *sk);
+	int (*poll_in) (struct sock *sk, size_t target,
+			  bool *data_ready_now);
+	int (*poll_out) (struct sock *sk, size_t target,
+			   bool *space_avail_now);
+	void (*handle_notify_pkt) (struct sock *sk,
+				   struct vmci_transport_packet *pkt,
+				   bool bottom_half, struct sockaddr_vm *dst,
+				   struct sockaddr_vm *src,
+				   bool *pkt_processed);
+	int (*recv_init) (struct sock *sk, size_t target,
+			  struct vmci_transport_recv_notify_data *data);
+	int (*recv_pre_block) (struct sock *sk, size_t target,
+			       struct vmci_transport_recv_notify_data *data);
+	int (*recv_pre_dequeue) (struct sock *sk, size_t target,
+				 struct vmci_transport_recv_notify_data *data);
+	int (*recv_post_dequeue) (struct sock *sk, size_t target,
+				  ssize_t copied, bool data_read,
+				  struct vmci_transport_recv_notify_data *data);
+	int (*send_init) (struct sock *sk,
+			  struct vmci_transport_send_notify_data *data);
+	int (*send_pre_block) (struct sock *sk,
+			       struct vmci_transport_send_notify_data *data);
+	int (*send_pre_enqueue) (struct sock *sk,
+				 struct vmci_transport_send_notify_data *data);
+	int (*send_post_enqueue) (struct sock *sk, ssize_t written,
+				  struct vmci_transport_send_notify_data *data);
+	void (*process_request) (struct sock *sk);
+	void (*process_negotiate) (struct sock *sk);
+};
+
+extern struct vmci_transport_notify_ops vmci_transport_notify_pkt_ops;
+extern struct vmci_transport_notify_ops vmci_transport_notify_pkt_q_state_ops;
+
+#endif /* __VMCI_TRANSPORT_NOTIFY_H__ */
diff --git a/net/vmw_vsock/vmci_transport_notify_qstate.c b/net/vmw_vsock/vmci_transport_notify_qstate.c
new file mode 100644
index 0000000..910d56f
--- /dev/null
+++ b/net/vmw_vsock/vmci_transport_notify_qstate.c
@@ -0,0 +1,411 @@
+/*
+ * VMware vSockets Driver
+ *
+ * Copyright (C) 2009-2013 VMware, Inc. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation version 2 and no later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ */
+
+#include <linux/types.h>
+#include <linux/socket.h>
+#include <linux/stddef.h>
+#include <net/sock.h>
+
+#include "vmci_transport_notify.h"
+#include "af_vsock.h"
+
+#define PKT_FIELD(vsk, field_name) ((vsk)->trans.notify.pkt_q_state.field_name)
+
+static bool vmci_transport_notify_waiting_write(struct vsock_sock *vsk)
+{
+	bool retval;
+	u64 notify_limit;
+
+	if (!PKT_FIELD(vsk, peer_waiting_write))
+		return false;
+
+	/* When the sender blocks, we take that as a sign that the sender is
+	 * faster than the receiver. To reduce the transmit rate of the sender,
+	 * we delay the sending of the read notification by decreasing the
+	 * write_notify_window. The notification is delayed until the number of
+	 * bytes used in the queue drops below the write_notify_window.
+	 */
+
+	if (!PKT_FIELD(vsk, peer_waiting_write_detected)) {
+		PKT_FIELD(vsk, peer_waiting_write_detected) = true;
+		if (PKT_FIELD(vsk, write_notify_window) < PAGE_SIZE) {
+			PKT_FIELD(vsk, write_notify_window) =
+			    PKT_FIELD(vsk, write_notify_min_window);
+		} else {
+			PKT_FIELD(vsk, write_notify_window) -= PAGE_SIZE;
+			if (PKT_FIELD(vsk, write_notify_window) <
+			    PKT_FIELD(vsk, write_notify_min_window))
+				PKT_FIELD(vsk, write_notify_window) =
+				    PKT_FIELD(vsk, write_notify_min_window);
+
+		}
+	}
+	notify_limit = vsk->trans.consume_size -
+		PKT_FIELD(vsk, write_notify_window);
+
+	/* The notify_limit is used to delay notifications in the case where
+	 * flow control is enabled. Below the test is expressed in terms of
+	 * free space in the queue: if free_space > ConsumeSize -
+	 * write_notify_window then notify An alternate way of expressing this
+	 * is to rewrite the expression to use the data ready in the receive
+	 * queue: if write_notify_window > bufferReady then notify as
+	 * free_space == ConsumeSize - bufferReady.
+	 */
+
+	retval =
+		vmci_qpair_consume_free_space(vsk->trans.qpair) > notify_limit;
+
+	if (retval) {
+		/* Once we notify the peer, we reset the detected flag so the
+		 * next wait will again cause a decrease in the window size.
+		 */
+
+		PKT_FIELD(vsk, peer_waiting_write_detected) = false;
+	}
+	return retval;
+}
+
+static void
+vmci_transport_handle_read(struct sock *sk,
+			   struct vmci_transport_packet *pkt,
+			   bool bottom_half,
+			   struct sockaddr_vm *dst, struct sockaddr_vm *src)
+{
+	sk->sk_write_space(sk);
+}
+
+static void
+vmci_transport_handle_wrote(struct sock *sk,
+			    struct vmci_transport_packet *pkt,
+			    bool bottom_half,
+			    struct sockaddr_vm *dst, struct sockaddr_vm *src)
+{
+	sk->sk_data_ready(sk, 0);
+}
+
+static void vsock_block_update_write_window(struct sock *sk)
+{
+	struct vsock_sock *vsk = vsock_sk(sk);
+
+	if (PKT_FIELD(vsk, write_notify_window) < vsk->trans.consume_size)
+		PKT_FIELD(vsk, write_notify_window) =
+		    min(PKT_FIELD(vsk, write_notify_window) + PAGE_SIZE,
+			vsk->trans.consume_size);
+}
+
+static int vmci_transport_send_read_notification(struct sock *sk)
+{
+	struct vsock_sock *vsk;
+	bool sent_read;
+	unsigned int retries;
+	int err;
+
+	vsk = vsock_sk(sk);
+	sent_read = false;
+	retries = 0;
+	err = 0;
+
+	if (vmci_transport_notify_waiting_write(vsk)) {
+		/* Notify the peer that we have read, retrying the send on
+		 * failure up to our maximum value.  XXX For now we just log
+		 * the failure, but later we should schedule a work item to
+		 * handle the resend until it succeeds.  That would require
+		 * keeping track of work items in the vsk and cleaning them up
+		 * upon socket close.
+		 */
+		while (!(vsk->peer_shutdown & RCV_SHUTDOWN) &&
+		       !sent_read &&
+		       retries < VMCI_TRANSPORT_MAX_DGRAM_RESENDS) {
+			err = vmci_transport_send_read(sk);
+			if (err >= 0)
+				sent_read = true;
+
+			retries++;
+		}
+
+		if (retries >= VMCI_TRANSPORT_MAX_DGRAM_RESENDS && !sent_read)
+			pr_err("%p unable to send read notification to peer\n",
+			       sk);
+		else
+			PKT_FIELD(vsk, peer_waiting_write) = false;
+
+	}
+	return err;
+}
+
+static void vmci_transport_notify_pkt_socket_init(struct sock *sk)
+{
+	struct vsock_sock *vsk = vsock_sk(sk);
+
+	PKT_FIELD(vsk, write_notify_window) = PAGE_SIZE;
+	PKT_FIELD(vsk, write_notify_min_window) = PAGE_SIZE;
+	PKT_FIELD(vsk, peer_waiting_write) = false;
+	PKT_FIELD(vsk, peer_waiting_write_detected) = false;
+}
+
+static void vmci_transport_notify_pkt_socket_destruct(struct sock *sk)
+{
+	struct vsock_sock *vsk = vsock_sk(sk);
+
+	PKT_FIELD(vsk, write_notify_window) = PAGE_SIZE;
+	PKT_FIELD(vsk, write_notify_min_window) = PAGE_SIZE;
+	PKT_FIELD(vsk, peer_waiting_write) = false;
+	PKT_FIELD(vsk, peer_waiting_write_detected) = false;
+}
+
+static int
+vmci_transport_notify_pkt_poll_in(struct sock *sk,
+				  size_t target, bool *data_ready_now)
+{
+	struct vsock_sock *vsk = vsock_sk(sk);
+
+	if (vsock_stream_has_data(vsk)) {
+		*data_ready_now = true;
+	} else {
+		/* We can't read right now because there is nothing in the
+		 * queue. Ask for notifications when there is something to
+		 * read.
+		 */
+		if (sk->sk_state == SS_CONNECTED)
+			vsock_block_update_write_window(sk);
+		*data_ready_now = false;
+	}
+
+	return 0;
+}
+
+static int
+vmci_transport_notify_pkt_poll_out(struct sock *sk,
+				   size_t target, bool *space_avail_now)
+{
+	s64 produce_q_free_space;
+	struct vsock_sock *vsk = vsock_sk(sk);
+
+	produce_q_free_space = vsock_stream_has_space(vsk);
+	if (produce_q_free_space > 0) {
+		*space_avail_now = true;
+		return 0;
+	} else if (produce_q_free_space == 0) {
+		/* This is a connected socket but we can't currently send data.
+		 * Nothing else to do.
+		 */
+		*space_avail_now = false;
+	}
+
+	return 0;
+}
+
+static int
+vmci_transport_notify_pkt_recv_init(
+				struct sock *sk,
+				size_t target,
+				struct vmci_transport_recv_notify_data *data)
+{
+	struct vsock_sock *vsk = vsock_sk(sk);
+
+	data->consume_head = 0;
+	data->produce_tail = 0;
+	data->notify_on_block = false;
+
+	if (PKT_FIELD(vsk, write_notify_min_window) < target + 1) {
+		PKT_FIELD(vsk, write_notify_min_window) = target + 1;
+		if (PKT_FIELD(vsk, write_notify_window) <
+		    PKT_FIELD(vsk, write_notify_min_window)) {
+			/* If the current window is smaller than the new
+			 * minimal window size, we need to reevaluate whether
+			 * we need to notify the sender. If the number of ready
+			 * bytes are smaller than the new window, we need to
+			 * send a notification to the sender before we block.
+			 */
+
+			PKT_FIELD(vsk, write_notify_window) =
+			    PKT_FIELD(vsk, write_notify_min_window);
+			data->notify_on_block = true;
+		}
+	}
+
+	return 0;
+}
+
+static int
+vmci_transport_notify_pkt_recv_pre_block(
+				struct sock *sk,
+				size_t target,
+				struct vmci_transport_recv_notify_data *data)
+{
+	int err = 0;
+
+	vsock_block_update_write_window(sk);
+
+	if (data->notify_on_block) {
+		err = vmci_transport_send_read_notification(sk);
+		if (err < 0)
+			return err;
+		data->notify_on_block = false;
+	}
+
+	return err;
+}
+
+static int
+vmci_transport_notify_pkt_recv_post_dequeue(
+				struct sock *sk,
+				size_t target,
+				ssize_t copied,
+				bool data_read,
+				struct vmci_transport_recv_notify_data *data)
+{
+	struct vsock_sock *vsk;
+	int err;
+	bool was_full = false;
+	u64 free_space;
+
+	vsk = vsock_sk(sk);
+	err = 0;
+
+	if (data_read) {
+		smp_mb();
+
+		free_space = vmci_qpair_consume_free_space(vsk->trans.qpair);
+		was_full = free_space == copied;
+
+		if (was_full)
+			PKT_FIELD(vsk, peer_waiting_write) = true;
+
+		err = vmci_transport_send_read_notification(sk);
+		if (err < 0)
+			return err;
+
+		/* See the comment in
+		 * vmci_transport_notify_pkt_send_post_enqueue().
+		 */
+		sk->sk_data_ready(sk, 0);
+	}
+
+	return err;
+}
+
+static int
+vmci_transport_notify_pkt_send_init(
+				struct sock *sk,
+				struct vmci_transport_send_notify_data *data)
+{
+	data->consume_head = 0;
+	data->produce_tail = 0;
+
+	return 0;
+}
+
+static int
+vmci_transport_notify_pkt_send_post_enqueue(
+				struct sock *sk,
+				ssize_t written,
+				struct vmci_transport_send_notify_data *data)
+{
+	int err = 0;
+	struct vsock_sock *vsk;
+	bool sent_wrote = false;
+	bool was_empty;
+	int retries = 0;
+
+	vsk = vsock_sk(sk);
+
+	smp_mb();
+
+	was_empty = vmci_qpair_produce_buf_ready(vsk->trans.qpair) == written;
+	if (was_empty) {
+		while (!(vsk->peer_shutdown & RCV_SHUTDOWN) &&
+		       !sent_wrote &&
+		       retries < VMCI_TRANSPORT_MAX_DGRAM_RESENDS) {
+			err = vmci_transport_send_wrote(sk);
+			if (err >= 0)
+				sent_wrote = true;
+
+			retries++;
+		}
+	}
+
+	if (retries >= VMCI_TRANSPORT_MAX_DGRAM_RESENDS && !sent_wrote) {
+		pr_err("%p unable to send wrote notification to peer\n",
+		       sk);
+		return err;
+	}
+
+	return err;
+}
+
+static void
+vmci_transport_notify_pkt_handle_pkt(
+				struct sock *sk,
+				struct vmci_transport_packet *pkt,
+				bool bottom_half,
+				struct sockaddr_vm *dst,
+				struct sockaddr_vm *src, bool *pkt_processed)
+{
+	bool processed = false;
+
+	switch (pkt->type) {
+	case VMCI_TRANSPORT_PACKET_TYPE_WROTE:
+		vmci_transport_handle_wrote(sk, pkt, bottom_half, dst, src);
+		processed = true;
+		break;
+	case VMCI_TRANSPORT_PACKET_TYPE_READ:
+		vmci_transport_handle_read(sk, pkt, bottom_half, dst, src);
+		processed = true;
+		break;
+	}
+
+	if (pkt_processed)
+		*pkt_processed = processed;
+}
+
+static void vmci_transport_notify_pkt_process_request(struct sock *sk)
+{
+	struct vsock_sock *vsk = vsock_sk(sk);
+
+	PKT_FIELD(vsk, write_notify_window) = vsk->trans.consume_size;
+	if (vsk->trans.consume_size < PKT_FIELD(vsk, write_notify_min_window))
+		PKT_FIELD(vsk, write_notify_min_window) =
+			vsk->trans.consume_size;
+}
+
+static void vmci_transport_notify_pkt_process_negotiate(struct sock *sk)
+{
+	struct vsock_sock *vsk = vsock_sk(sk);
+
+	PKT_FIELD(vsk, write_notify_window) = vsk->trans.consume_size;
+	if (vsk->trans.consume_size < PKT_FIELD(vsk, write_notify_min_window))
+		PKT_FIELD(vsk, write_notify_min_window) =
+			vsk->trans.consume_size;
+}
+
+/* Socket always on control packet based operations. */
+struct vmci_transport_notify_ops vmci_transport_notify_pkt_q_state_ops = {
+	vmci_transport_notify_pkt_socket_init,
+	vmci_transport_notify_pkt_socket_destruct,
+	vmci_transport_notify_pkt_poll_in,
+	vmci_transport_notify_pkt_poll_out,
+	vmci_transport_notify_pkt_handle_pkt,
+	vmci_transport_notify_pkt_recv_init,
+	vmci_transport_notify_pkt_recv_pre_block,
+	NULL,			/* recv_pre_dequeue */
+	vmci_transport_notify_pkt_recv_post_dequeue,
+	vmci_transport_notify_pkt_send_init,
+	NULL,			/* send_pre_block */
+	NULL,			/* send_pre_enqueue */
+	vmci_transport_notify_pkt_send_post_enqueue,
+	vmci_transport_notify_pkt_process_request,
+	vmci_transport_notify_pkt_process_negotiate,
+};
diff --git a/net/vmw_vsock/vsock_addr.c b/net/vmw_vsock/vsock_addr.c
new file mode 100644
index 0000000..3aa9717
--- /dev/null
+++ b/net/vmw_vsock/vsock_addr.c
@@ -0,0 +1,118 @@
+/*
+ * VMware vSockets Driver
+ *
+ * Copyright (C) 2007-2012 VMware, Inc. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation version 2 and no later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ */
+
+#include <linux/types.h>
+#include <linux/socket.h>
+#include <linux/stddef.h>
+#include <linux/vmw_vmci_defs.h>
+#include <linux/vmw_vmci_api.h>
+#include <net/sock.h>
+
+#include "vsock_addr.h"
+
+void vsock_addr_init(struct sockaddr_vm *addr, u32 cid, u32 port)
+{
+	memset(addr, 0, sizeof(*addr));
+	addr->svm_family = AF_VSOCK;
+	addr->svm_cid = cid;
+	addr->svm_port = port;
+}
+
+int vsock_addr_validate(const struct sockaddr_vm *addr)
+{
+	if (!addr)
+		return -EFAULT;
+
+	if (addr->svm_family != AF_VSOCK)
+		return -EAFNOSUPPORT;
+
+	if (addr->svm_zero[0] != 0)
+		return -EINVAL;
+
+	return 0;
+}
+
+bool vsock_addr_bound(const struct sockaddr_vm *addr)
+{
+	return addr->svm_port != VMADDR_PORT_ANY;
+}
+
+void vsock_addr_unbind(struct sockaddr_vm *addr)
+{
+	vsock_addr_init(addr, VMADDR_CID_ANY, VMADDR_PORT_ANY);
+}
+
+bool vsock_addr_equals_addr(const struct sockaddr_vm *addr,
+			    const struct sockaddr_vm *other)
+{
+	return addr->svm_cid == other->svm_cid &&
+		addr->svm_port == other->svm_port;
+}
+
+bool vsock_addr_equals_addr_any(const struct sockaddr_vm *addr,
+				const struct sockaddr_vm *other)
+{
+	return (addr->svm_cid == VMADDR_CID_ANY ||
+		other->svm_cid == VMADDR_CID_ANY ||
+		addr->svm_cid == other->svm_cid) &&
+	       addr->svm_port == other->svm_port;
+}
+
+bool vsock_addr_equals_handle_port(const struct sockaddr_vm *addr,
+				   struct vmci_handle handle, u32 port)
+{
+	return addr->svm_cid == handle.context && addr->svm_port == port;
+}
+
+int vsock_addr_cast(const struct sockaddr *addr,
+		    size_t len, struct sockaddr_vm **out_addr)
+{
+	if (len < sizeof(**out_addr))
+		return -EFAULT;
+
+	*out_addr = (struct sockaddr_vm *)addr;
+	return vsock_addr_validate(*out_addr);
+}
+
+bool vsock_addr_socket_context_stream(u32 cid)
+{
+	static const u32 non_socket_contexts[] = {
+		VMADDR_CID_HYPERVISOR,
+		VMADDR_CID_RESERVED,
+	};
+	int i;
+
+	BUILD_BUG_ON(sizeof(cid) != sizeof(*non_socket_contexts));
+
+	for (i = 0; i < ARRAY_SIZE(non_socket_contexts); i++) {
+		if (cid == non_socket_contexts[i])
+			return false;
+
+	}
+
+	return true;
+}
+
+bool vsock_addr_socket_context_dgram(u32 cid, u32 rid)
+{
+	if (cid == VMADDR_CID_HYPERVISOR) {
+		/* Registrations of PBRPC Servers do not modify VMX/Hypervisor
+		 * state and are allowed.
+		 */
+		return rid == VMCI_UNITY_PBRPC_REGISTER;
+	}
+
+	return true;
+}
diff --git a/net/vmw_vsock/vsock_addr.h b/net/vmw_vsock/vsock_addr.h
new file mode 100644
index 0000000..e47c70c
--- /dev/null
+++ b/net/vmw_vsock/vsock_addr.h
@@ -0,0 +1,36 @@
+/*
+ * VMware vSockets Driver
+ *
+ * Copyright (C) 2007-2013 VMware, Inc. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation version 2 and no later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ */
+
+#ifndef _VSOCK_ADDR_H_
+#define _VSOCK_ADDR_H_
+
+#include <linux/vm_sockets.h>
+
+void vsock_addr_init(struct sockaddr_vm *addr, u32 cid, u32 port);
+int vsock_addr_validate(const struct sockaddr_vm *addr);
+bool vsock_addr_bound(const struct sockaddr_vm *addr);
+void vsock_addr_unbind(struct sockaddr_vm *addr);
+bool vsock_addr_equals_addr(const struct sockaddr_vm *addr,
+			    const struct sockaddr_vm *other);
+bool vsock_addr_equals_addr_any(const struct sockaddr_vm *addr,
+				const struct sockaddr_vm *other);
+bool vsock_addr_equals_handle_port(const struct sockaddr_vm *addr,
+				   struct vmci_handle handle, u32 port);
+int vsock_addr_cast(const struct sockaddr *addr, size_t len,
+		    struct sockaddr_vm **out_addr);
+bool vsock_addr_socket_context_stream(u32 cid);
+bool vsock_addr_socket_context_dgram(u32 cid, u32 rid);
+
+#endif
diff --git a/net/vmw_vsock/vsock_version.h b/net/vmw_vsock/vsock_version.h
new file mode 100644
index 0000000..4df7f5e
--- /dev/null
+++ b/net/vmw_vsock/vsock_version.h
@@ -0,0 +1,22 @@
+/*
+ * VMware vSockets Driver
+ *
+ * Copyright (C) 2011-2012 VMware, Inc. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation version 2 and no later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ */
+
+#ifndef _VSOCK_VERSION_H_
+#define _VSOCK_VERSION_H_
+
+#define VSOCK_DRIVER_VERSION_PARTS	{ 1, 0, 0, 0 }
+#define VSOCK_DRIVER_VERSION_STRING	"1.0.0.0-k"
+
+#endif /* _VSOCK_VERSION_H_ */
-- 
1.7.4.1

^ permalink raw reply related

* [PATCH] net: loopback: fix a dst refcounting issue
From: Eric Dumazet @ 2013-01-25 17:44 UTC (permalink / raw)
  To: Ben Greear, David Miller; +Cc: netdev
In-Reply-To: <1358991906.12374.1356.camel@edumazet-glaptop>

From: Eric Dumazet <edumazet@google.com>

Ben Greear reported crashes in ip_rcv_finish() on a stress
test involving many macvlans.

We tracked the bug to a dst use after free. ip_rcv_finish()
was calling dst->input() and got garbage for dst->input value.

It appears the bug is in loopback driver, lacking
a skb_dst_force() before calling netif_rx().

As a result, a non refcounted dst, normally protected by a
RCU read_lock section, was escaping this section and could
be freed before the packet being processed.

  [<ffffffff813a3c4d>] loopback_xmit+0x64/0x83
  [<ffffffff81477364>] dev_hard_start_xmit+0x26c/0x35e
  [<ffffffff8147771a>] dev_queue_xmit+0x2c4/0x37c
  [<ffffffff81477456>] ? dev_hard_start_xmit+0x35e/0x35e
  [<ffffffff8148cfa6>] ? eth_header+0x28/0xb6
  [<ffffffff81480f09>] neigh_resolve_output+0x176/0x1a7
  [<ffffffff814ad835>] ip_finish_output2+0x297/0x30d
  [<ffffffff814ad6d5>] ? ip_finish_output2+0x137/0x30d
  [<ffffffff814ad90e>] ip_finish_output+0x63/0x68
  [<ffffffff814ae412>] ip_output+0x61/0x67
  [<ffffffff814ab904>] dst_output+0x17/0x1b
  [<ffffffff814adb6d>] ip_local_out+0x1e/0x23
  [<ffffffff814ae1c4>] ip_queue_xmit+0x315/0x353
  [<ffffffff814adeaf>] ? ip_send_unicast_reply+0x2cc/0x2cc
  [<ffffffff814c018f>] tcp_transmit_skb+0x7ca/0x80b
  [<ffffffff814c3571>] tcp_connect+0x53c/0x587
  [<ffffffff810c2f0c>] ? getnstimeofday+0x44/0x7d
  [<ffffffff810c2f56>] ? ktime_get_real+0x11/0x3e
  [<ffffffff814c6f9b>] tcp_v4_connect+0x3c2/0x431
  [<ffffffff814d6913>] __inet_stream_connect+0x84/0x287
  [<ffffffff814d6b38>] ? inet_stream_connect+0x22/0x49
  [<ffffffff8108d695>] ? _local_bh_enable_ip+0x84/0x9f
  [<ffffffff8108d6c8>] ? local_bh_enable+0xd/0x11
  [<ffffffff8146763c>] ? lock_sock_nested+0x6e/0x79
  [<ffffffff814d6b38>] ? inet_stream_connect+0x22/0x49
  [<ffffffff814d6b49>] inet_stream_connect+0x33/0x49
  [<ffffffff814632c6>] sys_connect+0x75/0x98

This bug was introduced in linux-2.6.35, in commit
7fee226ad2397b (net: add a noref bit on skb dst)

skb_dst_force() is enforced in dev_queue_xmit() for devices having a
qdisc. 

Reported-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Tested-by: Ben Greear <greearb@candelatech.com>
---
 drivers/net/loopback.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c
index 81f8f9e..fcbf680 100644
--- a/drivers/net/loopback.c
+++ b/drivers/net/loopback.c
@@ -77,6 +77,11 @@ static netdev_tx_t loopback_xmit(struct sk_buff *skb,
 
 	skb_orphan(skb);
 
+	/* Before queueing this packet to netif_rx(),
+	 * make sure dst is refcounted.
+	 */
+	skb_dst_force(skb);
+
 	skb->protocol = eth_type_trans(skb, dev);
 
 	/* it's OK to use per_cpu_ptr() because BHs are off */

^ permalink raw reply related

* Re: [patch net-next V2] bond: have random dev address by default instead of zeroes
From: Jay Vosburgh @ 2013-01-25 17:53 UTC (permalink / raw)
  To: Jiri Pirko; +Cc: netdev, davem, andy, stephen, psimerda, dcbw
In-Reply-To: <20130125072221.GB1659@minipsycho.orion>

Jiri Pirko <jiri@resnulli.us> wrote:

>Fri, Jan 25, 2013 at 07:37:13AM CET, jiri@resnulli.us wrote:
>>Fri, Jan 25, 2013 at 02:35:01AM CET, fubar@us.ibm.com wrote:
>>>Jiri Pirko <jiri@resnulli.us> wrote:
>>>
>>>>Makes more sense to have randomly generated address by default than to
>>>>have all zeroes. It also allows user to for example put the bond into
>>>>bridge without need to have any slaves in it.
>>>>
>>>>Also note that this changes only behaviour of bonds with no slaves. Once
>>>>the first slave device is enslaved, its address will be used (no change
>>>>here).
>
>
>Also, this is not entirely true now. Example:
>
>eth1 has 52:54:00:b8:30:0b
>
># ip link add bondx address 22:33:44:55:66:77 type bond
># ip link set eth1 master bondx
>
>Now both bondx and eth1 has 22:33:44:55:66:77
>
>Shouldn't both have 52:54:00:b8:30:0b ?

	This is the way bonding has worked for as long as I can recall.
The MAC of the first slave is assigned to the master, unless the bond
has had its MAC manually set to something prior to the first slave being
added.  If the bond's MAC has been set manually, then that MAC is used
instead of the first slave's MAC.

	Your patch doesn't appear to change that behavior, but it does
substitute a random MAC in place of the all zeroes MAC used previously
(and tests a flag to determine if the MAC has been manually set instead
of checking for the all zeroes MAC).

	I know of customers that rely on this behavior to explicitly set
the MAC of the bond (for filtering or accounting purposes).  It probably
should be documented more clearly, but I don't think it should be
changed.

	-J

---
	-Jay Vosburgh, IBM Linux Technology Center, fubar@us.ibm.com

^ permalink raw reply

* Re: [patch net-next V2] bond: have random dev address by default instead of zeroes
From: Pavel Simerda @ 2013-01-25 17:56 UTC (permalink / raw)
  To: Jay Vosburgh; +Cc: netdev, davem, andy, stephen, dcbw, Jiri Pirko
In-Reply-To: <21365.1359136387@death.nxdomain>

----- Original Message -----
> From: "Jay Vosburgh" <fubar@us.ibm.com>
> but I don't think it should be changed.

Just a short question. Is there any reason for bonding interfaces to behave differently from bridging interfaces in this respect?

Cheers,

Pavel

^ permalink raw reply

* Re: [patch net-next V2] bond: have random dev address by default instead of zeroes
From: Jiri Pirko @ 2013-01-25 18:08 UTC (permalink / raw)
  To: Jay Vosburgh; +Cc: netdev, davem, andy, stephen, psimerda, dcbw
In-Reply-To: <21365.1359136387@death.nxdomain>

Fri, Jan 25, 2013 at 06:53:07PM CET, fubar@us.ibm.com wrote:
>Jiri Pirko <jiri@resnulli.us> wrote:
>
>>Fri, Jan 25, 2013 at 07:37:13AM CET, jiri@resnulli.us wrote:
>>>Fri, Jan 25, 2013 at 02:35:01AM CET, fubar@us.ibm.com wrote:
>>>>Jiri Pirko <jiri@resnulli.us> wrote:
>>>>
>>>>>Makes more sense to have randomly generated address by default than to
>>>>>have all zeroes. It also allows user to for example put the bond into
>>>>>bridge without need to have any slaves in it.
>>>>>
>>>>>Also note that this changes only behaviour of bonds with no slaves. Once
>>>>>the first slave device is enslaved, its address will be used (no change
>>>>>here).
>>
>>
>>Also, this is not entirely true now. Example:
>>
>>eth1 has 52:54:00:b8:30:0b
>>
>># ip link add bondx address 22:33:44:55:66:77 type bond
>># ip link set eth1 master bondx
>>
>>Now both bondx and eth1 has 22:33:44:55:66:77
>>
>>Shouldn't both have 52:54:00:b8:30:0b ?
>
>	This is the way bonding has worked for as long as I can recall.
>The MAC of the first slave is assigned to the master, unless the bond
>has had its MAC manually set to something prior to the first slave being
>added.  If the bond's MAC has been set manually, then that MAC is used
>instead of the first slave's MAC.
>
>	Your patch doesn't appear to change that behavior, but it does
>substitute a random MAC in place of the all zeroes MAC used previously
>(and tests a flag to determine if the MAC has been manually set instead
>of checking for the all zeroes MAC).

Yeah, I know my patch is not changing this. I was just making sure it is
correct.

>
>	I know of customers that rely on this behavior to explicitly set
>the MAC of the bond (for filtering or accounting purposes).  It probably
>should be documented more clearly, but I don't think it should be
>changed.
>
>	-J
>
>---
>	-Jay Vosburgh, IBM Linux Technology Center, fubar@us.ibm.com
>

^ permalink raw reply

* Re: [RFC PATCH 4/4] net: mvmdio: add getter and setter for PHY addresses
From: Jason Gunthorpe @ 2013-01-25 18:16 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: thomas.petazzoni, andrew, jason, arnd, netdev, gregory.clement,
	ian.molton, linux-arm-kernel
In-Reply-To: <1359108409-4378-5-git-send-email-florian@openwrt.org>

On Fri, Jan 25, 2013 at 11:06:49AM +0100, Florian Fainelli wrote:
> This patch adds orion_mdio_{set,get}_phy_addr(.., port_number, phy_addr)
> which is a feature available in this MDIO driver to monitor a particular
> PHY address. This brings mvmdio one step closer to what is used in
> mv643x_eth.

This seems really strange.

Are you sure this should be part of the MDIO driver? Based on my docs,
this register is part of the ethernet controller HW, which
autonomously reads from the phy via MDIO.

It seems cleaner to set this register from the ethernet controller
based on the phy it is using and keep the MDIO driver purely for MDIO
bus access.

It is acceptable to overlap the device address ranges, start the
ethernet controller at 72000 and start the MDIO at 72004, the platform
bus code automatically nests them.

Jason

^ permalink raw reply

* Re: [PATCH/RFC 2/3] ethernet: add a PHY reset GPIO DT binding to sh_eth
From: Jason Gunthorpe @ 2013-01-25 18:21 UTC (permalink / raw)
  To: Guennadi Liakhovetski
  Cc: Laurent Pinchart, linux-sh, netdev, devicetree-discuss,
	Magnus Damm, Simon Horman, linux-arm-kernel
In-Reply-To: <Pine.LNX.4.64.1301251127460.17518@axis700.grange>

On Fri, Jan 25, 2013 at 11:34:55AM +0100, Guennadi Liakhovetski wrote:

> > Is there no need to reset the phy at runtime ?
> 
> No idea, I'm not developing the driver, I'm just porting one specific 
> feature from one API to another with no functional changes (apart from 
> postponing setting the GPIO).

Generally Linux relies on resetting the phy via the inband MDIO method,
which is what Linux does. It is pretty much never required to reset
via the hard pin - but you do need to generate a robust reset edge on
the reset pin once after power up.

Jason

^ permalink raw reply

* Re: [patch net-next V2] bond: have random dev address by default instead of zeroes
From: Jay Vosburgh @ 2013-01-25 18:31 UTC (permalink / raw)
  To: Pavel Simerda; +Cc: netdev, davem, andy, stephen, dcbw, Jiri Pirko
In-Reply-To: <542237717.4200599.1359136587903.JavaMail.root@redhat.com>

Pavel Simerda <psimerda@redhat.com> wrote:

>----- Original Message -----
>> From: "Jay Vosburgh" <fubar@us.ibm.com>
>> but I don't think it should be changed.
>
>Just a short question. Is there any reason for bonding interfaces to
>behave differently from bridging interfaces in this respect?

	To clarify, what I don't think should change is that a manually
set MAC on the bonding master should override the automatic copy of the
first slave's MAC to the bonding master.  The fail_over_mac active and
follow settings are an exception to this, but those are special cases
for unusual network hardware.

	As for the random MAC vs. zero MAC, I've always thought that the
all zero MAC was a clear indicator that the device (the bonding master
in this case) was not in a usable state (in the sense that it could not
send or receive actual traffic).  It's not a really big deal, though, so
if the trend these days is for everything to have a MAC all the time,
that's fine, as long as doing so doesn't break anything.

	I think the patch under discussion should be fine with the
addition of the last notifier call previously discussed.  Some
documentation updates would be nice, too.

	-J

---
	-Jay Vosburgh, IBM Linux Technology Center, fubar@us.ibm.com

^ permalink raw reply

* Web10g TCP statistics patch - mainlining into kernel?
From: Valdis Kletnieks @ 2013-01-25 18:31 UTC (permalink / raw)
  To: netdev, linux-kernel, web10g-user

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

I had a user who's working on tuning high-performance network file systems what
the chances of upstreaming the Web10G patch to provide the RFC4898 TCP Extended
Statistics MIB via netlink.

Yes, it's a tad on the intrusive side, and there's performance costs attached -
but so are a lot of *other* things that people use all the time for kernel
debugging, and it's a zero-hit thing for people who don't choose to configure
it into their kernel.  The added detailed status available from this will be
useful for people who are doing tuning and development (consider how useful
this would have been for the people who wrote the codel line discipline as part
of the bufferbloat project).

I'm willing to do the not-so-heavy lifting of getting the existing patch
cleaned up to upstream standards and sheparded through the process, if there's
any interest at all....


[-- Attachment #2: Type: application/pgp-signature, Size: 865 bytes --]

^ permalink raw reply

* [PATCH] bonding: unset primary slave via sysfs
From: Milos Vyletel @ 2013-01-25 18:41 UTC (permalink / raw)
  To: netdev

When bonding module is loaded with primary parameter and one decides to unset primary slave using sysfs these settings are not preserved during bond device restart.  Primary slave is only unset once and it's not remembered in bond->params structure. Below is example of recreation. Fix is simple one-liner

# grep OPTS /etc/sysconfig/network-scripts/ifcfg-bond0
BONDING_OPTS="mode=active-backup miimon=100 primary=eth01"
# grep "Primary Slave" /proc/net/bonding/bond0 
Primary Slave: eth01 (primary_reselect always)

# echo "" > /sys/class/net/bond0/bonding/primary
# grep "Primary Slave" /proc/net/bonding/bond0 
Primary Slave: None

# sed -i -e 's/primary=eth01//' /etc/sysconfig/network-scripts/ifcfg-bond0
# grep OPTS /etc/sysconfig/network-scripts/ifcfg-bond 
BONDING_OPTS="mode=active-backup miimon=100 "
# ifdown bond0 && ifup bond0

without patch:
# grep "Primary Slave" /proc/net/bonding/bond0 
Primary Slave: eth01 (primary_reselect always)

with patch:
# grep "Primary Slave" /proc/net/bonding/bond0 
Primary Slave: None


---
 drivers/net/bonding/bond_sysfs.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c
index 1877ed7..50f7eef 100644
--- a/drivers/net/bonding/bond_sysfs.c
+++ b/drivers/net/bonding/bond_sysfs.c
@@ -1053,6 +1053,7 @@ static ssize_t bonding_store_primary(struct device *d,
                pr_info("%s: Setting primary slave to None.\n",
                        bond->dev->name);
                bond->primary_slave = NULL;
+               memset(bond->params.primary, '\0', sizeof(bond->params.primary));
                bond_select_active_slave(bond);
                goto out;
        }
-- 
1.8.1

^ permalink raw reply related

* Re: [Web10g-user] Web10g TCP statistics patch - mainlining into kernel?
From: Valdis.Kletnieks @ 2013-01-25 18:57 UTC (permalink / raw)
  To: Dominic Hamon; +Cc: netdev, linux-kernel, web10g-user
In-Reply-To: <CAO1dsSdQJDKZ+zzCaLgge9wqiNaJFzPWWBLjRkMEswLVOOd0qA@mail.gmail.com>

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

On Fri, 25 Jan 2013 10:38:59 -0800, Dominic Hamon said:
> Hello Valdis
>
> I actually just finished patching a fork from the kernel github repo here:
> https://github.com/dominic-mlab/linux with a view to pushing it up. I
> haven't pushed a patch upstream before, so any guidance is welcome.

A quick browse over that git repo looks like it's unfortunately a tad
busticated - you've apparently got development on the 'master' branch, instead
of starting a separate branch.  This effectively means that it can't be easily
pulled upstream.  Fortunately, you only have one commit against it so
far, so you can probably recover by rejecting that commit so you're back
to a Linus tree, and then create a branch and do subsequent development there.

Question for the netdev people - you prefer pull requests based off
a Linus tree, or linux-next, davem/(net,net-next), or some other tree?


[-- Attachment #2: Type: application/pgp-signature, Size: 865 bytes --]

^ permalink raw reply

* Re: [Web10g-user] Web10g TCP statistics patch - mainlining into kernel?
From: rapier @ 2013-01-25 19:34 UTC (permalink / raw)
  To: Valdis.Kletnieks; +Cc: web10g-user, netdev, linux-kernel
In-Reply-To: <18855.1359138716@turing-police.cc.vt.edu>

Hi,

My name is Chris Rapier and I'm on the Web10G dev team. We are 
interested in moving this into consideration for the mainline Linux 
kernel, in fact it's the primary goal of this project. We haven't 
brought this to the linux kernel community as of yet as we've not 
completed the quantification of performance/memory impact versus a 
vanilla baseline as of yet. Including the KIS we also have to test the 
impact the DKLM imposes (taking into account measurement granularity, 
number of concurrent connections, maximum throughput for a single 
stream, etc). Then we need to compare that against Web100 and write a 
paper. We're looking at around a 2 month time frame for that.

That being said, we welcome any and all insight and help on this that we 
can get from the community. Our desire to get the tests and paper worked 
out before bringing it to the kernel community was to simply make sure 
we would be able to answer any questions that might come up. 
Additionally, if you have any metrics of the impact of the KIS, DKLM, or 
any combination thereof we'd love to see them. The more data the better 
(for some definitions of better).

I and the rest of the development team are more than happy to answer any 
questions, address concerns, explain our thinking, discuss possible 
applications for this data, etc with anyone interested.

The web100-user list is probably the best way (for us at least) to do 
this. You do need to subscribe to post at 
https://lists.psc.edu/mailman/listinfo/web10g-user but I'll do my best 
to add any relevant posts that get caught up in the filter.

Thanks for your interest and I look forward to talking to anyone 
interested in our work.

Chris Rapier
Pittsburgh Supercomputing Center



On 1/25/13 1:31 PM, Valdis Kletnieks wrote:
> I had a user who's working on tuning high-performance network file systems what
> the chances of upstreaming the Web10G patch to provide the RFC4898 TCP Extended
> Statistics MIB via netlink.
>
> Yes, it's a tad on the intrusive side, and there's performance costs attached -
> but so are a lot of *other* things that people use all the time for kernel
> debugging, and it's a zero-hit thing for people who don't choose to configure
> it into their kernel.  The added detailed status available from this will be
> useful for people who are doing tuning and development (consider how useful
> this would have been for the people who wrote the codel line discipline as part
> of the bufferbloat project).
>
> I'm willing to do the not-so-heavy lifting of getting the existing patch
> cleaned up to upstream standards and sheparded through the process, if there's
> any interest at all....
>
>
>
> _______________________________________________
> Web10g-user mailing list
> Web10g-user@web10g.org
> https://lists.psc.edu/mailman/listinfo/web10g-user
>
> To UNSUBSCRIBE visit https://lists.psc.edu/mailman/unsubscribe/web10g-user
>

^ permalink raw reply

* Re: [patch net-next V2] bond: have random dev address by default instead of zeroes
From: Pavel Simerda @ 2013-01-25 19:42 UTC (permalink / raw)
  To: Jay Vosburgh; +Cc: netdev, davem, andy, stephen, dcbw, Jiri Pirko
In-Reply-To: <22106.1359138692@death.nxdomain>

----- Original Message -----
> From: "Jay Vosburgh" <fubar@us.ibm.com>
> To: "Pavel Simerda" <psimerda@redhat.com>
> Cc: netdev@vger.kernel.org, davem@davemloft.net, andy@greyhouse.net, stephen@networkplumber.org, dcbw@redhat.com,
> "Jiri Pirko" <jiri@resnulli.us>
> Sent: Friday, January 25, 2013 7:31:32 PM
> Subject: Re: [patch net-next V2] bond: have random dev address by default instead of zeroes
> 
> Pavel Simerda <psimerda@redhat.com> wrote:
> 
> >----- Original Message -----
> >> From: "Jay Vosburgh" <fubar@us.ibm.com>
> >> but I don't think it should be changed.
> >
> >Just a short question. Is there any reason for bonding interfaces to
> >behave differently from bridging interfaces in this respect?
> 
> 	To clarify, what I don't think should change is that a manually
> set MAC on the bonding master should override the automatic copy of
> the
> first slave's MAC to the bonding master.  The fail_over_mac active
> and
> follow settings are an exception to this, but those are special cases
> for unusual network hardware.
> 
> 	As for the random MAC vs. zero MAC, I've always thought that the
> all zero MAC was a clear indicator that the device (the bonding
> master
> in this case) was not in a usable state (in the sense that it could
> not
> send or receive actual traffic).  It's not a really big deal, though,
> so

Thanks for clarification.
> if the trend these days is for everything to have a MAC all the time,
> that's fine, as long as doing so doesn't break anything.
> 
> 	I think the patch under discussion should be fine with the
> addition of the last notifier call previously discussed.  Some
> documentation updates would be nice, too.
> 
> 	-J
> 
> ---
> 	-Jay Vosburgh, IBM Linux Technology Center, fubar@us.ibm.com
> 
> 

^ permalink raw reply

* Re: [PATCH 2/2] v2 GRE: Add segmentation offload for GRE
From: Eric Dumazet @ 2013-01-25 19:52 UTC (permalink / raw)
  To: Pravin Shelar; +Cc: netdev, jesse
In-Reply-To: <CALnjE+p0m7E7vH20M9mXuNiFG4iUpAsoyjW7ugez3ch=RdkVcw@mail.gmail.com>

On Thu, 2013-01-24 at 19:38 -0800, Pravin Shelar wrote:

> I thought you were working on the fix. If not I will post patch.

I am working on a patch, will send it shortly.

As it is a stable candidate, I did a short one.

^ permalink raw reply

* Re: [Web10g-user] Web10g TCP statistics patch - mainlining into kernel?
From: Valdis.Kletnieks @ 2013-01-25 19:56 UTC (permalink / raw)
  To: rapier; +Cc: netdev, web10g-user, linux-kernel
In-Reply-To: <5102DE61.80804@psc.edu>

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

On Fri, 25 Jan 2013 14:34:57 -0500, rapier said:

> My name is Chris Rapier and I'm on the Web10G dev team. We are
> interested in moving this into consideration for the mainline Linux
> kernel, in fact it's the primary goal of this project. We haven't
> brought this to the linux kernel community as of yet as we've not
> completed the quantification of performance/memory impact versus a
> vanilla baseline as of yet.

I already looked over the patch and it looks *fairly* sane.  Having said
that, the best way to proceed for the performance side is probably to
get some rough ballpark numbers and then get the patch into a state
that's upstream-able before doing the final measurements (because there's
actually a high likelihood that the final numbers will end up being
dependent on the exact details of the patch, plus having more eyeballs on
it from the netdev side may shake out better approaches).

Sorry if you've already done all that - I didn't see much evidence of
it from the web10g-user archives...

[-- Attachment #2: Type: application/pgp-signature, Size: 865 bytes --]

^ permalink raw reply

* Re: [RFC PATCH 4/4] net: mvmdio: add getter and setter for PHY addresses
From: Florian Fainelli @ 2013-01-25 19:58 UTC (permalink / raw)
  To: Jason Gunthorpe
  Cc: thomas.petazzoni, andrew, jason, arnd, netdev, gregory.clement,
	ian.molton, linux-arm-kernel
In-Reply-To: <20130125181629.GA7393@obsidianresearch.com>

Le 25/01/2013 19:16, Jason Gunthorpe a écrit :
> On Fri, Jan 25, 2013 at 11:06:49AM +0100, Florian Fainelli wrote:
>> This patch adds orion_mdio_{set,get}_phy_addr(.., port_number, phy_addr)
>> which is a feature available in this MDIO driver to monitor a particular
>> PHY address. This brings mvmdio one step closer to what is used in
>> mv643x_eth.
>
> This seems really strange.
>
> Are you sure this should be part of the MDIO driver? Based on my docs,
> this register is part of the ethernet controller HW, which
> autonomously reads from the phy via MDIO.

My reading of the datasheets for 88F628x and Armada 370 says that it 
actually belongs to the MDIO part of the controller (it is just below 
the SMI registers).

>
> It seems cleaner to set this register from the ethernet controller
> based on the phy it is using and keep the MDIO driver purely for MDIO
> bus access.
>
> It is acceptable to overlap the device address ranges, start the
> ethernet controller at 72000 and start the MDIO at 72004, the platform
> bus code automatically nests them.

Ok I did not think this would work, but I kind of prefer that too.
--
Florian

^ permalink raw reply

* Re: [patch net-next V2] bond: have random dev address by default instead of zeroes
From: Jiri Pirko @ 2013-01-25 20:00 UTC (permalink / raw)
  To: Jay Vosburgh; +Cc: Pavel Simerda, netdev, davem, andy, stephen, dcbw
In-Reply-To: <22106.1359138692@death.nxdomain>

Fri, Jan 25, 2013 at 07:31:32PM CET, fubar@us.ibm.com wrote:
>Pavel Simerda <psimerda@redhat.com> wrote:
>
>>----- Original Message -----
>>> From: "Jay Vosburgh" <fubar@us.ibm.com>
>>> but I don't think it should be changed.
>>
>>Just a short question. Is there any reason for bonding interfaces to
>>behave differently from bridging interfaces in this respect?
>
>	To clarify, what I don't think should change is that a manually
>set MAC on the bonding master should override the automatic copy of the
>first slave's MAC to the bonding master.  The fail_over_mac active and
>follow settings are an exception to this, but those are special cases
>for unusual network hardware.
>
>	As for the random MAC vs. zero MAC, I've always thought that the
>all zero MAC was a clear indicator that the device (the bonding master
>in this case) was not in a usable state (in the sense that it could not
>send or receive actual traffic).  It's not a really big deal, though, so
>if the trend these days is for everything to have a MAC all the time,
>that's fine, as long as doing so doesn't break anything.
>
>	I think the patch under discussion should be fine with the
>addition of the last notifier call previously discussed.  Some
>documentation updates would be nice, too.

Will do :)

>
>	-J
>
>---
>	-Jay Vosburgh, IBM Linux Technology Center, fubar@us.ibm.com
>
>--
>To unsubscribe from this list: send the line "unsubscribe netdev" in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [Web10g-user] Web10g TCP statistics patch - mainlining into kernel?
From: rapier @ 2013-01-25 20:08 UTC (permalink / raw)
  To: Valdis.Kletnieks; +Cc: netdev, web10g-user, linux-kernel
In-Reply-To: <23149.1359143784@turing-police.cc.vt.edu>



On 1/25/13 2:56 PM, Valdis.Kletnieks@vt.edu wrote:

> I already looked over the patch and it looks *fairly* sane.  Having said
> that, the best way to proceed for the performance side is probably to
> get some rough ballpark numbers and then get the patch into a state
> that's upstream-able before doing the final measurements (because there's
> actually a high likelihood that the final numbers will end up being
> dependent on the exact details of the patch, plus having more eyeballs on
> it from the netdev side may shake out better approaches).
 >
> Sorry if you've already done all that - I didn't see much evidence of
> it from the web10g-user archives...

The user side of the list has been pretty quiet to be sure. Most of the 
discussion happens internal to the team. The primary KIS developer is 
out the office until next week but I'll try to make sure he addresses 
this as soon as he can. I agree entirely with the more eyes approach and 
none of us have a lot of ego sunk into the details of the code in and of 
itself. As researchers, more than anything else, we want the concept 
moved forward. We believe, strongly, that having these metrics in the 
mainline can really do a lot to help the entire user community and spur 
some really neat development.

Chris

^ permalink raw reply

* HELLO
From: thomas Kurlick @ 2013-01-25 20:12 UTC (permalink / raw)


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



[-- Attachment #2: Col. Thomas Kurlick.pdf --]
[-- Type: application/pdf, Size: 171059 bytes --]

^ permalink raw reply

* brcm WARN() on v3.7.2
From: Felipe Balbi @ 2013-01-25 20:23 UTC (permalink / raw)
  To: Pieter-Paul Giesberts, Hauke Mehrtens, linux-wireless,
	brcm80211-dev-list, netdev

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

Hi folks,

I'm running Fedora 18 with v3.7.2 on her MacBookAir 11" and it turns out
that brcm is acting out, see below full dmesg. Any tips ? Is this fixed
already ?

cheers

[    0.000000] Initializing cgroup subsys cpuset
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Linux version 3.7.2-204.fc18.x86_64 (mockbuild@bkernel01.phx2.fedoraproject.org) (gcc version 4.7.2 20121109 (Red Hat 4.7.2-8) (GCC) ) #1 SMP Wed Jan 16 16:22:52 UTC 2013
[    0.000000] Command line: BOOT_IMAGE=/vmlinuz-3.7.2-204.fc18.x86_64 root=/dev/mapper/fedora-root ro rd.lvm.lv=fedora/swap rd.md=0 rd.dm=0 rd.luks=0 vconsole.keymap=us rd.lvm.lv=fedora/root rhgb quiet LANG=en_US.UTF-8
[    0.000000] e820: BIOS-provided physical RAM map:
[    0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000008efff] usable
[    0.000000] BIOS-e820: [mem 0x000000000008f000-0x000000000008ffff] ACPI NVS
[    0.000000] BIOS-e820: [mem 0x0000000000090000-0x000000000009ffff] usable
[    0.000000] BIOS-e820: [mem 0x0000000000100000-0x00000000aeffffff] usable
[    0.000000] BIOS-e820: [mem 0x00000000af000000-0x00000000beffffff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000bf000000-0x00000000bf718fff] usable
[    0.000000] BIOS-e820: [mem 0x00000000bf719000-0x00000000bf938fff] ACPI NVS
[    0.000000] BIOS-e820: [mem 0x00000000bf939000-0x00000000bf953fff] usable
[    0.000000] BIOS-e820: [mem 0x00000000bf954000-0x00000000bf96afff] ACPI data
[    0.000000] BIOS-e820: [mem 0x00000000bf96b000-0x00000000bf96dfff] usable
[    0.000000] BIOS-e820: [mem 0x00000000bf96e000-0x00000000bf99afff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000bf99b000-0x00000000bf9affff] usable
[    0.000000] BIOS-e820: [mem 0x00000000bf9b0000-0x00000000bf9dafff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000bf9db000-0x00000000bfef8fff] usable
[    0.000000] BIOS-e820: [mem 0x00000000bfef9000-0x00000000bfefffff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000d3200000-0x00000000d3200fff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000ffc00000-0x00000000ffffffff] reserved
[    0.000000] BIOS-e820: [mem 0x0000000100000000-0x000000013fffffff] usable
[    0.000000] e820: update [mem 0xae8df018-0xae8edc57] usable ==> usable
[    0.000000] extended physical RAM map:
[    0.000000] reserve setup_data: [mem 0x0000000000000000-0x000000000008efff] usable
[    0.000000] reserve setup_data: [mem 0x000000000008f000-0x000000000008ffff] ACPI NVS
[    0.000000] reserve setup_data: [mem 0x0000000000090000-0x000000000009ffff] usable
[    0.000000] reserve setup_data: [mem 0x0000000000100000-0x00000000ae8df017] usable
[    0.000000] reserve setup_data: [mem 0x00000000ae8df018-0x00000000ae8edc57] usable
[    0.000000] reserve setup_data: [mem 0x00000000ae8edc58-0x00000000aeffffff] usable
[    0.000000] reserve setup_data: [mem 0x00000000af000000-0x00000000beffffff] reserved
[    0.000000] reserve setup_data: [mem 0x00000000bf000000-0x00000000bf718fff] usable
[    0.000000] reserve setup_data: [mem 0x00000000bf719000-0x00000000bf938fff] ACPI NVS
[    0.000000] reserve setup_data: [mem 0x00000000bf939000-0x00000000bf953fff] usable
[    0.000000] reserve setup_data: [mem 0x00000000bf954000-0x00000000bf96afff] ACPI data
[    0.000000] reserve setup_data: [mem 0x00000000bf96b000-0x00000000bf96dfff] usable
[    0.000000] reserve setup_data: [mem 0x00000000bf96e000-0x00000000bf99afff] reserved
[    0.000000] reserve setup_data: [mem 0x00000000bf99b000-0x00000000bf9affff] usable
[    0.000000] reserve setup_data: [mem 0x00000000bf9b0000-0x00000000bf9dafff] reserved
[    0.000000] reserve setup_data: [mem 0x00000000bf9db000-0x00000000bfef8fff] usable
[    0.000000] reserve setup_data: [mem 0x00000000bfef9000-0x00000000bfefffff] reserved
[    0.000000] reserve setup_data: [mem 0x00000000d3200000-0x00000000d3200fff] reserved
[    0.000000] reserve setup_data: [mem 0x00000000ffc00000-0x00000000ffffffff] reserved
[    0.000000] reserve setup_data: [mem 0x0000000100000000-0x000000013fffffff] usable
[    0.000000] NX (Execute Disable) protection: active
[    0.000000] efi: EFI v1.10 by Apple
[    0.000000] efi:  ACPI=0xbf96a000  ACPI 2.0=0xbf96a014  SMBIOS=0xbf71a000 
[    0.000000] efi: mem00: type=7, attr=0xf, range=[0x0000000000000000-0x000000000008f000) (0MB)
[    0.000000] efi: mem01: type=10, attr=0xf, range=[0x000000000008f000-0x0000000000090000) (0MB)
[    0.000000] efi: mem02: type=2, attr=0xf, range=[0x0000000000090000-0x0000000000092000) (0MB)
[    0.000000] efi: mem03: type=7, attr=0xf, range=[0x0000000000092000-0x00000000000a0000) (0MB)
[    0.000000] efi: mem04: type=7, attr=0xf, range=[0x0000000000100000-0x0000000001000000) (15MB)
[    0.000000] efi: mem05: type=2, attr=0xf, range=[0x0000000001000000-0x00000000023c9000) (19MB)
[    0.000000] efi: mem06: type=7, attr=0xf, range=[0x00000000023c9000-0x000000003e17a000) (957MB)
[    0.000000] efi: mem07: type=2, attr=0xf, range=[0x000000003e17a000-0x0000000040000000) (30MB)
[    0.000000] efi: mem08: type=7, attr=0xf, range=[0x0000000040000000-0x0000000081b94000) (1051MB)
[    0.000000] efi: mem09: type=2, attr=0xf, range=[0x0000000081b94000-0x00000000acf9e000) (692MB)
[    0.000000] efi: mem10: type=7, attr=0xf, range=[0x00000000acf9e000-0x00000000acfa2000) (0MB)
[    0.000000] efi: mem11: type=4, attr=0xf, range=[0x00000000acfa2000-0x00000000acfa6000) (0MB)
[    0.000000] efi: mem12: type=2, attr=0xf, range=[0x00000000acfa6000-0x00000000ad146000) (1MB)
[    0.000000] efi: mem13: type=4, attr=0xf, range=[0x00000000ad146000-0x00000000ae856000) (23MB)
[    0.000000] efi: mem14: type=7, attr=0xf, range=[0x00000000ae856000-0x00000000ae8df000) (0MB)
[    0.000000] efi: mem15: type=2, attr=0xf, range=[0x00000000ae8df000-0x00000000ae8ee000) (0MB)
[    0.000000] efi: mem16: type=4, attr=0xf, range=[0x00000000ae8ee000-0x00000000ae96e000) (0MB)
[    0.000000] efi: mem17: type=7, attr=0xf, range=[0x00000000ae96e000-0x00000000ae96f000) (0MB)
[    0.000000] efi: mem18: type=4, attr=0xf, range=[0x00000000ae96f000-0x00000000af000000) (6MB)
[    0.000000] efi: mem19: type=4, attr=0xf, range=[0x00000000bf000000-0x00000000bf6af000) (6MB)
[    0.000000] efi: mem20: type=7, attr=0xf, range=[0x00000000bf6af000-0x00000000bf719000) (0MB)
[    0.000000] efi: mem21: type=10, attr=0xf, range=[0x00000000bf719000-0x00000000bf939000) (2MB)
[    0.000000] efi: mem22: type=7, attr=0xf, range=[0x00000000bf939000-0x00000000bf954000) (0MB)
[    0.000000] efi: mem23: type=9, attr=0xf, range=[0x00000000bf954000-0x00000000bf96b000) (0MB)
[    0.000000] efi: mem24: type=7, attr=0xf, range=[0x00000000bf96b000-0x00000000bf96e000) (0MB)
[    0.000000] efi: mem25: type=6, attr=0x800000000000000f, range=[0x00000000bf96e000-0x00000000bf99b000) (0MB)
[    0.000000] efi: mem26: type=7, attr=0xf, range=[0x00000000bf99b000-0x00000000bf9b0000) (0MB)
[    0.000000] efi: mem27: type=5, attr=0x800000000000000f, range=[0x00000000bf9b0000-0x00000000bf9db000) (0MB)
[    0.000000] efi: mem28: type=7, attr=0xf, range=[0x00000000bf9db000-0x00000000bfa64000) (0MB)
[    0.000000] efi: mem29: type=3, attr=0xf, range=[0x00000000bfa64000-0x00000000bfd5f000) (2MB)
[    0.000000] efi: mem30: type=7, attr=0xf, range=[0x00000000bfd5f000-0x00000000bfdb8000) (0MB)
[    0.000000] efi: mem31: type=1, attr=0xf, range=[0x00000000bfdb8000-0x00000000bfeef000) (1MB)
[    0.000000] efi: mem32: type=7, attr=0xf, range=[0x00000000bfeef000-0x00000000bfef9000) (0MB)
[    0.000000] efi: mem33: type=0, attr=0xf, range=[0x00000000bfef9000-0x00000000bfeff000) (0MB)
[    0.000000] efi: mem34: type=6, attr=0x800000000000000f, range=[0x00000000bfeff000-0x00000000bff00000) (0MB)
[    0.000000] efi: mem35: type=7, attr=0xf, range=[0x0000000100000000-0x0000000140000000) (1024MB)
[    0.000000] efi: mem36: type=0, attr=0x8000000000000000, range=[0x00000000af000000-0x00000000bf000000) (256MB)
[    0.000000] efi: mem37: type=11, attr=0x8000000000000000, range=[0x00000000d3200000-0x00000000d3201000) (0MB)
[    0.000000] efi: mem38: type=11, attr=0x8000000000000000, range=[0x00000000ffc00000-0x00000000ffc80000) (0MB)
[    0.000000] efi: mem39: type=11, attr=0x8000000000000000, range=[0x00000000ffc80000-0x00000000ffca8000) (0MB)
[    0.000000] efi: mem40: type=11, attr=0x8000000000000000, range=[0x00000000ffca8000-0x00000000ffcca000) (0MB)
[    0.000000] efi: mem41: type=11, attr=0x8000000000000000, range=[0x00000000ffcca000-0x00000000ffffc000) (3MB)
[    0.000000] efi: mem42: type=11, attr=0x8000000000000000, range=[0x00000000ffffc000-0x0000000100000000) (0MB)
[    0.000000] DMI 2.4 present.
[    0.000000] DMI: Apple Inc. MacBookAir3,1/Mac-942452F5819B1C1B, BIOS    MBA31.88Z.0061.B07.1201241641 01/24/12
[    0.000000] e820: update [mem 0x00000000-0x0000ffff] usable ==> reserved
[    0.000000] e820: remove [mem 0x000a0000-0x000fffff] usable
[    0.000000] No AGP bridge found
[    0.000000] e820: last_pfn = 0x140000 max_arch_pfn = 0x400000000
[    0.000000] MTRR default type: write-back
[    0.000000] MTRR fixed ranges enabled:
[    0.000000]   00000-9FFFF write-back
[    0.000000]   A0000-FFFFF uncachable
[    0.000000] MTRR variable ranges enabled:
[    0.000000]   0 base 0C0000000 mask FC0000000 uncachable
[    0.000000]   1 base 0BFF00000 mask FFFF00000 uncachable
[    0.000000]   2 disabled
[    0.000000]   3 disabled
[    0.000000]   4 disabled
[    0.000000]   5 disabled
[    0.000000]   6 disabled
[    0.000000]   7 disabled
[    0.000000] x86 PAT enabled: cpu 0, old 0x7040600070406, new 0x7010600070106
[    0.000000] e820: last_pfn = 0xbfef9 max_arch_pfn = 0x400000000
[    0.000000] initial memory mapped: [mem 0x00000000-0x1fffffff]
[    0.000000] Base memory trampoline at [ffff880000099000] 99000 size 24576
[    0.000000] init_memory_mapping: [mem 0x00000000-0xbfef8fff]
[    0.000000]  [mem 0x00000000-0xbfdfffff] page 2M
[    0.000000]  [mem 0xbfe00000-0xbfef8fff] page 4k
[    0.000000] kernel direct mapping tables up to 0xbfef8fff @ [mem 0x1fffb000-0x1fffffff]
[    0.000000] init_memory_mapping: [mem 0x100000000-0x13fffffff]
[    0.000000]  [mem 0x100000000-0x13fffffff] page 2M
[    0.000000] kernel direct mapping tables up to 0x13fffffff @ [mem 0xbfef7000-0xbfef8fff]
[    0.000000] RAMDISK: [mem 0x3e17a000-0x3fffafff]
[    0.000000] ACPI: RSDP 00000000bf96a014 00024 (v02 APPLE )
[    0.000000] ACPI: XSDT 00000000bf96a1c0 00084 (v01 APPLE   Apple00 00000061      01000013)
[    0.000000] ACPI: FACP 00000000bf968000 000F4 (v04 APPLE   Apple00 00000061 Loki 0000005F)
[    0.000000] ACPI: DSDT 00000000bf95b000 0572C (v01 APPLE  MacBookA 00030001 INTL 20061109)
[    0.000000] ACPI: FACS 00000000bf71e000 00040
[    0.000000] ACPI: HPET 00000000bf967000 00038 (v01 APPLE   Apple00 00000001 Loki 0000005F)
[    0.000000] ACPI: APIC 00000000bf966000 00068 (v01 APPLE   Apple00 00000001 Loki 0000005F)
[    0.000000] ACPI: APIC 00000000bf965000 00068 (v02 APPLE   Apple00 00000001 Loki 0000005F)
[    0.000000] ACPI: ASF! 00000000bf963000 000A5 (v32 APPLE   Apple00 00000001 Loki 0000005F)
[    0.000000] ACPI: SBST 00000000bf962000 00030 (v01 APPLE   Apple00 00000001 Loki 0000005F)
[    0.000000] ACPI: ECDT 00000000bf961000 00053 (v01 APPLE   Apple00 00000001 Loki 0000005F)
[    0.000000] ACPI: SSDT 00000000bf958000 00107 (v01 APPLE  SataAhci 00001000 INTL 20061109)
[    0.000000] ACPI: SSDT 00000000bf957000 00024 (v01 APPLE     Apple 00001000 INTL 20061109)
[    0.000000] ACPI: SSDT 00000000bf955000 0008A (v01 APPLE  NoSDCard 00001000 INTL 20061109)
[    0.000000] ACPI: SSDT 00000000bf954000 004DC (v01  APPLE    CpuPm 00003000 INTL 20061109)
[    0.000000] ACPI: MCFG 00000000bf964000 0003C (v01 APPLE   Apple00 00000001 Loki 0000005F)
[    0.000000] ACPI: BIOS bug: multiple APIC/MADT found, using 0
[    0.000000] ACPI: If "acpi_apic_instance=2" works better, notify linux-acpi@vger.kernel.org
[    0.000000] ACPI: Local APIC address 0xfee00000
[    0.000000] No NUMA configuration found
[    0.000000] Faking a node at [mem 0x0000000000000000-0x000000013fffffff]
[    0.000000] Initmem setup node 0 [mem 0x00000000-0x13fffffff]
[    0.000000]   NODE_DATA [mem 0x13ffec000-0x13fffffff]
[    0.000000]  [ffffea0000000000-ffffea0004ffffff] PMD -> [ffff88013b800000-ffff88013f5fffff] on node 0
[    0.000000] Zone ranges:
[    0.000000]   DMA      [mem 0x00010000-0x00ffffff]
[    0.000000]   DMA32    [mem 0x01000000-0xffffffff]
[    0.000000]   Normal   [mem 0x100000000-0x13fffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x00010000-0x0008efff]
[    0.000000]   node   0: [mem 0x00090000-0x0009ffff]
[    0.000000]   node   0: [mem 0x00100000-0xaeffffff]
[    0.000000]   node   0: [mem 0xbf000000-0xbf718fff]
[    0.000000]   node   0: [mem 0xbf939000-0xbf953fff]
[    0.000000]   node   0: [mem 0xbf96b000-0xbf96dfff]
[    0.000000]   node   0: [mem 0xbf99b000-0xbf9affff]
[    0.000000]   node   0: [mem 0xbf9db000-0xbfef8fff]
[    0.000000]   node   0: [mem 0x100000000-0x13fffffff]
[    0.000000] On node 0 totalpages: 982009
[    0.000000]   DMA zone: 64 pages used for memmap
[    0.000000]   DMA zone: 8 pages reserved
[    0.000000]   DMA zone: 3911 pages, LIFO batch:0
[    0.000000]   DMA32 zone: 16320 pages used for memmap
[    0.000000]   DMA32 zone: 699562 pages, LIFO batch:31
[    0.000000]   Normal zone: 4096 pages used for memmap
[    0.000000]   Normal zone: 258048 pages, LIFO batch:31
[    0.000000] tboot: non-0 tboot_addr but it is not of type E820_RESERVED
[    0.000000] ACPI: PM-Timer IO Port: 0x408
[    0.000000] ACPI: Local APIC address 0xfee00000
[    0.000000] ACPI: LAPIC (acpi_id[0x00] lapic_id[0x00] enabled)
[    0.000000] ACPI: LAPIC (acpi_id[0x01] lapic_id[0x01] enabled)
[    0.000000] ACPI: LAPIC_NMI (acpi_id[0x00] high edge lint[0x1])
[    0.000000] ACPI: LAPIC_NMI (acpi_id[0x01] high edge lint[0x1])
[    0.000000] ACPI: IOAPIC (id[0x01] address[0xfec00000] gsi_base[0])
[    0.000000] IOAPIC[0]: apic_id 1, version 17, address 0xfec00000, GSI 0-23
[    0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)
[    0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level)
[    0.000000] ACPI: IRQ0 used by override.
[    0.000000] ACPI: IRQ2 used by override.
[    0.000000] ACPI: IRQ9 used by override.
[    0.000000] Using ACPI (MADT) for SMP configuration information
[    0.000000] ACPI: HPET id: 0x10de8201 base: 0xfed00000
[    0.000000] smpboot: Allowing 2 CPUs, 0 hotplug CPUs
[    0.000000] nr_irqs_gsi: 40
[    0.000000] PM: Registered nosave memory: 000000000008f000 - 0000000000090000
[    0.000000] PM: Registered nosave memory: 00000000000a0000 - 0000000000100000
[    0.000000] PM: Registered nosave memory: 00000000ae8df000 - 00000000ae8e0000
[    0.000000] PM: Registered nosave memory: 00000000ae8ed000 - 00000000ae8ee000
[    0.000000] PM: Registered nosave memory: 00000000af000000 - 00000000bf000000
[    0.000000] PM: Registered nosave memory: 00000000bf719000 - 00000000bf939000
[    0.000000] PM: Registered nosave memory: 00000000bf954000 - 00000000bf96b000
[    0.000000] PM: Registered nosave memory: 00000000bf96e000 - 00000000bf99b000
[    0.000000] PM: Registered nosave memory: 00000000bf9b0000 - 00000000bf9db000
[    0.000000] PM: Registered nosave memory: 00000000bfef9000 - 00000000bff00000
[    0.000000] PM: Registered nosave memory: 00000000bff00000 - 00000000d3200000
[    0.000000] PM: Registered nosave memory: 00000000d3200000 - 00000000d3201000
[    0.000000] PM: Registered nosave memory: 00000000d3201000 - 00000000ffc00000
[    0.000000] PM: Registered nosave memory: 00000000ffc00000 - 0000000100000000
[    0.000000] e820: [mem 0xd3201000-0xffbfffff] available for PCI devices
[    0.000000] Booting paravirtualized kernel on bare hardware
[    0.000000] setup_percpu: NR_CPUS:128 nr_cpumask_bits:128 nr_cpu_ids:2 nr_node_ids:1
[    0.000000] PERCPU: Embedded 28 pages/cpu @ffff88013fc00000 s84288 r8192 d22208 u1048576
[    0.000000] pcpu-alloc: s84288 r8192 d22208 u1048576 alloc=1*2097152
[    0.000000] pcpu-alloc: [0] 0 1 
[    0.000000] Built 1 zonelists in Node order, mobility grouping on.  Total pages: 961521
[    0.000000] Policy zone: Normal
[    0.000000] Kernel command line: BOOT_IMAGE=/vmlinuz-3.7.2-204.fc18.x86_64 root=/dev/mapper/fedora-root ro rd.lvm.lv=fedora/swap rd.md=0 rd.dm=0 rd.luks=0 vconsole.keymap=us rd.lvm.lv=fedora/root rhgb quiet LANG=en_US.UTF-8
[    0.000000] PID hash table entries: 4096 (order: 3, 32768 bytes)
[    0.000000] __ex_table already sorted, skipping sort
[    0.000000] xsave: enabled xstate_bv 0x3, cntxt size 0x240
[    0.000000] Checking aperture...
[    0.000000] No AGP bridge found
[    0.000000] Memory: 3709948k/5242880k available (6407k kernel code, 1314844k absent, 218088k reserved, 6793k data, 1068k init)
[    0.000000] SLUB: Genslabs=15, HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
[    0.000000] Hierarchical RCU implementation.
[    0.000000] 	RCU restricting CPUs from NR_CPUS=128 to nr_cpu_ids=2.
[    0.000000] NR_IRQS:8448 nr_irqs:512 16
[    0.000000] Extended CMOS year: 2000
[    0.000000] Console: colour dummy device 80x25
[    0.000000] console [tty0] enabled
[    0.000000] allocated 16252928 bytes of page_cgroup
[    0.000000] please try 'cgroup_disable=memory' option if you don't want memory cgroups
[    0.000000] hpet clockevent registered
[    0.000000] tsc: Fast TSC calibration using PIT
[    0.000000] tsc: Detected 1596.634 MHz processor
[    0.001004] Calibrating delay loop (skipped), value calculated using timer frequency.. 3193.26 BogoMIPS (lpj=1596634)
[    0.001009] pid_max: default: 32768 minimum: 301
[    0.001037] init_memory_mapping: [mem 0xbfeff000-0xbfefffff]
[    0.001042]  [mem 0xbfeff000-0xbfefffff] page 4k
[    0.186363] Security Framework initialized
[    0.186377] SELinux:  Initializing.
[    0.186391] SELinux:  Starting in permissive mode
[    0.187046] Dentry cache hash table entries: 524288 (order: 10, 4194304 bytes)
[    0.189678] Inode-cache hash table entries: 262144 (order: 9, 2097152 bytes)
[    0.190892] Mount-cache hash table entries: 256
[    0.191244] Initializing cgroup subsys cpuacct
[    0.191248] Initializing cgroup subsys memory
[    0.191268] Initializing cgroup subsys devices
[    0.191270] Initializing cgroup subsys freezer
[    0.191272] Initializing cgroup subsys net_cls
[    0.191275] Initializing cgroup subsys blkio
[    0.191277] Initializing cgroup subsys perf_event
[    0.191321] CPU: Physical Processor ID: 0
[    0.191323] CPU: Processor Core ID: 0
[    0.191326] mce: CPU supports 6 MCE banks
[    0.191337] CPU0: Thermal monitoring enabled (TM2)
[    0.191342] process: using mwait in idle threads
[    0.191348] Last level iTLB entries: 4KB 128, 2MB 4, 4MB 4
Last level dTLB entries: 4KB 256, 2MB 0, 4MB 32
tlb_flushall_shift: -1
[    0.191512] Freeing SMP alternatives: 24k freed
[    0.193733] ACPI: Core revision 20120913
[    0.202451] ftrace: allocating 23745 entries in 93 pages
[    0.213152] ..TIMER: vector=0x30 apic1=0 pin1=2 apic2=-1 pin2=-1
[    0.223160] smpboot: CPU0: Intel(R) Core(TM)2 Duo CPU     U9600  @ 1.60GHz (fam: 06, model: 17, stepping: 0a)
[    0.224000] Performance Events: PEBS fmt0+, 4-deep LBR, Core2 events, Intel PMU driver.
[    0.224000] ... version:                2
[    0.224000] ... bit width:              40
[    0.224000] ... generic registers:      2
[    0.224000] ... value mask:             000000ffffffffff
[    0.224000] ... max period:             000000007fffffff
[    0.224000] ... fixed-purpose events:   3
[    0.224000] ... event mask:             0000000700000003
[    0.225059] smpboot: Booting Node   0, Processors  #1 OK
[    0.237029] Brought up 2 CPUs
[    0.237036] smpboot: Total of 2 processors activated (6386.53 BogoMIPS)
[    0.237171] NMI watchdog: enabled on all CPUs, permanently consumes one hw-PMU counter.
[    0.239080] devtmpfs: initialized
[    0.239236] PM: Registering ACPI NVS region [mem 0x0008f000-0x0008ffff] (4096 bytes)
[    0.239236] PM: Registering ACPI NVS region [mem 0xbf719000-0xbf938fff] (2228224 bytes)
[    0.240737] atomic64 test passed for x86-64 platform with CX8 and with SSE
[    0.240802] RTC time: 20:17:17, date: 01/25/13
[    0.240869] NET: Registered protocol family 16
[    0.241124] ACPI FADT declares the system doesn't support PCIe ASPM, so disable it
[    0.241127] ACPI: bus type pci registered
[    0.241458] PCI: MMCONFIG for domain 0000 [bus 00-02] at [mem 0xf0000000-0xf02fffff] (base 0xf0000000)
[    0.241461] PCI: not using MMCONFIG
[    0.241464] PCI: Using configuration type 1 for base access
[    0.242707] bio: create slab <bio-0> at 0
[    0.243048] ACPI: Added _OSI(Module Device)
[    0.243051] ACPI: Added _OSI(Processor Device)
[    0.243053] ACPI: Added _OSI(3.0 _SCP Extensions)
[    0.243056] ACPI: Added _OSI(Processor Aggregator Device)
[    0.244793] ACPI: EC: EC description table is found, configuring boot EC
[    0.249509] [Firmware Bug]: ACPI: BIOS _OSI(Linux) query ignored
[    0.249921] ACPI: SSDT 00000000bf71dc98 0023D (v01  APPLE  Cpu0Ist 00003000 INTL 20061109)
[    0.250313] ACPI: Dynamic OEM Table Load:
[    0.250318] ACPI: SSDT           (null) 0023D (v01  APPLE  Cpu0Ist 00003000 INTL 20061109)
[    0.250492] ACPI: SSDT 00000000bf71c618 005A6 (v01  APPLE  Cpu0Cst 00003001 INTL 20061109)
[    0.250861] ACPI: Dynamic OEM Table Load:
[    0.250865] ACPI: SSDT           (null) 005A6 (v01  APPLE  Cpu0Cst 00003001 INTL 20061109)
[    0.260266] ACPI: SSDT 00000000bf71df18 000C8 (v01  APPLE  Cpu1Ist 00003000 INTL 20061109)
[    0.260643] ACPI: Dynamic OEM Table Load:
[    0.260647] ACPI: SSDT           (null) 000C8 (v01  APPLE  Cpu1Ist 00003000 INTL 20061109)
[    0.260764] ACPI: SSDT 00000000bf71bf18 00085 (v01  APPLE  Cpu1Cst 00003000 INTL 20061109)
[    0.261139] ACPI: Dynamic OEM Table Load:
[    0.261143] ACPI: SSDT           (null) 00085 (v01  APPLE  Cpu1Cst 00003000 INTL 20061109)
[    0.270216] ACPI: Interpreter enabled
[    0.270221] ACPI: (supports S0 S3 S4 S5)
[    0.270241] ACPI: Using IOAPIC for interrupt routing
[    0.270262] PCI: MMCONFIG for domain 0000 [bus 00-02] at [mem 0xf0000000-0xf02fffff] (base 0xf0000000)
[    0.270582] PCI: MMCONFIG at [mem 0xf0000000-0xf02fffff] reserved in ACPI motherboard resources
[    0.282280] ACPI: EC: GPE = 0x57, I/O: command/status = 0x66, data = 0x62
[    0.282487] ACPI: No dock devices found.
[    0.282492] PCI: Using host bridge windows from ACPI; if necessary, use "pci=nocrs" and report a bug
[    0.282670] ACPI: PCI Root Bridge [PCI0] (domain 0000 [bus 00-ff])
[    0.282789] pci_root PNP0A08:00: [Firmware Info]: MMCONFIG for domain 0000 [bus 00-02] only partially covers this bridge
[    0.282828] PCI host bridge to bus 0000:00
[    0.282833] pci_bus 0000:00: root bus resource [bus 00-ff]
[    0.282836] pci_bus 0000:00: root bus resource [io  0x0000-0x0cf7]
[    0.282840] pci_bus 0000:00: root bus resource [io  0x0d00-0xffff]
[    0.282843] pci_bus 0000:00: root bus resource [mem 0x000a0000-0x000bffff]
[    0.282846] pci_bus 0000:00: root bus resource [mem 0x000c0000-0x000c3fff]
[    0.282849] pci_bus 0000:00: root bus resource [mem 0x000c4000-0x000c7fff]
[    0.282852] pci_bus 0000:00: root bus resource [mem 0x000c8000-0x000cbfff]
[    0.282856] pci_bus 0000:00: root bus resource [mem 0x000cc000-0x000cffff]
[    0.282859] pci_bus 0000:00: root bus resource [mem 0x000d0000-0x000d3fff]
[    0.282862] pci_bus 0000:00: root bus resource [mem 0x000d4000-0x000d7fff]
[    0.282865] pci_bus 0000:00: root bus resource [mem 0x000d8000-0x000dbfff]
[    0.282868] pci_bus 0000:00: root bus resource [mem 0x000dc000-0x000dffff]
[    0.282871] pci_bus 0000:00: root bus resource [mem 0x000e0000-0x000e3fff]
[    0.282874] pci_bus 0000:00: root bus resource [mem 0x000e4000-0x000e7fff]
[    0.282877] pci_bus 0000:00: root bus resource [mem 0x000e8000-0x000ebfff]
[    0.282880] pci_bus 0000:00: root bus resource [mem 0x000ec000-0x000effff]
[    0.282884] pci_bus 0000:00: root bus resource [mem 0x000f0000-0x000fffff]
[    0.282887] pci_bus 0000:00: root bus resource [mem 0xc0000000-0xfebfffff]
[    0.282907] pci 0000:00:00.0: [10de:0d60] type 00 class 0x060000
[    0.283039] pci 0000:00:00.1: [10de:0d68] type 00 class 0x050000
[    0.283225] pci 0000:00:01.0: [10de:0d6d] type 00 class 0x050000
[    0.283403] pci 0000:00:01.1: [10de:0d6e] type 00 class 0x050000
[    0.283581] pci 0000:00:01.2: [10de:0d6f] type 00 class 0x050000
[    0.283759] pci 0000:00:01.3: [10de:0d70] type 00 class 0x050000
[    0.283942] pci 0000:00:02.0: [10de:0d71] type 00 class 0x050000
[    0.284127] pci 0000:00:02.1: [10de:0d72] type 00 class 0x050000
[    0.284306] pci 0000:00:03.0: [10de:0d80] type 00 class 0x060100
[    0.284319] pci 0000:00:03.0: reg 10: [io  0x2100-0x21ff]
[    0.284377] pci 0000:00:03.1: [10de:0d7b] type 00 class 0x050000
[    0.284475] pci 0000:00:03.2: [10de:0d79] type 00 class 0x0c0500
[    0.284493] pci 0000:00:03.2: reg 10: [io  0x2000-0x20ff]
[    0.284503] pci 0000:00:03.2: reg 14: [mem 0xd3286000-0xd3287fff]
[    0.284525] pci 0000:00:03.2: reg 20: [io  0x2240-0x227f]
[    0.284534] pci 0000:00:03.2: reg 24: [io  0x2200-0x223f]
[    0.284576] pci 0000:00:03.2: PME# supported from D3hot D3cold
[    0.284607] pci 0000:00:03.3: [10de:0d69] type 00 class 0x050000
[    0.284826] pci 0000:00:03.4: [10de:0d7a] type 00 class 0x0b4000
[    0.284850] pci 0000:00:03.4: reg 10: [mem 0xd3200000-0xd327ffff]
[    0.285009] pci 0000:00:04.0: [10de:0d9c] type 00 class 0x0c0310
[    0.285025] pci 0000:00:04.0: reg 10: [mem 0xd328a000-0xd328afff]
[    0.285087] pci 0000:00:04.0: supports D1 D2
[    0.285090] pci 0000:00:04.0: PME# supported from D0 D1 D2 D3hot D3cold
[    0.285111] pci 0000:00:04.1: [10de:0d9d] type 00 class 0x0c0320
[    0.285129] pci 0000:00:04.1: reg 10: [mem 0xd328b100-0xd328b1ff]
[    0.285201] pci 0000:00:04.1: supports D1 D2
[    0.285204] pci 0000:00:04.1: PME# supported from D0 D1 D2 D3hot D3cold
[    0.285238] pci 0000:00:06.0: [10de:0d9c] type 00 class 0x0c0310
[    0.285253] pci 0000:00:06.0: reg 10: [mem 0xd3289000-0xd3289fff]
[    0.285315] pci 0000:00:06.0: supports D1 D2
[    0.285318] pci 0000:00:06.0: PME# supported from D0 D1 D2 D3hot D3cold
[    0.285339] pci 0000:00:06.1: [10de:0d9d] type 00 class 0x0c0320
[    0.285356] pci 0000:00:06.1: reg 10: [mem 0xd328b000-0xd328b0ff]
[    0.285429] pci 0000:00:06.1: supports D1 D2
[    0.285432] pci 0000:00:06.1: PME# supported from D0 D1 D2 D3hot D3cold
[    0.285467] pci 0000:00:08.0: [10de:0d94] type 00 class 0x040300
[    0.285485] pci 0000:00:08.0: reg 10: [mem 0xd3280000-0xd3283fff]
[    0.285560] pci 0000:00:08.0: PME# supported from D3hot D3cold
[    0.285586] pci 0000:00:0a.0: [10de:0d88] type 00 class 0x010601
[    0.285602] pci 0000:00:0a.0: reg 10: [io  0x2298-0x229f]
[    0.285611] pci 0000:00:0a.0: reg 14: [io  0x22a4-0x22a7]
[    0.285619] pci 0000:00:0a.0: reg 18: [io  0x2290-0x2297]
[    0.285628] pci 0000:00:0a.0: reg 1c: [io  0x22a0-0x22a3]
[    0.285636] pci 0000:00:0a.0: reg 20: [io  0x2280-0x228f]
[    0.285645] pci 0000:00:0a.0: reg 24: [mem 0xd3284000-0xd3285fff]
[    0.285702] pci 0000:00:0b.0: [10de:0d75] type 00 class 0x050000
[    0.285720] pci 0000:00:0b.0: reg 10: [mem 0xd3288000-0xd3288fff]
[    0.285868] pci 0000:00:15.0: [10de:0d9b] type 01 class 0x060400
[    0.286149] pci 0000:00:15.0: PME# supported from D0 D1 D2 D3hot D3cold
[    0.286217] pci 0000:00:17.0: [10de:0d76] type 01 class 0x060400
[    0.286273] pci 0000:00:17.0: PME# supported from D0 D3hot D3cold
[    0.286550] pci 0000:01:00.0: [14e4:4353] type 00 class 0x028000
[    0.286574] pci 0000:01:00.0: reg 10: [mem 0xd3100000-0xd3103fff 64bit]
[    0.286693] pci 0000:01:00.0: supports D1 D2
[    0.286696] pci 0000:01:00.0: PME# supported from D0 D3hot D3cold
[    0.286764] pci 0000:00:15.0: PCI bridge to [bus 01]
[    0.286789] pci 0000:00:15.0:   bridge window [mem 0xd3100000-0xd31fffff]
[    0.286849] pci 0000:02:00.0: [10de:08a2] type 00 class 0x030000
[    0.286866] pci 0000:02:00.0: reg 10: [mem 0xd2000000-0xd2ffffff]
[    0.286878] pci 0000:02:00.0: reg 14: [mem 0xc0000000-0xcfffffff 64bit pref]
[    0.286889] pci 0000:02:00.0: reg 1c: [mem 0xd0000000-0xd1ffffff 64bit pref]
[    0.286898] pci 0000:02:00.0: reg 24: [io  0x1000-0x107f]
[    0.286907] pci 0000:02:00.0: reg 30: [mem 0xd3000000-0xd301ffff pref]
[    0.286971] pci 0000:00:17.0: PCI bridge to [bus 02]
[    0.286977] pci 0000:00:17.0:   bridge window [io  0x1000-0x1fff]
[    0.286981] pci 0000:00:17.0:   bridge window [mem 0xd2000000-0xd30fffff]
[    0.286987] pci 0000:00:17.0:   bridge window [mem 0xc0000000-0xd1ffffff 64bit pref]
[    0.287014] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0._PRT]
[    0.287201] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.IXVE._PRT]
[    0.287336]  pci0000:00: Requesting ACPI _OSC control (0x1d)
[    0.287525]  pci0000:00: ACPI _OSC control (0x1d) granted
[    0.303734] ACPI: PCI Interrupt Link [LNK1] (IRQs *16 17 18 19 20 21 22 23)
[    0.303850] ACPI: PCI Interrupt Link [LNK2] (IRQs 16 *17 18 19 20 21 22 23)
[    0.303958] ACPI: PCI Interrupt Link [LNK3] (IRQs 16 17 *18 19 20 21 22 23)
[    0.304073] ACPI: PCI Interrupt Link [LNK4] (IRQs 16 17 18 *19 20 21 22 23)
[    0.304180] ACPI: PCI Interrupt Link [Z00J] (IRQs 16 17 18 19 20 *21 22 23)
[    0.304288] ACPI: PCI Interrupt Link [Z00K] (IRQs 16 17 18 19 20 *21 22 23)
[    0.304395] ACPI: PCI Interrupt Link [Z00L] (IRQs 16 17 18 19 20 *21 22 23)
[    0.304503] ACPI: PCI Interrupt Link [Z00M] (IRQs 16 17 18 19 20 *21 22 23)
[    0.304610] ACPI: PCI Interrupt Link [LSMB] (IRQs 16 17 18 19 20 21 *22 23)
[    0.304716] ACPI: PCI Interrupt Link [LUS0] (IRQs 16 *17 18 19 20 21 22 23)
[    0.304822] ACPI: PCI Interrupt Link [LUS2] (IRQs 16 *17 18 19 20 21 22 23)
[    0.304928] ACPI: PCI Interrupt Link [LMAC] (IRQs 16 *17 18 19 20 21 22 23)
[    0.305044] ACPI: PCI Interrupt Link [LAZA] (IRQs 16 17 18 19 *20 21 22 23)
[    0.305153] ACPI: PCI Interrupt Link [LGPU] (IRQs *16 17 18 19 20 21 22 23)
[    0.305256] ACPI: PCI Interrupt Link [LPID] (IRQs 16 17 18 19 20 21 22 23) *0, disabled.
[    0.305364] ACPI: PCI Interrupt Link [LSI0] (IRQs 16 17 *18 19 20 21 22 23)
[    0.305470] ACPI: PCI Interrupt Link [Z000] (IRQs 16 17 *18 19 20 21 22 23)
[    0.305576] ACPI: PCI Interrupt Link [Z001] (IRQs 16 17 18 19 20 21 *22 23)
[    0.305679] ACPI: PCI Interrupt Link [LPMU] (IRQs 16 17 18 19 20 21 22 23) *0, disabled.
[    0.305767] vgaarb: device added: PCI:0000:02:00.0,decodes=io+mem,owns=none,locks=none
[    0.305767] vgaarb: loaded
[    0.305767] vgaarb: bridge control possible 0000:02:00.0
[    0.305767] SCSI subsystem initialized
[    0.305767] ACPI: bus type scsi registered
[    0.305767] libata version 3.00 loaded.
[    0.305767] ACPI: bus type usb registered
[    0.305767] usbcore: registered new interface driver usbfs
[    0.305767] usbcore: registered new interface driver hub
[    0.306015] usbcore: registered new device driver usb
[    0.306060] PCI: Using ACPI for IRQ routing
[    0.306060] PCI: pci_cache_line_size set to 64 bytes
[    0.306096] e820: reserve RAM buffer [mem 0x0008f000-0x0008ffff]
[    0.306099] e820: reserve RAM buffer [mem 0xae8df018-0xafffffff]
[    0.306102] e820: reserve RAM buffer [mem 0xaf000000-0xafffffff]
[    0.306104] e820: reserve RAM buffer [mem 0xbf719000-0xbfffffff]
[    0.306107] e820: reserve RAM buffer [mem 0xbf954000-0xbfffffff]
[    0.306111] e820: reserve RAM buffer [mem 0xbf96e000-0xbfffffff]
[    0.306113] e820: reserve RAM buffer [mem 0xbf9b0000-0xbfffffff]
[    0.306116] e820: reserve RAM buffer [mem 0xbfef9000-0xbfffffff]
[    0.306243] NetLabel: Initializing
[    0.306246] NetLabel:  domain hash size = 128
[    0.306247] NetLabel:  protocols = UNLABELED CIPSOv4
[    0.306263] NetLabel:  unlabeled traffic allowed by default
[    0.306334] HPET: 4 timers in total, 0 timers will be used for per-cpu timer
[    0.306341] hpet0: at MMIO 0xfed00000, IRQs 2, 8, 31, 31
[    0.306348] hpet0: 4 comparators, 64-bit 25.000000 MHz counter
[    0.308013] Switching to clocksource hpet
[    0.317929] pnp: PnP ACPI init
[    0.317959] ACPI: bus type pnp registered
[    0.318116] pnp 00:00: [bus 00-ff]
[    0.318121] pnp 00:00: [io  0x0cf8-0x0cff]
[    0.318125] pnp 00:00: [io  0x0000-0x0cf7 window]
[    0.318128] pnp 00:00: [io  0x0d00-0xffff window]
[    0.318131] pnp 00:00: [mem 0x000a0000-0x000bffff window]
[    0.318135] pnp 00:00: [mem 0x000c0000-0x000c3fff window]
[    0.318138] pnp 00:00: [mem 0x000c4000-0x000c7fff window]
[    0.318141] pnp 00:00: [mem 0x000c8000-0x000cbfff window]
[    0.318144] pnp 00:00: [mem 0x000cc000-0x000cffff window]
[    0.318147] pnp 00:00: [mem 0x000d0000-0x000d3fff window]
[    0.318154] pnp 00:00: [mem 0x000d4000-0x000d7fff window]
[    0.318158] pnp 00:00: [mem 0x000d8000-0x000dbfff window]
[    0.318161] pnp 00:00: [mem 0x000dc000-0x000dffff window]
[    0.318164] pnp 00:00: [mem 0x000e0000-0x000e3fff window]
[    0.318167] pnp 00:00: [mem 0x000e4000-0x000e7fff window]
[    0.318170] pnp 00:00: [mem 0x000e8000-0x000ebfff window]
[    0.318173] pnp 00:00: [mem 0x000ec000-0x000effff window]
[    0.318176] pnp 00:00: [mem 0x000f0000-0x000fffff window]
[    0.318180] pnp 00:00: [mem 0xc0000000-0xfebfffff window]
[    0.318239] pnp 00:00: Plug and Play ACPI device, IDs PNP0a08 PNP0a03 (active)
[    0.318266] pnp 00:01: [mem 0x00000000-0xffffffffffffffff disabled]
[    0.318269] pnp 00:01: [mem 0xf0000000-0xf3ffffff]
[    0.318341] system 00:01: [mem 0xf0000000-0xf3ffffff] has been reserved
[    0.318347] system 00:01: Plug and Play ACPI device, IDs PNP0c02 (active)
[    0.318364] pnp 00:02: [io  0x0300-0x031f]
[    0.318382] pnp 00:02: [irq 6]
[    0.318407] pnp 00:02: Plug and Play ACPI device, IDs APP0001 (active)
[    0.318465] pnp 00:03: [io  0x0000-0x0008]
[    0.318468] pnp 00:03: [io  0x000a-0x000f]
[    0.318471] pnp 00:03: [io  0x0081-0x0083]
[    0.318474] pnp 00:03: [io  0x0087]
[    0.318477] pnp 00:03: [io  0x0089-0x008b]
[    0.318480] pnp 00:03: [io  0x008f]
[    0.318483] pnp 00:03: [io  0x00c0-0x00d1]
[    0.318486] pnp 00:03: [io  0x00d4-0x00df]
[    0.318489] pnp 00:03: [dma 4]
[    0.318520] pnp 00:03: Plug and Play ACPI device, IDs PNP0200 (active)
[    0.318593] pnp 00:04: [irq 0 disabled]
[    0.318602] pnp 00:04: [irq 8]
[    0.318605] pnp 00:04: [mem 0xfed00000-0xfed003ff]
[    0.318647] system 00:04: [mem 0xfed00000-0xfed003ff] has been reserved
[    0.318652] system 00:04: Plug and Play ACPI device, IDs PNP0103 PNP0c01 (active)
[    0.318667] pnp 00:05: [io  0x00f0-0x00f1]
[    0.318674] pnp 00:05: [irq 13]
[    0.318709] pnp 00:05: Plug and Play ACPI device, IDs PNP0c04 (active)
[    0.318853] pnp 00:06: [io  0x0400-0x047f]
[    0.318857] pnp 00:06: [io  0x0480-0x04ff]
[    0.318860] pnp 00:06: [io  0x0500-0x057f]
[    0.318863] pnp 00:06: [io  0x0580-0x05ff]
[    0.318866] pnp 00:06: [io  0x0800-0x087f]
[    0.318869] pnp 00:06: [io  0x0880-0x08ff]
[    0.318871] pnp 00:06: [io  0x0010-0x001f]
[    0.318874] pnp 00:06: [io  0x0022-0x003f]
[    0.318877] pnp 00:06: [io  0x0044-0x005f]
[    0.318880] pnp 00:06: [io  0x0063]
[    0.318883] pnp 00:06: [io  0x0065]
[    0.318886] pnp 00:06: [io  0x0067-0x006f]
[    0.318889] pnp 00:06: [io  0x0072-0x0073]
[    0.318892] pnp 00:06: [io  0x0074-0x007f]
[    0.318895] pnp 00:06: [io  0x0091-0x0093]
[    0.318901] pnp 00:06: [io  0x0097-0x009f]
[    0.318904] pnp 00:06: [io  0x00a2-0x00bf]
[    0.318907] pnp 00:06: [io  0x00e0-0x00ef]
[    0.318910] pnp 00:06: [io  0x04d0-0x04d1]
[    0.318913] pnp 00:06: [io  0x0080]
[    0.318916] pnp 00:06: [io  0x0295-0x0296]
[    0.318970] system 00:06: [io  0x0400-0x047f] has been reserved
[    0.318974] system 00:06: [io  0x0480-0x04ff] has been reserved
[    0.318977] system 00:06: [io  0x0500-0x057f] has been reserved
[    0.318981] system 00:06: [io  0x0580-0x05ff] has been reserved
[    0.318984] system 00:06: [io  0x0800-0x087f] has been reserved
[    0.318988] system 00:06: [io  0x0880-0x08ff] has been reserved
[    0.318992] system 00:06: [io  0x04d0-0x04d1] has been reserved
[    0.318996] system 00:06: [io  0x0295-0x0296] has been reserved
[    0.319011] system 00:06: Plug and Play ACPI device, IDs PNP0c02 (active)
[    0.319023] pnp 00:07: [io  0x0070-0x0077]
[    0.319055] pnp 00:07: Plug and Play ACPI device, IDs PNP0b00 (active)
[    0.324425] pnp: PnP ACPI: found 8 devices
[    0.324428] ACPI: ACPI bus type pnp unregistered
[    0.332048] pci 0000:00:15.0: PCI bridge to [bus 01]
[    0.332064] pci 0000:00:15.0:   bridge window [mem 0xd3100000-0xd31fffff]
[    0.332088] pci 0000:00:17.0: PCI bridge to [bus 02]
[    0.332091] pci 0000:00:17.0:   bridge window [io  0x1000-0x1fff]
[    0.332097] pci 0000:00:17.0:   bridge window [mem 0xd2000000-0xd30fffff]
[    0.332102] pci 0000:00:17.0:   bridge window [mem 0xc0000000-0xd1ffffff 64bit pref]
[    0.332291] ACPI: PCI Interrupt Link [Z00J] enabled at IRQ 21
[    0.332312] pci 0000:00:17.0: setting latency timer to 64
[    0.332318] pci_bus 0000:00: resource 4 [io  0x0000-0x0cf7]
[    0.332321] pci_bus 0000:00: resource 5 [io  0x0d00-0xffff]
[    0.332324] pci_bus 0000:00: resource 6 [mem 0x000a0000-0x000bffff]
[    0.332328] pci_bus 0000:00: resource 7 [mem 0x000c0000-0x000c3fff]
[    0.332331] pci_bus 0000:00: resource 8 [mem 0x000c4000-0x000c7fff]
[    0.332334] pci_bus 0000:00: resource 9 [mem 0x000c8000-0x000cbfff]
[    0.332337] pci_bus 0000:00: resource 10 [mem 0x000cc000-0x000cffff]
[    0.332340] pci_bus 0000:00: resource 11 [mem 0x000d0000-0x000d3fff]
[    0.332343] pci_bus 0000:00: resource 12 [mem 0x000d4000-0x000d7fff]
[    0.332346] pci_bus 0000:00: resource 13 [mem 0x000d8000-0x000dbfff]
[    0.332349] pci_bus 0000:00: resource 14 [mem 0x000dc000-0x000dffff]
[    0.332352] pci_bus 0000:00: resource 15 [mem 0x000e0000-0x000e3fff]
[    0.332355] pci_bus 0000:00: resource 16 [mem 0x000e4000-0x000e7fff]
[    0.332358] pci_bus 0000:00: resource 17 [mem 0x000e8000-0x000ebfff]
[    0.332361] pci_bus 0000:00: resource 18 [mem 0x000ec000-0x000effff]
[    0.332365] pci_bus 0000:00: resource 19 [mem 0x000f0000-0x000fffff]
[    0.332368] pci_bus 0000:00: resource 20 [mem 0xc0000000-0xfebfffff]
[    0.332372] pci_bus 0000:01: resource 1 [mem 0xd3100000-0xd31fffff]
[    0.332375] pci_bus 0000:02: resource 0 [io  0x1000-0x1fff]
[    0.332378] pci_bus 0000:02: resource 1 [mem 0xd2000000-0xd30fffff]
[    0.332382] pci_bus 0000:02: resource 2 [mem 0xc0000000-0xd1ffffff 64bit pref]
[    0.332438] NET: Registered protocol family 2
[    0.333708] TCP established hash table entries: 524288 (order: 11, 8388608 bytes)
[    0.338299] TCP bind hash table entries: 65536 (order: 8, 1048576 bytes)
[    0.338901] TCP: Hash tables configured (established 524288 bind 65536)
[    0.338991] TCP: reno registered
[    0.339034] UDP hash table entries: 2048 (order: 4, 65536 bytes)
[    0.339082] UDP-Lite hash table entries: 2048 (order: 4, 65536 bytes)
[    0.339247] NET: Registered protocol family 1
[    0.339587] ACPI: PCI Interrupt Link [LUS0] enabled at IRQ 17
[    0.390205] ACPI: PCI Interrupt Link [LUS2] enabled at IRQ 23
[    0.390407] ACPI: PCI Interrupt Link [Z000] enabled at IRQ 18
[    0.441195] ACPI: PCI Interrupt Link [Z001] enabled at IRQ 22
[    0.441335] PCI: CLS 256 bytes, default 64
[    0.441411] Unpacking initramfs...
[    1.302075] Freeing initrd memory: 31236k freed
[    1.320056] PCI-DMA: Using software bounce buffering for IO (SWIOTLB)
[    1.320065] software IO TLB [mem 0xa8fa2000-0xacfa1fff] (64MB) mapped at [ffff8800a8fa2000-ffff8800acfa1fff]
[    1.320866] Initialise module verification
[    1.320932] audit: initializing netlink socket (disabled)
[    1.320952] type=2000 audit(1359145038.320:1): initialized
[    1.355228] HugeTLB registered 2 MB page size, pre-allocated 0 pages
[    1.357586] VFS: Disk quotas dquot_6.5.2
[    1.357651] Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[    1.358271] msgmni has been set to 7386
[    1.358362] SELinux:  Registering netfilter hooks
[    1.359033] alg: No test for stdrng (krng)
[    1.359043] NET: Registered protocol family 38
[    1.359048] Key type asymmetric registered
[    1.359050] Asymmetric key parser 'x509' registered
[    1.359104] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
[    1.359140] io scheduler noop registered
[    1.359143] io scheduler deadline registered
[    1.359154] io scheduler cfq registered (default)
[    1.359471] pcieport 0000:00:15.0: irq 40 for MSI/MSI-X
[    1.359701] pcieport 0000:00:15.0: Signaling PME through PCIe PME interrupt
[    1.359705] pci 0000:01:00.0: Signaling PME through PCIe PME interrupt
[    1.359715] pcie_pme 0000:00:15.0:pcie01: service driver pcie_pme loaded
[    1.359735] pci_hotplug: PCI Hot Plug PCI Core version: 0.5
[    1.359759] pciehp: PCI Express Hot Plug Controller Driver version: 0.4
[    1.359762] acpiphp: ACPI Hot Plug PCI Controller Driver version: 0.5
[    1.360257] efifb: probing for efifb
[    1.361812] efifb: framebuffer at 0xc0010000, mapped to 0xffffc90001780000, using 6144k, total 6144k
[    1.361815] efifb: mode is 1366x768x32, linelength=8192, pages=1
[    1.361817] efifb: scrolling: redraw
[    1.361820] efifb: Truecolor: size=8:8:8:8, shift=24:16:8:0
[    1.361922] Console: switching to colour frame buffer device 170x48
[    1.366152] fb0: EFI VGA frame buffer device
[    1.366160] intel_idle: does not run on family 6 model 23
[    1.366244] ACPI: AC Adapter [ADP1] (on-line)
[    1.366365] input: Lid Switch as /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0D:00/input/input0
[    1.366386] ACPI: Lid Switch [LID0]
[    1.366438] input: Power Button as /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0C:00/input/input1
[    1.366443] ACPI: Power Button [PWRB]
[    1.366492] input: Sleep Button as /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0E:00/input/input2
[    1.366496] ACPI: Sleep Button [SLPB]
[    1.366568] input: Power Button as /devices/LNXSYSTM:00/LNXPWRBN:00/input/input3
[    1.366571] ACPI: Power Button [PWRF]
[    1.366803] ACPI: Requesting acpi_cpufreq
[    1.368343] Monitor-Mwait will be used to enter C-1 state
[    1.368352] Monitor-Mwait will be used to enter C-2 state
[    1.368356] Monitor-Mwait will be used to enter C-3 state
[    1.368361] tsc: Marking TSC unstable due to TSC halts in idle
[    1.368374] ACPI: acpi_idle registered with cpuidle
[    1.381106] GHES: HEST is not enabled!
[    1.381201] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
[    1.381991] Non-volatile memory driver v1.3
[    1.381994] Linux agpgart interface v0.103
[    1.383652] loop: module loaded
[    1.383736] ahci 0000:00:0a.0: version 3.0
[    1.384173] ACPI: PCI Interrupt Link [LSI0] enabled at IRQ 20
[    1.384331] ahci 0000:00:0a.0: irq 41 for MSI/MSI-X
[    1.384371] ahci 0000:00:0a.0: AHCI 0001.0300 32 slots 1 ports 3 Gbps 0x1 impl SATA mode
[    1.384377] ahci 0000:00:0a.0: flags: 64bit ncq sntf pm led pio slum part apst 
[    1.384382] ahci 0000:00:0a.0: setting latency timer to 64
[    1.384714] scsi0 : ahci
[    1.384788] ata1: SATA max UDMA/133 abar m8192@0xd3284000 port 0xd3284100 irq 41
[    1.384906] libphy: Fixed MDIO Bus: probed
[    1.384972] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    1.385026] ehci_hcd 0000:00:04.1: setting latency timer to 64
[    1.385031] ehci_hcd 0000:00:04.1: EHCI Host Controller
[    1.385149] ehci_hcd 0000:00:04.1: new USB bus registered, assigned bus number 1
[    1.385162] ehci_hcd 0000:00:04.1: debug port 1
[    1.385187] ehci_hcd 0000:00:04.1: disable lpm/ppcd for nvidia mcp89
[    1.406027] ehci_hcd 0000:00:04.1: cache line size of 256 is not supported
[    1.406047] ehci_hcd 0000:00:04.1: irq 23, io mem 0xd328b100
[    1.412025] ehci_hcd 0000:00:04.1: USB 2.0 started, EHCI 1.10
[    1.412053] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[    1.412057] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.412060] usb usb1: Product: EHCI Host Controller
[    1.412063] usb usb1: Manufacturer: Linux 3.7.2-204.fc18.x86_64 ehci_hcd
[    1.412066] usb usb1: SerialNumber: 0000:00:04.1
[    1.412210] hub 1-0:1.0: USB hub found
[    1.412216] hub 1-0:1.0: 6 ports detected
[    1.412753] ehci_hcd 0000:00:06.1: setting latency timer to 64
[    1.412758] ehci_hcd 0000:00:06.1: EHCI Host Controller
[    1.412815] ehci_hcd 0000:00:06.1: new USB bus registered, assigned bus number 2
[    1.412826] ehci_hcd 0000:00:06.1: debug port 1
[    1.412846] ehci_hcd 0000:00:06.1: disable lpm/ppcd for nvidia mcp89
[    1.433025] ehci_hcd 0000:00:06.1: cache line size of 256 is not supported
[    1.433043] ehci_hcd 0000:00:06.1: irq 22, io mem 0xd328b000
[    1.439024] ehci_hcd 0000:00:06.1: USB 2.0 started, EHCI 1.10
[    1.439043] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002
[    1.439046] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.439050] usb usb2: Product: EHCI Host Controller
[    1.439053] usb usb2: Manufacturer: Linux 3.7.2-204.fc18.x86_64 ehci_hcd
[    1.439056] usb usb2: SerialNumber: 0000:00:06.1
[    1.439187] hub 2-0:1.0: USB hub found
[    1.439193] hub 2-0:1.0: 6 ports detected
[    1.439718] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    1.439747] ohci_hcd 0000:00:04.0: setting latency timer to 64
[    1.439752] ohci_hcd 0000:00:04.0: OHCI Host Controller
[    1.439838] ohci_hcd 0000:00:04.0: new USB bus registered, assigned bus number 3
[    1.439867] ohci_hcd 0000:00:04.0: irq 17, io mem 0xd328a000
[    1.482970] ACPI: Battery Slot [BAT0] (battery present)
[    1.492037] usb usb3: New USB device found, idVendor=1d6b, idProduct=0001
[    1.492041] usb usb3: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.492044] usb usb3: Product: OHCI Host Controller
[    1.492048] usb usb3: Manufacturer: Linux 3.7.2-204.fc18.x86_64 ohci_hcd
[    1.492051] usb usb3: SerialNumber: 0000:00:04.0
[    1.492184] hub 3-0:1.0: USB hub found
[    1.492191] hub 3-0:1.0: 6 ports detected
[    1.492729] ohci_hcd 0000:00:06.0: setting latency timer to 64
[    1.492733] ohci_hcd 0000:00:06.0: OHCI Host Controller
[    1.492785] ohci_hcd 0000:00:06.0: new USB bus registered, assigned bus number 4
[    1.492810] ohci_hcd 0000:00:06.0: irq 18, io mem 0xd3289000
[    1.545038] usb usb4: New USB device found, idVendor=1d6b, idProduct=0001
[    1.545042] usb usb4: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.545045] usb usb4: Product: OHCI Host Controller
[    1.545049] usb usb4: Manufacturer: Linux 3.7.2-204.fc18.x86_64 ohci_hcd
[    1.545052] usb usb4: SerialNumber: 0000:00:06.0
[    1.545182] hub 4-0:1.0: USB hub found
[    1.545189] hub 4-0:1.0: 6 ports detected
[    1.545700] uhci_hcd: USB Universal Host Controller Interface driver
[    1.545779] usbcore: registered new interface driver usbserial
[    1.545790] usbcore: registered new interface driver usbserial_generic
[    1.545799] usbserial: USB Serial support registered for generic
[    1.545856] mousedev: PS/2 mouse device common for all mice
[    1.546127] rtc_cmos 00:07: RTC can wake from S4
[    1.546395] rtc_cmos 00:07: rtc core: registered rtc_cmos as rtc0
[    1.546448] rtc0: alarms up to one year, y3k, 242 bytes nvram, hpet irqs
[    1.546577] device-mapper: uevent: version 1.0.3
[    1.546671] device-mapper: ioctl: 4.23.0-ioctl (2012-07-25) initialised: dm-devel@redhat.com
[    1.546811] cpuidle: using governor ladder
[    1.546874] cpuidle: using governor menu
[    1.547245] EFI Variables Facility v0.08 2004-May-17
[    1.689245] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
[    1.689573] ata1.00: ACPI cmd ef/10:03:00:00:00:a0 (SET FEATURES) filtered out
[    1.689661] ata1.00: ATA-8: APPLE SSD TS128C, CJAA0201, max UDMA/100
[    1.689665] ata1.00: 236978176 sectors, multi 16: LBA48 
[    1.690034] ata1.00: ACPI cmd ef/10:03:00:00:00:a0 (SET FEATURES) filtered out
[    1.690133] ata1.00: configured for UDMA/100
[    1.690268] scsi 0:0:0:0: Direct-Access     ATA      APPLE SSD TS128C CJAA PQ: 0 ANSI: 5
[    1.690456] sd 0:0:0:0: Attached scsi generic sg0 type 0
[    1.690527] ACPI: Invalid Power Resource to register!
[    1.690563] sd 0:0:0:0: [sda] 236978176 512-byte logical blocks: (121 GB/113 GiB)
[    1.690646] sd 0:0:0:0: [sda] Write Protect is off
[    1.690650] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
[    1.690677] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    1.692724]  sda: sda1 sda2 sda3
[    1.693088] sd 0:0:0:0: [sda] Attached SCSI disk
[    1.822881] usbcore: registered new interface driver usbhid
[    1.822883] usbhid: USB HID core driver
[    1.822914] drop_monitor: Initializing network drop monitor service
[    1.823034] ip_tables: (C) 2000-2006 Netfilter Core Team
[    1.823081] TCP: cubic registered
[    1.823084] Initializing XFRM netlink socket
[    1.823239] NET: Registered protocol family 10
[    1.823461] mip6: Mobile IPv6
[    1.823465] NET: Registered protocol family 17
[    1.823861] PM: Hibernation image not present or could not be loaded.
[    1.823863] Loading module verification certificates
[    1.825422] MODSIGN: Loaded cert 'Fedora kernel signing key: 5d4d3db151807b6ebce83001a24319304d98d21f'
[    1.825440] registered taskstats version 1
[    1.826548]   Magic number: 13:688:296
[    1.826589] tty tty29: hash matches
[    1.826701] rtc_cmos 00:07: setting system clock to 2013-01-25 20:17:19 UTC (1359145039)
[    1.829590] Freeing unused kernel memory: 1068k freed
[    1.830056] Write protecting the kernel read-only data: 12288k
[    1.837216] Freeing unused kernel memory: 1776k freed
[    1.843238] Freeing unused kernel memory: 1404k freed
[    1.919162] usb 1-6: new high-speed USB device number 4 using ehci_hcd
[    2.047904] usb 1-6: New USB device found, idVendor=05ac, idProduct=850a
[    2.047913] usb 1-6: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    2.047920] usb 1-6: Product: Built-in iSight
[    2.047926] usb 1-6: Manufacturer: Apple Inc.
[    2.047932] usb 1-6: SerialNumber: CCGB1CTXMGDF9KF0
[    2.186358] systemd[1]: systemd 197 running in system mode. (+PAM +LIBWRAP +AUDIT +SELINUX +IMA +SYSVINIT +LIBCRYPTSETUP +GCRYPT +ACL +XZ)
[    2.186878] systemd[1]: Running in initial RAM disk.
[    2.187329] systemd[1]: No hostname configured.
[    2.187347] systemd[1]: Set hostname to <localhost>.
[    2.187671] systemd[1]: Initializing machine ID from random generator.
[    2.211774] systemd[1]: Starting Encrypted Volumes.
[    2.211819] systemd[1]: Reached target Encrypted Volumes.
[    2.211987] systemd[1]: Starting udev Kernel Socket.
[    2.212103] systemd[1]: Listening on udev Kernel Socket.
[    2.212245] systemd[1]: Starting udev Control Socket.
[    2.212340] systemd[1]: Listening on udev Control Socket.
[    2.212371] systemd[1]: Starting Journal Socket.
[    2.212513] systemd[1]: Listening on Journal Socket.
[    2.212550] systemd[1]: Starting dracut cmdline hook...
[    2.222357] systemd[1]: Started Load Kernel Modules.
[    2.222415] systemd[1]: Starting Journal Service...
[    2.232434] systemd[1]: Started Journal Service.
[    2.243221] systemd[1]: Starting Sockets.
[    2.243271] systemd[1]: Reached target Sockets.
[    2.243312] systemd[1]: Starting Swap.
[    2.243344] systemd[1]: Reached target Swap.
[    2.243373] systemd[1]: Starting Local File Systems.
[    2.243404] systemd[1]: Reached target Local File Systems.
[    2.495408] RPC: Registered named UNIX socket transport module.
[    2.495413] RPC: Registered udp transport module.
[    2.495415] RPC: Registered tcp transport module.
[    2.495417] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    2.522049] usb 3-3: new full-speed USB device number 2 using ohci_hcd
[    2.609510] systemd-udevd[150]: starting version 197
[    2.723061] usb 3-3: New USB device found, idVendor=05ac, idProduct=0242
[    2.723074] usb 3-3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    2.723082] usb 3-3: Product: Apple Internal Keyboard / Trackpad
[    2.723088] usb 3-3: Manufacturer: Apple Inc.
[    2.738838] input: Apple Inc. Apple Internal Keyboard / Trackpad as /devices/pci0000:00/0000:00:04.0/usb3/3-3/3-3:1.0/input/input4
[    2.738946] apple 0003:05AC:0242.0001: input,hidraw0: USB HID v1.11 Keyboard [Apple Inc. Apple Internal Keyboard / Trackpad] on usb-0000:00:04.0-3/input0
[    2.751160] apple 0003:05AC:0242.0002: hidraw1: USB HID v1.11 Device [Apple Inc. Apple Internal Keyboard / Trackpad] on usb-0000:00:04.0-3/input1
[    2.812819] [Firmware Bug]: ACPI(IGPU) defines _DOD but not _DOS
[    2.813030] ACPI: Video Device [IGPU] (multi-head: yes  rom: no  post: no)
[    2.813219] input: Video Bus as /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:2a/LNXVIDEO:00/input/input5
[    2.851173] [drm] Initialized drm 1.1.0 20060810
[    2.862539] wmi: Mapper loaded
[    2.891890] checking generic (c0010000 600000) vs hw (c0000000 10000000)
[    2.891895] fb: conflicting fb hw usage nouveaufb vs EFI VGA - removing generic driver
[    2.891920] Console: switching to colour dummy device 80x25
[    2.898579] nouveau 0000:02:00.0: setting latency timer to 64
[    2.898591] nouveau 0000:02:00.0: enabling device (0006 -> 0007)
[    2.898808] ACPI: PCI Interrupt Link [LGPU] enabled at IRQ 16
[    2.899735] nouveau  [  DEVICE][0000:02:00.0] BOOT0  : 0x0af100a2
[    2.899741] nouveau  [  DEVICE][0000:02:00.0] Chipset: MCP89 (NVAF)
[    2.899744] nouveau  [  DEVICE][0000:02:00.0] Family : NV50
[    2.907202] nouveau  [   VBIOS][0000:02:00.0] checking PRAMIN for image...
[    2.967292] nouveau  [   VBIOS][0000:02:00.0] ... appears to be valid
[    2.967297] nouveau  [   VBIOS][0000:02:00.0] using image from PRAMIN
[    2.967448] nouveau  [   VBIOS][0000:02:00.0] BIT signature found
[    2.967452] nouveau  [   VBIOS][0000:02:00.0] version 70.89.13.00
[    2.987849] nouveau  [     MXM][0000:02:00.0] no VBIOS data, nothing to do
[    3.070924] usb 3-5: new full-speed USB device number 3 using ohci_hcd
[    3.071110] nouveau  [     PFB][0000:02:00.0] RAM type: stolen system memory
[    3.071114] nouveau  [     PFB][0000:02:00.0] RAM size: 256 MiB
[    3.270052] usb 3-5: New USB device found, idVendor=0a5c, idProduct=4500
[    3.270059] usb 3-5: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    3.270062] usb 3-5: Product: BRCM2070 Hub
[    3.270066] usb 3-5: Manufacturer: Apple Inc.
[    3.273080] hub 3-5:1.0: USB hub found
[    3.276036] hub 3-5:1.0: 3 ports detected
[    3.589058] usb 3-5.1: new full-speed USB device number 4 using ohci_hcd
[    3.689046] usb 3-5.1: New USB device found, idVendor=05ac, idProduct=820a
[    3.689051] usb 3-5.1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[    3.698446] input: HID 05ac:820a as /devices/pci0000:00/0000:00:04.0/usb3/3-5/3-5.1/3-5.1:1.0/input/input6
[    3.698545] hid-generic 0003:05AC:820A.0003: input,hidraw2: USB HID v1.11 Keyboard [HID 05ac:820a] on usb-0000:00:04.0-5.1/input0
[    3.720083] nouveau W[    PCE0][0000:02:00.0] disabled, PCE0=1 to enable
[    3.720219] [TTM] Zone  kernel: Available graphics memory: 1893110 kiB
[    3.720222] [TTM] Initializing pool allocator
[    3.720228] [TTM] Initializing DMA pool allocator
[    3.722468] nouveau  [     DRM] VRAM: 256 MiB
[    3.722474] nouveau  [     DRM] GART: 512 MiB
[    3.722480] nouveau  [     DRM] BIT BIOS found
[    3.722484] nouveau  [     DRM] Bios version 70.89.13.00
[    3.722489] nouveau  [     DRM] TMDS table version 2.0
[    3.722492] nouveau  [     DRM] DCB version 4.0
[    3.722495] nouveau  [     DRM] DCB outp 00: 040001b6 0f220010
[    3.722499] nouveau  [     DRM] DCB outp 01: 020112a6 0f220010
[    3.722502] nouveau  [     DRM] DCB outp 02: 02011262 00020010
[    3.722505] nouveau  [     DRM] DCB conn 00: 00002047
[    3.722509] nouveau  [     DRM] DCB conn 01: 00101146
[    3.735376] [drm] Supports vblank timestamp caching Rev 1 (10.10.2010).
[    3.735379] [drm] No driver support for vblank timestamp query.
[    4.904369] nouveau  [     DRM] 4 available performance level(s)
[    4.904375] nouveau  [     DRM] 0: core 405MHz shader 405MHz memory 405MHz voltage 900mV
[    4.904380] nouveau  [     DRM] 1: core 450MHz shader 810MHz memory 450MHz voltage 900mV
[    4.904385] nouveau  [     DRM] 2: core 450MHz shader 810MHz memory 450MHz voltage 900mV
[    4.904389] nouveau  [     DRM] 3: core 450MHz shader 950MHz memory 450MHz voltage 900mV
[    4.904393] nouveau  [     DRM] c: core 405MHz shader 810MHz
[    4.905014] [sched_delayed] sched: RT throttling activated
[    4.906050] usb 3-5.2: new full-speed USB device number 5 using ohci_hcd
[    5.004884] nouveau  [     DRM] MM: using M2MF for buffer copies
[    5.049071] nouveau  [     DRM] allocated 1366x768 fb: 0x50000, bo ffff8801330e1400
[    5.049179] fbcon: nouveaufb (fb0) is primary device
[    5.085068] usb 3-5.2: New USB device found, idVendor=05ac, idProduct=820b
[    5.085073] usb 3-5.2: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[    5.091844] Console: switching to colour frame buffer device 170x48
[    5.094132] fb0: nouveaufb frame buffer device
[    5.094134] drm: registered panic notifier
[    5.094140] [drm] Initialized nouveau 1.1.0 20120801 for 0000:02:00.0 on minor 0
[    5.094407] input: HID 05ac:820b as /devices/pci0000:00/0000:00:04.0/usb3/3-5/3-5.2/3-5.2:1.0/input/input7
[    5.094548] hid-generic 0003:05AC:820B.0004: input,hidraw3: USB HID v1.11 Mouse [HID 05ac:820b] on usb-0000:00:04.0-5.2/input0
[    5.167041] usb 3-5.3: new full-speed USB device number 6 using ohci_hcd
[    5.232371] bio: create slab <bio-1> at 1
[    5.277056] usb 3-5.3: New USB device found, idVendor=05ac, idProduct=821b
[    5.277064] usb 3-5.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    5.277068] usb 3-5.3: Product: Bluetooth USB Host Controller
[    5.277071] usb 3-5.3: Manufacturer: Apple Inc.
[    5.323104] EXT4-fs (dm-1): mounted filesystem with ordered data mode. Opts: (null)
[    5.401812] EXT4-fs (dm-1): mounted filesystem with ordered data mode. Opts: (null)
[    5.763329] systemd-journald[55]: Received SIGTERM
[    5.885206] type=1404 audit(1359145043.558:2): enforcing=1 old_enforcing=0 auid=4294967295 ses=4294967295
[    5.943829] SELinux: 2048 avtab hash slots, 94354 rules.
[    5.966668] SELinux: 2048 avtab hash slots, 94354 rules.
[    6.259136] SELinux:  9 users, 15 roles, 4357 types, 236 bools, 1 sens, 1024 cats
[    6.259142] SELinux:  83 classes, 94354 rules
[    6.266534] SELinux:  Completing initialization.
[    6.266539] SELinux:  Setting up existing superblocks.
[    6.266548] SELinux: initialized (dev sysfs, type sysfs), uses genfs_contexts
[    6.266555] SELinux: initialized (dev rootfs, type rootfs), uses genfs_contexts
[    6.266574] SELinux: initialized (dev bdev, type bdev), uses genfs_contexts
[    6.266581] SELinux: initialized (dev proc, type proc), uses genfs_contexts
[    6.266596] SELinux: initialized (dev tmpfs, type tmpfs), uses transition SIDs
[    6.266622] SELinux: initialized (dev devtmpfs, type devtmpfs), uses transition SIDs
[    6.267748] SELinux: initialized (dev sockfs, type sockfs), uses task SIDs
[    6.267755] SELinux: initialized (dev debugfs, type debugfs), uses genfs_contexts
[    6.270178] SELinux: initialized (dev pipefs, type pipefs), uses task SIDs
[    6.270189] SELinux: initialized (dev anon_inodefs, type anon_inodefs), uses genfs_contexts
[    6.270194] SELinux: initialized (dev devpts, type devpts), uses transition SIDs
[    6.270218] SELinux: initialized (dev hugetlbfs, type hugetlbfs), uses transition SIDs
[    6.270230] SELinux: initialized (dev mqueue, type mqueue), uses transition SIDs
[    6.270240] SELinux: initialized (dev selinuxfs, type selinuxfs), uses genfs_contexts
[    6.270271] SELinux: initialized (dev sysfs, type sysfs), uses genfs_contexts
[    6.271248] SELinux: initialized (dev securityfs, type securityfs), uses genfs_contexts
[    6.271254] SELinux: initialized (dev efivarfs, type efivarfs), uses genfs_contexts
[    6.271280] SELinux: initialized (dev tmpfs, type tmpfs), uses transition SIDs
[    6.271289] SELinux: initialized (dev tmpfs, type tmpfs), uses transition SIDs
[    6.271433] SELinux: initialized (dev tmpfs, type tmpfs), uses transition SIDs
[    6.271476] SELinux: initialized (dev cgroup, type cgroup), uses genfs_contexts
[    6.271483] SELinux: initialized (dev cgroup, type cgroup), uses genfs_contexts
[    6.271496] SELinux: initialized (dev cgroup, type cgroup), uses genfs_contexts
[    6.271540] SELinux: initialized (dev cgroup, type cgroup), uses genfs_contexts
[    6.271557] SELinux: initialized (dev cgroup, type cgroup), uses genfs_contexts
[    6.271566] SELinux: initialized (dev cgroup, type cgroup), uses genfs_contexts
[    6.271572] SELinux: initialized (dev cgroup, type cgroup), uses genfs_contexts
[    6.271580] SELinux: initialized (dev cgroup, type cgroup), uses genfs_contexts
[    6.271595] SELinux: initialized (dev cgroup, type cgroup), uses genfs_contexts
[    6.271604] SELinux: initialized (dev rpc_pipefs, type rpc_pipefs), uses genfs_contexts
[    6.271621] SELinux: initialized (dev dm-1, type ext4), uses xattr
[    6.303388] type=1403 audit(1359145043.976:3): policy loaded auid=4294967295 ses=4294967295
[    6.316105] systemd[1]: Successfully loaded SELinux policy in 435ms 804us.
[    6.381883] systemd[1]: Relabelled /dev and /run in 36ms 388us.
[    6.652383] SELinux: initialized (dev autofs, type autofs), uses genfs_contexts
[    6.666772] SELinux: initialized (dev hugetlbfs, type hugetlbfs), uses transition SIDs
[    6.675341] SELinux: initialized (dev tmpfs, type tmpfs), uses transition SIDs
[    6.738960] systemd-udevd[376]: starting version 197
[    6.833189] EXT4-fs (dm-1): re-mounted. Opts: (null)
[    6.892625] SELinux: initialized (dev configfs, type configfs), uses genfs_contexts
[    6.921422] tun: Universal TUN/TAP device driver, 1.6
[    6.921426] tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>
[    7.058681] shpchp: Standard Hot Plug PCI Controller Driver version: 0.4
[    7.095517] microcode: CPU0 sig=0x1067a, pf=0x80, revision=0xa07
[    7.101008] microcode: CPU0 updated to revision 0xa0b, date = 2010-09-28
[    7.109593] bcma: bus0: Found chip with id 0xA8D8, rev 0x01 and package 0x08
[    7.109616] bcma: bus0: Core 0 found: ChipCommon (manuf 0x4BF, id 0x800, rev 0x22, class 0x0)
[    7.109634] bcma: bus0: Core 1 found: IEEE 802.11 (manuf 0x4BF, id 0x812, rev 0x17, class 0x0)
[    7.109668] bcma: bus0: Core 2 found: PCIe (manuf 0x4BF, id 0x820, rev 0x0F, class 0x0)
[    7.114302] microcode: CPU1 sig=0x1067a, pf=0x80, revision=0xa07
[    7.115009] microcode: CPU1 updated to revision 0xa0b, date = 2010-09-28
[    7.123091] microcode: Microcode Update Driver: v2.00 <tigran@aivazian.fsnet.co.uk>, Peter Oruba
[    7.159026] bcma: bus0: Bus registered
[    7.228647] snd_hda_intel 0000:00:08.0: enabling device (0000 -> 0002)
[    7.228972] ACPI: PCI Interrupt Link [LAZA] enabled at IRQ 19
[    7.229059] hda_intel: Disabling MSI
[    7.229062] hda_intel: position_fix set to 1 for device 10de:cb89
[    7.229164] snd_hda_intel 0000:00:08.0: setting latency timer to 64
[    7.241509] ALSA sound/pci/hda/hda_intel.c:1628 Enable delay in RIRB handling
[    7.263663] input: bcm5974 as /devices/pci0000:00/0000:00:04.0/usb3/3-3/3-3:1.2/input/input8
[    7.263973] usbcore: registered new interface driver bcm5974
[    7.332838] Bluetooth: Core ver 2.16
[    7.332871] NET: Registered protocol family 31
[    7.332874] Bluetooth: HCI device and connection manager initialized
[    7.332885] Bluetooth: HCI socket layer initialized
[    7.332889] Bluetooth: L2CAP socket layer initialized
[    7.332897] Bluetooth: SCO socket layer initialized
[    7.344328] usbcore: registered new interface driver btusb
[    7.351492] media: Linux media interface: v0.10
[    7.361078] Linux video capture interface: v2.00
[    7.366438] cfg80211: Calling CRDA to update world regulatory domain
[    7.385058] usb 3-5.1: USB disconnect, device number 4
[    7.385231] cfg80211: World regulatory domain updated:
[    7.385234] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[    7.385237] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[    7.385240] cfg80211:   (2457000 KHz - 2482000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
[    7.385243] cfg80211:   (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
[    7.385246] cfg80211:   (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[    7.385248] cfg80211:   (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[    7.414857] applesmc: key=322 fan=1 temp=27 index=26 acc=0 lux=0 kbd=0
[    7.423911] uvcvideo: Found UVC 1.00 device Built-in iSight (05ac:850a)
[    7.431237] input: Built-in iSight as /devices/pci0000:00/0000:00:04.1/usb1/1-6/1-6:1.0/input/input9
[    7.431554] usbcore: registered new interface driver uvcvideo
[    7.431557] USB Video Class driver (1.1.1)
[    7.459877] brcmsmac bcma0:0: mfg 4bf core 812 rev 23 class 0 irq 21
[    7.513473] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
[    7.518721] Adding 3801084k swap on /dev/mapper/fedora-swap.  Priority:-1 extents:1 across:3801084k SS
[    7.535050] usb 3-5.2: USB disconnect, device number 5
[    7.637761] ALSA sound/pci/hda/hda_auto_parser.c:318 autoconfig: line_outs=2 (0xb/0xa/0x0/0x0/0x0) type:speaker
[    7.637767] ALSA sound/pci/hda/hda_auto_parser.c:322    speaker_outs=0 (0x0/0x0/0x0/0x0/0x0)
[    7.637770] ALSA sound/pci/hda/hda_auto_parser.c:326    hp_outs=1 (0x9/0x0/0x0/0x0/0x0)
[    7.637773] ALSA sound/pci/hda/hda_auto_parser.c:327    mono: mono_out=0x0
[    7.637776] ALSA sound/pci/hda/hda_auto_parser.c:330    dig-out=0x10/0x0
[    7.637778] ALSA sound/pci/hda/hda_auto_parser.c:331    inputs:
[    7.637781] ALSA sound/pci/hda/hda_auto_parser.c:335      Mic=0xd
[    7.639461] EXT4-fs (sda2): mounted filesystem with ordered data mode. Opts: (null)
[    7.639683] SELinux: initialized (dev sda2, type ext4), uses xattr
[    7.674634] SELinux: initialized (dev sda1, type hfsplus), uses genfs_contexts
[    7.883280] input: HDA NVidia HDMI/DP,pcm=8 as /devices/pci0000:00/0000:00:08.0/sound/card0/input10
[    7.883524] input: HDA NVidia HDMI/DP,pcm=7 as /devices/pci0000:00/0000:00:08.0/sound/card0/input11
[    7.883717] input: HDA NVidia HDMI/DP,pcm=3 as /devices/pci0000:00/0000:00:08.0/sound/card0/input12
[    7.883908] input: HDA NVidia Headphone as /devices/pci0000:00/0000:00:08.0/sound/card0/input13
[    8.186825] EXT4-fs (dm-2): mounted filesystem with ordered data mode. Opts: (null)
[    8.186839] SELinux: initialized (dev dm-2, type ext4), uses xattr
[    8.382602] systemd-journald[406]: Received SIGUSR1
[    8.798596] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[    8.798601] Bluetooth: BNEP filters: protocol multicast
[    8.798614] Bluetooth: BNEP socket layer initialized
[    8.822744] Bluetooth: RFCOMM TTY layer initialized
[    8.822764] Bluetooth: RFCOMM socket layer initialized
[    8.822766] Bluetooth: RFCOMM ver 1.11
[    9.149697] Loading iSCSI transport class v2.0-870.
[    9.185557] iscsi: registered transport (tcp)
[    9.240372] ip6_tables: (C) 2000-2006 Netfilter Core Team
[    9.294356] Ebtables v2.0 registered
[    9.365221] iscsi: registered transport (iser)
[    9.400465] libcxgbi:libcxgbi_init_module: tag itt 0x1fff, 13 bits, age 0xf, 4 bits.
[    9.400471] libcxgbi:ddp_setup_host_page_size: system PAGE 4096, ddp idx 0.
[    9.508168] ieee80211 phy0: brcms_ops_bss_info_changed: qos enabled: false (implement)
[    9.508182] ieee80211 phy0: brcms_ops_config: change power-save mode: false (implement)
[    9.522696] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[    9.529471] Chelsio T3 iSCSI Driver cxgb3i v2.0.0 (Jun. 2010)
[    9.529958] iscsi: registered transport (cxgb3i)
[    9.606464] Chelsio T4 iSCSI Driver cxgb4i v0.9.1 (Aug. 2010)
[    9.607916] iscsi: registered transport (cxgb4i)
[    9.617810] nouveau W[    PCE0][0000:02:00.0] disabled, PCE0=1 to enable
[    9.643803] cnic: Broadcom NetXtreme II CNIC Driver cnic v2.5.14 (Sep 30, 2012)
[    9.651162] Broadcom NetXtreme II iSCSI Driver bnx2i v2.7.2.2 (Apr 25, 2012)
[    9.667370] iscsi: registered transport (bnx2i)
[    9.721297] nf_conntrack version 0.5.0 (16384 buckets, 65536 max)
[    9.733520] iscsi: registered transport (be2iscsi)
[    9.733526] In beiscsi_module_init, tt=ffffffffa06ed000
[   10.736366] nouveau W[    PCE0][0000:02:00.0] disabled, PCE0=1 to enable
[   12.289251] nouveau W[    PCE0][0000:02:00.0] disabled, PCE0=1 to enable
[   17.634442] wlan0: authenticate with 10:9a:dd:89:4c:84
[   17.653618] wlan0: direct probe to 10:9a:dd:89:4c:84 (try 1/3)
[   17.854059] wlan0: send auth to 10:9a:dd:89:4c:84 (try 2/3)
[   17.854544] wlan0: authenticated
[   17.856057] wlan0: associate with 10:9a:dd:89:4c:84 (try 1/3)
[   17.859052] wlan0: RX AssocResp from 10:9a:dd:89:4c:84 (capab=0x511 status=0 aid=3)
[   17.859471] ieee80211 phy0: brcmsmac: brcms_ops_bss_info_changed: associated
[   17.859483] ieee80211 phy0: brcms_ops_bss_info_changed: arp filtering: enabled true, count 0 (implement)
[   17.859490] ieee80211 phy0: brcms_ops_bss_info_changed: qos enabled: true (implement)
[   17.859516] wlan0: associated
[   17.859545] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[   17.859776] cfg80211: Calling CRDA for country: FI
[   17.877610] cfg80211: Regulatory domain changed to country: FI
[   17.877616] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[   17.877619] cfg80211:   (2402000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm)
[   17.877621] cfg80211:   (5170000 KHz - 5250000 KHz @ 40000 KHz), (N/A, 2000 mBm)
[   17.877624] cfg80211:   (5250000 KHz - 5330000 KHz @ 40000 KHz), (N/A, 2000 mBm)
[   17.877627] cfg80211:   (5490000 KHz - 5710000 KHz @ 40000 KHz), (N/A, 2700 mBm)
[   17.880113] wlan0: Limiting TX power to 30 (30 - 0) dBm as advertised by 10:9a:dd:89:4c:84
[   18.018462] ieee80211 phy0: brcms_ops_bss_info_changed: arp filtering: enabled true, count 1 (implement)
[   20.264533] cgroup: libvirtd (1226) created nested cgroup for controller "memory" which has incomplete hierarchy support. Nested cgroups may change behavior in the future.
[   20.264543] cgroup: "memory" requires setting use_hierarchy to 1 on the root.
[   20.264715] cgroup: libvirtd (1226) created nested cgroup for controller "devices" which has incomplete hierarchy support. Nested cgroups may change behavior in the future.
[   20.264817] cgroup: libvirtd (1226) created nested cgroup for controller "freezer" which has incomplete hierarchy support. Nested cgroups may change behavior in the future.
[   20.264905] cgroup: libvirtd (1226) created nested cgroup for controller "blkio" which has incomplete hierarchy support. Nested cgroups may change behavior in the future.
[   25.876145] fuse init (API version 7.20)
[   25.885175] SELinux: initialized (dev fuse, type fuse), uses genfs_contexts
[   27.411152] nouveau W[    PCE0][0000:02:00.0] disabled, PCE0=1 to enable
[   37.599098] ------------[ cut here ]------------
[   37.599163] WARNING: at drivers/net/wireless/brcm80211/brcmsmac/main.c:7993 brcms_c_wait_for_tx_completion+0x99/0xb0 [brcmsmac]()
[   37.599167] Hardware name: MacBookAir3,1
[   37.599171] Modules linked in: fuse ebtable_nat ipt_MASQUERADE nf_conntrack_netbios_ns nf_conntrack_broadcast ip6table_mangle ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 iptable_nat nf_nat_ipv4 nf_nat iptable_mangle nf_conntrack_ipv4 nf_defrag_ipv4 be2iscsi xt_conntrack nf_conntrack iscsi_boot_sysfs bnx2i cnic uio cxgb4i cxgb4 cxgb3i cxgb3 mdio libcxgbi ib_iser ebtable_filter rdma_cm ib_addr iw_cm ib_cm ebtables ip6table_filter ip6_tables ib_sa ib_mad ib_core iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi rfcomm bnep snd_hda_codec_hdmi nls_utf8 hfsplus snd_hda_codec_cirrus arc4 brcmsmac cordic brcmutil uvcvideo mac80211 videobuf2_vmalloc videobuf2_memops videobuf2_core cfg80211 videodev media btusb bluetooth joydev rfkill bcm5974 coretemp snd_hda_intel snd_hda_codec snd_hwdep snd_seq applesmc
[   37.599287]  snd_seq_device input_polldev snd_pcm bcma microcode snd_page_alloc snd_timer snd shpchp soundcore apple_bl vhost_net tun macvtap macvlan kvm_intel kvm uinput nouveau mxm_wmi wmi i2c_algo_bit drm_kms_helper ttm drm i2c_core video sunrpc
[   37.599342] Pid: 6, comm: kworker/u:0 Not tainted 3.7.2-204.fc18.x86_64 #1
[   37.599347] Call Trace:
[   37.599366]  [<ffffffff8105e67f>] warn_slowpath_common+0x7f/0xc0
[   37.599375]  [<ffffffff8105e6da>] warn_slowpath_null+0x1a/0x20
[   37.599402]  [<ffffffffa051ec99>] brcms_c_wait_for_tx_completion+0x99/0xb0 [brcmsmac]
[   37.599423]  [<ffffffffa05116bb>] brcms_ops_flush+0x3b/0x60 [brcmsmac]
[   37.599478]  [<ffffffffa04317ed>] ieee80211_mgd_probe_ap_send+0x13d/0x200 [mac80211]
[   37.599508]  [<ffffffffa03dc5ee>] ? cfg80211_cqm_rssi_notify+0x2e/0x40 [cfg80211]
[   37.599549]  [<ffffffffa042fb91>] ? ieee80211_cqm_rssi_notify+0x41/0xa0 [mac80211]
[   37.599590]  [<ffffffffa0431e5c>] ieee80211_mgd_probe_ap.part.25+0x12c/0x150 [mac80211]
[   37.599631]  [<ffffffffa0431eaa>] ieee80211_sta_monitor_work+0x2a/0x30 [mac80211]
[   37.599642]  [<ffffffff8107a487>] process_one_work+0x147/0x490
[   37.599683]  [<ffffffffa0431e80>] ? ieee80211_mgd_probe_ap.part.25+0x150/0x150 [mac80211]
[   37.599691]  [<ffffffff8107cd1e>] worker_thread+0x15e/0x450
[   37.599700]  [<ffffffff8107cbc0>] ? busy_worker_rebind_fn+0x110/0x110
[   37.599709]  [<ffffffff81081c80>] kthread+0xc0/0xd0
[   37.599716]  [<ffffffff8107a8c0>] ? rescuer_thread+0xb0/0x240
[   37.599727]  [<ffffffff81010000>] ? ftrace_raw_event_xen_mmu_flush_tlb_others+0x50/0xe0
[   37.599735]  [<ffffffff81081bc0>] ? kthread_create_on_node+0x120/0x120
[   37.599746]  [<ffffffff8163de2c>] ret_from_fork+0x7c/0xb0
[   37.599754]  [<ffffffff81081bc0>] ? kthread_create_on_node+0x120/0x120
[   37.599759] ---[ end trace c70b3d4e5e865a15 ]---
[   41.060113] nouveau W[    PCE0][0000:02:00.0] disabled, PCE0=1 to enable

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply

* [PATCH net-next 0/8] qlcnic: bug fix and feature updates
From: Jitendra Kalsaria @ 2013-01-25 20:20 UTC (permalink / raw)
  To: davem; +Cc: netdev, sony.chacko, Dept_NX_Linux_NIC_Driver, Jitendra Kalsaria

From: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>

Please apply it to net-next.

Thanks,
Jitendra

^ 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