Netdev List
 help / color / mirror / Atom feed
* [PATCH v5 2/3] VSOCK: Add vsockmon device
From: Stefan Hajnoczi @ 2017-04-21  9:10 UTC (permalink / raw)
  To: netdev
  Cc: Zhu Yanjun, Michael S. Tsirkin, Gerard Garcia, Jorgen Hansen,
	Stefan Hajnoczi
In-Reply-To: <20170421091046.5599-1-stefanha@redhat.com>

From: Gerard Garcia <ggarcia@deic.uab.cat>

Add vsockmon virtual network device that receives packets from the vsock
transports and exposes them to user space.

Based on the nlmon device.

Signed-off-by: Gerard Garcia <ggarcia@deic.uab.cat>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
v5:
 * Add vsockmon.[ch] entries in MAINTAINERS
 * checkpatch.pl fixes
v4:
 * Add explicit reserved padding field to struct af_vsockmon_hdr and
   drop __attribute__((packed)) [Michael, DaveM]
v3:
 * Fix DEFAULT_MTU macro definition [Zhu Yanjun]
 * Rename af_vsockmon_hdr->t field ->transport for clarity
 * Update .ndo_get_stats64() return type since it has changed
---
 MAINTAINERS                   |   2 +
 drivers/net/Makefile          |   1 +
 include/uapi/linux/vsockmon.h |  60 +++++++++++++++
 drivers/net/vsockmon.c        | 170 ++++++++++++++++++++++++++++++++++++++++++
 drivers/net/Kconfig           |   8 ++
 include/uapi/linux/Kbuild     |   1 +
 6 files changed, 242 insertions(+)
 create mode 100644 include/uapi/linux/vsockmon.h
 create mode 100644 drivers/net/vsockmon.c

diff --git a/MAINTAINERS b/MAINTAINERS
index 449e55f..2676f55 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -13276,9 +13276,11 @@ L:	netdev@vger.kernel.org
 S:	Maintained
 F:	include/linux/virtio_vsock.h
 F:	include/uapi/linux/virtio_vsock.h
+F:	include/uapi/linux/vsockmon.h
 F:	net/vmw_vsock/af_vsock_tap.c
 F:	net/vmw_vsock/virtio_transport_common.c
 F:	net/vmw_vsock/virtio_transport.c
+F:	drivers/net/vsockmon.c
 F:	drivers/vhost/vsock.c
 F:	drivers/vhost/vsock.h
 
diff --git a/drivers/net/Makefile b/drivers/net/Makefile
index 98ed4d9..2d54930 100644
--- a/drivers/net/Makefile
+++ b/drivers/net/Makefile
@@ -30,6 +30,7 @@ obj-$(CONFIG_GENEVE) += geneve.o
 obj-$(CONFIG_GTP) += gtp.o
 obj-$(CONFIG_NLMON) += nlmon.o
 obj-$(CONFIG_NET_VRF) += vrf.o
+obj-$(CONFIG_VSOCKMON) += vsockmon.o
 
 #
 # Networking Drivers
diff --git a/include/uapi/linux/vsockmon.h b/include/uapi/linux/vsockmon.h
new file mode 100644
index 0000000..a08b522
--- /dev/null
+++ b/include/uapi/linux/vsockmon.h
@@ -0,0 +1,60 @@
+#ifndef _UAPI_VSOCKMON_H
+#define _UAPI_VSOCKMON_H
+
+#include <linux/virtio_vsock.h>
+
+/*
+ * vsockmon is the AF_VSOCK packet capture device.  Packets captured have the
+ * following layout:
+ *
+ *   +-----------------------------------+
+ *   |           vsockmon header         |
+ *   |      (struct af_vsockmon_hdr)     |
+ *   +-----------------------------------+
+ *   |          transport header         |
+ *   | (af_vsockmon_hdr->len bytes long) |
+ *   +-----------------------------------+
+ *   |              payload              |
+ *   |       (until end of packet)       |
+ *   +-----------------------------------+
+ *
+ * The vsockmon header is a transport-independent description of the packet.
+ * It duplicates some of the information from the transport header so that
+ * no transport-specific knowledge is necessary to process packets.
+ *
+ * The transport header is useful for low-level transport-specific packet
+ * analysis.  Transport type is given in af_vsockmon_hdr->transport and
+ * transport header length is given in af_vsockmon_hdr->len.
+ *
+ * If af_vsockmon_hdr->op is AF_VSOCK_OP_PAYLOAD then the payload follows the
+ * transport header.  Other ops do not have a payload.
+ */
+
+struct af_vsockmon_hdr {
+	__le64 src_cid;
+	__le64 dst_cid;
+	__le32 src_port;
+	__le32 dst_port;
+	__le16 op;			/* enum af_vsockmon_op */
+	__le16 transport;		/* enum af_vsockmon_transport */
+	__le16 len;			/* Transport header length */
+	__u8 reserved[2];
+};
+
+enum af_vsockmon_op {
+	AF_VSOCK_OP_UNKNOWN = 0,
+	AF_VSOCK_OP_CONNECT = 1,
+	AF_VSOCK_OP_DISCONNECT = 2,
+	AF_VSOCK_OP_CONTROL = 3,
+	AF_VSOCK_OP_PAYLOAD = 4,
+};
+
+enum af_vsockmon_transport {
+	AF_VSOCK_TRANSPORT_UNKNOWN = 0,
+	AF_VSOCK_TRANSPORT_NO_INFO = 1,	/* No transport information */
+
+	/* Transport header type: struct virtio_vsock_hdr */
+	AF_VSOCK_TRANSPORT_VIRTIO = 2,
+};
+
+#endif
diff --git a/drivers/net/vsockmon.c b/drivers/net/vsockmon.c
new file mode 100644
index 0000000..7f0136f
--- /dev/null
+++ b/drivers/net/vsockmon.c
@@ -0,0 +1,170 @@
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/if_arp.h>
+#include <net/rtnetlink.h>
+#include <net/sock.h>
+#include <net/af_vsock.h>
+#include <uapi/linux/vsockmon.h>
+#include <linux/virtio_vsock.h>
+
+/* Virtio transport max packet size plus header */
+#define DEFAULT_MTU (VIRTIO_VSOCK_MAX_PKT_BUF_SIZE + \
+		     sizeof(struct af_vsockmon_hdr))
+
+struct pcpu_lstats {
+	u64 rx_packets;
+	u64 rx_bytes;
+	struct u64_stats_sync syncp;
+};
+
+static int vsockmon_dev_init(struct net_device *dev)
+{
+	dev->lstats = netdev_alloc_pcpu_stats(struct pcpu_lstats);
+	if (!dev->lstats)
+		return -ENOMEM;
+	return 0;
+}
+
+static void vsockmon_dev_uninit(struct net_device *dev)
+{
+	free_percpu(dev->lstats);
+}
+
+struct vsockmon {
+	struct vsock_tap vt;
+};
+
+static int vsockmon_open(struct net_device *dev)
+{
+	struct vsockmon *vsockmon = netdev_priv(dev);
+
+	vsockmon->vt.dev = dev;
+	vsockmon->vt.module = THIS_MODULE;
+	return vsock_add_tap(&vsockmon->vt);
+}
+
+static int vsockmon_close(struct net_device *dev)
+{
+	struct vsockmon *vsockmon = netdev_priv(dev);
+
+	return vsock_remove_tap(&vsockmon->vt);
+}
+
+static netdev_tx_t vsockmon_xmit(struct sk_buff *skb, struct net_device *dev)
+{
+	int len = skb->len;
+	struct pcpu_lstats *stats = this_cpu_ptr(dev->lstats);
+
+	u64_stats_update_begin(&stats->syncp);
+	stats->rx_bytes += len;
+	stats->rx_packets++;
+	u64_stats_update_end(&stats->syncp);
+
+	dev_kfree_skb(skb);
+
+	return NETDEV_TX_OK;
+}
+
+static void
+vsockmon_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
+{
+	int i;
+	u64 bytes = 0, packets = 0;
+
+	for_each_possible_cpu(i) {
+		const struct pcpu_lstats *vstats;
+		u64 tbytes, tpackets;
+		unsigned int start;
+
+		vstats = per_cpu_ptr(dev->lstats, i);
+
+		do {
+			start = u64_stats_fetch_begin_irq(&vstats->syncp);
+			tbytes = vstats->rx_bytes;
+			tpackets = vstats->rx_packets;
+		} while (u64_stats_fetch_retry_irq(&vstats->syncp, start));
+
+		packets += tpackets;
+		bytes += tbytes;
+	}
+
+	stats->rx_packets = packets;
+	stats->tx_packets = 0;
+
+	stats->rx_bytes = bytes;
+	stats->tx_bytes = 0;
+}
+
+static int vsockmon_is_valid_mtu(int new_mtu)
+{
+	return new_mtu >= (int)sizeof(struct af_vsockmon_hdr);
+}
+
+static int vsockmon_change_mtu(struct net_device *dev, int new_mtu)
+{
+	if (!vsockmon_is_valid_mtu(new_mtu))
+		return -EINVAL;
+
+	dev->mtu = new_mtu;
+	return 0;
+}
+
+static const struct net_device_ops vsockmon_ops = {
+	.ndo_init = vsockmon_dev_init,
+	.ndo_uninit = vsockmon_dev_uninit,
+	.ndo_open = vsockmon_open,
+	.ndo_stop = vsockmon_close,
+	.ndo_start_xmit = vsockmon_xmit,
+	.ndo_get_stats64 = vsockmon_get_stats64,
+	.ndo_change_mtu = vsockmon_change_mtu,
+};
+
+static u32 always_on(struct net_device *dev)
+{
+	return 1;
+}
+
+static const struct ethtool_ops vsockmon_ethtool_ops = {
+	.get_link = always_on,
+};
+
+static void vsockmon_setup(struct net_device *dev)
+{
+	dev->type = ARPHRD_VSOCKMON;
+	dev->priv_flags |= IFF_NO_QUEUE;
+
+	dev->netdev_ops	= &vsockmon_ops;
+	dev->ethtool_ops = &vsockmon_ethtool_ops;
+	dev->destructor	= free_netdev;
+
+	dev->features = NETIF_F_SG | NETIF_F_FRAGLIST |
+			NETIF_F_HIGHDMA | NETIF_F_LLTX;
+
+	dev->flags = IFF_NOARP;
+
+	dev->mtu = DEFAULT_MTU;
+}
+
+static struct rtnl_link_ops vsockmon_link_ops __read_mostly = {
+	.kind			= "vsockmon",
+	.priv_size		= sizeof(struct vsockmon),
+	.setup			= vsockmon_setup,
+};
+
+static __init int vsockmon_register(void)
+{
+	return rtnl_link_register(&vsockmon_link_ops);
+}
+
+static __exit void vsockmon_unregister(void)
+{
+	rtnl_link_unregister(&vsockmon_link_ops);
+}
+
+module_init(vsockmon_register);
+module_exit(vsockmon_unregister);
+
+MODULE_LICENSE("GPL v2");
+MODULE_AUTHOR("Gerard Garcia <ggarcia@deic.uab.cat>");
+MODULE_DESCRIPTION("Vsock monitoring device. Based on nlmon device.");
+MODULE_ALIAS_RTNL_LINK("vsockmon");
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 100fbdc..83a1616 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -355,6 +355,14 @@ config NET_VRF
 	  This option enables the support for mapping interfaces into VRF's. The
 	  support enables VRF devices.
 
+config VSOCKMON
+    tristate "Virtual vsock monitoring device"
+    depends on VHOST_VSOCK
+    ---help---
+     This option enables a monitoring net device for vsock sockets. It is
+     mostly intended for developers or support to debug vsock issues. If
+     unsure, say N.
+
 endif # NET_CORE
 
 config SUNGEM_PHY
diff --git a/include/uapi/linux/Kbuild b/include/uapi/linux/Kbuild
index dd9820b..9165e87 100644
--- a/include/uapi/linux/Kbuild
+++ b/include/uapi/linux/Kbuild
@@ -476,6 +476,7 @@ header-y += virtio_types.h
 header-y += virtio_vsock.h
 header-y += virtio_crypto.h
 header-y += vm_sockets.h
+header-y += vsockmon.h
 header-y += vt.h
 header-y += vtpm_proxy.h
 header-y += wait.h
-- 
2.9.3

^ permalink raw reply related

* [PATCH v5 1/3] VSOCK: Add vsockmon tap functions
From: Stefan Hajnoczi @ 2017-04-21  9:10 UTC (permalink / raw)
  To: netdev
  Cc: Zhu Yanjun, Michael S. Tsirkin, Gerard Garcia, Jorgen Hansen,
	Stefan Hajnoczi
In-Reply-To: <20170421091046.5599-1-stefanha@redhat.com>

From: Gerard Garcia <ggarcia@deic.uab.cat>

Add tap functions that can be used by the vsock transports to
deliver packets to vsockmon virtual network devices.

Signed-off-by: Gerard Garcia <ggarcia@deic.uab.cat>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
v5:
 * Change vsock_deliver_tap() API to avoid unnecessary skb creation
   [Jorgen]
 * Fix skb leak when no taps are registered [Jorgen]
 * Add af_vsock_tap.c entry in MAINTAINERS
 * checkpatch.pl fixes
v4:
 * Call synchronize_net() before module_put() [Michael]
v3:
 * Include missing <linux/module.h> header in af_vsock_tap.c
---
 MAINTAINERS                  |   1 +
 net/vmw_vsock/Makefile       |   2 +-
 include/net/af_vsock.h       |  13 +++++
 include/uapi/linux/if_arp.h  |   1 +
 net/vmw_vsock/af_vsock_tap.c | 114 +++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 130 insertions(+), 1 deletion(-)
 create mode 100644 net/vmw_vsock/af_vsock_tap.c

diff --git a/MAINTAINERS b/MAINTAINERS
index fdd5350..449e55f 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -13276,6 +13276,7 @@ L:	netdev@vger.kernel.org
 S:	Maintained
 F:	include/linux/virtio_vsock.h
 F:	include/uapi/linux/virtio_vsock.h
+F:	net/vmw_vsock/af_vsock_tap.c
 F:	net/vmw_vsock/virtio_transport_common.c
 F:	net/vmw_vsock/virtio_transport.c
 F:	drivers/vhost/vsock.c
diff --git a/net/vmw_vsock/Makefile b/net/vmw_vsock/Makefile
index bc27c70..09fc2eb 100644
--- a/net/vmw_vsock/Makefile
+++ b/net/vmw_vsock/Makefile
@@ -3,7 +3,7 @@ obj-$(CONFIG_VMWARE_VMCI_VSOCKETS) += vmw_vsock_vmci_transport.o
 obj-$(CONFIG_VIRTIO_VSOCKETS) += vmw_vsock_virtio_transport.o
 obj-$(CONFIG_VIRTIO_VSOCKETS_COMMON) += vmw_vsock_virtio_transport_common.o
 
-vsock-y += af_vsock.o vsock_addr.o
+vsock-y += af_vsock.o af_vsock_tap.o vsock_addr.o
 
 vmw_vsock_vmci_transport-y += vmci_transport.o vmci_transport_notify.o \
 	vmci_transport_notify_qstate.o
diff --git a/include/net/af_vsock.h b/include/net/af_vsock.h
index f32ed9a..f9fb566 100644
--- a/include/net/af_vsock.h
+++ b/include/net/af_vsock.h
@@ -188,4 +188,17 @@ struct sock *vsock_find_connected_socket(struct sockaddr_vm *src,
 void vsock_remove_sock(struct vsock_sock *vsk);
 void vsock_for_each_connected_socket(void (*fn)(struct sock *sk));
 
+/**** TAP ****/
+
+struct vsock_tap {
+	struct net_device *dev;
+	struct module *module;
+	struct list_head list;
+};
+
+int vsock_init_tap(void);
+int vsock_add_tap(struct vsock_tap *vt);
+int vsock_remove_tap(struct vsock_tap *vt);
+void vsock_deliver_tap(struct sk_buff *build_skb(void *opaque), void *opaque);
+
 #endif /* __AF_VSOCK_H__ */
diff --git a/include/uapi/linux/if_arp.h b/include/uapi/linux/if_arp.h
index 4d024d7..cf73510 100644
--- a/include/uapi/linux/if_arp.h
+++ b/include/uapi/linux/if_arp.h
@@ -95,6 +95,7 @@
 #define ARPHRD_IP6GRE	823		/* GRE over IPv6		*/
 #define ARPHRD_NETLINK	824		/* Netlink header		*/
 #define ARPHRD_6LOWPAN	825		/* IPv6 over LoWPAN             */
+#define ARPHRD_VSOCKMON	826		/* Vsock monitor header		*/
 
 #define ARPHRD_VOID	  0xFFFF	/* Void type, nothing is known */
 #define ARPHRD_NONE	  0xFFFE	/* zero header length */
diff --git a/net/vmw_vsock/af_vsock_tap.c b/net/vmw_vsock/af_vsock_tap.c
new file mode 100644
index 0000000..98f09b5
--- /dev/null
+++ b/net/vmw_vsock/af_vsock_tap.c
@@ -0,0 +1,114 @@
+/*
+ * Tap functions for AF_VSOCK sockets.
+ *
+ * Code based on net/netlink/af_netlink.c tap functions.
+ *
+ * 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; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+
+#include <linux/module.h>
+#include <net/sock.h>
+#include <net/af_vsock.h>
+#include <linux/if_arp.h>
+
+static DEFINE_SPINLOCK(vsock_tap_lock);
+static struct list_head vsock_tap_all __read_mostly =
+				LIST_HEAD_INIT(vsock_tap_all);
+
+int vsock_add_tap(struct vsock_tap *vt)
+{
+	if (unlikely(vt->dev->type != ARPHRD_VSOCKMON))
+		return -EINVAL;
+
+	__module_get(vt->module);
+
+	spin_lock(&vsock_tap_lock);
+	list_add_rcu(&vt->list, &vsock_tap_all);
+	spin_unlock(&vsock_tap_lock);
+
+	return 0;
+}
+EXPORT_SYMBOL_GPL(vsock_add_tap);
+
+int vsock_remove_tap(struct vsock_tap *vt)
+{
+	struct vsock_tap *tmp;
+	bool found = false;
+
+	spin_lock(&vsock_tap_lock);
+
+	list_for_each_entry(tmp, &vsock_tap_all, list) {
+		if (vt == tmp) {
+			list_del_rcu(&vt->list);
+			found = true;
+			goto out;
+		}
+	}
+
+	pr_warn("vsock_remove_tap: %p not found\n", vt);
+out:
+	spin_unlock(&vsock_tap_lock);
+
+	synchronize_net();
+
+	if (found)
+		module_put(vt->module);
+
+	return found ? 0 : -ENODEV;
+}
+EXPORT_SYMBOL_GPL(vsock_remove_tap);
+
+static int __vsock_deliver_tap_skb(struct sk_buff *skb,
+				   struct net_device *dev)
+{
+	int ret = 0;
+	struct sk_buff *nskb = skb_clone(skb, GFP_ATOMIC);
+
+	if (nskb) {
+		dev_hold(dev);
+
+		nskb->dev = dev;
+		ret = dev_queue_xmit(nskb);
+		if (unlikely(ret > 0))
+			ret = net_xmit_errno(ret);
+
+		dev_put(dev);
+	}
+
+	return ret;
+}
+
+static void __vsock_deliver_tap(struct sk_buff *skb)
+{
+	int ret;
+	struct vsock_tap *tmp;
+
+	list_for_each_entry_rcu(tmp, &vsock_tap_all, list) {
+		ret = __vsock_deliver_tap_skb(skb, tmp->dev);
+		if (unlikely(ret))
+			break;
+	}
+}
+
+void vsock_deliver_tap(struct sk_buff *build_skb(void *opaque), void *opaque)
+{
+	struct sk_buff *skb;
+
+	rcu_read_lock();
+
+	if (likely(list_empty(&vsock_tap_all)))
+		goto out;
+
+	skb = build_skb(opaque);
+	if (skb) {
+		__vsock_deliver_tap(skb);
+		consume_skb(skb);
+	}
+
+out:
+	rcu_read_unlock();
+}
+EXPORT_SYMBOL_GPL(vsock_deliver_tap);
-- 
2.9.3

^ permalink raw reply related

* [PATCH v5 0/3] VSOCK: vsockmon virtual device to monitor AF_VSOCK sockets.
From: Stefan Hajnoczi @ 2017-04-21  9:10 UTC (permalink / raw)
  To: netdev
  Cc: Zhu Yanjun, Michael S. Tsirkin, Gerard Garcia, Jorgen Hansen,
	Stefan Hajnoczi

v5:
 * Change vsock_deliver_tap() API to avoid unnecessary skb creation
   [Jorgen]
 * Fix skb leak when no taps are registered [Jorgen]
 * s/cpu_to_le16(pkt->hdr.op)/le16_to_cpu(pkt->hdr.op)/ [Michael]
 * Add af_vsock_tap.c and vsockmon.[ch] to MAINTAINERS
 * checkpatch.pl and sparse fixes

v4:
 * Add explicit reserved padding field to struct af_vsockmon_hdr and
   drop __attribute__((packed)) [Michael, DaveM]
 * Call synchronize_net() before module_put() [Michael]

v3:
 * Hook virtio_transport.c (guest driver), not just drivers/vhost/vsock.c (host
   driver)
 * Fix DEFAULT_MTU macro definition [Zhu Yanjun]
 * Rename af_vsockmon_hdr->t field ->transport for clarity
 * Update .ndo_get_stats64() return type since it has changed
 * Include missing <linux/module.h> header in af_vsock_tap.c

This is a continuation of Gerard Garcia's work on the vsockmon packet capture
interface for AF_VSOCK.  Packet capture is an essential feature for network
communication.  Gerard began addressing this feature gap in his Google Summer
of Code 2016 project.  I have cleaned up, rebased, and retested the v2 series
he posted previously.

The design follows the nlmon packet capture interface closely.  This is because
vsock has the same problem as netlink: there is no netdev on which packets can
be captured.  The nlmon driver is a synthetic netdev purely for the purpose of
enabling packet capture.  We follow the same approach here with vsockmon.

See include/uapi/linux/vsockmon.h in this series for details on the packet
layout.

How to try it:

1. Build tcpdump with vsockmon patches:

  $ git clone -b vsock https://github.com/stefanha/libpcap
  $ (cd libcap && ./configure && make)
  $ git clone -b vsock https://github.com/stefanha/tcpdump
  $ (cd tcpdump && ./configure && make)

2. Build nc-vsock (a netcat-like tool):

  $ git clone https://github.com/stefanha/nc-vsock
  $ (cd nc-vsock && make)

3. Launch a virtual machine:

  # modprobe vhost_vsock
  # qemu-system-x86_64 -M accel=kvm -m 1024 -cpu host \
      -drive if=virtio,file=test.img,format=raw \
      -device vhost-vsock-pci,guest-cid=3

  (Assumes guest is running a kernel with this patch)

4. Capture AF_VSOCK traffic in guest and/or host:

  # modprobe vsockmon
  # ip link add type vsockmon
  # ip link set vsockmon0 up
  # tcpdump -i vsockmon0 -vvv

5. Communicate!

  (host)$ nc-vsock -l 1234
  (guest)$ nc-vsock 2 1234

Gerard Garcia (3):
  VSOCK: Add vsockmon tap functions
  VSOCK: Add vsockmon device
  VSOCK: Add virtio vsock vsockmon hooks

 MAINTAINERS                             |   3 +
 drivers/net/Makefile                    |   1 +
 net/vmw_vsock/Makefile                  |   2 +-
 include/linux/virtio_vsock.h            |   1 +
 include/net/af_vsock.h                  |  13 +++
 include/uapi/linux/if_arp.h             |   1 +
 include/uapi/linux/vsockmon.h           |  60 +++++++++++
 drivers/net/vsockmon.c                  | 170 ++++++++++++++++++++++++++++++++
 drivers/vhost/vsock.c                   |   8 ++
 net/vmw_vsock/af_vsock_tap.c            | 114 +++++++++++++++++++++
 net/vmw_vsock/virtio_transport.c        |   3 +
 net/vmw_vsock/virtio_transport_common.c |  64 ++++++++++++
 drivers/net/Kconfig                     |   8 ++
 include/uapi/linux/Kbuild               |   1 +
 14 files changed, 448 insertions(+), 1 deletion(-)
 create mode 100644 include/uapi/linux/vsockmon.h
 create mode 100644 drivers/net/vsockmon.c
 create mode 100644 net/vmw_vsock/af_vsock_tap.c

-- 
2.9.3

^ permalink raw reply

* pull-request: wireless-drivers-next 2017-04-21
From: Kalle Valo @ 2017-04-21  9:08 UTC (permalink / raw)
  To: David Miller; +Cc: linux-wireless, netdev, linux-kernel

Hi Dave,

here's most likely the last pull request to net-next for 4.12, unless
Linus delayes the start of merge window. More info in the signed tag
below and please let me know if there are any problems.

Kalle

The following changes since commit d92be7a41ef15463eb816a4a2d42bf094b56dfce:

  net: make struct net_device::min_header_len 8-bit (2017-04-12 13:59:21 -0400)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git tags/wireless-drivers-next-for-davem-2017-04-21

for you to fetch changes up to a0597834dc0e1af68f48f92b31617b360a14dfc8:

  rt2800: fix mt7620 E2 channel registers (2017-04-20 14:00:54 +0300)

----------------------------------------------------------------
wireless-drivers-next patches for 4.12

Quite a lot of patches for rtlwifi and iwlwifi this time, but changes
also for other active wireless drivers.

Major changes:

ath9k

* add support for Dell Wireless 1601 PCI device

* add debugfs file to manually override noise floor

ath10k

* bump up FW API to 6 for a new QCA6174 firmware branch

wil6210

* support 8 kB RX buffers

iwlwifi

* work to support A000 devices continues

* add support for FW API 30

* add Geographical and Dynamic Specific Absorption Rate (SAR) support

* support a few new PCI device IDs

rtlwifi

* work on adding Bluetooth coexistance support, not finished yet

----------------------------------------------------------------
Arend Van Spriel (7):
      brcmfmac: rename brcmf_fws_{de,}init to brcmf_fws{at,de}tach
      brcmfmac: ignore interfaces when fwsignal is disabled
      brcmfmac: remove reference to fwsignal data from struct brcmf_pub
      brcmfmac: add length checks in scheduled scan result handler
      brcmfmac: remove bogus check in scheduled scan result handler
      brcmfmac: only add channels and ssids once in scan request
      brcmfmac: only build fwsignal module for CONFIG_BRCMFMAC_PROTO_BCDC

Brian Norris (6):
      mwifiex: MAC randomization should not be persistent
      mwifiex: pcie: fix cmd_buf use-after-free in remove/reset
      mwifiex: reset timeout flag when resetting device
      mwifiex: pcie: clear outstanding work when resetting
      mwifiex: don't leak 'chan_stats' on reset
      MAINTAINERS: update Amitkumar's email address

Damien Thébault (1):
      ath9k: Add Dell Wireless 1601 with wowlan capability

Dan Carpenter (1):
      ath9k: off by one in ath9k_hw_nvram_read_array()

Daniel Golle (3):
      rt2x00: reverse external PA capability flag logic
      rt2800: fix LNA gain assignment for MT7620
      rt2800: do VCO calibration after programming ALC

David Spinadel (1):
      iwlwifi: mvm: change TX_CMD_SEC_KEY_FROM_TABLE value

Dedy Lansky (3):
      wil6210: align to latest auto generated wmi.h
      wil6210: fix memory access violation in wil_memcpy_from/toio_32
      wil6210: fix array out of bounds access in pmc

Emmanuel Grumbach (5):
      iwlwifi: mvm: add DQA_ENABLE_CMD to the command list
      iwlwifi: pcie: print less data upon firmware crash
      iwlwifi: mvm: tell the firmware about the U-APSD parameters
      iwlwifi: mvm: provide the actual number of frames for the SP len
      iwlwifi: split the handler and the wake parts of the notification infra

Ganapathi Bhat (1):
      mwifiex: Fix invalid port issue

Golan Ben-Ami (1):
      iwlwifi: mvm: support MFUART dump in case of MFUART assert

Goodstein, Mordechay (1):
      iwlwifi: mvm: move new API code to the end

Haim Dreyfuss (2):
      iwlwifi: mvm: refactor SAR init to prepare for dynamic SAR
      iwlwifi: mvm: add GEO_TX_POWER_LIMIT cmd for geographic tx power table

Hamad Kadmany (3):
      wil6210: fix sequence for scan-abort during reset
      wil6210: fix protection against connections during reset
      wil6210: fix check for sparrow D0 FW file

Heiner Kallweit (1):
      brcmfmac: properly align buffers on certain platforms with 64 bit DMA

Joe Perches (1):
      ath6kl: add __printf verification to ath6kl_dbg

Johan Hovold (1):
      ath9k_htc: fix NULL-deref at probe

Johannes Berg (5):
      iwlwifi: mvm: fix RX SKB header size and align it properly
      iwlwifi: use upper_32_bits/lower_32_bits where appropriate
      iwlwifi: pcie: use iwl_get_dma_hi_addr()
      iwlwifi: pcie: fix mutex leak in gen2 start
      iwlwifi: pcie: free context info in case of failures

Kalle Valo (3):
      Merge tag 'iwlwifi-next-for-kalle-2017-04-13' of git://git.kernel.org/.../iwlwifi/iwlwifi-next
      Merge tag 'iwlwifi-next-for-kalle-2017-04-19-2' of git://git.kernel.org/.../iwlwifi/iwlwifi-next
      Merge ath-next from git://git.kernel.org/.../kvalo/ath.git

Lazar Alexei (1):
      wil6210: restore power save state after internal FW reset

Liad Kaufman (3):
      iwlwifi: add support for 9000 HW B-step NICs
      iwlwifi: mvm: remove unneeded reg write in iwl_mvm_up()
      iwlwifi: a000: fix memory offsets and lengths

Lior David (1):
      wil6210: support 8KB RX buffers

Luca Coelho (9):
      iwlwifi: be more verbose about needed firmware
      iwlwifi: remove support for deprecated RF
      iwlwifi: mvm: bump max API to 30
      iwlwifi: remove unnecessary dev_cmd_headroom parameter
      iwlwifi: mvm: spin off SAR profile selection function
      iwlwifi: mvm: add support for EWRD (Dynamic SAR) ACPI table
      iwlwifi: mvm: remove unnecessary debugging from UMAC scan
      iwlwifi: mvm: remove unnecessary label in iwl_mvm_handle_rx_statistics()
      iwlwifi: pcie: remove RSA race workaround

Maharaja Kennadyrajan (1):
      ath10k: fix the Transmit Power Control stats display format

Marcin Rokicki (3):
      ath10k: fix block comments style
      ath10k: use octal permission representation
      ath10k: clean header files from bad block comments

Matthias Kaehlcke (1):
      ath9k: Add cast to u8 to FREQ2FBIN macro

Maya Erez (3):
      wil6210: protect against sporadic interrupt during suspend flow
      wil6210: remove HALP voting in debugfs ioblob
      wil6210: prevent access to 11AD device if resume fails

Mohammed Shafi Shajakhan (7):
      ath10k: fix NAPI enable/disable symmetry for AHB interface
      ath10k: cancel coverage class work during stop and restart
      ath10k: enable a HTC debug message during insufficient tx credits
      ath10k: remove obselete Copy Engine comments
      ath10k: fix compile time sanity check for CE4 buffer size
      ath10k: fix spectral scan for QCA99X0 family of chipsets
      ath: Fix updating radar flags for coutry code India

Ryan Hsu (1):
      ath10k: bump up FW API to 6

Sara Sharon (48):
      iwlwifi: mvm: support new binding API
      iwlwifi: mvm: adjust new API of compressed BA
      iwlwifi: mvm: cleanup pending frames in DQA mode
      iwlwifi: mvm: add multicast station
      iwlwifi: mvm: support new ADD_MODIFY_STA_KEY command
      iwlwifi: mvm: optimize reorder timeout frame releasing
      iwlwifi: mvm: don't assume static queue numbers
      Revert "iwlwifi: introduce trans API to get byte count table"
      iwlwifi: pcie: remove the active field in struct iwl_txq
      iwlwifi: pcie: use WFPM_GP for debugging D3 flows
      iwlwifi: pcie: introduce split point to a000 devices
      iwlwifi: pcie: add context information support
      iwlwifi: mvm: remove call for paging in new init flow
      iwlwifi: mvm: separate queue mapping from queue enablement
      iwlwifi: mvm: read new secure boot registers
      iwlwifi: mvm: add queues after adding station
      iwlwifi: cleanup unused function
      iwlwifi: mvm: prepare for station count change
      iwlwifi: mvm: use same scan API for all a000 devices
      iwlwifi: mvm: disable multi-queue for a000 devices
      iwlwifi: mvm: support new TX API
      iwlwifi: pcie: introduce a000 TX queues management
      iwlwifi: mvm: support a000 SCD queue configuration
      iwlwifi: mvm: support moving to mgmt tid
      iwlwifi: pcie: copy TX functions to new transport
      iwlwifi: pcie: cleanup old transport code from gen2
      iwlwifi: pcie: support new TX command
      iwlwifi: pcie: rewrite TFD creation
      iwlwifi: pcie: support host commands in new transport
      iwlwifi: pcie: support new write pointer width
      iwlwifi: pcie: remove block and freeze operations from new transport
      iwlwifi: pcie: prepare for dynamic queue allocation
      iwlwifi: pcie: introduce new stop_device
      iwlwifi: pcie: alloc queues dynamically
      iwlwifi: pcie: get rid of txq id assignment
      iwlwifi: mvm: support new TX response for TVQM
      iwlwifi: move to TVQM mode
      iwlwifi: mvm: do not turn on RX_FLAG_AMSDU_MORE
      iwlwifi: mvm: work around HW issue with AMSDU de-aggregation
      iwlwifi: mvm: ignore BAID for SN smaller than SSN
      iwlwifi: mvm: support change to a000 smem API
      iwlwifi: support a000 CDB product
      iwlwifi: mvm: support init extended command
      iwlwifi: mvm: disable RX queue notification for a000 devices
      iwlwifi: mvm: dump frames early on invalid rate
      iwlwifi: mvm: flip address 4 of AMSDU frames
      iwlwifi: mvm: support changing band for phy context
      iwlwifi: mvm: allow block ack response without data

Simon Wunderlich (1):
      ath9k: add noise floor override option

Tomislav Požega (2):
      rt2800: fix mt7620 vco calibration registers
      rt2800: fix mt7620 E2 channel registers

Tzipi Peres (1):
      iwlwifi: add four new 8265 and 8275 series PCI IDs

Venkateswara Rao Naralasetty (1):
      ath10k: fix station nss computation

Xinming Hu (4):
      mwifiex: remove unnecessary wakeup interrupt number sanity check
      mwifiex: fall back mwifiex_dbg to pr_info when adapter->dev not set
      mwifiex: pcie: correct scratch register name
      mwifiex: pcie: extract wifi part from combo firmware during function level reset

Yan-Hsuan Chuang (71):
      rtlwifi: btcoex: 23b 2ant: check PS state before setting tdma duration
      rtlwifi: btcoex: 23b 2ant: rename tdma_adj_type to ps_tdma_du_adj_type
      rtlwifi: btcoex: 23b 2ant: detect ap num and set GNT_BT properly
      rtlwifi: btcoex: 23b 2ant: more cases for adjusting tdma duration
      rtlwifi: btcoex: 23b 2ant: fix PTA unstable problem when hw init
      rtlwifi: btcoex: 23b 2ant: add pnp notidy to avoid LPS/IPS mismatch
      rtlwifi: btcoex: 23b 2ant: check more cases when bt is queuing
      rtlwifi: btcoex: 23b 2ant: workaround for bt a2dp and hid
      rtlwifi: btcoex: 23b 2ant: tell fw if external or internal switch is used
      rtlwifi: btcoex: 23b 2ant: let bt transmit when hw initialisation done
      rtlwifi: btcoex: 23b 2ant: turn off ps and tdma mechanism when in concurrent mode
      rtlwifi: btcoex: 23b 2ant: turn off antenna when rssi is too high/low
      rtlwifi: btcoex: 23b 2ant: set coex table when wifi is linking
      rtlwifi: btcoex: 23b 2ant: set coex table when wifi is idle
      rtlwifi: btcoex: 23b 2ant: treat too many low prio packets as retry
      rtlwifi: btcoex: 23b 2ant: remove debugging code for 0x948
      rtlwifi: btcoex: 23b 2ant: need those information when scan
      rtlwifi: btcoex: 23b 2ant: wifi is not actually off in mp mode
      rtlwifi: btcoex: 23b 2ant: power on settings for coex
      rtlwifi: btcoex: 23b 2ant: before firmware ready settings
      rtlwifi: btcoex: 23b 2ant: fine tune for bt pan_edr_a2dp
      rtlwifi: btcoex: 23b 2ant: fine tune for bt hid_a2dp
      rtlwifi: btcoex: 23b 2ant: notify more bt information
      rtlwifi: btcoex: 23b 2ant: some hi-prio pkt will cause hid_exist
      rtlwifi: btcoex: 21a 1ant: fw settings for softap mode
      rtlwifi: btcoex: 21a 1ant: add function to check wifi status
      rtlwifi: btcoex: 21a 1ant: coex table setting for new fw
      rtlwifi: btcoex: 21a 1ant: mask profile bit for connect-ilde
      rtlwifi: btcoex: 21a 1ant: remove setting for 2 antennas
      rtlwifi: btcoex: 21a 1ant: set antenna control path for PTA
      rtlwifi: btcoex: 21a 1ant: add multi port action for miracast and P2P
      rtlwifi: btcoex: 21a 1ant: action when associating/authenticating
      rtlwifi: btcoex: 21a 1ant: If wifi only, do not initiate coex mechanism
      rtlwifi: btcoex: 21a 1ant: move bt_disabled to global struct
      rtlwifi: btcoex: 21a 1ant: consider more cases when bt inquiry
      rtlwifi: btcoex: 21a 1ant: monitor bt profiling when scan
      rtlwifi: btcoex: 21a 1ant: do not switch antenna when wifi is under 5G channel
      rtlwifi: btcoex: 21a 1ant: avoid LPS/IPS mismatch for pnp notify
      rtlwifi: btcoex: 21a 2ant: limit rx aggregation size to avoid bt interrupt
      rtlwifi: btcoex: 21a 2ant: monitor if bt is slave or not
      rtlwifi: btcoex: 21a 2ant: monitor wifi counter to check network status
      rtlwifi: btcoex: 21a 2ant: update bt profiling information
      rtlwifi: btcoex: 21a 2ant: finer adjustment of bt power
      rtlwifi: btcoex: 21a 2ant: move from bt_stack_info to bt_link_info
      rtlwifi: btcoex: 21a 2ant: suffer less tx penalty from retry
      rtlwifi: btcoex: 21a 2ant: check power save state before pstdma
      rtlwifi: btcoex: 21a 2ant: do not check wifi bandwidth
      rtlwifi: btcoex: 21a 2ant: centralized control of coex table
      rtlwifi: btcoex: 21a 2ant: check if wifi status changed
      rtlwifi: btcoex: 21a 2ant: ignore wifi if it is at 5G band
      rtlwifi: btcoex: 21a 2ant: set coex table and tdma when bt inquiry
      rtlwifi: btcoex: 21a 2ant: let PTA circuit control the switch
      rtlwifi: btcoex: 21a 2ant: slot time fine tune
      rtlwifi: btcoex: 21a 2ant: tdma cases for low wifi/bt rssi
      rtlwifi: btcoex: 21a 2ant: action for wifi is idle/linking/common
      rtlwifi: btcoex: 21a 2ant: fix invalid argument passed
      rtlwifi: btcoex: 21a 2ant: refine tdma duration adjust function
      rtlwifi: btcoex: 21a 2ant: turn on sw dac swing and check if is sco_only
      rtlwifi: btcoex: 21a 2ant: add threshold to examine bt rssi
      rtlwifi: btcoex: 21a 2ant: force wifi to use RF path A
      rtlwifi: btcoex: 21a 2ant: more combinations of wifi/bt rssi state
      rtlwifi: btcoex: 21a 2ant: fix some coding style issues
      rtlwifi: btcoex: 21a 2ant: set tdma based on rssi state amd limit rx agg size
      rtlwifi: btcoex: 21a 2ant: add multiport action for p2p/miracast
      rtlwifi: btcoex: 21a 2ant: monitor extra wifi rssi to examine network status
      rtlwifi: btcoex: 21a 2ant: notify fw the number of APs
      rtlwifi: btcoex: 21a 2ant: dec bt power according to bt rssi and set tdma
      rtlwifi: btcoex: 21a 2ant: macro for bt rssi threshold
      rtlwifi: btcoex: 21a 2ant: do not limit rx agg size
      rtlwifi: btcoex: 21a 2ant: just return when wifi is under ips
      rtlwifi: btcoex: 21a 2ant: wifi is linking action

 MAINTAINERS                                        |    2 +-
 drivers/net/wireless/ath/ath10k/ahb.c              |    2 +-
 drivers/net/wireless/ath/ath10k/bmi.h              |    3 +-
 drivers/net/wireless/ath/ath10k/ce.c               |    5 +-
 drivers/net/wireless/ath/ath10k/core.c             |   28 +-
 drivers/net/wireless/ath/ath10k/core.h             |    9 +-
 drivers/net/wireless/ath/ath10k/debug.c            |   93 +-
 drivers/net/wireless/ath/ath10k/debugfs_sta.c      |    9 +-
 drivers/net/wireless/ath/ath10k/hif.h              |    6 +-
 drivers/net/wireless/ath/ath10k/htc.c              |    6 +-
 drivers/net/wireless/ath/ath10k/htt.h              |   24 +-
 drivers/net/wireless/ath/ath10k/htt_rx.c           |    9 +-
 drivers/net/wireless/ath/ath10k/htt_tx.c           |    6 +-
 drivers/net/wireless/ath/ath10k/hw.h               |   11 +-
 drivers/net/wireless/ath/ath10k/mac.c              |   58 +-
 drivers/net/wireless/ath/ath10k/pci.c              |   13 +-
 drivers/net/wireless/ath/ath10k/rx_desc.h          |   13 +-
 drivers/net/wireless/ath/ath10k/spectral.c         |   32 +-
 drivers/net/wireless/ath/ath10k/targaddrs.h        |   19 +-
 drivers/net/wireless/ath/ath10k/thermal.c          |    5 +-
 drivers/net/wireless/ath/ath10k/txrx.c             |    3 +-
 drivers/net/wireless/ath/ath10k/wmi-ops.h          |    3 +-
 drivers/net/wireless/ath/ath10k/wmi.c              |   16 +-
 drivers/net/wireless/ath/ath10k/wmi.h              |   30 +-
 drivers/net/wireless/ath/ath6kl/debug.h            |    2 +
 drivers/net/wireless/ath/ath6kl/htc_pipe.c         |    2 +-
 drivers/net/wireless/ath/ath6kl/wmi.c              |    2 +-
 drivers/net/wireless/ath/ath9k/calib.c             |    5 +-
 drivers/net/wireless/ath/ath9k/debug.c             |   62 +
 drivers/net/wireless/ath/ath9k/eeprom.c            |    2 +-
 drivers/net/wireless/ath/ath9k/eeprom.h            |    2 +-
 drivers/net/wireless/ath/ath9k/hif_usb.c           |    3 +
 drivers/net/wireless/ath/ath9k/hw.h                |    1 +
 drivers/net/wireless/ath/ath9k/pci.c               |    5 +
 drivers/net/wireless/ath/regd.c                    |   19 +-
 drivers/net/wireless/ath/wil6210/cfg80211.c        |   12 +-
 drivers/net/wireless/ath/wil6210/debugfs.c         |    5 +-
 drivers/net/wireless/ath/wil6210/fw_inc.c          |    4 +-
 drivers/net/wireless/ath/wil6210/main.c            |   65 +-
 drivers/net/wireless/ath/wil6210/pm.c              |   27 +-
 drivers/net/wireless/ath/wil6210/pmc.c             |    4 +-
 drivers/net/wireless/ath/wil6210/rx_reorder.c      |   12 +-
 drivers/net/wireless/ath/wil6210/txrx.c            |   24 +-
 drivers/net/wireless/ath/wil6210/wil6210.h         |   13 +-
 drivers/net/wireless/ath/wil6210/wmi.c             |   14 +-
 drivers/net/wireless/ath/wil6210/wmi.h             |   73 +-
 .../wireless/broadcom/brcm80211/brcmfmac/Makefile  |    4 +-
 .../wireless/broadcom/brcm80211/brcmfmac/bcdc.c    |   35 +-
 .../wireless/broadcom/brcm80211/brcmfmac/bcdc.h    |    1 +
 .../broadcom/brcm80211/brcmfmac/cfg80211.c         |   39 +-
 .../wireless/broadcom/brcm80211/brcmfmac/core.h    |    2 -
 .../broadcom/brcm80211/brcmfmac/fwsignal.c         |   53 +-
 .../broadcom/brcm80211/brcmfmac/fwsignal.h         |    4 +-
 .../wireless/broadcom/brcm80211/brcmfmac/sdio.c    |    4 +
 drivers/net/wireless/intel/iwlwifi/Makefile        |    1 +
 drivers/net/wireless/intel/iwlwifi/iwl-7000.c      |    4 +-
 drivers/net/wireless/intel/iwlwifi/iwl-8000.c      |    4 +-
 drivers/net/wireless/intel/iwlwifi/iwl-9000.c      |   48 +-
 drivers/net/wireless/intel/iwlwifi/iwl-a000.c      |   31 +-
 drivers/net/wireless/intel/iwlwifi/iwl-config.h    |   25 +-
 .../net/wireless/intel/iwlwifi/iwl-context-info.h  |  203 ++
 drivers/net/wireless/intel/iwlwifi/iwl-csr.h       |    1 -
 drivers/net/wireless/intel/iwlwifi/iwl-drv.c       |   34 +-
 drivers/net/wireless/intel/iwlwifi/iwl-fh.h        |    6 +-
 drivers/net/wireless/intel/iwlwifi/iwl-fw-file.h   |    5 +
 drivers/net/wireless/intel/iwlwifi/iwl-io.c        |    4 +-
 .../net/wireless/intel/iwlwifi/iwl-notif-wait.c    |   10 +-
 .../net/wireless/intel/iwlwifi/iwl-notif-wait.h    |   25 +-
 drivers/net/wireless/intel/iwlwifi/iwl-prph.h      |    9 +-
 drivers/net/wireless/intel/iwlwifi/iwl-trans.c     |    7 +-
 drivers/net/wireless/intel/iwlwifi/iwl-trans.h     |  105 +-
 drivers/net/wireless/intel/iwlwifi/mvm/binding.c   |   17 +-
 drivers/net/wireless/intel/iwlwifi/mvm/coex.c      |    2 +-
 drivers/net/wireless/intel/iwlwifi/mvm/d3.c        |   26 +-
 .../net/wireless/intel/iwlwifi/mvm/debugfs-vif.c   |    2 +-
 drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c   |    2 +-
 .../net/wireless/intel/iwlwifi/mvm/fw-api-mac.h    |    4 +-
 .../net/wireless/intel/iwlwifi/mvm/fw-api-power.h  |   43 +-
 .../net/wireless/intel/iwlwifi/mvm/fw-api-scan.h   |   14 +-
 .../net/wireless/intel/iwlwifi/mvm/fw-api-sta.h    |   50 +-
 drivers/net/wireless/intel/iwlwifi/mvm/fw-api-tx.h |   91 +-
 drivers/net/wireless/intel/iwlwifi/mvm/fw-api.h    |  107 +-
 drivers/net/wireless/intel/iwlwifi/mvm/fw-dbg.c    |  287 ++-
 drivers/net/wireless/intel/iwlwifi/mvm/fw.c        |  520 ++++-
 drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c  |    9 +-
 drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c  |   48 +-
 drivers/net/wireless/intel/iwlwifi/mvm/mvm.h       |   83 +-
 drivers/net/wireless/intel/iwlwifi/mvm/ops.c       |   26 +-
 drivers/net/wireless/intel/iwlwifi/mvm/phy-ctxt.c  |   21 +-
 drivers/net/wireless/intel/iwlwifi/mvm/rx.c        |  111 +-
 drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c      |   87 +-
 drivers/net/wireless/intel/iwlwifi/mvm/scan.c      |   85 +-
 drivers/net/wireless/intel/iwlwifi/mvm/sf.c        |    6 +-
 drivers/net/wireless/intel/iwlwifi/mvm/sta.c       |  486 ++--
 drivers/net/wireless/intel/iwlwifi/mvm/sta.h       |    3 +
 drivers/net/wireless/intel/iwlwifi/mvm/tdls.c      |   22 +-
 drivers/net/wireless/intel/iwlwifi/mvm/tof.c       |    2 +-
 drivers/net/wireless/intel/iwlwifi/mvm/tt.c        |    2 +-
 drivers/net/wireless/intel/iwlwifi/mvm/tx.c        |  132 +-
 drivers/net/wireless/intel/iwlwifi/mvm/utils.c     |  108 +-
 .../net/wireless/intel/iwlwifi/pcie/ctxt-info.c    |  277 +++
 drivers/net/wireless/intel/iwlwifi/pcie/drv.c      |   24 +-
 drivers/net/wireless/intel/iwlwifi/pcie/internal.h |   93 +-
 drivers/net/wireless/intel/iwlwifi/pcie/rx.c       |   57 +-
 .../net/wireless/intel/iwlwifi/pcie/trans-gen2.c   |  374 ++++
 drivers/net/wireless/intel/iwlwifi/pcie/trans.c    |  284 +--
 drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c  | 1018 +++++++++
 drivers/net/wireless/intel/iwlwifi/pcie/tx.c       |  237 +-
 drivers/net/wireless/marvell/mwifiex/cfg80211.c    |    4 +-
 drivers/net/wireless/marvell/mwifiex/fw.h          |   18 +
 drivers/net/wireless/marvell/mwifiex/main.c        |   20 +-
 drivers/net/wireless/marvell/mwifiex/pcie.c        |  127 +-
 drivers/net/wireless/marvell/mwifiex/pcie.h        |   16 +-
 drivers/net/wireless/marvell/mwifiex/sdio.c        |    4 +-
 drivers/net/wireless/ralink/rt2x00/rt2800lib.c     |   72 +-
 drivers/net/wireless/ralink/rt2x00/rt2x00.h        |    4 +-
 .../realtek/rtlwifi/btcoexist/halbtc8723b2ant.c    | 1661 ++++++++++++--
 .../realtek/rtlwifi/btcoexist/halbtc8723b2ant.h    |   22 +-
 .../realtek/rtlwifi/btcoexist/halbtc8821a1ant.c    |  408 +++-
 .../realtek/rtlwifi/btcoexist/halbtc8821a1ant.h    |    2 +
 .../realtek/rtlwifi/btcoexist/halbtc8821a2ant.c    | 2357 +++++++++++++++-----
 .../realtek/rtlwifi/btcoexist/halbtc8821a2ant.h    |   29 +-
 .../realtek/rtlwifi/btcoexist/halbtcoutsrc.h       |   20 +
 123 files changed, 8770 insertions(+), 2181 deletions(-)
 create mode 100644 drivers/net/wireless/intel/iwlwifi/iwl-context-info.h
 create mode 100644 drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info.c
 create mode 100644 drivers/net/wireless/intel/iwlwifi/pcie/trans-gen2.c
 create mode 100644 drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c

^ permalink raw reply

* [PATCH 4.4-only] netlink: Allow direct reclaim for fallback allocation
From: Ross Lagerwall @ 2017-04-21  8:52 UTC (permalink / raw)
  To: netdev
  Cc: Anoob Soman, Ross Lagerwall, David S. Miller, Eric Dumazet,
	linux-kernel

The backport of d35c99ff77ec ("netlink: do not enter direct reclaim from
netlink_dump()") to the 4.4 branch (first in 4.4.32) mistakenly removed
direct claim from the initial large allocation and the fallback
allocation which means that allocations can spuriously fail.
Fix the issue by adding back the direct reclaim flag to the fallback
allocation.

Fixes: 6d123f1d396b ("netlink: do not enter direct reclaim from netlink_dump()")
Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
---
 net/netlink/af_netlink.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index 8e33019..acfb16f 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -2107,7 +2107,7 @@ static int netlink_dump(struct sock *sk)
 	if (!skb) {
 		alloc_size = alloc_min_size;
 		skb = netlink_alloc_skb(sk, alloc_size, nlk->portid,
-					(GFP_KERNEL & ~__GFP_DIRECT_RECLAIM));
+					GFP_KERNEL);
 	}
 	if (!skb)
 		goto errout_skb;
-- 
2.7.4

^ permalink raw reply related

* Re: [PATCH 11/16] esp: Use a synchronous crypto algorithm on offloading.
From: Steffen Klassert @ 2017-04-21  8:33 UTC (permalink / raw)
  To: Herbert Xu; +Cc: David Miller, netdev
In-Reply-To: <20170421052934.GA12702@gondor.apana.org.au>

On Fri, Apr 21, 2017 at 01:29:34PM +0800, Herbert Xu wrote:
> On Thu, Apr 20, 2017 at 12:50:29PM +0200, Steffen Klassert wrote:
> > On Thu, Apr 20, 2017 at 05:52:35PM +0800, Herbert Xu wrote:
> > > On Thu, Apr 20, 2017 at 11:17:52AM +0200, Steffen Klassert wrote:
> > > >
> > > > I tried to use async algorithms but it lead to serveral problems.
> > > > The GSO layer can't handle async returns, we'd need callbacks
> > > > for all the GSO handlers. Also we need something where we can
> > > > requeue packets if the driver is busy etc.
> > > 
> > > Why would we need to requeue? As it is if you get an EBUSY on
> > > an IPsec packet it's simply dropped.
> > 
> > Yes we could do this, but the GSO problem remain.
> > 
> > We discussed this last year at netdevconf but could not come
> > up with an acceptable solutuion.
> 
> Why is it a problem exactly?

My solution for this added some extra code to the generic networking
path, this was seen as too intrusive for this very special usecase.

I still think we can get this to work, but it needs some extra care.

> 
> > For now this is just a fallback to make hardware offloading
> > possible at all, so this is slowpath anyway. Allowing async
> > algorithms can (and should) be done in a second step once we
> > found a not too intrusive solution.
> 
> OK, as long as nobody gets silently switched from async to sync
> then it's fine with me.

The user has to explicitely ask for a offloaded state, so
we don't hide anything here. In this case the user wants
to use the crypto engine of the NIC, we just need a software
fallback to catch some corner cases where the NIC can't
do the crypto operation.

^ permalink raw reply

* (unknown), 
From: scotte @ 2017-04-21  8:30 UTC (permalink / raw)
  To: netdev

[-- Attachment #1: EMAIL_73239390_netdev.zip --]
[-- Type: application/zip, Size: 2207 bytes --]

^ permalink raw reply

* blocking ops when !TASK_RUNNING in vsock_stream_sendmsg() (again)
From: Michal Kubecek @ 2017-04-21  8:14 UTC (permalink / raw)
  To: Claudio Imbrenda; +Cc: netdev, Andy King, George Zhang

Hello,

one of openSUSE Leap 42.2 users encountered (repeatedly) a warning

[ 4057.170653] WARNING: CPU: 1 PID: 3471 at ../kernel/sched/core.c:7913 __might_sleep+0x76/0x80()
[ 4057.170661] do not call blocking ops when !TASK_RUNNING; state=1 set at [<ffffffff810c25ab>] prepare_to_wait+0x2b/0x80

with stack

[ 4057.170786]  [<ffffffff81019e69>] dump_trace+0x59/0x320
[ 4057.170789]  [<ffffffff8101a22a>] show_stack_log_lvl+0xfa/0x180
[ 4057.170792]  [<ffffffff8101afd1>] show_stack+0x21/0x40
[ 4057.170798]  [<ffffffff81327657>] dump_stack+0x5c/0x85
[ 4057.170803]  [<ffffffff8107e821>] warn_slowpath_common+0x81/0xb0
[ 4057.170806]  [<ffffffff8107e89c>] warn_slowpath_fmt+0x4c/0x50
[ 4057.170809]  [<ffffffff810a3106>] __might_sleep+0x76/0x80
[ 4057.170814]  [<ffffffff816071ac>] mutex_lock+0x1c/0x38
[ 4057.170822]  [<ffffffffa0cfb477>] vmci_qpair_produce_free_space+0x97/0xd0 [vmw_vmci]
[ 4057.170848]  [<ffffffffa0d10d36>] vsock_stream_sendmsg+0x1f6/0x320 [vsock]
[ 4057.170855]  [<ffffffff814f6fb0>] sock_sendmsg+0x30/0x40
[ 4057.170859]  [<ffffffff814f7039>] sock_write_iter+0x79/0xd0
[ 4057.170864]  [<ffffffff81204d49>] __vfs_write+0xa9/0xf0
[ 4057.170867]  [<ffffffff8120534d>] vfs_write+0x9d/0x190
[ 4057.170870]  [<ffffffff81206012>] SyS_write+0x42/0xa0
[ 4057.170873]  [<ffffffff816093f2>] entry_SYSCALL_64_fastpath+0x16/0x71

The kernel is 4.4.27 but it already has commit f7f9b5e7f8ec ("AF_VSOCK:
Shrink the area influenced by prepare_to_wait") applied. The issue comes
from this part of vsock_stream_sendmsg():

                prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
                while (vsock_stream_has_space(vsk) == 0 &&
                       sk->sk_err == 0 &&
                       !(sk->sk_shutdown & SEND_SHUTDOWN) &&
                       !(vsk->peer_shutdown & RCV_SHUTDOWN)) {

where vsock_stream_has_space() can sleep:

  vsock_stream_has_space
    vmci_transport_stream_has_space
      vmci_qpair_produce_free_space
        qp_lock
          qp_acquire_queue_mutex
            mutex_lock

but this is not allowed between prepare_to_wait() and either the actual
waiting or finish_wait().

I tried to think about a solution but there doesn't seem to be an easy
way to fix this in vmw_stream_sendmsg() as moving prepare_to_wait()
inside the loop would result in missed wake-ups (that was the problem
with the original fix); IMHO the right way to resolve the issue would be
rewriting the vmci queue pair code to allow performing the has_space()
check without taking a mutex.

                                                        Michal Kubecek

^ permalink raw reply

* Re: [net-next 04/14] i40e: dump VF information in debugfs
From: Or Gerlitz @ 2017-04-21  8:11 UTC (permalink / raw)
  To: David Miller
  Cc: Yuval.Mintz, Jiri Pirko, Jeff Kirsher, Mitch Williams,
	Linux Netdev List, nhorman@redhat.com, sassmann@redhat.com,
	jogreene@redhat.com, Chad.Dupuis, Manish Rangankar
In-Reply-To: <20170420.125841.799913763607507081.davem@davemloft.net>

On Thu, Apr 20, 2017 at 7:58 PM, David Miller <davem@davemloft.net> wrote:
> From: "Mintz, Yuval" <Yuval.Mintz@cavium.com>
> Date: Thu, 20 Apr 2017 16:24:51 +0000
>
>> the HW pipeline itself can't be abstracted in this case.
>
> I've heard that argument before, and I'm glad Jiri didn't drink the
> koolaide and instead wrote dpipe.

donno re drinking but re writing s/jiri/arkadi/

^ permalink raw reply

* Re: [PATCH v3 net-next] mdio_bus: Issue GPIO RESET to PHYs.
From: Roger Quadros @ 2017-04-21  8:04 UTC (permalink / raw)
  To: Florian Fainelli, davem, Andrew Lunn
  Cc: tony, nsekhar, jsarha, netdev, linux-omap, linux-kernel
In-Reply-To: <fa24ae98-3d4f-4b11-bbb4-485b9ed41ed7@gmail.com>

Hi Florian,

On 21/04/17 04:23, Florian Fainelli wrote:
> Hi Roger,
> 
> On 04/20/2017 07:11 AM, Roger Quadros wrote:
>> Some boards [1] leave the PHYs at an invalid state
>> during system power-up or reset thus causing unreliability
>> issues with the PHY which manifests as PHY not being detected
>> or link not functional. To fix this, these PHYs need to be RESET
>> via a GPIO connected to the PHY's RESET pin.
>>
>> Some boards have a single GPIO controlling the PHY RESET pin of all
>> PHYs on the bus whereas some others have separate GPIOs controlling
>> individual PHY RESETs.
>>
>> In both cases, the RESET de-assertion cannot be done in the PHY driver
>> as the PHY will not probe till its reset is de-asserted.
>> So do the RESET de-assertion in the MDIO bus driver.
>>
>> [1] - am572x-idk, am571x-idk, a437x-idk
>>
>> Signed-off-by: Roger Quadros <rogerq@ti.com>
> 
> A few comments on the binding and the code, sorry for this late review.

No problem at all.
> 
>> +Example :
>> +This example shows these optional properties, plus other properties
>> +required for the TI Davinci MDIO driver.
>> +
>> +	davinci_mdio: ethernet@0x5c030000 {
>> +		compatible = "ti,davinci_mdio";
>> +		reg = <0x5c030000 0x1000>;
>> +		#address-cells = <1>;
>> +		#size-cells = <0>;
>> +
>> +		reset-gpios = <&gpio2 5 GPIO_ACTIVE_LOW>;
>> +		reset-delay-us = <2>;   /* PHY datasheet states 1uS min */
> 
> us is micro seconds, uS is micro siemens.

OK.

> 
>> +
>> +		ethphy0: ethernet-phy@1 {
>> +			reg = <1>;
>> +		};
>> +
>> +		ethphy1: ethernet-phy@3 {
>> +			reg = <3>;
>> +		};
>> +	};
> 
>>  
>> +	/* de-assert bus level PHY GPIO resets */
>> +	for (i = 0; i < bus->num_reset_gpios; i++) {
>> +		gpiod = devm_gpiod_get_index(&bus->dev, "reset", i,
>> +					     GPIOD_OUT_LOW);
>> +		if (IS_ERR(gpiod)) {
>> +			err = PTR_ERR(gpiod);
>> +			if (err != -ENOENT) {
>> +				pr_err("mii_bus %s couldn't get reset GPIO\n",
>> +				       bus->id);
> 
> Could we use dev_err(&bus->dev) here to better identify which MDIO bus
> is returning the problem?

Sure.
> 
>> +				return err;
> 
> Should we somehow "unwind" the reset lines we were able to successfully
> take out of reset and therefore put back into reset state? How about
> mdiobus_unregister()? Should we have similar code there, if not for
> correctness to be more power efficient?

Al right.

> 
>> +			}
>> +		} else {
>> +			gpiod_set_value_cansleep(gpiod, 1);
>> +			udelay(bus->reset_delay_us);
>> +			gpiod_set_value_cansleep(gpiod, 0);
> 
> Does that work even if the polarity of the reset line is active low?
> 

Yes. The polarity needs to be specified at DT as explained by Andrew already.

cheers,
-roger

^ permalink raw reply

* Re: [PATCH net-next] net: dsa: Remove redundant NULL dst check
From: Juergen Borleis @ 2017-04-21  7:29 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: netdev, Andrew Lunn, Vivien Didelot, David S. Miller, open list
In-Reply-To: <20170420224723.6916-1-f.fainelli@gmail.com>

Hi Florian,

On Friday 21 April 2017 00:47:22 Florian Fainelli wrote:
> tag_lan9303.c does check for a NULL dst but that's already checked by
> dsa_switch_rcv() one layer above.
>
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
>  net/dsa/tag_lan9303.c | 5 -----
>  1 file changed, 5 deletions(-)
>
> diff --git a/net/dsa/tag_lan9303.c b/net/dsa/tag_lan9303.c
> index 563b6c8fe445..70130ed5c21a 100644
> --- a/net/dsa/tag_lan9303.c
> +++ b/net/dsa/tag_lan9303.c
> @@ -79,11 +79,6 @@ static struct sk_buff *lan9303_rcv(struct sk_buff
> *skb, struct net_device *dev, struct dsa_switch *ds;
>  	unsigned int source_port;
>
> -	if (unlikely(!dst)) {
> -		dev_warn_ratelimited(&dev->dev, "Dropping packet, due to missing switch tree device\n");
> -		return NULL; 
> -	}
> -
>  	ds = dst->ds[0];
>
>  	if (unlikely(!ds)) {

Thanks!

Acked-by: Juergen Borleis <jbe@pengutronix.de>

-- 
Pengutronix e.K.                             | Juergen Borleis             |
Industrial Linux Solutions                   | http://www.pengutronix.de/  |

^ permalink raw reply

* [PATCH net v3 3/3] net: hns: fixed bug that skb used after kfree
From: Yankejian @ 2017-04-21  7:44 UTC (permalink / raw)
  To: davem, salil.mehta, yisen.zhuang, lipeng321, huangdaode,
	zhouhuiru
  Cc: netdev, charles.chenxin, linuxarm
In-Reply-To: <1492760684-117205-1-git-send-email-yankejian@huawei.com>

From: lipeng <lipeng321@huawei.com>

There is KASAN warning which turn out it's a skb used after free:

    BUG: KASAN: use-after-free in hns_nic_net_xmit_hw+0x62c/0x940...
    [17659.112635]      alloc_debug_processing+0x18c/0x1a0
    [17659.117208]      __slab_alloc+0x52c/0x560
    [17659.120909]      kmem_cache_alloc_node+0xac/0x2c0
    [17659.125309]      __alloc_skb+0x6c/0x260
    [17659.128837]      tcp_send_ack+0x8c/0x280
    [17659.132449]      __tcp_ack_snd_check+0x9c/0xf0
    [17659.136587]      tcp_rcv_established+0x5a4/0xa70
    [17659.140899]      tcp_v4_do_rcv+0x27c/0x620
    [17659.144687]      tcp_prequeue_process+0x108/0x170
    [17659.149085]      tcp_recvmsg+0x940/0x1020
    [17659.152787]      inet_recvmsg+0x124/0x180
    [17659.156488]      sock_recvmsg+0x64/0x80
    [17659.160012]      SyS_recvfrom+0xd8/0x180
    [17659.163626]      __sys_trace_return+0x0/0x4
    [17659.167506] INFO: Freed in kfree_skbmem+0xa0/0xb0 age=23 cpu=1 pid=13
    [17659.174000]      free_debug_processing+0x1d4/0x2c0
    [17659.178486]      __slab_free+0x240/0x390
    [17659.182100]      kmem_cache_free+0x24c/0x270
    [17659.186062]      kfree_skbmem+0xa0/0xb0
    [17659.189587]      __kfree_skb+0x28/0x40
    [17659.193025]      napi_gro_receive+0x168/0x1c0
    [17659.197074]      hns_nic_rx_up_pro+0x58/0x90
    [17659.201038]      hns_nic_rx_poll_one+0x518/0xbc0
    [17659.205352]      hns_nic_common_poll+0x94/0x140
    [17659.209576]      net_rx_action+0x458/0x5e0
    [17659.213363]      __do_softirq+0x1b8/0x480
    [17659.217062]      run_ksoftirqd+0x64/0x80
    [17659.220679]      smpboot_thread_fn+0x224/0x310
    [17659.224821]      kthread+0x150/0x170
    [17659.228084]      ret_from_fork+0x10/0x40

    BUG: KASAN: use-after-free in hns_nic_net_xmit+0x8c/0xc0...
    [17751.080490]      __slab_alloc+0x52c/0x560
    [17751.084188]      kmem_cache_alloc+0x244/0x280
    [17751.088238]      __build_skb+0x40/0x150
    [17751.091764]      build_skb+0x28/0x100
    [17751.095115]      __alloc_rx_skb+0x94/0x150
    [17751.098900]      __napi_alloc_skb+0x34/0x90
    [17751.102776]      hns_nic_rx_poll_one+0x180/0xbc0
    [17751.107097]      hns_nic_common_poll+0x94/0x140
    [17751.111333]      net_rx_action+0x458/0x5e0
    [17751.115123]      __do_softirq+0x1b8/0x480
    [17751.118823]      run_ksoftirqd+0x64/0x80
    [17751.122437]      smpboot_thread_fn+0x224/0x310
    [17751.126575]      kthread+0x150/0x170
    [17751.129838]      ret_from_fork+0x10/0x40
    [17751.133454] INFO: Freed in kfree_skbmem+0xa0/0xb0 age=19 cpu=7 pid=43
    [17751.139951]      free_debug_processing+0x1d4/0x2c0
    [17751.144436]      __slab_free+0x240/0x390
    [17751.148051]      kmem_cache_free+0x24c/0x270
    [17751.152014]      kfree_skbmem+0xa0/0xb0
    [17751.155543]      __kfree_skb+0x28/0x40
    [17751.159022]      napi_gro_receive+0x168/0x1c0
    [17751.163074]      hns_nic_rx_up_pro+0x58/0x90
    [17751.167041]      hns_nic_rx_poll_one+0x518/0xbc0
    [17751.171358]      hns_nic_common_poll+0x94/0x140
    [17751.175585]      net_rx_action+0x458/0x5e0
    [17751.179373]      __do_softirq+0x1b8/0x480
    [17751.183076]      run_ksoftirqd+0x64/0x80
    [17751.186691]      smpboot_thread_fn+0x224/0x310
    [17751.190826]      kthread+0x150/0x170
    [17751.194093]      ret_from_fork+0x10/0x40

in drivers/net/ethernet/hisilicon/hns/hns_enet.c

    static netdev_tx_t hns_nic_net_xmit(struct sk_buff *skb,
                                        struct net_device *ndev)
    {
        struct hns_nic_priv *priv = netdev_priv(ndev);
        int ret;

        assert(skb->queue_mapping < ndev->ae_handle->q_num);
        ret = hns_nic_net_xmit_hw(ndev, skb,
                                  &tx_ring_data(priv, skb->queue_mapping));
        if (ret == NETDEV_TX_OK) {
                netif_trans_update(ndev);
                ndev->stats.tx_bytes += skb->len;
                ndev->stats.tx_packets++;
        }
         return (netdev_tx_t)ret;
    }

skb maybe freed in hns_nic_net_xmit_hw() and return NETDEV_TX_OK:

    out_err_tx_ok:

        dev_kfree_skb_any(skb);
        return NETDEV_TX_OK;

This patch fix this bug.

Reported-by: Jun He <hjat2005@huawei.com>
Signed-off-by: lipeng <lipeng321@huawei.com>
Reviewed-by: Yisen Zhuang <yisen.zhuang@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns/hns_enet.c | 22 ++++++++++------------
 drivers/net/ethernet/hisilicon/hns/hns_enet.h |  6 +++---
 2 files changed, 13 insertions(+), 15 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns/hns_enet.c b/drivers/net/ethernet/hisilicon/hns/hns_enet.c
index fca37e2..1e04df6 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_enet.c
+++ b/drivers/net/ethernet/hisilicon/hns/hns_enet.c
@@ -300,9 +300,9 @@ static void fill_tso_desc(struct hnae_ring *ring, void *priv,
 			     mtu);
 }
 
-int hns_nic_net_xmit_hw(struct net_device *ndev,
-			struct sk_buff *skb,
-			struct hns_nic_ring_data *ring_data)
+netdev_tx_t hns_nic_net_xmit_hw(struct net_device *ndev,
+				struct sk_buff *skb,
+				struct hns_nic_ring_data *ring_data)
 {
 	struct hns_nic_priv *priv = netdev_priv(ndev);
 	struct hnae_ring *ring = ring_data->ring;
@@ -361,6 +361,10 @@ int hns_nic_net_xmit_hw(struct net_device *ndev,
 	dev_queue = netdev_get_tx_queue(ndev, skb->queue_mapping);
 	netdev_tx_sent_queue(dev_queue, skb->len);
 
+	netif_trans_update(ndev);
+	ndev->stats.tx_bytes += skb->len;
+	ndev->stats.tx_packets++;
+
 	wmb(); /* commit all data before submit */
 	assert(skb->queue_mapping < priv->ae_handle->q_num);
 	hnae_queue_xmit(priv->ae_handle->qs[skb->queue_mapping], buf_num);
@@ -1474,17 +1478,11 @@ static netdev_tx_t hns_nic_net_xmit(struct sk_buff *skb,
 				    struct net_device *ndev)
 {
 	struct hns_nic_priv *priv = netdev_priv(ndev);
-	int ret;
 
 	assert(skb->queue_mapping < ndev->ae_handle->q_num);
-	ret = hns_nic_net_xmit_hw(ndev, skb,
-				  &tx_ring_data(priv, skb->queue_mapping));
-	if (ret == NETDEV_TX_OK) {
-		netif_trans_update(ndev);
-		ndev->stats.tx_bytes += skb->len;
-		ndev->stats.tx_packets++;
-	}
-	return (netdev_tx_t)ret;
+
+	return hns_nic_net_xmit_hw(ndev, skb,
+				   &tx_ring_data(priv, skb->queue_mapping));
 }
 
 static int hns_nic_change_mtu(struct net_device *ndev, int new_mtu)
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_enet.h b/drivers/net/ethernet/hisilicon/hns/hns_enet.h
index 5b412de..7bc6a6e 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_enet.h
+++ b/drivers/net/ethernet/hisilicon/hns/hns_enet.h
@@ -91,8 +91,8 @@ struct hns_nic_priv {
 void hns_nic_net_reset(struct net_device *ndev);
 void hns_nic_net_reinit(struct net_device *netdev);
 int hns_nic_init_phy(struct net_device *ndev, struct hnae_handle *h);
-int hns_nic_net_xmit_hw(struct net_device *ndev,
-			struct sk_buff *skb,
-			struct hns_nic_ring_data *ring_data);
+netdev_tx_t hns_nic_net_xmit_hw(struct net_device *ndev,
+				struct sk_buff *skb,
+				struct hns_nic_ring_data *ring_data);
 
 #endif	/**__HNS_ENET_H */
-- 
1.9.1

^ permalink raw reply related

* [PATCH net v2 2/3] net: hns: support deferred probe when no mdio
From: Yankejian @ 2017-04-21  7:44 UTC (permalink / raw)
  To: davem, salil.mehta, yisen.zhuang, lipeng321, huangdaode,
	zhouhuiru
  Cc: netdev, charles.chenxin, linuxarm
In-Reply-To: <1492760684-117205-1-git-send-email-yankejian@huawei.com>

From: lipeng <lipeng321@huawei.com>

In the hip06 and hip07 SoCs, phy connect to mdio bus.The mdio
module is probed with module_init, and, as such,
is not guaranteed to probe before the HNS driver. So we need
to support deferred probe.

We check for probe deferral in the mac init, so we not init DSAF
when there is no mdio, and free all resource, to later learn that
we need to defer the probe.

Signed-off-by: lipeng <lipeng321@huawei.com>
Reviewed-by: Yisen Zhuang <yisen.zhuang@huawei.com>

---
change log:
V1 -> V2:
1. Return appropriate errno in hns_mac_register_phy;
---
---
 drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c | 39 +++++++++++++++++++----
 1 file changed, 33 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c
index bdd8cdd..8c00e09 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c
+++ b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c
@@ -735,6 +735,8 @@ static int hns_mac_init_ex(struct hns_mac_cb *mac_cb)
 	rc = phy_device_register(phy);
 	if (rc) {
 		phy_device_free(phy);
+		dev_err(&mdio->dev, "registered phy fail at address %i\n",
+			addr);
 		return -ENODEV;
 	}
 
@@ -745,7 +747,7 @@ static int hns_mac_init_ex(struct hns_mac_cb *mac_cb)
 	return 0;
 }
 
-static void hns_mac_register_phy(struct hns_mac_cb *mac_cb)
+static int hns_mac_register_phy(struct hns_mac_cb *mac_cb)
 {
 	struct acpi_reference_args args;
 	struct platform_device *pdev;
@@ -755,24 +757,39 @@ static void hns_mac_register_phy(struct hns_mac_cb *mac_cb)
 
 	/* Loop over the child nodes and register a phy_device for each one */
 	if (!to_acpi_device_node(mac_cb->fw_port))
-		return;
+		return -ENODEV;
 
 	rc = acpi_node_get_property_reference(
 			mac_cb->fw_port, "mdio-node", 0, &args);
 	if (rc)
-		return;
+		return rc;
 
 	addr = hns_mac_phy_parse_addr(mac_cb->dev, mac_cb->fw_port);
 	if (addr < 0)
-		return;
+		return addr;
 
 	/* dev address in adev */
 	pdev = hns_dsaf_find_platform_device(acpi_fwnode_handle(args.adev));
+	if (!pdev) {
+		dev_err(mac_cb->dev, "mac%d mdio pdev is NULL\n",
+			mac_cb->mac_id);
+		return  -EINVAL;
+	}
+
 	mii_bus = platform_get_drvdata(pdev);
+	if (!mii_bus) {
+		dev_err(mac_cb->dev,
+			"mac%d mdio is NULL, dsaf will probe again later\n",
+			mac_cb->mac_id);
+		return -EPROBE_DEFER;
+	}
+
 	rc = hns_mac_register_phydev(mii_bus, mac_cb, addr);
 	if (!rc)
 		dev_dbg(mac_cb->dev, "mac%d register phy addr:%d\n",
 			mac_cb->mac_id, addr);
+
+	return rc;
 }
 
 #define MAC_MEDIA_TYPE_MAX_LEN		16
@@ -793,7 +810,7 @@ static void hns_mac_register_phy(struct hns_mac_cb *mac_cb)
  *@np:device node
  * return: 0 --success, negative --fail
  */
-static int  hns_mac_get_info(struct hns_mac_cb *mac_cb)
+static int hns_mac_get_info(struct hns_mac_cb *mac_cb)
 {
 	struct device_node *np;
 	struct regmap *syscon;
@@ -903,7 +920,15 @@ static int  hns_mac_get_info(struct hns_mac_cb *mac_cb)
 			}
 		}
 	} else if (is_acpi_node(mac_cb->fw_port)) {
-		hns_mac_register_phy(mac_cb);
+		ret = hns_mac_register_phy(mac_cb);
+		/*
+		 * Mac can work well if there is phy or not.If the port don't
+		 * connect with phy, the return value will be ignored. Only
+		 * when there is phy but can't find mdio bus, the return value
+		 * will be handled.
+		 */
+		if (ret == -EPROBE_DEFER)
+			return ret;
 	} else {
 		dev_err(mac_cb->dev, "mac%d cannot find phy node\n",
 			mac_cb->mac_id);
@@ -1065,6 +1090,7 @@ int hns_mac_init(struct dsaf_device *dsaf_dev)
 			dsaf_dev->mac_cb[port_id] = mac_cb;
 		}
 	}
+
 	/* init mac_cb for all port */
 	for (port_id = 0; port_id < max_port_num; port_id++) {
 		mac_cb = dsaf_dev->mac_cb[port_id];
@@ -1074,6 +1100,7 @@ int hns_mac_init(struct dsaf_device *dsaf_dev)
 		ret = hns_mac_get_cfg(dsaf_dev, mac_cb);
 		if (ret)
 			return ret;
+
 		ret = hns_mac_init_ex(mac_cb);
 		if (ret)
 			return ret;
-- 
1.9.1

^ permalink raw reply related

* [PATCH net v2 1/3] net: hns: support deferred probe when can not obtain irq
From: Yankejian @ 2017-04-21  7:44 UTC (permalink / raw)
  To: davem, salil.mehta, yisen.zhuang, lipeng321, huangdaode,
	zhouhuiru
  Cc: netdev, charles.chenxin, linuxarm
In-Reply-To: <1492760684-117205-1-git-send-email-yankejian@huawei.com>

From: lipeng <lipeng321@huawei.com>

In the hip06 and hip07 SoCs, the interrupt lines from the
DSAF controllers are connected to mbigen hw module.
The mbigen module is probed with module_init, and, as such,
is not guaranteed to probe before the HNS driver. So we need
to support deferred probe.

We check for probe deferral in the hw layer probe, so we not
probe into the main layer and memories, etc., to later learn
that we need to defer the probe.

Signed-off-by: lipeng <lipeng321@huawei.com>
Reviewed-by: Yisen Zhuang <yisen.zhuang@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c
index 403ea9d..2da5b42 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c
+++ b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c
@@ -2971,6 +2971,18 @@ static int hns_dsaf_probe(struct platform_device *pdev)
 	struct dsaf_device *dsaf_dev;
 	int ret;
 
+	/*
+	 * Check if we should defer the probe before we probe the
+	 * dsaf, as it's hard to defer later on.
+	 */
+	ret = platform_get_irq(pdev, 0);
+	if (ret < 0) {
+		if (ret != -EPROBE_DEFER)
+			dev_err(&pdev->dev, "Cannot obtain irq\n");
+
+		return ret;
+	}
+
 	dsaf_dev = hns_dsaf_alloc_dev(&pdev->dev, sizeof(struct dsaf_drv_priv));
 	if (IS_ERR(dsaf_dev)) {
 		ret = PTR_ERR(dsaf_dev);
-- 
1.9.1

^ permalink raw reply related

* [PATCH net v2 0/3] net: hns: bug fix for HNS driver
From: Yankejian @ 2017-04-21  7:44 UTC (permalink / raw)
  To: davem, salil.mehta, yisen.zhuang, lipeng321, huangdaode,
	zhouhuiru
  Cc: netdev, charles.chenxin, linuxarm

From: lipeng <lipeng321@huawei.com>

This series adds support defered probe when mdio or mbigen module
insmod behind HNS driver, and fixes a bug that a skb has been
freed, but it may be still used in driver.

change log:
V1 -> V2:
1. Return appropriate errno in hns_mac_register_phy;

lipeng (3):
  net: hns: support deferred probe when can not obtain irq
  net: hns: support deferred probe when no mdio
  net: hns: fixed bug that skb used after kfree

 drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c  | 39 ++++++++++++++++++----
 drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c | 12 +++++++
 drivers/net/ethernet/hisilicon/hns/hns_enet.c      | 22 ++++++------
 drivers/net/ethernet/hisilicon/hns/hns_enet.h      |  6 ++--
 4 files changed, 58 insertions(+), 21 deletions(-)

-- 
1.9.1

^ permalink raw reply

* Re: [PATCH net-next 2/3] net: hns: support deferred probe when no mdio
From: lipeng (Y) @ 2017-04-21  7:18 UTC (permalink / raw)
  To: Matthias Brugger, Yankejian, davem, salil.mehta, yisen.zhuang,
	allenhuangsz10, huangdaode, hjat.hejun, zhangping5, qichengming,
	qumingguang, zhouhuiru
  Cc: netdev, charles.chenxin, linuxarm
In-Reply-To: <5c299e38-88f0-9801-5e7b-477e6fa0db18@gmail.com>



On 2017/4/20 19:13, Matthias Brugger wrote:
> On 18/04/17 12:12, Yankejian wrote:
>> From: lipeng <lipeng321@huawei.com>
>>
>> In the hip06 and hip07 SoCs, phy connect to mdio bus.The mdio
>> module is probed with module_init, and, as such,
>> is not guaranteed to probe before the HNS driver. So we need
>> to support deferred probe.
>>
>> We check for probe deferral in the mac init, so we not init DSAF
>> when there is no mdio, and free all resource, to later learn that
>> we need to defer the probe.
>>
>> Signed-off-by: lipeng <lipeng321@huawei.com>
>
> on which kernel version is this patch based?
> I checked against next-20170420 and it does not apply.
>

Will refloat this patchset on net.

thanks.
lipeng
>
>> ---
>>  drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c | 34 
>> +++++++++++++++++++----
>>  1 file changed, 28 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c 
>> b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c
>> index bdd8cdd..284ebfe 100644
>> --- a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c
>> +++ b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c
>> @@ -735,6 +735,8 @@ static int hns_mac_init_ex(struct hns_mac_cb 
>> *mac_cb)
>>      rc = phy_device_register(phy);
>>      if (rc) {
>>          phy_device_free(phy);
>> +        dev_err(&mdio->dev, "registered phy fail at address %i\n",
>> +            addr);
>>          return -ENODEV;
>>      }
>>
>> @@ -745,7 +747,7 @@ static int hns_mac_init_ex(struct hns_mac_cb 
>> *mac_cb)
>>      return 0;
>>  }
>>
>> -static void hns_mac_register_phy(struct hns_mac_cb *mac_cb)
>> +static int hns_mac_register_phy(struct hns_mac_cb *mac_cb)
>>  {
>>      struct acpi_reference_args args;
>>      struct platform_device *pdev;
>> @@ -755,24 +757,39 @@ static void hns_mac_register_phy(struct 
>> hns_mac_cb *mac_cb)
>>
>>      /* Loop over the child nodes and register a phy_device for each 
>> one */
>>      if (!to_acpi_device_node(mac_cb->fw_port))
>> -        return;
>> +        return 0;
>
> Please return appropriate errno.
>
>>
>>      rc = acpi_node_get_property_reference(
>>              mac_cb->fw_port, "mdio-node", 0, &args);
>>      if (rc)
>> -        return;
>> +        return 0;
>
> Please return appropriate errno.
>
>>
>>      addr = hns_mac_phy_parse_addr(mac_cb->dev, mac_cb->fw_port);
>>      if (addr < 0)
>> -        return;
>> +        return 0;
>
> Shouldn't we just error out here by returning addr?
>
>>
>>      /* dev address in adev */
>>      pdev = 
>> hns_dsaf_find_platform_device(acpi_fwnode_handle(args.adev));
>> +    if (!pdev) {
>> +        dev_err(mac_cb->dev, "mac%d mdio pdev is NULL\n",
>> +            mac_cb->mac_id);
>> +        return 0;
>
> Please return appropriate errno.
>
> Regards,
> Matthias
>
>> +    }
>> +
>>      mii_bus = platform_get_drvdata(pdev);
>> +    if (!mii_bus) {
>> +        dev_err(mac_cb->dev,
>> +            "mac%d mdio is NULL, dsaf will probe again later\n",
>> +            mac_cb->mac_id);
>> +        return -EPROBE_DEFER;
>> +    }
>> +
>>      rc = hns_mac_register_phydev(mii_bus, mac_cb, addr);
>>      if (!rc)
>>          dev_dbg(mac_cb->dev, "mac%d register phy addr:%d\n",
>>              mac_cb->mac_id, addr);
>> +
>> +    return rc;
>>  }
>>
>>  #define MAC_MEDIA_TYPE_MAX_LEN        16
>> @@ -793,7 +810,7 @@ static void hns_mac_register_phy(struct 
>> hns_mac_cb *mac_cb)
>>   *@np:device node
>>   * return: 0 --success, negative --fail
>>   */
>> -static int  hns_mac_get_info(struct hns_mac_cb *mac_cb)
>> +static int hns_mac_get_info(struct hns_mac_cb *mac_cb)
>>  {
>>      struct device_node *np;
>>      struct regmap *syscon;
>> @@ -903,7 +920,10 @@ static int  hns_mac_get_info(struct hns_mac_cb 
>> *mac_cb)
>>              }
>>          }
>>      } else if (is_acpi_node(mac_cb->fw_port)) {
>> -        hns_mac_register_phy(mac_cb);
>> +        ret = hns_mac_register_phy(mac_cb);
>> +
>> +        if (ret)
>> +            return ret;
>>      } else {
>>          dev_err(mac_cb->dev, "mac%d cannot find phy node\n",
>>              mac_cb->mac_id);
>> @@ -1065,6 +1085,7 @@ int hns_mac_init(struct dsaf_device *dsaf_dev)
>>              dsaf_dev->mac_cb[port_id] = mac_cb;
>>          }
>>      }
>> +
>>      /* init mac_cb for all port */
>>      for (port_id = 0; port_id < max_port_num; port_id++) {
>>          mac_cb = dsaf_dev->mac_cb[port_id];
>> @@ -1074,6 +1095,7 @@ int hns_mac_init(struct dsaf_device *dsaf_dev)
>>          ret = hns_mac_get_cfg(dsaf_dev, mac_cb);
>>          if (ret)
>>              return ret;
>> +
>>          ret = hns_mac_init_ex(mac_cb);
>>          if (ret)
>>              return ret;
>>
>
> .
>

^ permalink raw reply

* Re: [PATCH V2 net] netdevice: Include NETIF_F_HW_CSUM when intersecting features
From: Michal Kubecek @ 2017-04-21  5:33 UTC (permalink / raw)
  To: Vlad Yasevich; +Cc: Alexander Duyck, Vladislav Yasevich, Netdev, Tom Herbert
In-Reply-To: <b34063e7-e0c2-583d-f809-02386fc175de@redhat.com>

On Thu, Apr 20, 2017 at 07:19:55PM -0400, Vlad Yasevich wrote:
> 
> Having said that, the other alternative is to inherit hw_features from
> lower devices.  BTW, bonding I think has a similar "issue" you are
> describing since it prefers HW_CSUM if any of the slaves have it set.

It does but bonding uses netdev_increment_features() to combine slave
features and this function handles checksumming like "or", not "and"
(not only checksumming, also flags in NETIF_F_ONE_FOR_ALL).

That said, it's legitimate to ask if we want some of the features to be
handled differently when computing features for a vlan device. My point
before was that if the helper is called netdev_intersect_features(), it
shouldn't return any features that are not supported by both argument
sets, even if all its current users would benefit from slightly
different behaviour. If it does, it's a trap that someone might one day
fall in.

                                                         Michal Kubecek

^ permalink raw reply

* [PATCH net-next 4/5] qed: Support dcbnl IEEE selector field.
From: Sudarsana Reddy Kalluru @ 2017-04-21  5:31 UTC (permalink / raw)
  To: davem; +Cc: netdev, Yuval.Mintz
In-Reply-To: <20170421053120.12980-1-sudarsana.kalluru@cavium.com>

Signed-off-by: Sudarsana Reddy Kalluru <Sudarsana.Kalluru@cavium.com>
Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com>
---
 drivers/net/ethernet/qlogic/qed/qed_dcbx.c    | 53 ++++++++++++++++++++++-----
 drivers/net/ethernet/qlogic/qede/qede_dcbnl.c |  5 +++
 2 files changed, 49 insertions(+), 9 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qed/qed_dcbx.c b/drivers/net/ethernet/qlogic/qed/qed_dcbx.c
index 507b79d..d79831d 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_dcbx.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_dcbx.c
@@ -2181,15 +2181,46 @@ static int qed_dcbnl_ieee_setets(struct qed_dev *cdev, struct ieee_ets *ets)
 	return qed_dcbnl_get_ieee_pfc(cdev, pfc, true);
 }
 
+static int qed_get_sf_ieee_value(u8 selector, u8 *sf_ieee)
+{
+	switch (selector) {
+	case IEEE_8021QAZ_APP_SEL_ETHERTYPE:
+		*sf_ieee = QED_DCBX_SF_IEEE_ETHTYPE;
+		break;
+	case IEEE_8021QAZ_APP_SEL_STREAM:
+		*sf_ieee = QED_DCBX_SF_IEEE_TCP_PORT;
+		break;
+	case IEEE_8021QAZ_APP_SEL_DGRAM:
+		*sf_ieee = QED_DCBX_SF_IEEE_UDP_PORT;
+		break;
+	case IEEE_8021QAZ_APP_SEL_ANY:
+		*sf_ieee = QED_DCBX_SF_IEEE_TCP_UDP_PORT;
+		break;
+	default:
+		return -EINVAL;
+	}
+
+	return 0;
+}
+
 static int qed_dcbnl_ieee_getapp(struct qed_dev *cdev, struct dcb_app *app)
 {
 	struct qed_hwfn *hwfn = QED_LEADING_HWFN(cdev);
 	struct qed_dcbx_get *dcbx_info;
 	struct qed_app_entry *entry;
-	bool ethtype;
 	u8 prio = 0;
+	u8 sf_ieee;
 	int i;
 
+	DP_VERBOSE(hwfn, QED_MSG_DCB, "selector = %d protocol = %d\n",
+		   app->selector, app->protocol);
+
+	if (qed_get_sf_ieee_value(app->selector, &sf_ieee)) {
+		DP_INFO(cdev, "Invalid selector field value %d\n",
+			app->selector);
+		return -EINVAL;
+	}
+
 	dcbx_info = qed_dcbnl_get_dcbx(hwfn, QED_DCBX_OPERATIONAL_MIB);
 	if (!dcbx_info)
 		return -EINVAL;
@@ -2200,11 +2231,9 @@ static int qed_dcbnl_ieee_getapp(struct qed_dev *cdev, struct dcb_app *app)
 		return -EINVAL;
 	}
 
-	/* ieee defines the selector field value for ethertype to be 1 */
-	ethtype = !!((app->selector - 1) == DCB_APP_IDTYPE_ETHTYPE);
 	for (i = 0; i < QED_DCBX_MAX_APP_PROTOCOL; i++) {
 		entry = &dcbx_info->operational.params.app_entry[i];
-		if ((entry->ethtype == ethtype) &&
+		if ((entry->sf_ieee == sf_ieee) &&
 		    (entry->proto_id == app->protocol)) {
 			prio = entry->prio;
 			break;
@@ -2232,14 +2261,22 @@ static int qed_dcbnl_ieee_setapp(struct qed_dev *cdev, struct dcb_app *app)
 	struct qed_dcbx_set dcbx_set;
 	struct qed_app_entry *entry;
 	struct qed_ptt *ptt;
-	bool ethtype;
+	u8 sf_ieee;
 	int rc, i;
 
+	DP_VERBOSE(hwfn, QED_MSG_DCB, "selector = %d protocol = %d pri = %d\n",
+		   app->selector, app->protocol, app->priority);
 	if (app->priority < 0 || app->priority >= QED_MAX_PFC_PRIORITIES) {
 		DP_INFO(hwfn, "Invalid priority %d\n", app->priority);
 		return -EINVAL;
 	}
 
+	if (qed_get_sf_ieee_value(app->selector, &sf_ieee)) {
+		DP_INFO(cdev, "Invalid selector field value %d\n",
+			app->selector);
+		return -EINVAL;
+	}
+
 	dcbx_info = qed_dcbnl_get_dcbx(hwfn, QED_DCBX_OPERATIONAL_MIB);
 	if (!dcbx_info)
 		return -EINVAL;
@@ -2257,11 +2294,9 @@ static int qed_dcbnl_ieee_setapp(struct qed_dev *cdev, struct dcb_app *app)
 	if (rc)
 		return -EINVAL;
 
-	/* ieee defines the selector field value for ethertype to be 1 */
-	ethtype = !!((app->selector - 1) == DCB_APP_IDTYPE_ETHTYPE);
 	for (i = 0; i < QED_DCBX_MAX_APP_PROTOCOL; i++) {
 		entry = &dcbx_set.config.params.app_entry[i];
-		if ((entry->ethtype == ethtype) &&
+		if ((entry->sf_ieee == sf_ieee) &&
 		    (entry->proto_id == app->protocol))
 			break;
 		/* First empty slot */
@@ -2277,7 +2312,7 @@ static int qed_dcbnl_ieee_setapp(struct qed_dev *cdev, struct dcb_app *app)
 	}
 
 	dcbx_set.override_flags |= QED_DCBX_OVERRIDE_APP_CFG;
-	dcbx_set.config.params.app_entry[i].ethtype = ethtype;
+	dcbx_set.config.params.app_entry[i].sf_ieee = sf_ieee;
 	dcbx_set.config.params.app_entry[i].proto_id = app->protocol;
 	dcbx_set.config.params.app_entry[i].prio = BIT(app->priority);
 
diff --git a/drivers/net/ethernet/qlogic/qede/qede_dcbnl.c b/drivers/net/ethernet/qlogic/qede/qede_dcbnl.c
index 03e8c02..a9e7379 100644
--- a/drivers/net/ethernet/qlogic/qede/qede_dcbnl.c
+++ b/drivers/net/ethernet/qlogic/qede/qede_dcbnl.c
@@ -281,6 +281,11 @@ static int qede_dcbnl_ieee_setapp(struct net_device *netdev,
 				  struct dcb_app *app)
 {
 	struct qede_dev *edev = netdev_priv(netdev);
+	int err;
+
+	err = dcb_ieee_setapp(netdev, app);
+	if (err)
+		return err;
 
 	return edev->ops->dcb->ieee_setapp(edev->cdev, app);
 }
-- 
1.8.3.1

^ permalink raw reply related

* [PATCH net-next 5/5] qed: Add support for static dcbx.
From: Sudarsana Reddy Kalluru @ 2017-04-21  5:31 UTC (permalink / raw)
  To: davem; +Cc: netdev, Yuval.Mintz
In-Reply-To: <20170421053120.12980-1-sudarsana.kalluru@cavium.com>

The patch adds driver support for static/local dcbx mode. In this mode
adapter brings up the dcbx link with locally configured parameters
instead of performing the dcbx negotiation with the peer. The feature
is useful when peer device/switch doesn't support dcbx.

Signed-off-by: Sudarsana Reddy Kalluru <Sudarsana.Kalluru@cavium.com>
Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com>
---
 drivers/net/ethernet/qlogic/qed/qed_dcbx.c | 24 +++++++++++++++++++-----
 include/linux/qed/qed_if.h                 |  1 +
 2 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qed/qed_dcbx.c b/drivers/net/ethernet/qlogic/qed/qed_dcbx.c
index d79831d..8b4ea77 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_dcbx.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_dcbx.c
@@ -673,8 +673,14 @@ static int qed_dcbx_process_mib_info(struct qed_hwfn *p_hwfn)
 		 DCBX_CONFIG_VERSION_CEE);
 	p_operational->cee = val;
 
-	DP_VERBOSE(p_hwfn, QED_MSG_DCB, "Version support: ieee %d, cee %d\n",
-		   p_operational->ieee, p_operational->cee);
+	val = !!(QED_MFW_GET_FIELD(flags, DCBX_CONFIG_VERSION) ==
+		 DCBX_CONFIG_VERSION_STATIC);
+	p_operational->local = val;
+
+	DP_VERBOSE(p_hwfn, QED_MSG_DCB,
+		   "Version support: ieee %d, cee %d, static %d\n",
+		   p_operational->ieee, p_operational->cee,
+		   p_operational->local);
 
 	qed_dcbx_get_common_params(p_hwfn, &p_feat->app,
 				   p_feat->app.app_pri_tbl, &p_feat->ets,
@@ -1226,6 +1232,8 @@ int qed_dcbx_get_config_params(struct qed_hwfn *p_hwfn,
 		p_hwfn->p_dcbx_info->set.ver_num |= DCBX_CONFIG_VERSION_CEE;
 	if (dcbx_info->operational.ieee)
 		p_hwfn->p_dcbx_info->set.ver_num |= DCBX_CONFIG_VERSION_IEEE;
+	if (dcbx_info->operational.local)
+		p_hwfn->p_dcbx_info->set.ver_num |= DCBX_CONFIG_VERSION_STATIC;
 
 	p_hwfn->p_dcbx_info->set.enabled = dcbx_info->operational.enabled;
 	memcpy(&p_hwfn->p_dcbx_info->set.config.params,
@@ -1775,8 +1783,9 @@ static u8 qed_dcbnl_setdcbx(struct qed_dev *cdev, u8 mode)
 
 	DP_VERBOSE(hwfn, QED_MSG_DCB, "new mode = %x\n", mode);
 
-	if (!(mode & DCB_CAP_DCBX_VER_IEEE) && !(mode & DCB_CAP_DCBX_VER_CEE)) {
-		DP_INFO(hwfn, "Allowed mode is cee, ieee or both\n");
+	if (!(mode & DCB_CAP_DCBX_VER_IEEE) &&
+	    !(mode & DCB_CAP_DCBX_VER_CEE) && !(mode & DCB_CAP_DCBX_STATIC)) {
+		DP_INFO(hwfn, "Allowed modes are cee, ieee or static\n");
 		return 1;
 	}
 
@@ -1796,6 +1805,11 @@ static u8 qed_dcbnl_setdcbx(struct qed_dev *cdev, u8 mode)
 		dcbx_set.enabled = true;
 	}
 
+	if (mode & DCB_CAP_DCBX_STATIC) {
+		dcbx_set.ver_num |= DCBX_CONFIG_VERSION_STATIC;
+		dcbx_set.enabled = true;
+	}
+
 	ptt = qed_ptt_acquire(hwfn);
 	if (!ptt)
 		return 1;
@@ -1804,7 +1818,7 @@ static u8 qed_dcbnl_setdcbx(struct qed_dev *cdev, u8 mode)
 
 	qed_ptt_release(hwfn, ptt);
 
-	return 0;
+	return rc;
 }
 
 static u8 qed_dcbnl_getfeatcfg(struct qed_dev *cdev, int featid, u8 *flags)
diff --git a/include/linux/qed/qed_if.h b/include/linux/qed/qed_if.h
index d44933a..9f966be895 100644
--- a/include/linux/qed/qed_if.h
+++ b/include/linux/qed/qed_if.h
@@ -144,6 +144,7 @@ struct qed_dcbx_operational_params {
 	bool enabled;
 	bool ieee;
 	bool cee;
+	bool local;
 	u32 err;
 };
 
-- 
1.8.3.1

^ permalink raw reply related

* [PATCH net-next 3/5] qed: Add additional DCBx debug messages.
From: Sudarsana Reddy Kalluru @ 2017-04-21  5:31 UTC (permalink / raw)
  To: davem; +Cc: netdev, Yuval.Mintz
In-Reply-To: <20170421053120.12980-1-sudarsana.kalluru@cavium.com>

Signed-off-by: Sudarsana Reddy Kalluru <Sudarsana.Kalluru@cavium.com>
Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com>
---
 drivers/net/ethernet/qlogic/qed/qed_dcbx.c | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qed/qed_dcbx.c b/drivers/net/ethernet/qlogic/qed/qed_dcbx.c
index d868b7e..507b79d 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_dcbx.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_dcbx.c
@@ -556,8 +556,9 @@ static int qed_dcbx_process_mib_info(struct qed_hwfn *p_hwfn)
 	p_params->pfc.prio[7] = !!(pfc_map & DCBX_PFC_PRI_EN_BITMAP_PRI_7);
 
 	DP_VERBOSE(p_hwfn, QED_MSG_DCB,
-		   "PFC params: willing %d, pfc_bitmap %d\n",
-		   p_params->pfc.willing, pfc_map);
+		   "PFC params: willing %d, pfc_bitmap %u max_tc = %u enabled = %d\n",
+		   p_params->pfc.willing, pfc_map, p_params->pfc.max_tc,
+		   p_params->pfc.enabled);
 }
 
 static void
@@ -576,10 +577,10 @@ static int qed_dcbx_process_mib_info(struct qed_hwfn *p_hwfn)
 	p_params->max_ets_tc = QED_MFW_GET_FIELD(p_ets->flags,
 						 DCBX_ETS_MAX_TCS);
 	DP_VERBOSE(p_hwfn, QED_MSG_DCB,
-		   "ETS params: willing %d, ets_cbs %d pri_tc_tbl_0 %x max_ets_tc %d\n",
-		   p_params->ets_willing,
-		   p_params->ets_cbs,
-		   p_ets->pri_tc_tbl[0], p_params->max_ets_tc);
+		   "ETS params: willing %d, enabled = %d ets_cbs %d pri_tc_tbl_0 %x max_ets_tc %d\n",
+		   p_params->ets_willing, p_params->ets_enabled,
+		   p_params->ets_cbs, p_ets->pri_tc_tbl[0],
+		   p_params->max_ets_tc);
 
 	/* 8 bit tsa and bw data corresponding to each of the 8 TC's are
 	 * encoded in a type u32 array of size 2.
@@ -658,6 +659,7 @@ static int qed_dcbx_process_mib_info(struct qed_hwfn *p_hwfn)
 	if (!enabled) {
 		p_operational->enabled = enabled;
 		p_operational->valid = false;
+		DP_VERBOSE(p_hwfn, QED_MSG_DCB, "Dcbx is disabled\n");
 		return;
 	}
 
@@ -1145,6 +1147,9 @@ static int qed_dcbx_query_params(struct qed_hwfn *p_hwfn,
 		local_admin->config = DCBX_CONFIG_VERSION_DISABLED;
 	}
 
+	DP_VERBOSE(p_hwfn, QED_MSG_DCB, "Dcbx version = %d\n",
+		   local_admin->config);
+
 	if (params->override_flags & QED_DCBX_OVERRIDE_PFC_CFG)
 		qed_dcbx_set_pfc_data(p_hwfn, &local_admin->features.pfc,
 				      &params->config.params);
-- 
1.8.3.1

^ permalink raw reply related

* [PATCH net-next 2/5] qed: Separate RoCE DCBx support for V2.
From: Sudarsana Reddy Kalluru @ 2017-04-21  5:31 UTC (permalink / raw)
  To: davem; +Cc: netdev, Yuval.Mintz
In-Reply-To: <20170421053120.12980-1-sudarsana.kalluru@cavium.com>

In the older firmware there was no distinction between RoCE and RoCEv2
whereas the newer firmware (8.15.3.0) allows us to configure each
independently. Driver need to populate the RoCEv2 data in its specific
structure.

Signed-off-by: Sudarsana Reddy Kalluru <Sudarsana.Kalluru@cavium.com>
Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com>
---
 drivers/net/ethernet/qlogic/qed/qed_dcbx.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qed/qed_dcbx.c b/drivers/net/ethernet/qlogic/qed/qed_dcbx.c
index 9b4580b..d868b7e 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_dcbx.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_dcbx.c
@@ -944,14 +944,9 @@ void qed_dcbx_set_pf_update_params(struct qed_dcbx_results *p_src,
 	p_dcb_data = &p_dest->fcoe_dcb_data;
 	qed_dcbx_update_protocol_data(p_dcb_data, p_src, DCBX_PROTOCOL_FCOE);
 	p_dcb_data = &p_dest->roce_dcb_data;
-
-	if (p_src->arr[DCBX_PROTOCOL_ROCE].update)
-		qed_dcbx_update_protocol_data(p_dcb_data, p_src,
-					      DCBX_PROTOCOL_ROCE);
-	if (p_src->arr[DCBX_PROTOCOL_ROCE_V2].update)
-		qed_dcbx_update_protocol_data(p_dcb_data, p_src,
-					      DCBX_PROTOCOL_ROCE_V2);
-
+	qed_dcbx_update_protocol_data(p_dcb_data, p_src, DCBX_PROTOCOL_ROCE);
+	p_dcb_data = &p_dest->rroce_dcb_data;
+	qed_dcbx_update_protocol_data(p_dcb_data, p_src, DCBX_PROTOCOL_ROCE_V2);
 	p_dcb_data = &p_dest->iscsi_dcb_data;
 	qed_dcbx_update_protocol_data(p_dcb_data, p_src, DCBX_PROTOCOL_ISCSI);
 	p_dcb_data = &p_dest->eth_dcb_data;
-- 
1.8.3.1

^ permalink raw reply related

* [PATCH net-next 1/5] qed: Cleanup DCBx unnecessary parameters.
From: Sudarsana Reddy Kalluru @ 2017-04-21  5:31 UTC (permalink / raw)
  To: davem; +Cc: netdev, Yuval.Mintz
In-Reply-To: <20170421053120.12980-1-sudarsana.kalluru@cavium.com>

Signed-off-by: Sudarsana Reddy Kalluru <Sudarsana.Kalluru@cavium.com>
Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com>
---
 drivers/net/ethernet/qlogic/qed/qed_dcbx.c | 38 ++++++++++++------------------
 drivers/net/ethernet/qlogic/qed/qed_dcbx.h |  2 +-
 drivers/net/ethernet/qlogic/qed/qed_dev.c  |  2 +-
 3 files changed, 17 insertions(+), 25 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qed/qed_dcbx.c b/drivers/net/ethernet/qlogic/qed/qed_dcbx.c
index 2fc1fde..9b4580b 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_dcbx.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_dcbx.c
@@ -271,8 +271,8 @@ static bool qed_dcbx_roce_v2_tlv(u32 app_info_bitmap, u16 proto_id, bool ieee)
 		     struct dcbx_app_priority_entry *p_tbl,
 		     u32 pri_tc_tbl, int count, u8 dcbx_version)
 {
-	u8 tc, priority_map;
 	enum dcbx_protocol_type type;
+	u8 tc, priority_map;
 	bool enable, ieee;
 	u16 protocol_id;
 	int priority;
@@ -613,8 +613,7 @@ static int qed_dcbx_process_mib_info(struct qed_hwfn *p_hwfn)
 }
 
 static void
-qed_dcbx_get_local_params(struct qed_hwfn *p_hwfn,
-			  struct qed_ptt *p_ptt, struct qed_dcbx_get *params)
+qed_dcbx_get_local_params(struct qed_hwfn *p_hwfn, struct qed_dcbx_get *params)
 {
 	struct dcbx_features *p_feat;
 
@@ -626,8 +625,7 @@ static int qed_dcbx_process_mib_info(struct qed_hwfn *p_hwfn)
 }
 
 static void
-qed_dcbx_get_remote_params(struct qed_hwfn *p_hwfn,
-			   struct qed_ptt *p_ptt, struct qed_dcbx_get *params)
+qed_dcbx_get_remote_params(struct qed_hwfn *p_hwfn, struct qed_dcbx_get *params)
 {
 	struct dcbx_features *p_feat;
 
@@ -640,7 +638,6 @@ static int qed_dcbx_process_mib_info(struct qed_hwfn *p_hwfn)
 
 static void
 qed_dcbx_get_operational_params(struct qed_hwfn *p_hwfn,
-				struct qed_ptt *p_ptt,
 				struct qed_dcbx_get *params)
 {
 	struct qed_dcbx_operational_params *p_operational;
@@ -690,7 +687,6 @@ static int qed_dcbx_process_mib_info(struct qed_hwfn *p_hwfn)
 
 static void
 qed_dcbx_get_local_lldp_params(struct qed_hwfn *p_hwfn,
-			       struct qed_ptt *p_ptt,
 			       struct qed_dcbx_get *params)
 {
 	struct lldp_config_params_s *p_local;
@@ -705,7 +701,6 @@ static int qed_dcbx_process_mib_info(struct qed_hwfn *p_hwfn)
 
 static void
 qed_dcbx_get_remote_lldp_params(struct qed_hwfn *p_hwfn,
-				struct qed_ptt *p_ptt,
 				struct qed_dcbx_get *params)
 {
 	struct lldp_status_params_s *p_remote;
@@ -719,25 +714,24 @@ static int qed_dcbx_process_mib_info(struct qed_hwfn *p_hwfn)
 }
 
 static int
-qed_dcbx_get_params(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt,
-		    struct qed_dcbx_get *p_params,
+qed_dcbx_get_params(struct qed_hwfn *p_hwfn, struct qed_dcbx_get *p_params,
 		    enum qed_mib_read_type type)
 {
 	switch (type) {
 	case QED_DCBX_REMOTE_MIB:
-		qed_dcbx_get_remote_params(p_hwfn, p_ptt, p_params);
+		qed_dcbx_get_remote_params(p_hwfn, p_params);
 		break;
 	case QED_DCBX_LOCAL_MIB:
-		qed_dcbx_get_local_params(p_hwfn, p_ptt, p_params);
+		qed_dcbx_get_local_params(p_hwfn, p_params);
 		break;
 	case QED_DCBX_OPERATIONAL_MIB:
-		qed_dcbx_get_operational_params(p_hwfn, p_ptt, p_params);
+		qed_dcbx_get_operational_params(p_hwfn, p_params);
 		break;
 	case QED_DCBX_REMOTE_LLDP_MIB:
-		qed_dcbx_get_remote_lldp_params(p_hwfn, p_ptt, p_params);
+		qed_dcbx_get_remote_lldp_params(p_hwfn, p_params);
 		break;
 	case QED_DCBX_LOCAL_LLDP_MIB:
-		qed_dcbx_get_local_lldp_params(p_hwfn, p_ptt, p_params);
+		qed_dcbx_get_local_lldp_params(p_hwfn, p_params);
 		break;
 	default:
 		DP_ERR(p_hwfn, "MIB read err, unknown mib type %d\n", type);
@@ -895,7 +889,8 @@ void qed_dcbx_aen(struct qed_hwfn *hwfn, u32 mib_type)
 			qed_sp_pf_update(p_hwfn);
 		}
 	}
-	qed_dcbx_get_params(p_hwfn, p_ptt, &p_hwfn->p_dcbx_info->get, type);
+
+	qed_dcbx_get_params(p_hwfn, &p_hwfn->p_dcbx_info->get, type);
 	qed_dcbx_aen(p_hwfn, type);
 
 	return rc;
@@ -903,17 +898,14 @@ void qed_dcbx_aen(struct qed_hwfn *hwfn, u32 mib_type)
 
 int qed_dcbx_info_alloc(struct qed_hwfn *p_hwfn)
 {
-	int rc = 0;
-
 	p_hwfn->p_dcbx_info = kzalloc(sizeof(*p_hwfn->p_dcbx_info), GFP_KERNEL);
 	if (!p_hwfn->p_dcbx_info)
-		rc = -ENOMEM;
+		return -ENOMEM;
 
-	return rc;
+	return 0;
 }
 
-void qed_dcbx_info_free(struct qed_hwfn *p_hwfn,
-			struct qed_dcbx_info *p_dcbx_info)
+void qed_dcbx_info_free(struct qed_hwfn *p_hwfn)
 {
 	kfree(p_hwfn->p_dcbx_info);
 }
@@ -985,7 +977,7 @@ static int qed_dcbx_query_params(struct qed_hwfn *p_hwfn,
 	if (rc)
 		goto out;
 
-	rc = qed_dcbx_get_params(p_hwfn, p_ptt, p_get, type);
+	rc = qed_dcbx_get_params(p_hwfn, p_get, type);
 
 out:
 	qed_ptt_release(p_hwfn, p_ptt);
diff --git a/drivers/net/ethernet/qlogic/qed/qed_dcbx.h b/drivers/net/ethernet/qlogic/qed/qed_dcbx.h
index 2eb988f..414e262 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_dcbx.h
+++ b/drivers/net/ethernet/qlogic/qed/qed_dcbx.h
@@ -119,7 +119,7 @@ int qed_dcbx_config_params(struct qed_hwfn *,
 			  struct qed_ptt *, enum qed_mib_read_type);
 
 int qed_dcbx_info_alloc(struct qed_hwfn *p_hwfn);
-void qed_dcbx_info_free(struct qed_hwfn *, struct qed_dcbx_info *);
+void qed_dcbx_info_free(struct qed_hwfn *p_hwfn);
 void qed_dcbx_set_pf_update_params(struct qed_dcbx_results *p_src,
 				   struct pf_update_ramrod_data *p_dest);
 
diff --git a/drivers/net/ethernet/qlogic/qed/qed_dev.c b/drivers/net/ethernet/qlogic/qed/qed_dev.c
index fad7319..6d24308 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_dev.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_dev.c
@@ -183,7 +183,7 @@ void qed_resc_free(struct qed_dev *cdev)
 		}
 		qed_iov_free(p_hwfn);
 		qed_dmae_info_free(p_hwfn);
-		qed_dcbx_info_free(p_hwfn, p_hwfn->p_dcbx_info);
+		qed_dcbx_info_free(p_hwfn);
 	}
 }
 
-- 
1.8.3.1

^ permalink raw reply related

* [PATCH net-next 0/5] qed*: Dcbx/dcbnl enhancements.
From: Sudarsana Reddy Kalluru @ 2017-04-21  5:31 UTC (permalink / raw)
  To: davem; +Cc: netdev, Yuval.Mintz, Sudarsana Reddy Kalluru

From: Sudarsana Reddy Kalluru <Sudarsana.Kalluru@cavium.com>

The series has set of enhancements for dcbx/dcbnl implementation of
qed/qede drivers.
 - Patches (1) & (3) capture the sematic and debug changes.
 - Patch (2) adds the driver support for populating RoCEv2 dcb data.
 - Patch (4) adds the required support for reading/configuring the
   IEEE selection field (SF).
 - Patch (5) adds the support for configuring the static dcbx mode.

Please consider applying this to 'net-next' branch.

Sudarsana Reddy Kalluru (5):
  qed: Cleanup DCBx unnecessary parameters.
  qed: Separate RoCE DCBx support for V2.
  qed: Add additional DCBx debug messages.
  qed: Support dcbnl IEEE selector field.
  qed: Add support for static dcbx.

 drivers/net/ethernet/qlogic/qed/qed_dcbx.c    | 143 +++++++++++++++++---------
 drivers/net/ethernet/qlogic/qed/qed_dcbx.h    |   2 +-
 drivers/net/ethernet/qlogic/qed/qed_dev.c     |   2 +-
 drivers/net/ethernet/qlogic/qede/qede_dcbnl.c |   5 +
 include/linux/qed/qed_if.h                    |   1 +
 5 files changed, 100 insertions(+), 53 deletions(-)

-- 
1.8.3.1

^ permalink raw reply

* Re: [PATCH 11/16] esp: Use a synchronous crypto algorithm on offloading.
From: Herbert Xu @ 2017-04-21  5:29 UTC (permalink / raw)
  To: Steffen Klassert; +Cc: David Miller, netdev
In-Reply-To: <20170420105029.GJ2649@secunet.com>

On Thu, Apr 20, 2017 at 12:50:29PM +0200, Steffen Klassert wrote:
> On Thu, Apr 20, 2017 at 05:52:35PM +0800, Herbert Xu wrote:
> > On Thu, Apr 20, 2017 at 11:17:52AM +0200, Steffen Klassert wrote:
> > >
> > > I tried to use async algorithms but it lead to serveral problems.
> > > The GSO layer can't handle async returns, we'd need callbacks
> > > for all the GSO handlers. Also we need something where we can
> > > requeue packets if the driver is busy etc.
> > 
> > Why would we need to requeue? As it is if you get an EBUSY on
> > an IPsec packet it's simply dropped.
> 
> Yes we could do this, but the GSO problem remain.
> 
> We discussed this last year at netdevconf but could not come
> up with an acceptable solutuion.

Why is it a problem exactly?

> For now this is just a fallback to make hardware offloading
> possible at all, so this is slowpath anyway. Allowing async
> algorithms can (and should) be done in a second step once we
> found a not too intrusive solution.

OK, as long as nobody gets silently switched from async to sync
then it's fine with me.

Cheers,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply

* Re: [PATCH net-next v3] bindings: net: stmmac: add missing note about LPI interrupt
From: Giuseppe CAVALLARO @ 2017-04-21  5:26 UTC (permalink / raw)
  To: Niklas Cassel, Rob Herring, Mark Rutland, David S. Miller,
	Joao Pinto, Niklas Cassel, Alexandre TORGUE, Thierry Reding,
	Eric Engestrom
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA, devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20170418123955.21335-1-niklass-VrBV9hrLPhE@public.gmane.org>

On 4/18/2017 2:39 PM, Niklas Cassel wrote:
> From: Niklas Cassel <niklas.cassel-VrBV9hrLPhE@public.gmane.org>
>
> The hardware has a LPI interrupt.
> There is already code in the stmmac driver to parse and handle the
> interrupt. However, this information was missing from the DT binding.
>
> At the same time, improve the description of the existing interrupts.
>
> Signed-off-by: Niklas Cassel <niklas.cassel-VrBV9hrLPhE@public.gmane.org>
> ---
>   Documentation/devicetree/bindings/net/stmmac.txt | 13 ++++++++-----
>   1 file changed, 8 insertions(+), 5 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/net/stmmac.txt b/Documentation/devicetree/bindings/net/stmmac.txt
> index f652b0c384ce..c3a7be6615c5 100644
> --- a/Documentation/devicetree/bindings/net/stmmac.txt
> +++ b/Documentation/devicetree/bindings/net/stmmac.txt
> @@ -7,9 +7,12 @@ Required properties:
>   - interrupt-parent: Should be the phandle for the interrupt controller
>     that services interrupts for this device
>   - interrupts: Should contain the STMMAC interrupts
> -- interrupt-names: Should contain the interrupt names "macirq"
> -  "eth_wake_irq" if this interrupt is supported in the "interrupts"
> -  property
> +- interrupt-names: Should contain a list of interrupt names corresponding to
> +	the interrupts in the interrupts property, if available.
> +	Valid interrupt names are:
> +  - "macirq" (combined signal for various interrupt events)
> +  - "eth_wake_irq" (the interrupt to manage the remote wake-up packet detection)
> +  - "eth_lpi" (the interrupt that occurs when Tx or Rx enters/exits LPI state)
>   - phy-mode: See ethernet.txt file in the same directory.
>   - snps,reset-gpio 	gpio number for phy reset.
>   - snps,reset-active-low boolean flag to indicate if phy reset is active low.
> @@ -152,8 +155,8 @@ Examples:
>   		compatible = "st,spear600-gmac";
>   		reg = <0xe0800000 0x8000>;
>   		interrupt-parent = <&vic1>;
> -		interrupts = <24 23>;
> -		interrupt-names = "macirq", "eth_wake_irq";
> +		interrupts = <24 23 22>;
> +		interrupt-names = "macirq", "eth_wake_irq", "eth_lpi";
>   		mac-address = [000000000000]; /* Filled in by U-Boot */
>   		max-frame-size = <3800>;
>   		phy-mode = "gmii";

Acked-by: Giuseppe Cavallaro <peppe.cavallaro-qxv4g6HH51o@public.gmane.org>

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ 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