Netdev List
 help / color / mirror / Atom feed
* [net-next, PATCH 1/2, v1] net: socionext: different approach on DMA
From: Ilias Apalodimas @ 2018-09-10  8:24 UTC (permalink / raw)
  To: netdev, jaswinder.singh
  Cc: ard.biesheuvel, masami.hiramatsu, arnd, mykyta.iziumtsev,
	bjorn.topel, magnus.karlsson, Ilias Apalodimas
In-Reply-To: <1536567880-15097-1-git-send-email-ilias.apalodimas@linaro.org>

Current driver dynamically allocates an skb and maps it as DMA rx buffer.
A following patch introduces AF_XDP functionality, so we need a
different allocation scheme. Buffers are allocated dynamically and
mapped into hardware. During the Rx operation the driver uses
build_skb() to produce the necessary buffers for the network stack

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
---
 drivers/net/ethernet/socionext/netsec.c | 239 +++++++++++++++++---------------
 1 file changed, 130 insertions(+), 109 deletions(-)

diff --git a/drivers/net/ethernet/socionext/netsec.c b/drivers/net/ethernet/socionext/netsec.c
index 7aa5ebb..666fee2 100644
--- a/drivers/net/ethernet/socionext/netsec.c
+++ b/drivers/net/ethernet/socionext/netsec.c
@@ -296,6 +296,11 @@ struct netsec_rx_pkt_info {
 	bool err_flag;
 };
 
+static void netsec_rx_fill(struct netsec_priv *priv, u16 from, u16 num);
+
+static void *netsec_alloc_rx_data(struct netsec_priv *priv,
+				  dma_addr_t *dma_addr, u16 *len);
+
 static void netsec_write(struct netsec_priv *priv, u32 reg_addr, u32 val)
 {
 	writel(val, priv->ioaddr + reg_addr);
@@ -556,34 +561,10 @@ static const struct ethtool_ops netsec_ethtool_ops = {
 
 /************* NETDEV_OPS FOLLOW *************/
 
-static struct sk_buff *netsec_alloc_skb(struct netsec_priv *priv,
-					struct netsec_desc *desc)
-{
-	struct sk_buff *skb;
-
-	if (device_get_dma_attr(priv->dev) == DEV_DMA_COHERENT) {
-		skb = netdev_alloc_skb_ip_align(priv->ndev, desc->len);
-	} else {
-		desc->len = L1_CACHE_ALIGN(desc->len);
-		skb = netdev_alloc_skb(priv->ndev, desc->len);
-	}
-	if (!skb)
-		return NULL;
-
-	desc->addr = skb->data;
-	desc->dma_addr = dma_map_single(priv->dev, desc->addr, desc->len,
-					DMA_FROM_DEVICE);
-	if (dma_mapping_error(priv->dev, desc->dma_addr)) {
-		dev_kfree_skb_any(skb);
-		return NULL;
-	}
-	return skb;
-}
 
 static void netsec_set_rx_de(struct netsec_priv *priv,
 			     struct netsec_desc_ring *dring, u16 idx,
-			     const struct netsec_desc *desc,
-			     struct sk_buff *skb)
+			     const struct netsec_desc *desc)
 {
 	struct netsec_de *de = dring->vaddr + DESC_SZ * idx;
 	u32 attr = (1 << NETSEC_RX_PKT_OWN_FIELD) |
@@ -602,59 +583,6 @@ static void netsec_set_rx_de(struct netsec_priv *priv,
 	dring->desc[idx].dma_addr = desc->dma_addr;
 	dring->desc[idx].addr = desc->addr;
 	dring->desc[idx].len = desc->len;
-	dring->desc[idx].skb = skb;
-}
-
-static struct sk_buff *netsec_get_rx_de(struct netsec_priv *priv,
-					struct netsec_desc_ring *dring,
-					u16 idx,
-					struct netsec_rx_pkt_info *rxpi,
-					struct netsec_desc *desc, u16 *len)
-{
-	struct netsec_de de = {};
-
-	memcpy(&de, dring->vaddr + DESC_SZ * idx, DESC_SZ);
-
-	*len = de.buf_len_info >> 16;
-
-	rxpi->err_flag = (de.attr >> NETSEC_RX_PKT_ER_FIELD) & 1;
-	rxpi->rx_cksum_result = (de.attr >> NETSEC_RX_PKT_CO_FIELD) & 3;
-	rxpi->err_code = (de.attr >> NETSEC_RX_PKT_ERR_FIELD) &
-							NETSEC_RX_PKT_ERR_MASK;
-	*desc = dring->desc[idx];
-	return desc->skb;
-}
-
-static struct sk_buff *netsec_get_rx_pkt_data(struct netsec_priv *priv,
-					      struct netsec_rx_pkt_info *rxpi,
-					      struct netsec_desc *desc,
-					      u16 *len)
-{
-	struct netsec_desc_ring *dring = &priv->desc_ring[NETSEC_RING_RX];
-	struct sk_buff *tmp_skb, *skb = NULL;
-	struct netsec_desc td;
-	int tail;
-
-	*rxpi = (struct netsec_rx_pkt_info){};
-
-	td.len = priv->ndev->mtu + 22;
-
-	tmp_skb = netsec_alloc_skb(priv, &td);
-
-	tail = dring->tail;
-
-	if (!tmp_skb) {
-		netsec_set_rx_de(priv, dring, tail, &dring->desc[tail],
-				 dring->desc[tail].skb);
-	} else {
-		skb = netsec_get_rx_de(priv, dring, tail, rxpi, desc, len);
-		netsec_set_rx_de(priv, dring, tail, &td, tmp_skb);
-	}
-
-	/* move tail ahead */
-	dring->tail = (dring->tail + 1) % DESC_NUM;
-
-	return skb;
 }
 
 static int netsec_clean_tx_dring(struct netsec_priv *priv, int budget)
@@ -721,19 +649,29 @@ static int netsec_process_tx(struct netsec_priv *priv, int budget)
 	return done;
 }
 
+static void nsetsec_adv_desc(u16 *idx)
+{
+	*idx = *idx + 1;
+	if (unlikely(*idx >= DESC_NUM))
+		*idx = 0;
+}
+
 static int netsec_process_rx(struct netsec_priv *priv, int budget)
 {
 	struct netsec_desc_ring *dring = &priv->desc_ring[NETSEC_RING_RX];
 	struct net_device *ndev = priv->ndev;
-	struct netsec_rx_pkt_info rx_info;
-	int done = 0;
-	struct netsec_desc desc;
 	struct sk_buff *skb;
-	u16 len;
+	int done = 0;
 
 	while (done < budget) {
 		u16 idx = dring->tail;
 		struct netsec_de *de = dring->vaddr + (DESC_SZ * idx);
+		struct netsec_desc *desc = &dring->desc[idx];
+		struct netsec_rx_pkt_info rpi;
+		dma_addr_t dma_handle;
+		void *buf_addr;
+		u16 pkt_len;
+		u16 desc_len;
 
 		if (de->attr & (1U << NETSEC_RX_PKT_OWN_FIELD))
 			break;
@@ -744,28 +682,62 @@ static int netsec_process_rx(struct netsec_priv *priv, int budget)
 		 */
 		dma_rmb();
 		done++;
-		skb = netsec_get_rx_pkt_data(priv, &rx_info, &desc, &len);
-		if (unlikely(!skb) || rx_info.err_flag) {
+
+		pkt_len = de->buf_len_info >> 16;
+		rpi.err_code = (de->attr >> NETSEC_RX_PKT_ERR_FIELD) &
+			NETSEC_RX_PKT_ERR_MASK;
+		rpi.err_flag = (de->attr >> NETSEC_RX_PKT_ER_FIELD) & 1;
+		if (rpi.err_flag) {
 			netif_err(priv, drv, priv->ndev,
-				  "%s: rx fail err(%d)\n",
-				  __func__, rx_info.err_code);
+				  "%s: rx fail err(%d)\n", __func__,
+				  rpi.err_code);
 			ndev->stats.rx_dropped++;
+			nsetsec_adv_desc(&dring->tail);
+			/* reuse buffer page frag */
+			netsec_rx_fill(priv, idx, 1);
 			continue;
 		}
+		rpi.rx_cksum_result = (de->attr >> NETSEC_RX_PKT_CO_FIELD) & 3;
 
-		dma_unmap_single(priv->dev, desc.dma_addr, desc.len,
-				 DMA_FROM_DEVICE);
-		skb_put(skb, len);
+		dma_sync_single_for_cpu(priv->dev, desc->dma_addr, pkt_len,
+					DMA_FROM_DEVICE);
+
+		prefetch(desc->addr);
+		buf_addr = netsec_alloc_rx_data(priv, &dma_handle, &desc_len);
+		if (unlikely(!buf_addr))
+			break;
+
+		skb = build_skb(desc->addr, desc->len);
+		if (unlikely(!skb)) {
+			dma_unmap_single(priv->dev, dma_handle, desc_len,
+					 DMA_TO_DEVICE);
+			skb_free_frag(buf_addr);
+			netif_err(priv, drv, priv->ndev,
+				  "rx failed to alloc skb\n");
+			break;
+		}
+		dma_unmap_single_attrs(priv->dev, desc->dma_addr, desc->len,
+				       DMA_TO_DEVICE, DMA_ATTR_SKIP_CPU_SYNC);
+
+		/* Update the descriptor with fresh buffers */
+		desc->len = desc_len;
+		desc->dma_addr = dma_handle;
+		desc->addr = buf_addr;
+
+		skb_put(skb, pkt_len);
 		skb->protocol = eth_type_trans(skb, priv->ndev);
 
 		if (priv->rx_cksum_offload_flag &&
-		    rx_info.rx_cksum_result == NETSEC_RX_CKSUM_OK)
+		    rpi.rx_cksum_result == NETSEC_RX_CKSUM_OK)
 			skb->ip_summed = CHECKSUM_UNNECESSARY;
 
 		if (napi_gro_receive(&priv->napi, skb) != GRO_DROP) {
 			ndev->stats.rx_packets++;
-			ndev->stats.rx_bytes += len;
+			ndev->stats.rx_bytes += pkt_len;
 		}
+
+		netsec_rx_fill(priv, idx, 1);
+		nsetsec_adv_desc(&dring->tail);
 	}
 
 	return done;
@@ -928,7 +900,10 @@ static void netsec_uninit_pkt_dring(struct netsec_priv *priv, int id)
 		dma_unmap_single(priv->dev, desc->dma_addr, desc->len,
 				 id == NETSEC_RING_RX ? DMA_FROM_DEVICE :
 							      DMA_TO_DEVICE);
-		dev_kfree_skb(desc->skb);
+		if (id == NETSEC_RING_RX)
+			skb_free_frag(desc->addr);
+		else if (id == NETSEC_RING_TX)
+			dev_kfree_skb(desc->skb);
 	}
 
 	memset(dring->desc, 0, sizeof(struct netsec_desc) * DESC_NUM);
@@ -953,50 +928,96 @@ static void netsec_free_dring(struct netsec_priv *priv, int id)
 	dring->desc = NULL;
 }
 
+static void *netsec_alloc_rx_data(struct netsec_priv *priv,
+				  dma_addr_t *dma_handle, u16 *desc_len)
+{
+	size_t len = priv->ndev->mtu + ETH_HLEN + VLAN_HLEN * 2 + NET_SKB_PAD +
+		NET_IP_ALIGN;
+	dma_addr_t mapping;
+	void *buf;
+
+	len = SKB_DATA_ALIGN(len);
+	len += SKB_DATA_ALIGN(sizeof(struct skb_shared_info));
+
+	buf = napi_alloc_frag(len);
+	if (!buf)
+		return NULL;
+
+	mapping = dma_map_single(priv->dev, buf, len, DMA_FROM_DEVICE);
+	if (unlikely(dma_mapping_error(priv->dev, mapping)))
+		goto err_out;
+
+	*dma_handle = mapping;
+	*desc_len = len;
+
+	return buf;
+
+err_out:
+	skb_free_frag(buf);
+	return NULL;
+}
+
+static void netsec_rx_fill(struct netsec_priv *priv, u16 from, u16 num)
+{
+	struct netsec_desc_ring *dring = &priv->desc_ring[NETSEC_RING_RX];
+	u16 idx = from;
+
+	while (num) {
+		netsec_set_rx_de(priv, dring, idx, &dring->desc[idx]);
+		idx++;
+		if (idx >= DESC_NUM)
+			idx = 0;
+		num--;
+	}
+}
+
 static int netsec_alloc_dring(struct netsec_priv *priv, enum ring_id id)
 {
 	struct netsec_desc_ring *dring = &priv->desc_ring[id];
-	int ret = 0;
 
 	dring->vaddr = dma_zalloc_coherent(priv->dev, DESC_SZ * DESC_NUM,
 					   &dring->desc_dma, GFP_KERNEL);
-	if (!dring->vaddr) {
-		ret = -ENOMEM;
+	if (!dring->vaddr)
 		goto err;
-	}
 
 	dring->desc = kcalloc(DESC_NUM, sizeof(*dring->desc), GFP_KERNEL);
-	if (!dring->desc) {
-		ret = -ENOMEM;
+	if (!dring->desc)
 		goto err;
-	}
 
 	return 0;
 err:
 	netsec_free_dring(priv, id);
 
-	return ret;
+	return -ENOMEM;
 }
 
 static int netsec_setup_rx_dring(struct netsec_priv *priv)
 {
 	struct netsec_desc_ring *dring = &priv->desc_ring[NETSEC_RING_RX];
-	struct netsec_desc desc;
-	struct sk_buff *skb;
-	int n;
+	int i;
 
-	desc.len = priv->ndev->mtu + 22;
+	for (i = 0; i < DESC_NUM; i++) {
+		struct netsec_desc *desc = &dring->desc[i];
+		dma_addr_t dma_handle;
+		void *buf;
+		u16 len;
 
-	for (n = 0; n < DESC_NUM; n++) {
-		skb = netsec_alloc_skb(priv, &desc);
-		if (!skb) {
+		buf = netsec_alloc_rx_data(priv, &dma_handle, &len);
+		if (!buf) {
 			netsec_uninit_pkt_dring(priv, NETSEC_RING_RX);
-			return -ENOMEM;
+			goto err_out;
 		}
-		netsec_set_rx_de(priv, dring, n, &desc, skb);
+		desc->dma_addr = dma_handle;
+		desc->addr = buf;
+		desc->len = len;
 	}
 
+	netsec_rx_fill(priv, 0, DESC_NUM);
+
 	return 0;
+
+err_out:
+	return -ENOMEM;
 }
 
 static int netsec_netdev_load_ucode_region(struct netsec_priv *priv, u32 reg,
-- 
2.7.4

^ permalink raw reply related

* [net-next, PATCH 2/2, v1] net: socionext: add AF_XDP support
From: Ilias Apalodimas @ 2018-09-10  8:24 UTC (permalink / raw)
  To: netdev, jaswinder.singh
  Cc: ard.biesheuvel, masami.hiramatsu, arnd, mykyta.iziumtsev,
	bjorn.topel, magnus.karlsson, Ilias Apalodimas
In-Reply-To: <1536567880-15097-1-git-send-email-ilias.apalodimas@linaro.org>

Add basic AF_XDP support without zero-copy

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
---
 drivers/net/ethernet/socionext/netsec.c | 211 ++++++++++++++++++++++++++++++--
 1 file changed, 202 insertions(+), 9 deletions(-)

diff --git a/drivers/net/ethernet/socionext/netsec.c b/drivers/net/ethernet/socionext/netsec.c
index 666fee2..7464ca6 100644
--- a/drivers/net/ethernet/socionext/netsec.c
+++ b/drivers/net/ethernet/socionext/netsec.c
@@ -9,6 +9,8 @@
 #include <linux/etherdevice.h>
 #include <linux/interrupt.h>
 #include <linux/io.h>
+#include <linux/bpf.h>
+#include <linux/bpf_trace.h>
 
 #include <net/tcp.h>
 #include <net/ip6_checksum.h>
@@ -238,6 +240,11 @@
 
 #define NETSEC_F_NETSEC_VER_MAJOR_NUM(x)	((x) & 0xffff0000)
 
+#define NETSEC_XDP_PASS          0
+#define NETSEC_XDP_CONSUMED      BIT(0)
+#define NETSEC_XDP_TX            BIT(1)
+#define NETSEC_XDP_REDIR         BIT(2)
+
 enum ring_id {
 	NETSEC_RING_TX = 0,
 	NETSEC_RING_RX
@@ -256,11 +263,13 @@ struct netsec_desc_ring {
 	void *vaddr;
 	u16 pkt_cnt;
 	u16 head, tail;
+	struct xdp_rxq_info xdp_rxq;
 };
 
 struct netsec_priv {
 	struct netsec_desc_ring desc_ring[NETSEC_RING_MAX];
 	struct ethtool_coalesce et_coalesce;
+	struct bpf_prog *xdp_prog;
 	spinlock_t reglock; /* protect reg access */
 	struct napi_struct napi;
 	phy_interface_t phy_interface;
@@ -297,6 +306,8 @@ struct netsec_rx_pkt_info {
 };
 
 static void netsec_rx_fill(struct netsec_priv *priv, u16 from, u16 num);
+static u32 netsec_run_xdp(struct netsec_desc *desc, struct netsec_priv *priv,
+			  struct bpf_prog *prog, u16 len);
 
 static void *netsec_alloc_rx_data(struct netsec_priv *priv,
 				  dma_addr_t *dma_addr, u16 *len);
@@ -613,13 +624,23 @@ static int netsec_clean_tx_dring(struct netsec_priv *priv, int budget)
 
 		eop = (entry->attr >> NETSEC_TX_LAST) & 1;
 
-		dma_unmap_single(priv->dev, desc->dma_addr, desc->len,
-				 DMA_TO_DEVICE);
-		if (eop) {
-			pkts++;
+		if (desc->skb) {
+			dma_unmap_single(priv->dev, desc->dma_addr, desc->len,
+					 DMA_TO_DEVICE);
+		}
+
+		if (!eop) {
+			*desc = (struct netsec_desc){};
+			continue;
+		}
+
+		if (!desc->skb) {
+			skb_free_frag(desc->addr);
+		} else {
 			bytes += desc->skb->len;
 			dev_kfree_skb(desc->skb);
 		}
+		pkts++;
 		*desc = (struct netsec_desc){};
 	}
 	dring->pkt_cnt -= budget;
@@ -659,8 +680,11 @@ static void nsetsec_adv_desc(u16 *idx)
 static int netsec_process_rx(struct netsec_priv *priv, int budget)
 {
 	struct netsec_desc_ring *dring = &priv->desc_ring[NETSEC_RING_RX];
+	struct bpf_prog *xdp_prog = READ_ONCE(priv->xdp_prog);
 	struct net_device *ndev = priv->ndev;
-	struct sk_buff *skb;
+	struct sk_buff *skb = NULL;
+	u32 xdp_flush = 0;
+	u32 xdp_result;
 	int done = 0;
 
 	while (done < budget) {
@@ -707,6 +731,26 @@ static int netsec_process_rx(struct netsec_priv *priv, int budget)
 		if (unlikely(!buf_addr))
 			break;
 
+		if (xdp_prog) {
+			xdp_result = netsec_run_xdp(desc, priv, xdp_prog,
+						    pkt_len);
+			if (xdp_result != NETSEC_XDP_PASS) {
+				xdp_flush |= xdp_result & NETSEC_XDP_REDIR;
+
+				dma_unmap_single_attrs(priv->dev,
+						       desc->dma_addr,
+						       desc->len, DMA_TO_DEVICE,
+						       DMA_ATTR_SKIP_CPU_SYNC);
+
+				desc->len = desc_len;
+				desc->dma_addr = dma_handle;
+				desc->addr = buf_addr;
+				netsec_rx_fill(priv, idx, 1);
+				nsetsec_adv_desc(&dring->tail);
+			}
+			continue;
+		}
+
 		skb = build_skb(desc->addr, desc->len);
 		if (unlikely(!skb)) {
 			dma_unmap_single(priv->dev, dma_handle, desc_len,
@@ -740,6 +784,9 @@ static int netsec_process_rx(struct netsec_priv *priv, int budget)
 		nsetsec_adv_desc(&dring->tail);
 	}
 
+	if (xdp_flush & NETSEC_XDP_REDIR)
+		xdp_do_flush_map();
+
 	return done;
 }
 
@@ -892,6 +939,9 @@ static void netsec_uninit_pkt_dring(struct netsec_priv *priv, int id)
 	if (!dring->vaddr || !dring->desc)
 		return;
 
+	if (xdp_rxq_info_is_reg(&dring->xdp_rxq))
+		xdp_rxq_info_unreg(&dring->xdp_rxq);
+
 	for (idx = 0; idx < DESC_NUM; idx++) {
 		desc = &dring->desc[idx];
 		if (!desc->addr)
@@ -994,7 +1044,7 @@ static int netsec_alloc_dring(struct netsec_priv *priv, enum ring_id id)
 static int netsec_setup_rx_dring(struct netsec_priv *priv)
 {
 	struct netsec_desc_ring *dring = &priv->desc_ring[NETSEC_RING_RX];
-	int i;
+	int i, err;
 
 	for (i = 0; i < DESC_NUM; i++) {
 		struct netsec_desc *desc = &dring->desc[i];
@@ -1003,20 +1053,29 @@ static int netsec_setup_rx_dring(struct netsec_priv *priv)
 		u16 len;
 
 		buf = netsec_alloc_rx_data(priv, &dma_handle, &len);
-		if (!buf) {
-			netsec_uninit_pkt_dring(priv, NETSEC_RING_RX);
+		if (!buf)
 			goto err_out;
-		}
 		desc->dma_addr = dma_handle;
 		desc->addr = buf;
 		desc->len = len;
 	}
 
 	netsec_rx_fill(priv, 0, DESC_NUM);
+	err = xdp_rxq_info_reg(&dring->xdp_rxq, priv->ndev, 0);
+	if (err)
+		goto err_out;
+
+	err = xdp_rxq_info_reg_mem_model(&dring->xdp_rxq, MEM_TYPE_PAGE_SHARED,
+					 NULL);
+	if (err) {
+		xdp_rxq_info_unreg(&dring->xdp_rxq);
+		goto err_out;
+	}
 
 	return 0;
 
 err_out:
+	netsec_uninit_pkt_dring(priv, NETSEC_RING_RX);
 	return -ENOMEM;
 }
 
@@ -1353,6 +1412,9 @@ static int netsec_netdev_stop(struct net_device *ndev)
 
 	napi_disable(&priv->napi);
 
+	if (priv->xdp_prog)
+		bpf_prog_put(priv->xdp_prog);
+
 	netsec_write(priv, NETSEC_REG_INTEN_CLR, ~0);
 	netsec_stop_gmac(priv);
 
@@ -1420,6 +1482,136 @@ static int netsec_netdev_ioctl(struct net_device *ndev, struct ifreq *ifr,
 	return phy_mii_ioctl(ndev->phydev, ifr, cmd);
 }
 
+static u32 netsec_xmit_xdp(struct netsec_priv *priv, struct xdp_buff *xdp,
+			   struct netsec_desc *rx_desc)
+{
+	struct netsec_desc_ring *tx_ring = &priv->desc_ring[NETSEC_RING_TX];
+	struct netsec_tx_pkt_ctrl tx_ctrl = {};
+	struct netsec_desc tx_desc;
+	int filled;
+	u32 len;
+
+	len = xdp->data_end - xdp->data;
+
+	if (tx_ring->head >= tx_ring->tail)
+		filled = tx_ring->head - tx_ring->tail;
+	else
+		filled = tx_ring->head + DESC_NUM - tx_ring->tail;
+
+	if (DESC_NUM - filled <= 1)
+		return NETSEC_XDP_CONSUMED;
+
+	dma_sync_single_for_device(priv->dev, rx_desc->dma_addr, len,
+				   DMA_TO_DEVICE);
+
+	tx_desc.dma_addr = rx_desc->dma_addr;
+	tx_desc.addr = xdp->data;
+	tx_desc.len = len;
+
+	netsec_set_tx_de(priv, tx_ring, &tx_ctrl, &tx_desc, NULL);
+	netsec_write(priv, NETSEC_REG_NRM_TX_PKTCNT, 1); /* submit another tx */
+
+	return NETSEC_XDP_TX;
+}
+
+static u32 netsec_run_xdp(struct netsec_desc *desc, struct netsec_priv *priv,
+			  struct bpf_prog *prog, u16 len)
+
+{
+	struct netsec_desc_ring *dring = &priv->desc_ring[NETSEC_RING_RX];
+	struct xdp_buff xdp;
+	u32 ret = NETSEC_XDP_PASS;
+	int err;
+	u32 act;
+
+	xdp.data_hard_start = desc->addr;
+	xdp.data = desc->addr;
+	xdp_set_data_meta_invalid(&xdp);
+	xdp.data_end = xdp.data + len;
+	xdp.rxq = &dring->xdp_rxq;
+
+	rcu_read_lock();
+	act = bpf_prog_run_xdp(prog, &xdp);
+
+	switch (act) {
+	case XDP_PASS:
+		ret = NETSEC_XDP_PASS;
+		break;
+	case XDP_TX:
+		ret = netsec_xmit_xdp(priv, &xdp, desc);
+		break;
+	case XDP_REDIRECT:
+		err = xdp_do_redirect(priv->ndev, &xdp, prog);
+		if (!err) {
+			ret = NETSEC_XDP_REDIR;
+		} else {
+			ret = NETSEC_XDP_CONSUMED;
+			xdp_return_buff(&xdp);
+		}
+		break;
+	default:
+		bpf_warn_invalid_xdp_action(act);
+		/* fall through */
+	case XDP_ABORTED:
+		trace_xdp_exception(priv->ndev, prog, act);
+		/* fall through -- handle aborts by dropping packet */
+	case XDP_DROP:
+		ret = NETSEC_XDP_CONSUMED;
+		break;
+	}
+
+	rcu_read_unlock();
+
+	return ret;
+}
+
+static int netsec_xdp_setup(struct netsec_priv *priv, struct bpf_prog *prog)
+{
+	struct net_device *dev = priv->ndev;
+	struct bpf_prog *old_prog;
+
+	/* For now just support only the usual MTU sized frames */
+	if (prog && dev->mtu > 1500) {
+		netdev_warn(dev, "Jumbo frames not yet supported with XDP\n");
+		return -EOPNOTSUPP;
+	}
+
+	if (netif_running(dev))
+		netsec_netdev_stop(dev);
+
+	/* Detach old prog, if any */
+	old_prog = xchg(&priv->xdp_prog, prog);
+	if (old_prog)
+		bpf_prog_put(old_prog);
+
+	if (priv->xdp_prog) {
+		/* Attach BPF program */
+		priv->xdp_prog = bpf_prog_add(priv->xdp_prog, 1);
+		if (IS_ERR(priv->xdp_prog))
+			return PTR_ERR(priv->xdp_prog);
+	}
+
+	if (netif_running(dev))
+		netsec_netdev_open(dev);
+
+	return 0;
+}
+
+static int netsec_xdp(struct net_device *ndev, struct netdev_bpf *xdp)
+{
+	struct netsec_priv *priv = netdev_priv(ndev);
+
+	switch (xdp->command) {
+	case XDP_SETUP_PROG:
+		return netsec_xdp_setup(priv, xdp->prog);
+	case XDP_QUERY_PROG:
+		xdp->prog_id = priv->xdp_prog ? priv->xdp_prog->aux->id : 0;
+		return 0;
+	default:
+		return -EINVAL;
+	}
+}
+
 static const struct net_device_ops netsec_netdev_ops = {
 	.ndo_init		= netsec_netdev_init,
 	.ndo_uninit		= netsec_netdev_uninit,
@@ -1430,6 +1622,7 @@ static const struct net_device_ops netsec_netdev_ops = {
 	.ndo_set_mac_address    = eth_mac_addr,
 	.ndo_validate_addr	= eth_validate_addr,
 	.ndo_do_ioctl		= netsec_netdev_ioctl,
+	.ndo_bpf		= netsec_xdp,
 };
 
 static int netsec_of_probe(struct platform_device *pdev,
-- 
2.7.4

^ permalink raw reply related

* Re: Allow bpf_perf_event_output to access packet data
From: Jakub Kicinski @ 2018-09-10  8:26 UTC (permalink / raw)
  To: Lorenz Bauer; +Cc: netdev
In-Reply-To: <CACAyw98SbTciw9n5=ANSQNgFc9hD41=Az2qxLnGBE3YdDMMvUQ@mail.gmail.com>

On Fri, 7 Sep 2018 15:56:15 +0100, Lorenz Bauer wrote:
> Hello list,
> 
> I'm attempting to use bpf_perf_event_output to do packet sampling from XDP.
> 
> The code basically runs before our other XDP code, does a
> perf_event_output with the full packet (for now) and then tail calls
> into DDoS mitigation, etc.
> 
> I've just discovered that perf_event_output isn't allowed to access
> packet data by the verifier. Is this something that could be allowed?

Hi Lorenz!

The amount of packet data to output is controlled by high bits of the
"flags" parameter.  This is a trivial sample:

struct bpf_map_def SEC("maps") pa = {
	.type = BPF_MAP_TYPE_PERF_EVENT_ARRAY,
	.key_size = sizeof(int),
	.value_size = sizeof(int),
	.max_entries = 64,
};

int xdp_prog1(struct xdp_md *xdp)
{
	int key = 0;

	bpf_perf_event_output(xdp, &pa, 0x20ffffffffULL, &key, 0);

	return XDP_PASS;
}

The 0x20ffffffffULL will mean use the index in the map for current CPU
(0xffffffff), and output 32 bytes of the context (0x20 << 32).  For
networking programs context means the packet (slightly confusingly).

These are the relevant defines from bpf.h:

/* BPF_FUNC_perf_event_output, BPF_FUNC_perf_event_read and
 * BPF_FUNC_perf_event_read_value flags.
 */
#define BPF_F_INDEX_MASK		0xffffffffULL
#define BPF_F_CURRENT_CPU		BPF_F_INDEX_MASK
/* BPF_FUNC_perf_event_output for sk_buff input context. */
#define BPF_F_CTXLEN_MASK		(0xfffffULL << 32)

Also check out:

bpftool map event_pipe id $ID

For simple way to dump the events in user space.

^ permalink raw reply

* KASAN: use-after-free Write in rb_erase
From: syzbot @ 2018-09-10  8:30 UTC (permalink / raw)
  To: ast, daniel, linux-kernel, netdev, syzkaller-bugs

Hello,

syzbot found the following crash on:

HEAD commit:    7a8c7f5c30f9 net: dsa: b53: Fix build with B53_SRAB enable..
git tree:       net-next
console output: https://syzkaller.appspot.com/x/log.txt?x=17b19e49400000
kernel config:  https://syzkaller.appspot.com/x/.config?x=8f59875069d721b6
dashboard link: https://syzkaller.appspot.com/bug?extid=83e25da873f2a81c5e3c
compiler:       gcc (GCC) 8.0.1 20180413 (experimental)

Unfortunately, I don't have any reproducer for this crash yet.

IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+83e25da873f2a81c5e3c@syzkaller.appspotmail.com

syz-executor4 (7549) used greatest stack depth: 16104 bytes left
==================================================================
BUG: KASAN: use-after-free in __rb_erase_augmented  
include/linux/rbtree_augmented.h:188 [inline]
BUG: KASAN: use-after-free in rb_erase+0x26d0/0x3710 lib/rbtree.c:459
Write of size 8 at addr ffff8801c2a5aaf0 by task syz-executor5/7453

CPU: 1 PID: 7453 Comm: syz-executor5 Not tainted 4.19.0-rc2+ #209
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS  
Google 01/01/2011
Call Trace:
  __dump_stack lib/dump_stack.c:77 [inline]
  dump_stack+0x1c4/0x2b4 lib/dump_stack.c:113
  print_address_description.cold.8+0x9/0x1ff mm/kasan/report.c:256
  kasan_report_error mm/kasan/report.c:354 [inline]
  kasan_report.cold.9+0x242/0x309 mm/kasan/report.c:412
  __asan_report_store8_noabort+0x17/0x20 mm/kasan/report.c:438
  __rb_erase_augmented include/linux/rbtree_augmented.h:188 [inline]
  rb_erase+0x26d0/0x3710 lib/rbtree.c:459
  __lt_erase include/linux/rbtree_latch.h:102 [inline]
  latch_tree_erase include/linux/rbtree_latch.h:176 [inline]
  bpf_prog_ksym_node_del kernel/bpf/core.c:466 [inline]
  bpf_prog_kallsyms_del+0x1c2/0x410 kernel/bpf/core.c:498
  bpf_prog_kallsyms_del_all+0x1d/0x20 kernel/bpf/core.c:364
  __bpf_prog_put+0xd7/0x150 kernel/bpf/syscall.c:1105
  bpf_prog_put kernel/bpf/syscall.c:1113 [inline]
  bpf_prog_test_run+0x145/0x1a0 kernel/bpf/syscall.c:1754
BUG: unable to handle kernel paging request at ffffc90001930030
PGD 1da948067 P4D 1da948067 PUD 1da949067 PMD 1d49ae067 PTE 0
Oops: 0000 [#1] PREEMPT SMP KASAN
CPU: 1 PID: 7453 Comm: syz-executor5 Not tainted 4.19.0-rc2+ #209
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS  
Google 01/01/2011
RIP: 0010:bpf_prog_ebpf_jited include/linux/filter.h:898 [inline]
RIP: 0010:bpf_get_prog_addr_region kernel/bpf/core.c:381 [inline]
RIP: 0010:bpf_tree_comp kernel/bpf/core.c:435 [inline]
RIP: 0010:__lt_find include/linux/rbtree_latch.h:115 [inline]
RIP: 0010:latch_tree_find include/linux/rbtree_latch.h:208 [inline]
RIP: 0010:bpf_prog_kallsyms_find+0x289/0x4a0 kernel/bpf/core.c:509
Code: 03 42 80 3c 30 00 0f 85 b1 01 00 00 4d 8b 6f 50 49 8d 7d 30 48 89 fa  
48 c1 ea 03 42 80 3c 32 00 0f 85 ab 01 00 00 49 8d 7d 02 <4d> 8b 65 30 48  
89 fa 48 89 f9 48 c1 ea 03 83 e1 07 42 0f b6 14 32
RSP: 0018:ffff88019a066dd0 EFLAGS: 00010046
RAX: 0000000000000000 RBX: ffff8801c2a5ab08 RCX: ffffffff818b41d1
RDX: 1ffff92000326006 RSI: 0000000000000008 RDI: ffffc90001930002
RBP: ffff88019a066f48 R08: ffff8801cce982c0 R09: ffffed003b5a4732
R10: ffffed003b5a4732 R11: ffff8801dad23993 R12: 1ffff1003340cddc
R13: ffffc90001930000 R14: dffffc0000000000 R15: ffff8801c2a5aaf0
FS:  00007f524d117700(0000) GS:ffff8801dad00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffc90001930030 CR3: 00000001d3889000 CR4: 00000000001406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
BUG: unable to handle kernel paging request at ffffc90001930030
PGD 1da948067 P4D 1da948067 PUD 1da949067 PMD 1d49ae067 PTE 0
Oops: 0000 [#2] PREEMPT SMP KASAN
CPU: 1 PID: 7453 Comm: syz-executor5 Not tainted 4.19.0-rc2+ #209
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS  
Google 01/01/2011
RIP: 0010:bpf_prog_ebpf_jited include/linux/filter.h:898 [inline]
RIP: 0010:bpf_get_prog_addr_region kernel/bpf/core.c:381 [inline]
RIP: 0010:bpf_tree_comp kernel/bpf/core.c:435 [inline]
RIP: 0010:__lt_find include/linux/rbtree_latch.h:115 [inline]
RIP: 0010:latch_tree_find include/linux/rbtree_latch.h:208 [inline]
RIP: 0010:bpf_prog_kallsyms_find+0x289/0x4a0 kernel/bpf/core.c:509
Code: 03 42 80 3c 30 00 0f 85 b1 01 00 00 4d 8b 6f 50 49 8d 7d 30 48 89 fa  
48 c1 ea 03 42 80 3c 32 00 0f 85 ab 01 00 00 49 8d 7d 02 <4d> 8b 65 30 48  
89 fa 48 89 f9 48 c1 ea 03 83 e1 07 42 0f b6 14 32
RSP: 0018:ffff88019a066678 EFLAGS: 00010046
RAX: 0000000000000000 RBX: ffff8801c2a5ab08 RCX: ffffffff818b41d1
RDX: 1ffff92000326006 RSI: 0000000000000008 RDI: ffffc90001930002
RBP: ffff88019a0667f0 R08: ffff8801cce982c0 R09: 0000000000000001
R10: ffffed003b5a4732 R11: 0000000000000000 R12: 1ffff1003340ccf1
R13: ffffc90001930000 R14: dffffc0000000000 R15: ffff8801c2a5aaf0
FS:  00007f524d117700(0000) GS:ffff8801dad00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffc90001930030 CR3: 00000001d3889000 CR4: 00000000001406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
BUG: unable to handle kernel paging request at ffffc90001930030
PGD 1da948067 P4D 1da948067 PUD 1da949067 PMD 1d49ae067 PTE 0
Oops: 0000 [#3] PREEMPT SMP KASAN
CPU: 1 PID: 7453 Comm: syz-executor5 Not tainted 4.19.0-rc2+ #209
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS  
Google 01/01/2011
RIP: 0010:bpf_prog_ebpf_jited include/linux/filter.h:898 [inline]
RIP: 0010:bpf_get_prog_addr_region kernel/bpf/core.c:381 [inline]
RIP: 0010:bpf_tree_comp kernel/bpf/core.c:435 [inline]
RIP: 0010:__lt_find include/linux/rbtree_latch.h:115 [inline]
RIP: 0010:latch_tree_find include/linux/rbtree_latch.h:208 [inline]
RIP: 0010:bpf_prog_kallsyms_find+0x289/0x4a0 kernel/bpf/core.c:509
Code: 03 42 80 3c 30 00 0f 85 b1 01 00 00 4d 8b 6f 50 49 8d 7d 30 48 89 fa  
48 c1 ea 03 42 80 3c 32 00 0f 85 ab 01 00 00 49 8d 7d 02 <4d> 8b 65 30 48  
89 fa 48 89 f9 48 c1 ea 03 83 e1 07 42 0f b6 14 32
RSP: 0018:ffff88019a065f18 EFLAGS: 00010046
RAX: 0000000000000000 RBX: ffff8801c2a5ab08 RCX: ffffffff818b41d1
RDX: 1ffff92000326006 RSI: 0000000000000008 RDI: ffffc90001930002
RBP: ffff88019a066090 R08: ffff8801cce982c0 R09: 0000000000000001
R10: ffffed003b5a4732 R11: 0000000000000000 R12: 1ffff1003340cc05
R13: ffffc90001930000 R14: dffffc0000000000 R15: ffff8801c2a5aaf0
FS:  00007f524d117700(0000) GS:ffff8801dad00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffc90001930030 CR3: 00000001d3889000 CR4: 00000000001406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
BUG: unable to handle kernel paging request at ffffc90001930030
PGD 1da948067 P4D 1da948067 PUD 1da949067 PMD 1d49ae067 PTE 0
Oops: 0000 [#4] PREEMPT SMP KASAN
CPU: 1 PID: 7453 Comm: syz-executor5 Not tainted 4.19.0-rc2+ #209
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS  
Google 01/01/2011
RIP: 0010:bpf_prog_ebpf_jited include/linux/filter.h:898 [inline]
RIP: 0010:bpf_get_prog_addr_region kernel/bpf/core.c:381 [inline]
RIP: 0010:bpf_tree_comp kernel/bpf/core.c:435 [inline]
RIP: 0010:__lt_find include/linux/rbtree_latch.h:115 [inline]
RIP: 0010:latch_tree_find include/linux/rbtree_latch.h:208 [inline]
RIP: 0010:bpf_prog_kallsyms_find+0x289/0x4a0 kernel/bpf/core.c:509
Code: 03 42 80 3c 30 00 0f 85 b1 01 00 00 4d 8b 6f 50 49 8d 7d 30 48 89 fa  
48 c1 ea 03 42 80 3c 32 00 0f 85 ab 01 00 00 49 8d 7d 02 <4d> 8b 65 30 48  
89 fa 48 89 f9 48 c1 ea 03 83 e1 07 42 0f b6 14 32
RSP: 0018:ffff88019a0657b8 EFLAGS: 00010046
RAX: 0000000000000000 RBX: ffff8801c2a5ab08 RCX: ffffffff818b41d1
RDX: 1ffff92000326006 RSI: 0000000000000008 RDI: ffffc90001930002
RBP: ffff88019a065930 R08: ffff8801cce982c0 R09: 0000000000000001
R10: ffffed003b5a4732 R11: 0000000000000000 R12: 1ffff1003340cb19
R13: ffffc90001930000 R14: dffffc0000000000 R15: ffff8801c2a5aaf0
FS:  00007f524d117700(0000) GS:ffff8801dad00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffc90001930030 CR3: 00000001d3889000 CR4: 00000000001406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
BUG: unable to handle kernel paging request at ffffc90001930030
PGD 1da948067 P4D 1da948067 PUD 1da949067 PMD 1d49ae067 PTE 0
Oops: 0000 [#5] PREEMPT SMP KASAN
CPU: 1 PID: 7453 Comm: syz-executor5 Not tainted 4.19.0-rc2+ #209
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS  
Google 01/01/2011
RIP: 0010:bpf_prog_ebpf_jited include/linux/filter.h:898 [inline]
RIP: 0010:bpf_get_prog_addr_region kernel/bpf/core.c:381 [inline]
RIP: 0010:bpf_tree_comp kernel/bpf/core.c:435 [inline]
RIP: 0010:__lt_find include/linux/rbtree_latch.h:115 [inline]
RIP: 0010:latch_tree_find include/linux/rbtree_latch.h:208 [inline]
RIP: 0010:bpf_prog_kallsyms_find+0x289/0x4a0 kernel/bpf/core.c:509
Code: 03 42 80 3c 30 00 0f 85 b1 01 00 00 4d 8b 6f 50 49 8d 7d 30 48 89 fa  
48 c1 ea 03 42 80 3c 32 00 0f 85 ab 01 00 00 49 8d 7d 02 <4d> 8b 65 30 48  
89 fa 48 89 f9 48 c1 ea 03 83 e1 07 42 0f b6 14 32
RSP: 0018:ffff88019a065058 EFLAGS: 00010046
RAX: 0000000000000000 RBX: ffff8801c2a5ab08 RCX: ffffffff818b41d1
RDX: 1ffff92000326006 RSI: 0000000000000008 RDI: ffffc90001930002
RBP: ffff88019a0651d0 R08: ffff8801cce982c0 R09: 0000000000000001
R10: ffffed003b5a4732 R11: 0000000000000000 R12: 1ffff1003340ca2d
R13: ffffc90001930000 R14: dffffc0000000000 R15: ffff8801c2a5aaf0
FS:  00007f524d117700(0000) GS:ffff8801dad00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffc90001930030 CR3: 00000001d3889000 CR4: 00000000001406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
BUG: unable to handle kernel paging request at ffffc90001930030
PGD 1da948067 P4D 1da948067 PUD 1da949067 PMD 1d49ae067 PTE 0
Oops: 0000 [#6] PREEMPT SMP KASAN
CPU: 1 PID: 7453 Comm: syz-executor5 Not tainted 4.19.0-rc2+ #209
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS  
Google 01/01/2011
RIP: 0010:bpf_prog_ebpf_jited include/linux/filter.h:898 [inline]
RIP: 0010:bpf_get_prog_addr_region kernel/bpf/core.c:381 [inline]
RIP: 0010:bpf_tree_comp kernel/bpf/core.c:435 [inline]
RIP: 0010:__lt_find include/linux/rbtree_latch.h:115 [inline]
RIP: 0010:latch_tree_find include/linux/rbtree_latch.h:208 [inline]
RIP: 0010:bpf_prog_kallsyms_find+0x289/0x4a0 kernel/bpf/core.c:509
Code: 03 42 80 3c 30 00 0f 85 b1 01 00 00 4d 8b 6f 50 49 8d 7d 30 48 89 fa  
48 c1 ea 03 42 80 3c 32 00 0f 85 ab 01 00 00 49 8d 7d 02 <4d> 8b 65 30 48  
89 fa 48 89 f9 48 c1 ea 03 83 e1 07 42 0f b6 14 32
RSP: 0018:ffff88019a0648f8 EFLAGS: 00010046
RAX: 0000000000000000 RBX: ffff8801c2a5ab08 RCX: ffffffff818b41d1
RDX: 1ffff92000326006 RSI: 0000000000000008 RDI: ffffc90001930002
RBP: ffff88019a064a70 R08: ffff8801cce982c0 R09: 0000000000000001
R10: ffffed003b5a4732 R11: 0000000000000000 R12: 1ffff1003340c941
R13: ffffc90001930000 R14: dffffc0000000000 R15: ffff8801c2a5aaf0
FS:  00007f524d117700(0000) GS:ffff8801dad00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffc90001930030 CR3: 00000001d3889000 CR4: 00000000001406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
BUG: unable to handle kernel paging request at ffffc90001930030
PGD 1da948067 P4D 1da948067 PUD 1da949067 PMD 1d49ae067 PTE 0
Oops: 0000 [#7] PREEMPT SMP KASAN
CPU: 1 PID: 7453 Comm: syz-executor5 Not tainted 4.19.0-rc2+ #209
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS  
Google 01/01/2011
RIP: 0010:bpf_prog_ebpf_jited include/linux/filter.h:898 [inline]
RIP: 0010:bpf_get_prog_addr_region kernel/bpf/core.c:381 [inline]
RIP: 0010:bpf_tree_comp kernel/bpf/core.c:435 [inline]
RIP: 0010:__lt_find include/linux/rbtree_latch.h:115 [inline]
RIP: 0010:latch_tree_find include/linux/rbtree_latch.h:208 [inline]
RIP: 0010:bpf_prog_kallsyms_find+0x289/0x4a0 kernel/bpf/core.c:509
Code: 03 42 80 3c 30 00 0f 85 b1 01 00 00 4d 8b 6f 50 49 8d 7d 30 48 89 fa  
48 c1 ea 03 42 80 3c 32 00 0f 85 ab 01 00 00 49 8d 7d 02 <4d> 8b 65 30 48  
89 fa 48 89 f9 48 c1 ea 03 83 e1 07 42 0f b6 14 32
RSP: 0018:ffff88019a064198 EFLAGS: 00010046
RAX: 0000000000000000 RBX: ffff8801c2a5ab08 RCX: ffffffff818b41d1
RDX: 1ffff92000326006 RSI: 0000000000000008 RDI: ffffc90001930002
RBP: ffff88019a064310 R08: ffff8801cce982c0 R09: 0000000000000001
R10: ffffed003b5a4732 R11: 0000000000000000 R12: 1ffff1003340c855
R13: ffffc90001930000 R14: dffffc0000000000 R15: ffff8801c2a5aaf0
FS:  00007f524d117700(0000) GS:ffff8801dad00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffc90001930030 CR3: 00000001d3889000 CR4: 00000000001406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
BUG: unable to handle kernel paging request at ffffc90001930030
PGD 1da948067 P4D 1da948067 PUD 1da949067 PMD 1d49ae067 PTE 0
Oops: 0000 [#8] PREEMPT SMP KASAN
CPU: 1 PID: 7453 Comm: syz-executor5 Not tainted 4.19.0-rc2+ #209
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS  
Google 01/01/2011
RIP: 0010:bpf_prog_ebpf_jited include/linux/filter.h:898 [inline]
RIP: 0010:bpf_get_prog_addr_region kernel/bpf/core.c:381 [inline]
RIP: 0010:bpf_tree_comp kernel/bpf/core.c:435 [inline]
RIP: 0010:__lt_find include/linux/rbtree_latch.h:115 [inline]
RIP: 0010:latch_tree_find include/linux/rbtree_latch.h:208 [inline]
RIP: 0010:bpf_prog_kallsyms_find+0x289/0x4a0 kernel/bpf/core.c:509
Code: 03 42 80 3c 30 00 0f 85 b1 01 00 00 4d 8b 6f 50 49 8d 7d 30 48 89 fa  
48 c1 ea 03 42 80 3c 32 00 0f 85 ab 01 00 00 49 8d 7d 02 <4d> 8b 65 30 48  
89 fa 48 89 f9 48 c1 ea 03 83 e1 07 42 0f b6 14 32
RSP: 0018:ffff88019a063a38 EFLAGS: 00010046
RAX: 0000000000000000 RBX: ffff8801c2a5ab08 RCX: ffffffff818b41d1
RDX: 1ffff92000326006 RSI: 0000000000000008 RDI: ffffc90001930002
RBP: ffff88019a063bb0 R08: ffff8801cce982c0 R09: 0000000000000001
R10: ffffed003b5a4732 R11: 0000000000000000 R12: 1ffff1003340c769
R13: ffffc90001930000 R14: dffffc0000000000 R15: ffff8801c2a5aaf0
FS:  00007f524d117700(0000) GS:ffff8801dad00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffc90001930030 CR3: 00000001d3889000 CR4: 00000000001406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
BUG: unable to handle kernel paging request at ffffc90001930030
PGD 1da948067 P4D 1da948067 PUD 1da949067 PMD 1d49ae067 PTE 0
Oops: 0000 [#9] PREEMPT SMP KASAN
CPU: 1 PID: 7453 Comm: syz-executor5 Not tainted 4.19.0-rc2+ #209
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS  
Google 01/01/2011
RIP: 0010:bpf_prog_ebpf_jited include/linux/filter.h:898 [inline]
RIP: 0010:bpf_get_prog_addr_region kernel/bpf/core.c:381 [inline]
RIP: 0010:bpf_tree_comp kernel/bpf/core.c:435 [inline]
RIP: 0010:__lt_find include/linux/rbtree_latch.h:115 [inline]
RIP: 0010:latch_tree_find include/linux/rbtree_latch.h:208 [inline]
RIP: 0010:bpf_prog_kallsyms_find+0x289/0x4a0 kernel/bpf/core.c:509
Code: 03 42 80 3c 30 00 0f 85 b1 01 00 00 4d 8b 6f 50 49 8d 7d 30 48 89 fa  
48 c1 ea 03 42 80 3c 32 00 0f 85 ab 01 00 00 49 8d 7d 02 <4d> 8b 65 30 48  
89 fa 48 89 f9 48 c1 ea 03 83 e1 07 42 0f b6 14 32
RSP: 0018:ffff88019a0632d8 EFLAGS: 00010046
RAX: 0000000000000000 RBX: ffff8801c2a5ab08 RCX: ffffffff818b41d1
RDX: 1ffff92000326006 RSI: 0000000000000008 RDI: ffffc90001930002
RBP: ffff88019a063450 R08: ffff8801cce982c0 R09: 0000000000000001
R10: ffffed003b5a4732 R11: 0000000000000000 R12: 1ffff1003340c67d
R13: ffffc90001930000 R14: dffffc0000000000 R15: ffff8801c2a5aaf0
FS:  00007f524d117700(0000) GS:ffff8801dad00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffc90001930030 CR3: 00000001d3889000 CR4: 00000000001406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
BUG: unable to handle kernel paging request at ffffc90001930030
PGD 1da948067 P4D 1da948067 PUD 1da949067 PMD 1d49ae067 PTE 0
Oops: 0000 [#10] PREEMPT SMP KASAN
CPU: 1 PID: 7453 Comm: syz-executor5 Not tainted 4.19.0-rc2+ #209
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS  
Google 01/01/2011
RIP: 0010:bpf_prog_ebpf_jited include/linux/filter.h:898 [inline]
RIP: 0010:bpf_get_prog_addr_region kernel/bpf/core.c:381 [inline]
RIP: 0010:bpf_tree_comp kernel/bpf/core.c:435 [inline]
RIP: 0010:__lt_find include/linux/rbtree_latch.h:115 [inline]
RIP: 0010:latch_tree_find include/linux/rbtree_latch.h:208 [inline]
RIP: 0010:bpf_prog_kallsyms_find+0x289/0x4a0 kernel/bpf/core.c:509
Code: 03 42 80 3c 30 00 0f 85 b1 01 00 00 4d 8b 6f 50 49 8d 7d 30 48 89 fa  
48 c1 ea 03 42 80 3c 32 00 0f 85 ab 01 00 00 49 8d 7d 02 <4d> 8b 65 30 48  
89 fa 48 89 f9 48 c1 ea 03 83 e1 07 42 0f b6 14 32
RSP: 0018:ffff88019a062b78 EFLAGS: 00010046
RAX: 0000000000000000 RBX: ffff8801c2a5ab08 RCX: ffffffff818b41d1
RDX: 1ffff92000326006 RSI: 0000000000000008 RDI: ffffc90001930002
RBP: ffff88019a062cf0 R08: ffff8801cce982c0 R09: 0000000000000001
R10: ffffed003b5a4732 R11: 0000000000000000 R12: 1ffff1003340c591
R13: ffffc90001930000 R14: dffffc0000000000 R15: ffff8801c2a5aaf0
FS:  00007f524d117700(0000) GS:ffff8801dad00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffc90001930030 CR3: 00000001d3889000 CR4: 00000000001406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
BUG: unable to handle kernel paging request at ffffc90001930030
PGD 1da948067 P4D 1da948067 PUD 1da949067 PMD 1d49ae067 PTE 0
Oops: 0000 [#11] PREEMPT SMP KASAN
CPU: 1 PID: 7453 Comm: syz-executor5 Not tainted 4.19.0-rc2+ #209
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS  
Google 01/01/2011
RIP: 0010:bpf_prog_ebpf_jited include/linux/filter.h:898 [inline]
RIP: 0010:bpf_get_prog_addr_region kernel/bpf/core.c:381 [inline]
RIP: 0010:bpf_tree_comp kernel/bpf/core.c:435 [inline]
RIP: 0010:__lt_find include/linux/rbtree_latch.h:115 [inline]
RIP: 0010:latch_tree_find include/linux/rbtree_latch.h:208 [inline]
RIP: 0010:bpf_prog_kallsyms_find+0x289/0x4a0 kernel/bpf/core.c:509
Code: 03 42 80 3c 30 00 0f 85 b1 01 00 00 4d 8b 6f 50 49 8d 7d 30 48 89 fa  
48 c1 ea 03 42 80 3c 32 00 0f 85 ab 01 00 00 49 8d 7d 02 <4d> 8b 65 30 48  
89 fa 48 89 f9 48 c1 ea 03 83 e1 07 42 0f b6 14 32
RSP: 0018:ffff88019a062418 EFLAGS: 00010046
RAX: 0000000000000000 RBX: ffff8801c2a5ab08 RCX: ffffffff818b41d1
RDX: 1ffff92000326006 RSI: 0000000000000008 RDI: ffffc90001930002
RBP: ffff88019a062590 R08: ffff8801cce982c0 R09: 0000000000000001
R10: ffffed003b5a4732 R11: 0000000000000000 R12: 1ffff1003340c4a5
R13: ffffc90001930000 R14: dffffc0000000000 R15: ffff8801c2a5aaf0
FS:  00007f524d117700(0000) GS:ffff8801dad00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffc90001930030 CR3: 00000001d3889000 CR4: 00000000001406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
BUG: unable to handle kernel paging request at ffffc90001930030
PGD 1da948067 P4D 1da948067 PUD 1da949067 PMD 1d49ae067 PTE 0
Oops: 0000 [#12] PREEMPT SMP KASAN
CPU: 1 PID: 7453 Comm: syz-executor5 Not tainted 4.19.0-rc2+ #209
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS  
Google 01/01/2011
RIP: 0010:bpf_prog_ebpf_jited include/linux/filter.h:898 [inline]
RIP: 0010:bpf_get_prog_addr_region kernel/bpf/core.c:381 [inline]
RIP: 0010:bpf_tree_comp kernel/bpf/core.c:435 [inline]
RIP: 0010:__lt_find include/linux/rbtree_latch.h:115 [inline]
RIP: 0010:latch_tree_find include/linux/rbtree_latch.h:208 [inline]
RIP: 0010:bpf_prog_kallsyms_find+0x289/0x4a0 kernel/bpf/core.c:509
Code: 03 42 80 3c 30 00 0f 85 b1 01 00 00 4d 8b 6f 50 49 8d 7d 30 48 89 fa  
48 c1 ea 03 42 80 3c 32 00 0f 85 ab 01 00 00 49 8d 7d 02 <4d> 8b 65 30 48  
89 fa 48 89 f9 48 c1 ea 03 83 e1 07 42 0f b6 14 32
RSP: 0018:ffff88019a061cb8 EFLAGS: 00010046
RAX: 0000000000000000 RBX: ffff8801c2a5ab08 RCX: ffffffff818b41d1
RDX: 1ffff92000326006 RSI: 0000000000000008 RDI: ffffc90001930002
RBP: ffff88019a061e30 R08: ffff8801cce982c0 R09: 0000000000000001
R10: ffffed003b5a4732 R11: 0000000000000000 R12: 1ffff1003340c3b9
R13: ffffc90001930000 R14: dffffc0000000000 R15: ffff8801c2a5aaf0
FS:  00007f524d117700(0000) GS:ffff8801dad00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffc90001930030 CR3: 00000001d3889000 CR4: 00000000001406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
BUG: unable to handle kernel paging request at ffffc90001930030
PGD 1da948067 P4D 1da948067 PUD 1da949067 PMD 1d49ae067 PTE 0
Oops: 0000 [#13] PREEMPT SMP KASAN
CPU: 1 PID: 7453 Comm: syz-executor5 Not tainted 4.19.0-rc2+ #209
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS  
Google 01/01/2011
RIP: 0010:bpf_prog_ebpf_jited include/linux/filter.h:898 [inline]
RIP: 0010:bpf_get_prog_addr_region kernel/bpf/core.c:381 [inline]
RIP: 0010:bpf_tree_comp kernel/bpf/core.c:435 [inline]
RIP: 0010:__lt_find include/linux/rbtree_latch.h:115 [inline]
RIP: 0010:latch_tree_find include/linux/rbtree_latch.h:208 [inline]
RIP: 0010:bpf_prog_kallsyms_find+0x289/0x4a0 kernel/bpf/core.c:509
Code: 03 42 80 3c 30 00 0f 85 b1 01 00 00 4d 8b 6f 50 49 8d 7d 30 48 89 fa  
48 c1 ea 03 42 80 3c 32 00 0f 85 ab 01 00 00 49 8d 7d 02 <4d> 8b 65 30 48  
89 fa 48 89 f9 48 c1 ea 03 83 e1 07 42 0f b6 14 32
RSP: 0018:ffff88019a061558 EFLAGS: 00010046
RAX: 0000000000000000 RBX: ffff8801c2a5ab08 RCX: ffffffff818b41d1
RDX: 1ffff92000326006 RSI: 0000000000000008 RDI: ffffc90001930002
RBP: ffff88019a0616d0 R08: ffff8801cce982c0 R09: 0000000000000001
R10: ffffed003b5a4732 R11: 0000000000000000 R12: 1ffff1003340c2cd
R13: ffffc90001930000 R14: dffffc0000000000 R15: ffff8801c2a5aaf0
FS:  00007f524d117700(0000) GS:ffff8801dad00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffc90001930030 CR3: 00000001d3889000 CR4: 00000000001406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
BUG: unable to handle kernel paging request at ffffc90001930030
PGD 1da948067 P4D 1da948067 PUD 1da949067 PMD 1d49ae067 PTE 0
Thread overran stack, or stack corrupted
Oops: 0000 [#14] PREEMPT SMP KASAN
CPU: 1 PID: 7453 Comm: syz-executor5 Not tainted 4.19.0-rc2+ #209
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS  
Google 01/01/2011
RIP: 0010:bpf_prog_ebpf_jited include/linux/filter.h:898 [inline]
RIP: 0010:bpf_get_prog_addr_region kernel/bpf/core.c:381 [inline]
RIP: 0010:bpf_tree_comp kernel/bpf/core.c:435 [inline]
RIP: 0010:__lt_find include/linux/rbtree_latch.h:115 [inline]
RIP: 0010:latch_tree_find include/linux/rbtree_latch.h:208 [inline]
RIP: 0010:bpf_prog_kallsyms_find+0x289/0x4a0 kernel/bpf/core.c:509
Code: 03 42 80 3c 30 00 0f 85 b1 01 00 00 4d 8b 6f 50 49 8d 7d 30 48 89 fa  
48 c1 ea 03 42 80 3c 32 00 0f 85 ab 01 00 00 49 8d 7d 02 <4d> 8b 65 30 48  
89 fa 48 89 f9 48 c1 ea 03 83 e1 07 42 0f b6 14 32
RSP: 0018:ffff88019a060df8 EFLAGS: 00010046
RAX: 0000000000000000 RBX: ffff8801c2a5ab08 RCX: ffffffff818b41d1
RDX: 1ffff92000326006 RSI: 0000000000000008 RDI: ffffc90001930002
RBP: ffff88019a060f70 R08: ffff8801cce982c0 R09: 0000000000000001
R10: ffffed003b5a4732 R11: 0000000000000000 R12: 1ffff1003340c1e1
R13: ffffc90001930000 R14: dffffc0000000000 R15: ffff8801c2a5aaf0
FS:  00007f524d117700(0000) GS:ffff8801dad00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffc90001930030 CR3: 00000001d3889000 CR4: 00000000001406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
BUG: unable to handle kernel paging request at ffffc90001930030
PGD 1da948067 P4D 1da948067 PUD 1da949067 PMD 1d49ae067 PTE 0
Thread overran stack, or stack corrupted
Oops: 0000 [#15] PREEMPT SMP KASAN
CPU: 1 PID: 7453 Comm: syz-executor5 Not tainted 4.19.0-rc2+ #209
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS  
Google 01/01/2011
RIP: 0010:bpf_prog_ebpf_jited include/linux/filter.h:898 [inline]
RIP: 0010:bpf_get_prog_addr_region kernel/bpf/core.c:381 [inline]
RIP: 0010:bpf_tree_comp kernel/bpf/core.c:435 [inline]
RIP: 0010:__lt_find include/linux/rbtree_latch.h:115 [inline]
RIP: 0010:latch_tree_find include/linux/rbtree_latch.h:208 [inline]
RIP: 0010:bpf_prog_kallsyms_find+0x289/0x4a0 kernel/bpf/core.c:509
Code: 03 42 80 3c 30 00 0f 85 b1 01 00 00 4d 8b 6f 50 49 8d 7d 30 48 89 fa  
48 c1 ea 03 42 80 3c 32 00 0f 85 ab 01 00 00 49 8d 7d 02 <4d> 8b 65 30 48  
89 fa 48 89 f9 48 c1 ea 03 83 e1 07 42 0f b6 14 32
RSP: 0018:ffff88019a060698 EFLAGS: 00010046
RAX: 0000000000000000 RBX: ffff8801c2a5ab08 RCX: ffffffff818b41d1
RDX: 1ffff92000326006 RSI: 0000000000000008 RDI: ffffc90001930002
RBP: ffff88019a060810 R08: ffff8801cce982c0 R09: 0000000000000001
R10: ffffed003b5a4732 R11: 0000000000000000 R12: 1ffff1003340c0f5
R13: ffffc90001930000 R14: dffffc0000000000 R15: ffff8801c2a5aaf0
FS:  00007f524d117700(0000) GS:ffff8801dad00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffc90001930030 CR3: 00000001d3889000 CR4: 00000000001406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
------------[ cut here ]------------
kernel BUG at mm/slab.c:4421!
invalid opcode: 0000 [#16] PREEMPT SMP KASAN
CPU: 1 PID: 7453 Comm: syz-executor5 Not tainted 4.19.0-rc2+ #209
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS  
Google 01/01/2011
RIP: 0010:__check_heap_object+0xa7/0xb5 mm/slab.c:4446
Code: 48 c7 c7 15 75 25 89 e8 97 83 0a 00 5d c3 41 8b 91 04 01 00 00 48 29  
c7 48 39 d7 77 be 48 01 d0 48 29 c8 48 39 f0 72 b3 5d c3 <0f> 0b 48 c7 c7  
15 75 25 89 e8 fd 8b 0a 00 44 89 e9 48 c7 c7 d0 75
RSP: 0018:ffff88019a05f3f0 EFLAGS: 00010046
RAX: 0000000000000001 RBX: 1ffff1003340be85 RCX: 000000000000000c
RDX: ffff88019a05e380 RSI: 0000000000000002 RDI: ffff88019a05f598
RBP: ffff88019a05f3f0 R08: ffff8801cce982c0 R09: ffff8801da972d80
R10: 0000000000000ff7 R11: 0000000000000000 R12: ffff88019a05f598
R13: 0000000000000002 R14: ffffea0006681780 R15: 0000000000000001
FS:  00007f524d117700(0000) GS:ffff8801dad00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffc90001930030 CR3: 00000001d3889000 CR4: 00000000001406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
BUG: unable to handle kernel paging request at ffffc90001930030
PGD 1da948067 P4D 1da948067 PUD 1da949067 PMD 1d49ae067 PTE 0
Thread overran stack, or stack corrupted
Oops: 0000 [#17] PREEMPT SMP KASAN
CPU: 1 PID: 7453 Comm: syz-executor5 Not tainted 4.19.0-rc2+ #209
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS  
Google 01/01/2011
RIP: 0010:bpf_prog_ebpf_jited include/linux/filter.h:898 [inline]
RIP: 0010:bpf_get_prog_addr_region kernel/bpf/core.c:381 [inline]
RIP: 0010:bpf_tree_comp kernel/bpf/core.c:435 [inline]
RIP: 0010:__lt_find include/linux/rbtree_latch.h:115 [inline]
RIP: 0010:latch_tree_find include/linux/rbtree_latch.h:208 [inline]
RIP: 0010:bpf_prog_kallsyms_find+0x289/0x4a0 kernel/bpf/core.c:509
Code: 03 42 80 3c 30 00 0f 85 b1 01 00 00 4d 8b 6f 50 49 8d 7d 30 48 89 fa  
48 c1 ea 03 42 80 3c 32 00 0f 85 ab 01 00 00 49 8d 7d 02 <4d> 8b 65 30 48  
89 fa 48 89 f9 48 c1 ea 03 83 e1 07 42 0f b6 14 32
RSP: 0018:ffff88019a05ee68 EFLAGS: 00010046
RAX: 0000000000000000 RBX: ffff8801c2a5ab08 RCX: ffffffff818b41d1
RDX: 1ffff92000326006 RSI: 0000000000000008 RDI: ffffc90001930002
RBP: ffff88019a05efe0 R08: ffff8801cce982c0 R09: 0000000000000001
R10: ffffed003b5a4732 R11: 0000000000000000 R12: 1ffff1003340bdef
R13: ffffc90001930000 R14: dffffc0000000000 R15: ffff8801c2a5aaf0
FS:  00007f524d117700(0000) GS:ffff8801dad00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffc90001930030 CR3: 00000001d3889000 CR4: 00000000001406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
Modules linked in:
Dumping ftrace buffer:
    (ftrace buffer empty)
CR2: ffffc90001930030
---[ end trace 90699f7c967c99ef ]---
RIP: 0010:bpf_prog_ebpf_jited include/linux/filter.h:898 [inline]
RIP: 0010:bpf_get_prog_addr_region kernel/bpf/core.c:381 [inline]
RIP: 0010:bpf_tree_comp kernel/bpf/core.c:435 [inline]
RIP: 0010:__lt_find include/linux/rbtree_latch.h:115 [inline]
RIP: 0010:latch_tree_find include/linux/rbtree_latch.h:208 [inline]
RIP: 0010:bpf_prog_kallsyms_find+0x289/0x4a0 kernel/bpf/core.c:509
Code: 03 42 80 3c 30 00 0f 85 b1 01 00 00 4d 8b 6f 50 49 8d 7d 30 48 89 fa  
48 c1 ea 03 42 80 3c 32 00 0f 85 ab 01 00 00 49 8d 7d 02 <4d> 8b 65 30 48  
89 fa 48 89 f9 48 c1 ea 03 83 e1 07 42 0f b6 14 32
RSP: 0018:ffff88019a066dd0 EFLAGS: 00010046
RAX: 0000000000000000 RBX: ffff8801c2a5ab08 RCX: ffffffff818b41d1
RDX: 1ffff92000326006 RSI: 0000000000000008 RDI: ffffc90001930002
RBP: ffff88019a066f48 R08: ffff8801cce982c0 R09: ffffed003b5a4732
R10: ffffed003b5a4732 R11: ffff8801dad23993 R12: 1ffff1003340cddc
R13: ffffc90001930000 R14: dffffc0000000000 R15: ffff8801c2a5aaf0
FS:  00007f524d117700(0000) GS:ffff8801dad00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffc90001930030 CR3: 00000001d3889000 CR4: 00000000001406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400


---
This bug is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@googlegroups.com.

syzbot will keep track of this bug report. See:
https://goo.gl/tpsmEJ#bug-status-tracking for how to communicate with  
syzbot.

^ permalink raw reply

* BUG: unable to handle kernel paging request in bpf_prog_kallsyms_add
From: syzbot @ 2018-09-10  8:31 UTC (permalink / raw)
  To: ast, daniel, linux-kernel, netdev, syzkaller-bugs

Hello,

syzbot found the following crash on:

HEAD commit:    f6f3bac08ff9 tools/bpf: bpftool: add net support
git tree:       bpf-next
console output: https://syzkaller.appspot.com/x/log.txt?x=17940056400000
kernel config:  https://syzkaller.appspot.com/x/.config?x=8f59875069d721b6
dashboard link: https://syzkaller.appspot.com/bug?extid=c827a78260579449ad39
compiler:       gcc (GCC) 8.0.1 20180413 (experimental)
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=1611c7e1400000

IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+c827a78260579449ad39@syzkaller.appspotmail.com

**   NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE   **
**********************************************************
BUG: unable to handle kernel paging request at ffffc90001930002
PGD 1da948067 P4D 1da948067 PUD 1da949067 PMD 1d49da067 PTE 0
Oops: 0000 [#1] PREEMPT SMP KASAN
CPU: 0 PID: 12601 Comm: syz-executor3 Not tainted 4.19.0-rc2+ #93
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS  
Google 01/01/2011
RIP: 0010:bpf_prog_kallsyms_candidate kernel/bpf/core.c:472 [inline]
RIP: 0010:bpf_prog_kallsyms_add+0xbe/0x9b0 kernel/bpf/core.c:483
Code: d0 31 c0 e8 14 68 f3 ff 49 8d 7c 24 02 48 89 f8 48 89 fa 48 c1 e8 03  
83 e2 07 0f b6 04 18 38 d0 7f 08 84 c0 0f 85 39 07 00 00 <41> 0f b6 5c 24  
02 31 ff 83 e3 01 89 de e8 b0 68 f3 ff 84 db 0f 84
RSP: 0018:ffff8801bc2af9c0 EFLAGS: 00010246
RAX: 0000000000000000 RBX: dffffc0000000000 RCX: ffffffff818c8b39
RDX: 0000000000000002 RSI: ffffffff818b671c RDI: ffffc90001930002
RBP: ffff8801bc2afb30 R08: ffff8801bf750100 R09: ffffed003b584732
R10: ffffed003b584732 R11: ffff8801dac23993 R12: ffffc90001930000
R13: ffff8801bc2afd18 R14: 0000000000000000 R15: 1ffff10037855f3d
FS:  00007fb5d21c9700(0000) GS:ffff8801dac00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffc90001930002 CR3: 00000001bcd1c000 CR4: 00000000001406f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
  bpf_prog_load+0x13d1/0x1cb0 kernel/bpf/syscall.c:1442
  __do_sys_bpf kernel/bpf/syscall.c:2371 [inline]
  __se_sys_bpf kernel/bpf/syscall.c:2333 [inline]
  __x64_sys_bpf+0x36c/0x510 kernel/bpf/syscall.c:2333
  do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290
  entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x457099
Code: fd b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7  
48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff  
ff 0f 83 cb b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007fb5d21c8c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000141
RAX: ffffffffffffffda RBX: 00007fb5d21c96d4 RCX: 0000000000457099
RDX: 0000000000000048 RSI: 0000000020000000 RDI: 0000000000000005
RBP: 00000000009300a0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff
R13: 00000000004cb9c8 R14: 00000000004c335d R15: 0000000000000000
Modules linked in:
Dumping ftrace buffer:
    (ftrace buffer empty)
CR2: ffffc90001930002
---[ end trace fcb4474011e9b55c ]---
RIP: 0010:bpf_prog_kallsyms_candidate kernel/bpf/core.c:472 [inline]
RIP: 0010:bpf_prog_kallsyms_add+0xbe/0x9b0 kernel/bpf/core.c:483
Code: d0 31 c0 e8 14 68 f3 ff 49 8d 7c 24 02 48 89 f8 48 89 fa 48 c1 e8 03  
83 e2 07 0f b6 04 18 38 d0 7f 08 84 c0 0f 85 39 07 00 00 <41> 0f b6 5c 24  
02 31 ff 83 e3 01 89 de e8 b0 68 f3 ff 84 db 0f 84
RSP: 0018:ffff8801bc2af9c0 EFLAGS: 00010246
RAX: 0000000000000000 RBX: dffffc0000000000 RCX: ffffffff818c8b39
RDX: 0000000000000002 RSI: ffffffff818b671c RDI: ffffc90001930002
RBP: ffff8801bc2afb30 R08: ffff8801bf750100 R09: ffffed003b584732
R10: ffffed003b584732 R11: ffff8801dac23993 R12: ffffc90001930000
R13: ffff8801bc2afd18 R14: 0000000000000000 R15: 1ffff10037855f3d
FS:  00007fb5d21c9700(0000) GS:ffff8801dac00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffc90001930002 CR3: 00000001bcd1c000 CR4: 00000000001406f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400


---
This bug is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@googlegroups.com.

syzbot will keep track of this bug report. See:
https://goo.gl/tpsmEJ#bug-status-tracking for how to communicate with  
syzbot.
syzbot can test patches for this bug, for details see:
https://goo.gl/tpsmEJ#testing-patches

^ permalink raw reply

* general protection fault in rhashtable_walk_exit
From: syzbot @ 2018-09-10  8:36 UTC (permalink / raw)
  To: davem, jon.maloy, linux-kernel, netdev, syzkaller-bugs,
	tipc-discussion, ying.xue

Hello,

syzbot found the following crash on:

HEAD commit:    f74dd480cf4e r8169: set TxConfig register after TX / RX is..
git tree:       net
console output: https://syzkaller.appspot.com/x/log.txt?x=1545498e400000
kernel config:  https://syzkaller.appspot.com/x/.config?x=8f59875069d721b6
dashboard link: https://syzkaller.appspot.com/bug?extid=3f8324abccfbf8c74a9f
compiler:       gcc (GCC) 8.0.1 20180413 (experimental)

Unfortunately, I don't have any reproducer for this crash yet.

IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+3f8324abccfbf8c74a9f@syzkaller.appspotmail.com

RBP: 00000000009300a0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000005
R13: 00000000004d4bc0 R14: 00000000004c910b R15: 0000000000000008
kasan: CONFIG_KASAN_INLINE enabled
kasan: GPF could be caused by NULL-ptr deref or user memory access
general protection fault: 0000 [#1] PREEMPT SMP KASAN
kobject: 'loop0' (00000000215195a2): kobject_uevent_env
CPU: 1 PID: 29198 Comm: syz-executor7 Not tainted 4.19.0-rc2+ #89
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS  
Google 01/01/2011
RIP: 0010:rhashtable_walk_exit+0x74/0x360 lib/rhashtable.c:689
Code: 8e 83 c7 00 f1 f1 f1 f1 c7 40 04 00 f2 f2 f2 65 48 8b 04 25 28 00 00  
00 48 89 45 d0 31 c0 e8 13 28 f0 fd 48 89 d8 48 c1 e8 03 <42> 80 3c 28 00  
0f 85 e5 01 00 00 48 8b 03 48 8d b8 00 01 00 00 e8
RSP: 0018:ffff8801d7ea70e8 EFLAGS: 00010246
RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffffc90005071000
RDX: 0000000000040000 RSI: ffffffff838ea71d RDI: 0000000000000000
RBP: ffff8801d7ea7188 R08: ffff8801bd23c400 R09: ffffed0037cde4b6
R10: ffffed0037cde4b6 R11: ffff8801be6f25b3 R12: 1ffff1003afd4e20
R13: dffffc0000000000 R14: ffff8801d7ea7160 R15: dffffc0000000000
FS:  00007fe16cc8f700(0000) GS:ffff8801daf00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000001b32023000 CR3: 00000001ba6b3000 CR4: 00000000001406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
  tipc_dump_done+0x34/0x50 net/tipc/socket.c:3295
  __tipc_nl_compat_dumpit.isra.11+0x670/0xb30 net/tipc/netlink_compat.c:220
kobject: 'loop0' (00000000215195a2): fill_kobj_path: path  
= '/devices/virtual/block/loop0'
  tipc_nl_compat_dumpit+0x1f4/0x440 net/tipc/netlink_compat.c:267
  tipc_nl_compat_handle net/tipc/netlink_compat.c:1149 [inline]
  tipc_nl_compat_recv+0x1078/0x19a0 net/tipc/netlink_compat.c:1207
  genl_family_rcv_msg+0x8a9/0x1140 net/netlink/genetlink.c:601
  genl_rcv_msg+0xc6/0x168 net/netlink/genetlink.c:626
  netlink_rcv_skb+0x172/0x440 net/netlink/af_netlink.c:2454
  genl_rcv+0x28/0x40 net/netlink/genetlink.c:637
  netlink_unicast_kernel net/netlink/af_netlink.c:1317 [inline]
  netlink_unicast+0x5a5/0x760 net/netlink/af_netlink.c:1343
  netlink_sendmsg+0xa18/0xfc0 net/netlink/af_netlink.c:1908
  sock_sendmsg_nosec net/socket.c:621 [inline]
  sock_sendmsg+0xd5/0x120 net/socket.c:631
  ___sys_sendmsg+0x7fd/0x930 net/socket.c:2114
  __sys_sendmsg+0x11d/0x280 net/socket.c:2152
  __do_sys_sendmsg net/socket.c:2161 [inline]
  __se_sys_sendmsg net/socket.c:2159 [inline]
  __x64_sys_sendmsg+0x78/0xb0 net/socket.c:2159
  do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290
  entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x457099
Code: fd b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7  
48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff  
ff 0f 83 cb b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007fe16cc8ec78 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 00007fe16cc8f6d4 RCX: 0000000000457099
RDX: 0000000000000000 RSI: 0000000020000100 RDI: 0000000000000004
RBP: 00000000009300a0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000005
R13: 00000000004d4bc0 R14: 00000000004c910b R15: 0000000000000008
Modules linked in:
Dumping ftrace buffer:
---------------------------------
syz-exec-8484    1...1 142827802us : 0: u00000000488588c4	
syz-exec-8484    1...1 142827812us : 0: u00000000488588c4	
syz-exec-8484    1...1 142827818us : 0: u00000000488588c4	
syz-exec-8484    1...1 142827824us : 0: u00000000488588c4	
syz-exec-8484    1...1 142827831us : 0: u00000000488588c4	
syz-exec-8484    1...1 142827837us : 0: u00000000488588c4	
syz-exec-8484    1...1 142827842us : 0: u00000000488588c4	
syz-exec-8484    1...1 142827848us : 0: u00000000488588c4	
syz-exec-8484    1...1 142827853us : 0: u00000000488588c4	
syz-exec-8484    1...1 142827858us : 0: u00000000488588c4	
syz-exec-8484    1...1 142827863us : 0: u00000000488588c4	
syz-exec-8484    1...1 142827869us : 0: u00000000488588c4	
syz-exec-8484    1...1 142827874us : 0: u00000000488588c4	
syz-exec-8484    1...1 142827879us : 0: u00000000488588c4	
syz-exec-8484    1...1 142827884us : 0: u00000000488588c4	
syz-exec-8484    1...1 142827889us : 0: u00000000488588c4	
syz-exec-8484    1...1 142827893us : 0: u00000000488588c4	
syz-exec-8484    1...1 142827898us : 0: u00000000488588c4	
syz-exec-8484    1...1 142827903us : 0: u00000000488588c4	
syz-exec-8484    1...1 142827907us : 0: u00000000488588c4	
syz-exec-8484    1...1 142827911us : 0: u00000000488588c4	
syz-exec-8484    1...1 142827916us : 0: u00000000488588c4	
syz-exec-8484    1...1 142827921us : 0: u00000000488588c4	
syz-exec-8484    1...1 142827926us : 0: u00000000488588c4	
syz-exec-8484    1...1 142827931us : 0: u00000000488588c4	
syz-exec-8484    1...1 142827936us : 0: u00000000488588c4	
syz-exec-8484    1...1 142827941us : 0: u00000000488588c4	
syz-exec-8484    1...1 142827946us : 0: u00000000488588c4	
syz-exec-8484    1...1 142827951us : 0: u00000000488588c4	
syz-exec-8484    1...1 142827956us : 0: u00000000488588c4	
syz-exec-8484    1...1 142827961us : 0: u00000000488588c4	
syz-exec-8484    1...1 142827966us : 0: u00000000488588c4	
syz-exec-8484    1...1 142827971us : 0: u00000000488588c4	
syz-exec-8484    1...1 142827977us : 0: u00000000488588c4	
syz-exec-8484    1...1 142827982us : 0: u00000000488588c4	
syz-exec-8484    1...1 142827987us : 0: u00000000488588c4	
syz-exec-8484    1...1 142827991us : 0: u00000000488588c4	
syz-exec-8484    1...1 142827996us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828001us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828006us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828011us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828016us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828021us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828027us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828033us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828037us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828043us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828048us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828054us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828059us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828065us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828070us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828076us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828081us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828086us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828091us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828096us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828102us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828107us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828112us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828117us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828122us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828127us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828132us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828137us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828141us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828146us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828151us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828180us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828189us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828194us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828200us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828206us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828212us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828217us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828222us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828228us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828235us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828242us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828247us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828254us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828260us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828265us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828272us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828277us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828283us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828288us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828294us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828299us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828305us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828310us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828316us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828321us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828326us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828331us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828336us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828341us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828346us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828352us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828357us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828362us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828370us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828375us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828381us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828386us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828391us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828396us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828401us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828406us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828411us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828416us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828421us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828427us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828432us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828437us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828442us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828447us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828459us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828464us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828469us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828474us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828480us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828485us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828490us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828495us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828500us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828505us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828511us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828516us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828521us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828526us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828531us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828536us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828542us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828547us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828552us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828557us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828562us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828567us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828572us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828577us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828582us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828587us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828593us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828598us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828603us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828608us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828613us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828618us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828624us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828629us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828634us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828640us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828645us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828650us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828655us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828660us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828665us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828670us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828676us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828690us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828696us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828701us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828707us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828713us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828719us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828725us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828730us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828736us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828741us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828747us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828753us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828759us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828765us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828770us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828776us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828781us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828787us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828792us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828797us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828802us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828807us : 0: u00000000488588c4	
syz-exec-8484    1.N.1 142828853us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828906us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828912us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828918us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828923us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828929us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828934us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828940us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828945us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828950us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828956us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828961us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828967us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828972us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828978us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828983us : 0: u00000000488588c4	
syz-exec-8484    1...1 142828993us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829004us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829010us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829015us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829020us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829027us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829033us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829039us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829044us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829049us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829054us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829059us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829065us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829070us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829075us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829080us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829085us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829090us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829095us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829110us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829116us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829123us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829128us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829133us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829139us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829144us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829150us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829155us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829174us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829181us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829188us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829205us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829210us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829215us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829221us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829228us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829235us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829240us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829246us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829251us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829257us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829263us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829270us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829275us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829281us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829287us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829292us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829310us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829317us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829323us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829329us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829335us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829341us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829346us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829353us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829358us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829365us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829371us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829377us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829383us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829389us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829395us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829401us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829407us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829413us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829419us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829425us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829431us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829438us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829444us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829450us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829455us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829461us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829467us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829473us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829479us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829485us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829491us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829496us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829503us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829508us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829514us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829519us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829525us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829531us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829537us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829544us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829549us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829556us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829561us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829566us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829572us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829577us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829583us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829588us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829595us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829599us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829606us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829611us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829617us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829623us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829629us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829634us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829639us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829644us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829649us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829654us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829661us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829666us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829672us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829677us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829694us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829700us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829706us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829712us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829717us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829723us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829728us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829734us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829739us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829744us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829750us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829755us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829762us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829766us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829772us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829778us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829784us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829790us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829795us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829801us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829805us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829811us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829816us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829823us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829829us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829835us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829841us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829846us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829852us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829857us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829862us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829867us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829872us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829877us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829882us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829888us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829893us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829899us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829905us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829911us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829917us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829923us : 0: u00000000488588c4	
syz-exec-8484    1...1 142829929us : 0: u00000000488588c4	
syz-exec-8484    1.N.1 142829976us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830035us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830043us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830048us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830055us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830060us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830066us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830072us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830079us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830085us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830091us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830097us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830102us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830107us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830112us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830118us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830124us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830130us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830136us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830141us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830148us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830153us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830172us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830178us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830186us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830193us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830198us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830204us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830209us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830215us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830220us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830226us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830231us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830237us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830242us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830247us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830252us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830258us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830263us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830268us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830273us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830280us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830285us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830291us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830297us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830303us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830308us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830314us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830320us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830326us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830332us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830337us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830344us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830349us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830355us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830361us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830367us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830374us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830379us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830385us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830392us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830398us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830403us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830409us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830415us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830420us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830426us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830430us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830436us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830442us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830448us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830454us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830459us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830466us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830471us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830478us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830484us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830490us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830496us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830501us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830508us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830513us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830519us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830526us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830532us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830538us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830544us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830550us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830556us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830563us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830568us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830574us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830580us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830586us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830592us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830598us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830604us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830610us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830616us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830621us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830627us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830634us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830639us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830646us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830651us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830657us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830662us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830669us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830675us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830690us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830697us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830703us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830709us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830714us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830721us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830726us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830732us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830738us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830743us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830750us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830756us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830762us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830767us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830773us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830779us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830784us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830790us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830796us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830802us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830807us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830813us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830818us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830824us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830830us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830835us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830841us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830847us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830853us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830860us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830865us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830871us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830876us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830882us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830886us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830892us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830897us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830904us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830909us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830915us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830922us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830927us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830932us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830937us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830942us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830947us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830952us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830959us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830966us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830974us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830979us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830986us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830991us : 0: u00000000488588c4	
syz-exec-8484    1...1 142830997us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831003us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831008us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831015us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831020us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831026us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831032us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831038us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831044us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831049us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831055us : 0: u00000000488588c4	
syz-exec-8484    1.N.1 142831102us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831173us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831181us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831188us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831194us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831201us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831207us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831213us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831218us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831224us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831229us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831235us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831240us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831245us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831250us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831255us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831260us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831265us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831271us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831276us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831281us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831287us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831292us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831298us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831303us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831308us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831313us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831319us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831324us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831329us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831334us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831339us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831345us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831350us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831355us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831360us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831365us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831370us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831375us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831382us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831387us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831393us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831398us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831404us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831409us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831415us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831421us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831426us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831432us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831437us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831442us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831448us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831453us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831458us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831463us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831470us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831475us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831481us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831486us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831492us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831497us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831503us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831508us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831513us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831519us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831524us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831529us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831534us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831540us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831546us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831551us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831557us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831562us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831568us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831573us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831578us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831584us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831590us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831596us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831601us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831608us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831614us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831620us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831625us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831631us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831637us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831644us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831651us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831656us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831662us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831668us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831675us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831690us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831697us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831703us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831708us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831714us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831719us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831725us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831731us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831737us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831743us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831749us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831755us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831760us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831766us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831771us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831776us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831781us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831786us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831792us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831797us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831802us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831807us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831813us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831818us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831823us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831829us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831834us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831840us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831844us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831850us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831855us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831860us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831867us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831872us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831878us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831884us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831890us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831895us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831901us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831907us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831912us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831919us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831924us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831930us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831935us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831941us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831947us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831952us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831957us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831962us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831967us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831973us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831978us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831983us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831988us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831993us : 0: u00000000488588c4	
syz-exec-8484    1...1 142831998us : 0: u00000000488588c4	
syz-exec-8484    1...1 142832003us : 0: u00000000488588c4	
syz-exec-8484    1...1 142832009us : 0: u00000000488588c4	
syz-exec-8484    1...1 142832014us : 0: u00000000488588c4	
syz-exec-8484    1...1 142832019us : 0: u00000000488588c4	
syz-exec-8484    1...1 142832024us : 0: u00000000488588c4	
syz-exec-8484    1...1 142832030us : 0: u00000000488588c4	
syz-exec-8484    1...1 142832035us : 0: u00000000488588c4	
syz-exec-8484    1...1 142832040us : 0: u00000000488588c4	
syz-exec-8484    1...1 142832045us : 0: u00000000488588c4	
syz-exec-8484    1...1 142832050us : 0: u00000000488588c4	
syz-exec-8484    1...1 142832056us : 0: u00000000488588c4	
syz-exec-8484    1...1 142832061us : 0: u00000000488588c4	
syz-exec-8484    1...1 142832066us : 0: u00000000488588c4	
syz-exec-8484    1...1 142832071us : 0: u00000000488588c4	
syz-exec-8484    1...1 142832076us : 0: u00000000488588c4	
syz-exec-8484    1...1 142832081us : 0: u00000000488588c4	
syz-exec-8484    1...1 142832087us : 0: u00000000488588c4	
syz-exec-8484    1...1 142832092us : 0: u00000000488588c4	
syz-exec-8484    1...1 142832097us : 0: u00000000488588c4	
syz-exec-8484    1...1 142832102us : 0: u00000000488588c4	
syz-exec-8484    1...1 142832107us : 0: u00000000488588c4	
syz-exec-8484    1...1 142832113us : 0: u00000000488588c4	
syz-exec-8484    1...1 142832118us : 0: u00000000488588c4	
syz-exec-8484    1...1 142832123us : 0: u00000000488588c4	
syz-exec-8484    1...1 142832128us : 0: u00000000488588c4	
syz-exec-8484    1...1 142832133us : 0: u00000000488588c4	
syz-exec-8484    1...1 142832138us : 0: u00000000488588c4	
syz-exec-8484    1...1 142832144us : 0: u00000000488588c4	
syz-exec-8484    1...1 142832149us : 0: u00000000488588c4	
syz-exec-8484    1...1 142832154us : 0: u00000000488588c4	
syz-exec-8484    1...1 142832174us : 0: u00000000488588c4	
syz-exec-8484    1...1 142832180us : 0: u00000000488588c4	
syz-exec-8484    1.N.1 142832226us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835389us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835397us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835403us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835408us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835414us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835420us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835428us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835435us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835440us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835446us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835452us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835458us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835463us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835468us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835474us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835479us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835484us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835489us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835495us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835500us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835505us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835510us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835515us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835520us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835526us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835531us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835536us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835542us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835547us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835552us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835557us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835562us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835567us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835572us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835577us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835583us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835588us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835593us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835598us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835603us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835608us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835614us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835619us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835624us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835630us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835636us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835642us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835647us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835653us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835659us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835665us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835670us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835676us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835692us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835698us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835704us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835709us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835716us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835722us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835728us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835734us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835739us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835746us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835751us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835757us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835762us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835768us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835773us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835778us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835784us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835789us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835794us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835800us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835806us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835812us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835817us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835824us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835829us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835835us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835840us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835846us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835852us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835857us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835862us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835867us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835872us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835878us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835884us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835889us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835895us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835900us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835905us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835910us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835915us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835920us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835925us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835930us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835935us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835940us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835945us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835951us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835956us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835961us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835967us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835972us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835979us : 0: u00000000488588c4	
syz-exec-8484    1...1 142835985us : 0: u00000000488588c4	
syz-exec-8484    1...1 142836061us : 0: u00000000488588c4	
syz-exec-8484    1...1 142836069us : 0: u00000000488588c4	
syz-exec-8484    1...1 142836075us : 0: u00000000488588c4	
syz-exec-8484    1...1 142836081us : 0: u00000000488588c4	
syz-exec-8484    1...1 142836088us : 0: u00000000488588c4	
syz-exec-8484    1...1 142836093us : 0: u00000000488588c4	
syz-exec-8484    1...1 142836099us : 0: u00000000488588c4	
syz-exec-8484    1...1 142836103us : 0: u00000000488588c4	
syz-exec-8484    1...1 142836109us : 0: u00000000488588c4	
syz-exec-8484    1...1 142836114us : 0: u00000000488588c4	
syz-exec-8484    1...1 142836120us : 0: u00000000488588c4	
syz-exec-8484    1...1 142836124us : 0: u00000000488588c4	
syz-exec-8484    1...1 142836129us : 0: u00000000488588c4	
syz-exec-8484    1...1 142836134us : 0: u00000000488588c4	
syz-exec-8484    1...1 142836140us : 0: u00000000488588c4	
syz-exec-8484    1...1 142836145us : 0: u00000000488588c4	
syz-exec-8484    1...1 142836151us : 0: u00000000488588c4	
syz-exec-8484    1...1 142836170us : 0: u00000000488588c4	
syz-exec-8484    1...1 142836188us : 0: u00000000488588c4	
syz-exec-8484    1...1 142836196us : 0: u00000000488588c4	
syz-exec-8484    1...1 142836202us : 0: u00000000488588c4	
syz-exec-8484    1...1 142836208us : 0: u00000000488588c4	
syz-exec-8484    1...1 142836214us : 0: u00000000488588c4	
syz-exec-8484    1...1 142836219us : 0: u00000000488588c4	
syz-exec-8484    1...1 142836225us : 0: u00000000488588c4	
syz-exec-8484    1...1 142836231us : 0: u00000000488588c4	
syz-exec-8484    1...1 142836237us : 0: u00000000488588c4	
syz-exec-8484    1...1 142836244us : 0: u00000000488588c4	
syz-exec-8484    1...1 142836249us : 0: u00000000488588c4	
syz-exec-8484    1...1 142836256us : 0: u00000000488588c4	
syz-exec-8484    1...1 142836261us : 0: u00000000488588c4	
syz-exec-8484    1...1 142836266us : 0: u00000000488588c4	
syz-exec-8484    1...1 142836278us : 0: u00000000488588c4	
syz-exec-8484    1...1 142836283us : 0: u00000000488588c4	
syz-exec-8484    1...1 142836289us : 0: u00000000488588c4	
syz-exec-8484    1...1 142836294us : 0: u00000000488588c4	
syz-exec-8484    1...1 142836299us : 0: u00000000488588c4	
syz-exec-8484    1...1 142836304us : 0: u00000000488588c4	
syz-exec-8484    1...1 142836309us : 0: u00000000488588c4	
syz-exec-8484    1...1 142836314us : 0: u00000000488588c4	
syz-exec-8484    1...1 142836319us : 0: u00000000488588c4	
syz-exec-8484    1...1 142836324us : 0: u00000000488588c4	
syz-exec-8484    1...1 142836329us : 0: u00000000488588c4	
syz-exec-8484    1...1 142836334us : 0: u00000000488588c4	
syz-exec-8484    1...1 142836339us : 0: u00000000488588c4	
syz-exec-8484    1...1 142836344us : 0: u00000000488588c4	
syz-exec-8484    1...1 142836349us : 0: u00000000488588c4	
syz-exec-8484    1...1 142836356us : 0: u00000000488588c4	
syz-exec-8484    1...1 142836361us : 0: u00000000488588c4	
syz-exec-8484    1...1 142836367us : 0: u00000000488588c4	
syz-exec-8484    1...1 142836373us : 0: u00000000488588c4	
syz-exec-8484    1...1 142836378us : 0: u00000000488588c4	
syz-exec-8484    1...1 142836384us : 0: u00000000488588c4	
syz-exec-8484    1...1 142836390us : 0: u00000000488588c4	
syz-exec-8484    1...1 142836396us : 0: u00000000488588c4	
syz-exec-8484    1...1 142836401us : 0: u00000000488588c4	
syz-exec-8484    1...1 142836407us : 0: u00000000488588c4	
syz-exec-8484    1...1 142836412us : 0: u00000000488588c4	
syz-exec-8484    1.N.1 142836458us : 0: u00000000488588c4	
syz-exec-8484    1...1 142840674us : 0: u00000000488588c4	
syz-exec-8484    1...1 142840693us : 0: u00000000488588c4	
syz-exec-8484    1...1 142840699us : 0: u00000000488588c4	
syz-exec-8484    1...1 142840705us : 0: u00000000488588c4	
syz-exec-8484    1...1 142840710us : 0: u00000000488588c4	
syz-exec-8484    1...1 142840717us : 0: u00000000488588c4	
syz-exec-8484    1...1 142840722us : 0: u00000000488588c4	
syz-exec-8484    1...1 142840728us : 0: u00000000488588c4	
syz-exec-8484    1...1 142840734us : 0: u00000000488588c4	
syz-exec-8484    1...1 142840740us : 0: u00000000488588c4	
syz-exec-8484    1...1 142840746us : 0: u00000000488588c4	
syz-exec-8484    1...1 142840751us : 0: u00000000488588c4	
syz-exec-8484    1...1 142840757us : 0: u00000000488588c4	
syz-exec-8484    1...1 142840762us : 0: u00000000488588c4	
syz-exec-8484    1...1 142840768us : 0: u00000000488588c4	
syz-exec-8484    1...1 142840774us : 0: u00000000488588c4	
syz-exec-8484    1...1 142840779us : 0: u00000000488588c4	
syz-exec-8484    1...1 142840785us : 0: u00000000488588c4	
syz-exec-8484    1...1 142840790us : 0: u00000000488588c4	
syz-exec-8484    1...1 142840795us : 0: u00000000488588c4	
syz-exec-8484    1...1 142840800us : 0: u00000000488588c4	
syz-exec-8484    1...1 142840806us : 0: u00000000488588c4	
syz-exec-8484    1...1 142840812us : 0: u00000000488588c4	
syz-exec-8484    1...1 142840818us : 0: u00000000488588c4	
syz-exec-8484    1...1 142840824us : 0: u00000000488588c4	
syz-exec-8484    1...1 142840830us : 0: u00000000488588c4	
syz-exec-8484    1...1 142840836us : 0: u00000000488588c4	
syz-exec-8484    1...1 142840842us : 0: u00000000488588c4	
syz-exec-8484    1...1 142840847us : 0: u00000000488588c4	
syz-exec-8484    1...1 142840853us : 0: u00000000488588c4	
syz-exec-8484    1...1 142840858us : 0: u00000000488588c4	
syz-exec-8484    1...1 142840863us : 0: u00000000488588c4	
syz-exec-8484    1...1 142840868us : 0: u00000000488588c4	
syz-exec-8484    1...1 142840873us : 0: u00000000488588c4	
syz-exec-8484    1...1 142840878us : 0: u00000000488588c4	
syz-exec-8484    1...1 142840883us : 0: u00000000488588c4	
syz-exec-8484    1...1 142840926us : 0: u00000000488588c4	
syz-exec-8484    1...1 142840932us : 0: u00000000488588c4	
syz-exec-8484    1...1 142840937us : 0: u00000000488588c4	
syz-exec-8484    1...1 142840942us : 0: u00000000488588c4	
syz-exec-8484    1...1 142840947us : 0: u00000000488588c4	
syz-exec-8484    1...1 142840953us : 0: u00000000488588c4	
syz-exec-8484    1...1 142840958us : 0: u00000000488588c4	
syz-exec-8484    1...1 142840963us : 0: u00000000488588c4	
syz-exec-8484    1...1 142840969us : 0: u00000000488588c4	
syz-exec-8484    1...1 142840974us : 0: u00000000488588c4	
syz-exec-8484    1...1 142840980us : 0: u00000000488588c4	
syz-exec-8484    1...1 142840985us : 0: u00000000488588c4	
syz-exec-8484    1...1 142840990us : 0: u00000000488588c4	
syz-exec-8484    1...1 142840995us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841000us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841005us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841010us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841015us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841020us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841025us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841030us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841036us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841041us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841046us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841051us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841057us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841062us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841067us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841072us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841077us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841083us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841088us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841093us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841098us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841104us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841109us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841114us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841119us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841124us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841129us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841134us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841139us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841145us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841150us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841168us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841175us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841180us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841189us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841194us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841199us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841204us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841210us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841215us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841220us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841225us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841230us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841235us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841240us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841245us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841250us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841255us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841260us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841266us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841271us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841277us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841282us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841287us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841293us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841298us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841303us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841308us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841314us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841319us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841325us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841330us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841335us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841340us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841345us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841350us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841356us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841361us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841366us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841371us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841376us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841381us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841386us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841391us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841397us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841402us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841407us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841412us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841417us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841423us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841428us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841433us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841438us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841443us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841448us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841453us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841459us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841464us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841469us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841474us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841479us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841485us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841490us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841495us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841500us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841505us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841510us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841517us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841523us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841528us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841533us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841538us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841544us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841549us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841554us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841559us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841564us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841570us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841575us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841580us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841585us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841590us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841595us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841601us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841606us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841611us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841616us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841622us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841627us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841632us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841637us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841643us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841648us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841653us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841658us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841663us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841669us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841673us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841685us : 0: u00000000488588c4	
syz-exec-8484    1...1 142841691us : 0: u00000000488588c4	
syz-exe

---
This bug is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@googlegroups.com.

syzbot will keep track of this bug report. See:
https://goo.gl/tpsmEJ#bug-status-tracking for how to communicate with  
syzbot.

^ permalink raw reply

* Re: [PATCH] wireless: remove unnecessary condition check before kfree
From: zhong jiang @ 2018-09-10 13:54 UTC (permalink / raw)
  To: Johannes Berg; +Cc: davem, linux-wireless, netdev, linux-kernel
In-Reply-To: <1536563406.3224.2.camel@sipsolutions.net>

On 2018/9/10 15:10, Johannes Berg wrote:
> On Sat, 2018-09-08 at 22:12 +0800, zhong jiang wrote:
>> kfree has taken the null pointer into account. Just remove the
>> redundant condition check before kfree.
> I'm all for doing that if it actually removes conditionals, but
>
>> -	if (!IS_ERR_OR_NULL(regdb))
>> +	if (!IS_ERR(regdb))
>>  		kfree(regdb);
> this seems rather pointless since there's still a condition. In that
> case, I feel it's easier to understand the original code.
 Fine, make sense you have said. I just consider the duplication of function.
 
 Thanks,
 zhong jiang
> johannes
>
> .
>

^ permalink raw reply

* Re: kernels > v4.12 oops/crash with ipsec-traffic: bisected to b838d5e1c5b6e57b10ec8af2268824041e3ea911: ipv4: mark DST_NOGC and remove the operation of dst_free()
From: Tobias Hommel @ 2018-09-10  9:06 UTC (permalink / raw)
  To: Steffen Klassert; +Cc: Wolfgang Walter, netdev, Wei Wang, Eric Dumazet
In-Reply-To: <20180910063739.GX23674@gauss3.secunet.de>

On Mon, Sep 10, 2018 at 08:37:39AM +0200, Steffen Klassert wrote:
...
> The other thing I wonder about is why Tobias bisected this to
> 
> commit b838d5e1c5b6e57b10ec8af2268824041e3ea911
> ipv4: mark DST_NOGC and remove the operation of dst_free()
> 
> from 'Jun 17 2017' and not to
> 
> commit 222d7dbd258dad4cd5241c43ef818141fad5a87a
> net: prevent dst uses after free
> 
> from 'Sep 21 2017'.
> 
> Maybe Tobias has seen two bugs. Before
> ("net: prevent dst uses after free"), it was the
> use after free, and after this fix it was a NULL
> pointer derference of skb->dst.
> 
Uhm, yeah, I checked back, we actually had different bugs. My mistake, sorry
for the confusion.

^ permalink raw reply

* [PATCH net-next v2 0/2] net: stmmac: Coalesce and tail addr fixes
From: Jose Abreu @ 2018-09-10  9:14 UTC (permalink / raw)
  To: netdev
  Cc: Jose Abreu, Jerome Brunet, Martin Blumenstingl, David S. Miller,
	Joao Pinto, Giuseppe Cavallaro, Alexandre Torgue

The fix for coalesce timer and a fix in tail address setting that impacts
XGMAC2 operation.

Cc: Jerome Brunet <jbrunet@baylibre.com>
Cc: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Joao Pinto <jpinto@synopsys.com>
Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Cc: Alexandre Torgue <alexandre.torgue@st.com>

Jose Abreu (2):
  net: stmmac: Rework coalesce timer and fix multi-queue races
  net: stmmac: Fixup the tail addr setting in xmit path

 drivers/net/ethernet/stmicro/stmmac/common.h      |   4 +-
 drivers/net/ethernet/stmicro/stmmac/stmmac.h      |   6 +-
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 212 ++++++++++++++--------
 3 files changed, 138 insertions(+), 84 deletions(-)

-- 
2.7.4

^ permalink raw reply

* [PATCH net-next v2 1/2] net: stmmac: Rework coalesce timer and fix multi-queue races
From: Jose Abreu @ 2018-09-10  9:14 UTC (permalink / raw)
  To: netdev
  Cc: Jose Abreu, Jerome Brunet, Martin Blumenstingl, David S. Miller,
	Joao Pinto, Giuseppe Cavallaro, Alexandre Torgue
In-Reply-To: <cover.1536570319.git.joabreu@synopsys.com>

This follows David Miller advice and tries to fix coalesce timer in
multi-queue scenarios.

We are now using per-queue coalesce values and per-queue TX timer.

Coalesce timer default values was changed to 1ms and the coalesce frames
to 25.

Tested in B2B setup between XGMAC2 and GMAC5.

Signed-off-by: Jose Abreu <joabreu@synopsys.com>
Cc: Jerome Brunet <jbrunet@baylibre.com>
Cc: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Joao Pinto <jpinto@synopsys.com>
Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Cc: Alexandre Torgue <alexandre.torgue@st.com>
---
Jerome,

Can you please test if this one is okay ?

Thanks and Best Regards,
Jose Miguel Abreu
---
 drivers/net/ethernet/stmicro/stmmac/common.h      |   4 +-
 drivers/net/ethernet/stmicro/stmmac/stmmac.h      |   6 +-
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 207 ++++++++++++++--------
 3 files changed, 135 insertions(+), 82 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/common.h b/drivers/net/ethernet/stmicro/stmmac/common.h
index 1854f270ad66..b1b305f8f414 100644
--- a/drivers/net/ethernet/stmicro/stmmac/common.h
+++ b/drivers/net/ethernet/stmicro/stmmac/common.h
@@ -258,10 +258,10 @@ struct stmmac_safety_stats {
 #define MAX_DMA_RIWT		0xff
 #define MIN_DMA_RIWT		0x20
 /* Tx coalesce parameters */
-#define STMMAC_COAL_TX_TIMER	40000
+#define STMMAC_COAL_TX_TIMER	1000
 #define STMMAC_MAX_COAL_TX_TICK	100000
 #define STMMAC_TX_MAX_FRAMES	256
-#define STMMAC_TX_FRAMES	64
+#define STMMAC_TX_FRAMES	25
 
 /* Packets types */
 enum packets_types {
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac.h b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
index c0a855b7ab3b..957030cfb833 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac.h
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
@@ -48,6 +48,9 @@ struct stmmac_tx_info {
 
 /* Frequently used values are kept adjacent for cache effect */
 struct stmmac_tx_queue {
+	u32 tx_count_frames;
+	int tx_timer_active;
+	struct timer_list txtimer;
 	u32 queue_index;
 	struct stmmac_priv *priv_data;
 	struct dma_extended_desc *dma_etx ____cacheline_aligned_in_smp;
@@ -59,6 +62,7 @@ struct stmmac_tx_queue {
 	dma_addr_t dma_tx_phy;
 	u32 tx_tail_addr;
 	u32 mss;
+	struct napi_struct napi ____cacheline_aligned_in_smp;
 };
 
 struct stmmac_rx_queue {
@@ -109,14 +113,12 @@ struct stmmac_pps_cfg {
 
 struct stmmac_priv {
 	/* Frequently used values are kept adjacent for cache effect */
-	u32 tx_count_frames;
 	u32 tx_coal_frames;
 	u32 tx_coal_timer;
 
 	int tx_coalesce;
 	int hwts_tx_en;
 	bool tx_path_in_lpi_mode;
-	struct timer_list txtimer;
 	bool tso;
 
 	unsigned int dma_buf_sz;
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 9f458bb16f2a..9809c2b319fe 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -148,6 +148,7 @@ static void stmmac_verify_args(void)
 static void stmmac_disable_all_queues(struct stmmac_priv *priv)
 {
 	u32 rx_queues_cnt = priv->plat->rx_queues_to_use;
+	u32 tx_queues_cnt = priv->plat->tx_queues_to_use;
 	u32 queue;
 
 	for (queue = 0; queue < rx_queues_cnt; queue++) {
@@ -155,6 +156,12 @@ static void stmmac_disable_all_queues(struct stmmac_priv *priv)
 
 		napi_disable(&rx_q->napi);
 	}
+
+	for (queue = 0; queue < tx_queues_cnt; queue++) {
+		struct stmmac_tx_queue *tx_q = &priv->tx_queue[queue];
+
+		napi_disable(&tx_q->napi);
+	}
 }
 
 /**
@@ -164,6 +171,7 @@ static void stmmac_disable_all_queues(struct stmmac_priv *priv)
 static void stmmac_enable_all_queues(struct stmmac_priv *priv)
 {
 	u32 rx_queues_cnt = priv->plat->rx_queues_to_use;
+	u32 tx_queues_cnt = priv->plat->tx_queues_to_use;
 	u32 queue;
 
 	for (queue = 0; queue < rx_queues_cnt; queue++) {
@@ -171,6 +179,12 @@ static void stmmac_enable_all_queues(struct stmmac_priv *priv)
 
 		napi_enable(&rx_q->napi);
 	}
+
+	for (queue = 0; queue < tx_queues_cnt; queue++) {
+		struct stmmac_tx_queue *tx_q = &priv->tx_queue[queue];
+
+		napi_enable(&tx_q->napi);
+	}
 }
 
 /**
@@ -1843,7 +1857,8 @@ static void stmmac_dma_operation_mode(struct stmmac_priv *priv)
  * @queue: TX queue index
  * Description: it reclaims the transmit resources after transmission completes.
  */
-static void stmmac_tx_clean(struct stmmac_priv *priv, u32 queue)
+static int stmmac_tx_clean(struct stmmac_priv *priv, int limit, u32 queue,
+			   bool *more)
 {
 	struct stmmac_tx_queue *tx_q = &priv->tx_queue[queue];
 	unsigned int bytes_compl = 0, pkts_compl = 0;
@@ -1851,10 +1866,13 @@ static void stmmac_tx_clean(struct stmmac_priv *priv, u32 queue)
 
 	netif_tx_lock(priv->dev);
 
+	if (more)
+		*more = false;
+
 	priv->xstats.tx_clean++;
 
 	entry = tx_q->dirty_tx;
-	while (entry != tx_q->cur_tx) {
+	while ((entry != tx_q->cur_tx) && (pkts_compl < limit)) {
 		struct sk_buff *skb = tx_q->tx_skbuff[entry];
 		struct dma_desc *p;
 		int status;
@@ -1937,7 +1955,13 @@ static void stmmac_tx_clean(struct stmmac_priv *priv, u32 queue)
 		stmmac_enable_eee_mode(priv);
 		mod_timer(&priv->eee_ctrl_timer, STMMAC_LPI_T(eee_timer));
 	}
+
+	if (more && (tx_q->dirty_tx != tx_q->cur_tx))
+		*more = true;
+
 	netif_tx_unlock(priv->dev);
+
+	return pkts_compl;
 }
 
 /**
@@ -2020,6 +2044,34 @@ static bool stmmac_safety_feat_interrupt(struct stmmac_priv *priv)
 	return false;
 }
 
+static int stmmac_napi_check(struct stmmac_priv *priv, u32 chan)
+{
+	int status = stmmac_dma_interrupt_status(priv, priv->ioaddr,
+						 &priv->xstats, chan);
+
+	if ((status & handle_rx) && (chan < priv->plat->rx_queues_to_use)) {
+		struct stmmac_rx_queue *rx_q = &priv->rx_queue[chan];
+
+		if (likely(napi_schedule_prep(&rx_q->napi))) {
+			stmmac_disable_dma_irq(priv, priv->ioaddr, chan);
+			__napi_schedule(&rx_q->napi);
+		}
+	} else {
+		status &= ~handle_rx;
+	}
+
+	if ((status & handle_tx) && (chan < priv->plat->tx_queues_to_use)) {
+		struct stmmac_tx_queue *tx_q = &priv->tx_queue[chan];
+
+		if (likely(napi_schedule_prep(&tx_q->napi)))
+			__napi_schedule(&tx_q->napi);
+	} else {
+		status &= ~handle_tx;
+	}
+
+	return status;
+}
+
 /**
  * stmmac_dma_interrupt - DMA ISR
  * @priv: driver private structure
@@ -2034,57 +2086,14 @@ static void stmmac_dma_interrupt(struct stmmac_priv *priv)
 	u32 channels_to_check = tx_channel_count > rx_channel_count ?
 				tx_channel_count : rx_channel_count;
 	u32 chan;
-	bool poll_scheduled = false;
 	int status[max_t(u32, MTL_MAX_TX_QUEUES, MTL_MAX_RX_QUEUES)];
 
 	/* Make sure we never check beyond our status buffer. */
 	if (WARN_ON_ONCE(channels_to_check > ARRAY_SIZE(status)))
 		channels_to_check = ARRAY_SIZE(status);
 
-	/* Each DMA channel can be used for rx and tx simultaneously, yet
-	 * napi_struct is embedded in struct stmmac_rx_queue rather than in a
-	 * stmmac_channel struct.
-	 * Because of this, stmmac_poll currently checks (and possibly wakes)
-	 * all tx queues rather than just a single tx queue.
-	 */
 	for (chan = 0; chan < channels_to_check; chan++)
-		status[chan] = stmmac_dma_interrupt_status(priv, priv->ioaddr,
-				&priv->xstats, chan);
-
-	for (chan = 0; chan < rx_channel_count; chan++) {
-		if (likely(status[chan] & handle_rx)) {
-			struct stmmac_rx_queue *rx_q = &priv->rx_queue[chan];
-
-			if (likely(napi_schedule_prep(&rx_q->napi))) {
-				stmmac_disable_dma_irq(priv, priv->ioaddr, chan);
-				__napi_schedule(&rx_q->napi);
-				poll_scheduled = true;
-			}
-		}
-	}
-
-	/* If we scheduled poll, we already know that tx queues will be checked.
-	 * If we didn't schedule poll, see if any DMA channel (used by tx) has a
-	 * completed transmission, if so, call stmmac_poll (once).
-	 */
-	if (!poll_scheduled) {
-		for (chan = 0; chan < tx_channel_count; chan++) {
-			if (status[chan] & handle_tx) {
-				/* It doesn't matter what rx queue we choose
-				 * here. We use 0 since it always exists.
-				 */
-				struct stmmac_rx_queue *rx_q =
-					&priv->rx_queue[0];
-
-				if (likely(napi_schedule_prep(&rx_q->napi))) {
-					stmmac_disable_dma_irq(priv,
-							priv->ioaddr, chan);
-					__napi_schedule(&rx_q->napi);
-				}
-				break;
-			}
-		}
-	}
+		status[chan] = stmmac_napi_check(priv, chan);
 
 	for (chan = 0; chan < tx_channel_count; chan++) {
 		if (unlikely(status[chan] & tx_hard_error_bump_tc)) {
@@ -2241,13 +2250,11 @@ static int stmmac_init_dma_engine(struct stmmac_priv *priv)
  */
 static void stmmac_tx_timer(struct timer_list *t)
 {
-	struct stmmac_priv *priv = from_timer(priv, t, txtimer);
-	u32 tx_queues_count = priv->plat->tx_queues_to_use;
-	u32 queue;
+	struct stmmac_tx_queue *tx_q = from_timer(tx_q, t, txtimer);
 
-	/* let's scan all the tx queues */
-	for (queue = 0; queue < tx_queues_count; queue++)
-		stmmac_tx_clean(priv, queue);
+	if (likely(napi_schedule_prep(&tx_q->napi)))
+		__napi_schedule(&tx_q->napi);
+	tx_q->tx_timer_active = 0;
 }
 
 /**
@@ -2260,11 +2267,17 @@ static void stmmac_tx_timer(struct timer_list *t)
  */
 static void stmmac_init_tx_coalesce(struct stmmac_priv *priv)
 {
+	u32 tx_channel_count = priv->plat->tx_queues_to_use;
+	u32 chan;
+
 	priv->tx_coal_frames = STMMAC_TX_FRAMES;
 	priv->tx_coal_timer = STMMAC_COAL_TX_TIMER;
-	timer_setup(&priv->txtimer, stmmac_tx_timer, 0);
-	priv->txtimer.expires = STMMAC_COAL_TIMER(priv->tx_coal_timer);
-	add_timer(&priv->txtimer);
+
+	for (chan = 0; chan < tx_channel_count; chan++) {
+		struct stmmac_tx_queue *tx_q = &priv->tx_queue[chan];
+
+		timer_setup(&tx_q->txtimer, stmmac_tx_timer, 0);
+	}
 }
 
 static void stmmac_set_rings_length(struct stmmac_priv *priv)
@@ -2592,6 +2605,7 @@ static void stmmac_hw_teardown(struct net_device *dev)
 static int stmmac_open(struct net_device *dev)
 {
 	struct stmmac_priv *priv = netdev_priv(dev);
+	u32 chan;
 	int ret;
 
 	stmmac_check_ether_addr(priv);
@@ -2688,7 +2702,9 @@ static int stmmac_open(struct net_device *dev)
 	if (dev->phydev)
 		phy_stop(dev->phydev);
 
-	del_timer_sync(&priv->txtimer);
+	for (chan = 0; chan < priv->plat->tx_queues_to_use; chan++)
+		del_timer_sync(&priv->tx_queue[chan].txtimer);
+
 	stmmac_hw_teardown(dev);
 init_error:
 	free_dma_desc_resources(priv);
@@ -2708,6 +2724,7 @@ static int stmmac_open(struct net_device *dev)
 static int stmmac_release(struct net_device *dev)
 {
 	struct stmmac_priv *priv = netdev_priv(dev);
+	u32 chan;
 
 	if (priv->eee_enabled)
 		del_timer_sync(&priv->eee_ctrl_timer);
@@ -2722,7 +2739,8 @@ static int stmmac_release(struct net_device *dev)
 
 	stmmac_disable_all_queues(priv);
 
-	del_timer_sync(&priv->txtimer);
+	for (chan = 0; chan < priv->plat->tx_queues_to_use; chan++)
+		del_timer_sync(&priv->tx_queue[chan].txtimer);
 
 	/* Free the IRQ lines */
 	free_irq(dev->irq, dev);
@@ -2936,14 +2954,11 @@ static netdev_tx_t stmmac_tso_xmit(struct sk_buff *skb, struct net_device *dev)
 	priv->xstats.tx_tso_nfrags += nfrags;
 
 	/* Manage tx mitigation */
-	priv->tx_count_frames += nfrags + 1;
-	if (likely(priv->tx_coal_frames > priv->tx_count_frames)) {
-		mod_timer(&priv->txtimer,
-			  STMMAC_COAL_TIMER(priv->tx_coal_timer));
-	} else {
-		priv->tx_count_frames = 0;
+	tx_q->tx_count_frames += nfrags + 1;
+	if (priv->tx_coal_frames <= tx_q->tx_count_frames) {
 		stmmac_set_tx_ic(priv, desc);
 		priv->xstats.tx_set_ic_bit++;
+		tx_q->tx_count_frames = 0;
 	}
 
 	skb_tx_timestamp(skb);
@@ -2994,6 +3009,12 @@ static netdev_tx_t stmmac_tso_xmit(struct sk_buff *skb, struct net_device *dev)
 
 	stmmac_set_tx_tail_ptr(priv, priv->ioaddr, tx_q->tx_tail_addr, queue);
 
+	if (priv->tx_coal_timer && !tx_q->tx_timer_active) {
+		tx_q->tx_timer_active = 1;
+		mod_timer(&tx_q->txtimer,
+				STMMAC_COAL_TIMER(priv->tx_coal_timer));
+	}
+
 	return NETDEV_TX_OK;
 
 dma_map_err:
@@ -3146,14 +3167,11 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev)
 	 * This approach takes care about the fragments: desc is the first
 	 * element in case of no SG.
 	 */
-	priv->tx_count_frames += nfrags + 1;
-	if (likely(priv->tx_coal_frames > priv->tx_count_frames)) {
-		mod_timer(&priv->txtimer,
-			  STMMAC_COAL_TIMER(priv->tx_coal_timer));
-	} else {
-		priv->tx_count_frames = 0;
+	tx_q->tx_count_frames += nfrags + 1;
+	if (priv->tx_coal_frames <= tx_q->tx_count_frames) {
 		stmmac_set_tx_ic(priv, desc);
 		priv->xstats.tx_set_ic_bit++;
+		tx_q->tx_count_frames = 0;
 	}
 
 	skb_tx_timestamp(skb);
@@ -3199,8 +3217,15 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev)
 	netdev_tx_sent_queue(netdev_get_tx_queue(dev, queue), skb->len);
 
 	stmmac_enable_dma_transmission(priv, priv->ioaddr);
+
 	stmmac_set_tx_tail_ptr(priv, priv->ioaddr, tx_q->tx_tail_addr, queue);
 
+	if (priv->tx_coal_timer && !tx_q->tx_timer_active) {
+		tx_q->tx_timer_active = 1;
+		mod_timer(&tx_q->txtimer,
+				STMMAC_COAL_TIMER(priv->tx_coal_timer));
+	}
+
 	return NETDEV_TX_OK;
 
 dma_map_err:
@@ -3514,27 +3539,41 @@ static int stmmac_rx(struct stmmac_priv *priv, int limit, u32 queue)
  *  Description :
  *  To look at the incoming frames and clear the tx resources.
  */
-static int stmmac_poll(struct napi_struct *napi, int budget)
+static int stmmac_rx_poll(struct napi_struct *napi, int budget)
 {
 	struct stmmac_rx_queue *rx_q =
 		container_of(napi, struct stmmac_rx_queue, napi);
 	struct stmmac_priv *priv = rx_q->priv_data;
-	u32 tx_count = priv->plat->tx_queues_to_use;
 	u32 chan = rx_q->queue_index;
 	int work_done = 0;
-	u32 queue;
 
 	priv->xstats.napi_poll++;
 
-	/* check all the queues */
-	for (queue = 0; queue < tx_count; queue++)
-		stmmac_tx_clean(priv, queue);
-
 	work_done = stmmac_rx(priv, budget, rx_q->queue_index);
+	if (work_done < budget && napi_complete_done(napi, work_done))
+		stmmac_enable_dma_irq(priv, priv->ioaddr, chan);
+
+	return work_done;
+}
+
+static int stmmac_tx_poll(struct napi_struct *napi, int budget)
+{
+	struct stmmac_tx_queue *tx_q =
+		container_of(napi, struct stmmac_tx_queue, napi);
+	struct stmmac_priv *priv = tx_q->priv_data;
+	u32 chan = tx_q->queue_index;
+	int work_done = 0;
+	bool more;
+
+	priv->xstats.napi_poll++;
+
+	work_done = stmmac_tx_clean(priv, budget, chan, &more);
 	if (work_done < budget) {
 		napi_complete_done(napi, work_done);
-		stmmac_enable_dma_irq(priv, priv->ioaddr, chan);
+		if (more)
+			napi_reschedule(napi);
 	}
+
 	return work_done;
 }
 
@@ -4325,10 +4364,17 @@ int stmmac_dvr_probe(struct device *device,
 	for (queue = 0; queue < priv->plat->rx_queues_to_use; queue++) {
 		struct stmmac_rx_queue *rx_q = &priv->rx_queue[queue];
 
-		netif_napi_add(ndev, &rx_q->napi, stmmac_poll,
+		netif_napi_add(ndev, &rx_q->napi, stmmac_rx_poll,
 			       (8 * priv->plat->rx_queues_to_use));
 	}
 
+	for (queue = 0; queue < priv->plat->tx_queues_to_use; queue++) {
+		struct stmmac_tx_queue *tx_q = &priv->tx_queue[queue];
+
+		netif_napi_add(ndev, &tx_q->napi, stmmac_tx_poll,
+			       (8 * priv->plat->tx_queues_to_use));
+	}
+
 	mutex_init(&priv->lock);
 
 	/* If a specific clk_csr value is passed from the platform
@@ -4377,6 +4423,11 @@ int stmmac_dvr_probe(struct device *device,
 
 		netif_napi_del(&rx_q->napi);
 	}
+	for (queue = 0; queue < priv->plat->tx_queues_to_use; queue++) {
+		struct stmmac_tx_queue *tx_q = &priv->tx_queue[queue];
+
+		netif_napi_del(&tx_q->napi);
+	}
 error_hw_init:
 	destroy_workqueue(priv->wq);
 error_wq:
-- 
2.7.4

^ permalink raw reply related

* [PATCH net-next v2 2/2] net: stmmac: Fixup the tail addr setting in xmit path
From: Jose Abreu @ 2018-09-10  9:14 UTC (permalink / raw)
  To: netdev
  Cc: Jose Abreu, David S. Miller, Joao Pinto, Giuseppe Cavallaro,
	Alexandre Torgue
In-Reply-To: <cover.1536570319.git.joabreu@synopsys.com>

Currently we are always setting the tail address of descriptor list to
the end of the pre-allocated list.

According to databook this is not correct. Tail address should point to
the last available descriptor + 1, which means we have to update the
tail address everytime we call the xmit function.

This should make no impact in older versions of MAC but in newer
versions there are some DMA features which allows the IP to fetch
descriptors in advance and in a non sequential order so its critical
that we set the tail address correctly.

Signed-off-by: Jose Abreu <joabreu@synopsys.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Joao Pinto <jpinto@synopsys.com>
Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Cc: Alexandre Torgue <alexandre.torgue@st.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 9809c2b319fe..97268769186e 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -2229,8 +2229,7 @@ static int stmmac_init_dma_engine(struct stmmac_priv *priv)
 		stmmac_init_tx_chan(priv, priv->ioaddr, priv->plat->dma_cfg,
 				    tx_q->dma_tx_phy, chan);
 
-		tx_q->tx_tail_addr = tx_q->dma_tx_phy +
-			    (DMA_TX_SIZE * sizeof(struct dma_desc));
+		tx_q->tx_tail_addr = tx_q->dma_tx_phy;
 		stmmac_set_tx_tail_ptr(priv, priv->ioaddr,
 				       tx_q->tx_tail_addr, chan);
 	}
@@ -3007,6 +3006,7 @@ static netdev_tx_t stmmac_tso_xmit(struct sk_buff *skb, struct net_device *dev)
 
 	netdev_tx_sent_queue(netdev_get_tx_queue(dev, queue), skb->len);
 
+	tx_q->tx_tail_addr = tx_q->dma_tx_phy + (tx_q->cur_tx * sizeof(*desc));
 	stmmac_set_tx_tail_ptr(priv, priv->ioaddr, tx_q->tx_tail_addr, queue);
 
 	if (priv->tx_coal_timer && !tx_q->tx_timer_active) {
@@ -3218,6 +3218,7 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev)
 
 	stmmac_enable_dma_transmission(priv, priv->ioaddr);
 
+	tx_q->tx_tail_addr = tx_q->dma_tx_phy + (tx_q->cur_tx * sizeof(*desc));
 	stmmac_set_tx_tail_ptr(priv, priv->ioaddr, tx_q->tx_tail_addr, queue);
 
 	if (priv->tx_coal_timer && !tx_q->tx_timer_active) {
-- 
2.7.4

^ permalink raw reply related

* [PATCH 1/2] erspan: return PACKET_REJECT when the appropriate tunnel is not found
From: Haishuang Yan @ 2018-09-10 14:19 UTC (permalink / raw)
  To: David S. Miller, Alexey Kuznetsov
  Cc: netdev, linux-kernel, Haishuang Yan, William Tu

If erspan tunnel hasn't been established, we'd better send icmp port
unreachable message after receive erspan packets.

Fixes: 84e54fe0a5ea ("gre: introduce native tunnel support for ERSPAN")
Cc: William Tu <u9012063@gmail.com>
Signed-off-by: Haishuang Yan <yanhaishuang@cmss.chinamobile.com>
---
 net/ipv4/ip_gre.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index ae714ae..85a714d 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -328,6 +328,8 @@ static int erspan_rcv(struct sk_buff *skb, struct tnl_ptk_info *tpi,
 		ip_tunnel_rcv(tunnel, skb, tpi, tun_dst, log_ecn_error);
 		return PACKET_RCVD;
 	}
+	return PACKET_REJECT;
+
 drop:
 	kfree_skb(skb);
 	return PACKET_RCVD;
-- 
1.8.3.1

^ permalink raw reply related

* [PATCH 2/2] erspan: fix error handling for erspan tunnel
From: Haishuang Yan @ 2018-09-10 14:19 UTC (permalink / raw)
  To: David S. Miller, Alexey Kuznetsov
  Cc: netdev, linux-kernel, Haishuang Yan, William Tu
In-Reply-To: <1536589188-27550-1-git-send-email-yanhaishuang@cmss.chinamobile.com>

When processing icmp unreachable message for erspan tunnel, tunnel id
should be erspan_net_id instead of ipgre_net_id.

Fixes: 84e54fe0a5ea ("gre: introduce native tunnel support for ERSPAN")
Cc: William Tu <u9012063@gmail.com>
Signed-off-by: Haishuang Yan <yanhaishuang@cmss.chinamobile.com>
---
 net/ipv4/ip_gre.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index 85a714d..8cce0e9 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -178,6 +178,9 @@ static void ipgre_err(struct sk_buff *skb, u32 info,
 
 	if (tpi->proto == htons(ETH_P_TEB))
 		itn = net_generic(net, gre_tap_net_id);
+	else if (tpi->proto == htons(ETH_P_ERSPAN) ||
+		 tpi->proto == htons(ETH_P_ERSPAN2))
+		itn = net_generic(net, erspan_net_id);
 	else
 		itn = net_generic(net, ipgre_net_id);
 
-- 
1.8.3.1

^ permalink raw reply related

* [PATCH net-next v3 1/7] net: aquantia: fix hw_atl_utils_fw_upload_dwords
From: Igor Russkikh @ 2018-09-10  9:39 UTC (permalink / raw)
  To: David S . Miller; +Cc: netdev, Igor Russkikh, Yana Esina, Nikita Danilov
In-Reply-To: <cover.1536572107.git.igor.russkikh@aquantia.com>

From: Yana Esina <yana.esina@aquantia.com>

This patch fixes the upload function, which worked incorrectly with
some chips.

Signed-off-by: Yana Esina <yana.esina@aquantia.com>
Signed-off-by: Nikita Danilov <nikita.danilov@aquantia.com>
Tested-by: Nikita Danilov <nikita.danilov@aquantia.com>
Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
---
 .../ethernet/aquantia/atlantic/hw_atl/hw_atl_llh.c |  8 +++++
 .../ethernet/aquantia/atlantic/hw_atl/hw_atl_llh.h |  3 ++
 .../aquantia/atlantic/hw_atl/hw_atl_llh_internal.h | 13 ++++++++
 .../aquantia/atlantic/hw_atl/hw_atl_utils.c        | 36 +++++++++++++++-------
 .../aquantia/atlantic/hw_atl/hw_atl_utils.h        |  5 +++
 .../aquantia/atlantic/hw_atl/hw_atl_utils_fw2x.c   |  5 +++
 6 files changed, 59 insertions(+), 11 deletions(-)

diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh.c b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh.c
index 10ba035dadb1..be0a3a90dfad 100644
--- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh.c
+++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh.c
@@ -1460,3 +1460,11 @@ void hw_atl_reg_glb_cpu_scratch_scp_set(struct aq_hw_s *aq_hw,
 	aq_hw_write_reg(aq_hw, HW_ATL_GLB_CPU_SCRATCH_SCP_ADR(scratch_scp),
 			glb_cpu_scratch_scp);
 }
+
+void hw_atl_mcp_up_force_intr_set(struct aq_hw_s *aq_hw, u32 up_force_intr)
+{
+	aq_hw_write_reg_bit(aq_hw, HW_ATL_MCP_UP_FORCE_INTERRUPT_ADR,
+			    HW_ATL_MCP_UP_FORCE_INTERRUPT_MSK,
+			    HW_ATL_MCP_UP_FORCE_INTERRUPT_SHIFT,
+			    up_force_intr);
+}
diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh.h b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh.h
index dfb426f2dc2c..7056c7342afc 100644
--- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh.h
+++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh.h
@@ -698,4 +698,7 @@ void hw_atl_msm_reg_wr_strobe_set(struct aq_hw_s *aq_hw, u32 reg_wr_strobe);
 /* set pci register reset disable */
 void hw_atl_pci_pci_reg_res_dis_set(struct aq_hw_s *aq_hw, u32 pci_reg_res_dis);
 
+/* set uP Force Interrupt */
+void hw_atl_mcp_up_force_intr_set(struct aq_hw_s *aq_hw, u32 up_force_intr);
+
 #endif /* HW_ATL_LLH_H */
diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh_internal.h b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh_internal.h
index e0cf70120f1d..716674a9b729 100644
--- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh_internal.h
+++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh_internal.h
@@ -2387,4 +2387,17 @@
 #define HW_ATL_GLB_CPU_SCRATCH_SCP_ADR(scratch_scp) \
 	(0x00000300u + (scratch_scp) * 0x4)
 
+/* register address for bitfield uP Force Interrupt */
+#define HW_ATL_MCP_UP_FORCE_INTERRUPT_ADR 0x00000404
+/* bitmask for bitfield uP Force Interrupt */
+#define HW_ATL_MCP_UP_FORCE_INTERRUPT_MSK 0x00000002
+/* inverted bitmask for bitfield uP Force Interrupt */
+#define HW_ATL_MCP_UP_FORCE_INTERRUPT_MSKN 0xFFFFFFFD
+/* lower bit position of bitfield uP Force Interrupt */
+#define HW_ATL_MCP_UP_FORCE_INTERRUPT_SHIFT 1
+/* width of bitfield uP Force Interrupt */
+#define HW_ATL_MCP_UP_FORCE_INTERRUPT_WIDTH 1
+/* default value of bitfield uP Force Interrupt */
+#define HW_ATL_MCP_UP_FORCE_INTERRUPT_DEFAULT 0x0
+
 #endif /* HW_ATL_LLH_INTERNAL_H */
diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.c b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.c
index c965e65d07db..1926532bd1af 100644
--- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.c
+++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.c
@@ -325,17 +325,31 @@ static int hw_atl_utils_fw_upload_dwords(struct aq_hw_s *self, u32 a, u32 *p,
 		err = -ETIME;
 		goto err_exit;
 	}
+	if (IS_CHIP_FEATURE(REVISION_B1)) {
+		u32 offset = 0;
+
+		for (; offset < cnt; ++offset) {
+			aq_hw_write_reg(self, 0x328, p[offset]);
+			aq_hw_write_reg(self, 0x32C,
+					(0x80000000 | (0xFFFF & (offset * 4))));
+			hw_atl_mcp_up_force_intr_set(self, 1);
+			/* 1000 times by 10us = 10ms */
+			AQ_HW_WAIT_FOR((aq_hw_read_reg(self,
+						       0x32C) & 0xF0000000) !=
+				       0x80000000,
+				       10, 1000);
+		}
+	} else {
+		u32 offset = 0;
 
-	aq_hw_write_reg(self, 0x00000208U, a);
-
-	for (++cnt; --cnt;) {
-		u32 i = 0U;
+		aq_hw_write_reg(self, 0x208, a);
 
-		aq_hw_write_reg(self, 0x0000020CU, *(p++));
-		aq_hw_write_reg(self, 0x00000200U, 0xC000U);
+		for (; offset < cnt; ++offset) {
+			aq_hw_write_reg(self, 0x20C, p[offset]);
+			aq_hw_write_reg(self, 0x200, 0xC000);
 
-		for (i = 1024U;
-			(0x100U & aq_hw_read_reg(self, 0x00000200U)) && --i;) {
+			AQ_HW_WAIT_FOR((aq_hw_read_reg(self, 0x200U) &
+					0x100) == 0, 10, 1000);
 		}
 	}
 
@@ -399,7 +413,7 @@ struct aq_hw_atl_utils_fw_rpc_tid_s {
 
 #define hw_atl_utils_fw_rpc_init(_H_) hw_atl_utils_fw_rpc_wait(_H_, NULL)
 
-static int hw_atl_utils_fw_rpc_call(struct aq_hw_s *self, unsigned int rpc_size)
+int hw_atl_utils_fw_rpc_call(struct aq_hw_s *self, unsigned int rpc_size)
 {
 	int err = 0;
 	struct aq_hw_atl_utils_fw_rpc_tid_s sw;
@@ -423,8 +437,8 @@ static int hw_atl_utils_fw_rpc_call(struct aq_hw_s *self, unsigned int rpc_size)
 	return err;
 }
 
-static int hw_atl_utils_fw_rpc_wait(struct aq_hw_s *self,
-				    struct hw_aq_atl_utils_fw_rpc **rpc)
+int hw_atl_utils_fw_rpc_wait(struct aq_hw_s *self,
+			     struct hw_aq_atl_utils_fw_rpc **rpc)
 {
 	int err = 0;
 	struct aq_hw_atl_utils_fw_rpc_tid_s sw;
diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.h b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.h
index b875590efcbd..505c8a2abd9c 100644
--- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.h
+++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.h
@@ -319,6 +319,11 @@ struct aq_stats_s *hw_atl_utils_get_hw_stats(struct aq_hw_s *self);
 int hw_atl_utils_fw_downld_dwords(struct aq_hw_s *self, u32 a,
 				  u32 *p, u32 cnt);
 
+int hw_atl_utils_fw_rpc_call(struct aq_hw_s *self, unsigned int rpc_size);
+
+int hw_atl_utils_fw_rpc_wait(struct aq_hw_s *self,
+			     struct hw_aq_atl_utils_fw_rpc **rpc);
+
 extern const struct aq_fw_ops aq_fw_1x_ops;
 extern const struct aq_fw_ops aq_fw_2x_ops;
 
diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils_fw2x.c b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils_fw2x.c
index e37943760a58..6300d94c9ff0 100644
--- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils_fw2x.c
+++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils_fw2x.c
@@ -21,6 +21,7 @@
 
 #define HW_ATL_FW2X_MPI_EFUSE_ADDR	0x364
 #define HW_ATL_FW2X_MPI_MBOX_ADDR	0x360
+#define HW_ATL_FW2X_MPI_RPC_ADDR        0x334
 
 #define HW_ATL_FW2X_MPI_CONTROL_ADDR	0x368
 #define HW_ATL_FW2X_MPI_CONTROL2_ADDR	0x36C
@@ -40,6 +41,10 @@ static int aq_fw2x_init(struct aq_hw_s *self)
 	AQ_HW_WAIT_FOR(0U != (self->mbox_addr =
 			aq_hw_read_reg(self, HW_ATL_FW2X_MPI_MBOX_ADDR)),
 		       1000U, 10U);
+	AQ_HW_WAIT_FOR(0U != (self->rpc_addr =
+		       aq_hw_read_reg(self, HW_ATL_FW2X_MPI_RPC_ADDR)),
+		       1000U, 100U);
+
 	return err;
 }
 
-- 
2.7.4

^ permalink raw reply related

* [PATCH net-next v3 2/7] net: aquantia: definitions for WOL
From: Igor Russkikh @ 2018-09-10  9:39 UTC (permalink / raw)
  To: David S . Miller; +Cc: netdev, Igor Russkikh, Yana Esina, Nikita Danilov
In-Reply-To: <cover.1536572107.git.igor.russkikh@aquantia.com>

From: Yana Esina <yana.esina@aquantia.com>

Added definitions and structures needed to support WOL.

Signed-off-by: Yana Esina <yana.esina@aquantia.com>
Signed-off-by: Nikita Danilov <nikita.danilov@aquantia.com>
Tested-by: Nikita Danilov <nikita.danilov@aquantia.com>
Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
---
 drivers/net/ethernet/aquantia/atlantic/aq_nic.h    |  3 +
 .../aquantia/atlantic/hw_atl/hw_atl_utils.h        | 94 ++++++++++++++++++++--
 .../aquantia/atlantic/hw_atl/hw_atl_utils_fw2x.c   | 32 ++++++++
 3 files changed, 124 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_nic.h b/drivers/net/ethernet/aquantia/atlantic/aq_nic.h
index fecfc401f95d..2069cbb6e1a1 100644
--- a/drivers/net/ethernet/aquantia/atlantic/aq_nic.h
+++ b/drivers/net/ethernet/aquantia/atlantic/aq_nic.h
@@ -36,6 +36,7 @@ struct aq_nic_cfg_s {
 	u32 flow_control;
 	u32 link_speed_msk;
 	u32 vlan_id;
+	u32 wol;
 	u16 is_mc_list_enabled;
 	u16 mc_list_count;
 	bool is_autoneg;
@@ -54,6 +55,8 @@ struct aq_nic_cfg_s {
 #define AQ_NIC_FLAG_ERR_UNPLUG  0x40000000U
 #define AQ_NIC_FLAG_ERR_HW      0x80000000U
 
+#define AQ_NIC_WOL_ENABLED	BIT(0)
+
 #define AQ_NIC_TCVEC2RING(_NIC_, _TC_, _VEC_) \
 	((_TC_) * AQ_CFG_TCS_MAX + (_VEC_))
 
diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.h b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.h
index 505c8a2abd9c..beec0775f1c1 100644
--- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.h
+++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.h
@@ -101,8 +101,6 @@ struct __packed hw_aq_atl_utils_fw_rpc {
 		struct {
 			u32 priority;
 			u32 wol_packet_type;
-			u16 friendly_name_len;
-			u16 friendly_name[65];
 			u32 pattern_id;
 			u32 next_wol_pattern_offset;
 
@@ -134,13 +132,36 @@ struct __packed hw_aq_atl_utils_fw_rpc {
 					u32 pattern_offset;
 					u32 pattern_size;
 				} wol_bit_map_pattern;
+
+				struct {
+					u8 mac_addr[ETH_ALEN];
+				} wol_magic_packet_patter;
 			} wol_pattern;
 		} msg_wol;
 
 		struct {
-			u32 is_wake_on_link_down;
-			u32 is_wake_on_link_up;
-		} msg_wolink;
+			union {
+				u32 pattern_mask;
+
+				struct {
+					u32 reason_arp_v4_pkt : 1;
+					u32 reason_ipv4_ping_pkt : 1;
+					u32 reason_ipv6_ns_pkt : 1;
+					u32 reason_ipv6_ping_pkt : 1;
+					u32 reason_link_up : 1;
+					u32 reason_link_down : 1;
+					u32 reason_maximum : 1;
+				};
+			};
+
+			union {
+				u32 offload_mask;
+			};
+		} msg_enable_wakeup;
+
+		struct {
+			u32 id;
+		} msg_del_id;
 	};
 };
 
@@ -155,6 +176,57 @@ struct __packed hw_aq_atl_utils_mbox {
 	struct hw_atl_stats_s stats;
 };
 
+/* fw2x */
+typedef u32	fw_offset_t;
+
+struct __packed offload_ip_info {
+	u8 v4_local_addr_count;
+	u8 v4_addr_count;
+	u8 v6_local_addr_count;
+	u8 v6_addr_count;
+	fw_offset_t v4_addr;
+	fw_offset_t v4_prefix;
+	fw_offset_t v6_addr;
+	fw_offset_t v6_prefix;
+};
+
+struct __packed offload_port_info {
+	u16 udp_port_count;
+	u16 tcp_port_count;
+	fw_offset_t udp_port;
+	fw_offset_t tcp_port;
+};
+
+struct __packed offload_ka_info {
+	u16 v4_ka_count;
+	u16 v6_ka_count;
+	u32 retry_count;
+	u32 retry_interval;
+	fw_offset_t v4_ka;
+	fw_offset_t v6_ka;
+};
+
+struct __packed offload_rr_info {
+	u32 rr_count;
+	u32 rr_buf_len;
+	fw_offset_t rr_id_x;
+	fw_offset_t rr_buf;
+};
+
+struct __packed offload_info {
+	u32 version;
+	u32 len;
+	u8 mac_addr[ETH_ALEN];
+
+	u8 reserved[2];
+
+	struct offload_ip_info ips;
+	struct offload_port_info ports;
+	struct offload_ka_info kas;
+	struct offload_rr_info rrs;
+	u8 buf[0];
+};
+
 #define HAL_ATLANTIC_UTILS_CHIP_MIPS         0x00000001U
 #define HAL_ATLANTIC_UTILS_CHIP_TPO2         0x00000002U
 #define HAL_ATLANTIC_UTILS_CHIP_RPF2         0x00000004U
@@ -181,6 +253,18 @@ enum hal_atl_utils_fw_state_e {
 #define HAL_ATLANTIC_RATE_100M       BIT(5)
 #define HAL_ATLANTIC_RATE_INVALID    BIT(6)
 
+#define HAL_ATLANTIC_UTILS_FW_MSG_PING          0x1U
+#define HAL_ATLANTIC_UTILS_FW_MSG_ARP           0x2U
+#define HAL_ATLANTIC_UTILS_FW_MSG_INJECT        0x3U
+#define HAL_ATLANTIC_UTILS_FW_MSG_WOL_ADD       0x4U
+#define HAL_ATLANTIC_UTILS_FW_MSG_WOL_DEL       0x5U
+#define HAL_ATLANTIC_UTILS_FW_MSG_ENABLE_WAKEUP 0x6U
+#define HAL_ATLANTIC_UTILS_FW_MSG_MSM_PFC       0x7U
+#define HAL_ATLANTIC_UTILS_FW_MSG_PROVISIONING  0x8U
+#define HAL_ATLANTIC_UTILS_FW_MSG_OFFLOAD_ADD   0x9U
+#define HAL_ATLANTIC_UTILS_FW_MSG_OFFLOAD_DEL   0xAU
+#define HAL_ATLANTIC_UTILS_FW_MSG_CABLE_DIAG    0xDU
+
 enum hw_atl_fw2x_rate {
 	FW2X_RATE_100M    = 0x20,
 	FW2X_RATE_1G      = 0x100,
diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils_fw2x.c b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils_fw2x.c
index 6300d94c9ff0..3e5fed50a44c 100644
--- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils_fw2x.c
+++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils_fw2x.c
@@ -16,6 +16,7 @@
 #include "../aq_pci_func.h"
 #include "../aq_ring.h"
 #include "../aq_vec.h"
+#include "../aq_nic.h"
 #include "hw_atl_utils.h"
 #include "hw_atl_llh.h"
 
@@ -29,6 +30,37 @@
 #define HW_ATL_FW2X_MPI_STATE_ADDR	0x370
 #define HW_ATL_FW2X_MPI_STATE2_ADDR	0x374
 
+#define HW_ATL_FW2X_CAP_SLEEP_PROXY      BIT(CAPS_HI_SLEEP_PROXY)
+#define HW_ATL_FW2X_CAP_WOL              BIT(CAPS_HI_WOL)
+
+#define HW_ATL_FW2X_CTRL_SLEEP_PROXY      BIT(CTRL_SLEEP_PROXY)
+#define HW_ATL_FW2X_CTRL_WOL              BIT(CTRL_WOL)
+#define HW_ATL_FW2X_CTRL_LINK_DROP        BIT(CTRL_LINK_DROP)
+#define HW_ATL_FW2X_CTRL_PAUSE            BIT(CTRL_PAUSE)
+#define HW_ATL_FW2X_CTRL_ASYMMETRIC_PAUSE BIT(CTRL_ASYMMETRIC_PAUSE)
+#define HW_ATL_FW2X_CTRL_FORCE_RECONNECT  BIT(CTRL_FORCE_RECONNECT)
+
+#define HAL_ATLANTIC_WOL_FILTERS_COUNT   8
+#define HAL_ATLANTIC_UTILS_FW2X_MSG_WOL  0x0E
+
+struct __packed fw2x_msg_wol_pattern {
+	u8 mask[16];
+	u32 crc;
+};
+
+struct __packed fw2x_msg_wol {
+	u32 msg_id;
+	u8 hw_addr[ETH_ALEN];
+	u8 magic_packet_enabled;
+	u8 filter_count;
+	struct fw2x_msg_wol_pattern filter[HAL_ATLANTIC_WOL_FILTERS_COUNT];
+	u8 link_up_enabled;
+	u8 link_down_enabled;
+	u16 reserved;
+	u32 link_up_timeout;
+	u32 link_down_timeout;
+};
+
 static int aq_fw2x_set_link_speed(struct aq_hw_s *self, u32 speed);
 static int aq_fw2x_set_state(struct aq_hw_s *self,
 			     enum hal_atl_utils_fw_state_e state);
-- 
2.7.4

^ permalink raw reply related

* [PATCH net-next v3 3/7] net: aquantia: implement WOL support
From: Igor Russkikh @ 2018-09-10  9:39 UTC (permalink / raw)
  To: David S . Miller; +Cc: netdev, Igor Russkikh, Yana Esina, Nikita Danilov
In-Reply-To: <cover.1536572107.git.igor.russkikh@aquantia.com>

From: Yana Esina <yana.esina@aquantia.com>

Add WOL support. Currently only magic packet
(ethtool -s <ethX> wol g) feature is implemented.

Remove hw_set_power and move that to FW_OPS set_power:
because WOL configuration behaves differently on 1x and 2x
firmwares

Signed-off-by: Yana Esina <yana.esina@aquantia.com>
Signed-off-by: Nikita Danilov <nikita.danilov@aquantia.com>
Tested-by: Nikita Danilov <nikita.danilov@aquantia.com>
Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
---
 .../net/ethernet/aquantia/atlantic/aq_ethtool.c    | 32 +++++++
 drivers/net/ethernet/aquantia/atlantic/aq_hw.h     |  4 +-
 drivers/net/ethernet/aquantia/atlantic/aq_nic.c    | 12 +--
 .../ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c  |  1 -
 .../ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c  |  1 -
 .../aquantia/atlantic/hw_atl/hw_atl_utils.c        | 84 +++++++++++++++++--
 .../aquantia/atlantic/hw_atl/hw_atl_utils.h        |  5 ++
 .../aquantia/atlantic/hw_atl/hw_atl_utils_fw2x.c   | 98 +++++++++++++++++++++-
 8 files changed, 220 insertions(+), 17 deletions(-)

diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_ethtool.c b/drivers/net/ethernet/aquantia/atlantic/aq_ethtool.c
index 08c9fa6ca71f..b88be5e5f0a2 100644
--- a/drivers/net/ethernet/aquantia/atlantic/aq_ethtool.c
+++ b/drivers/net/ethernet/aquantia/atlantic/aq_ethtool.c
@@ -285,6 +285,36 @@ static int aq_ethtool_set_coalesce(struct net_device *ndev,
 	return aq_nic_update_interrupt_moderation_settings(aq_nic);
 }
 
+static void aq_ethtool_get_wol(struct net_device *ndev,
+			       struct ethtool_wolinfo *wol)
+{
+	struct aq_nic_s *aq_nic = netdev_priv(ndev);
+	struct aq_nic_cfg_s *cfg = aq_nic_get_cfg(aq_nic);
+
+	wol->supported = WAKE_MAGIC;
+	wol->wolopts = 0;
+
+	if (cfg->wol)
+		wol->wolopts |= WAKE_MAGIC;
+}
+
+static int aq_ethtool_set_wol(struct net_device *ndev,
+			      struct ethtool_wolinfo *wol)
+{
+	struct pci_dev *pdev = to_pci_dev(ndev->dev.parent);
+	struct aq_nic_s *aq_nic = netdev_priv(ndev);
+	struct aq_nic_cfg_s *cfg = aq_nic_get_cfg(aq_nic);
+	int err = 0;
+
+	if (wol->wolopts & WAKE_MAGIC)
+		cfg->wol |= AQ_NIC_WOL_ENABLED;
+	else
+		cfg->wol &= ~AQ_NIC_WOL_ENABLED;
+	err = device_set_wakeup_enable(&pdev->dev, wol->wolopts);
+
+	return err;
+}
+
 static int aq_ethtool_nway_reset(struct net_device *ndev)
 {
 	struct aq_nic_s *aq_nic = netdev_priv(ndev);
@@ -403,6 +433,8 @@ const struct ethtool_ops aq_ethtool_ops = {
 	.get_drvinfo         = aq_ethtool_get_drvinfo,
 	.get_strings         = aq_ethtool_get_strings,
 	.get_rxfh_indir_size = aq_ethtool_get_rss_indir_size,
+	.get_wol             = aq_ethtool_get_wol,
+	.set_wol             = aq_ethtool_set_wol,
 	.nway_reset          = aq_ethtool_nway_reset,
 	.get_ringparam       = aq_get_ringparam,
 	.set_ringparam       = aq_set_ringparam,
diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_hw.h b/drivers/net/ethernet/aquantia/atlantic/aq_hw.h
index 5c00671f248d..9050b40d4f58 100644
--- a/drivers/net/ethernet/aquantia/atlantic/aq_hw.h
+++ b/drivers/net/ethernet/aquantia/atlantic/aq_hw.h
@@ -204,7 +204,6 @@ struct aq_hw_ops {
 
 	int (*hw_get_fw_version)(struct aq_hw_s *self, u32 *fw_version);
 
-	int (*hw_set_power)(struct aq_hw_s *self, unsigned int power_state);
 };
 
 struct aq_fw_ops {
@@ -228,6 +227,9 @@ struct aq_fw_ops {
 	int (*update_stats)(struct aq_hw_s *self);
 
 	int (*set_flow_control)(struct aq_hw_s *self);
+
+	int (*set_power)(struct aq_hw_s *self, unsigned int power_state,
+			 u8 *mac);
 };
 
 #endif /* AQ_HW_H */
diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_nic.c b/drivers/net/ethernet/aquantia/atlantic/aq_nic.c
index 26dc6782b475..9809dbf8c272 100644
--- a/drivers/net/ethernet/aquantia/atlantic/aq_nic.c
+++ b/drivers/net/ethernet/aquantia/atlantic/aq_nic.c
@@ -889,11 +889,13 @@ void aq_nic_deinit(struct aq_nic_s *self)
 		self->aq_vecs > i; ++i, aq_vec = self->aq_vec[i])
 		aq_vec_deinit(aq_vec);
 
-	if (self->power_state == AQ_HW_POWER_STATE_D0) {
-		(void)self->aq_fw_ops->deinit(self->aq_hw);
-	} else {
-		(void)self->aq_hw_ops->hw_set_power(self->aq_hw,
-						   self->power_state);
+	self->aq_fw_ops->deinit(self->aq_hw);
+
+	if (self->power_state != AQ_HW_POWER_STATE_D0 ||
+	    self->aq_hw->aq_nic_cfg->wol) {
+		self->aq_fw_ops->set_power(self->aq_hw,
+					   self->power_state,
+					   self->ndev->dev_addr);
 	}
 
 err_exit:;
diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c
index 97addfa6f895..1dd0ef4a895c 100644
--- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c
+++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c
@@ -877,7 +877,6 @@ static int hw_atl_a0_hw_ring_rx_stop(struct aq_hw_s *self,
 const struct aq_hw_ops hw_atl_ops_a0 = {
 	.hw_set_mac_address   = hw_atl_a0_hw_mac_addr_set,
 	.hw_init              = hw_atl_a0_hw_init,
-	.hw_set_power         = hw_atl_utils_hw_set_power,
 	.hw_reset             = hw_atl_a0_hw_reset,
 	.hw_start             = hw_atl_a0_hw_start,
 	.hw_ring_tx_start     = hw_atl_a0_hw_ring_tx_start,
diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c
index 1d44a386e7d3..d03f43683d8b 100644
--- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c
+++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c
@@ -935,7 +935,6 @@ static int hw_atl_b0_hw_ring_rx_stop(struct aq_hw_s *self,
 const struct aq_hw_ops hw_atl_ops_b0 = {
 	.hw_set_mac_address   = hw_atl_b0_hw_mac_addr_set,
 	.hw_init              = hw_atl_b0_hw_init,
-	.hw_set_power         = hw_atl_utils_hw_set_power,
 	.hw_reset             = hw_atl_b0_hw_reset,
 	.hw_start             = hw_atl_b0_hw_start,
 	.hw_ring_tx_start     = hw_atl_b0_hw_ring_tx_start,
diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.c b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.c
index 1926532bd1af..c6fe4a58e047 100644
--- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.c
+++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.c
@@ -744,14 +744,6 @@ static int hw_atl_fw1x_deinit(struct aq_hw_s *self)
 	return 0;
 }
 
-int hw_atl_utils_hw_set_power(struct aq_hw_s *self,
-			      unsigned int power_state)
-{
-	hw_atl_utils_mpi_set_speed(self, 0);
-	hw_atl_utils_mpi_set_state(self, MPI_POWER);
-	return 0;
-}
-
 int hw_atl_utils_update_stats(struct aq_hw_s *self)
 {
 	struct hw_aq_atl_utils_mbox mbox;
@@ -839,6 +831,81 @@ int hw_atl_utils_get_fw_version(struct aq_hw_s *self, u32 *fw_version)
 	return 0;
 }
 
+static int aq_fw1x_set_wol(struct aq_hw_s *self, bool wol_enabled, u8 *mac)
+{
+	struct hw_aq_atl_utils_fw_rpc *prpc = NULL;
+	unsigned int rpc_size = 0U;
+	int err = 0;
+
+	err = hw_atl_utils_fw_rpc_wait(self, &prpc);
+	if (err < 0)
+		goto err_exit;
+
+	memset(prpc, 0, sizeof(*prpc));
+
+	if (wol_enabled) {
+		rpc_size = sizeof(prpc->msg_id) + sizeof(prpc->msg_wol);
+
+		prpc->msg_id = HAL_ATLANTIC_UTILS_FW_MSG_WOL_ADD;
+		prpc->msg_wol.priority =
+				HAL_ATLANTIC_UTILS_FW_MSG_WOL_PRIOR;
+		prpc->msg_wol.pattern_id =
+				HAL_ATLANTIC_UTILS_FW_MSG_WOL_PATTERN;
+		prpc->msg_wol.wol_packet_type =
+				HAL_ATLANTIC_UTILS_FW_MSG_WOL_MAG_PKT;
+
+		ether_addr_copy((u8 *)&prpc->msg_wol.wol_pattern, mac);
+	} else {
+		rpc_size = sizeof(prpc->msg_id) + sizeof(prpc->msg_del_id);
+
+		prpc->msg_id = HAL_ATLANTIC_UTILS_FW_MSG_WOL_DEL;
+		prpc->msg_wol.pattern_id =
+				HAL_ATLANTIC_UTILS_FW_MSG_WOL_PATTERN;
+	}
+
+	err = hw_atl_utils_fw_rpc_call(self, rpc_size);
+
+err_exit:
+	return err;
+}
+
+int aq_fw1x_set_power(struct aq_hw_s *self, unsigned int power_state,
+		      u8 *mac)
+{
+	struct hw_aq_atl_utils_fw_rpc *prpc = NULL;
+	unsigned int rpc_size = 0U;
+	int err = 0;
+
+	if (self->aq_nic_cfg->wol & AQ_NIC_WOL_ENABLED) {
+		err = aq_fw1x_set_wol(self, 1, mac);
+
+		if (err < 0)
+			goto err_exit;
+
+		rpc_size = sizeof(prpc->msg_id) +
+			   sizeof(prpc->msg_enable_wakeup);
+
+		err = hw_atl_utils_fw_rpc_wait(self, &prpc);
+
+		if (err < 0)
+			goto err_exit;
+
+		memset(prpc, 0, rpc_size);
+
+		prpc->msg_id = HAL_ATLANTIC_UTILS_FW_MSG_ENABLE_WAKEUP;
+		prpc->msg_enable_wakeup.pattern_mask = 0x00000002;
+
+		err = hw_atl_utils_fw_rpc_call(self, rpc_size);
+		if (err < 0)
+			goto err_exit;
+	}
+	hw_atl_utils_mpi_set_speed(self, 0);
+	hw_atl_utils_mpi_set_state(self, MPI_POWER);
+
+err_exit:
+	return err;
+}
+
 const struct aq_fw_ops aq_fw_1x_ops = {
 	.init = hw_atl_utils_mpi_create,
 	.deinit = hw_atl_fw1x_deinit,
@@ -848,5 +915,6 @@ const struct aq_fw_ops aq_fw_1x_ops = {
 	.set_state = hw_atl_utils_mpi_set_state,
 	.update_link_status = hw_atl_utils_mpi_get_link_status,
 	.update_stats = hw_atl_utils_update_stats,
+	.set_power = aq_fw1x_set_power,
 	.set_flow_control = NULL,
 };
diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.h b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.h
index beec0775f1c1..48bebb686819 100644
--- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.h
+++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.h
@@ -257,6 +257,9 @@ enum hal_atl_utils_fw_state_e {
 #define HAL_ATLANTIC_UTILS_FW_MSG_ARP           0x2U
 #define HAL_ATLANTIC_UTILS_FW_MSG_INJECT        0x3U
 #define HAL_ATLANTIC_UTILS_FW_MSG_WOL_ADD       0x4U
+#define HAL_ATLANTIC_UTILS_FW_MSG_WOL_PRIOR     0x10000000U
+#define HAL_ATLANTIC_UTILS_FW_MSG_WOL_PATTERN   0x1U
+#define HAL_ATLANTIC_UTILS_FW_MSG_WOL_MAG_PKT   0x2U
 #define HAL_ATLANTIC_UTILS_FW_MSG_WOL_DEL       0x5U
 #define HAL_ATLANTIC_UTILS_FW_MSG_ENABLE_WAKEUP 0x6U
 #define HAL_ATLANTIC_UTILS_FW_MSG_MSM_PFC       0x7U
@@ -403,6 +406,8 @@ struct aq_stats_s *hw_atl_utils_get_hw_stats(struct aq_hw_s *self);
 int hw_atl_utils_fw_downld_dwords(struct aq_hw_s *self, u32 a,
 				  u32 *p, u32 cnt);
 
+int hw_atl_utils_fw_set_wol(struct aq_hw_s *self, bool wol_enabled, u8 *mac);
+
 int hw_atl_utils_fw_rpc_call(struct aq_hw_s *self, unsigned int rpc_size);
 
 int hw_atl_utils_fw_rpc_wait(struct aq_hw_s *self,
diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils_fw2x.c b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils_fw2x.c
index 3e5fed50a44c..9fc187f57ed4 100644
--- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils_fw2x.c
+++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils_fw2x.c
@@ -231,7 +231,7 @@ static int aq_fw2x_get_mac_permanent(struct aq_hw_s *self, u8 *mac)
 	return err;
 }
 
-static int aq_fw2x_update_stats(struct aq_hw_s *self)
+int aq_fw2x_update_stats(struct aq_hw_s *self)
 {
 	int err = 0;
 	u32 mpi_opts = aq_hw_read_reg(self, HW_ATL_FW2X_MPI_CONTROL2_ADDR);
@@ -252,6 +252,101 @@ static int aq_fw2x_update_stats(struct aq_hw_s *self)
 	return hw_atl_utils_update_stats(self);
 }
 
+static int aq_fw2x_set_sleep_proxy(struct aq_hw_s *self, u8 *mac)
+{
+	struct hw_aq_atl_utils_fw_rpc *rpc = NULL;
+	struct offload_info *cfg = NULL;
+	unsigned int rpc_size = 0U;
+	u32 mpi_opts;
+	int err = 0;
+
+	rpc_size = sizeof(rpc->msg_id) + sizeof(*cfg);
+
+	err = hw_atl_utils_fw_rpc_wait(self, &rpc);
+	if (err < 0)
+		goto err_exit;
+
+	memset(rpc, 0, rpc_size);
+	cfg = (struct offload_info *)(&rpc->msg_id + 1);
+
+	memcpy(cfg->mac_addr, mac, ETH_ALEN);
+	cfg->len = sizeof(*cfg);
+
+	/* Clear bit 0x36C.23 and 0x36C.22 */
+	mpi_opts = aq_hw_read_reg(self, HW_ATL_FW2X_MPI_CONTROL2_ADDR);
+	mpi_opts &= ~HW_ATL_FW2X_CTRL_SLEEP_PROXY;
+	mpi_opts &= ~HW_ATL_FW2X_CTRL_LINK_DROP;
+
+	aq_hw_write_reg(self, HW_ATL_FW2X_MPI_CONTROL2_ADDR, mpi_opts);
+
+	err = hw_atl_utils_fw_rpc_call(self, rpc_size);
+	if (err < 0)
+		goto err_exit;
+
+	/* Set bit 0x36C.23 */
+	mpi_opts |= HW_ATL_FW2X_CTRL_SLEEP_PROXY;
+	aq_hw_write_reg(self, HW_ATL_FW2X_MPI_CONTROL2_ADDR, mpi_opts);
+
+	AQ_HW_WAIT_FOR((aq_hw_read_reg(self, HW_ATL_FW2X_MPI_STATE2_ADDR) &
+			HW_ATL_FW2X_CTRL_SLEEP_PROXY), 1U, 10000U);
+
+err_exit:
+	return err;
+}
+
+static int aq_fw2x_set_wol_params(struct aq_hw_s *self, u8 *mac)
+{
+	struct hw_aq_atl_utils_fw_rpc *rpc = NULL;
+	struct fw2x_msg_wol *msg = NULL;
+	u32 mpi_opts;
+	int err = 0;
+
+	err = hw_atl_utils_fw_rpc_wait(self, &rpc);
+	if (err < 0)
+		goto err_exit;
+
+	msg = (struct fw2x_msg_wol *)rpc;
+
+	msg->msg_id = HAL_ATLANTIC_UTILS_FW2X_MSG_WOL;
+	msg->magic_packet_enabled = true;
+	memcpy(msg->hw_addr, mac, ETH_ALEN);
+
+	mpi_opts = aq_hw_read_reg(self, HW_ATL_FW2X_MPI_CONTROL2_ADDR);
+	mpi_opts &= ~(HW_ATL_FW2X_CTRL_SLEEP_PROXY | HW_ATL_FW2X_CTRL_WOL);
+
+	aq_hw_write_reg(self, HW_ATL_FW2X_MPI_CONTROL2_ADDR, mpi_opts);
+
+	err = hw_atl_utils_fw_rpc_call(self, sizeof(*msg));
+	if (err < 0)
+		goto err_exit;
+
+	/* Set bit 0x36C.24 */
+	mpi_opts |= HW_ATL_FW2X_CTRL_WOL;
+	aq_hw_write_reg(self, HW_ATL_FW2X_MPI_CONTROL2_ADDR, mpi_opts);
+
+	AQ_HW_WAIT_FOR((aq_hw_read_reg(self, HW_ATL_FW2X_MPI_STATE2_ADDR) &
+			HW_ATL_FW2X_CTRL_WOL), 1U, 10000U);
+
+err_exit:
+	return err;
+}
+
+static int aq_fw2x_set_power(struct aq_hw_s *self, unsigned int power_state,
+			     u8 *mac)
+{
+	int err = 0;
+
+	if (self->aq_nic_cfg->wol & AQ_NIC_WOL_ENABLED) {
+		err = aq_fw2x_set_sleep_proxy(self, mac);
+		if (err < 0)
+			goto err_exit;
+		err = aq_fw2x_set_wol_params(self, mac);
+	}
+
+err_exit:
+	return err;
+}
+
 static int aq_fw2x_renegotiate(struct aq_hw_s *self)
 {
 	u32 mpi_opts = aq_hw_read_reg(self, HW_ATL_FW2X_MPI_CONTROL2_ADDR);
@@ -284,5 +379,6 @@ const struct aq_fw_ops aq_fw_2x_ops = {
 	.set_state = aq_fw2x_set_state,
 	.update_link_status = aq_fw2x_update_link_status,
 	.update_stats = aq_fw2x_update_stats,
+	.set_power = aq_fw2x_set_power,
 	.set_flow_control   = aq_fw2x_set_flow_control,
 };
-- 
2.7.4

^ permalink raw reply related

* [PATCH net-next v3 4/7] net: aquantia: implement EEE support
From: Igor Russkikh @ 2018-09-10  9:39 UTC (permalink / raw)
  To: David S . Miller; +Cc: netdev, Igor Russkikh, Yana Esina, Nikita Danilov
In-Reply-To: <cover.1536572107.git.igor.russkikh@aquantia.com>

From: Yana Esina <yana.esina@aquantia.com>

Support of Energy-Efficient Ethernet to aQuantia NIC's via ethtool
(according to the IEEE 802.3az specifications)

Signed-off-by: Yana Esina <yana.esina@aquantia.com>
Signed-off-by: Nikita Danilov <nikita.danilov@aquantia.com>
Tested-by: Nikita Danilov <nikita.danilov@aquantia.com>
Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
---
 drivers/net/ethernet/aquantia/atlantic/aq_common.h |  5 ++
 .../net/ethernet/aquantia/atlantic/aq_ethtool.c    | 77 +++++++++++++++++++
 drivers/net/ethernet/aquantia/atlantic/aq_hw.h     |  5 ++
 drivers/net/ethernet/aquantia/atlantic/aq_nic.h    |  1 +
 .../aquantia/atlantic/hw_atl/hw_atl_utils.c        |  2 +
 .../aquantia/atlantic/hw_atl/hw_atl_utils.h        | 13 ++++
 .../aquantia/atlantic/hw_atl/hw_atl_utils_fw2x.c   | 86 ++++++++++++++++++++++
 7 files changed, 189 insertions(+)

diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_common.h b/drivers/net/ethernet/aquantia/atlantic/aq_common.h
index d52b088ff8f0..becb578211ed 100644
--- a/drivers/net/ethernet/aquantia/atlantic/aq_common.h
+++ b/drivers/net/ethernet/aquantia/atlantic/aq_common.h
@@ -57,4 +57,9 @@
 #define AQ_NIC_RATE_1G         BIT(4)
 #define AQ_NIC_RATE_100M       BIT(5)
 
+#define AQ_NIC_RATE_EEE_10G	BIT(6)
+#define AQ_NIC_RATE_EEE_5G	BIT(7)
+#define AQ_NIC_RATE_EEE_2GS	BIT(8)
+#define AQ_NIC_RATE_EEE_1G	BIT(9)
+
 #endif /* AQ_COMMON_H */
diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_ethtool.c b/drivers/net/ethernet/aquantia/atlantic/aq_ethtool.c
index b88be5e5f0a2..22dd4fbd34d7 100644
--- a/drivers/net/ethernet/aquantia/atlantic/aq_ethtool.c
+++ b/drivers/net/ethernet/aquantia/atlantic/aq_ethtool.c
@@ -315,6 +315,81 @@ static int aq_ethtool_set_wol(struct net_device *ndev,
 	return err;
 }
 
+static enum hw_atl_fw2x_rate eee_mask_to_ethtool_mask(u32 speed)
+{
+	u32 rate = 0;
+
+	if (speed & AQ_NIC_RATE_EEE_10G)
+		rate |= SUPPORTED_10000baseT_Full;
+
+	if (speed & AQ_NIC_RATE_EEE_2GS)
+		rate |= SUPPORTED_2500baseX_Full;
+
+	if (speed & AQ_NIC_RATE_EEE_1G)
+		rate |= SUPPORTED_1000baseT_Full;
+
+	return rate;
+}
+
+static int aq_ethtool_get_eee(struct net_device *ndev, struct ethtool_eee *eee)
+{
+	struct aq_nic_s *aq_nic = netdev_priv(ndev);
+	u32 rate, supported_rates;
+	int err = 0;
+
+	if (!aq_nic->aq_fw_ops->get_eee_rate)
+		return -EOPNOTSUPP;
+
+	err = aq_nic->aq_fw_ops->get_eee_rate(aq_nic->aq_hw, &rate,
+					      &supported_rates);
+	if (err < 0)
+		return err;
+
+	eee->supported = eee_mask_to_ethtool_mask(supported_rates);
+
+	if (aq_nic->aq_nic_cfg.eee_speeds)
+		eee->advertised = eee->supported;
+
+	eee->lp_advertised = eee_mask_to_ethtool_mask(rate);
+
+	eee->eee_enabled = !!eee->advertised;
+
+	eee->tx_lpi_enabled = eee->eee_enabled;
+	if (eee->advertised & eee->lp_advertised)
+		eee->eee_active = true;
+
+	return 0;
+}
+
+static int aq_ethtool_set_eee(struct net_device *ndev, struct ethtool_eee *eee)
+{
+	struct aq_nic_s *aq_nic = netdev_priv(ndev);
+	u32 rate, supported_rates;
+	struct aq_nic_cfg_s *cfg;
+	int err = 0;
+
+	cfg = aq_nic_get_cfg(aq_nic);
+
+	if (unlikely(!aq_nic->aq_fw_ops->get_eee_rate ||
+		     !aq_nic->aq_fw_ops->set_eee_rate))
+		return -EOPNOTSUPP;
+
+	err = aq_nic->aq_fw_ops->get_eee_rate(aq_nic->aq_hw, &rate,
+					      &supported_rates);
+	if (err < 0)
+		return err;
+
+	if (eee->eee_enabled) {
+		rate = supported_rates;
+		cfg->eee_speeds = rate;
+	} else {
+		rate = 0;
+		cfg->eee_speeds = 0;
+	}
+
+	return aq_nic->aq_fw_ops->set_eee_rate(aq_nic->aq_hw, rate);
+}
+
 static int aq_ethtool_nway_reset(struct net_device *ndev)
 {
 	struct aq_nic_s *aq_nic = netdev_priv(ndev);
@@ -438,6 +513,8 @@ const struct ethtool_ops aq_ethtool_ops = {
 	.nway_reset          = aq_ethtool_nway_reset,
 	.get_ringparam       = aq_get_ringparam,
 	.set_ringparam       = aq_set_ringparam,
+	.get_eee             = aq_ethtool_get_eee,
+	.set_eee             = aq_ethtool_set_eee,
 	.get_pauseparam      = aq_ethtool_get_pauseparam,
 	.set_pauseparam      = aq_ethtool_set_pauseparam,
 	.get_rxfh_key_size   = aq_ethtool_get_rss_key_size,
diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_hw.h b/drivers/net/ethernet/aquantia/atlantic/aq_hw.h
index 9050b40d4f58..908f19fe19b3 100644
--- a/drivers/net/ethernet/aquantia/atlantic/aq_hw.h
+++ b/drivers/net/ethernet/aquantia/atlantic/aq_hw.h
@@ -230,6 +230,11 @@ struct aq_fw_ops {
 
 	int (*set_power)(struct aq_hw_s *self, unsigned int power_state,
 			 u8 *mac);
+
+	int (*set_eee_rate)(struct aq_hw_s *self, u32 speed);
+
+	int (*get_eee_rate)(struct aq_hw_s *self, u32 *rate,
+			    u32 *supported_rates);
 };
 
 #endif /* AQ_HW_H */
diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_nic.h b/drivers/net/ethernet/aquantia/atlantic/aq_nic.h
index 2069cbb6e1a1..c1582f4e8e1b 100644
--- a/drivers/net/ethernet/aquantia/atlantic/aq_nic.h
+++ b/drivers/net/ethernet/aquantia/atlantic/aq_nic.h
@@ -45,6 +45,7 @@ struct aq_nic_cfg_s {
 	bool is_lro;
 	u8  tcs;
 	struct aq_rss_parameters aq_rss;
+	u32 eee_speeds;
 };
 
 #define AQ_NIC_FLAG_STARTED     0x00000004U
diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.c b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.c
index c6fe4a58e047..bb1561c6d25a 100644
--- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.c
+++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.c
@@ -916,5 +916,7 @@ const struct aq_fw_ops aq_fw_1x_ops = {
 	.update_link_status = hw_atl_utils_mpi_get_link_status,
 	.update_stats = hw_atl_utils_update_stats,
 	.set_power = aq_fw1x_set_power,
+	.set_eee_rate = NULL,
+	.get_eee_rate = NULL,
 	.set_flow_control = NULL,
 };
diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.h b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.h
index 48bebb686819..6ced102d02db 100644
--- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.h
+++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.h
@@ -171,9 +171,22 @@ struct __packed hw_aq_atl_utils_mbox_header {
 	u32 error;
 };
 
+struct __packed hw_aq_info {
+	u8 reserved[6];
+	u16 phy_fault_code;
+	u16 phy_temperature;
+	u8 cable_len;
+	u8 reserved1;
+	u32 cable_diag_data[4];
+	u8 reserved2[32];
+	u32 caps_lo;
+	u32 caps_hi;
+};
+
 struct __packed hw_aq_atl_utils_mbox {
 	struct hw_aq_atl_utils_mbox_header header;
 	struct hw_atl_stats_s stats;
+	struct hw_aq_info info;
 };
 
 /* fw2x */
diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils_fw2x.c b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils_fw2x.c
index 9fc187f57ed4..27bed5dd5295 100644
--- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils_fw2x.c
+++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils_fw2x.c
@@ -40,6 +40,11 @@
 #define HW_ATL_FW2X_CTRL_ASYMMETRIC_PAUSE BIT(CTRL_ASYMMETRIC_PAUSE)
 #define HW_ATL_FW2X_CTRL_FORCE_RECONNECT  BIT(CTRL_FORCE_RECONNECT)
 
+#define HW_ATL_FW2X_CAP_EEE_1G_MASK      BIT(CAPS_HI_1000BASET_FD_EEE)
+#define HW_ATL_FW2X_CAP_EEE_2G5_MASK     BIT(CAPS_HI_2P5GBASET_FD_EEE)
+#define HW_ATL_FW2X_CAP_EEE_5G_MASK      BIT(CAPS_HI_5GBASET_FD_EEE)
+#define HW_ATL_FW2X_CAP_EEE_10G_MASK     BIT(CAPS_HI_10GBASET_FD_EEE)
+
 #define HAL_ATLANTIC_WOL_FILTERS_COUNT   8
 #define HAL_ATLANTIC_UTILS_FW2X_MSG_WOL  0x0E
 
@@ -115,6 +120,38 @@ static enum hw_atl_fw2x_rate link_speed_mask_2fw2x_ratemask(u32 speed)
 	return rate;
 }
 
+static u32 fw2x_to_eee_mask(u32 speed)
+{
+	u32 rate = 0;
+
+	if (speed & HW_ATL_FW2X_CAP_EEE_10G_MASK)
+		rate |= AQ_NIC_RATE_EEE_10G;
+	if (speed & HW_ATL_FW2X_CAP_EEE_5G_MASK)
+		rate |= AQ_NIC_RATE_EEE_5G;
+	if (speed & HW_ATL_FW2X_CAP_EEE_2G5_MASK)
+		rate |= AQ_NIC_RATE_EEE_2GS;
+	if (speed & HW_ATL_FW2X_CAP_EEE_1G_MASK)
+		rate |= AQ_NIC_RATE_EEE_1G;
+
+	return rate;
+}
+
+static u32 eee_mask_to_fw2x(u32 speed)
+{
+	u32 rate = 0;
+
+	if (speed & AQ_NIC_RATE_EEE_10G)
+		rate |= HW_ATL_FW2X_CAP_EEE_10G_MASK;
+	if (speed & AQ_NIC_RATE_EEE_5G)
+		rate |= HW_ATL_FW2X_CAP_EEE_5G_MASK;
+	if (speed & AQ_NIC_RATE_EEE_2GS)
+		rate |= HW_ATL_FW2X_CAP_EEE_2G5_MASK;
+	if (speed & AQ_NIC_RATE_EEE_1G)
+		rate |= HW_ATL_FW2X_CAP_EEE_1G_MASK;
+
+	return rate;
+}
+
 static int aq_fw2x_set_link_speed(struct aq_hw_s *self, u32 speed)
 {
 	u32 val = link_speed_mask_2fw2x_ratemask(speed);
@@ -137,14 +174,27 @@ static void aq_fw2x_set_mpi_flow_control(struct aq_hw_s *self, u32 *mpi_state)
 		*mpi_state &= ~BIT(CAPS_HI_ASYMMETRIC_PAUSE);
 }
 
+static void aq_fw2x_upd_eee_rate_bits(struct aq_hw_s *self, u32 *mpi_opts,
+				      u32 eee_speeds)
+{
+	*mpi_opts &= ~(HW_ATL_FW2X_CAP_EEE_1G_MASK |
+		       HW_ATL_FW2X_CAP_EEE_2G5_MASK |
+		       HW_ATL_FW2X_CAP_EEE_5G_MASK |
+		       HW_ATL_FW2X_CAP_EEE_10G_MASK);
+
+	*mpi_opts |= eee_mask_to_fw2x(eee_speeds);
+}
+
 static int aq_fw2x_set_state(struct aq_hw_s *self,
 			     enum hal_atl_utils_fw_state_e state)
 {
 	u32 mpi_state = aq_hw_read_reg(self, HW_ATL_FW2X_MPI_CONTROL2_ADDR);
+	struct aq_nic_cfg_s *cfg = self->aq_nic_cfg;
 
 	switch (state) {
 	case MPI_INIT:
 		mpi_state &= ~BIT(CAPS_HI_LINK_DROP);
+		aq_fw2x_upd_eee_rate_bits(self, &mpi_state, cfg->eee_speeds);
 		aq_fw2x_set_mpi_flow_control(self, &mpi_state);
 		break;
 	case MPI_DEINIT:
@@ -347,6 +397,40 @@ static int aq_fw2x_set_power(struct aq_hw_s *self, unsigned int power_state,
 	return err;
 }
 
+static int aq_fw2x_set_eee_rate(struct aq_hw_s *self, u32 speed)
+{
+	u32 mpi_opts = aq_hw_read_reg(self, HW_ATL_FW2X_MPI_CONTROL2_ADDR);
+
+	aq_fw2x_upd_eee_rate_bits(self, &mpi_opts, speed);
+
+	aq_hw_write_reg(self, HW_ATL_FW2X_MPI_CONTROL2_ADDR, mpi_opts);
+
+	return 0;
+}
+
+static int aq_fw2x_get_eee_rate(struct aq_hw_s *self, u32 *rate,
+				u32 *supported_rates)
+{
+	u32 mpi_state;
+	u32 caps_hi;
+	int err = 0;
+	u32 addr = self->mbox_addr + offsetof(struct hw_aq_atl_utils_mbox, info) +
+		   offsetof(struct hw_aq_info, caps_hi);
+
+	err = hw_atl_utils_fw_downld_dwords(self, addr, &caps_hi,
+					    sizeof(caps_hi) / sizeof(u32));
+
+	if (err)
+		return err;
+
+	*supported_rates = fw2x_to_eee_mask(caps_hi);
+
+	mpi_state = aq_hw_read_reg(self, HW_ATL_FW2X_MPI_STATE2_ADDR);
+	*rate = fw2x_to_eee_mask(mpi_state);
+
+	return err;
+}
+
 static int aq_fw2x_renegotiate(struct aq_hw_s *self)
 {
 	u32 mpi_opts = aq_hw_read_reg(self, HW_ATL_FW2X_MPI_CONTROL2_ADDR);
@@ -380,5 +464,7 @@ const struct aq_fw_ops aq_fw_2x_ops = {
 	.update_link_status = aq_fw2x_update_link_status,
 	.update_stats = aq_fw2x_update_stats,
 	.set_power = aq_fw2x_set_power,
+	.set_eee_rate = aq_fw2x_set_eee_rate,
+	.get_eee_rate = aq_fw2x_get_eee_rate,
 	.set_flow_control   = aq_fw2x_set_flow_control,
 };
-- 
2.7.4

^ permalink raw reply related

* [PATCH net-next v3 5/7] net: aquantia: whitespace changes
From: Igor Russkikh @ 2018-09-10  9:39 UTC (permalink / raw)
  To: David S . Miller; +Cc: netdev, Igor Russkikh, Nikita Danilov
In-Reply-To: <cover.1536572107.git.igor.russkikh@aquantia.com>

From: Nikita Danilov <nikita.danilov@aquantia.com>

Removed extra spaces, corrected alignment.

Signed-off-by: Nikita Danilov <nikita.danilov@aquantia.com>
Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
---
 .../net/ethernet/aquantia/atlantic/aq_ethtool.c    |  4 +--
 drivers/net/ethernet/aquantia/atlantic/aq_nic.c    | 12 ++++----
 drivers/net/ethernet/aquantia/atlantic/aq_ring.c   |  4 +--
 .../ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c  | 18 ++++++------
 .../ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c  | 14 ++++-----
 .../aquantia/atlantic/hw_atl/hw_atl_utils.c        | 33 +++++++++++-----------
 .../aquantia/atlantic/hw_atl/hw_atl_utils.h        |  1 +
 .../aquantia/atlantic/hw_atl/hw_atl_utils_fw2x.c   | 12 ++++----
 8 files changed, 49 insertions(+), 49 deletions(-)

diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_ethtool.c b/drivers/net/ethernet/aquantia/atlantic/aq_ethtool.c
index 22dd4fbd34d7..6a633c70f603 100644
--- a/drivers/net/ethernet/aquantia/atlantic/aq_ethtool.c
+++ b/drivers/net/ethernet/aquantia/atlantic/aq_ethtool.c
@@ -98,8 +98,8 @@ static void aq_ethtool_stats(struct net_device *ndev,
 	struct aq_nic_cfg_s *cfg = aq_nic_get_cfg(aq_nic);
 
 	memset(data, 0, (ARRAY_SIZE(aq_ethtool_stat_names) +
-				ARRAY_SIZE(aq_ethtool_queue_stat_names) *
-				cfg->vecs) * sizeof(u64));
+			 ARRAY_SIZE(aq_ethtool_queue_stat_names) *
+			 cfg->vecs) * sizeof(u64));
 	aq_nic_get_stats(aq_nic, data);
 }
 
diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_nic.c b/drivers/net/ethernet/aquantia/atlantic/aq_nic.c
index 9809dbf8c272..5fed24446687 100644
--- a/drivers/net/ethernet/aquantia/atlantic/aq_nic.c
+++ b/drivers/net/ethernet/aquantia/atlantic/aq_nic.c
@@ -189,7 +189,7 @@ static void aq_nic_polling_timer_cb(struct timer_list *t)
 		aq_vec_isr(i, (void *)aq_vec);
 
 	mod_timer(&self->polling_timer, jiffies +
-		AQ_CFG_POLLING_TIMER_INTERVAL);
+		  AQ_CFG_POLLING_TIMER_INTERVAL);
 }
 
 int aq_nic_ndev_register(struct aq_nic_s *self)
@@ -301,13 +301,13 @@ int aq_nic_start(struct aq_nic_s *self)
 	unsigned int i = 0U;
 
 	err = self->aq_hw_ops->hw_multicast_list_set(self->aq_hw,
-						    self->mc_list.ar,
-						    self->mc_list.count);
+						     self->mc_list.ar,
+						     self->mc_list.count);
 	if (err < 0)
 		goto err_exit;
 
 	err = self->aq_hw_ops->hw_packet_filter_set(self->aq_hw,
-						   self->packet_filter);
+						    self->packet_filter);
 	if (err < 0)
 		goto err_exit;
 
@@ -327,7 +327,7 @@ int aq_nic_start(struct aq_nic_s *self)
 		goto err_exit;
 	timer_setup(&self->service_timer, aq_nic_service_timer_cb, 0);
 	mod_timer(&self->service_timer, jiffies +
-			AQ_CFG_SERVICE_TIMER_INTERVAL);
+		  AQ_CFG_SERVICE_TIMER_INTERVAL);
 
 	if (self->aq_nic_cfg.is_polling) {
 		timer_setup(&self->polling_timer, aq_nic_polling_timer_cb, 0);
@@ -344,7 +344,7 @@ int aq_nic_start(struct aq_nic_s *self)
 		}
 
 		err = self->aq_hw_ops->hw_irq_enable(self->aq_hw,
-				    AQ_CFG_IRQ_MASK);
+						     AQ_CFG_IRQ_MASK);
 		if (err < 0)
 			goto err_exit;
 	}
diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_ring.c b/drivers/net/ethernet/aquantia/atlantic/aq_ring.c
index b5f1f62e8e25..32111272d7bf 100644
--- a/drivers/net/ethernet/aquantia/atlantic/aq_ring.c
+++ b/drivers/net/ethernet/aquantia/atlantic/aq_ring.c
@@ -29,8 +29,8 @@ static struct aq_ring_s *aq_ring_alloc(struct aq_ring_s *self,
 		goto err_exit;
 	}
 	self->dx_ring = dma_alloc_coherent(aq_nic_get_dev(aq_nic),
-						self->size * self->dx_size,
-						&self->dx_ring_pa, GFP_KERNEL);
+					   self->size * self->dx_size,
+					   &self->dx_ring_pa, GFP_KERNEL);
 	if (!self->dx_ring) {
 		err = -ENOMEM;
 		goto err_exit;
diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c
index 1dd0ef4a895c..d1d5bfda6a5b 100644
--- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c
+++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c
@@ -49,9 +49,9 @@
 const struct aq_hw_caps_s hw_atl_a0_caps_aqc100 = {
 	DEFAULT_A0_BOARD_BASIC_CAPABILITIES,
 	.media_type = AQ_HW_MEDIA_TYPE_FIBRE,
-	.link_speed_msk = HW_ATL_A0_RATE_5G  |
+	.link_speed_msk = HW_ATL_A0_RATE_5G |
 			  HW_ATL_A0_RATE_2G5 |
-			  HW_ATL_A0_RATE_1G  |
+			  HW_ATL_A0_RATE_1G |
 			  HW_ATL_A0_RATE_100M,
 };
 
@@ -59,9 +59,9 @@ const struct aq_hw_caps_s hw_atl_a0_caps_aqc107 = {
 	DEFAULT_A0_BOARD_BASIC_CAPABILITIES,
 	.media_type = AQ_HW_MEDIA_TYPE_TP,
 	.link_speed_msk = HW_ATL_A0_RATE_10G |
-			  HW_ATL_A0_RATE_5G  |
+			  HW_ATL_A0_RATE_5G |
 			  HW_ATL_A0_RATE_2G5 |
-			  HW_ATL_A0_RATE_1G  |
+			  HW_ATL_A0_RATE_1G |
 			  HW_ATL_A0_RATE_100M,
 };
 
@@ -78,7 +78,7 @@ const struct aq_hw_caps_s hw_atl_a0_caps_aqc109 = {
 	DEFAULT_A0_BOARD_BASIC_CAPABILITIES,
 	.media_type = AQ_HW_MEDIA_TYPE_TP,
 	.link_speed_msk = HW_ATL_A0_RATE_2G5 |
-			  HW_ATL_A0_RATE_1G  |
+			  HW_ATL_A0_RATE_1G |
 			  HW_ATL_A0_RATE_100M,
 };
 
@@ -284,7 +284,7 @@ static int hw_atl_a0_hw_init_rx_path(struct aq_hw_s *self)
 
 	/* RSS Ring selection */
 	hw_atl_reg_rx_flr_rss_control1set(self, cfg->is_rss ?
-					0xB3333333U : 0x00000000U);
+					  0xB3333333U : 0x00000000U);
 
 	/* Multicast filters */
 	for (i = HW_ATL_A0_MAC_MAX; i--;) {
@@ -325,7 +325,7 @@ static int hw_atl_a0_hw_mac_addr_set(struct aq_hw_s *self, u8 *mac_addr)
 	}
 	h = (mac_addr[0] << 8) | (mac_addr[1]);
 	l = (mac_addr[2] << 24) | (mac_addr[3] << 16) |
-		(mac_addr[4] << 8) | mac_addr[5];
+	    (mac_addr[4] << 8) | mac_addr[5];
 
 	hw_atl_rpfl2_uc_flr_en_set(self, 0U, HW_ATL_A0_MAC);
 	hw_atl_rpfl2unicast_dest_addresslsw_set(self, l, HW_ATL_A0_MAC);
@@ -519,7 +519,7 @@ static int hw_atl_a0_hw_ring_rx_init(struct aq_hw_s *self,
 
 	hw_atl_rdm_rx_desc_data_buff_size_set(self,
 					      AQ_CFG_RX_FRAME_MAX / 1024U,
-				       aq_ring->idx);
+					      aq_ring->idx);
 
 	hw_atl_rdm_rx_desc_head_buff_size_set(self, 0U, aq_ring->idx);
 	hw_atl_rdm_rx_desc_head_splitting_set(self, 0U, aq_ring->idx);
@@ -758,7 +758,7 @@ static int hw_atl_a0_hw_packet_filter_set(struct aq_hw_s *self,
 		hw_atl_rpfl2_uc_flr_en_set(self,
 					   (self->aq_nic_cfg->is_mc_list_enabled &&
 					   (i <= self->aq_nic_cfg->mc_list_count)) ?
-					    1U : 0U, i);
+					   1U : 0U, i);
 
 	return aq_hw_err_from_flags(self);
 }
diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c
index d03f43683d8b..7c8ee103c825 100644
--- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c
+++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c
@@ -52,9 +52,9 @@ const struct aq_hw_caps_s hw_atl_b0_caps_aqc100 = {
 	DEFAULT_B0_BOARD_BASIC_CAPABILITIES,
 	.media_type = AQ_HW_MEDIA_TYPE_FIBRE,
 	.link_speed_msk = HW_ATL_B0_RATE_10G |
-			  HW_ATL_B0_RATE_5G  |
+			  HW_ATL_B0_RATE_5G |
 			  HW_ATL_B0_RATE_2G5 |
-			  HW_ATL_B0_RATE_1G  |
+			  HW_ATL_B0_RATE_1G |
 			  HW_ATL_B0_RATE_100M,
 };
 
@@ -62,18 +62,18 @@ const struct aq_hw_caps_s hw_atl_b0_caps_aqc107 = {
 	DEFAULT_B0_BOARD_BASIC_CAPABILITIES,
 	.media_type = AQ_HW_MEDIA_TYPE_TP,
 	.link_speed_msk = HW_ATL_B0_RATE_10G |
-			  HW_ATL_B0_RATE_5G  |
+			  HW_ATL_B0_RATE_5G |
 			  HW_ATL_B0_RATE_2G5 |
-			  HW_ATL_B0_RATE_1G  |
+			  HW_ATL_B0_RATE_1G |
 			  HW_ATL_B0_RATE_100M,
 };
 
 const struct aq_hw_caps_s hw_atl_b0_caps_aqc108 = {
 	DEFAULT_B0_BOARD_BASIC_CAPABILITIES,
 	.media_type = AQ_HW_MEDIA_TYPE_TP,
-	.link_speed_msk = HW_ATL_B0_RATE_5G  |
+	.link_speed_msk = HW_ATL_B0_RATE_5G |
 			  HW_ATL_B0_RATE_2G5 |
-			  HW_ATL_B0_RATE_1G  |
+			  HW_ATL_B0_RATE_1G |
 			  HW_ATL_B0_RATE_100M,
 };
 
@@ -81,7 +81,7 @@ const struct aq_hw_caps_s hw_atl_b0_caps_aqc109 = {
 	DEFAULT_B0_BOARD_BASIC_CAPABILITIES,
 	.media_type = AQ_HW_MEDIA_TYPE_TP,
 	.link_speed_msk = HW_ATL_B0_RATE_2G5 |
-			  HW_ATL_B0_RATE_1G  |
+			  HW_ATL_B0_RATE_1G |
 			  HW_ATL_B0_RATE_100M,
 };
 
diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.c b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.c
index bb1561c6d25a..5b7116d015a4 100644
--- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.c
+++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.c
@@ -49,6 +49,7 @@
 #define FORCE_FLASHLESS 0
 
 static int hw_atl_utils_ver_match(u32 ver_expected, u32 ver_actual);
+
 static int hw_atl_utils_mpi_set_state(struct aq_hw_s *self,
 				      enum hal_atl_utils_fw_state_e state);
 
@@ -69,10 +70,10 @@ int hw_atl_utils_initfw(struct aq_hw_s *self, const struct aq_fw_ops **fw_ops)
 				   self->fw_ver_actual) == 0) {
 		*fw_ops = &aq_fw_1x_ops;
 	} else if (hw_atl_utils_ver_match(HW_ATL_FW_VER_2X,
-					self->fw_ver_actual) == 0) {
+					  self->fw_ver_actual) == 0) {
 		*fw_ops = &aq_fw_2x_ops;
 	} else if (hw_atl_utils_ver_match(HW_ATL_FW_VER_3X,
-					self->fw_ver_actual) == 0) {
+					  self->fw_ver_actual) == 0) {
 		*fw_ops = &aq_fw_2x_ops;
 	} else {
 		aq_pr_err("Bad FW version detected: %x\n",
@@ -260,7 +261,7 @@ int hw_atl_utils_soft_reset(struct aq_hw_s *self)
 
 		hw_atl_utils_mpi_set_state(self, MPI_DEINIT);
 		AQ_HW_WAIT_FOR((aq_hw_read_reg(self, HW_ATL_MPI_STATE_ADR) &
-			       HW_ATL_MPI_STATE_MSK) == MPI_DEINIT,
+				HW_ATL_MPI_STATE_MSK) == MPI_DEINIT,
 			       10, 1000U);
 	}
 
@@ -277,7 +278,7 @@ int hw_atl_utils_fw_downld_dwords(struct aq_hw_s *self, u32 a,
 
 	AQ_HW_WAIT_FOR(hw_atl_reg_glb_cpu_sem_get(self,
 						  HW_ATL_FW_SM_RAM) == 1U,
-						  1U, 10000U);
+		       1U, 10000U);
 
 	if (err < 0) {
 		bool is_locked;
@@ -393,7 +394,7 @@ static int hw_atl_utils_init_ucp(struct aq_hw_s *self,
 
 	/* check 10 times by 1ms */
 	AQ_HW_WAIT_FOR(0U != (self->mbox_addr =
-			aq_hw_read_reg(self, 0x360U)), 1000U, 10U);
+			      aq_hw_read_reg(self, 0x360U)), 1000U, 10U);
 
 	return err;
 }
@@ -425,7 +426,7 @@ int hw_atl_utils_fw_rpc_call(struct aq_hw_s *self, unsigned int rpc_size)
 	err = hw_atl_utils_fw_upload_dwords(self, self->rpc_addr,
 					    (u32 *)(void *)&self->rpc,
 					    (rpc_size + sizeof(u32) -
-					    sizeof(u8)) / sizeof(u32));
+					     sizeof(u8)) / sizeof(u32));
 	if (err < 0)
 		goto err_exit;
 
@@ -450,7 +451,7 @@ int hw_atl_utils_fw_rpc_wait(struct aq_hw_s *self,
 		self->rpc_tid = sw.tid;
 
 		AQ_HW_WAIT_FOR(sw.tid ==
-				(fw.val =
+			       (fw.val =
 				aq_hw_read_reg(self, HW_ATL_RPC_STATE_ADR),
 				fw.tid), 1000U, 100U);
 		if (err < 0)
@@ -473,7 +474,7 @@ int hw_atl_utils_fw_rpc_wait(struct aq_hw_s *self,
 						      (u32 *)(void *)
 						      &self->rpc,
 						      (fw.len + sizeof(u32) -
-						      sizeof(u8)) /
+						       sizeof(u8)) /
 						      sizeof(u32));
 			if (err < 0)
 				goto err_exit;
@@ -506,9 +507,9 @@ int hw_atl_utils_mpi_read_mbox(struct aq_hw_s *self,
 			       struct hw_aq_atl_utils_mbox_header *pmbox)
 {
 	return hw_atl_utils_fw_downld_dwords(self,
-				      self->mbox_addr,
-				      (u32 *)(void *)pmbox,
-				      sizeof(*pmbox) / sizeof(u32));
+					     self->mbox_addr,
+					     (u32 *)(void *)pmbox,
+					     sizeof(*pmbox) / sizeof(u32));
 }
 
 void hw_atl_utils_mpi_read_stats(struct aq_hw_s *self,
@@ -561,8 +562,8 @@ static int hw_atl_utils_mpi_set_state(struct aq_hw_s *self,
 		transaction_id = mbox.transaction_id;
 
 		AQ_HW_WAIT_FOR(transaction_id !=
-				(hw_atl_utils_mpi_read_mbox(self, &mbox),
-				 mbox.transaction_id),
+			       (hw_atl_utils_mpi_read_mbox(self, &mbox),
+				mbox.transaction_id),
 			       1000U, 100U);
 		if (err < 0)
 			goto err_exit;
@@ -659,9 +660,9 @@ int hw_atl_utils_get_mac_permanent(struct aq_hw_s *self,
 
 	if ((mac[0] & 0x01U) || ((mac[0] | mac[1] | mac[2]) == 0x00U)) {
 		/* chip revision */
-		l = 0xE3000000U
-			| (0xFFFFU & aq_hw_read_reg(self, HW_ATL_UCP_0X370_REG))
-			| (0x00 << 16);
+		l = 0xE3000000U |
+		    (0xFFFFU & aq_hw_read_reg(self, HW_ATL_UCP_0X370_REG)) |
+		    (0x00 << 16);
 		h = 0x8001300EU;
 
 		mac[5] = (u8)(0xFFU & l);
diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.h b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.h
index 6ced102d02db..f3d830f423f2 100644
--- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.h
+++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.h
@@ -416,6 +416,7 @@ int hw_atl_utils_get_fw_version(struct aq_hw_s *self, u32 *fw_version);
 int hw_atl_utils_update_stats(struct aq_hw_s *self);
 
 struct aq_stats_s *hw_atl_utils_get_hw_stats(struct aq_hw_s *self);
+
 int hw_atl_utils_fw_downld_dwords(struct aq_hw_s *self, u32 a,
 				  u32 *p, u32 cnt);
 
diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils_fw2x.c b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils_fw2x.c
index 27bed5dd5295..7410e28e5a1f 100644
--- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils_fw2x.c
+++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils_fw2x.c
@@ -76,7 +76,7 @@ static int aq_fw2x_init(struct aq_hw_s *self)
 
 	/* check 10 times by 1ms */
 	AQ_HW_WAIT_FOR(0U != (self->mbox_addr =
-			aq_hw_read_reg(self, HW_ATL_FW2X_MPI_MBOX_ADDR)),
+		       aq_hw_read_reg(self, HW_ATL_FW2X_MPI_MBOX_ADDR)),
 		       1000U, 10U);
 	AQ_HW_WAIT_FOR(0U != (self->rpc_addr =
 		       aq_hw_read_reg(self, HW_ATL_FW2X_MPI_RPC_ADDR)),
@@ -213,7 +213,7 @@ static int aq_fw2x_update_link_status(struct aq_hw_s *self)
 {
 	u32 mpi_state = aq_hw_read_reg(self, HW_ATL_FW2X_MPI_STATE_ADDR);
 	u32 speed = mpi_state & (FW2X_RATE_100M | FW2X_RATE_1G |
-				FW2X_RATE_2G5 | FW2X_RATE_5G | FW2X_RATE_10G);
+				 FW2X_RATE_2G5 | FW2X_RATE_5G | FW2X_RATE_10G);
 	struct aq_hw_link_status_s *link_status = &self->aq_link_status;
 
 	if (speed) {
@@ -262,9 +262,7 @@ static int aq_fw2x_get_mac_permanent(struct aq_hw_s *self, u8 *mac)
 
 		get_random_bytes(&rnd, sizeof(unsigned int));
 
-		l = 0xE3000000U
-			| (0xFFFFU & rnd)
-			| (0x00 << 16);
+		l = 0xE3000000U | (0xFFFFU & rnd) | (0x00 << 16);
 		h = 0x8001300EU;
 
 		mac[5] = (u8)(0xFFU & l);
@@ -294,7 +292,7 @@ int aq_fw2x_update_stats(struct aq_hw_s *self)
 	/* Wait FW to report back */
 	AQ_HW_WAIT_FOR(orig_stats_val !=
 		       (aq_hw_read_reg(self, HW_ATL_FW2X_MPI_STATE2_ADDR) &
-				       BIT(CAPS_HI_STATISTICS)),
+			BIT(CAPS_HI_STATISTICS)),
 		       1U, 10000U);
 	if (err)
 		return err;
@@ -466,5 +464,5 @@ const struct aq_fw_ops aq_fw_2x_ops = {
 	.set_power = aq_fw2x_set_power,
 	.set_eee_rate = aq_fw2x_set_eee_rate,
 	.get_eee_rate = aq_fw2x_get_eee_rate,
-	.set_flow_control   = aq_fw2x_set_flow_control,
+	.set_flow_control = aq_fw2x_set_flow_control,
 };
-- 
2.7.4

^ permalink raw reply related

* [PATCH net-next v3 6/7] net: aquantia: renaming for better visibility
From: Igor Russkikh @ 2018-09-10  9:39 UTC (permalink / raw)
  To: David S . Miller; +Cc: netdev, Igor Russkikh, Nikita Danilov
In-Reply-To: <cover.1536572107.git.igor.russkikh@aquantia.com>

From: Nikita Danilov <nikita.danilov@aquantia.com>

Removed extra characters from the names of structures to unify prefixes
used through the driver code (we normally use hw_atl for hw specifics).
HW_ATL_B0_ and HW_ATL_A0_ are the same and useless copies.

Signed-off-by: Nikita Danilov <nikita.danilov@aquantia.com>
Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
---
 drivers/net/ethernet/aquantia/atlantic/aq_hw.h     |  4 +--
 .../ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c  | 32 ++++++++++----------
 .../aquantia/atlantic/hw_atl/hw_atl_a0_internal.h  |  6 ----
 .../ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c  | 34 +++++++++++-----------
 .../aquantia/atlantic/hw_atl/hw_atl_b0_internal.h  |  6 ----
 .../aquantia/atlantic/hw_atl/hw_atl_utils.c        | 14 ++++-----
 .../aquantia/atlantic/hw_atl/hw_atl_utils.h        | 14 ++++-----
 .../aquantia/atlantic/hw_atl/hw_atl_utils_fw2x.c   |  6 ++--
 8 files changed, 52 insertions(+), 64 deletions(-)

diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_hw.h b/drivers/net/ethernet/aquantia/atlantic/aq_hw.h
index 908f19fe19b3..e8689241204e 100644
--- a/drivers/net/ethernet/aquantia/atlantic/aq_hw.h
+++ b/drivers/net/ethernet/aquantia/atlantic/aq_hw.h
@@ -112,7 +112,7 @@ struct aq_hw_s {
 	const struct aq_fw_ops *aq_fw_ops;
 	void __iomem *mmio;
 	struct aq_hw_link_status_s aq_link_status;
-	struct hw_aq_atl_utils_mbox mbox;
+	struct hw_atl_utils_mbox mbox;
 	struct hw_atl_stats_s last_stats;
 	struct aq_stats_s curr_stats;
 	u64 speed;
@@ -124,7 +124,7 @@ struct aq_hw_s {
 	u32 mbox_addr;
 	u32 rpc_addr;
 	u32 rpc_tid;
-	struct hw_aq_atl_utils_fw_rpc rpc;
+	struct hw_atl_utils_fw_rpc rpc;
 };
 
 struct aq_ring_s;
diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c
index d1d5bfda6a5b..2469ed4d86b9 100644
--- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c
+++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c
@@ -49,37 +49,37 @@
 const struct aq_hw_caps_s hw_atl_a0_caps_aqc100 = {
 	DEFAULT_A0_BOARD_BASIC_CAPABILITIES,
 	.media_type = AQ_HW_MEDIA_TYPE_FIBRE,
-	.link_speed_msk = HW_ATL_A0_RATE_5G |
-			  HW_ATL_A0_RATE_2G5 |
-			  HW_ATL_A0_RATE_1G |
-			  HW_ATL_A0_RATE_100M,
+	.link_speed_msk = AQ_NIC_RATE_5G |
+			  AQ_NIC_RATE_2GS |
+			  AQ_NIC_RATE_1G |
+			  AQ_NIC_RATE_100M,
 };
 
 const struct aq_hw_caps_s hw_atl_a0_caps_aqc107 = {
 	DEFAULT_A0_BOARD_BASIC_CAPABILITIES,
 	.media_type = AQ_HW_MEDIA_TYPE_TP,
-	.link_speed_msk = HW_ATL_A0_RATE_10G |
-			  HW_ATL_A0_RATE_5G |
-			  HW_ATL_A0_RATE_2G5 |
-			  HW_ATL_A0_RATE_1G |
-			  HW_ATL_A0_RATE_100M,
+	.link_speed_msk = AQ_NIC_RATE_10G |
+			  AQ_NIC_RATE_5G |
+			  AQ_NIC_RATE_2GS |
+			  AQ_NIC_RATE_1G |
+			  AQ_NIC_RATE_100M,
 };
 
 const struct aq_hw_caps_s hw_atl_a0_caps_aqc108 = {
 	DEFAULT_A0_BOARD_BASIC_CAPABILITIES,
 	.media_type = AQ_HW_MEDIA_TYPE_TP,
-	.link_speed_msk = HW_ATL_A0_RATE_5G  |
-			  HW_ATL_A0_RATE_2G5 |
-			  HW_ATL_A0_RATE_1G  |
-			  HW_ATL_A0_RATE_100M,
+	.link_speed_msk = AQ_NIC_RATE_5G |
+			  AQ_NIC_RATE_2GS |
+			  AQ_NIC_RATE_1G |
+			  AQ_NIC_RATE_100M,
 };
 
 const struct aq_hw_caps_s hw_atl_a0_caps_aqc109 = {
 	DEFAULT_A0_BOARD_BASIC_CAPABILITIES,
 	.media_type = AQ_HW_MEDIA_TYPE_TP,
-	.link_speed_msk = HW_ATL_A0_RATE_2G5 |
-			  HW_ATL_A0_RATE_1G |
-			  HW_ATL_A0_RATE_100M,
+	.link_speed_msk = AQ_NIC_RATE_2GS |
+			  AQ_NIC_RATE_1G |
+			  AQ_NIC_RATE_100M,
 };
 
 static int hw_atl_a0_hw_reset(struct aq_hw_s *self)
diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0_internal.h b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0_internal.h
index 3c94cff57876..a021dc431ef7 100644
--- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0_internal.h
+++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0_internal.h
@@ -62,12 +62,6 @@
 #define HW_ATL_A0_MPI_SPEED_MSK       0xFFFFU
 #define HW_ATL_A0_MPI_SPEED_SHIFT     16U
 
-#define HW_ATL_A0_RATE_10G            BIT(0)
-#define HW_ATL_A0_RATE_5G             BIT(1)
-#define HW_ATL_A0_RATE_2G5            BIT(3)
-#define HW_ATL_A0_RATE_1G             BIT(4)
-#define HW_ATL_A0_RATE_100M           BIT(5)
-
 #define HW_ATL_A0_TXBUF_MAX 160U
 #define HW_ATL_A0_RXBUF_MAX 320U
 
diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c
index 7c8ee103c825..76d25d594a0f 100644
--- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c
+++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c
@@ -51,38 +51,38 @@
 const struct aq_hw_caps_s hw_atl_b0_caps_aqc100 = {
 	DEFAULT_B0_BOARD_BASIC_CAPABILITIES,
 	.media_type = AQ_HW_MEDIA_TYPE_FIBRE,
-	.link_speed_msk = HW_ATL_B0_RATE_10G |
-			  HW_ATL_B0_RATE_5G |
-			  HW_ATL_B0_RATE_2G5 |
-			  HW_ATL_B0_RATE_1G |
-			  HW_ATL_B0_RATE_100M,
+	.link_speed_msk = AQ_NIC_RATE_10G |
+			  AQ_NIC_RATE_5G |
+			  AQ_NIC_RATE_2GS |
+			  AQ_NIC_RATE_1G |
+			  AQ_NIC_RATE_100M,
 };
 
 const struct aq_hw_caps_s hw_atl_b0_caps_aqc107 = {
 	DEFAULT_B0_BOARD_BASIC_CAPABILITIES,
 	.media_type = AQ_HW_MEDIA_TYPE_TP,
-	.link_speed_msk = HW_ATL_B0_RATE_10G |
-			  HW_ATL_B0_RATE_5G |
-			  HW_ATL_B0_RATE_2G5 |
-			  HW_ATL_B0_RATE_1G |
-			  HW_ATL_B0_RATE_100M,
+	.link_speed_msk = AQ_NIC_RATE_10G |
+			  AQ_NIC_RATE_5G |
+			  AQ_NIC_RATE_2GS |
+			  AQ_NIC_RATE_1G |
+			  AQ_NIC_RATE_100M,
 };
 
 const struct aq_hw_caps_s hw_atl_b0_caps_aqc108 = {
 	DEFAULT_B0_BOARD_BASIC_CAPABILITIES,
 	.media_type = AQ_HW_MEDIA_TYPE_TP,
-	.link_speed_msk = HW_ATL_B0_RATE_5G |
-			  HW_ATL_B0_RATE_2G5 |
-			  HW_ATL_B0_RATE_1G |
-			  HW_ATL_B0_RATE_100M,
+	.link_speed_msk = AQ_NIC_RATE_5G |
+			  AQ_NIC_RATE_2GS |
+			  AQ_NIC_RATE_1G |
+			  AQ_NIC_RATE_100M,
 };
 
 const struct aq_hw_caps_s hw_atl_b0_caps_aqc109 = {
 	DEFAULT_B0_BOARD_BASIC_CAPABILITIES,
 	.media_type = AQ_HW_MEDIA_TYPE_TP,
-	.link_speed_msk = HW_ATL_B0_RATE_2G5 |
-			  HW_ATL_B0_RATE_1G |
-			  HW_ATL_B0_RATE_100M,
+	.link_speed_msk = AQ_NIC_RATE_2GS |
+			  AQ_NIC_RATE_1G |
+			  AQ_NIC_RATE_100M,
 };
 
 static int hw_atl_b0_hw_reset(struct aq_hw_s *self)
diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0_internal.h b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0_internal.h
index 28568f5fa74b..b318eefd36ae 100644
--- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0_internal.h
+++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0_internal.h
@@ -67,12 +67,6 @@
 #define HW_ATL_B0_MPI_SPEED_MSK         0xFFFFU
 #define HW_ATL_B0_MPI_SPEED_SHIFT       16U
 
-#define HW_ATL_B0_RATE_10G              BIT(0)
-#define HW_ATL_B0_RATE_5G               BIT(1)
-#define HW_ATL_B0_RATE_2G5              BIT(3)
-#define HW_ATL_B0_RATE_1G               BIT(4)
-#define HW_ATL_B0_RATE_100M             BIT(5)
-
 #define HW_ATL_B0_TXBUF_MAX  160U
 #define HW_ATL_B0_RXBUF_MAX  320U
 
diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.c b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.c
index 5b7116d015a4..0dd59b09060b 100644
--- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.c
+++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.c
@@ -439,7 +439,7 @@ int hw_atl_utils_fw_rpc_call(struct aq_hw_s *self, unsigned int rpc_size)
 }
 
 int hw_atl_utils_fw_rpc_wait(struct aq_hw_s *self,
-			     struct hw_aq_atl_utils_fw_rpc **rpc)
+			     struct hw_atl_utils_fw_rpc **rpc)
 {
 	int err = 0;
 	struct aq_hw_atl_utils_fw_rpc_tid_s sw;
@@ -504,7 +504,7 @@ static int hw_atl_utils_mpi_create(struct aq_hw_s *self)
 }
 
 int hw_atl_utils_mpi_read_mbox(struct aq_hw_s *self,
-			       struct hw_aq_atl_utils_mbox_header *pmbox)
+			       struct hw_atl_utils_mbox_header *pmbox)
 {
 	return hw_atl_utils_fw_downld_dwords(self,
 					     self->mbox_addr,
@@ -513,7 +513,7 @@ int hw_atl_utils_mpi_read_mbox(struct aq_hw_s *self,
 }
 
 void hw_atl_utils_mpi_read_stats(struct aq_hw_s *self,
-				 struct hw_aq_atl_utils_mbox *pmbox)
+				 struct hw_atl_utils_mbox *pmbox)
 {
 	int err = 0;
 
@@ -553,7 +553,7 @@ static int hw_atl_utils_mpi_set_state(struct aq_hw_s *self,
 {
 	int err = 0;
 	u32 transaction_id = 0;
-	struct hw_aq_atl_utils_mbox_header mbox;
+	struct hw_atl_utils_mbox_header mbox;
 	u32 val = aq_hw_read_reg(self, HW_ATL_MPI_CONTROL_ADR);
 
 	if (state == MPI_RESET) {
@@ -747,7 +747,7 @@ static int hw_atl_fw1x_deinit(struct aq_hw_s *self)
 
 int hw_atl_utils_update_stats(struct aq_hw_s *self)
 {
-	struct hw_aq_atl_utils_mbox mbox;
+	struct hw_atl_utils_mbox mbox;
 
 	hw_atl_utils_mpi_read_stats(self, &mbox);
 
@@ -834,7 +834,7 @@ int hw_atl_utils_get_fw_version(struct aq_hw_s *self, u32 *fw_version)
 
 static int aq_fw1x_set_wol(struct aq_hw_s *self, bool wol_enabled, u8 *mac)
 {
-	struct hw_aq_atl_utils_fw_rpc *prpc = NULL;
+	struct hw_atl_utils_fw_rpc *prpc = NULL;
 	unsigned int rpc_size = 0U;
 	int err = 0;
 
@@ -873,7 +873,7 @@ static int aq_fw1x_set_wol(struct aq_hw_s *self, bool wol_enabled, u8 *mac)
 int aq_fw1x_set_power(struct aq_hw_s *self, unsigned int power_state,
 		      u8 *mac)
 {
-	struct hw_aq_atl_utils_fw_rpc *prpc = NULL;
+	struct hw_atl_utils_fw_rpc *prpc = NULL;
 	unsigned int rpc_size = 0U;
 	int err = 0;
 
diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.h b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.h
index f3d830f423f2..3613fca64b58 100644
--- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.h
+++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.h
@@ -75,7 +75,7 @@ union __packed ip_addr {
 	} v4;
 };
 
-struct __packed hw_aq_atl_utils_fw_rpc {
+struct __packed hw_atl_utils_fw_rpc {
 	u32 msg_id;
 
 	union {
@@ -165,7 +165,7 @@ struct __packed hw_aq_atl_utils_fw_rpc {
 	};
 };
 
-struct __packed hw_aq_atl_utils_mbox_header {
+struct __packed hw_atl_utils_mbox_header {
 	u32 version;
 	u32 transaction_id;
 	u32 error;
@@ -183,8 +183,8 @@ struct __packed hw_aq_info {
 	u32 caps_hi;
 };
 
-struct __packed hw_aq_atl_utils_mbox {
-	struct hw_aq_atl_utils_mbox_header header;
+struct __packed hw_atl_utils_mbox {
+	struct hw_atl_utils_mbox_header header;
 	struct hw_atl_stats_s stats;
 	struct hw_aq_info info;
 };
@@ -386,10 +386,10 @@ int hw_atl_utils_soft_reset(struct aq_hw_s *self);
 void hw_atl_utils_hw_chip_features_init(struct aq_hw_s *self, u32 *p);
 
 int hw_atl_utils_mpi_read_mbox(struct aq_hw_s *self,
-			       struct hw_aq_atl_utils_mbox_header *pmbox);
+			       struct hw_atl_utils_mbox_header *pmbox);
 
 void hw_atl_utils_mpi_read_stats(struct aq_hw_s *self,
-				 struct hw_aq_atl_utils_mbox *pmbox);
+				 struct hw_atl_utils_mbox *pmbox);
 
 void hw_atl_utils_mpi_set(struct aq_hw_s *self,
 			  enum hal_atl_utils_fw_state_e state,
@@ -425,7 +425,7 @@ int hw_atl_utils_fw_set_wol(struct aq_hw_s *self, bool wol_enabled, u8 *mac);
 int hw_atl_utils_fw_rpc_call(struct aq_hw_s *self, unsigned int rpc_size);
 
 int hw_atl_utils_fw_rpc_wait(struct aq_hw_s *self,
-			     struct hw_aq_atl_utils_fw_rpc **rpc);
+			     struct hw_atl_utils_fw_rpc **rpc);
 
 extern const struct aq_fw_ops aq_fw_1x_ops;
 extern const struct aq_fw_ops aq_fw_2x_ops;
diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils_fw2x.c b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils_fw2x.c
index 7410e28e5a1f..c0568465e10b 100644
--- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils_fw2x.c
+++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils_fw2x.c
@@ -302,7 +302,7 @@ int aq_fw2x_update_stats(struct aq_hw_s *self)
 
 static int aq_fw2x_set_sleep_proxy(struct aq_hw_s *self, u8 *mac)
 {
-	struct hw_aq_atl_utils_fw_rpc *rpc = NULL;
+	struct hw_atl_utils_fw_rpc *rpc = NULL;
 	struct offload_info *cfg = NULL;
 	unsigned int rpc_size = 0U;
 	u32 mpi_opts;
@@ -344,7 +344,7 @@ static int aq_fw2x_set_sleep_proxy(struct aq_hw_s *self, u8 *mac)
 
 static int aq_fw2x_set_wol_params(struct aq_hw_s *self, u8 *mac)
 {
-	struct hw_aq_atl_utils_fw_rpc *rpc = NULL;
+	struct hw_atl_utils_fw_rpc *rpc = NULL;
 	struct fw2x_msg_wol *msg = NULL;
 	u32 mpi_opts;
 	int err = 0;
@@ -412,7 +412,7 @@ static int aq_fw2x_get_eee_rate(struct aq_hw_s *self, u32 *rate,
 	u32 mpi_state;
 	u32 caps_hi;
 	int err = 0;
-	u32 addr = self->mbox_addr + offsetof(struct hw_aq_atl_utils_mbox, info) +
+	u32 addr = self->mbox_addr + offsetof(struct hw_atl_utils_mbox, info) +
 		   offsetof(struct hw_aq_info, caps_hi);
 
 	err = hw_atl_utils_fw_downld_dwords(self, addr, &caps_hi,
-- 
2.7.4

^ permalink raw reply related

* [PATCH net-next v3 7/7] net: aquantia: bump driver version
From: Igor Russkikh @ 2018-09-10  9:39 UTC (permalink / raw)
  To: David S . Miller; +Cc: netdev, Igor Russkikh
In-Reply-To: <cover.1536572107.git.igor.russkikh@aquantia.com>

Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
---
 drivers/net/ethernet/aquantia/atlantic/ver.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/aquantia/atlantic/ver.h b/drivers/net/ethernet/aquantia/atlantic/ver.h
index 94efc6477bdc..b48260114da3 100644
--- a/drivers/net/ethernet/aquantia/atlantic/ver.h
+++ b/drivers/net/ethernet/aquantia/atlantic/ver.h
@@ -12,7 +12,7 @@
 
 #define NIC_MAJOR_DRIVER_VERSION           2
 #define NIC_MINOR_DRIVER_VERSION           0
-#define NIC_BUILD_DRIVER_VERSION           3
+#define NIC_BUILD_DRIVER_VERSION           4
 #define NIC_REVISION_DRIVER_VERSION        0
 
 #define AQ_CFG_DRV_VERSION_SUFFIX "-kern"
-- 
2.7.4

^ permalink raw reply related

* [PATCH net-next v3 0/7] net: aquantia: implement WOL and EEE support
From: Igor Russkikh @ 2018-09-10  9:39 UTC (permalink / raw)
  To: David S . Miller; +Cc: netdev, Igor Russkikh

This is v3 of WOL/EEE functionality patch for atlantic driver.

In this patchset Yana Esina and Nikita Danilov implemented:

- Upload function to interact with FW memory
- Definitions and structures necessary for the correct operation of Wake ON Lan
- The functionality Wake On Lan via ethtool (Magic packet is supported)
- The functionality for Energy-Efficient Ethernet configuration via ethtool

Version 3:
- use ETH_ALEN instead of raw number

Version 2 has the following fixes:
- patchset reorganized to extract renaming and whitespace fixes into separate
  patches
- some of magic numbers replaced with defines
- reverse christmas tree applied

Discussion outcome regarding driver version bumps was not finished
(here https://patchwork.ozlabs.org/patch/954905/)
David, could you suggest the best way to proceed on this?

Igor Russkikh (1):
  net: aquantia: bump driver version

Nikita Danilov (2):
  net: aquantia: whitespace changes
  net: aquantia: renaming for better visibility

Yana Esina (4):
  net: aquantia: fix hw_atl_utils_fw_upload_dwords
  net: aquantia: definitions for WOL
  net: aquantia: implement WOL support
  net: aquantia: implement EEE support

 drivers/net/ethernet/aquantia/atlantic/aq_common.h |   5 +
 .../net/ethernet/aquantia/atlantic/aq_ethtool.c    | 113 +++++++++-
 drivers/net/ethernet/aquantia/atlantic/aq_hw.h     |  13 +-
 drivers/net/ethernet/aquantia/atlantic/aq_nic.c    |  24 ++-
 drivers/net/ethernet/aquantia/atlantic/aq_nic.h    |   4 +
 drivers/net/ethernet/aquantia/atlantic/aq_ring.c   |   4 +-
 .../ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c  |  41 ++--
 .../aquantia/atlantic/hw_atl/hw_atl_a0_internal.h  |   6 -
 .../ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c  |  35 ++--
 .../aquantia/atlantic/hw_atl/hw_atl_b0_internal.h  |   6 -
 .../ethernet/aquantia/atlantic/hw_atl/hw_atl_llh.c |   8 +
 .../ethernet/aquantia/atlantic/hw_atl/hw_atl_llh.h |   3 +
 .../aquantia/atlantic/hw_atl/hw_atl_llh_internal.h |  13 ++
 .../aquantia/atlantic/hw_atl/hw_atl_utils.c        | 163 ++++++++++----
 .../aquantia/atlantic/hw_atl/hw_atl_utils.h        | 130 +++++++++++-
 .../aquantia/atlantic/hw_atl/hw_atl_utils_fw2x.c   | 233 ++++++++++++++++++++-
 drivers/net/ethernet/aquantia/atlantic/ver.h       |   2 +-
 17 files changed, 675 insertions(+), 128 deletions(-)

-- 
2.7.4

^ permalink raw reply

* [PATCH] net: ipv4: Use BUG_ON directly instead of a if condition followed by BUG
From: zhong jiang @ 2018-09-10 14:38 UTC (permalink / raw)
  To: davem, edumazet; +Cc: kuznet, yoshfuji, netdev, linux-kernel

The if condition can be removed if we use BUG_ON directly.
The issule is detected with the help of Coccinelle.

Signed-off-by: zhong jiang <zhongjiang@huawei.com>
---
 net/ipv4/tcp_input.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 62508a2..893bde3 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -4934,8 +4934,8 @@ void tcp_rbtree_insert(struct rb_root *root, struct sk_buff *skb)
 			BUG_ON(offset < 0);
 			if (size > 0) {
 				size = min(copy, size);
-				if (skb_copy_bits(skb, offset, skb_put(nskb, size), size))
-					BUG();
+				BUG(skb_copy_bits(skb, offset,
+						  skb_put(nskb, size), size));
 				TCP_SKB_CB(nskb)->end_seq += size;
 				copy -= size;
 				start += size;
@@ -5327,8 +5327,8 @@ static void tcp_urg(struct sock *sk, struct sk_buff *skb, const struct tcphdr *t
 		/* Is the urgent pointer pointing into this packet? */
 		if (ptr < skb->len) {
 			u8 tmp;
-			if (skb_copy_bits(skb, ptr, &tmp, 1))
-				BUG();
+
+			BUG(skb_copy_bits(skb, ptr, &tmp, 1));
 			tp->urg_data = TCP_URG_VALID | tmp;
 			if (!sock_flag(sk, SOCK_DEAD))
 				sk->sk_data_ready(sk);
-- 
1.7.12.4

^ permalink raw reply related

* RE: [PATCH 1/3][can-next] can: rcar_can: Fix erroneous registration
From: Fabrizio Castro @ 2018-09-10  9:45 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Wolfgang Grandegger, Marc Kleine-Budde, Sergei Shtylyov,
	David S. Miller, linux-can@vger.kernel.org, netdev, Simon Horman,
	Geert Uytterhoeven, Chris Paterson, Biju Das, Linux-Renesas
In-Reply-To: <CAMuHMdWrfuLF7h_-yYnCsUBryJUody_WuhqN_2jEQZu-V8khJw@mail.gmail.com>

Hello Geert,

I am sorry for the late reply.
Thank you for your feedback.

> Subject: Re: [PATCH 1/3][can-next] can: rcar_can: Fix erroneous registration
>
> Hi Fabrizio,
>
> On Thu, Aug 23, 2018 at 3:08 PM Fabrizio Castro
> <fabrizio.castro@bp.renesas.com> wrote:
> > Assigning 2 to "renesas,can-clock-select" tricks the driver into
> > registering the CAN interface, even though we don't want that.
> > This patch fixes this problem and also allows for architectures
> > missing some of the clocks (e.g. RZ/G2) to behave as expected.
>
> I think the fix for the second issue is not needed (see my reply to the other
> patch).
>
> > Fixes: 862e2b6af9413b43 ("can: rcar_can: support all input clocks")
> > Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> > Signed-off-by: Chris Paterson <Chris.Paterson2@renesas.com>
> > ---
> >
> > This patch applies on linux-can-next-for-4.19-20180727
> >
> >  drivers/net/can/rcar/rcar_can.c | 43 +++++++++++++++++++++++++++++++++--------
> >  1 file changed, 35 insertions(+), 8 deletions(-)
> >
> > diff --git a/drivers/net/can/rcar/rcar_can.c b/drivers/net/can/rcar/rcar_can.c
> > index 11662f4..fbd9284 100644
> > --- a/drivers/net/can/rcar/rcar_can.c
> > +++ b/drivers/net/can/rcar/rcar_can.c
> > @@ -21,9 +21,13 @@
> >  #include <linux/clk.h>
> >  #include <linux/can/platform/rcar_can.h>
> >  #include <linux/of.h>
> > +#include <linux/of_device.h>
> >
> >  #define RCAR_CAN_DRV_NAME      "rcar_can"
> >
> > +#define RCAR_SUPPORTED_CLOCKS  (BIT(CLKR_CLKP1) | BIT(CLKR_CLKP2) | \
> > +                                BIT(CLKR_CLKEXT))
> > +
> >  /* Mailbox configuration:
> >   * mailbox 60 - 63 - Rx FIFO mailboxes
> >   * mailbox 56 - 59 - Tx FIFO mailboxes
> > @@ -745,10 +749,12 @@ static int rcar_can_probe(struct platform_device *pdev)
> >         u32 clock_select = CLKR_CLKP1;
> >         int err = -ENODEV;
> >         int irq;
> > +       uintptr_t allowed_clks = RCAR_SUPPORTED_CLOCKS;
> >
> >         if (pdev->dev.of_node) {
> >                 of_property_read_u32(pdev->dev.of_node,
> >                                      "renesas,can-clock-select", &clock_select);
>
>
> > +               allowed_clks = (uintptr_t)of_device_get_match_data(&pdev->dev);
> >         } else {
> >                 pdata = dev_get_platdata(&pdev->dev);
> >                 if (!pdata) {
> > @@ -789,7 +795,7 @@ static int rcar_can_probe(struct platform_device *pdev)
> >                 goto fail_clk;
> >         }
> >
> > -       if (clock_select >= ARRAY_SIZE(clock_names)) {
> > +       if (!(BIT(clock_select) & allowed_clks)) {
>
> Hence you can just use RCAR_SUPPORTED_CLOCKS directly,
> or better, just check clock_names[clock_select] != NULL, ...

I rather use RCAR_SUPPORTED_CLOCKS then, it's safer. I'll send a v2 for you to look at.

>
> >                 err = -EINVAL;
> >                 dev_err(&pdev->dev, "invalid CAN clock selected\n");
> >                 goto fail_clk;
> > @@ -899,13 +905,34 @@ static int __maybe_unused rcar_can_resume(struct device *dev)
> >  static SIMPLE_DEV_PM_OPS(rcar_can_pm_ops, rcar_can_suspend, rcar_can_resume);
> >
> >  static const struct of_device_id rcar_can_of_table[] __maybe_unused = {
> > -       { .compatible = "renesas,can-r8a7778" },
> > -       { .compatible = "renesas,can-r8a7779" },
> > -       { .compatible = "renesas,can-r8a7790" },
> > -       { .compatible = "renesas,can-r8a7791" },
> > -       { .compatible = "renesas,rcar-gen1-can" },
> > -       { .compatible = "renesas,rcar-gen2-can" },
> > -       { .compatible = "renesas,rcar-gen3-can" },
> > +       {
> > +               .compatible = "renesas,can-r8a7778",
> > +               .data = (void *)RCAR_SUPPORTED_CLOCKS,
> > +       },
> > +       {
> > +               .compatible = "renesas,can-r8a7779",
> > +               .data = (void *)RCAR_SUPPORTED_CLOCKS,
> > +       },
> > +       {
> > +               .compatible = "renesas,can-r8a7790",
> > +               .data = (void *)RCAR_SUPPORTED_CLOCKS,
> > +       },
> > +       {
> > +               .compatible = "renesas,can-r8a7791",
> > +               .data = (void *)RCAR_SUPPORTED_CLOCKS,
> > +       },
> > +       {
> > +               .compatible = "renesas,rcar-gen1-can",
> > +               .data = (void *)RCAR_SUPPORTED_CLOCKS,
> > +       },
> > +       {
> > +               .compatible = "renesas,rcar-gen2-can",
> > +               .data = (void *)RCAR_SUPPORTED_CLOCKS,
> > +       },
> > +       {
> > +               .compatible = "renesas,rcar-gen3-can",z
> > +               .data = (void *)RCAR_SUPPORTED_CLOCKS,
> > +       },
> >         { }
>
> ... and all of the above can dropped.
>
> >  };
> >  MODULE_DEVICE_TABLE(of, rcar_can_of_table);
>
> BTW, why does the custom "renesas,can-clock-select" exist?
> If guess the standard "assigned-clock-parents" wasn't suitable because there's
> no actual defined clock for which you can change the parent?
>
> Why do you need manual selection? Can't the driver just pick the most suitable
> available clock, like other drivers (e.g. sh-sci) do?

Please have a look at 862e2b6af941 ("can: rcar_can: support all input clocks").
Maybe this could be improved in the future?

Thanks,
Fab

>
> Gr{oetje,eeting}s,
>
>                         Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                 -- Linus Torvalds



Renesas Electronics Europe Ltd, Dukes Meadow, Millboard Road, Bourne End, Buckinghamshire, SL8 5FH, UK. Registered in England & Wales under Registered No. 04586709.

^ permalink raw reply

* RE: [PATCH 2/3][can-next] can: rcar_can: Add RZ/G2 support
From: Fabrizio Castro @ 2018-09-10  9:45 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Wolfgang Grandegger, Marc Kleine-Budde, Sergei Shtylyov,
	David S. Miller, linux-can@vger.kernel.org, netdev, Simon Horman,
	Geert Uytterhoeven, Chris Paterson, Biju Das, Linux-Renesas
In-Reply-To: <CAMuHMdWEPwG6=MEtYKREfqyow=bz__p+Qj28kXufbXc37u8p9A@mail.gmail.com>

Hello Geert,

Thank you for your feedback.

> Subject: Re: [PATCH 2/3][can-next] can: rcar_can: Add RZ/G2 support
>
> Hi Fabrizio,
>
> (Usually the DT patch goes before the driver patch)
>
> On Thu, Aug 23, 2018 at 3:08 PM Fabrizio Castro
> <fabrizio.castro@bp.renesas.com> wrote:
> > RZ/G2 devices don't have clkp2, therefore this commit adds a
> > generic compatible string for them to allow for proper checking
> > during probe.
> >
> > Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> > Signed-off-by: Chris Paterson <Chris.Paterson2@renesas.com>
>
> Thanks for your patch!
>
> > --- a/drivers/net/can/rcar/rcar_can.c
> > +++ b/drivers/net/can/rcar/rcar_can.c
> > @@ -27,6 +27,7 @@
> >
> >  #define RCAR_SUPPORTED_CLOCKS  (BIT(CLKR_CLKP1) | BIT(CLKR_CLKP2) | \
> >                                  BIT(CLKR_CLKEXT))
> > +#define RZG2_SUPPORTED_CLOCKS  (BIT(CLKR_CLKP1) | BIT(CLKR_CLKEXT))
> >
> >  /* Mailbox configuration:
> >   * mailbox 60 - 63 - Rx FIFO mailboxes
> > @@ -933,6 +934,10 @@ static const struct of_device_id rcar_can_of_table[] __maybe_unused = {
> >                 .compatible = "renesas,rcar-gen3-can",
> >                 .data = (void *)RCAR_SUPPORTED_CLOCKS,
> >         },
> > +       {
> > +               .compatible = "renesas,rzg-gen2-can",
> > +               .data = (void *)RZG2_SUPPORTED_CLOCKS,
> > +       },
> >         { }
>
> I think this patch is not needed, cfr. my reply to the
> first^H^H^H^H^Hthird patch
> in your series.

I am dropping this patch.

Thanks,
Fab

>
> Gr{oetje,eeting}s,
>
>                         Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                 -- Linus Torvalds



Renesas Electronics Europe Ltd, Dukes Meadow, Millboard Road, Bourne End, Buckinghamshire, SL8 5FH, UK. Registered in England & Wales under Registered No. 04586709.

^ permalink raw reply

* RE: [PATCH 3/3] dt-bindings: can: rcar_can: Add r8a774a1 support
From: Fabrizio Castro @ 2018-09-10  9:54 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Wolfgang Grandegger, Marc Kleine-Budde, Rob Herring, Mark Rutland,
	Sergei Shtylyov, David S. Miller, linux-can@vger.kernel.org,
	netdev,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Simon Horman, Geert Uytterhoeven, Chris Paterson, Biju Das,
	Linux-Renesas, Linux Kernel Mailing List
In-Reply-To: <CAMuHMdWPuqfXOgh_-qp8q6wATU3Lj_WpX0bAOxPBX76SKvyXCQ@mail.gmail.com>

Hello Geert,

Thank you for your feedback.

> Subject: Re: [PATCH 3/3] dt-bindings: can: rcar_can: Add r8a774a1 support
>
> Hi Fabrizio,
>
> On Thu, Aug 23, 2018 at 3:08 PM Fabrizio Castro
> <fabrizio.castro@bp.renesas.com> wrote:>
> > Document RZ/G2M (r8a774a1) SoC specific bindings and RZ/G2
> > generic bindings.
> >
> > Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> > Signed-off-by: Chris Paterson <Chris.Paterson2@renesas.com>
> > Reviewed-by: Biju Das <biju.das@bp.renesas.com>
>
> Thanks for your patch!
>
> > --- a/Documentation/devicetree/bindings/net/can/rcar_can.txt
> > +++ b/Documentation/devicetree/bindings/net/can/rcar_can.txt
> > @@ -4,6 +4,7 @@ Renesas R-Car CAN controller Device Tree Bindings
> >  Required properties:
> >  - compatible: "renesas,can-r8a7743" if CAN controller is a part of R8A7743 SoC.
> >               "renesas,can-r8a7745" if CAN controller is a part of R8A7745 SoC.
> > +             "renesas,can-r8a774a1" if CAN controller is a part of R8A774A1 SoC.
>
> Looks good to me.
>
> >               "renesas,can-r8a7778" if CAN controller is a part of R8A7778 SoC.
> >               "renesas,can-r8a7779" if CAN controller is a part of R8A7779 SoC.
> >               "renesas,can-r8a7790" if CAN controller is a part of R8A7790 SoC.
> > @@ -17,6 +18,7 @@ Required properties:
> >               "renesas,rcar-gen2-can" for a generic R-Car Gen2 or RZ/G1
> >               compatible device.
> >               "renesas,rcar-gen3-can" for a generic R-Car Gen3 compatible device.
> > +             "renesas,rzg-gen2-can" for a generic RZ/G2 compatible device.
>
> AFAIK, the actual CAN module in RZ/G2M is fully compatible with the CAN
> module in R-Car Gen3 SoCs. The lack of clkp2 is merely an integration
> difference: as RZ/G2 SoCs do not have the CANFD module, and their CPG block
> doesn't provide the CANFD clock (so the CAN device node in DT cannot refer
> to that clock anyway).
>
> Hence I don't think there's a need to introduce a "renesas,rzg-gen2-can"
> compatible value.

Agreed, will drop RZ/G2 specific compatible string.

>
> >               When compatible with the generic version, nodes must list the
> >               SoC-specific version corresponding to the platform first
> >               followed by the generic version.
> > @@ -24,7 +26,9 @@ Required properties:
> >  - reg: physical base address and size of the R-Car CAN register map.
> >  - interrupts: interrupt specifier for the sole interrupt.
> >  - clocks: phandles and clock specifiers for 3 CAN clock inputs.
>
> You still have "3" here. Perhaps
> "Must contain a phandle and clock-specifier pair for each entry in
> clock-names."?

Good spot, we overlooked it.

>
> > -- clock-names: 3 clock input name strings: "clkp1", "clkp2", "can_clk".
> > +- clock-names: 2 clock input name strings for RZ/G2: "clkp1", "can_clk".
> > +              3 clock input name strings for every other SoC: "clkp1", "clkp2",
> > +              "can_clk".
>
> OK.
>
> > @@ -41,8 +45,9 @@ using the below properties:
> >  Optional properties:
> >  - renesas,can-clock-select: R-Car CAN Clock Source Select. Valid values are:
> >                             <0x0> (default) : Peripheral clock (clkp1)
> > -                           <0x1> : Peripheral clock (clkp2)
> > -                           <0x3> : Externally input clock
> > +                           <0x1> : Peripheral clock (clkp2) (not supported by
> > +                                   RZ/G2 devices)
> > +                           <0x3> : External input clock
>
> I already expressed my feelings about this property in my reply to the first
> patch ;-)

I know, I am not super happy about it either, maybe we will get a proper solution for this at some point in the future.

Thanks,
Fab

>
> Gr{oetje,eeting}s,
>
>                         Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                 -- Linus Torvalds



Renesas Electronics Europe Ltd, Dukes Meadow, Millboard Road, Bourne End, Buckinghamshire, SL8 5FH, UK. Registered in England & Wales under Registered No. 04586709.

^ 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