All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next 00/12] code optimizations & bugfixes for HNS3 driver
@ 2019-04-24  3:21 Huazhong Tan
  2019-04-24  3:21 ` [PATCH net-next 01/12] net: hns3: fix data race between ring->next_to_clean Huazhong Tan
                   ` (12 more replies)
  0 siblings, 13 replies; 35+ messages in thread
From: Huazhong Tan @ 2019-04-24  3:21 UTC (permalink / raw)
  To: davem
  Cc: netdev, linux-kernel, salil.mehta, yisen.zhuang, linuxarm,
	nhorman, Huazhong Tan

This patch-set includes code optimizations and bugfixes for the HNS3
ethernet controller driver.

[patch 1/12 - 3/12] fixes some bugs about the IO path

[patch 4/12 - 6/12] includes some optimization and bugfixes
about mailbox message handling

[patch 7/12 - 12/12] adds misc code optimizations and bugfixes.

Huazhong Tan (7):
  net: hns3: stop sending keep alive msg when VF command queue needs
    reinit
  net: hns3: use atomic_t replace u32 for arq's count
  net: hns3: use a reserved byte to identify need_resp flag
  net: hns3: not reset TQP in the DOWN while VF resetting
  net: hns3: stop schedule reset service while unloading driver
  net: hns3: fix pause configure fail problem
  net: hns3: prevent double free in hns3_put_ring_config()

Weihang Li (1):
  net: hns3: remove reset after command send failed

Yunsheng Lin (3):
  net: hns3: fix data race between ring->next_to_clean
  net: hns3: fix for TX clean num when cleaning TX BD
  net: hns3: handle the BD info on the last BD of the packet

liuzhongzhu (1):
  net: hns3: extend the loopback state acquisition time

 drivers/net/ethernet/hisilicon/hns3/hclge_mbx.h    |  7 ++-
 drivers/net/ethernet/hisilicon/hns3/hns3_enet.c    | 65 +++++++++++++---------
 drivers/net/ethernet/hisilicon/hns3/hns3_enet.h    |  7 ++-
 .../net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c | 10 ----
 .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c    |  8 ++-
 .../net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c |  7 +--
 .../net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c  |  5 +-
 .../ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c   |  2 +-
 .../ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c  | 12 ++--
 .../ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h  |  1 +
 .../ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c   |  9 ++-
 11 files changed, 76 insertions(+), 57 deletions(-)

-- 
2.7.4


^ permalink raw reply	[flat|nested] 35+ messages in thread

* [PATCH net-next 01/12] net: hns3: fix data race between ring->next_to_clean
  2019-04-24  3:21 [PATCH net-next 00/12] code optimizations & bugfixes for HNS3 driver Huazhong Tan
@ 2019-04-24  3:21 ` Huazhong Tan
  2019-04-24  3:21 ` [PATCH net-next 02/12] net: hns3: fix for TX clean num when cleaning TX BD Huazhong Tan
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 35+ messages in thread
From: Huazhong Tan @ 2019-04-24  3:21 UTC (permalink / raw)
  To: davem
  Cc: netdev, linux-kernel, salil.mehta, yisen.zhuang, linuxarm,
	nhorman, Yunsheng Lin, Peng Li, Huazhong Tan

From: Yunsheng Lin <linyunsheng@huawei.com>

hns3_clean_tx_ring calls hns3_nic_reclaim_one_desc to clean
buffers and set ring->next_to_clean, then hns3_nic_net_xmit
reuses the cleaned buffers. But there are no memory barriers
when buffers gets recycled, so the recycled buffers can be
corrupted.

This patch uses smp_store_release to update ring->next_to_clean
and smp_load_acquire to read ring->next_to_clean to properly
hand off buffers from hns3_clean_tx_ring to hns3_nic_net_xmit.

Fixes: 76ad4f0ee747 ("net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC")
Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 14 +++++++++++---
 drivers/net/ethernet/hisilicon/hns3/hns3_enet.h |  7 +++++--
 2 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
index 176d4b9..9fdc87e 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
@@ -2214,14 +2214,22 @@ static void hns3_reuse_buffer(struct hns3_enet_ring *ring, int i)
 static void hns3_nic_reclaim_one_desc(struct hns3_enet_ring *ring, int *bytes,
 				      int *pkts)
 {
-	struct hns3_desc_cb *desc_cb = &ring->desc_cb[ring->next_to_clean];
+	int ntc = ring->next_to_clean;
+	struct hns3_desc_cb *desc_cb;
 
+	desc_cb = &ring->desc_cb[ntc];
 	(*pkts) += (desc_cb->type == DESC_TYPE_SKB);
 	(*bytes) += desc_cb->length;
 	/* desc_cb will be cleaned, after hnae3_free_buffer_detach*/
-	hns3_free_buffer_detach(ring, ring->next_to_clean);
+	hns3_free_buffer_detach(ring, ntc);
 
-	ring_ptr_move_fw(ring, next_to_clean);
+	if (++ntc == ring->desc_num)
+		ntc = 0;
+
+	/* This smp_store_release() pairs with smp_load_acquire() in
+	 * ring_space called by hns3_nic_net_xmit.
+	 */
+	smp_store_release(&ring->next_to_clean, ntc);
 }
 
 static int is_valid_clean_head(struct hns3_enet_ring *ring, int h)
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h
index cec56a5..2b4f5ea 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h
@@ -581,8 +581,11 @@ union l4_hdr_info {
 
 static inline int ring_space(struct hns3_enet_ring *ring)
 {
-	int begin = ring->next_to_clean;
-	int end = ring->next_to_use;
+	/* This smp_load_acquire() pairs with smp_store_release() in
+	 * hns3_nic_reclaim_one_desc called by hns3_clean_tx_ring.
+	 */
+	int begin = smp_load_acquire(&ring->next_to_clean);
+	int end = READ_ONCE(ring->next_to_use);
 
 	return ((end >= begin) ? (ring->desc_num - end + begin) :
 			(begin - end)) - 1;
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH net-next 02/12] net: hns3: fix for TX clean num when cleaning TX BD
  2019-04-24  3:21 [PATCH net-next 00/12] code optimizations & bugfixes for HNS3 driver Huazhong Tan
  2019-04-24  3:21 ` [PATCH net-next 01/12] net: hns3: fix data race between ring->next_to_clean Huazhong Tan
@ 2019-04-24  3:21 ` Huazhong Tan
  2019-04-24  3:21 ` [PATCH net-next 03/12] net: hns3: handle the BD info on the last BD of the packet Huazhong Tan
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 35+ messages in thread
From: Huazhong Tan @ 2019-04-24  3:21 UTC (permalink / raw)
  To: davem
  Cc: netdev, linux-kernel, salil.mehta, yisen.zhuang, linuxarm,
	nhorman, Yunsheng Lin, Peng Li, Huazhong Tan

From: Yunsheng Lin <linyunsheng@huawei.com>

hns3_desc_unused() returns how many BD have been cleaned, but new
buffer has not been attached to them. The register of
HNS3_RING_RX_RING_FBDNUM_REG returns how many BD need allocating new
buffer to or need to cleaned. So the remaining BD need to be clean
is HNS3_RING_RX_RING_FBDNUM_REG - hns3_desc_unused().

Also, new buffer can not attach to the pending BD when the last BD is
not handled, because memcpy has not been done on the first pending BD.

This patch fixes by subtracting the pending BD num from unused_count
after 'HNS3_RING_RX_RING_FBDNUM_REG - unused_count' is used to calculate
the BD bum need to be clean.

Fixes: e55970950556 ("net: hns3: Add handling of GRO Pkts not fully RX'ed in NAPI poll")
Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
index 9fdc87e..6695b94 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
@@ -2874,7 +2874,7 @@ int hns3_clean_rx_ring(
 {
 #define RCB_NOF_ALLOC_RX_BUFF_ONCE 16
 	int recv_pkts, recv_bds, clean_count, err;
-	int unused_count = hns3_desc_unused(ring) - ring->pending_buf;
+	int unused_count = hns3_desc_unused(ring);
 	struct sk_buff *skb = ring->skb;
 	int num;
 
@@ -2883,6 +2883,7 @@ int hns3_clean_rx_ring(
 
 	recv_pkts = 0, recv_bds = 0, clean_count = 0;
 	num -= unused_count;
+	unused_count -= ring->pending_buf;
 
 	while (recv_pkts < budget && recv_bds < num) {
 		/* Reuse or realloc buffers */
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH net-next 03/12] net: hns3: handle the BD info on the last BD of the packet
  2019-04-24  3:21 [PATCH net-next 00/12] code optimizations & bugfixes for HNS3 driver Huazhong Tan
  2019-04-24  3:21 ` [PATCH net-next 01/12] net: hns3: fix data race between ring->next_to_clean Huazhong Tan
  2019-04-24  3:21 ` [PATCH net-next 02/12] net: hns3: fix for TX clean num when cleaning TX BD Huazhong Tan
@ 2019-04-24  3:21 ` Huazhong Tan
  2019-04-24  3:21 ` [PATCH net-next 04/12] net: hns3: stop sending keep alive msg when VF command queue needs reinit Huazhong Tan
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 35+ messages in thread
From: Huazhong Tan @ 2019-04-24  3:21 UTC (permalink / raw)
  To: davem
  Cc: netdev, linux-kernel, salil.mehta, yisen.zhuang, linuxarm,
	nhorman, Yunsheng Lin, Peng Li, Huazhong Tan

From: Yunsheng Lin <linyunsheng@huawei.com>

The bdinfo handled in hns3_handle_bdinfo is only valid on the
last BD of the current packet, currently the bd info may be handled
based on the first BD if the packet has more than two BDs, which
may cause rx error.

This patch fixes it by using the last BD of the current packet in
hns3_handle_bdinfo.

Also, hns3_set_rx_skb_rss_type has used RSS hash value from the last
BD of the current packet, so remove the same last BD calculation in
hns3_set_rx_skb_rss_type and call it from hns3_handle_bdinfo.

Fixes: e55970950556 ("net: hns3: Add handling of GRO Pkts not fully RX'ed in NAPI poll")

Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 38 +++++++++++++------------
 1 file changed, 20 insertions(+), 18 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
index 6695b94..7dc281c 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
@@ -2697,36 +2697,37 @@ static int hns3_set_gro_and_checksum(struct hns3_enet_ring *ring,
 }
 
 static void hns3_set_rx_skb_rss_type(struct hns3_enet_ring *ring,
-				     struct sk_buff *skb)
+				     struct sk_buff *skb, u32 rss_hash)
 {
 	struct hnae3_handle *handle = ring->tqp->handle;
 	enum pkt_hash_types rss_type;
-	struct hns3_desc *desc;
-	int last_bd;
-
-	/* When driver handle the rss type, ring->next_to_clean indicates the
-	 * first descriptor of next packet, need -1 here.
-	 */
-	last_bd = (ring->next_to_clean - 1 + ring->desc_num) % ring->desc_num;
-	desc = &ring->desc[last_bd];
 
-	if (le32_to_cpu(desc->rx.rss_hash))
+	if (rss_hash)
 		rss_type = handle->kinfo.rss_type;
 	else
 		rss_type = PKT_HASH_TYPE_NONE;
 
-	skb_set_hash(skb, le32_to_cpu(desc->rx.rss_hash), rss_type);
+	skb_set_hash(skb, rss_hash, rss_type);
 }
 
-static int hns3_handle_bdinfo(struct hns3_enet_ring *ring, struct sk_buff *skb,
-			      struct hns3_desc *desc)
+static int hns3_handle_bdinfo(struct hns3_enet_ring *ring, struct sk_buff *skb)
 {
 	struct net_device *netdev = ring->tqp->handle->kinfo.netdev;
-	u32 bd_base_info = le32_to_cpu(desc->rx.bd_base_info);
-	u32 l234info = le32_to_cpu(desc->rx.l234_info);
 	enum hns3_pkt_l2t_type l2_frame_type;
+	u32 bd_base_info, l234info;
+	struct hns3_desc *desc;
 	unsigned int len;
-	int ret;
+	int pre_ntc, ret;
+
+	/* bdinfo handled below is only valid on the last BD of the
+	 * current packet, and ring->next_to_clean indicates the first
+	 * descriptor of next packet, so need - 1 below.
+	 */
+	pre_ntc = ring->next_to_clean ? (ring->next_to_clean - 1) :
+					(ring->desc_num - 1);
+	desc = &ring->desc[pre_ntc];
+	bd_base_info = le32_to_cpu(desc->rx.bd_base_info);
+	l234info = le32_to_cpu(desc->rx.l234_info);
 
 	/* Based on hw strategy, the tag offloaded will be stored at
 	 * ot_vlan_tag in two layer tag case, and stored at vlan_tag
@@ -2787,6 +2788,8 @@ static int hns3_handle_bdinfo(struct hns3_enet_ring *ring, struct sk_buff *skb,
 	u64_stats_update_end(&ring->syncp);
 
 	ring->tqp_vector->rx_group.total_bytes += len;
+
+	hns3_set_rx_skb_rss_type(ring, skb, le32_to_cpu(desc->rx.rss_hash));
 	return 0;
 }
 
@@ -2856,14 +2859,13 @@ static int hns3_handle_rx_bd(struct hns3_enet_ring *ring,
 		       ALIGN(ring->pull_len, sizeof(long)));
 	}
 
-	ret = hns3_handle_bdinfo(ring, skb, desc);
+	ret = hns3_handle_bdinfo(ring, skb);
 	if (unlikely(ret)) {
 		dev_kfree_skb_any(skb);
 		return ret;
 	}
 
 	*out_skb = skb;
-	hns3_set_rx_skb_rss_type(ring, skb);
 
 	return 0;
 }
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH net-next 04/12] net: hns3: stop sending keep alive msg when VF command queue needs reinit
  2019-04-24  3:21 [PATCH net-next 00/12] code optimizations & bugfixes for HNS3 driver Huazhong Tan
                   ` (2 preceding siblings ...)
  2019-04-24  3:21 ` [PATCH net-next 03/12] net: hns3: handle the BD info on the last BD of the packet Huazhong Tan
@ 2019-04-24  3:21 ` Huazhong Tan
  2019-04-24  3:22 ` [PATCH net-next 05/12] net: hns3: use atomic_t replace u32 for arq's count Huazhong Tan
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 35+ messages in thread
From: Huazhong Tan @ 2019-04-24  3:21 UTC (permalink / raw)
  To: davem
  Cc: netdev, linux-kernel, salil.mehta, yisen.zhuang, linuxarm,
	nhorman, Huazhong Tan, Peng Li

HCLGEVF_STATE_CMD_DISABLE is more suitable than
HCLGEVF_STATE_RST_HANDLING to stop sending keep alive msg,
since HCLGEVF_STATE_RST_HANDLING only be set when the reset
task is running.

Fixes: c59a85c07e77 ("net: hns3: stop sending keep alive msg to PF when VF is resetting")
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
index f9d98f8..7672cab 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
@@ -1758,7 +1758,7 @@ static void hclgevf_keep_alive_task(struct work_struct *work)
 
 	hdev = container_of(work, struct hclgevf_dev, keep_alive_task);
 
-	if (test_bit(HCLGEVF_STATE_RST_HANDLING, &hdev->state))
+	if (test_bit(HCLGEVF_STATE_CMD_DISABLE, &hdev->state))
 		return;
 
 	ret = hclgevf_send_mbx_msg(hdev, HCLGE_MBX_KEEP_ALIVE, 0, NULL,
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH net-next 05/12] net: hns3: use atomic_t replace u32 for arq's count
  2019-04-24  3:21 [PATCH net-next 00/12] code optimizations & bugfixes for HNS3 driver Huazhong Tan
                   ` (3 preceding siblings ...)
  2019-04-24  3:21 ` [PATCH net-next 04/12] net: hns3: stop sending keep alive msg when VF command queue needs reinit Huazhong Tan
@ 2019-04-24  3:22 ` Huazhong Tan
  2019-04-24  3:22 ` [PATCH net-next 06/12] net: hns3: use a reserved byte to identify need_resp flag Huazhong Tan
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 35+ messages in thread
From: Huazhong Tan @ 2019-04-24  3:22 UTC (permalink / raw)
  To: davem
  Cc: netdev, linux-kernel, salil.mehta, yisen.zhuang, linuxarm,
	nhorman, Huazhong Tan, Peng Li

Since irq handler and mailbox task will both update arq's count,
so arq's count should use atomic_t instead of u32, otherwise
its value may go wrong finally.

Fixes: 07a0556a3a73 ("net: hns3: Changes to support ARQ(Asynchronous Receive Queue)")
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hclge_mbx.h          | 2 +-
 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c | 2 +-
 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c | 7 ++++---
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hclge_mbx.h b/drivers/net/ethernet/hisilicon/hns3/hclge_mbx.h
index 360463a..8b6191f 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hclge_mbx.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hclge_mbx.h
@@ -111,7 +111,7 @@ struct hclgevf_mbx_arq_ring {
 	struct hclgevf_dev *hdev;
 	u32 head;
 	u32 tail;
-	u32 count;
+	atomic_t count;
 	u16 msg_q[HCLGE_MBX_MAX_ARQ_MSG_NUM][HCLGE_MBX_MAX_ARQ_MSG_SIZE];
 };
 
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c
index 1b428d4..71f356f 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c
@@ -340,7 +340,7 @@ int hclgevf_cmd_init(struct hclgevf_dev *hdev)
 	hdev->arq.hdev = hdev;
 	hdev->arq.head = 0;
 	hdev->arq.tail = 0;
-	hdev->arq.count = 0;
+	atomic_set(&hdev->arq.count, 0);
 	hdev->hw.cmq.csq.next_to_clean = 0;
 	hdev->hw.cmq.csq.next_to_use = 0;
 	hdev->hw.cmq.crq.next_to_clean = 0;
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c
index eb56287..3c22639 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c
@@ -212,7 +212,8 @@ void hclgevf_mbx_handler(struct hclgevf_dev *hdev)
 			/* we will drop the async msg if we find ARQ as full
 			 * and continue with next message
 			 */
-			if (hdev->arq.count >= HCLGE_MBX_MAX_ARQ_MSG_NUM) {
+			if (atomic_read(&hdev->arq.count) >=
+			    HCLGE_MBX_MAX_ARQ_MSG_NUM) {
 				dev_warn(&hdev->pdev->dev,
 					 "Async Q full, dropping msg(%d)\n",
 					 req->msg[1]);
@@ -224,7 +225,7 @@ void hclgevf_mbx_handler(struct hclgevf_dev *hdev)
 			memcpy(&msg_q[0], req->msg,
 			       HCLGE_MBX_MAX_ARQ_MSG_SIZE * sizeof(u16));
 			hclge_mbx_tail_ptr_move_arq(hdev->arq);
-			hdev->arq.count++;
+			atomic_inc(&hdev->arq.count);
 
 			hclgevf_mbx_task_schedule(hdev);
 
@@ -317,7 +318,7 @@ void hclgevf_mbx_async_handler(struct hclgevf_dev *hdev)
 		}
 
 		hclge_mbx_head_ptr_move_arq(hdev->arq);
-		hdev->arq.count--;
+		atomic_dec(&hdev->arq.count);
 		msg_q = hdev->arq.msg_q[hdev->arq.head];
 	}
 }
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH net-next 06/12] net: hns3: use a reserved byte to identify need_resp flag
  2019-04-24  3:21 [PATCH net-next 00/12] code optimizations & bugfixes for HNS3 driver Huazhong Tan
                   ` (4 preceding siblings ...)
  2019-04-24  3:22 ` [PATCH net-next 05/12] net: hns3: use atomic_t replace u32 for arq's count Huazhong Tan
@ 2019-04-24  3:22 ` Huazhong Tan
  2019-04-24  3:22 ` [PATCH net-next 07/12] net: hns3: not reset TQP in the DOWN while VF resetting Huazhong Tan
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 35+ messages in thread
From: Huazhong Tan @ 2019-04-24  3:22 UTC (permalink / raw)
  To: davem
  Cc: netdev, linux-kernel, salil.mehta, yisen.zhuang, linuxarm,
	nhorman, Huazhong Tan, Peng Li

This patch uses a reserved byte in the hclge_mbx_vf_to_pf_cmd
to save the need_resp flag, so when PF received the mailbox,
it can use it to decise whether send a response to VF.

For hclge_set_vf_uc_mac_addr(), it should use mbx_need_resp flag
to decide whether send response to VF.

Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hclge_mbx.h          | 5 ++++-
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c   | 7 +++----
 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c | 2 ++
 3 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hclge_mbx.h b/drivers/net/ethernet/hisilicon/hns3/hclge_mbx.h
index 8b6191f..83e19c6 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hclge_mbx.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hclge_mbx.h
@@ -84,12 +84,15 @@ struct hclgevf_mbx_resp_status {
 struct hclge_mbx_vf_to_pf_cmd {
 	u8 rsv;
 	u8 mbx_src_vfid; /* Auto filled by IMP */
-	u8 rsv1[2];
+	u8 mbx_need_resp;
+	u8 rsv1[1];
 	u8 msg_len;
 	u8 rsv2[3];
 	u8 msg[HCLGE_MBX_MAX_MSG_SIZE];
 };
 
+#define HCLGE_MBX_NEED_RESP_BIT		BIT(0)
+
 struct hclge_mbx_pf_to_vf_cmd {
 	u8 dest_vfid;
 	u8 rsv[3];
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c
index 24386bd..fe48c56 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c
@@ -212,8 +212,7 @@ static int hclge_set_vf_promisc_mode(struct hclge_vport *vport,
 }
 
 static int hclge_set_vf_uc_mac_addr(struct hclge_vport *vport,
-				    struct hclge_mbx_vf_to_pf_cmd *mbx_req,
-				    bool gen_resp)
+				    struct hclge_mbx_vf_to_pf_cmd *mbx_req)
 {
 	const u8 *mac_addr = (const u8 *)(&mbx_req->msg[2]);
 	struct hclge_dev *hdev = vport->back;
@@ -249,7 +248,7 @@ static int hclge_set_vf_uc_mac_addr(struct hclge_vport *vport,
 		return -EIO;
 	}
 
-	if (gen_resp)
+	if (mbx_req->mbx_need_resp & HCLGE_MBX_NEED_RESP_BIT)
 		hclge_gen_resp_to_vf(vport, mbx_req, status, NULL, 0);
 
 	return 0;
@@ -597,7 +596,7 @@ void hclge_mbx_handler(struct hclge_dev *hdev)
 					ret);
 			break;
 		case HCLGE_MBX_SET_UNICAST:
-			ret = hclge_set_vf_uc_mac_addr(vport, req, true);
+			ret = hclge_set_vf_uc_mac_addr(vport, req);
 			if (ret)
 				dev_err(&hdev->pdev->dev,
 					"PF fail(%d) to set VF UC MAC Addr\n",
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c
index 3c22639..30f2e93 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c
@@ -98,6 +98,8 @@ int hclgevf_send_mbx_msg(struct hclgevf_dev *hdev, u16 code, u16 subcode,
 	}
 
 	hclgevf_cmd_setup_basic_desc(&desc, HCLGEVF_OPC_MBX_VF_TO_PF, false);
+	req->mbx_need_resp |= need_resp ? HCLGE_MBX_NEED_RESP_BIT :
+					  ~HCLGE_MBX_NEED_RESP_BIT;
 	req->msg[0] = code;
 	req->msg[1] = subcode;
 	memcpy(&req->msg[2], msg_data, msg_len);
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH net-next 07/12] net: hns3: not reset TQP in the DOWN while VF resetting
  2019-04-24  3:21 [PATCH net-next 00/12] code optimizations & bugfixes for HNS3 driver Huazhong Tan
                   ` (5 preceding siblings ...)
  2019-04-24  3:22 ` [PATCH net-next 06/12] net: hns3: use a reserved byte to identify need_resp flag Huazhong Tan
@ 2019-04-24  3:22 ` Huazhong Tan
  2019-04-24  3:22 ` [PATCH net-next 08/12] net: hns3: stop schedule reset service while unloading driver Huazhong Tan
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 35+ messages in thread
From: Huazhong Tan @ 2019-04-24  3:22 UTC (permalink / raw)
  To: davem
  Cc: netdev, linux-kernel, salil.mehta, yisen.zhuang, linuxarm,
	nhorman, Huazhong Tan, Peng Li

Since the hardware does not handle mailboxes and the hardware
reset include TQP reset, so it is unnecessary to reset TQP
in the hclgevf_ae_stop() while doing VF reset. Also it is
unnecessary to reset the remaining TQP when one reset fails.

Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
index 7672cab..6ce5b03 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
@@ -2050,8 +2050,10 @@ static void hclgevf_ae_stop(struct hnae3_handle *handle)
 
 	set_bit(HCLGEVF_STATE_DOWN, &hdev->state);
 
-	for (i = 0; i < handle->kinfo.num_tqps; i++)
-		hclgevf_reset_tqp(handle, i);
+	if (hdev->reset_type != HNAE3_VF_RESET)
+		for (i = 0; i < handle->kinfo.num_tqps; i++)
+			if (hclgevf_reset_tqp(handle, i))
+				break;
 
 	/* reset tqp stats */
 	hclgevf_reset_tqp_stats(handle);
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH net-next 08/12] net: hns3: stop schedule reset service while unloading driver
  2019-04-24  3:21 [PATCH net-next 00/12] code optimizations & bugfixes for HNS3 driver Huazhong Tan
                   ` (6 preceding siblings ...)
  2019-04-24  3:22 ` [PATCH net-next 07/12] net: hns3: not reset TQP in the DOWN while VF resetting Huazhong Tan
@ 2019-04-24  3:22 ` Huazhong Tan
  2019-04-24  3:22 ` [PATCH net-next 09/12] net: hns3: fix pause configure fail problem Huazhong Tan
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 35+ messages in thread
From: Huazhong Tan @ 2019-04-24  3:22 UTC (permalink / raw)
  To: davem
  Cc: netdev, linux-kernel, salil.mehta, yisen.zhuang, linuxarm,
	nhorman, Huazhong Tan, Peng Li

This patch uses HCLGE_STATE_REMOVING/HCLGEVF_STATE_REMOVING flag to
indicate that the driver is unloading, and we should stop new coming
reset service to be scheduled, otherwise, reset service will access
some resource which has been freed by unloading.

Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c   | 4 +++-
 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 4 +++-
 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h | 1 +
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
index 4d5568e..ead8308 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
@@ -2175,7 +2175,8 @@ static void hclge_mbx_task_schedule(struct hclge_dev *hdev)
 
 static void hclge_reset_task_schedule(struct hclge_dev *hdev)
 {
-	if (!test_and_set_bit(HCLGE_STATE_RST_SERVICE_SCHED, &hdev->state))
+	if (!test_bit(HCLGE_STATE_REMOVING, &hdev->state) &&
+	    !test_and_set_bit(HCLGE_STATE_RST_SERVICE_SCHED, &hdev->state))
 		schedule_work(&hdev->rst_service_task);
 }
 
@@ -7768,6 +7769,7 @@ static void hclge_state_init(struct hclge_dev *hdev)
 static void hclge_state_uninit(struct hclge_dev *hdev)
 {
 	set_bit(HCLGE_STATE_DOWN, &hdev->state);
+	set_bit(HCLGE_STATE_REMOVING, &hdev->state);
 
 	if (hdev->service_timer.function)
 		del_timer_sync(&hdev->service_timer);
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
index 6ce5b03..f0de528 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
@@ -1611,7 +1611,8 @@ static void hclgevf_get_misc_vector(struct hclgevf_dev *hdev)
 
 void hclgevf_reset_task_schedule(struct hclgevf_dev *hdev)
 {
-	if (!test_bit(HCLGEVF_STATE_RST_SERVICE_SCHED, &hdev->state)) {
+	if (!test_bit(HCLGEVF_STATE_RST_SERVICE_SCHED, &hdev->state) &&
+	    !test_bit(HCLGEVF_STATE_REMOVING, &hdev->state)) {
 		set_bit(HCLGEVF_STATE_RST_SERVICE_SCHED, &hdev->state);
 		schedule_work(&hdev->rst_service_task);
 	}
@@ -2049,6 +2050,7 @@ static void hclgevf_ae_stop(struct hnae3_handle *handle)
 	int i;
 
 	set_bit(HCLGEVF_STATE_DOWN, &hdev->state);
+	set_bit(HCLGEVF_STATE_REMOVING, &hdev->state);
 
 	if (hdev->reset_type != HNAE3_VF_RESET)
 		for (i = 0; i < handle->kinfo.num_tqps; i++)
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h
index ee3a6cb..0cceda3 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h
@@ -130,6 +130,7 @@ enum hclgevf_states {
 	HCLGEVF_STATE_DOWN,
 	HCLGEVF_STATE_DISABLED,
 	HCLGEVF_STATE_IRQ_INITED,
+	HCLGEVF_STATE_REMOVING,
 	/* task states */
 	HCLGEVF_STATE_SERVICE_SCHED,
 	HCLGEVF_STATE_RST_SERVICE_SCHED,
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH net-next 09/12] net: hns3: fix pause configure fail problem
  2019-04-24  3:21 [PATCH net-next 00/12] code optimizations & bugfixes for HNS3 driver Huazhong Tan
                   ` (7 preceding siblings ...)
  2019-04-24  3:22 ` [PATCH net-next 08/12] net: hns3: stop schedule reset service while unloading driver Huazhong Tan
@ 2019-04-24  3:22 ` Huazhong Tan
  2019-04-24  3:22 ` [PATCH net-next 10/12] net: hns3: extend the loopback state acquisition time Huazhong Tan
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 35+ messages in thread
From: Huazhong Tan @ 2019-04-24  3:22 UTC (permalink / raw)
  To: davem
  Cc: netdev, linux-kernel, salil.mehta, yisen.zhuang, linuxarm,
	nhorman, Huazhong Tan, Peng Li

When configure pause, current implementation returns directly
after setup PFC without setup BP, which is not sufficient.

So this patch fixes it, only return while setting PFC failed.

Fixes: 44e59e375bf7 ("net: hns3: do not return GE PFC setting err when initializing")
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c
index aafc69f..a7bbb6d 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c
@@ -1331,8 +1331,11 @@ int hclge_pause_setup_hw(struct hclge_dev *hdev, bool init)
 	ret = hclge_pfc_setup_hw(hdev);
 	if (init && ret == -EOPNOTSUPP)
 		dev_warn(&hdev->pdev->dev, "GE MAC does not support pfc\n");
-	else
+	else if (ret) {
+		dev_err(&hdev->pdev->dev, "config pfc failed! ret = %d\n",
+			ret);
 		return ret;
+	}
 
 	return hclge_tm_bp_setup(hdev);
 }
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH net-next 10/12] net: hns3: extend the loopback state acquisition time
  2019-04-24  3:21 [PATCH net-next 00/12] code optimizations & bugfixes for HNS3 driver Huazhong Tan
                   ` (8 preceding siblings ...)
  2019-04-24  3:22 ` [PATCH net-next 09/12] net: hns3: fix pause configure fail problem Huazhong Tan
@ 2019-04-24  3:22 ` Huazhong Tan
  2019-04-24  3:22 ` [PATCH net-next 11/12] net: hns3: prevent double free in hns3_put_ring_config() Huazhong Tan
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 35+ messages in thread
From: Huazhong Tan @ 2019-04-24  3:22 UTC (permalink / raw)
  To: davem
  Cc: netdev, linux-kernel, salil.mehta, yisen.zhuang, linuxarm,
	nhorman, liuzhongzhu, Peng Li, Huazhong Tan

From: liuzhongzhu <liuzhongzhu@huawei.com>

The test results show that the maximum time of hardware return
to mac link state is 500MS.The software needs to set twice the
maximum time of hardware return state (1000MS).

If not modified, the loopback test returns probability failure.

Signed-off-by: liuzhongzhu <liuzhongzhu@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
index ead8308..22afd75 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
@@ -5338,8 +5338,8 @@ static int hclge_set_serdes_loopback(struct hclge_dev *hdev, bool en,
 #define HCLGE_SERDES_RETRY_MS	10
 #define HCLGE_SERDES_RETRY_NUM	100
 
-#define HCLGE_MAC_LINK_STATUS_MS   20
-#define HCLGE_MAC_LINK_STATUS_NUM  10
+#define HCLGE_MAC_LINK_STATUS_MS   10
+#define HCLGE_MAC_LINK_STATUS_NUM  100
 #define HCLGE_MAC_LINK_STATUS_DOWN 0
 #define HCLGE_MAC_LINK_STATUS_UP   1
 
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH net-next 11/12] net: hns3: prevent double free in hns3_put_ring_config()
  2019-04-24  3:21 [PATCH net-next 00/12] code optimizations & bugfixes for HNS3 driver Huazhong Tan
                   ` (9 preceding siblings ...)
  2019-04-24  3:22 ` [PATCH net-next 10/12] net: hns3: extend the loopback state acquisition time Huazhong Tan
@ 2019-04-24  3:22 ` Huazhong Tan
  2019-04-24  3:22 ` [PATCH net-next 12/12] net: hns3: remove reset after command send failed Huazhong Tan
  2019-04-24  6:27 ` [PATCH net-next 00/12] code optimizations & bugfixes for HNS3 driver tanhuazhong
  12 siblings, 0 replies; 35+ messages in thread
From: Huazhong Tan @ 2019-04-24  3:22 UTC (permalink / raw)
  To: davem
  Cc: netdev, linux-kernel, salil.mehta, yisen.zhuang, linuxarm,
	nhorman, Huazhong Tan, Peng Li

This patch adds a check for the hns3_put_ring_config() to prevent
double free, and for more readable, move the NULL assignment of
priv->ring_data into the hns3_put_ring_config().

Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
index 7dc281c..b0f31eb 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
@@ -3487,6 +3487,7 @@ static int hns3_get_ring_config(struct hns3_nic_priv *priv)
 	}
 
 	devm_kfree(&pdev->dev, priv->ring_data);
+	priv->ring_data = NULL;
 	return ret;
 }
 
@@ -3495,12 +3496,16 @@ static void hns3_put_ring_config(struct hns3_nic_priv *priv)
 	struct hnae3_handle *h = priv->ae_handle;
 	int i;
 
+	if (!priv->ring_data)
+		return;
+
 	for (i = 0; i < h->kinfo.num_tqps; i++) {
 		devm_kfree(priv->dev, priv->ring_data[i].ring);
 		devm_kfree(priv->dev,
 			   priv->ring_data[i + h->kinfo.num_tqps].ring);
 	}
 	devm_kfree(priv->dev, priv->ring_data);
+	priv->ring_data = NULL;
 }
 
 static int hns3_alloc_ring_memory(struct hns3_enet_ring *ring)
@@ -3920,8 +3925,6 @@ static void hns3_client_uninit(struct hnae3_handle *handle, bool reset)
 
 	hns3_dbg_uninit(handle);
 
-	priv->ring_data = NULL;
-
 out_netdev_free:
 	free_netdev(netdev);
 }
@@ -4268,12 +4271,10 @@ static int hns3_reset_notify_init_enet(struct hnae3_handle *handle)
 	hns3_uninit_all_ring(priv);
 err_uninit_vector:
 	hns3_nic_uninit_vector_data(priv);
-	priv->ring_data = NULL;
 err_dealloc_vector:
 	hns3_nic_dealloc_vector_data(priv);
 err_put_ring:
 	hns3_put_ring_config(priv);
-	priv->ring_data = NULL;
 
 	return ret;
 }
@@ -4335,7 +4336,6 @@ static int hns3_reset_notify_uninit_enet(struct hnae3_handle *handle)
 		netdev_err(netdev, "uninit ring error\n");
 
 	hns3_put_ring_config(priv);
-	priv->ring_data = NULL;
 
 	return ret;
 }
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH net-next 12/12] net: hns3: remove reset after command send failed
  2019-04-24  3:21 [PATCH net-next 00/12] code optimizations & bugfixes for HNS3 driver Huazhong Tan
                   ` (10 preceding siblings ...)
  2019-04-24  3:22 ` [PATCH net-next 11/12] net: hns3: prevent double free in hns3_put_ring_config() Huazhong Tan
@ 2019-04-24  3:22 ` Huazhong Tan
  2019-04-24  6:27 ` [PATCH net-next 00/12] code optimizations & bugfixes for HNS3 driver tanhuazhong
  12 siblings, 0 replies; 35+ messages in thread
From: Huazhong Tan @ 2019-04-24  3:22 UTC (permalink / raw)
  To: davem
  Cc: netdev, linux-kernel, salil.mehta, yisen.zhuang, linuxarm,
	nhorman, Weihang Li, Peng Li, Huazhong Tan

From: Weihang Li <liweihang@hisilicon.com>

It's meaningless to trigger reset when failed to send command to IMP,
because the failure is usually caused by no authority, illegal command
and so on. When that happened, we just need to return the status code
for further debugging.

Signed-off-by: Weihang Li <liweihang@hisilicon.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c
index 804c870..4ac8063 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c
@@ -1653,8 +1653,6 @@ int hclge_handle_hw_msix_error(struct hclge_dev *hdev,
 	if (ret) {
 		dev_err(dev, "fail(%d) to query msix int status bd num\n",
 			ret);
-		/* reset everything for now */
-		set_bit(HNAE3_GLOBAL_RESET, reset_requests);
 		return ret;
 	}
 
@@ -1675,8 +1673,6 @@ int hclge_handle_hw_msix_error(struct hclge_dev *hdev,
 	if (ret) {
 		dev_err(dev, "query all mpf msix int cmd failed (%d)\n",
 			ret);
-		/* reset everything for now */
-		set_bit(HNAE3_GLOBAL_RESET, reset_requests);
 		goto msi_error;
 	}
 
@@ -1710,8 +1706,6 @@ int hclge_handle_hw_msix_error(struct hclge_dev *hdev,
 	if (ret) {
 		dev_err(dev, "clear all mpf msix int cmd failed (%d)\n",
 			ret);
-		/* reset everything for now */
-		set_bit(HNAE3_GLOBAL_RESET, reset_requests);
 		goto msi_error;
 	}
 
@@ -1725,8 +1719,6 @@ int hclge_handle_hw_msix_error(struct hclge_dev *hdev,
 	if (ret) {
 		dev_err(dev, "query all pf msix int cmd failed (%d)\n",
 			ret);
-		/* reset everything for now */
-		set_bit(HNAE3_GLOBAL_RESET, reset_requests);
 		goto msi_error;
 	}
 
@@ -1767,8 +1759,6 @@ int hclge_handle_hw_msix_error(struct hclge_dev *hdev,
 	if (ret) {
 		dev_err(dev, "clear all pf msix int cmd failed (%d)\n",
 			ret);
-		/* reset everything for now */
-		set_bit(HNAE3_GLOBAL_RESET, reset_requests);
 	}
 
 	/* query and clear mac tnl interruptions */
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* Re: [PATCH net-next 00/12] code optimizations & bugfixes for HNS3 driver
  2019-04-24  3:21 [PATCH net-next 00/12] code optimizations & bugfixes for HNS3 driver Huazhong Tan
                   ` (11 preceding siblings ...)
  2019-04-24  3:22 ` [PATCH net-next 12/12] net: hns3: remove reset after command send failed Huazhong Tan
@ 2019-04-24  6:27 ` tanhuazhong
  12 siblings, 0 replies; 35+ messages in thread
From: tanhuazhong @ 2019-04-24  6:27 UTC (permalink / raw)
  To: davem; +Cc: netdev, linux-kernel, salil.mehta, yisen.zhuang, linuxarm, nhorman

Sorry, please ignore this patchset. I will send V2 to fix something else.

On 2019/4/24 11:21, Huazhong Tan wrote:
> This patch-set includes code optimizations and bugfixes for the HNS3
> ethernet controller driver.
> 
> [patch 1/12 - 3/12] fixes some bugs about the IO path
> 
> [patch 4/12 - 6/12] includes some optimization and bugfixes
> about mailbox message handling
> 
> [patch 7/12 - 12/12] adds misc code optimizations and bugfixes.
> 
> Huazhong Tan (7):
>    net: hns3: stop sending keep alive msg when VF command queue needs
>      reinit
>    net: hns3: use atomic_t replace u32 for arq's count
>    net: hns3: use a reserved byte to identify need_resp flag
>    net: hns3: not reset TQP in the DOWN while VF resetting
>    net: hns3: stop schedule reset service while unloading driver
>    net: hns3: fix pause configure fail problem
>    net: hns3: prevent double free in hns3_put_ring_config()
> 
> Weihang Li (1):
>    net: hns3: remove reset after command send failed
> 
> Yunsheng Lin (3):
>    net: hns3: fix data race between ring->next_to_clean
>    net: hns3: fix for TX clean num when cleaning TX BD
>    net: hns3: handle the BD info on the last BD of the packet
> 
> liuzhongzhu (1):
>    net: hns3: extend the loopback state acquisition time
> 
>   drivers/net/ethernet/hisilicon/hns3/hclge_mbx.h    |  7 ++-
>   drivers/net/ethernet/hisilicon/hns3/hns3_enet.c    | 65 +++++++++++++---------
>   drivers/net/ethernet/hisilicon/hns3/hns3_enet.h    |  7 ++-
>   .../net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c | 10 ----
>   .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c    |  8 ++-
>   .../net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c |  7 +--
>   .../net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c  |  5 +-
>   .../ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c   |  2 +-
>   .../ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c  | 12 ++--
>   .../ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h  |  1 +
>   .../ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c   |  9 ++-
>   11 files changed, 76 insertions(+), 57 deletions(-)
> 


^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH net-next 00/12] code optimizations & bugfixes for HNS3 driver
  2019-06-01  0:18   ` David Miller
@ 2019-06-03  1:42     ` tanhuazhong
  0 siblings, 0 replies; 35+ messages in thread
From: tanhuazhong @ 2019-06-03  1:42 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, linux-kernel, salil.mehta, yisen.zhuang, linuxarm



On 2019/6/1 8:18, David Miller wrote:
> From: David Miller <davem@davemloft.net>
> Date: Fri, 31 May 2019 17:15:29 -0700 (PDT)
> 
>> From: Huazhong Tan <tanhuazhong@huawei.com>
>> Date: Fri, 31 May 2019 16:54:46 +0800
>>
>>> This patch-set includes code optimizations and bugfixes for the HNS3
>>> ethernet controller driver.
>>>
>>> [patch 1/12] removes the redundant core reset type
>>>
>>> [patch 2/12 - 3/12] fixes two VLAN related issues
>>>
>>> [patch 4/12] fixes a TM issue
>>>
>>> [patch 5/12 - 12/12] includes some patches related to RAS & MSI-X error
>>
>> Series applied.
> 
> I reverted, you need to actually build test the infiniband side of your
> driver.
> 
> drivers/infiniband/hw/hns/hns_roce_hw_v2.c: In function ‘hns_roce_v2_msix_interrupt_abn’:
> drivers/infiniband/hw/hns/hns_roce_hw_v2.c:5032:14: warning: passing argument 2 of ‘ops->set_default_reset_request’ makes pointer from integer without a cast [-Wint-conversion]
>                HNAE3_FUNC_RESET);
>                ^~~~~~~~~~~~~~~~
> drivers/infiniband/hw/hns/hns_roce_hw_v2.c:5032:14: note: expected ‘long unsigned int *’ but argument is of type ‘int’
>    C-c C-cmake[5]: *** Deleting file 'drivers/net/wireless/ath/carl9170/cmd.o'
> 

Sorry, I will remove [10/12 - 11/12] for V2, these two patches needs to 
modify HNS's infiniband driver at the same time, so they will be 
upstreamed later with the infiniband's one.


^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH net-next 00/12] code optimizations & bugfixes for HNS3 driver
  2019-06-01  0:15 ` David Miller
@ 2019-06-01  0:18   ` David Miller
  2019-06-03  1:42     ` tanhuazhong
  0 siblings, 1 reply; 35+ messages in thread
From: David Miller @ 2019-06-01  0:18 UTC (permalink / raw)
  To: tanhuazhong; +Cc: netdev, linux-kernel, salil.mehta, yisen.zhuang, linuxarm

From: David Miller <davem@davemloft.net>
Date: Fri, 31 May 2019 17:15:29 -0700 (PDT)

> From: Huazhong Tan <tanhuazhong@huawei.com>
> Date: Fri, 31 May 2019 16:54:46 +0800
> 
>> This patch-set includes code optimizations and bugfixes for the HNS3
>> ethernet controller driver.
>> 
>> [patch 1/12] removes the redundant core reset type
>> 
>> [patch 2/12 - 3/12] fixes two VLAN related issues
>> 
>> [patch 4/12] fixes a TM issue
>> 
>> [patch 5/12 - 12/12] includes some patches related to RAS & MSI-X error
> 
> Series applied.

I reverted, you need to actually build test the infiniband side of your
driver.

drivers/infiniband/hw/hns/hns_roce_hw_v2.c: In function ‘hns_roce_v2_msix_interrupt_abn’:
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:5032:14: warning: passing argument 2 of ‘ops->set_default_reset_request’ makes pointer from integer without a cast [-Wint-conversion]
              HNAE3_FUNC_RESET);
              ^~~~~~~~~~~~~~~~
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:5032:14: note: expected ‘long unsigned int *’ but argument is of type ‘int’
  C-c C-cmake[5]: *** Deleting file 'drivers/net/wireless/ath/carl9170/cmd.o'

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH net-next 00/12] code optimizations & bugfixes for HNS3 driver
  2019-05-31  8:54 Huazhong Tan
@ 2019-06-01  0:15 ` David Miller
  2019-06-01  0:18   ` David Miller
  0 siblings, 1 reply; 35+ messages in thread
From: David Miller @ 2019-06-01  0:15 UTC (permalink / raw)
  To: tanhuazhong; +Cc: netdev, linux-kernel, salil.mehta, yisen.zhuang, linuxarm

From: Huazhong Tan <tanhuazhong@huawei.com>
Date: Fri, 31 May 2019 16:54:46 +0800

> This patch-set includes code optimizations and bugfixes for the HNS3
> ethernet controller driver.
> 
> [patch 1/12] removes the redundant core reset type
> 
> [patch 2/12 - 3/12] fixes two VLAN related issues
> 
> [patch 4/12] fixes a TM issue
> 
> [patch 5/12 - 12/12] includes some patches related to RAS & MSI-X error

Series applied.

^ permalink raw reply	[flat|nested] 35+ messages in thread

* [PATCH net-next 00/12] code optimizations & bugfixes for HNS3 driver
@ 2019-05-31  8:54 Huazhong Tan
  2019-06-01  0:15 ` David Miller
  0 siblings, 1 reply; 35+ messages in thread
From: Huazhong Tan @ 2019-05-31  8:54 UTC (permalink / raw)
  To: davem
  Cc: netdev, linux-kernel, salil.mehta, yisen.zhuang, linuxarm, Huazhong Tan

This patch-set includes code optimizations and bugfixes for the HNS3
ethernet controller driver.

[patch 1/12] removes the redundant core reset type

[patch 2/12 - 3/12] fixes two VLAN related issues

[patch 4/12] fixes a TM issue

[patch 5/12 - 12/12] includes some patches related to RAS & MSI-X error

Huazhong Tan (1):
  net: hns3: remove redundant core reset

Jian Shen (2):
  net: hns3: don't configure new VLAN ID into VF VLAN table when it's
    full
  net: hns3: fix VLAN filter restore issue after reset

Shiju Jose (2):
  net: hns3: delay setting of reset level for HW errors until slot_reset
    is called
  net: hns3: fix avoid unnecessary resetting for the H/W errors which do
    not require reset

Weihang Li (6):
  net: hns3: add a check to pointer in error_detected and slot_reset
  net: hns3: set ops to null when unregister ad_dev
  net: hns3: add handling of two bits in MAC tunnel interrupts
  net: hns3: remove setting bit of reset_requests when handling mac
    tunnel interrupts
  net: hns3: add opcode about query and clear RAS & MSI-X to special
    opcode
  net: hns3: delay and separate enabling of NIC and ROCE HW errors

Yunsheng Lin (1):
  net: hns3: set the port shaper according to MAC speed

 drivers/net/ethernet/hisilicon/hns3/hnae3.c        |   2 +
 drivers/net/ethernet/hisilicon/hns3/hnae3.h        |  10 +-
 drivers/net/ethernet/hisilicon/hns3/hns3_enet.c    |  55 +---
 drivers/net/ethernet/hisilicon/hns3/hns3_enet.h    |   1 -
 .../net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c |   6 +-
 .../ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c |   2 +-
 .../net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c | 351 ++++++++-------------
 .../net/ethernet/hisilicon/hns3/hns3pf/hclge_err.h |   9 +-
 .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c    | 137 +++++---
 .../ethernet/hisilicon/hns3/hns3pf/hclge_main.h    |   1 +
 .../net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c  |   2 +-
 .../ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c  |  12 +-
 12 files changed, 268 insertions(+), 320 deletions(-)

-- 
2.7.4


^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH net-next 00/12] code optimizations & bugfixes for HNS3 driver
  2019-05-28  9:02 Huazhong Tan
@ 2019-05-29  0:39 ` David Miller
  0 siblings, 0 replies; 35+ messages in thread
From: David Miller @ 2019-05-29  0:39 UTC (permalink / raw)
  To: tanhuazhong; +Cc: netdev, linux-kernel, salil.mehta, yisen.zhuang, linuxarm

From: Huazhong Tan <tanhuazhong@huawei.com>
Date: Tue, 28 May 2019 17:02:50 +0800

> This patch-set includes code optimizations and bugfixes for the HNS3
> ethernet controller driver.
> 
> [patch 1/12] fixes a compile warning reported by kbuild test robot.
> 
> [patch 2/12] fixes HNS3_RXD_GRO_SIZE_M macro definition error.
> 
> [patch 3/12] adds a debugfs command to dump firmware information.
> 
> [patch 4/12 - 10/12] adds some code optimizaions and cleanups for
> reset and driver unloading.
> 
> [patch 11/12 - 12/12] adds two bugfixes.

Series applied, thanks.

^ permalink raw reply	[flat|nested] 35+ messages in thread

* [PATCH net-next 00/12] code optimizations & bugfixes for HNS3 driver
@ 2019-05-28  9:02 Huazhong Tan
  2019-05-29  0:39 ` David Miller
  0 siblings, 1 reply; 35+ messages in thread
From: Huazhong Tan @ 2019-05-28  9:02 UTC (permalink / raw)
  To: davem
  Cc: netdev, linux-kernel, salil.mehta, yisen.zhuang, linuxarm, Huazhong Tan

This patch-set includes code optimizations and bugfixes for the HNS3
ethernet controller driver.

[patch 1/12] fixes a compile warning reported by kbuild test robot.

[patch 2/12] fixes HNS3_RXD_GRO_SIZE_M macro definition error.

[patch 3/12] adds a debugfs command to dump firmware information.

[patch 4/12 - 10/12] adds some code optimizaions and cleanups for
reset and driver unloading.

[patch 11/12 - 12/12] adds two bugfixes.

Huazhong Tan (9):
  net: hns3: use HCLGE_STATE_NIC_REGISTERED to indicate PF NIC client
    has registered
  net: hns3: use HCLGE_STATE_ROCE_REGISTERED to indicate PF ROCE client
    has registered
  net: hns3: use HCLGEVF_STATE_NIC_REGISTERED to indicate VF NIC client
    has registered
  net: hns3: modify hclge_init_client_instance()
  net: hns3: modify hclgevf_init_client_instance()
  net: hns3: add handshake with hardware while doing reset
  net: hns3: stop schedule reset service while unloading driver
  net: hns3: adjust hns3_uninit_phy()'s location in the
    hns3_client_uninit()
  net: hns3: fix a memory leak issue for
    hclge_map_unmap_ring_to_vf_vector

Jian Shen (1):
  net: hns3: fix compile warning without CONFIG_RFS_ACCEL

Yunsheng Lin (1):
  net: hns3: fix for HNS3_RXD_GRO_SIZE_M macro

Zhongzhu Liu (1):
  net: hns3: add support for dump firmware statistics by debugfs

 drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c |   1 +
 drivers/net/ethernet/hisilicon/hns3/hns3_enet.c    |   4 +-
 drivers/net/ethernet/hisilicon/hns3/hns3_enet.h    |   2 +-
 .../net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c |   6 +-
 .../net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h |   8 ++
 .../ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c |  57 +++++++++++
 .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c    | 110 ++++++++++++++-------
 .../ethernet/hisilicon/hns3/hns3pf/hclge_main.h    |   2 +
 .../net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c |   4 +-
 .../ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c   |   2 -
 .../ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c  |  95 ++++++++++++------
 .../ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h  |   2 +
 12 files changed, 213 insertions(+), 80 deletions(-)

-- 
2.7.4


^ permalink raw reply	[flat|nested] 35+ messages in thread

* [PATCH net-next 00/12] code optimizations & bugfixes for HNS3 driver
@ 2019-04-11 12:25 Huazhong Tan
  0 siblings, 0 replies; 35+ messages in thread
From: Huazhong Tan @ 2019-04-11 12:25 UTC (permalink / raw)
  To: davem
  Cc: netdev, linux-kernel, salil.mehta, yisen.zhuang, linuxarm, Huazhong Tan

This patchset includes bugfixes and code optimizations for
the HNS3 ethernet controller driver.

Jian Shen (5):
  net: hns3: fix VLAN initialization to be compatible with port base
    insert VLAN
  net: hns3: fix VLAN offload handle for VLAN inserted by port
  net: hns3: fix set port based VLAN for PF
  net: hns3: fix set port based VLAN issue for VF
  net: hns3: do not initialize MDIO bus when PHY is inexistent

Peng Li (2):
  net: hns3: free the pending skb when clean RX ring
  net: hns3: code optimization for command queue' spin lock

Weihang Li (1):
  net: hns3: set dividual reset level for all RAS and MSI-X errors

Yunsheng Lin (4):
  net: hns3: minor refactor for hns3_rx_checksum
  net: hns3: add hns3_gro_complete for HW GRO process
  net: hns3: always assume no drop TC for performance reason
  net: hns3: divide shared buffer between TC

 drivers/net/ethernet/hisilicon/hns3/hclge_mbx.h    |   3 +
 drivers/net/ethernet/hisilicon/hns3/hnae3.h        |   9 +
 drivers/net/ethernet/hisilicon/hns3/hns3_enet.c    | 266 ++++--
 .../net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c |   4 +-
 .../net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c | 956 +++++++++++++--------
 .../net/ethernet/hisilicon/hns3/hns3pf/hclge_err.h |   1 +
 .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c    | 341 ++++++--
 .../ethernet/hisilicon/hns3/hns3pf/hclge_main.h    |  29 +-
 .../net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c |  41 +-
 .../ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c    |   8 +-
 .../ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c   |   4 +-
 .../ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c  |  51 ++
 .../ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h  |   2 +
 .../ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c   |  11 +-
 14 files changed, 1205 insertions(+), 521 deletions(-)

-- 
2.7.4


^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH net-next 00/12] code optimizations & bugfixes for HNS3 driver
  2019-04-06  7:43 Huazhong Tan
@ 2019-04-08 22:31 ` David Miller
  0 siblings, 0 replies; 35+ messages in thread
From: David Miller @ 2019-04-08 22:31 UTC (permalink / raw)
  To: tanhuazhong; +Cc: netdev, linux-kernel, salil.mehta, yisen.zhuang, linuxarm

From: Huazhong Tan <tanhuazhong@huawei.com>
Date: Sat, 6 Apr 2019 15:43:24 +0800

> This patchset includes bugfixes and code optimizations for
> the HNS3 ethernet controller driver.

Series applied, thanks.

^ permalink raw reply	[flat|nested] 35+ messages in thread

* [PATCH net-next 00/12] code optimizations & bugfixes for HNS3 driver
@ 2019-04-06  7:43 Huazhong Tan
  2019-04-08 22:31 ` David Miller
  0 siblings, 1 reply; 35+ messages in thread
From: Huazhong Tan @ 2019-04-06  7:43 UTC (permalink / raw)
  To: davem
  Cc: netdev, linux-kernel, salil.mehta, yisen.zhuang, linuxarm, Huazhong Tan

This patchset includes bugfixes and code optimizations for
the HNS3 ethernet controller driver.

Huazhong Tan (12):
  net: hns3: set vport alive state to default while resetting
  net: hns3: set up the vport alive state while reinitializing
  net: hns3: not reset vport who not alive when PF reset
  net: hns3: adjust the timing of hns3_client_stop when unloading
  net: hns3: deactive the reset timer when reset successfully
  net: hns3: ignore lower-level new coming reset
  net: hns3: do not request reset when hardware resetting
  net: hns3: handle pending reset while reset fail
  net: hns3: stop mailbox handling when command queue need re-init
  net: hns3: add error handler for initializing command queue
  net: hns3: remove resetting check in hclgevf_reset_task_schedule
  net: hns3: fix keep_alive_timer not stop problem

 drivers/net/ethernet/hisilicon/hns3/hns3_enet.c    | 12 ++++++++++--
 .../net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c | 11 ++++++++---
 .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c    | 22 +++++++++++++++++++---
 .../ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c   | 11 ++++++++---
 .../ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c  | 17 ++++++++++++++---
 5 files changed, 59 insertions(+), 14 deletions(-)

-- 
2.7.4


^ permalink raw reply	[flat|nested] 35+ messages in thread

* [PATCH net-next 00/12] code optimizations & bugfixes for HNS3 driver
@ 2019-04-03  3:07 Huazhong Tan
  0 siblings, 0 replies; 35+ messages in thread
From: Huazhong Tan @ 2019-04-03  3:07 UTC (permalink / raw)
  To: davem
  Cc: netdev, linux-kernel, salil.mehta, yisen.zhuang, linuxarm, Huazhong Tan

This patchset includes bugfixes and code optimizations for
the HNS3 ethernet controller driver.

Huazhong Tan (4):
  net: hns3: simplify hclgevf_cmd_csq_clean
  net: hns3: check resetting status in hns3_get_stats()
  net: hns3: prevent change MTU when resetting
  net: hns3: modify HNS3_NIC_STATE_INITED flag in
    hns3_reset_notify_uninit_enet

Jian Shen (2):
  net: hns3: add protect when handling mac addr list
  net: hns3: split function hnae3_match_n_instantiate()

Peng Li (2):
  net: hns3: check 1000M half for hns3_ethtool_ops.set_link_ksettings
  net: hns3: return 0 and print warning when hit duplicate MAC

Yonglong Liu (1):
  net: hns3: reduce resources use in kdump kernel

Yunsheng Lin (2):
  net: hns3: minor optimization for ring_space
  net: hns3: minor optimization for datapath

liuzhongzhu (1):
  net: hns3: modify the VF network port media type acquisition method

 drivers/net/ethernet/hisilicon/hns3/hclge_mbx.h    |  1 +
 drivers/net/ethernet/hisilicon/hns3/hnae3.c        | 40 +++++++++++----------
 drivers/net/ethernet/hisilicon/hns3/hns3_enet.c    | 41 +++++++++++++++++-----
 drivers/net/ethernet/hisilicon/hns3/hns3_enet.h    | 15 +++-----
 drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c |  9 +++++
 .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c    | 30 ++++++++++++++--
 .../net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c | 23 +++++++++---
 .../ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c   | 35 ++++++++++++------
 .../ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c  | 23 ++++++++++++
 .../ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c   |  1 -
 10 files changed, 163 insertions(+), 55 deletions(-)

-- 
2.7.4


^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [Patch net-next 00/12] code optimizations & bugfixes for HNS3 driver
  2019-02-23  9:22 [Patch " Huazhong Tan
@ 2019-02-25  6:10 ` David Miller
  0 siblings, 0 replies; 35+ messages in thread
From: David Miller @ 2019-02-25  6:10 UTC (permalink / raw)
  To: tanhuazhong; +Cc: netdev, linux-kernel, salil.mehta, yisen.zhuang, linuxarm

From: Huazhong Tan <tanhuazhong@huawei.com>
Date: Sat, 23 Feb 2019 17:22:07 +0800

> This patchset includes bugfixes and code optimizations for
> the HNS3 ethernet controller driver.

Series applied, thanks.

^ permalink raw reply	[flat|nested] 35+ messages in thread

* [Patch net-next 00/12] code optimizations & bugfixes for HNS3 driver
@ 2019-02-23  9:22 Huazhong Tan
  2019-02-25  6:10 ` David Miller
  0 siblings, 1 reply; 35+ messages in thread
From: Huazhong Tan @ 2019-02-23  9:22 UTC (permalink / raw)
  To: davem
  Cc: netdev, linux-kernel, salil.mehta, yisen.zhuang, linuxarm, Huazhong Tan

This patchset includes bugfixes and code optimizations for
the HNS3 ethernet controller driver.

Huazhong Tan (1):
  net: hns3: fix improper error handling for hns3_client_start

Jian Shen (2):
  net: hns3: enable VF VLAN filter for each VF when initializing
  net: hns3: fix get VF RSS issue

Peng Li (1):
  net: hns3: add support to config depth for tx|rx ring separately

Shiju Jose (1):
  net: hns3: fix setting of the hns reset_type for rdma hw errors

Yunsheng Lin (7):
  net: hns3: add xps setting support for hns3 driver
  net: hns3: avoid mult + div op in critical data path
  net: hns3: limit some variable scope in critical data path
  net: hns3: remove some ops in struct hns3_nic_ops
  net: hns3: add unlikely for error handling in data path
  net: hns3: replace hnae3_set_bit and hnae3_set_field in data path
  net: hns3: remove hnae3_get_bit in data path

 drivers/net/ethernet/hisilicon/hns3/hclge_mbx.h    |   1 +
 drivers/net/ethernet/hisilicon/hns3/hnae3.h        |  10 +-
 drivers/net/ethernet/hisilicon/hns3/hns3_enet.c    | 264 +++++++++++----------
 drivers/net/ethernet/hisilicon/hns3/hns3_enet.h    |   8 +-
 drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c |  54 +++--
 .../net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h |   4 +-
 .../net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c |  36 +--
 .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c    |  52 ++--
 .../ethernet/hisilicon/hns3/hns3pf/hclge_main.h    |   3 +-
 .../net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c |  53 ++++-
 .../ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c  |  89 ++++++-
 .../ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h  |   3 +-
 12 files changed, 369 insertions(+), 208 deletions(-)

-- 
2.7.4


^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [Patch net-next 00/12] code optimizations & bugfixes for HNS3 driver
  2019-02-20  2:32 Huazhong Tan
@ 2019-02-22  0:34 ` David Miller
  0 siblings, 0 replies; 35+ messages in thread
From: David Miller @ 2019-02-22  0:34 UTC (permalink / raw)
  To: tanhuazhong; +Cc: netdev, linux-kernel, salil.mehta, yisen.zhuang, linuxarm

From: Huazhong Tan <tanhuazhong@huawei.com>
Date: Wed, 20 Feb 2019 10:32:39 +0800

> This patchset includes bugfixes and code optimizations for
> the HNS3 ethernet controller driver.

Series applied, thank you.

^ permalink raw reply	[flat|nested] 35+ messages in thread

* [Patch net-next 00/12] code optimizations & bugfixes for HNS3 driver
@ 2019-02-20  2:32 Huazhong Tan
  2019-02-22  0:34 ` David Miller
  0 siblings, 1 reply; 35+ messages in thread
From: Huazhong Tan @ 2019-02-20  2:32 UTC (permalink / raw)
  To: davem
  Cc: netdev, linux-kernel, salil.mehta, yisen.zhuang, linuxarm, Huazhong Tan

This patchset includes bugfixes and code optimizations for
the HNS3 ethernet controller driver.

Huazhong Tan (2):
  net: hns3: uninitialize command queue while unloading PF driver
  net: hns3: clear command queue's registers when unloading VF driver

Jian Shen (2):
  net: hns3: convert mac advertize and supported from u32 to link mode
  net: hns3: fix port info query issue for copper port

Weihang Li (4):
  net: hns3: modify print message of ssu common ecc errors
  net: hns3: some bugfix of ppu(rcb) ras errors
  net: hns3: enable 8~11th bit of mac common msi-x error
  net: hns3: fix 6th bit of ppp mpf abnormal errors

Yonglong Liu (2):
  net: hns3: add pointer checking at the beginning of the exported
    functions.
  net: hns3: Check variable is valid before assigning it to another

liuzhongzhu (2):
  net: hns3: Record VF unicast and multicast tables
  net: hns3: Record VF vlan tables

 drivers/net/ethernet/hisilicon/hns3/hclge_mbx.h    |   2 +
 drivers/net/ethernet/hisilicon/hns3/hnae3.c        |  37 ++-
 drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c |   9 +-
 .../net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c |  26 +++
 .../net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h |   2 +-
 .../net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c |  69 +++++-
 .../net/ethernet/hisilicon/hns3/hns3pf/hclge_err.h |   5 +-
 .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c    | 248 +++++++++++++++++++--
 .../ethernet/hisilicon/hns3/hns3pf/hclge_main.h    |  40 ++++
 .../net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c |  32 ++-
 .../ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c    |  17 +-
 .../ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c   |  20 ++
 12 files changed, 451 insertions(+), 56 deletions(-)

-- 
2.7.4


^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH net-next 00/12] code optimizations & bugfixes for HNS3 driver
  2019-02-02 14:39 [PATCH " Huazhong Tan
@ 2019-02-02 16:48 ` David Miller
  0 siblings, 0 replies; 35+ messages in thread
From: David Miller @ 2019-02-02 16:48 UTC (permalink / raw)
  To: tanhuazhong
  Cc: netdev, linux-kernel, huangdaode, yisen.zhuang, salil.mehta, linuxarm

From: Huazhong Tan <tanhuazhong@huawei.com>
Date: Sat, 2 Feb 2019 22:39:25 +0800

> This patchset includes bugfixes and code optimizations for the HNS3
> ethernet controller driver

Series applied.

^ permalink raw reply	[flat|nested] 35+ messages in thread

* [PATCH net-next 00/12] code optimizations & bugfixes for HNS3 driver
@ 2019-02-02 14:39 Huazhong Tan
  2019-02-02 16:48 ` David Miller
  0 siblings, 1 reply; 35+ messages in thread
From: Huazhong Tan @ 2019-02-02 14:39 UTC (permalink / raw)
  To: davem
  Cc: netdev, linux-kernel, huangdaode, yisen.zhuang, salil.mehta,
	linuxarm, Huazhong Tan

This patchset includes bugfixes and code optimizations for the HNS3
ethernet controller driver

Huazhong Tan (1):
  net: hns3: fix a wrong checking in the hclge_tx_buffer_calc()

Jian Shen (1):
  net: hns3: don't allow user to change vlan filter state

Peng Li (2):
  net: hns3: fix a code style issue for hns3_update_new_int_gl()
  net: hns3: fix an issue for hns3_update_new_int_gl

Weihang Li (2):
  net: hns3: add hclge_cmd_check_retval() to parse comman's return value
  net: hns3: move some set_bit statement into hclge_prepare_mac_addr

Yonglong Liu (1):
  net: hns3: Modify parameter type from int to bool in set_gro_en

Yunsheng Lin (1):
  net: hns3: code optimization for hclge_rx_buffer_calc

liuzhongzhu (4):
  net: hns3: fix the problem that the supported port is empty
  net: hns3: optimize the maximum TC macro
  net: hns3: modify the upper limit judgment condition
  net: hns3: MAC table entry count function increases operation 0 value
    protection measures

 .../net/ethernet/hisilicon/hns3/hclge_mbx.h   |   4 +-
 drivers/net/ethernet/hisilicon/hns3/hnae3.h   |   2 +-
 .../net/ethernet/hisilicon/hns3/hns3_enet.c   |  33 ++--
 .../hisilicon/hns3/hns3pf/hclge_cmd.c         |  62 +++---
 .../hisilicon/hns3/hns3pf/hclge_cmd.h         |   7 +-
 .../hisilicon/hns3/hns3pf/hclge_debugfs.c     |   4 +-
 .../hisilicon/hns3/hns3pf/hclge_main.c        | 184 ++++++++----------
 .../hisilicon/hns3/hns3pf/hclge_mbx.c         |  31 ++-
 .../hisilicon/hns3/hns3vf/hclgevf_main.c      |  34 +++-
 .../hisilicon/hns3/hns3vf/hclgevf_main.h      |   2 +
 .../hisilicon/hns3/hns3vf/hclgevf_mbx.c       |  12 ++
 11 files changed, 216 insertions(+), 159 deletions(-)

-- 
2.20.1



^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH net-next 00/12] code optimizations & bugfixes for HNS3 driver
  2019-01-30 20:55 Huazhong Tan
@ 2019-01-30 22:50 ` David Miller
  0 siblings, 0 replies; 35+ messages in thread
From: David Miller @ 2019-01-30 22:50 UTC (permalink / raw)
  To: tanhuazhong
  Cc: netdev, linux-kernel, huangdaode, yisen.zhuang, salil.mehta, linuxarm

From: Huazhong Tan <tanhuazhong@huawei.com>
Date: Thu, 31 Jan 2019 04:55:40 +0800

> This patchset includes bugfixes and code optimizations for the HNS3
> ethernet controller driver

Series applied, thanks.

^ permalink raw reply	[flat|nested] 35+ messages in thread

* [PATCH net-next 00/12] code optimizations & bugfixes for HNS3 driver
@ 2019-01-30 20:55 Huazhong Tan
  2019-01-30 22:50 ` David Miller
  0 siblings, 1 reply; 35+ messages in thread
From: Huazhong Tan @ 2019-01-30 20:55 UTC (permalink / raw)
  To: davem
  Cc: netdev, linux-kernel, huangdaode, yisen.zhuang, salil.mehta,
	linuxarm, Huazhong Tan

This patchset includes bugfixes and code optimizations for the HNS3
ethernet controller driver

Huazhong Tan (4):
  net: hns3: change hnae3_register_ae_dev() to int
  net: hns3: Fix NULL deref when unloading driver
  net: hns3: fix netif_napi_del() not do problem when unloading
  net: hns3: fix improper error handling in the hclge_init_ae_dev()

Jian Shen (4):
  net: hns3: fix VF dump register issue
  net: hns3: fix for rss result nonuniform
  net: hns3: stop sending keep alive msg to PF when VF is resetting
  net: hns3: keep flow director state unchanged when reset

Peng Li (2):
  net: hns3: use the correct interface to stop|open port
  net: hns3: fix an issue for hclgevf_ae_get_hdev

Yunsheng Lin (1):
  net: hns3: only support tc 0 for VF

liyongxin (1):
  net: hns3: reuse the definition of l3 and l4 header info union

 drivers/net/ethernet/hisilicon/hns3/hnae3.c   | 10 +-
 drivers/net/ethernet/hisilicon/hns3/hnae3.h   |  4 +-
 .../net/ethernet/hisilicon/hns3/hns3_enet.c   | 95 +++++++++----------
 .../net/ethernet/hisilicon/hns3/hns3_enet.h   |  1 +
 .../ethernet/hisilicon/hns3/hns3_ethtool.c    |  6 +-
 .../hisilicon/hns3/hns3pf/hclge_dcb.c         | 12 +--
 .../hisilicon/hns3/hns3pf/hclge_main.c        | 50 +++++-----
 .../hisilicon/hns3/hns3pf/hclge_main.h        |  2 +-
 .../hisilicon/hns3/hns3pf/hclge_mbx.c         | 10 +-
 .../hisilicon/hns3/hns3pf/hclge_mdio.c        |  8 +-
 .../hisilicon/hns3/hns3pf/hclge_mdio.h        |  4 +-
 .../ethernet/hisilicon/hns3/hns3pf/hclge_tm.c | 22 +++--
 .../hisilicon/hns3/hns3vf/hclgevf_main.c      | 25 ++++-
 13 files changed, 145 insertions(+), 104 deletions(-)

-- 
2.20.1



^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH net-next 00/12] code optimizations & bugfixes for HNS3 driver
  2019-01-26 16:49 Huazhong Tan
@ 2019-01-26 17:33 ` David Miller
  0 siblings, 0 replies; 35+ messages in thread
From: David Miller @ 2019-01-26 17:33 UTC (permalink / raw)
  To: tanhuazhong
  Cc: netdev, linux-kernel, huangdaode, yisen.zhuang, salil.mehta, linuxarm

From: Huazhong Tan <tanhuazhong@huawei.com>
Date: Sun, 27 Jan 2019 00:49:09 +0800

> This patchset includes bugfixes and code optimizations for the HNS3
> ethernet controller driver

Series applied, thanks.

^ permalink raw reply	[flat|nested] 35+ messages in thread

* [PATCH net-next 00/12] code optimizations & bugfixes for HNS3 driver
@ 2019-01-26 16:49 Huazhong Tan
  2019-01-26 17:33 ` David Miller
  0 siblings, 1 reply; 35+ messages in thread
From: Huazhong Tan @ 2019-01-26 16:49 UTC (permalink / raw)
  To: davem
  Cc: netdev, linux-kernel, huangdaode, yisen.zhuang, salil.mehta,
	linuxarm, Huazhong Tan

This patchset includes bugfixes and code optimizations for the HNS3
ethernet controller driver

Jian Shen (6):
  net: hns3: don't update packet statistics for packets dropped by
    hardware
  net: hns3: clear pci private data when unload hns3 driver
  net: hns3: fix return value handle issue for hclge_set_loopback()
  net: hns3: fix broadcast promisc issue for revision 0x20
  net: hns3: add initialization for nic state
  net: hns3: don't allow vf to enable promisc mode

Peng Li (1):
  net: hns3: add 8 BD limit for tx flow

Yunsheng Lin (4):
  net: hns3: add error handling in hclge_ieee_setets
  net: hns3: do reinitialization while mqprio configuration changed
  net: hns3: remove dcb_ops->map_update in hclge_dcb
  net: hns3: call hns3_nic_set_real_num_queue with netdev down

liuzhongzhu (1):
  net: hns3: After setting the loopback, add the status of getting MAC

 drivers/net/ethernet/hisilicon/hns3/hnae3.h   |  1 -
 .../net/ethernet/hisilicon/hns3/hns3_enet.c   | 72 +++++++++----------
 .../ethernet/hisilicon/hns3/hns3_ethtool.c    |  8 +--
 .../hisilicon/hns3/hns3pf/hclge_dcb.c         | 51 ++++++++++---
 .../hisilicon/hns3/hns3pf/hclge_main.c        | 36 +++++++++-
 .../hisilicon/hns3/hns3pf/hclge_mbx.c         |  7 +-
 .../hisilicon/hns3/hns3vf/hclgevf_main.c      | 32 +++++----
 7 files changed, 138 insertions(+), 69 deletions(-)

-- 
2.20.1



^ permalink raw reply	[flat|nested] 35+ messages in thread

* [PATCH net-next 00/12] code optimizations & bugfixes for HNS3 driver
@ 2019-01-22 16:39 Huazhong Tan
  0 siblings, 0 replies; 35+ messages in thread
From: Huazhong Tan @ 2019-01-22 16:39 UTC (permalink / raw)
  To: davem
  Cc: netdev, linux-kernel, huangdaode, yisen.zhuang, salil.mehta,
	linuxarm, Huazhong Tan

This patchset includes bugfixes and code optimizations for the HNS3
ethernet controller driver

Huazhong Tan (1):
  net: hns3: fix bug of ethtool_ops.get_channels for VF

Jian Shen (2):
  net: hns3: add rx multicast packets statistic
  net: hns3: refactor the statistics updating for netdev

Peng Li (2):
  net: hns3: add calling roce callback function when link status change
  net: hns3: clear param in ring when free ring

Yunsheng Lin (6):
  net: hns3: fix rss configuration lost problem when setting channel
  net: hns3: fix for shaper not setting when TC num changes
  net: hns3: Change fw error code NOT_EXEC to NOT_SUPPORTED
  net: hns3: do not return GE PFC setting err when initializing
  net: hns3: add ETS TC weight setting in SSU module
  net: hns3: fix PFC not setting problem for DCB module

liuzhongzhu (1):
  net: hns3: add statistics for PFC frames and MAC control frames

 drivers/net/ethernet/hisilicon/hns3/hnae3.h   |   3 +-
 .../net/ethernet/hisilicon/hns3/hns3_enet.c   |  47 ++++--
 .../net/ethernet/hisilicon/hns3/hns3_enet.h   |   8 +
 .../ethernet/hisilicon/hns3/hns3_ethtool.c    |   1 +
 .../hisilicon/hns3/hns3pf/hclge_cmd.c         |  12 +-
 .../hisilicon/hns3/hns3pf/hclge_cmd.h         |   4 +-
 .../hisilicon/hns3/hns3pf/hclge_dcb.c         |  19 +--
 .../hisilicon/hns3/hns3pf/hclge_main.c        | 138 ++++++++++++++----
 .../hisilicon/hns3/hns3pf/hclge_main.h        |   8 +
 .../ethernet/hisilicon/hns3/hns3pf/hclge_tm.c |  70 +++++++--
 .../ethernet/hisilicon/hns3/hns3pf/hclge_tm.h |   7 +-
 .../hisilicon/hns3/hns3vf/hclgevf_main.c      |  10 +-
 12 files changed, 254 insertions(+), 73 deletions(-)

-- 
2.20.1



^ permalink raw reply	[flat|nested] 35+ messages in thread

end of thread, other threads:[~2019-06-03  1:42 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-24  3:21 [PATCH net-next 00/12] code optimizations & bugfixes for HNS3 driver Huazhong Tan
2019-04-24  3:21 ` [PATCH net-next 01/12] net: hns3: fix data race between ring->next_to_clean Huazhong Tan
2019-04-24  3:21 ` [PATCH net-next 02/12] net: hns3: fix for TX clean num when cleaning TX BD Huazhong Tan
2019-04-24  3:21 ` [PATCH net-next 03/12] net: hns3: handle the BD info on the last BD of the packet Huazhong Tan
2019-04-24  3:21 ` [PATCH net-next 04/12] net: hns3: stop sending keep alive msg when VF command queue needs reinit Huazhong Tan
2019-04-24  3:22 ` [PATCH net-next 05/12] net: hns3: use atomic_t replace u32 for arq's count Huazhong Tan
2019-04-24  3:22 ` [PATCH net-next 06/12] net: hns3: use a reserved byte to identify need_resp flag Huazhong Tan
2019-04-24  3:22 ` [PATCH net-next 07/12] net: hns3: not reset TQP in the DOWN while VF resetting Huazhong Tan
2019-04-24  3:22 ` [PATCH net-next 08/12] net: hns3: stop schedule reset service while unloading driver Huazhong Tan
2019-04-24  3:22 ` [PATCH net-next 09/12] net: hns3: fix pause configure fail problem Huazhong Tan
2019-04-24  3:22 ` [PATCH net-next 10/12] net: hns3: extend the loopback state acquisition time Huazhong Tan
2019-04-24  3:22 ` [PATCH net-next 11/12] net: hns3: prevent double free in hns3_put_ring_config() Huazhong Tan
2019-04-24  3:22 ` [PATCH net-next 12/12] net: hns3: remove reset after command send failed Huazhong Tan
2019-04-24  6:27 ` [PATCH net-next 00/12] code optimizations & bugfixes for HNS3 driver tanhuazhong
  -- strict thread matches above, loose matches on Subject: below --
2019-05-31  8:54 Huazhong Tan
2019-06-01  0:15 ` David Miller
2019-06-01  0:18   ` David Miller
2019-06-03  1:42     ` tanhuazhong
2019-05-28  9:02 Huazhong Tan
2019-05-29  0:39 ` David Miller
2019-04-11 12:25 Huazhong Tan
2019-04-06  7:43 Huazhong Tan
2019-04-08 22:31 ` David Miller
2019-04-03  3:07 Huazhong Tan
2019-02-23  9:22 [Patch " Huazhong Tan
2019-02-25  6:10 ` David Miller
2019-02-20  2:32 Huazhong Tan
2019-02-22  0:34 ` David Miller
2019-02-02 14:39 [PATCH " Huazhong Tan
2019-02-02 16:48 ` David Miller
2019-01-30 20:55 Huazhong Tan
2019-01-30 22:50 ` David Miller
2019-01-26 16:49 Huazhong Tan
2019-01-26 17:33 ` David Miller
2019-01-22 16:39 Huazhong Tan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.