[PATCH V2 net 2/2] net: hns: add netif_carrier_off before change speed and duplex

2018-08-26 Thread Peng Li
If there are packets in hardware when changing the speed or duplex, it may cause hardware hang up. This patch adds netif_carrier_off before change speed and duplex in ethtool_ops.set_link_ksettings, and adds netif_carrier_on after complete the change. Signed-off-by: Peng Li --- drivers/net

[PATCH V2 net 1/2] net: hns: add the code for cleaning pkt in chip

2018-08-26 Thread Peng Li
ose rx of chip, close tx of protocol stack. 2) wait rcb, ppe, mac to clean. 3) adjust link 4) open rx of chip, open tx of protocol stack. Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns/hnae.h | 2 + drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c | 67 +

[PATCH V2 net 0/2] net: hns: fix some bugs about speed and duplex change

2018-08-26 Thread Peng Li
1) close rx of chip, close tx of protocol stack. 2) wait rcb, ppe, mac to clean. 3) adjust link 4) open rx of chip, open tx of protocol stack. --- Change log: V1 -> V2: 1, remove a patch according to the comment reported by Andrew Lunn. --- Peng Li (2): net: hns: add the code for cleaning pkt i

[PATCH net-next 06/11] net: hns3: refactor GL update function

2018-01-11 Thread Peng Li
separately, making user can enable TX GL self-adaptive or RX GL self-adaptive individually. Signed-off-by: Fuyun Liang Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 35 +++-- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/drivers

[PATCH net-next 03/11] net: hns3: add ethtool_ops.get_coalesce support to PF

2018-01-11 Thread Peng Li
From: Fuyun Liang This patch adds ethtool_ops.get_coalesce support to PF. Whilst our hardware supports per queue values, external interfaces support only a single shared value. As such we use the values for queue 0. Signed-off-by: Fuyun Liang Signed-off-by: Peng Li --- drivers/net/ethernet

[PATCH net-next 11/11] net: hns3: check for NULL function pointer in hns3_nic_set_features

2018-01-11 Thread Peng Li
From: Jian Shen It's necessary to check hook whether being defined before calling, improve the reliability. Signed-off-by: Jian Shen Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dr

[PATCH net-next 00/11] add some new features and fix some bugs

2018-01-11 Thread Peng Li
: remove unused GL setup function net: hns3: change the unit of GL value macro net: hns3: add int_gl_idx setup for TX and RX queues Jian Shen (2): net: hns3: fixes for feature changed checking net: hns3: fix possible NULL pointer in hns3_nic_set_features Peng Li (2): net: hns3: add

[PATCH net-next 10/11] net: hns3: add feature check when feature changed

2018-01-11 Thread Peng Li
From: Jian Shen Local variable "changed" was defined to indicates features changed, but was used only for feature NETIF_F_HW_VLAN_CTAG_RX. Add checking for other features. Fixes: 052ece6dc19c ("net: hns3: add ethtool related offload command") Signed-off-by: Jian Shen Si

[PATCH net-next 02/11] net: hns3: remove TSO config command from VF driver

2018-01-11 Thread Peng Li
Only main PF can config TSO MSS length according to hardware. This patch removes TSO config command from VF driver. Signed-off-by: Peng Li --- .../net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.h | 8 .../ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c| 20 2

[PATCH net-next 04/11] net: hns3: add ethtool_ops.set_coalesce support to PF

2018-01-11 Thread Peng Li
From: Fuyun Liang This patch adds ethtool_ops.set_coalesce support to PF. Signed-off-by: Fuyun Liang Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c| 34 - drivers/net/ethernet/hisilicon/hns3/hns3_enet.h| 17 +++ drivers/net/ethernet/hisilicon/hns3

[PATCH net-next 09/11] net: hns3: add int_gl_idx setup for TX and RX queues

2018-01-11 Thread Peng Li
and RX queues. Fixes: 76ad4f0ee747 ("net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC") Signed-off-by: Fuyun Liang Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hnae3.h | 5 + drivers/net/ethernet/hisilicon/hns3/hns3_enet.c

[PATCH net-next 01/11] net: hns3: add ethtool_ops.get_channels support for VF

2018-01-11 Thread Peng Li
This patch supports the ethtool's get_channels() for VF. Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | 1 + .../ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 30 ++ 2 files changed, 31 insertions(+) diff --git a/drivers/net/eth

[PATCH net-next 08/11] net: hns3: change the unit of GL value macro

2018-01-11 Thread Peng Li
From: Fuyun Liang Previously, driver used 2us as the GL unit. The time unit ethtool command "-c" and "-C" use is 1us, so now the GL unit driver uses actually is 1us. This patch changes the unit of GL value macro from 2us to 1us. Signed-off-by: Fuyun Liang Signed-off-by: P

[PATCH net-next 05/11] net: hns3: refactor interrupt coalescing init function

2018-01-11 Thread Peng Li
direction and the RX direction. It will cause some confusion. This patch refactors the function to initialize the TX GL and the RX GL separately. And the initialization of related variables also is added to this patch. Signed-off-by: Fuyun Liang Signed-off-by: Peng Li --- drivers/net/ethernet

[PATCH net-next 07/11] net: hns3: remove unused GL setup function

2018-01-11 Thread Peng Li
From: Fuyun Liang Since the TX GL and the RX GL need to be set separately, hns3_set_vector_coalesc_gl() has been replaced with hns3_set_vector_coalesce_rx_gl() and hns3_set_vector_coalesce_tx_gl(). This patch removes hns3_set_vector_coalesc_gl(). Signed-off-by: Fuyun Liang Signed-off-by: Peng

[PATCH V2 net-next 02/11] net: hns3: remove TSO config command from VF driver

2018-01-11 Thread Peng Li
Only main PF can config TSO MSS length according to hardware. This patch removes TSO config command from VF driver. Signed-off-by: Peng Li --- .../net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.h | 8 .../ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c| 20 2

[PATCH V2 net-next 08/11] net: hns3: change the unit of GL value macro

2018-01-11 Thread Peng Li
From: Fuyun Liang Previously, driver used 2us as the GL unit. The time unit ethtool command "-c" and "-C" use is 1us, so now the GL unit driver uses actually is 1us. This patch changes the unit of GL value macro from 2us to 1us. Signed-off-by: Fuyun Liang Signed-off-by: P

[PATCH V2 net-next 11/11] net: hns3: check for NULL function pointer in hns3_nic_set_features

2018-01-11 Thread Peng Li
From: Jian Shen It's necessary to check hook whether being defined before calling, improve the reliability. Signed-off-by: Jian Shen Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dr

[PATCH V2 net-next 04/11] net: hns3: add ethtool_ops.set_coalesce support to PF

2018-01-11 Thread Peng Li
From: Fuyun Liang This patch adds ethtool_ops.set_coalesce support to PF. Signed-off-by: Fuyun Liang Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c| 34 - drivers/net/ethernet/hisilicon/hns3/hns3_enet.h| 17 +++ drivers/net/ethernet/hisilicon/hns3

[PATCH V2 net-next 09/11] net: hns3: add int_gl_idx setup for TX and RX queues

2018-01-11 Thread Peng Li
and RX queues. Fixes: 76ad4f0ee747 ("net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC") Signed-off-by: Fuyun Liang Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hnae3.h | 5 + drivers/net/ethernet/hisilicon/hns3/hns3_enet.c

[PATCH V2 net-next 03/11] net: hns3: add ethtool_ops.get_coalesce support to PF

2018-01-11 Thread Peng Li
From: Fuyun Liang This patch adds ethtool_ops.get_coalesce support to PF. Whilst our hardware supports per queue values, external interfaces support only a single shared value. As such we use the values for queue 0. Signed-off-by: Fuyun Liang Signed-off-by: Peng Li --- drivers/net/ethernet

[PATCH V2 net-next 00/11] add some new features and fix some bugs

2018-01-11 Thread Peng Li
feature check when feature changed net: hns3: check for NULL function pointer in hns3_nic_set_features Peng Li (2): net: hns3: add ethtool_ops.get_channels support for VF net: hns3: remove TSO config command from VF driver drivers/net/ethernet/hisilicon/hns3/hnae3.h| 7 + drivers

[PATCH V2 net-next 05/11] net: hns3: refactor interrupt coalescing init function

2018-01-11 Thread Peng Li
direction and the RX direction. It will cause some confusion. This patch refactors the function to initialize the TX GL and the RX GL separately. And the initialization of related variables also is added to this patch. Signed-off-by: Fuyun Liang Signed-off-by: Peng Li --- drivers/net/ethernet

[PATCH V2 net-next 06/11] net: hns3: refactor GL update function

2018-01-11 Thread Peng Li
separately, making user can enable TX GL self-adaptive or RX GL self-adaptive individually. Signed-off-by: Fuyun Liang Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 35 +++-- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/drivers

[PATCH V2 net-next 01/11] net: hns3: add ethtool_ops.get_channels support for VF

2018-01-12 Thread Peng Li
This patch supports the ethtool's get_channels() for VF. Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | 1 + .../ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 30 ++ 2 files changed, 31 insertions(+) diff --git a/drivers/net/eth

[PATCH V2 net-next 10/11] net: hns3: add feature check when feature changed

2018-01-12 Thread Peng Li
From: Jian Shen Local variable "changed" was defined to indicates features changed, but was used only for feature NETIF_F_HW_VLAN_CTAG_RX. Add checking for other features. Fixes: 052ece6dc19c ("net: hns3: add ethtool related offload command") Signed-off-by: Jian Shen Si

[PATCH V2 net-next 07/11] net: hns3: remove unused GL setup function

2018-01-12 Thread Peng Li
From: Fuyun Liang Since the TX GL and the RX GL need to be set separately, hns3_set_vector_coalesc_gl() has been replaced with hns3_set_vector_coalesce_rx_gl() and hns3_set_vector_coalesce_tx_gl(). This patch removes hns3_set_vector_coalesc_gl(). Signed-off-by: Fuyun Liang Signed-off-by: Peng

[PATCH V2 net-next 0/4] add some features to hns3 driver

2018-01-18 Thread Peng Li
This patchset adds some features to hns3 driver, include the support for ethtool command -d, -p and support for manager table. [Patch 1/4] adds support for ethtool command -d, its ops is get_regs. driver will send command to command queue, and get regs number and regs value from command queue. [Pa

[PATCH V2 net-next 4/4] net: hns3: add net status led support for fiber port

2018-01-18 Thread Peng Li
From: Jian Shen Check the net status per second, include port speed, total rx/tx packets and link status. Updating the led status for fiber port. Signed-off-by: Jian Shen Signed-off-by: Peng Li --- .../net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h | 1 + .../ethernet/hisilicon/hns3/hns3pf

[PATCH V2 net-next 2/4] net: hns3: add manager table initialization for hardware

2018-01-18 Thread Peng Li
From: Fuyun Liang The manager table is empty by default. If it is not initialized, the management pkgs like LLDP will be dropped by hardware. Default entries need to be added to manager table. Signed-off-by: Fuyun Liang Signed-off-by: Peng Li --- .../net/ethernet/hisilicon/hns3/hns3pf

[PATCH V2 net-next 3/4] net: hns3: add ethtool -p support for fiber port

2018-01-18 Thread Peng Li
From: Jian Shen Add led location support for fiber port. The led will keep blinking when locating. Signed-off-by: Jian Shen Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hnae3.h| 2 + drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | 12 .../net/ethernet

[PATCH V2 net-next 1/4] net: hns3: add support for get_regs

2018-01-18 Thread Peng Li
From: Fuyun Liang This patch adds get_regs support for ethtool cmd. Signed-off-by: Fuyun Liang Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hnae3.h| 3 +- drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | 23 +++ .../net/ethernet/hisilicon/hns3/hns3pf

[PATCH net-next 00/20] add some new features and fix some bugs for HNS3 driver

2018-01-05 Thread Peng Li
hns3_stats net: hns3: Add packet statistics of netdev net: hns3: Fix a response data read error of tqp statistics query net: hns3: Add more packet size statisctics Peng Li (1): net: hns3: remove redundant semicolon drivers/net/ethernet/hisilicon/hns3/hnae3.h| 3 + drivers/net

[PATCH net-next 08/20] net: hns3: Fix an error of total drop packet statistics

2018-01-05 Thread Peng Li
From: Jian Shen The dropped tx/rx packets number of each tqp should also be counted into the total drop tx/rx packets numbers. Fixes: 76ad4f0ee74 ("net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC") Signed-off-by: Jian Shen Signed-off-by: Peng Li --- drivers/ne

[PATCH net-next 05/20] net: hns3: Remove repeat statistic of rx_errors

2018-01-05 Thread Peng Li
From: Jian Shen The igu_rx_err_pkt indicates the same error with mac_rx_fcs_err_pkt_num, so remove it. Fixes: 46a3df9f9718 ("net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support") Signed-off-by: Jian Shen Signed-off-by: Peng Li --- drivers/net/ethernet/hisilic

[PATCH net-next 09/20] net: hns3: Fix a loop index error of tqp statistics query

2018-01-05 Thread Peng Li
From: Jian Shen An error loop index was used while querying statistics data of tqps, which may cause call trace. Fixes: 496d03e960ae ("net: hns3: Add Ethtool support to HNS3 driver") Signed-off-by: Jian Shen Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hns3_etht

[PATCH net-next 18/20] net: hns3: fix for not setting pause parameters

2018-01-05 Thread Peng Li
. Fixes: 9dc2145d910e ("net: hns3: Add support for PFC setting in TM module") Signed-off-by: Fuyun Liang Signed-off-by: Peng Li --- .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c| 36 -- .../net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c | 58 +

[PATCH net-next 16/20] net: hns3: fix for changing MTU

2018-01-05 Thread Peng Li
From: Fuyun Liang when changing MTU, The new MTU must need to be set to netdevice. Fixes: a8e8b7ff3517 ("net: hns3: Add support to change MTU in HNS3 hardware") Signed-off-by: Fuyun Liang Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 2 ++ 1 file

[PATCH net-next 13/20] net: hns3: Fix a response data read error of tqp statistics query

2018-01-05 Thread Peng Li
From: Jian Shen The result of tqp statistics query was read with an error position, fix it according to the user manual. Fixes: 46a3df9f9718 ("net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support") Signed-off-by: Jian Shen Signed-off-by: Peng Li --- driver

[PATCH net-next 07/20] net: hns3: Mask the packet statistics query when NIC is down

2018-01-05 Thread Peng Li
From: Jian Shen Update the HNS3_NIC_STATE_DOWN bit when NIC state changes. When NIC is down, mask the packet statistics for querying with ifconfig command. It's a common practice. Signed-off-by: Jian Shen Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.

[PATCH net-next 19/20] net: hns3: remove redundant semicolon

2018-01-05 Thread Peng Li
There is a redundant semicolon, this patch removes it. Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c b/drivers/net/ethernet

[PATCH net-next 17/20] net: hns3: add MTU initialization for hardware

2018-01-05 Thread Peng Li
Signed-off-by: Fuyun Liang Signed-off-by: Peng Li --- .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c| 22 -- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3p

[PATCH net-next 20/20] net: hns3: Add more packet size statisctics

2018-01-05 Thread Peng Li
From: Jian Shen The statistics of rx/tx packets size greater than 1518 are not detailed. This patch adds more statistics for different packet size range. Signed-off-by: Jian Shen Signed-off-by: Peng Li --- .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c| 42

[PATCH net-next 10/20] net: hns3: Fix an error macro definition of HNS3_TQP_STAT

2018-01-05 Thread Peng Li
Signed-off-by: Jian Shen Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c index 9cca33c..

[PATCH net-next 11/20] net: hns3: Remove a useless member of struct hns3_stats

2018-01-05 Thread Peng Li
From: Jian Shen The member "stats_size" of struct hns3_stats is useless, remove it and fix the macro definition which has uses this struct. Signed-off-by: Jian Shen Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | 4 +--- 1 file changed, 1 inser

[PATCH net-next 03/20] net: hns3: Unify the strings display of packet statistics

2018-01-05 Thread Peng Li
err_cnt(rx side) --> rx_dropped pkts --> packets tx_err_cnt --> errors rx_err_cnt --> errors Signed-off-by: Jian Shen Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | 51 ++-- .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c| 56 +

[PATCH net-next 02/20] net: hns3: Disable VFs change rxvlan offload status

2018-01-05 Thread Peng Li
From: Jian Shen Rxvlan offload status can only be changed by PF. Initialize the value of NETIF_F_HW_VLAN_CTAG_RX bit of hw_features for VFS to false, make sure user can't be able to change it. Signed-off-by: Jian Shen Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hns3_e

[PATCH net-next 14/20] net: hns3: fix for updating fc_mode_last_time

2018-01-05 Thread Peng Li
by: Fuyun Liang Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 15 ++- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c

[PATCH net-next 06/20] net: hns3: Modify the update period of packet statistics

2018-01-05 Thread Peng Li
rflow). As a result, we need to update it while querying with ifconfig tool to keep the statistics data fresh. Signed-off-by: Jian Shen Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 3 +++ drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c

[PATCH net-next 15/20] net: hns3: fix for setting MTU

2018-01-05 Thread Peng Li
ngine & Compatibility Layer Support") Signed-off-by: Fuyun Liang Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h | 2 -- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 14 +++--- drivers/net/ethernet/hisilicon/hns3/hns3pf/hcl

[PATCH net-next 12/20] net: hns3: Add packet statistics of netdev

2018-01-05 Thread Peng Li
From: Jian Shen Add packet statistics of netdev for ethtool -S, in order to show the statistics data for current net device. Remove update_stats() calling because it has been completed in hns3_get_netdev_stats(). Signed-off-by: Jian Shen Signed-off-by: Peng Li --- drivers/net/ethernet

[PATCH net-next 01/20] net: hns3: Add ethtool interface for vlan filter

2018-01-05 Thread Peng Li
From: Jian Shen This patch adds vlan filter enable switch to support ethtool -K ethX rx-vlan-filter on/off. Signed-off-by: Jian Shen Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hnae3.h | 3 +++ drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 11

[PATCH net-next 04/20] net: hns3: Fix spelling errors

2018-01-05 Thread Peng Li
From: Jian Shen Fix spelling error "overrsize" --> "oversize". Fixes: 46a3df9f9718 ("net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support") Signed-off-by: Jian Shen Signed-off-by: Peng Li --- drivers/net/ethernet/hi

[PATCH net-next 1/2] net: hns3: add get/set_coalesce support to VF

2018-01-26 Thread Peng Li
From: Fuyun Liang This patch adds ethtool_ops.get/set_coalesce support to VF. Since PF and VF share the same get/set_coalesce interface, we only need to set hns3_get/set_coalesce to the ethtool_ops when supporting get/set_coalesce for VF. Signed-off-by: Fuyun Liang Signed-off-by: Peng Li

[PATCH net-next 0/2] net: hns3: add support ethtool_ops.{set|get}_coalesce for VF

2018-01-26 Thread Peng Li
This patch-set adds ethtool_ops.{get|set}_coalesce to VF and fix one related bug. HNS3 PF and VF driver use the common enet layer, as the ethtool_ops.{get|set}_coalesce to PF have upstreamed, just need add the ops to hns3vf_ethtool_ops. [Patch 1/2] fix a related bug for the VF ethtool_ops.{set|

[PATCH net-next 2/2] net: hns3: add int_gl_idx setup for VF

2018-01-26 Thread Peng Li
dware Compatibility Layer) Support") Signed-off-by: Fuyun Liang Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c| 8 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 5 + 2 files changed, 13 insertions(+) diff --git a/drivers/net/ethernet

[PATCH net-next 4/5] net: hns3: add ethtool -p support for fiber port

2018-01-17 Thread Peng Li
From: Jian Shen Add led location support for fiber port. The led will keep blinking when locating. Signed-off-by: Jian Shen Signed-off-by: Peng Li --- .../net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h | 20 .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c| 101

[PATCH net-next 3/5] net: hns3: add ethtool -p support for phy device

2018-01-17 Thread Peng Li
From: Jian Shen Add led location support for phy device. The led will keep blinking with frequency 2HZ when locating. Signed-off-by: Jian Shen Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hnae3.h| 2 + drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | 12

[PATCH net-next 2/5] net: hns3: add manager table initialization for hardware

2018-01-17 Thread Peng Li
From: Fuyun Liang The manager table is empty by default. If it is not initialized, the management pkgs like LLDP will be dropped by hardware. Default entries need to be added to manager table. Signed-off-by: Fuyun Liang Signed-off-by: Peng Li --- .../net/ethernet/hisilicon/hns3/hns3pf

[PATCH net-next 1/5] net: hns3: add support for get_regs

2018-01-17 Thread Peng Li
From: Fuyun Liang This patch adds get_regs support for ethtool cmd. Signed-off-by: Fuyun Liang Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hnae3.h| 3 +- drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | 23 +++ .../net/ethernet/hisilicon/hns3/hns3pf

[PATCH net-next 5/5] net: hns3: add net status led support for fiber port

2018-01-17 Thread Peng Li
From: Jian Shen Check the net status per second, include port speed, total rx/tx packets and link status. Updating the led status for fiber port. Signed-off-by: Jian Shen Signed-off-by: Peng Li --- .../net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h | 1 + .../ethernet/hisilicon/hns3/hns3pf

[PATCH net-next 0/5] add some features to hns3 driver

2018-01-17 Thread Peng Li
This patchset adds some features to hns3 driver, include the support for ethtool command -d, -p and support for manager table. [Patch 1/5] adds support for ethtool command -d, its ops is get_regs. driver will send command to command queue, and get regs number and regs value from command queue. [Pa

[PATCH net-next 0/2] code improvements in HNS3 driver

2018-01-08 Thread Peng Li
This patchset fixes 2 comments for community review. [patch 1/2] reverts "net: hns3: Add packet statistics of netdev" reported by Jakub Kicinski and David Miller. [patch 2/2] reports the function type the same line with hns3_nic_get_stats64, reported by Andrew Lunn. Peng Li (2): R

[PATCH net-next 1/2] Revert "net: hns3: Add packet statistics of netdev"

2018-01-08 Thread Peng Li
This reverts commit 8491000754796c838a0081c267f9dd54ad2ccba3. It is duplicate to add statistics of netdev for ethtool -S. Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | 80 +- 1 file changed, 1 insertion(+), 79 deletions(-) diff --git a

[PATCH net-next 2/2] net: hns3: report the function type the same line with hns3_nic_get_stats64

2018-01-08 Thread Peng Li
The function type should be on the same line with the function name, or it may cause display error if a patch edit the function. There is am example following: https://www.spinics.net/lists/netdev/msg476141.html Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 4

[PATCH net-next 08/12] net: hns3: fix for buffer overflow smatch warning

2018-03-09 Thread Peng Li
x support to PF driver") Signed-off-by: Yunsheng Lin Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hclge_mbx.h| 2 + .../net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c | 19 --- .../ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 60 ++ 3 files ch

[PATCH net-next 07/12] net: hns3: fix for loopback failure when vlan filter is enable

2018-03-09 Thread Peng Li
From: Yunsheng Lin When vlan ctag filter is enabled, the loopback selftest fails because loopback selftest does not support vlan. This patch fixes it by disabling the vlan ctag filter when runnig loopback selftest. Signed-off-by: Yunsheng Lin Signed-off-by: Peng Li --- drivers/net/ethernet

[PATCH net-next 09/12] net: hns3: fix error type definition of return value

2018-03-09 Thread Peng Li
From: Jian Shen An enum type variable was used to store an "int" type return value. This patch fixes it. Fixes: 46a3df9f9718 ("net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support") Signed-off-by: Jian Shen Signed-off-by: Peng Li --- drivers/net

[PATCH net-next 11/12] net: hns3: add existence checking before adding unicast mac address

2018-03-09 Thread Peng Li
table, and add it if the entry is inexistent. Fixes: 46a3df9f9718 ("net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support") Signed-off-by: Jian Shen Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 17 - 1 file chan

[PATCH net-next 12/12] net: hns3: add result checking for VF when modify unicast mac address

2018-03-09 Thread Peng Li
-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c| 2 +- drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 2 +- drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c | 4 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/net

[PATCH net-next 10/12] net: hns3: fix return value error of hclge_get_mac_vlan_cmd_status()

2018-03-09 Thread Peng Li
invalid op code, return -EINVAL. Fixes: 46a3df9f9718 ("net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support") Signed-off-by: Jian Shen Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 10 +- 1 file changed, 5 in

[PATCH net-next 03/12] net: hns3: fix for ipv6 address loss problem after setting channels

2018-03-09 Thread Peng Li
: Fuyun Liang Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c index 8113d22..4dba974 100644 --- a

[PATCH net-next 05/12] net: hns3: fix rx path skb->truesize reporting bug

2018-03-09 Thread Peng Li
Original skb->truesize reports the received packet size, not the actual buffer size NIC driver allocated(1 Page). The linux net protocol will misjudge the true size of rx queue. Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 10 -- 1 file changed

[PATCH net-next 06/12] net: hns3: add support for querying pfc puase packets statistic

2018-03-09 Thread Peng Li
This patch add support for querying pfc puase packets statistic in hclge_ieee_getpfc, which is used to tell user how many pfc puase packets have been sent and received by this mac port. Signed-off-by: Yunsheng Lin Signed-off-by: Peng Li --- .../net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c

[PATCH net-next 00/12] fix some bugs for HNS3 driver

2018-03-09 Thread Peng Li
net: hns3: fix return value error of hclge_get_mac_vlan_cmd_status() net: hns3: add existence checking before adding unicast mac address net: hns3: add result checking for VF when modify unicast mac address Peng Li (2): net: hns3: fix rx path skb->truesize reporting bug net: hns3: add supp

[PATCH net-next 04/12] net: hns3: unify the pause params setup function

2018-03-09 Thread Peng Li
From: Fuyun Liang Since the firmware cmd to setup mac pause params is the same as the firmware cmd to pfc pause params, this patch unifies the pause params setup function. Signed-off-by: Fuyun Liang Signed-off-by: Peng Li --- .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c| 2

[PATCH net-next 02/12] net: hns3: fix for netdev not running problem after calling net_stop and net_open

2018-03-09 Thread Peng Li
updating the link state in ae_stop function. Signed-off-by: Fuyun Liang Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 3 +++ drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/drivers/net/ethernet

[PATCH net-next 01/12] net: hns3: add existence check when remove old uc mac address

2018-03-09 Thread Peng Li
ngine & Compatibility Layer Support") Signed-off-by: Fuyun Liang Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hnae3.h | 3 ++- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 4 ++-- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 17 +++-

[PATCH net-next 0/5] fix some bugs for HNS3

2018-03-23 Thread Peng Li
returning wrong value problem in hns3_get_rss_key_size net: hns3: fix for returning wrong value problem in hns3_get_rss_indir_size net: hns3: fix for the wrong shift problem in hns3_set_txbd_baseinfo net: hns3: fix for not initializing VF rss_hash_key problem Peng Li (1): net: hns3: never

[PATCH net-next 3/5] net: hns3: fix for the wrong shift problem in hns3_set_txbd_baseinfo

2018-03-23 Thread Peng Li
From: Fuyun Liang Third parameter of hnae_set_field is shift, But a mask is given. This patch fixes it by replacing HNS3_TXD_BDTYPE_M with HNS3_TXD_BDTYPE_S. Signed-off-by: Fuyun Liang Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 2 +- 1 file changed, 1

[PATCH net-next 2/5] net: hns3: fix for returning wrong value problem in hns3_get_rss_indir_size

2018-03-23 Thread Peng Li
From: Fuyun Liang The return type of hns3_get_rss_indir_size is u32. But a negative value is returned. This patch fixes it by replacing the negative value with zero. Signed-off-by: Fuyun Liang Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | 2 +- 1 file

[PATCH net-next 5/5] net: hns3: never send command queue message to IMP when reset

2018-03-23 Thread Peng Li
IMP will not handle and command queue message any more when it is in core/global, driver should not send command queue message to IMP until reinitialize the NIC HW. This patch checks the status and avoid the message sent to IMP when reset. Signed-off-by: Peng Li --- .../ethernet/hisilicon/hns3

[PATCH net-next 1/5] net: hns3: fix for returning wrong value problem in hns3_get_rss_key_size

2018-03-23 Thread Peng Li
From: Fuyun Liang The return type of hns3_get_rss_key_size is u32. But a negative value is returned. This patch fixes it by replacing the negative value with zero. Signed-off-by: Fuyun Liang Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | 2 +- 1 file changed

[PATCH net-next 4/5] net: hns3: fix for not initializing VF rss_hash_key problem

2018-03-23 Thread Peng Li
From: Fuyun Liang Default rss_hash_key value should be given to all vports. But just the PF rss_hash_key has the default value here. This patch adds rss_hash_key Initialization for all vports. Signed-off-by: Fuyun Liang Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hns3pf

[PATCH net-next 00/11] fix some bugs for HNS3 driver

2018-03-21 Thread Peng Li
: fix for not returning problem in get_link_ksettings when phy exists Peng Li (2): net: hns3: fix the VF queue reset flow error net: hns3: increase the max time for IMP handle command Yunsheng Lin (2): net: hns3: fix for vlan table lost problem when resetting net: hns3: export pci table

[PATCH net-next 09/11] net: hns3: add get_link support to VF

2018-03-21 Thread Peng Li
From: Fuyun Liang This patch adds ethtool_ops.get_link support to VF. Signed-off-by: Fuyun Liang Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c| 1 + drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 8 2 files changed, 9 insertions

[PATCH net-next 11/11] net: hns3: fix for not returning problem in get_link_ksettings when phy exists

2018-03-21 Thread Peng Li
From: Fuyun Liang When phy exists, phy_ethtool_ksettings_get function is enough to get the link ksettings. If the phy exists, get_link_ksettings function can return directly after phy_ethtool_ksettings_get is called. Signed-off-by: Fuyun Liang Signed-off-by: Peng Li --- drivers/net/ethernet

[PATCH net-next 04/11] net: hns3: export pci table of hclge and hclgevf to userspace

2018-03-21 Thread Peng Li
e pci table, so this patch exports the pci table for hclge and hclgevf module too. Signed-off-by: Yunsheng Lin Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 2 ++ drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 2 ++ 2 files changed, 4 inser

[PATCH net-next 03/11] net: hns3: fix for vlan table lost problem when resetting

2018-03-21 Thread Peng Li
From: Yunsheng Lin The vlan table in hardware is clear after PF/Core/IMP/Global reset, which will cause vlan tagged packets not being received problem. This patch fixes it by restoring the vlan table after reset. Signed-off-by: Yunsheng Lin Signed-off-by: Peng Li --- drivers/net/ethernet

[PATCH net-next 01/11] net: hns3: reallocate tx/rx buffer after changing mtu

2018-03-21 Thread Peng Li
buffer and rx buffer need to be reallocated too. So calling set_mtu and buffer_alloc separately is better. Signed-off-by: Fuyun Liang Signed-off-by: Peng Li --- .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c| 36 +- 1 file changed, 22 insertions(+), 14 deletions

[PATCH net-next 08/11] net: hns3: fix for getting wrong link mode problem

2018-03-21 Thread Peng Li
From: Fuyun Liang Fixed link mode is returned by hns3_get_link_ksettings. It is unreasonable. This patch fixes it by adding some related functions to get link mode from hardware. Signed-off-by: Fuyun Liang Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hnae3.h| 4

[PATCH net-next 07/11] net: hns3: change the time interval of int_gl calculating

2018-03-21 Thread Peng Li
From: Fuyun Liang Since we change the update rate of int_gl from every interrupt to every one hundred interrupts, the old way to get time interval by int_gl value is not accurate. This patch calculates the time interval using the jiffies value. Signed-off-by: Fuyun Liang Signed-off-by: Peng Li

[PATCH net-next 10/11] net: hns3: add querying speed and duplex support to VF

2018-03-21 Thread Peng Li
From: Fuyun Liang This patch adds support for querying speed and duplex by ethtool ethX to VF. Signed-off-by: Fuyun Liang Signed-off-by: Peng Li --- .../net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c | 8 ++-- .../ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 22

[PATCH net-next 05/11] net: hns3: increase the max time for IMP handle command

2018-03-21 Thread Peng Li
It may need more time for IMP handle some command, such as reset. This patch enlarges the max time for cmd timeout. Driver will check the IMP result every us, it may break through the loop when get the right result. So not all command need the max time. Signed-off-by: Peng Li --- drivers/net

[PATCH net-next 06/11] net: hns3: change GL update rate

2018-03-21 Thread Peng Li
. Signed-off-by: Fuyun Liang Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 8 drivers/net/ethernet/hisilicon/hns3/hns3_enet.h | 2 ++ 2 files changed, 10 insertions(+) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet

[PATCH net-next 02/11] net: hns3: fix the VF queue reset flow error

2018-03-21 Thread Peng Li
reset flow as the correct step. Signed-off-by: Peng Li --- .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c| 37 ++ .../ethernet/hisilicon/hns3/hns3pf/hclge_main.h| 1 + .../net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c | 11 --- .../ethernet/hisilicon/hns3/hns3vf

[PATCH net-next 09/23] {topost} net: hns3: add support for querying pfc puase packets statistic

2018-03-07 Thread Peng Li
This patch add support for querying pfc puase packets statistic in hclge_ieee_getpfc, which is used to tell user how many pfc puase packets have been sent and received by this mac port. Signed-off-by: Yunsheng Lin Signed-off-by: Peng Li --- .../net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c

[PATCH net-next 16/23] {topost} net: hns3: fix for coalesce configuration lost during reset

2018-03-07 Thread Peng Li
. Signed-off-by: Yunsheng Lin Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 156 +--- 1 file changed, 114 insertions(+), 42 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3

[PATCH net-next 22/23] {topost} net: hns3: set the max ring num when alloc netdev

2018-03-07 Thread Peng Li
HNS3 driver should alloc netdev with max support ring num, as driver support change netdev count by ethtool -L. Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 27 - 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/drivers/net

[PATCH net-next 15/23] {topost} net: hns3: refactor the get/put_vector function

2018-03-07 Thread Peng Li
Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hnae3.h| 3 +++ drivers/net/ethernet/hisilicon/hns3/hns3_enet.c| 4 .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c| 28 -- .../ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 12

  1   2   >