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

2018-08-26 Thread Peng Li
s: 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 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 net-next 4/5] net: hns3: fix for not initializing VF rss_hash_key problem

2018-03-23 Thread Peng Li
From: Fuyun Liang <liangfuy...@huawei.com> 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 <liangfuy...@huawei.com> Signed-off

[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 <liangfuy...@huawei.com> 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 <liangfuy...@huawei.com> Signed-off-by: Peng Li <lipen

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

2018-03-23 Thread Peng Li
for 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 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 <liangfuy...@huawei.com> 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 <liangfuy...@huawei.com> Signed-off-by: Peng Li <lipen

[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 <lipeng...@huawei.

[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 <liangfuy...@huawei.com> 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 <liangfuy...@huawei.com> Signed-off-by: Peng Li <lipeng...@huawei.co

[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 <lipeng...@huawei.com> --- .../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 --- .../et

[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 <lip

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

2018-03-21 Thread Peng Li
From: Fuyun Liang <liangfuy...@huawei.com> This patch adds support for querying speed and duplex by ethtool ethX to VF. Signed-off-by: Fuyun Liang <liangfuy...@huawei.com> Signed-off-by: Peng Li <lipeng...@huawei.com> --- .../net/ethernet/hisilicon/hns3/hns3p

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

2018-03-21 Thread Peng Li
From: Fuyun Liang <liangfuy...@huawei.com> 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 <liangfuy...@huawei.com> Signed-off-by: Pen

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

2018-03-21 Thread Peng Li
When the tc_num is changed, the tx buffer and rx buffer need to be reallocated too. So calling set_mtu and buffer_alloc separately is better. Signed-off-by: Fuyun Liang <liangfuy...@huawei.com> Signed-off-by: Peng Li <lipeng...@huawei.com> --- .../ethernet/hisilicon/hns3/hns3pf/hc

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

2018-03-21 Thread Peng Li
Liang <liangfuy...@huawei.com> Signed-off-by: Peng Li <lipeng...@huawei.com> --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 46 - drivers/net/ethernet/hisilicon/hns3/hns3_enet.h | 1 + 2 files changed, 30 insertions(+), 17 deletions(-) diff --git a/dr

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

2018-03-21 Thread Peng Li
uawei.com> Signed-off-by: Peng Li <lipeng...@huawei.com> --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 26 + drivers/net/ethernet/hisilicon/hns3/hns3_enet.h | 3 +++ 2 files changed, 29 insertions(+) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_ene

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

2018-03-21 Thread Peng Li
From: Fuyun Liang <liangfuy...@huawei.com> This patch adds ethtool_ops.get_link support to VF. Signed-off-by: Fuyun Liang <liangfuy...@huawei.com> Signed-off-by: Peng Li <lipeng...@huawei.com> --- drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c| 1 + drivers/net/

[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
uawei.com> Signed-off-by: Peng Li <lipeng...@huawei.com> --- drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c b/drivers/net/ethernet/hisilicon/hns3/hns3_ethto

[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 04/11] net: hns3: export pci table of hclge and hclgevf to userspace

2018-03-21 Thread Peng Li
et has already exported the pci table, so this patch exports the pci table for hclge and hclgevf module too. Signed-off-by: Yunsheng Lin <linyunsh...@huawei.com> Signed-off-by: Peng Li <lipeng...@huawei.com> --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 2 ++ drivers/net/

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

2018-03-21 Thread Peng Li
efined by HNS3_INT_ADAPT_DOWN_START. Signed-off-by: Fuyun Liang <liangfuy...@huawei.com> Signed-off-by: Peng Li <lipeng...@huawei.com> --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 8 drivers/net/ethernet/hisilicon/hns3/hns3_enet.h | 2 ++ 2 files changed, 10 inserti

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

2018-03-09 Thread Peng Li
3: Add HNS3 Acceleration Engine & Compatibility Layer Support") Signed-off-by: Fuyun Liang <liangfuy...@huawei.com> Signed-off-by: Peng Li <lipeng...@huawei.com> --- drivers/net/ethernet/hisilicon/hns3/hnae3.h | 3 ++- drivers/net/ethernet/hisilicon/hns3/hns3_enet.

[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
roblem. This patch fixes it by updating the link state in ae_stop function. Signed-off-by: Fuyun Liang <liangfuy...@huawei.com> Signed-off-by: Peng Li <lipeng...@huawei.com> --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 3 +++ drivers/net/ethernet/hisilicon/hns3/hns3vf/

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

2018-03-09 Thread Peng Li
From: Fuyun Liang <liangfuy...@huawei.com> 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 <liangfuy...@huawei.com> Signed-off-by: Peng Li <lipen

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

2018-03-09 Thread Peng Li
uawei.com> Signed-off-by: Peng Li <lipeng...@huawei.com> --- drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | 16 1 file changed, 16 insertions(+) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c inde

[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 03/12] net: hns3: fix for ipv6 address loss problem after setting channels

2018-03-09 Thread Peng Li
eplace dev_open. Signed-off-by: Fuyun Liang <liangfuy...@huawei.com> Signed-off-by: Peng Li <lipeng...@huawei.com> --- 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_ene

[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 <linyunsh...@huawei.com> Signed-off-by: Peng Li <lipeng...@huawei.com>

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

2018-03-09 Thread Peng Li
d send fail, return -EIO. For invalid op code, return -EINVAL. Fixes: 46a3df9f9718 ("net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support") Signed-off-by: Jian Shen <shenjia...@huawei.com> Signed-off-by: Peng Li <lipeng...@huawei.com> --- drivers/ne

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

2018-03-09 Thread Peng Li
ed-off-by: Jian Shen <shenjia...@huawei.com> Signed-off-by: Peng Li <lipeng...@huawei.com> --- 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

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

2018-03-09 Thread Peng Li
From: Jian Shen <shenjia...@huawei.com> 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 <shenjia...@h

[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 <lipeng...@huawei.com> --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 10

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

2018-03-09 Thread Peng Li
("net: hns3: Add mailbox support to PF driver") Signed-off-by: Yunsheng Lin <linyunsh...@huawei.com> Signed-off-by: Peng Li <lipeng...@huawei.com> --- drivers/net/ethernet/hisilicon/hns3/hclge_mbx.h| 2 + .../net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c | 19 -

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

2018-03-09 Thread Peng Li
ddress in the mac_vlan 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 <shenjia...@huawei.com> Signed-off-by: Peng Li <lipeng...@huawei.com> --- drivers/ne

[PATCH net-next 1/9] net: hns3: refactor the hclge_get/set_rss function

2018-03-08 Thread Peng Li
From: Yunsheng Lin <linyunsh...@huawei.com> This patch refactors the hclge_get/set_rss function in order to fix the rss configuration loss problem during reset process. Signed-off-by: Yunsheng Lin <linyunsh...@huawei.com> Signed-off-by: Peng Li <lipeng...@huawei.com> --- .../

[PATCH net-next 4/9] net: hns3: fix for pause configuration lost during reset

2018-03-08 Thread Peng Li
ration to default value. Signed-off-by: Yunsheng Lin <linyunsh...@huawei.com> Signed-off-by: Peng Li <lipeng...@huawei.com> --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/h

[PATCH net-next 5/9] net: hns3: fix for use-after-free when setting ring parameter

2018-03-08 Thread Peng Li
he memory in hns3_uninit_all_ring, and uses hns3_put_ring_config to free it when necessary. Signed-off-by: Yunsheng Lin <linyunsh...@huawei.com> Signed-off-by: Peng Li <lipeng...@huawei.com> --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 10 +- 1 file changed, 5 inser

[PATCH net-next 8/9] net: hns3: refactor the coalesce related struct

2018-03-08 Thread Peng Li
; Signed-off-by: Peng Li <lipeng...@huawei.com> --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c| 46 +++--- drivers/net/ethernet/hisilicon/hns3/hns3_enet.h| 10 +++-- drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | 26 +++- 3 files changed, 46 insertion

[PATCH net-next 7/9] net: hns3: fix for coalesce configuration lost during reset

2018-03-08 Thread Peng Li
which will not be called in the reset process. Signed-off-by: Yunsheng Lin <linyunsh...@huawei.com> Signed-off-by: Peng Li <lipeng...@huawei.com> --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 156 +--- 1 file changed, 114 insertions(+), 42 deletions(-) diff --git a/dr

[PATCH net-next 0/9] fixes for configuration lost problems

2018-03-08 Thread Peng Li
This patchset refactors some functions and some bugs in order to fix the configuration loss problem when resetting and setting channel number. Yunsheng Lin (9): net: hns3: refactor the hclge_get/set_rss function net: hns3: refactor the hclge_get/set_rss_tuple function net: hns3: fix for RSS

[PATCH net-next 2/9] net: hns3: refactor the hclge_get/set_rss_tuple function

2018-03-08 Thread Peng Li
From: Yunsheng Lin <linyunsh...@huawei.com> This patch refactors the hclge_get/set_rss_tuple function in order to fix the rss configuration loss problem during reset process. Signed-off-by: Yunsheng Lin <linyunsh...@huawei.com> Signed-off-by: Peng Li <lipeng...@huawei.com>

[PATCH net-next 9/9] net: hns3: fix for coal configuation lost when setting the channel

2018-03-08 Thread Peng Li
Signed-off-by: Yunsheng Lin <linyunsh...@huawei.com> Signed-off-by: Peng Li <lipeng...@huawei.com> --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 37 +++-- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3

[PATCH net-next 6/9] net: hns3: refactor the get/put_vector function

2018-03-08 Thread Peng Li
rocess. Signed-off-by: Yunsheng Lin <linyunsh...@huawei.com> Signed-off-by: Peng Li <lipeng...@huawei.com> --- drivers/net/ethernet/hisilicon/hns3/hnae3.h| 3 +++ drivers/net/ethernet/hisilicon/hns3/hns3_enet.c| 4 .../ethernet/hisilicon/hns3/hns3pf/hc

[PATCH net-next 3/9] net: hns3: fix for RSS configuration loss problem during reset

2018-03-08 Thread Peng Li
reset process. Signed-off-by: Yunsheng Lin <linyunsh...@huawei.com> Signed-off-by: Peng Li <lipeng...@huawei.com> --- .../net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c | 2 + .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c| 107 ++--- .../ethernet/hisilicon/hns3/h

[Patch net-next 0/6] fix some bugs for hns3 driver

2018-03-08 Thread Peng Li
This patchset fix some bugs for hns3 driver. [Patch 1/6 - Patch 3/6] fix bugs related about VF driver. [Patch 3/6 - Patch 6/6] fix the bugs about ethtool_ops.set_channels. Peng Li (6): net: hns3: VF should get the real rss_size instead of rss_size_max net: hns3: set the cmdq out_vld bit to 0

[Patch net-next 4/6] net: hns3: fix the queue id for tqp enable&

2018-03-08 Thread Peng Li
Command HCLGE_OPC_CFG_COM_TQP_QUEUE should use queue id in the function, but command HCLGE_OPC_RESET_TQP_QUEUE should use global queue id. This patch fixes the queue id about queue enable/disable/reset. Signed-off-by: Peng Li <lipeng...@huawei.com> --- .../ethernet/hisilicon/hns3/

[Patch net-next 1/6] net: hns3: VF should get the real rss_size instead of rss_size_max

2018-03-08 Thread Peng Li
VF driver should get the real rss_size which is assigned by host PF, not rss_size_max. Signed-off-by: Peng Li <lipeng...@huawei.com> --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/hisilico

[Patch net-next 3/6] net: hns3: fix endian issue when PF get mbx message flag

2018-03-08 Thread Peng Li
This patch fixes the endian issue when PF get mbx message flag. Signed-off-by: Peng Li <lipeng...@huawei.com> --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/

[Patch net-next 5/6] net: hns3: set the max ring num when alloc netdev

2018-03-08 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 <lipeng...@huawei.com> --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 27 - 1 file changed, 13 insertions(+), 14 del

[Patch net-next 6/6] net: hns3: add support for VF driver inner interface hclgevf_ops.get_tqps_and_rss_info

2018-03-08 Thread Peng Li
This patch adds support for VF driver inner interface hclgevf_ops.get_tqps_and_rss_info. This interface will be used in the initialization process. Signed-off-by: Peng Li <lipeng...@huawei.com> --- drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 10 ++ 1 file chang

[Patch net-next 2/6] net: hns3: set the cmdq out_vld bit to 0 after used

2018-03-08 Thread Peng Li
Driver check the out_vld bit when get a new cmdq BD, if the bit is 1, the BD is valid. driver Should set the bit 0 after used and hw will set the bit 1 if get a valid BD. Signed-off-by: Peng Li <lipeng...@huawei.com> --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c | 1 + drive

[PATCH net-next 01/23] {topost} net: hns3: VF should get the real rss_size instead of rss_size_max

2018-03-07 Thread Peng Li
VF driver should get the real rss_size which is assigned by host PF, not rss_size_max. Signed-off-by: Peng Li <lipeng...@huawei.com> --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/hisilico

[PATCH net-next 06/23] {topost} net: hns3: fix for ipv6 address loss problem after setting channels

2018-03-07 Thread Peng Li
eplace dev_open. Signed-off-by: Fuyun Liang <liangfuy...@huawei.com> Signed-off-by: Peng Li <lipeng...@huawei.com> --- 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_ene

[PATCH net-next 12/23] {topost} net: hns3: fix for RSS configuration loss problem during reset

2018-03-07 Thread Peng Li
reset process. Signed-off-by: Yunsheng Lin <linyunsh...@huawei.com> Signed-off-by: Peng Li <lipeng...@huawei.com> --- .../net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c | 2 + .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c| 107 ++--- .../ethernet/hisilicon/hns3/h

[PATCH net-next 05/23] {topost} net: hns3: fix for netdev not running problem after calling net_stop and net_open

2018-03-07 Thread Peng Li
roblem. This patch fixes it by updating the link state in ae_stop function. Signed-off-by: Fuyun Liang <liangfuy...@huawei.com> Signed-off-by: Peng Li <lipeng...@huawei.com> --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 3 +++ drivers/net/ethernet/hisilicon/hns3/hns3vf/

[PATCH net-next 00/23] net: hns3: HNS3 bug fixes & code improvements

2018-03-07 Thread Peng Li
: fix for ipv6 address loss problem after setting channels {topost} net: hns3: unify the pause params setup function Peng Li (8): {topost} net: hns3: VF should get the real rss_size instead of rss_size_max {topost} net: hns3: set the cmdq out_vld bit to 0 after used {topost} net: hns3

[PATCH net-next 08/23] {topost} net: hns3: fix rx path skb->truesize reporting bug

2018-03-07 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 <lipeng...@huawei.com> --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 10

[PATCH net-next 14/23] {topost} net: hns3: fix for use-after-free when setting ring parameter

2018-03-07 Thread Peng Li
he memory in hns3_uninit_all_ring, and uses hns3_put_ring_config to free it when necessary. Signed-off-by: Yunsheng Lin <linyunsh...@huawei.com> Signed-off-by: Peng Li <lipeng...@huawei.com> --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 10 +- 1 file changed, 5 inser

[PATCH net-next 11/23] {topost} net: hns3: refactor the hclge_get/set_rss_tuple function

2018-03-07 Thread Peng Li
From: Yunsheng Lin <linyunsh...@huawei.com> This patch refactors the hclge_get/set_rss_tuple function in order to fix the rss configuration loss problem during reset process. Signed-off-by: Yunsheng Lin <linyunsh...@huawei.com> Signed-off-by: Peng Li <lipeng...@huawei.com>

[PATCH net-next 07/23] {topost} net: hns3: unify the pause params setup function

2018-03-07 Thread Peng Li
From: Fuyun Liang <liangfuy...@huawei.com> 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 <liangfuy...@huawei.com> Signed-off-by: Peng Li <lipen

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

2018-03-07 Thread Peng Li
ration to default value. Signed-off-by: Yunsheng Lin <linyunsh...@huawei.com> Signed-off-by: Peng Li <lipeng...@huawei.com> --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/h

[PATCH net-next 02/23] {topost} net: hns3: add existence check when remove old uc mac address

2018-03-07 Thread Peng Li
3: Add HNS3 Acceleration Engine & Compatibility Layer Support") Signed-off-by: Fuyun Liang <liangfuy...@huawei.com> Signed-off-by: Peng Li <lipeng...@huawei.com> --- drivers/net/ethernet/hisilicon/hns3/hnae3.h | 3 ++- drivers/net/ethernet/hisilicon/hns3/hns3_enet.

[PATCH net-next 10/23] {topost} net: hns3: refactor the hclge_get/set_rss function

2018-03-07 Thread Peng Li
From: Yunsheng Lin <linyunsh...@huawei.com> This patch refactors the hclge_get/set_rss function in order to fix the rss configuration loss problem during reset process. Signed-off-by: Yunsheng Lin <linyunsh...@huawei.com> Signed-off-by: Peng Li <lipeng...@huawei.com> --- .../

[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 <linyunsh...@huawei.com> Signed-off-by: Peng Li <lipeng...@huawei.com>

[PATCH net-next 19/23] {topost} net: hns3: fix for loopback failure when vlan filter is enable

2018-03-07 Thread Peng Li
uawei.com> Signed-off-by: Peng Li <lipeng...@huawei.com> --- drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | 16 1 file changed, 16 insertions(+) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c inde

[PATCH net-next 03/23] {topost} net: hns3: set the cmdq out_vld bit to 0 after used

2018-03-07 Thread Peng Li
Driver check the out_vld bit when get a new cmdq BD, if the bit is 1, the BD is valid. driver Should set the bit 0 after used and hw will set the bit 1 if get a valid BD. Signed-off-by: Peng Li <lipeng...@huawei.com> --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c | 1 + drive

[PATCH net-next 18/23] {topost} net: hns3: fix for coal configuation lost when setting the channel

2018-03-07 Thread Peng Li
Signed-off-by: Yunsheng Lin <linyunsh...@huawei.com> Signed-off-by: Peng Li <lipeng...@huawei.com> --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 37 +++-- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3

[PATCH net-next 17/23] {topost} net: hns3: refactor the coalesce related struct

2018-03-07 Thread Peng Li
; Signed-off-by: Peng Li <lipeng...@huawei.com> --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c| 46 +++--- drivers/net/ethernet/hisilicon/hns3/hns3_enet.h| 10 +++-- drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | 26 +++- 3 files changed, 46 insertion

[PATCH net-next 23/23] {topost} net: hns3: add support for VF driver inner interface hclgevf_ops.get_tqps_and_rss_info

2018-03-07 Thread Peng Li
This patch adds support for VF driver inner interface hclgevf_ops.get_tqps_and_rss_info. This interface will be used in the initialization process. Signed-off-by: Peng Li <lipeng...@huawei.com> --- drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 10 ++ 1 file chang

[PATCH net-next 20/23] {topost} net: hns3: fix for buffer overflow smatch warning

2018-03-07 Thread Peng Li
("net: hns3: Add mailbox support to PF driver") Signed-off-by: Yunsheng Lin <linyunsh...@huawei.com> Signed-off-by: Peng Li <lipeng...@huawei.com> --- drivers/net/ethernet/hisilicon/hns3/hclge_mbx.h| 2 + .../net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c | 19 -

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

2018-03-07 Thread Peng Li
rocess. Signed-off-by: Yunsheng Lin <linyunsh...@huawei.com> Signed-off-by: Peng Li <lipeng...@huawei.com> --- drivers/net/ethernet/hisilicon/hns3/hnae3.h| 3 +++ drivers/net/ethernet/hisilicon/hns3/hns3_enet.c| 4 .../ethernet/hisilicon/hns3/hns3pf/hc

[PATCH net-next 21/23] {topost} net: hns3: fix the queue id for tqp enable&

2018-03-07 Thread Peng Li
Command HCLGE_OPC_CFG_COM_TQP_QUEUE should use queue id in the function, but command HCLGE_OPC_RESET_TQP_QUEUE should use global queue id. This patch fixes the queue id about queue enable/disable/reset. Signed-off-by: Peng Li <lipeng...@huawei.com> --- .../ethernet/hisilicon/hns3/

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

2018-03-07 Thread Peng Li
which will not be called in the reset process. Signed-off-by: Yunsheng Lin <linyunsh...@huawei.com> Signed-off-by: Peng Li <lipeng...@huawei.com> --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 156 +--- 1 file changed, 114 insertions(+), 42 deletions(-) diff --git a/dr

[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 <lipeng...@huawei.com> --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 27 - 1 file changed, 13 insertions(+), 14 del

[PATCH net-next 04/23] {topost} net: hns3: fix endian issue when PF get mbx message flag

2018-03-07 Thread Peng Li
This patch fixes the endian issue when PF get mbx message flag. Signed-off-by: Peng Li <lipeng...@huawei.com> --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/

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

2018-01-26 Thread Peng Li
Liang <liangfuy...@huawei.com> Signed-off-by: Peng Li <lipeng...@huawei.com> --- drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c b/drivers/net/ethernet/hisilicon/hns3/hns3_ethto

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

2018-01-26 Thread Peng Li
Add HNS3 VF HCL(Hardware Compatibility Layer) Support") Signed-off-by: Fuyun Liang <liangfuy...@huawei.com> Signed-off-by: Peng Li <lipeng...@huawei.com> --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c| 8 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclge

[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 V2 net-next 1/4] net: hns3: add support for get_regs

2018-01-18 Thread Peng Li
From: Fuyun Liang <liangfuy...@huawei.com> This patch adds get_regs support for ethtool cmd. Signed-off-by: Fuyun Liang <liangfuy...@huawei.com> Signed-off-by: Peng Li <lipeng...@huawei.com> --- drivers/net/ethernet/hisilicon/hns3/hnae3.h| 3 +- drivers/net/ether

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

2018-01-18 Thread Peng Li
From: Fuyun Liang <liangfuy...@huawei.com> 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 <liangfuy...@huawei.com> Signed-off

[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.

[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 <shenjia...@huawei.com> 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 <shenjia...@huawei.com> Signed-off-by: Peng Li <lipeng...@huawei.com> --- .../net/

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

2018-01-18 Thread Peng Li
From: Jian Shen <shenjia...@huawei.com> Add led location support for fiber port. The led will keep blinking when locating. Signed-off-by: Jian Shen <shenjia...@huawei.com> Signed-off-by: Peng Li <lipeng...@huawei.com> --- drivers/net/ethernet/hisilicon/hns3/hnae3.h|

[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.

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

2018-01-17 Thread Peng Li
From: Jian Shen <shenjia...@huawei.com> 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 <shenjia...@huawei.com> Signed-off-by: Peng Li <lipeng...@huawei.com> --- .../net/

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

2018-01-17 Thread Peng Li
From: Fuyun Liang <liangfuy...@huawei.com> This patch adds get_regs support for ethtool cmd. Signed-off-by: Fuyun Liang <liangfuy...@huawei.com> Signed-off-by: Peng Li <lipeng...@huawei.com> --- drivers/net/ethernet/hisilicon/hns3/hnae3.h| 3 +- drivers/net/ether

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

2018-01-17 Thread Peng Li
From: Jian Shen <shenjia...@huawei.com> Add led location support for phy device. The led will keep blinking with frequency 2HZ when locating. Signed-off-by: Jian Shen <shenjia...@huawei.com> Signed-off-by: Peng Li <lipeng...@huawei.com> --- drivers/net/ethernet/hisi

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

2018-01-17 Thread Peng Li
From: Jian Shen <shenjia...@huawei.com> Add led location support for fiber port. The led will keep blinking when locating. Signed-off-by: Jian Shen <shenjia...@huawei.com> Signed-off-by: Peng Li <lipeng...@huawei.com> --- .../net/ethernet/hisilicon/hns3/hns3pf

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

2018-01-17 Thread Peng Li
From: Fuyun Liang <liangfuy...@huawei.com> 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 <liangfuy...@huawei.com> Signed-off

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

2018-01-12 Thread Peng Li
Fuyun Liang <liangfuy...@huawei.com> Signed-off-by: Peng Li <lipeng...@huawei.com> --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 12 1 file changed, 12 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3

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

2018-01-12 Thread Peng Li
) Signed-off-by: Jian Shen <shenjia...@huawei.com> Signed-off-by: Peng Li <lipeng...@huawei.com> --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 27 ++--- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_en

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

2018-01-12 Thread Peng Li
update the TX GL and the RX GL separately, making user can enable TX GL self-adaptive or RX GL self-adaptive individually. Signed-off-by: Fuyun Liang <liangfuy...@huawei.com> Signed-off-by: Peng Li <lipeng...@huawei.com> --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 35 ++

[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 09/11] net: hns3: add int_gl_idx setup for TX and RX queues

2018-01-11 Thread Peng Li
h adds the int_gl_idx setup for TX queues and RX queues. Fixes: 76ad4f0ee747 ("net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC") Signed-off-by: Fuyun Liang <liangfuy...@huawei.com> Signed-off-by: Peng Li <lipeng...@huawei.com> --- drivers/net/ethernet/hisilicon/h

[PATCH V2 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 <lipeng...@huawei.com> --- drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | 1 + .../ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 30 ++ 2 files changed, 31 insertions(+) diff

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

2018-01-11 Thread Peng Li
uawei.com> Signed-off-by: Peng Li <lipeng...@huawei.com> --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 29 + 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3

[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 <liangfuy...@huawei.com> This patch adds ethtool_ops.set_coalesce support to PF. Signed-off-by: Fuyun Liang <liangfuy...@huawei.com> Signed-off-by: Peng Li <lipeng...@huawei.com> --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c| 34 - drivers/net/

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

2018-01-11 Thread Peng Li
uawei.com> Signed-off-by: Peng Li <lipeng...@huawei.com> --- drivers/net/ethernet/hisilicon/hns3/hnae3.h| 2 ++ drivers/net/ethernet/hisilicon/hns3/hns3_enet.h| 1 + drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | 37 ++ 3 files changed, 40 inserti

[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 <shenjia...@huawei.com> It's necessary to check hook whether being defined before calling, improve the reliability. Signed-off-by: Jian Shen <shenjia...@huawei.com> Signed-off-by: Peng Li <lipeng...@huawei.com> --- drivers/net/ethernet/hisilicon/hns3/hns3_en

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

2018-01-11 Thread Peng Li
-by: Fuyun Liang <liangfuy...@huawei.com> Signed-off-by: Peng Li <lipeng...@huawei.com> --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.h | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h b/drivers/net/ethernet/hi

  1   2   >