netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 00/12] code optimizations & bugfixes for HNS3 driver
@ 2019-01-22 16:39 Huazhong Tan
  2019-01-22 16:39 ` [PATCH net-next 01/12] net: hns3: add calling roce callback function when link status change Huazhong Tan
                   ` (11 more replies)
  0 siblings, 12 replies; 37+ 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] 37+ messages in thread

* [PATCH net-next 01/12] net: hns3: add calling roce callback function when link status change
  2019-01-22 16:39 [PATCH net-next 00/12] code optimizations & bugfixes for HNS3 driver Huazhong Tan
@ 2019-01-22 16:39 ` Huazhong Tan
  2019-01-22 16:39 ` [PATCH net-next 02/12] net: hns3: add rx multicast packets statistic Huazhong Tan
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 37+ 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, Peng Li, Wei Hu, Huazhong Tan

From: Peng Li <lipeng321@huawei.com>

This patch adds calling roce callback function when link status
change.

Signed-off-by: Wei Hu (Xavier) <xavier.huwei@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   | 6 ++++++
 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 5 +++++
 2 files changed, 11 insertions(+)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
index 00d7acb4d45a..35fb0c54b986 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
@@ -2105,7 +2105,9 @@ static int hclge_get_mac_phy_link(struct hclge_dev *hdev)
 
 static void hclge_update_link_status(struct hclge_dev *hdev)
 {
+	struct hnae3_client *rclient = hdev->roce_client;
 	struct hnae3_client *client = hdev->nic_client;
+	struct hnae3_handle *rhandle;
 	struct hnae3_handle *handle;
 	int state;
 	int i;
@@ -2117,6 +2119,10 @@ static void hclge_update_link_status(struct hclge_dev *hdev)
 		for (i = 0; i < hdev->num_vmdq_vport + 1; i++) {
 			handle = &hdev->vport[i].nic;
 			client->ops->link_status_change(handle, state);
+			rhandle = &hdev->vport[i].roce;
+			if (rclient && rclient->ops->link_status_change)
+				rclient->ops->link_status_change(rhandle,
+								 state);
 		}
 		hdev->hw.mac.link = state;
 	}
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
index bb9f45200ef5..989f08377d58 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
@@ -349,16 +349,21 @@ static void hclgevf_request_link_info(struct hclgevf_dev *hdev)
 
 void hclgevf_update_link_status(struct hclgevf_dev *hdev, int link_state)
 {
+	struct hnae3_handle *rhandle = &hdev->roce;
 	struct hnae3_handle *handle = &hdev->nic;
+	struct hnae3_client *rclient;
 	struct hnae3_client *client;
 
 	client = handle->client;
+	rclient = hdev->roce_client;
 
 	link_state =
 		test_bit(HCLGEVF_STATE_DOWN, &hdev->state) ? 0 : link_state;
 
 	if (link_state != hdev->hw.mac.link) {
 		client->ops->link_status_change(handle, !!link_state);
+		if (rclient && rclient->ops->link_status_change)
+			rclient->ops->link_status_change(rhandle, !!link_state);
 		hdev->hw.mac.link = link_state;
 	}
 }
-- 
2.20.1



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

* [PATCH net-next 02/12] net: hns3: add rx multicast packets statistic
  2019-01-22 16:39 [PATCH net-next 00/12] code optimizations & bugfixes for HNS3 driver Huazhong Tan
  2019-01-22 16:39 ` [PATCH net-next 01/12] net: hns3: add calling roce callback function when link status change Huazhong Tan
@ 2019-01-22 16:39 ` Huazhong Tan
  2019-01-22 18:39   ` Eric Dumazet
  2019-01-22 16:39 ` [PATCH net-next 03/12] net: hns3: refactor the statistics updating for netdev Huazhong Tan
                   ` (9 subsequent siblings)
  11 siblings, 1 reply; 37+ 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, Jian Shen, Peng Li, Huazhong Tan

From: Jian Shen <shenjian15@huawei.com>

This patch adds rx multicast packets statistic for each ring.

Signed-off-by: Jian Shen <shenjian15@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    | 9 +++++++++
 drivers/net/ethernet/hisilicon/hns3/hns3_enet.h    | 8 ++++++++
 drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | 1 +
 3 files changed, 18 insertions(+)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
index 9dd8949381bc..f1ab2e4ca49e 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
@@ -2572,6 +2572,7 @@ static int hns3_handle_rx_bd(struct hns3_enet_ring *ring,
 			     struct sk_buff **out_skb)
 {
 	struct net_device *netdev = ring->tqp->handle->kinfo.netdev;
+	enum hns3_pkt_l2t_type l2_frame_type;
 	struct sk_buff *skb = ring->skb;
 	struct hns3_desc_cb *desc_cb;
 	struct hns3_desc *desc;
@@ -2680,6 +2681,14 @@ static int hns3_handle_rx_bd(struct hns3_enet_ring *ring,
 		return -EFAULT;
 	}
 
+	l2_frame_type = hnae3_get_field(l234info, HNS3_RXD_DMAC_M,
+					HNS3_RXD_DMAC_S);
+	if (l2_frame_type == HNS3_L2_TYPE_MULTICAST) {
+		u64_stats_update_begin(&ring->syncp);
+		ring->stats.rx_multicast++;
+		u64_stats_update_end(&ring->syncp);
+	}
+
 	u64_stats_update_begin(&ring->syncp);
 	ring->stats.rx_pkts++;
 	ring->stats.rx_bytes += skb->len;
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h
index f59ab7387b1f..f3d248626ab3 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h
@@ -202,6 +202,13 @@ enum hns3_nic_state {
 
 #define HNS3_RING_EN_B				0
 
+enum hns3_pkt_l2t_type {
+	HNS3_L2_TYPE_UNICAST,
+	HNS3_L2_TYPE_MULTICAST,
+	HNS3_L2_TYPE_BROADCAST,
+	HNS3_L2_TYPE_INVALID,
+};
+
 enum hns3_pkt_l3t_type {
 	HNS3_L3T_NONE,
 	HNS3_L3T_IPV6,
@@ -376,6 +383,7 @@ struct ring_stats {
 			u64 err_bd_num;
 			u64 l2_err;
 			u64 l3l4_csum_err;
+			u64 rx_multicast;
 		};
 	};
 };
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c
index e678b6939da3..abb78696d7ce 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c
@@ -47,6 +47,7 @@ static const struct hns3_stats hns3_rxq_stats[] = {
 	HNS3_TQP_STAT("err_bd_num", err_bd_num),
 	HNS3_TQP_STAT("l2_err", l2_err),
 	HNS3_TQP_STAT("l3l4_csum_err", l3l4_csum_err),
+	HNS3_TQP_STAT("multicast", rx_multicast),
 };
 
 #define HNS3_RXQ_STATS_COUNT ARRAY_SIZE(hns3_rxq_stats)
-- 
2.20.1



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

* [PATCH net-next 03/12] net: hns3: refactor the statistics updating for netdev
  2019-01-22 16:39 [PATCH net-next 00/12] code optimizations & bugfixes for HNS3 driver Huazhong Tan
  2019-01-22 16:39 ` [PATCH net-next 01/12] net: hns3: add calling roce callback function when link status change Huazhong Tan
  2019-01-22 16:39 ` [PATCH net-next 02/12] net: hns3: add rx multicast packets statistic Huazhong Tan
@ 2019-01-22 16:39 ` Huazhong Tan
  2019-01-22 16:39 ` [PATCH net-next 04/12] net: hns3: fix rss configuration lost problem when setting channel Huazhong Tan
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 37+ 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, Jian Shen, Peng Li, Huazhong Tan

From: Jian Shen <shenjian15@huawei.com>

In origin codes, there are some statistics item are got from mac, which
also include the packets statistics of VF. It is unreasonable. This
patch fixes it by counting them in the rx/tx processing flow.

Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
---
 .../net/ethernet/hisilicon/hns3/hns3_enet.c   | 27 ++++++++++++++-----
 .../hisilicon/hns3/hns3pf/hclge_main.c        | 25 -----------------
 2 files changed, 20 insertions(+), 32 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
index f1ab2e4ca49e..2b4199fe0e57 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
@@ -1399,7 +1399,12 @@ static void hns3_nic_get_stats64(struct net_device *netdev,
 	int queue_num = priv->ae_handle->kinfo.num_tqps;
 	struct hnae3_handle *handle = priv->ae_handle;
 	struct hns3_enet_ring *ring;
+	u64 rx_length_errors = 0;
+	u64 rx_crc_errors = 0;
+	u64 rx_multicast = 0;
 	unsigned int start;
+	u64 tx_errors = 0;
+	u64 rx_errors = 0;
 	unsigned int idx;
 	u64 tx_bytes = 0;
 	u64 rx_bytes = 0;
@@ -1422,6 +1427,8 @@ static void hns3_nic_get_stats64(struct net_device *netdev,
 			tx_pkts += ring->stats.tx_pkts;
 			tx_drop += ring->stats.tx_busy;
 			tx_drop += ring->stats.sw_err_cnt;
+			tx_errors += ring->stats.tx_busy;
+			tx_errors += ring->stats.sw_err_cnt;
 		} while (u64_stats_fetch_retry_irq(&ring->syncp, start));
 
 		/* fetch the rx stats */
@@ -1433,6 +1440,12 @@ static void hns3_nic_get_stats64(struct net_device *netdev,
 			rx_drop += ring->stats.non_vld_descs;
 			rx_drop += ring->stats.err_pkt_len;
 			rx_drop += ring->stats.l2_err;
+			rx_errors += ring->stats.non_vld_descs;
+			rx_errors += ring->stats.l2_err;
+			rx_crc_errors += ring->stats.l2_err;
+			rx_crc_errors += ring->stats.l3l4_csum_err;
+			rx_multicast += ring->stats.rx_multicast;
+			rx_length_errors += ring->stats.err_pkt_len;
 		} while (u64_stats_fetch_retry_irq(&ring->syncp, start));
 	}
 
@@ -1441,15 +1454,15 @@ static void hns3_nic_get_stats64(struct net_device *netdev,
 	stats->rx_bytes = rx_bytes;
 	stats->rx_packets = rx_pkts;
 
-	stats->rx_errors = netdev->stats.rx_errors;
-	stats->multicast = netdev->stats.multicast;
-	stats->rx_length_errors = netdev->stats.rx_length_errors;
-	stats->rx_crc_errors = netdev->stats.rx_crc_errors;
+	stats->rx_errors = rx_errors;
+	stats->multicast = rx_multicast;
+	stats->rx_length_errors = rx_length_errors;
+	stats->rx_crc_errors = rx_crc_errors;
 	stats->rx_missed_errors = netdev->stats.rx_missed_errors;
 
-	stats->tx_errors = netdev->stats.tx_errors;
-	stats->rx_dropped = rx_drop + netdev->stats.rx_dropped;
-	stats->tx_dropped = tx_drop + netdev->stats.tx_dropped;
+	stats->tx_errors = tx_errors;
+	stats->rx_dropped = rx_drop;
+	stats->tx_dropped = tx_drop;
 	stats->collisions = netdev->stats.collisions;
 	stats->rx_over_errors = netdev->stats.rx_over_errors;
 	stats->rx_frame_errors = netdev->stats.rx_frame_errors;
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
index 35fb0c54b986..bf0931c6764f 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
@@ -461,26 +461,6 @@ static u8 *hclge_comm_get_strings(u32 stringset,
 	return (u8 *)buff;
 }
 
-static void hclge_update_netstat(struct hclge_hw_stats *hw_stats,
-				 struct net_device_stats *net_stats)
-{
-	net_stats->tx_dropped = 0;
-	net_stats->rx_errors = hw_stats->mac_stats.mac_rx_oversize_pkt_num;
-	net_stats->rx_errors += hw_stats->mac_stats.mac_rx_undersize_pkt_num;
-	net_stats->rx_errors += hw_stats->mac_stats.mac_rx_fcs_err_pkt_num;
-
-	net_stats->multicast = hw_stats->mac_stats.mac_tx_multi_pkt_num;
-	net_stats->multicast += hw_stats->mac_stats.mac_rx_multi_pkt_num;
-
-	net_stats->rx_crc_errors = hw_stats->mac_stats.mac_rx_fcs_err_pkt_num;
-	net_stats->rx_length_errors =
-		hw_stats->mac_stats.mac_rx_undersize_pkt_num;
-	net_stats->rx_length_errors +=
-		hw_stats->mac_stats.mac_rx_oversize_pkt_num;
-	net_stats->rx_over_errors =
-		hw_stats->mac_stats.mac_rx_oversize_pkt_num;
-}
-
 static void hclge_update_stats_for_all(struct hclge_dev *hdev)
 {
 	struct hnae3_handle *handle;
@@ -500,8 +480,6 @@ static void hclge_update_stats_for_all(struct hclge_dev *hdev)
 	if (status)
 		dev_err(&hdev->pdev->dev,
 			"Update MAC stats fail, status = %d.\n", status);
-
-	hclge_update_netstat(&hdev->hw_stats, &handle->kinfo.netdev->stats);
 }
 
 static void hclge_update_stats(struct hnae3_handle *handle,
@@ -509,7 +487,6 @@ static void hclge_update_stats(struct hnae3_handle *handle,
 {
 	struct hclge_vport *vport = hclge_get_vport(handle);
 	struct hclge_dev *hdev = vport->back;
-	struct hclge_hw_stats *hw_stats = &hdev->hw_stats;
 	int status;
 
 	if (test_and_set_bit(HCLGE_STATE_STATISTICS_UPDATING, &hdev->state))
@@ -527,8 +504,6 @@ static void hclge_update_stats(struct hnae3_handle *handle,
 			"Update TQPS stats fail, status = %d.\n",
 			status);
 
-	hclge_update_netstat(hw_stats, net_stats);
-
 	clear_bit(HCLGE_STATE_STATISTICS_UPDATING, &hdev->state);
 }
 
-- 
2.20.1



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

* [PATCH net-next 04/12] net: hns3: fix rss configuration lost problem when setting channel
  2019-01-22 16:39 [PATCH net-next 00/12] code optimizations & bugfixes for HNS3 driver Huazhong Tan
                   ` (2 preceding siblings ...)
  2019-01-22 16:39 ` [PATCH net-next 03/12] net: hns3: refactor the statistics updating for netdev Huazhong Tan
@ 2019-01-22 16:39 ` Huazhong Tan
  2019-01-22 16:39 ` [PATCH net-next 05/12] net: hns3: fix for shaper not setting when TC num changes Huazhong Tan
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 37+ 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, Yunsheng Lin, Peng Li, Huazhong Tan

From: Yunsheng Lin <linyunsheng@huawei.com>

Currently rss configuration set by user will be lost when setting
channel.

This patch fixes it by not setting rss configuration to default
if user has configured the rss.

Fixes: 09f2af6405b8 ("net: hns3: add support to modify tqps number")
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/hnae3.h             | 3 ++-
 drivers/net/ethernet/hisilicon/hns3/hns3_enet.c         | 6 ++++--
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 8 +++++++-
 3 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hnae3.h b/drivers/net/ethernet/hisilicon/hns3/hnae3.h
index d486748d5883..dc3db45361d3 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hnae3.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hnae3.h
@@ -433,7 +433,8 @@ struct hnae3_ae_ops {
 			     struct ethtool_channels *ch);
 	void (*get_tqps_and_rss_info)(struct hnae3_handle *h,
 				      u16 *alloc_tqps, u16 *max_rss_size);
-	int (*set_channels)(struct hnae3_handle *handle, u32 new_tqps_num);
+	int (*set_channels)(struct hnae3_handle *handle, u32 new_tqps_num,
+			    bool rxfh_configured);
 	void (*get_flowctrl_adv)(struct hnae3_handle *handle,
 				 u32 *flowctrl_adv);
 	int (*set_led_id)(struct hnae3_handle *handle,
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
index 2b4199fe0e57..0a546ee03f92 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
@@ -4166,6 +4166,7 @@ int hns3_set_channels(struct net_device *netdev,
 {
 	struct hnae3_handle *h = hns3_get_handle(netdev);
 	struct hnae3_knic_private_info *kinfo = &h->kinfo;
+	bool rxfh_configured = netif_is_rxfh_configured(netdev);
 	u32 new_tqp_num = ch->combined_count;
 	u16 org_tqp_num;
 	int ret;
@@ -4193,9 +4194,10 @@ int hns3_set_channels(struct net_device *netdev,
 		return ret;
 
 	org_tqp_num = h->kinfo.num_tqps;
-	ret = h->ae_algo->ops->set_channels(h, new_tqp_num);
+	ret = h->ae_algo->ops->set_channels(h, new_tqp_num, rxfh_configured);
 	if (ret) {
-		ret = h->ae_algo->ops->set_channels(h, org_tqp_num);
+		ret = h->ae_algo->ops->set_channels(h, org_tqp_num,
+						    rxfh_configured);
 		if (ret) {
 			/* If revert to old tqp failed, fatal error occurred */
 			dev_err(&netdev->dev,
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
index bf0931c6764f..3ba8de93bc3d 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
@@ -7518,7 +7518,8 @@ static void hclge_get_tqps_and_rss_info(struct hnae3_handle *handle,
 	*max_rss_size = hdev->rss_size_max;
 }
 
-static int hclge_set_channels(struct hnae3_handle *handle, u32 new_tqps_num)
+static int hclge_set_channels(struct hnae3_handle *handle, u32 new_tqps_num,
+			      bool rxfh_configured)
 {
 	struct hclge_vport *vport = hclge_get_vport(handle);
 	struct hnae3_knic_private_info *kinfo = &vport->nic.kinfo;
@@ -7557,6 +7558,10 @@ static int hclge_set_channels(struct hnae3_handle *handle, u32 new_tqps_num)
 	if (ret)
 		return ret;
 
+	/* RSS indirection table has been configuared by user */
+	if (rxfh_configured)
+		goto out;
+
 	/* Reinitializes the rss indirect table according to the new RSS size */
 	rss_indir = kcalloc(HCLGE_RSS_IND_TBL_SIZE, sizeof(u32), GFP_KERNEL);
 	if (!rss_indir)
@@ -7572,6 +7577,7 @@ static int hclge_set_channels(struct hnae3_handle *handle, u32 new_tqps_num)
 
 	kfree(rss_indir);
 
+out:
 	if (!ret)
 		dev_info(&hdev->pdev->dev,
 			 "Channels changed, rss_size from %d to %d, tqps from %d to %d",
-- 
2.20.1



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

* [PATCH net-next 05/12] net: hns3: fix for shaper not setting when TC num changes
  2019-01-22 16:39 [PATCH net-next 00/12] code optimizations & bugfixes for HNS3 driver Huazhong Tan
                   ` (3 preceding siblings ...)
  2019-01-22 16:39 ` [PATCH net-next 04/12] net: hns3: fix rss configuration lost problem when setting channel Huazhong Tan
@ 2019-01-22 16:39 ` Huazhong Tan
  2019-01-22 16:39 ` [PATCH net-next 06/12] net: hns3: fix bug of ethtool_ops.get_channels for VF Huazhong Tan
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 37+ 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, Yunsheng Lin, Peng Li, Huazhong Tan

From: Yunsheng Lin <linyunsheng@huawei.com>

Shaper setting does not change currently, when TC num changes,
which may cause shaper parameter not setting problem.

This patch fixes it by setting the shaper parameter when TC num
changes.

Fixes: cacde272dd00 ("net: hns3: Add hclge_dcb module for the support of DCB feature")
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/hns3pf/hclge_dcb.c | 6 +-----
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c  | 6 +++---
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.h  | 3 +--
 3 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c
index 4ec0b9cd15ae..5f7ac63707b8 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c
@@ -162,11 +162,7 @@ static int hclge_map_update(struct hnae3_handle *h)
 	struct hclge_dev *hdev = vport->back;
 	int ret;
 
-	ret = hclge_tm_map_cfg(hdev);
-	if (ret)
-		return ret;
-
-	ret = hclge_tm_schd_mode_hw(hdev);
+	ret = hclge_tm_schd_setup_hw(hdev);
 	if (ret)
 		return ret;
 
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c
index fb8596a3e5e4..d057c9f03175 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c
@@ -1005,7 +1005,7 @@ static int hclge_tm_pri_dwrr_cfg(struct hclge_dev *hdev)
 	return 0;
 }
 
-int hclge_tm_map_cfg(struct hclge_dev *hdev)
+static int hclge_tm_map_cfg(struct hclge_dev *hdev)
 {
 	int ret;
 
@@ -1120,7 +1120,7 @@ static int hclge_tm_lvl34_schd_mode_cfg(struct hclge_dev *hdev)
 	return 0;
 }
 
-int hclge_tm_schd_mode_hw(struct hclge_dev *hdev)
+static int hclge_tm_schd_mode_hw(struct hclge_dev *hdev)
 {
 	int ret;
 
@@ -1131,7 +1131,7 @@ int hclge_tm_schd_mode_hw(struct hclge_dev *hdev)
 	return hclge_tm_lvl34_schd_mode_cfg(hdev);
 }
 
-static int hclge_tm_schd_setup_hw(struct hclge_dev *hdev)
+int hclge_tm_schd_setup_hw(struct hclge_dev *hdev)
 {
 	int ret;
 
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.h b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.h
index 898163c4d400..ef3f93b70c22 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.h
@@ -144,11 +144,10 @@ struct hclge_port_shapping_cmd {
 int hclge_tm_schd_init(struct hclge_dev *hdev);
 int hclge_tm_vport_map_update(struct hclge_dev *hdev);
 int hclge_pause_setup_hw(struct hclge_dev *hdev);
-int hclge_tm_schd_mode_hw(struct hclge_dev *hdev);
+int hclge_tm_schd_setup_hw(struct hclge_dev *hdev);
 void hclge_tm_prio_tc_info_update(struct hclge_dev *hdev, u8 *prio_tc);
 void hclge_tm_schd_info_update(struct hclge_dev *hdev, u8 num_tc);
 int hclge_tm_dwrr_cfg(struct hclge_dev *hdev);
-int hclge_tm_map_cfg(struct hclge_dev *hdev);
 int hclge_tm_init_hw(struct hclge_dev *hdev);
 int hclge_mac_pause_en_cfg(struct hclge_dev *hdev, bool tx, bool rx);
 int hclge_pause_addr_cfg(struct hclge_dev *hdev, const u8 *mac_addr);
-- 
2.20.1



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

* [PATCH net-next 06/12] net: hns3: fix bug of ethtool_ops.get_channels for VF
  2019-01-22 16:39 [PATCH net-next 00/12] code optimizations & bugfixes for HNS3 driver Huazhong Tan
                   ` (4 preceding siblings ...)
  2019-01-22 16:39 ` [PATCH net-next 05/12] net: hns3: fix for shaper not setting when TC num changes Huazhong Tan
@ 2019-01-22 16:39 ` Huazhong Tan
  2019-01-22 16:39 ` [PATCH net-next 07/12] net: hns3: clear param in ring when free ring Huazhong Tan
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 37+ 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, Peng Li

The current code returns the number of all queues that can be used and
the number of queues that have been allocated, which is incorrect.
What should be returned is the number of queues allocated for each enabled
TC and the number of queues that can be allocated.

This patch fixes it.

Fixes: 849e46077689 ("net: hns3: add ethtool_ops.get_channels support for VF")
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 | 5 +++--
 1 file changed, 3 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 989f08377d58..24b54083b5f9 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
@@ -2466,7 +2466,8 @@ static u32 hclgevf_get_max_channels(struct hclgevf_dev *hdev)
 	struct hnae3_handle *nic = &hdev->nic;
 	struct hnae3_knic_private_info *kinfo = &nic->kinfo;
 
-	return min_t(u32, hdev->rss_size_max * kinfo->num_tc, hdev->num_tqps);
+	return min_t(u32, hdev->rss_size_max,
+		     hdev->num_tqps / kinfo->num_tc);
 }
 
 /**
@@ -2487,7 +2488,7 @@ static void hclgevf_get_channels(struct hnae3_handle *handle,
 	ch->max_combined = hclgevf_get_max_channels(hdev);
 	ch->other_count = 0;
 	ch->max_other = 0;
-	ch->combined_count = hdev->num_tqps;
+	ch->combined_count = handle->kinfo.rss_size;
 }
 
 static void hclgevf_get_tqps_and_rss_info(struct hnae3_handle *handle,
-- 
2.20.1



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

* [PATCH net-next 07/12] net: hns3: clear param in ring when free ring
  2019-01-22 16:39 [PATCH net-next 00/12] code optimizations & bugfixes for HNS3 driver Huazhong Tan
                   ` (5 preceding siblings ...)
  2019-01-22 16:39 ` [PATCH net-next 06/12] net: hns3: fix bug of ethtool_ops.get_channels for VF Huazhong Tan
@ 2019-01-22 16:39 ` Huazhong Tan
  2019-01-22 16:39 ` [PATCH net-next 08/12] net: hns3: Change fw error code NOT_EXEC to NOT_SUPPORTED Huazhong Tan
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 37+ 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, Peng Li, Huazhong Tan

From: Peng Li <lipeng321@huawei.com>

Param pending_buf and skb may be not NULL when free ring.
This patch clears them when free ring.

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

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
index 0a546ee03f92..1d414f016cfb 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
@@ -3400,6 +3400,11 @@ static void hns3_fini_ring(struct hns3_enet_ring *ring)
 	ring->desc_cb = NULL;
 	ring->next_to_clean = 0;
 	ring->next_to_use = 0;
+	ring->pending_buf = 0;
+	if (ring->skb) {
+		dev_kfree_skb_any(ring->skb);
+		ring->skb = NULL;
+	}
 }
 
 static int hns3_buf_size2type(u32 buf_size)
-- 
2.20.1



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

* [PATCH net-next 08/12] net: hns3: Change fw error code NOT_EXEC to NOT_SUPPORTED
  2019-01-22 16:39 [PATCH net-next 00/12] code optimizations & bugfixes for HNS3 driver Huazhong Tan
                   ` (6 preceding siblings ...)
  2019-01-22 16:39 ` [PATCH net-next 07/12] net: hns3: clear param in ring when free ring Huazhong Tan
@ 2019-01-22 16:39 ` Huazhong Tan
  2019-01-22 16:39 ` [PATCH net-next 09/12] net: hns3: do not return GE PFC setting err when initializing Huazhong Tan
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 37+ 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, Yunsheng Lin, Peng Li, Huazhong Tan

From: Yunsheng Lin <linyunsheng@huawei.com>

According to firmware error code definition, the error code of 2
means NOT_SUPPORTED, this patch changes it to NOT_SUPPORTED.

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/hns3pf/hclge_cmd.c | 2 ++
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c
index e483a6e730e6..b0ee070884eb 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c
@@ -259,6 +259,8 @@ int hclge_cmd_send(struct hclge_hw *hw, struct hclge_desc *desc, int num)
 
 			if (desc_ret == HCLGE_CMD_EXEC_SUCCESS)
 				retval = 0;
+			else if (desc_ret == HCLGE_CMD_NOT_SUPPORTED)
+				retval = -EOPNOTSUPP;
 			else
 				retval = -EIO;
 			hw->cmq.last_status = desc_ret;
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h
index f23042b24c09..9f07279513b7 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h
@@ -39,7 +39,7 @@ struct hclge_cmq_ring {
 enum hclge_cmd_return_status {
 	HCLGE_CMD_EXEC_SUCCESS	= 0,
 	HCLGE_CMD_NO_AUTH	= 1,
-	HCLGE_CMD_NOT_EXEC	= 2,
+	HCLGE_CMD_NOT_SUPPORTED	= 2,
 	HCLGE_CMD_QUEUE_FULL	= 3,
 };
 
-- 
2.20.1



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

* [PATCH net-next 09/12] net: hns3: do not return GE PFC setting err when initializing
  2019-01-22 16:39 [PATCH net-next 00/12] code optimizations & bugfixes for HNS3 driver Huazhong Tan
                   ` (7 preceding siblings ...)
  2019-01-22 16:39 ` [PATCH net-next 08/12] net: hns3: Change fw error code NOT_EXEC to NOT_SUPPORTED Huazhong Tan
@ 2019-01-22 16:39 ` Huazhong Tan
  2019-01-22 16:39 ` [PATCH net-next 10/12] net: hns3: add ETS TC weight setting in SSU module Huazhong Tan
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 37+ 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, Yunsheng Lin, Peng Li, Huazhong Tan

From: Yunsheng Lin <linyunsheng@huawei.com>

GE MAC does not support PFC, when driver is initializing and MAC
is in GE Mode, ignore the fw not supported error, otherwise
initialization will fail.

Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
---
 .../hisilicon/hns3/hns3pf/hclge_dcb.c         |  6 +++---
 .../hisilicon/hns3/hns3pf/hclge_main.c        |  2 +-
 .../ethernet/hisilicon/hns3/hns3pf/hclge_tm.c | 19 ++++++++++++-------
 .../ethernet/hisilicon/hns3/hns3pf/hclge_tm.h |  4 ++--
 4 files changed, 18 insertions(+), 13 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c
index 5f7ac63707b8..7db491086fea 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c
@@ -166,7 +166,7 @@ static int hclge_map_update(struct hnae3_handle *h)
 	if (ret)
 		return ret;
 
-	ret = hclge_pause_setup_hw(hdev);
+	ret = hclge_pause_setup_hw(hdev, false);
 	if (ret)
 		return ret;
 
@@ -313,7 +313,7 @@ static int hclge_ieee_setpfc(struct hnae3_handle *h, struct ieee_pfc *pfc)
 
 	hdev->tm_info.hw_pfc_map = pfc_map;
 
-	return hclge_pause_setup_hw(hdev);
+	return hclge_pause_setup_hw(hdev, false);
 }
 
 /* DCBX configuration */
@@ -361,7 +361,7 @@ static int hclge_setup_tc(struct hnae3_handle *h, u8 tc, u8 *prio_tc)
 	hclge_tm_schd_info_update(hdev, tc);
 	hclge_tm_prio_tc_info_update(hdev, prio_tc);
 
-	ret = hclge_tm_init_hw(hdev);
+	ret = hclge_tm_init_hw(hdev, false);
 	if (ret)
 		return ret;
 
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
index 3ba8de93bc3d..6fb3144eb79d 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
@@ -7428,7 +7428,7 @@ static int hclge_reset_ae_dev(struct hnae3_ae_dev *ae_dev)
 		return ret;
 	}
 
-	ret = hclge_tm_init_hw(hdev);
+	ret = hclge_tm_init_hw(hdev, true);
 	if (ret) {
 		dev_err(&pdev->dev, "tm init hw fail, ret =%d\n", ret);
 		return ret;
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c
index d057c9f03175..44316602c2fc 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c
@@ -1255,7 +1255,7 @@ static int hclge_tm_bp_setup(struct hclge_dev *hdev)
 	return ret;
 }
 
-int hclge_pause_setup_hw(struct hclge_dev *hdev)
+int hclge_pause_setup_hw(struct hclge_dev *hdev, bool init)
 {
 	int ret;
 
@@ -1271,10 +1271,15 @@ int hclge_pause_setup_hw(struct hclge_dev *hdev)
 	if (!hnae3_dev_dcb_supported(hdev))
 		return 0;
 
-	/* When MAC is GE Mode, hdev does not support pfc setting */
+	/* GE MAC does not support PFC, when driver is initializing and MAC
+	 * is in GE Mode, ignore the error here, otherwise initialization
+	 * will fail.
+	 */
 	ret = hclge_pfc_setup_hw(hdev);
-	if (ret)
-		dev_warn(&hdev->pdev->dev, "set pfc pause failed:%d\n", ret);
+	if (init && ret == -EOPNOTSUPP)
+		dev_warn(&hdev->pdev->dev, "GE MAC does not support pfc\n");
+	else
+		return ret;
 
 	return hclge_tm_bp_setup(hdev);
 }
@@ -1314,7 +1319,7 @@ void hclge_tm_schd_info_update(struct hclge_dev *hdev, u8 num_tc)
 	hclge_tm_schd_info_init(hdev);
 }
 
-int hclge_tm_init_hw(struct hclge_dev *hdev)
+int hclge_tm_init_hw(struct hclge_dev *hdev, bool init)
 {
 	int ret;
 
@@ -1326,7 +1331,7 @@ int hclge_tm_init_hw(struct hclge_dev *hdev)
 	if (ret)
 		return ret;
 
-	ret = hclge_pause_setup_hw(hdev);
+	ret = hclge_pause_setup_hw(hdev, init);
 	if (ret)
 		return ret;
 
@@ -1345,7 +1350,7 @@ int hclge_tm_schd_init(struct hclge_dev *hdev)
 	if (ret)
 		return ret;
 
-	return hclge_tm_init_hw(hdev);
+	return hclge_tm_init_hw(hdev, true);
 }
 
 int hclge_tm_vport_map_update(struct hclge_dev *hdev)
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.h b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.h
index ef3f93b70c22..f60e540c7a62 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.h
@@ -143,12 +143,12 @@ struct hclge_port_shapping_cmd {
 
 int hclge_tm_schd_init(struct hclge_dev *hdev);
 int hclge_tm_vport_map_update(struct hclge_dev *hdev);
-int hclge_pause_setup_hw(struct hclge_dev *hdev);
+int hclge_pause_setup_hw(struct hclge_dev *hdev, bool init);
 int hclge_tm_schd_setup_hw(struct hclge_dev *hdev);
 void hclge_tm_prio_tc_info_update(struct hclge_dev *hdev, u8 *prio_tc);
 void hclge_tm_schd_info_update(struct hclge_dev *hdev, u8 num_tc);
 int hclge_tm_dwrr_cfg(struct hclge_dev *hdev);
-int hclge_tm_init_hw(struct hclge_dev *hdev);
+int hclge_tm_init_hw(struct hclge_dev *hdev, bool init);
 int hclge_mac_pause_en_cfg(struct hclge_dev *hdev, bool tx, bool rx);
 int hclge_pause_addr_cfg(struct hclge_dev *hdev, const u8 *mac_addr);
 int hclge_pfc_rx_stats_get(struct hclge_dev *hdev, u64 *stats);
-- 
2.20.1



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

* [PATCH net-next 10/12] net: hns3: add ETS TC weight setting in SSU module
  2019-01-22 16:39 [PATCH net-next 00/12] code optimizations & bugfixes for HNS3 driver Huazhong Tan
                   ` (8 preceding siblings ...)
  2019-01-22 16:39 ` [PATCH net-next 09/12] net: hns3: do not return GE PFC setting err when initializing Huazhong Tan
@ 2019-01-22 16:39 ` Huazhong Tan
  2019-01-22 16:39 ` [PATCH net-next 11/12] net: hns3: add statistics for PFC frames and MAC control frames Huazhong Tan
  2019-01-22 16:39 ` [PATCH net-next 12/12] net: hns3: fix PFC not setting problem for DCB module Huazhong Tan
  11 siblings, 0 replies; 37+ 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, Yunsheng Lin, Peng Li, Huazhong Tan

From: Yunsheng Lin <linyunsheng@huawei.com>

This patch sets the TC weight in SSU module according to
info in tm_info.

Also, zero weight of TC weight in SSU ETS module means enabling
strict priority, so do not allow zero weight when in ETS mode.

Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
---
 .../ethernet/hisilicon/hns3/hns3pf/hclge_tm.c | 43 +++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c
index 44316602c2fc..bad975ebe137 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c
@@ -947,6 +947,36 @@ static int hclge_tm_pri_tc_base_dwrr_cfg(struct hclge_dev *hdev)
 	return 0;
 }
 
+static int hclge_tm_ets_tc_dwrr_cfg(struct hclge_dev *hdev)
+{
+#define DEFAULT_TC_WEIGHT	1
+#define DEFAULT_TC_OFFSET	14
+
+	struct hclge_ets_tc_weight_cmd *ets_weight;
+	struct hclge_desc desc;
+	int i;
+
+	hclge_cmd_setup_basic_desc(&desc, HCLGE_OPC_ETS_TC_WEIGHT, false);
+	ets_weight = (struct hclge_ets_tc_weight_cmd *)desc.data;
+
+	for (i = 0; i < HNAE3_MAX_TC; i++) {
+		struct hclge_pg_info *pg_info;
+
+		ets_weight->tc_weight[i] = DEFAULT_TC_WEIGHT;
+
+		if (!(hdev->hw_tc_map & BIT(i)))
+			continue;
+
+		pg_info =
+			&hdev->tm_info.pg_info[hdev->tm_info.tc_info[i].pgid];
+		ets_weight->tc_weight[i] = pg_info->tc_dwrr[i];
+	}
+
+	ets_weight->weight_offset = DEFAULT_TC_OFFSET;
+
+	return hclge_cmd_send(&hdev->hw, &desc, 1);
+}
+
 static int hclge_tm_pri_vnet_base_dwrr_pri_cfg(struct hclge_vport *vport)
 {
 	struct hnae3_knic_private_info *kinfo = &vport->nic.kinfo;
@@ -996,6 +1026,19 @@ static int hclge_tm_pri_dwrr_cfg(struct hclge_dev *hdev)
 		ret = hclge_tm_pri_tc_base_dwrr_cfg(hdev);
 		if (ret)
 			return ret;
+
+		if (!hnae3_dev_dcb_supported(hdev))
+			return 0;
+
+		ret = hclge_tm_ets_tc_dwrr_cfg(hdev);
+		if (ret == -EOPNOTSUPP) {
+			dev_warn(&hdev->pdev->dev,
+				 "fw %08x does't support ets tc weight cmd\n",
+				 hdev->fw_version);
+			ret = 0;
+		}
+
+		return ret;
 	} else {
 		ret = hclge_tm_pri_vnet_base_dwrr_cfg(hdev);
 		if (ret)
-- 
2.20.1



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

* [PATCH net-next 11/12] net: hns3: add statistics for PFC frames and MAC control frames
  2019-01-22 16:39 [PATCH net-next 00/12] code optimizations & bugfixes for HNS3 driver Huazhong Tan
                   ` (9 preceding siblings ...)
  2019-01-22 16:39 ` [PATCH net-next 10/12] net: hns3: add ETS TC weight setting in SSU module Huazhong Tan
@ 2019-01-22 16:39 ` Huazhong Tan
  2019-01-22 16:39 ` [PATCH net-next 12/12] net: hns3: fix PFC not setting problem for DCB module Huazhong Tan
  11 siblings, 0 replies; 37+ 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, liuzhongzhu, Peng Li, Huazhong Tan

From: liuzhongzhu <liuzhongzhu@huawei.com>

In the old firmware version, statistics acquisition of
PFC frames and MAC control frames is not supported.
Add command retrieves statistics for PFC frames and
MAC control frames from the firmware.

Signed-off-by: liuzhongzhu <liuzhongzhu@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
---
 .../hisilicon/hns3/hns3pf/hclge_cmd.c         | 10 +-
 .../hisilicon/hns3/hns3pf/hclge_cmd.h         |  2 +
 .../hisilicon/hns3/hns3pf/hclge_main.c        | 97 ++++++++++++++++++-
 .../hisilicon/hns3/hns3pf/hclge_main.h        |  7 ++
 4 files changed, 109 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c
index b0ee070884eb..81dbe1b6abb0 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c
@@ -170,8 +170,12 @@ static bool hclge_is_special_opcode(u16 opcode)
 	/* these commands have several descriptors,
 	 * and use the first one to save opcode and return value
 	 */
-	u16 spec_opcode[3] = {HCLGE_OPC_STATS_64_BIT,
-		HCLGE_OPC_STATS_32_BIT, HCLGE_OPC_STATS_MAC};
+	u16 spec_opcode[] = {HCLGE_OPC_STATS_64_BIT,
+			     HCLGE_OPC_STATS_32_BIT,
+			     HCLGE_OPC_STATS_MAC,
+			     HCLGE_OPC_STATS_MAC_ALL,
+			     HCLGE_OPC_QUERY_32_BIT_REG,
+			     HCLGE_OPC_QUERY_64_BIT_REG};
 	int i;
 
 	for (i = 0; i < ARRAY_SIZE(spec_opcode); i++) {
@@ -259,6 +263,8 @@ int hclge_cmd_send(struct hclge_hw *hw, struct hclge_desc *desc, int num)
 
 			if (desc_ret == HCLGE_CMD_EXEC_SUCCESS)
 				retval = 0;
+			else if (desc_ret == HCLGE_CMD_NO_AUTH)
+				retval = -EPERM;
 			else if (desc_ret == HCLGE_CMD_NOT_SUPPORTED)
 				retval = -EOPNOTSUPP;
 			else
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h
index 9f07279513b7..e26a25128693 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h
@@ -82,6 +82,8 @@ enum hclge_opcode_type {
 	HCLGE_OPC_STATS_64_BIT		= 0x0030,
 	HCLGE_OPC_STATS_32_BIT		= 0x0031,
 	HCLGE_OPC_STATS_MAC		= 0x0032,
+	HCLGE_OPC_QUERY_MAC_REG_NUM	= 0x0033,
+	HCLGE_OPC_STATS_MAC_ALL		= 0x0034,
 
 	HCLGE_OPC_QUERY_REG_NUM		= 0x0040,
 	HCLGE_OPC_QUERY_32_BIT_REG	= 0x0041,
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
index 6fb3144eb79d..64b1589e549f 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
@@ -118,6 +118,12 @@ static const struct hclge_comm_stats_str g_mac_stats_string[] = {
 		HCLGE_MAC_STATS_FIELD_OFF(mac_tx_mac_pause_num)},
 	{"mac_rx_mac_pause_num",
 		HCLGE_MAC_STATS_FIELD_OFF(mac_rx_mac_pause_num)},
+	{"mac_tx_control_pkt_num",
+		HCLGE_MAC_STATS_FIELD_OFF(mac_tx_ctrl_pkt_num)},
+	{"mac_rx_control_pkt_num",
+		HCLGE_MAC_STATS_FIELD_OFF(mac_rx_ctrl_pkt_num)},
+	{"mac_tx_pfc_pkt_num",
+		HCLGE_MAC_STATS_FIELD_OFF(mac_tx_pfc_pause_pkt_num)},
 	{"mac_tx_pfc_pri0_pkt_num",
 		HCLGE_MAC_STATS_FIELD_OFF(mac_tx_pfc_pri0_pkt_num)},
 	{"mac_tx_pfc_pri1_pkt_num",
@@ -134,6 +140,8 @@ static const struct hclge_comm_stats_str g_mac_stats_string[] = {
 		HCLGE_MAC_STATS_FIELD_OFF(mac_tx_pfc_pri6_pkt_num)},
 	{"mac_tx_pfc_pri7_pkt_num",
 		HCLGE_MAC_STATS_FIELD_OFF(mac_tx_pfc_pri7_pkt_num)},
+	{"mac_rx_pfc_pkt_num",
+		HCLGE_MAC_STATS_FIELD_OFF(mac_rx_pfc_pause_pkt_num)},
 	{"mac_rx_pfc_pri0_pkt_num",
 		HCLGE_MAC_STATS_FIELD_OFF(mac_rx_pfc_pri0_pkt_num)},
 	{"mac_rx_pfc_pri1_pkt_num",
@@ -287,10 +295,9 @@ static const struct hclge_mac_mgr_tbl_entry_cmd hclge_mgr_table[] = {
 	},
 };
 
-static int hclge_mac_update_stats(struct hclge_dev *hdev)
+static int hclge_mac_update_stats_defective(struct hclge_dev *hdev)
 {
 #define HCLGE_MAC_CMD_NUM 21
-#define HCLGE_RTN_DATA_NUM 4
 
 	u64 *data = (u64 *)(&hdev->hw_stats.mac_stats);
 	struct hclge_desc desc[HCLGE_MAC_CMD_NUM];
@@ -308,22 +315,102 @@ static int hclge_mac_update_stats(struct hclge_dev *hdev)
 	}
 
 	for (i = 0; i < HCLGE_MAC_CMD_NUM; i++) {
+		/* for special opcode 0032, only the first desc has the head */
 		if (unlikely(i == 0)) {
 			desc_data = (__le64 *)(&desc[i].data[0]);
-			n = HCLGE_RTN_DATA_NUM - 2;
+			n = HCLGE_RD_FIRST_STATS_NUM;
 		} else {
 			desc_data = (__le64 *)(&desc[i]);
-			n = HCLGE_RTN_DATA_NUM;
+			n = HCLGE_RD_OTHER_STATS_NUM;
 		}
+
+		for (k = 0; k < n; k++) {
+			*data += le64_to_cpu(*desc_data);
+			data++;
+			desc_data++;
+		}
+	}
+
+	return 0;
+}
+
+static int hclge_mac_update_stats_complete(struct hclge_dev *hdev, u32 desc_num)
+{
+	u64 *data = (u64 *)(&hdev->hw_stats.mac_stats);
+	struct hclge_desc *desc;
+	__le64 *desc_data;
+	u16 i, k, n;
+	int ret;
+
+	desc = kcalloc(desc_num, sizeof(struct hclge_desc), GFP_KERNEL);
+	hclge_cmd_setup_basic_desc(&desc[0], HCLGE_OPC_STATS_MAC_ALL, true);
+	ret = hclge_cmd_send(&hdev->hw, desc, desc_num);
+	if (ret) {
+		kfree(desc);
+		return ret;
+	}
+
+	for (i = 0; i < desc_num; i++) {
+		/* for special opcode 0034, only the first desc has the head */
+		if (i == 0) {
+			desc_data = (__le64 *)(&desc[i].data[0]);
+			n = HCLGE_RD_FIRST_STATS_NUM;
+		} else {
+			desc_data = (__le64 *)(&desc[i]);
+			n = HCLGE_RD_OTHER_STATS_NUM;
+		}
+
 		for (k = 0; k < n; k++) {
-			*data++ += le64_to_cpu(*desc_data);
+			*data += le64_to_cpu(*desc_data);
+			data++;
 			desc_data++;
 		}
 	}
 
+	kfree(desc);
+
 	return 0;
 }
 
+static int hclge_mac_query_reg_num(struct hclge_dev *hdev, u32 *desc_num)
+{
+	struct hclge_desc desc;
+	__le32 *desc_data;
+	u32 reg_num;
+	int ret;
+
+	hclge_cmd_setup_basic_desc(&desc, HCLGE_OPC_QUERY_MAC_REG_NUM, true);
+	ret = hclge_cmd_send(&hdev->hw, &desc, 1);
+	if (ret)
+		return ret;
+
+	desc_data = (__le32 *)(&desc.data[0]);
+	reg_num = le32_to_cpu(*desc_data);
+
+	*desc_num = 1 + ((reg_num - 3) >> 2) +
+		    (u32)(((reg_num - 3) & 0x3) ? 1 : 0);
+
+	return 0;
+}
+
+static int hclge_mac_update_stats(struct hclge_dev *hdev)
+{
+	u32 desc_num;
+	int ret;
+
+	ret = hclge_mac_query_reg_num(hdev, &desc_num);
+
+	/* The firmware supports the new statistics acquisition method */
+	if (!ret)
+		ret = hclge_mac_update_stats_complete(hdev, desc_num);
+	else if (ret == -EOPNOTSUPP)
+		ret = hclge_mac_update_stats_defective(hdev);
+	else
+		dev_err(&hdev->pdev->dev, "query mac reg num fail!\n");
+
+	return ret;
+}
+
 static int hclge_tqps_update_stats(struct hnae3_handle *handle)
 {
 	struct hnae3_knic_private_info *kinfo = &handle->kinfo;
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h
index 279ed2d83cb8..b5a38fc1af91 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h
@@ -16,6 +16,9 @@
 
 #define HCLGE_MAX_PF_NUM		8
 
+#define HCLGE_RD_FIRST_STATS_NUM        2
+#define HCLGE_RD_OTHER_STATS_NUM        4
+
 #define HCLGE_INVALID_VPORT 0xffff
 
 #define HCLGE_PF_CFG_BLOCK_SIZE		32
@@ -415,6 +418,10 @@ struct hclge_mac_stats {
 	u64 mac_rx_fcs_err_pkt_num;
 	u64 mac_rx_send_app_good_pkt_num;
 	u64 mac_rx_send_app_bad_pkt_num;
+	u64 mac_tx_pfc_pause_pkt_num;
+	u64 mac_rx_pfc_pause_pkt_num;
+	u64 mac_tx_ctrl_pkt_num;
+	u64 mac_rx_ctrl_pkt_num;
 };
 
 #define HCLGE_STATS_TIMER_INTERVAL	(60 * 5)
-- 
2.20.1



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

* [PATCH net-next 12/12] net: hns3: fix PFC not setting problem for DCB module
  2019-01-22 16:39 [PATCH net-next 00/12] code optimizations & bugfixes for HNS3 driver Huazhong Tan
                   ` (10 preceding siblings ...)
  2019-01-22 16:39 ` [PATCH net-next 11/12] net: hns3: add statistics for PFC frames and MAC control frames Huazhong Tan
@ 2019-01-22 16:39 ` Huazhong Tan
  11 siblings, 0 replies; 37+ 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, Yunsheng Lin, Peng Li, Huazhong Tan

From: Yunsheng Lin <linyunsheng@huawei.com>

The PFC enabling is based on user priority, currently it is
based on TC, which may cause PFC not setting correctly when pri
to TC mapping is not one to one relation.

This patch adds pfc_en in tm_info to fix it.

Fixes: cacde272dd00 ("net: hns3: Add hclge_dcb module for the support of DCB feature")
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/hns3pf/hclge_dcb.c  | 7 ++++---
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h | 1 +
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c   | 2 +-
 3 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c
index 7db491086fea..3a4a54ee5204 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c
@@ -296,6 +296,9 @@ static int hclge_ieee_setpfc(struct hnae3_handle *h, struct ieee_pfc *pfc)
 	    hdev->flag & HCLGE_FLAG_MQPRIO_ENABLE)
 		return -EINVAL;
 
+	if (pfc->pfc_en == hdev->tm_info.pfc_en)
+		return 0;
+
 	prio_tc = hdev->tm_info.prio_tc;
 	pfc_map = 0;
 
@@ -308,10 +311,8 @@ static int hclge_ieee_setpfc(struct hnae3_handle *h, struct ieee_pfc *pfc)
 		}
 	}
 
-	if (pfc_map == hdev->tm_info.hw_pfc_map)
-		return 0;
-
 	hdev->tm_info.hw_pfc_map = pfc_map;
+	hdev->tm_info.pfc_en = pfc->pfc_en;
 
 	return hclge_pause_setup_hw(hdev, false);
 }
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h
index b5a38fc1af91..2c413c63c6c9 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h
@@ -325,6 +325,7 @@ struct hclge_tm_info {
 	struct hclge_tc_info tc_info[HNAE3_MAX_TC];
 	enum hclge_fc_mode fc_mode;
 	u8 hw_pfc_map; /* Allow for packet drop or not on this TC */
+	u8 pfc_en;	/* PFC enabled or not for user priority */
 };
 
 struct hclge_comm_stats_str {
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c
index bad975ebe137..9f4069fb786b 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c
@@ -1215,7 +1215,7 @@ static int hclge_pfc_setup_hw(struct hclge_dev *hdev)
 				HCLGE_RX_MAC_PAUSE_EN_MSK;
 
 	return hclge_pfc_pause_en_cfg(hdev, enable_bitmap,
-				      hdev->tm_info.hw_pfc_map);
+				      hdev->tm_info.pfc_en);
 }
 
 /* Each Tc has a 1024 queue sets to backpress, it divides to
-- 
2.20.1



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

* Re: [PATCH net-next 02/12] net: hns3: add rx multicast packets statistic
  2019-01-22 16:39 ` [PATCH net-next 02/12] net: hns3: add rx multicast packets statistic Huazhong Tan
@ 2019-01-22 18:39   ` Eric Dumazet
  2019-01-22 23:19     ` tanhuazhong
  0 siblings, 1 reply; 37+ messages in thread
From: Eric Dumazet @ 2019-01-22 18:39 UTC (permalink / raw)
  To: Huazhong Tan, davem
  Cc: netdev, linux-kernel, huangdaode, yisen.zhuang, salil.mehta,
	linuxarm, Jian Shen, Peng Li



On 01/22/2019 08:39 AM, Huazhong Tan wrote:
> From: Jian Shen <shenjian15@huawei.com>
> 
> This patch adds rx multicast packets statistic for each ring.
> 
> Signed-off-by: Jian Shen <shenjian15@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    | 9 +++++++++
>  drivers/net/ethernet/hisilicon/hns3/hns3_enet.h    | 8 ++++++++
>  drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | 1 +
>  3 files changed, 18 insertions(+)
> 
> diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
> index 9dd8949381bc..f1ab2e4ca49e 100644
> --- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
> +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
> @@ -2572,6 +2572,7 @@ static int hns3_handle_rx_bd(struct hns3_enet_ring *ring,
>  			     struct sk_buff **out_skb)
>  {
>  	struct net_device *netdev = ring->tqp->handle->kinfo.netdev;
> +	enum hns3_pkt_l2t_type l2_frame_type;
>  	struct sk_buff *skb = ring->skb;
>  	struct hns3_desc_cb *desc_cb;
>  	struct hns3_desc *desc;
> @@ -2680,6 +2681,14 @@ static int hns3_handle_rx_bd(struct hns3_enet_ring *ring,
>  		return -EFAULT;
>  	}
>  
> +	l2_frame_type = hnae3_get_field(l234info, HNS3_RXD_DMAC_M,
> +					HNS3_RXD_DMAC_S);
> +	if (l2_frame_type == HNS3_L2_TYPE_MULTICAST) {
> +		u64_stats_update_begin(&ring->syncp);
> +		ring->stats.rx_multicast++;
> +		u64_stats_update_end(&ring->syncp);
> +	}
> +
>  	u64_stats_update_begin(&ring->syncp);


This is a bit suboptimal to call u64_stats_update_begin() twice.

You could rewrite the thing to be :

        u64_stats_update_begin(&ring->syncp);
        if (l2_frame_type == HNS3_L2_TYPE_MULTICAST)
             ring->stats.rx_multicast++;
           
	ring->stats.rx_pkts++;
	...

>  	ring->stats.rx_pkts++;
>  	ring->stats.rx_bytes += skb->len;
> diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h
> index f59ab7387b1f..f3d248626ab3 100644
> --- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h
> +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h
> @@ -202,6 +202,13 @@ enum hns3_nic_state {
>  
>  #define HNS3_RING_EN_B				0
>  
> +enum hns3_pkt_l2t_type {
> +	HNS3_L2_TYPE_UNICAST,
> +	HNS3_L2_TYPE_MULTICAST,
> +	HNS3_L2_TYPE_BROADCAST,
> +	HNS3_L2_TYPE_INVALID,
> +};
> +
>  enum hns3_pkt_l3t_type {
>  	HNS3_L3T_NONE,
>  	HNS3_L3T_IPV6,
> @@ -376,6 +383,7 @@ struct ring_stats {
>  			u64 err_bd_num;
>  			u64 l2_err;
>  			u64 l3l4_csum_err;
> +			u64 rx_multicast;
>  		};
>  	};
>  };
> diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c
> index e678b6939da3..abb78696d7ce 100644
> --- a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c
> +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c
> @@ -47,6 +47,7 @@ static const struct hns3_stats hns3_rxq_stats[] = {
>  	HNS3_TQP_STAT("err_bd_num", err_bd_num),
>  	HNS3_TQP_STAT("l2_err", l2_err),
>  	HNS3_TQP_STAT("l3l4_csum_err", l3l4_csum_err),
> +	HNS3_TQP_STAT("multicast", rx_multicast),
>  };
>  
>  #define HNS3_RXQ_STATS_COUNT ARRAY_SIZE(hns3_rxq_stats)
> 

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

* RE: [PATCH net-next 02/12] net: hns3: add rx multicast packets statistic
  2019-01-22 18:39   ` Eric Dumazet
@ 2019-01-22 23:19     ` tanhuazhong
  0 siblings, 0 replies; 37+ messages in thread
From: tanhuazhong @ 2019-01-22 23:19 UTC (permalink / raw)
  To: Eric Dumazet, davem
  Cc: netdev, linux-kernel, huangdaode, Zhuangyuzeng (Yisen),
	Salil Mehta, Linuxarm, shenjian (K), lipeng (Y)



-----Original Message-----
From: Eric Dumazet [mailto:eric.dumazet@gmail.com] 
Sent: Wednesday, January 23, 2019 2:39 AM
To: tanhuazhong <tanhuazhong@huawei.com>; davem@davemloft.net
Cc: netdev@vger.kernel.org; linux-kernel@vger.kernel.org; huangdaode <huangdaode@hisilicon.com>; Zhuangyuzeng (Yisen) <yisen.zhuang@huawei.com>; Salil Mehta <salil.mehta@huawei.com>; Linuxarm <linuxarm@huawei.com>; shenjian (K) <shenjian15@huawei.com>; lipeng (Y) <lipeng321@huawei.com>
Subject: Re: [PATCH net-next 02/12] net: hns3: add rx multicast packets statistic



On 01/22/2019 08:39 AM, Huazhong Tan wrote:
> From: Jian Shen <shenjian15@huawei.com>
> 
> This patch adds rx multicast packets statistic for each ring.
> 
> Signed-off-by: Jian Shen <shenjian15@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    | 9 +++++++++
>  drivers/net/ethernet/hisilicon/hns3/hns3_enet.h    | 8 ++++++++
>  drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | 1 +
>  3 files changed, 18 insertions(+)
> 
> diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
> index 9dd8949381bc..f1ab2e4ca49e 100644
> --- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
> +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
> @@ -2572,6 +2572,7 @@ static int hns3_handle_rx_bd(struct hns3_enet_ring *ring,
>  			     struct sk_buff **out_skb)
>  {
>  	struct net_device *netdev = ring->tqp->handle->kinfo.netdev;
> +	enum hns3_pkt_l2t_type l2_frame_type;
>  	struct sk_buff *skb = ring->skb;
>  	struct hns3_desc_cb *desc_cb;
>  	struct hns3_desc *desc;
> @@ -2680,6 +2681,14 @@ static int hns3_handle_rx_bd(struct hns3_enet_ring *ring,
>  		return -EFAULT;
>  	}
>  
> +	l2_frame_type = hnae3_get_field(l234info, HNS3_RXD_DMAC_M,
> +					HNS3_RXD_DMAC_S);
> +	if (l2_frame_type == HNS3_L2_TYPE_MULTICAST) {
> +		u64_stats_update_begin(&ring->syncp);
> +		ring->stats.rx_multicast++;
> +		u64_stats_update_end(&ring->syncp);
> +	}
> +
>  	u64_stats_update_begin(&ring->syncp);


This is a bit suboptimal to call u64_stats_update_begin() twice.

You could rewrite the thing to be :

        u64_stats_update_begin(&ring->syncp);
        if (l2_frame_type == HNS3_L2_TYPE_MULTICAST)
             ring->stats.rx_multicast++;
           
	ring->stats.rx_pkts++;
	...

Ok, thanks.

>  	ring->stats.rx_pkts++;
>  	ring->stats.rx_bytes += skb->len;
> diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h
> index f59ab7387b1f..f3d248626ab3 100644
> --- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h
> +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h
> @@ -202,6 +202,13 @@ enum hns3_nic_state {
>  
>  #define HNS3_RING_EN_B				0
>  
> +enum hns3_pkt_l2t_type {
> +	HNS3_L2_TYPE_UNICAST,
> +	HNS3_L2_TYPE_MULTICAST,
> +	HNS3_L2_TYPE_BROADCAST,
> +	HNS3_L2_TYPE_INVALID,
> +};
> +
>  enum hns3_pkt_l3t_type {
>  	HNS3_L3T_NONE,
>  	HNS3_L3T_IPV6,
> @@ -376,6 +383,7 @@ struct ring_stats {
>  			u64 err_bd_num;
>  			u64 l2_err;
>  			u64 l3l4_csum_err;
> +			u64 rx_multicast;
>  		};
>  	};
>  };
> diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c
> index e678b6939da3..abb78696d7ce 100644
> --- a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c
> +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c
> @@ -47,6 +47,7 @@ static const struct hns3_stats hns3_rxq_stats[] = {
>  	HNS3_TQP_STAT("err_bd_num", err_bd_num),
>  	HNS3_TQP_STAT("l2_err", l2_err),
>  	HNS3_TQP_STAT("l3l4_csum_err", l3l4_csum_err),
> +	HNS3_TQP_STAT("multicast", rx_multicast),
>  };
>  
>  #define HNS3_RXQ_STATS_COUNT ARRAY_SIZE(hns3_rxq_stats)
> 

^ permalink raw reply	[flat|nested] 37+ 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; 37+ 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] 37+ 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; 37+ 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] 37+ 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; 37+ 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] 37+ 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; 37+ 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] 37+ 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; 37+ 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] 37+ 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; 37+ 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] 37+ messages in thread

* Re: [PATCH net-next 00/12] code optimizations & bugfixes for HNS3 driver
  2019-04-24  3:21 Huazhong Tan
@ 2019-04-24  6:27 ` tanhuazhong
  0 siblings, 0 replies; 37+ 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] 37+ messages in thread

* [PATCH net-next 00/12] code optimizations & bugfixes for HNS3 driver
@ 2019-04-24  3:21 Huazhong Tan
  2019-04-24  6:27 ` tanhuazhong
  0 siblings, 1 reply; 37+ 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] 37+ 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; 37+ 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] 37+ 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; 37+ 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] 37+ 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; 37+ 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] 37+ 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; 37+ 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] 37+ messages in thread

* Re: [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, 0 replies; 37+ 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] 37+ 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; 37+ 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] 37+ messages in thread

* Re: [Patch net-next 00/12] code optimizations & bugfixes for HNS3 driver
  2019-02-20  2:32 [Patch " Huazhong Tan
@ 2019-02-22  0:34 ` David Miller
  0 siblings, 0 replies; 37+ 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] 37+ 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; 37+ 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] 37+ messages in thread

* Re: [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, 0 replies; 37+ 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] 37+ 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; 37+ 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] 37+ 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; 37+ 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] 37+ 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; 37+ 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] 37+ messages in thread

* Re: [PATCH net-next 00/12] code optimizations & bugfixes for HNS3 driver
  2019-01-26 16:49 [PATCH net-next 00/12] code optimizations & bugfixes for HNS3 driver Huazhong Tan
@ 2019-01-26 17:33 ` David Miller
  0 siblings, 0 replies; 37+ 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] 37+ 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; 37+ 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] 37+ messages in thread

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

Thread overview: 37+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-22 16:39 [PATCH net-next 00/12] code optimizations & bugfixes for HNS3 driver Huazhong Tan
2019-01-22 16:39 ` [PATCH net-next 01/12] net: hns3: add calling roce callback function when link status change Huazhong Tan
2019-01-22 16:39 ` [PATCH net-next 02/12] net: hns3: add rx multicast packets statistic Huazhong Tan
2019-01-22 18:39   ` Eric Dumazet
2019-01-22 23:19     ` tanhuazhong
2019-01-22 16:39 ` [PATCH net-next 03/12] net: hns3: refactor the statistics updating for netdev Huazhong Tan
2019-01-22 16:39 ` [PATCH net-next 04/12] net: hns3: fix rss configuration lost problem when setting channel Huazhong Tan
2019-01-22 16:39 ` [PATCH net-next 05/12] net: hns3: fix for shaper not setting when TC num changes Huazhong Tan
2019-01-22 16:39 ` [PATCH net-next 06/12] net: hns3: fix bug of ethtool_ops.get_channels for VF Huazhong Tan
2019-01-22 16:39 ` [PATCH net-next 07/12] net: hns3: clear param in ring when free ring Huazhong Tan
2019-01-22 16:39 ` [PATCH net-next 08/12] net: hns3: Change fw error code NOT_EXEC to NOT_SUPPORTED Huazhong Tan
2019-01-22 16:39 ` [PATCH net-next 09/12] net: hns3: do not return GE PFC setting err when initializing Huazhong Tan
2019-01-22 16:39 ` [PATCH net-next 10/12] net: hns3: add ETS TC weight setting in SSU module Huazhong Tan
2019-01-22 16:39 ` [PATCH net-next 11/12] net: hns3: add statistics for PFC frames and MAC control frames Huazhong Tan
2019-01-22 16:39 ` [PATCH net-next 12/12] net: hns3: fix PFC not setting problem for DCB module Huazhong Tan
2019-01-26 16:49 [PATCH net-next 00/12] code optimizations & bugfixes for HNS3 driver Huazhong Tan
2019-01-26 17:33 ` David Miller
2019-01-30 20:55 Huazhong Tan
2019-01-30 22:50 ` David Miller
2019-02-02 14:39 Huazhong Tan
2019-02-02 16:48 ` David Miller
2019-02-20  2:32 [Patch " Huazhong Tan
2019-02-22  0:34 ` David Miller
2019-02-23  9:22 Huazhong Tan
2019-02-25  6:10 ` David Miller
2019-04-03  3:07 [PATCH " Huazhong Tan
2019-04-06  7:43 Huazhong Tan
2019-04-08 22:31 ` David Miller
2019-04-11 12:25 Huazhong Tan
2019-04-24  3:21 Huazhong Tan
2019-04-24  6:27 ` tanhuazhong
2019-05-28  9:02 Huazhong Tan
2019-05-29  0:39 ` David Miller
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).