linux-kernel@vger.kernel.org

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 --- .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c| 50

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

2018-03-07 Thread Peng Li
nsheng Lin Signed-off-by: Peng Li --- 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_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c index a0ba25f..b02f

[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 --- drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 10 ++ 1 file changed, 10 insertions(+) diff --git

[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 17/23] {topost} net: hns3: refactor the coalesce related struct

2018-03-07 Thread Peng Li
From: Yunsheng Lin This patch refoctors the coalesce related struct by introducing the hns3_enet_coalesce struct, in order to fix the coalesce configuation lost problem when changing the channel number. Signed-off-by: Yunsheng Lin Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon

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

2018-03-07 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 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 --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c | 1 + drivers/net/ethernet/hisilicon

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

2018-03-07 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 02/23] {topost} net: hns3: add existence check when remove old uc mac address

2018-03-07 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 10/23] {topost} net: hns3: refactor the hclge_get/set_rss function

2018-03-07 Thread Peng Li
From: Yunsheng Lin 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 Signed-off-by: Peng Li --- .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c| 39 -- .../ethernet

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

2018-03-07 Thread Peng Li
: Yunsheng Lin Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index

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

2018-03-07 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 14/23] {topost} net: hns3: fix for use-after-free when setting ring parameter

2018-03-07 Thread Peng Li
ing, and uses hns3_put_ring_config to free it when necessary. Signed-off-by: Yunsheng Lin Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c

[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 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 Signed-off-by: Peng Li --- .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c| 91

[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 --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 10 -- 1 file changed

[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 --- 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/hns3pf/hclge_mbx.c b/drivers/net

[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
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 12/23] {topost} net: hns3: fix for RSS configuration loss problem during reset

2018-03-07 Thread Peng Li
: Yunsheng Lin Signed-off-by: Peng Li --- .../net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c | 2 + .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c| 107 ++--- .../ethernet/hisilicon/hns3/hns3pf/hclge_main.h| 1 + 3 files changed, 56 insertions(+), 54 deletions(-) diff

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

2018-03-07 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 1bebfd9..83f4b36 100644 --- a

[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 --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c b

[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 --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c | 1 + drivers/net/ethernet/hisilicon

[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 --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 27 - 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/drivers/net

[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 --- drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 10 ++ 1 file changed, 10 insertions(+) diff --git

[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 --- 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/hns3pf/hclge_mbx.c b/drivers/net

[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 --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c b

[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

linux-kernel@vger.kernel.org

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 --- .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c| 50

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

2018-03-08 Thread Peng Li
: Yunsheng Lin Signed-off-by: Peng Li --- .../net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c | 2 + .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c| 107 ++--- .../ethernet/hisilicon/hns3/hns3pf/hclge_main.h| 1 + 3 files changed, 56 insertions(+), 54 deletions(-) diff

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

2018-03-08 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

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

2018-03-08 Thread Peng Li
nsheng Lin Signed-off-by: Peng Li --- 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_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c index f466f60..0a8c

[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 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 Signed-off-by: Peng Li --- .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c| 91

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

2018-03-08 Thread Peng Li
From: Yunsheng Lin This patch refoctors the coalesce related struct by introducing the hns3_enet_coalesce struct, in order to fix the coalesce configuation lost problem when changing the channel number. Signed-off-by: Yunsheng Lin Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon

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

2018-03-08 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 5/9] net: hns3: fix for use-after-free when setting ring parameter

2018-03-08 Thread Peng Li
ing, and uses hns3_put_ring_config to free it when necessary. Signed-off-by: Yunsheng Lin Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c

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

2018-03-08 Thread Peng Li
: Yunsheng Lin Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index

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

2018-03-08 Thread Peng Li
From: Yunsheng Lin 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 Signed-off-by: Peng Li --- .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c| 39 -- .../ethernet

[PATCH net-next 07/12] net: hns3: update coalesce param per second

2018-12-18 Thread Peng Li
param 100% in time, but the lag time is very short. Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 8 +++- drivers/net/ethernet/hisilicon/hns3/hns3_enet.h | 4 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3

[PATCH net-next 12/12] net: hns3: fix a SSU buffer checking bug

2018-12-18 Thread Peng Li
: 46a3df9f9718 ("net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support") Signed-off-by: Yunsheng Lin Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethe

[PATCH net-next 09/12] net: hns3: synchronize speed and duplex from phy when phy link up

2018-12-18 Thread Peng Li
Driver calls phy_connect_direct and registers hclge_mac_adjust_link to synchronize mac speed and duplex from phy. It is better to synchronize mac speed and duplex from phy when phy link up. Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c | 4 1 file

[PATCH net-next 06/12] net: hns3: fix incomplete uninitialization of IRQ in the hns3_nic_uninit_vector_data()

2018-12-18 Thread Peng Li
. Fixes: 424eb834a9be ("net: hns3: Unified HNS3 {VF|PF} Ethernet Driver for hip08 SoC") Signed-off-by: Huazhong Tan Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/net/ether

[PATCH net-next 03/12] net: hns3: fix napi_disable not return problem

2018-12-18 Thread Peng Li
t;net: hns3: stop napi polling when HNS3_NIC_STATE_DOWN is set") Signed-off-by: Huazhong Tan 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/d

[PATCH net-next 01/12] net: hns3: fix error handling int the hns3_get_vector_ring_chain

2018-12-18 Thread Peng Li
ain. This patch fixes them. Fixes: 73b907a083b8 ("net: hns3: bugfix for buffer not free problem during resetting") Signed-off-by: Huazhong Tan Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git

[PATCH net-next 04/12] net: hns3: update some variables while hclge_reset()/hclgevf_reset() done

2018-12-18 Thread Peng Li
hnae3_ae_dev to HNAE3_NONE_RESET. Signed-off-by: Huazhong Tan Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 5 - drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/net

[PATCH net-next 00/12] net: hns3: code optimizations & bugfixes for HNS3 driver

2018-12-18 Thread Peng Li
net: hns3: fix napi_disable not return problem net: hns3: update some variables while hclge_reset()/hclgevf_reset() done net: hns3: remove unnecessary configuration recapture while resetting net: hns3: fix incomplete uninitialization of IRQ in the hns3_nic_uninit_vector_data() Peng

[PATCH net-next 10/12] net: hns3: getting tx and dv buffer size through firmware

2018-12-18 Thread Peng Li
ff-by: Yunsheng Lin Signed-off-by: Peng Li --- .../net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h | 5 ++- .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c| 41 -- .../ethernet/hisilicon/hns3/hns3pf/hclge_main.h| 3 ++ 3 files changed, 38 insertions(+), 11 deletions(-)

[PATCH net-next 11/12] net: hns3: aligning buffer size in SSU to 256 bytes

2018-12-18 Thread Peng Li
From: Yunsheng Lin The hardware expects the buffer size set to SSU is aligned to 256 bytes, this patch aligns the buffer size to 256 byte using roundup or rounddown function. Signed-off-by: Yunsheng Lin Signed-off-by: Peng Li --- .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c| 43

[PATCH net-next 08/12] net: hns3: remove 1000M/half support of phy

2018-12-18 Thread Peng Li
From: Fuyun Liang Our phy does not support 1000M/half, this patch removes 1000M/half from PHY_SUPPORTED_FEATURES. Signed-off-by: Fuyun Liang Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a

[PATCH net-next 05/12] net: hns3: remove unnecessary configuration recapture while resetting

2018-12-18 Thread Peng Li
From: Huazhong Tan When doing reset, it is unnecessary to get the hardware's default configuration again, otherwise, the user's configuration will be overwritten. Fixes: 4ed340ab8f49 ("net: hns3: Add reset process in hclge_main") Signed-off-by: Huazhong Tan Signed-off-by: P

[PATCH net-next 02/12] net: hns3: uninitialize pci in the hclgevf_uninit

2018-12-18 Thread Peng Li
t;net: hns3: do VF's pci re-initialization while PF doing FLR") Signed-off-by: Huazhong Tan 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

[PATCH net-next 2/9] net: hns3: change default tc state to close

2018-12-19 Thread Peng Li
From: Jian Shen In original codes, default tc value is set to the max tc. It's more reasonable to close tc by changing default tc value to 1. Users can enable it with lldp tool when they want to use tc. Signed-off-by: Jian Shen Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon

[PATCH net-next 8/9] net: hns3: fix the descriptor index when get rss type

2018-12-19 Thread Peng Li
RSS hash information to RX skb") Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c index 624

[PATCH net-next 7/9] net: hns3: don't restore rules when flow director is disabled

2018-12-19 Thread Peng Li
handle for flow director") Fixes: c17852a8932f ("net: hns3: Add support for enable/disable flow director") Signed-off-by: Jian Shen Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/ne

[PATCH net-next 9/9] net: hns3: remove redundant variable initialization

2018-12-19 Thread Peng Li
This patch removes the redundant variable initialization, as driver will devm_kzalloc to set value to hdev soon. 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

[PATCH net-next 0/9] net: hns3: code optimizations & bugfixes for HNS3 driver

2018-12-19 Thread Peng Li
: add max vector number check for pf net: hns3: fix vf id check issue when add flow director rule net: hns3: don't restore rules when flow director is disabled Peng Li (3): net: hns3: fix a bug caused by udelay net: hns3: fix the descriptor index when get rss type net: hns3: r

[PATCH net-next 6/9] net: hns3: fix vf id check issue when add flow director rule

2018-12-19 Thread Peng Li
From: Jian Shen When add flow director fule for vf, the vf id is used as array subscript before valid checking, which may cause memory overflow. Fixes: dd74f815dd41 ("net: hns3: Add support for rule add/delete for flow director") Signed-off-by: Jian Shen Signed-off-by: Peng Li --

[PATCH net-next 4/9] net: hns3: add max vector number check for pf

2018-12-19 Thread Peng Li
x for coalesce configuration lost during reset") Signed-off-by: Jian Shen Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/h

[PATCH net-next 1/9] net: hns3: refine the handle for hns3_nic_net_open/stop()

2018-12-19 Thread Peng Li
(). To keep symmetrical, start the work task at the end of hns3_nic_net_open(). Signed-off-by: Jian Shen Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hnae3.h| 1 + drivers/net/ethernet/hisilicon/hns3/hns3_enet.c| 8 .../ethernet/hisilicon/hns3/hns3pf

[PATCH net-next 5/9] net: hns3: reset tqp while doing DOWN operation

2018-12-19 Thread Peng Li
emory during DOWN. Signed-off-by: Huazhong Tan Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 4 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 4 2 files changed, 8 insertions(+) diff --git a/drivers/net/ethernet/hisilicon/hns3/h

[PATCH net-next 3/9] net: hns3: fix a bug caused by udelay

2018-12-19 Thread Peng Li
udelay() in driver may always occupancy processor. If there is only one cpu in system, the VF driver may initialize fail when insmod PF and VF driver in the same system. This patch use msleep() to free cpu when VF wait PF message. Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3

[Patch net 03/10] net: hns: Some registers use wrong address according to the datasheet.

2018-12-14 Thread Peng Li
n. Signed-off-by: Yonglong Liu Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c | 242 ++--- drivers/net/ethernet/hisilicon/hns/hns_dsaf_reg.h | 12 +- 2 files changed, 127 insertions(+), 127 deletions(-) diff --git a/drivers/net/ethernet/his

[Patch net 01/10] net: hns: Incorrect offset address used for some registers.

2018-12-14 Thread Peng Li
From: Yonglong Liu According to the hip06 Datasheet: 1. The offset of INGRESS_SW_VLAN_TAG_DISC should be 0x1A00+4*all_chn_num 2. The offset of INGRESS_IN_DATA_STP_DISC should be 0x1A50+4*all_chn_num Signed-off-by: Yonglong Liu Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns

[Patch net 10/10] net: hns: Fix ping failed when use net bridge and send multicast

2018-12-14 Thread Peng Li
512 tcam entries, which indicate lower priority. And separate one promisc entry to two: mc & uc, to avoid package match the wrong tcam entry. Signed-off-by: Yonglong Liu Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c | 257 + 1 file changed,

[Patch net 04/10] net: hns: Fixed bug that netdev was opened twice

2018-12-14 Thread Peng Li
This patchset fix this bug according to the flag NIC_STATE_DOWN. Signed-off-by: Yonglong Liu Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns/hns_enet.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ethernet/hisilicon/hns/hns_enet.c b/drivers/net/ethernet

[Patch net 09/10] net: hns: Add mac pcs config when enable|disable mac

2018-12-14 Thread Peng Li
-off-by: Yonglong Liu Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns/hns_dsaf_gmac.c | 14 ++ drivers/net/ethernet/hisilicon/hns/hns_dsaf_reg.h | 1 + 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_gmac.c b

[Patch net 00/10] net: hns: Code improvements & fixes for HNS driver

2018-12-14 Thread Peng Li
This patchset introduces some code improvements and fixes for the identified problems in the HNS driver. Every patch is independent. Yonglong Liu (10): net: hns: Incorrect offset address used for some registers. net: hns: All ports can not work when insmod hns ko after rmmod. net: hns: some

[Patch net 08/10] net: hns: Fix ntuple-filters status error.

2018-12-14 Thread Peng Li
From: Yonglong Liu The ntuple-filters features is forced on by chip. But it shows "ntuple-filters: off [fixed]" when use ethtool. This patch make it correct with "ntuple-filters: on [fixed]". Signed-off-by: Yonglong Liu Signed-off-by: Peng Li --- drivers/net/ethernet/hisi

[Patch net 02/10] net: hns: All ports can not work when insmod hns ko after rmmod.

2018-12-14 Thread Peng Li
sometimes related, fixing the second case also requires fixing the first case, so fix them together. Signed-off-by: Yonglong Liu Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c | 15 +++ drivers/net/ethernet/hisilicon/hns/hns_enet.c | 3 +++ 2 files c

[Patch net 05/10] net: hns: Clean rx fbd when ae stopped.

2018-12-14 Thread Peng Li
From: Yonglong Liu If there are packets in hardware when changing the speed or duplex, it may cause hardware hang up. This patch adds the code to wait rx fbd clean up when ae stopped. Signed-off-by: Yonglong Liu Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c

[Patch net 06/10] net: hns: Free irq when exit from abnormal branch

2018-12-14 Thread Peng Li
dy requested are not release. Signed-off-by: Yonglong Liu Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns/hns_enet.c | 23 ++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/hisilicon/hns/hns_enet.c b/drivers/net/ethernet/

[Patch net 07/10] net: hns: Avoid net reset caused by pause frames storm

2018-12-14 Thread Peng Li
-by: Yonglong Liu Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns/hns_enet.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns/hns_enet.c b/drivers/net/ethernet/hisilicon/hns/hns_enet.c index 03d959c..8a53c82 100644 --

[PATCH net 0/3] net: hns: code optimizations & bugfixes for HNS driver

2019-01-26 Thread Peng Li
This patchset includes bugfixes and code optimizations for the HNS ethernet controller driver Yonglong Liu (3): net: hns: Fix for missing of_node_put() after of_parse_phandle() net: hns: Restart autoneg need return failed when autoneg off net: hns: Fix wrong read accesses via Clause 45 MDIO

[PATCH net 2/3] net: hns: Restart autoneg need return failed when autoneg off

2019-01-26 Thread Peng Li
From: Yonglong Liu The hns driver of earlier devices, when autoneg off, restart autoneg will return -EINVAL, so make the hns driver for the latest devices do the same. Signed-off-by: Yonglong Liu Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns/hns_ethtool.c | 16

[PATCH net 1/3] net: hns: Fix for missing of_node_put() after of_parse_phandle()

2019-01-26 Thread Peng Li
//lkml.org/lkml/2018/12/22/217 Fixes: 48189d6aaf1e ("net: hns: enet specifies a reference to dsaf") Reported-by: Alexey Khoroshilov Signed-off-by: Yonglong Liu Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns/hns_enet.c | 5 + 1 file changed, 5 insertions(+) diff

[PATCH net 3/3] net: hns: Fix wrong read accesses via Clause 45 MDIO protocol

2019-01-26 Thread Peng Li
From: Yonglong Liu When reading phy registers via Clause 45 MDIO protocol, after write address operation, the driver use another write address operation, so can not read the right value of any phy registers. This patch fixes it. Signed-off-by: Yonglong Liu Signed-off-by: Peng Li --- drivers

[PATCH net-next] net: hns: add ACPI mode support for ethtool -p

2017-12-29 Thread Peng Li
From: Jian Shen The locate operation interface of fiber port can only work with DT mode. Add a new interface to control the locate led for ACPI mode. Signed-off-by: Jian Shen Signed-off-by: Peng Li Tested-by: Zhou Wang --- drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c | 2 +- drivers

[PATCH V5 net-next 13/17] net: hns3: add support to update flow control settings after autoneg

2017-12-21 Thread Peng Li
When auto-negotiation is enabled, the MAC flow control settings is based on the flow control negotiation result. And it should be configured after a valid link has been established. This patch adds support to update flow control settings after auto-negotiation has completed. Signed-off-by: Peng

[PATCH V5 net-next 10/17] net: hns3: cleanup mac auto-negotiation state query

2017-12-21 Thread Peng Li
-negotiation state query. Signed-off-by: Fuyun Liang Signed-off-by: Peng Li --- .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c| 24 -- 1 file changed, 24 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon

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

2017-12-21 Thread Peng Li
V4 -> V5: 1. change the name spelling of Peng Li. V3 -> V4: 1. change the name spelling of Mingguang Qu and Jian Shen. V2 -> V3: 1. order local variables requested by David Miller. 2. use "int" for index iteration loops requested by David Miller. V1 -> V2: 1. fix the

[PATCH V5 net-next 02/17] net: hns3: add support to modify tqps number

2017-12-21 Thread Peng Li
This patch adds the support to change tqps number for PF driver by using ehtool -L command. Signed-off-by: Peng Li Signed-off-by: Mingguang Qu --- drivers/net/ethernet/hisilicon/hns3/hnae3.h| 3 + drivers/net/ethernet/hisilicon/hns3/hns3_enet.c| 122 + drivers

[PATCH V5 net-next 05/17] net: hns3: get rss_size_max from configuration but not hardcode

2017-12-21 Thread Peng Li
Add configuration for rss_size_max in hdev but not hardcode it. Signed-off-by: Peng Li Signed-off-by: Mingguang Qu --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h | 2 ++ drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 6 +- drivers/net/ethernet/hisilicon/hns3/hns3pf

[PATCH V5 net-next 03/17] net: hns3: change the returned tqp number by ethtool -x

2017-12-21 Thread Peng Li
This patch modifies the return data of get_rxnfc, it will return the current handle's rss_size but not the total tqp number. because the tc_size has been change to the log2 of roundup power of two of rss_size. Signed-off-by: Peng Li Signed-off-by: Mingguang Qu --- drivers/net/eth

[PATCH V5 net-next 12/17] net: hns3: add support for set_pauseparam

2017-12-21 Thread Peng Li
This patch adds set_pauseparam support for ethtool cmd. Signed-off-by: Peng Li Signed-off-by: Fuyun Liang --- drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | 13 .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c| 83 ++ .../net/ethernet/hisilicon/hns3/hns3pf

[PATCH V5 net-next 17/17] net: hns3: change TM sched mode to TC-based mode when SRIOV enabled

2017-12-21 Thread Peng Li
TC-based sched mode supports SRIOV enabled and SRIOV disabled. This patch change the TM sched mode to TC-based mode in initialization process. Fixes: cc9bb43ab394 ("net: hns3: Add tc-based TM support for sriov enabled port") Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/h

[PATCH V5 net-next 14/17] net: hns3: add Asym Pause support to phy default features

2017-12-21 Thread Peng Li
tised when the phy negotiates flow control. Fixes: c4fb2cdf575d ("net: hns3: fix a bug for phy supported feature initialization") Signed-off-by: Fuyun Liang Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c | 1 + 1 file changed, 1 insertion(+) diff

[PATCH V5 net-next 15/17] net: hns3: add support for querying advertised pause frame by ethtool ethx

2017-12-21 Thread Peng Li
This patch adds support for querying advertised pause frame by using ethtool command(ethtool ethx). Fixes: 496d03e960ae ("net: hns3: Add Ethtool support to HNS3 driver") Signed-off-by: Peng Li Signed-off-by: Fuyun Liang --- drivers/net/ethernet/hisilicon/hns3/hnae3.h

[PATCH V5 net-next 07/17] net: hns3: add vlan offload config command

2017-12-21 Thread Peng Li
This patch adds vlan offload config commands, initializes the rules of tx/rx vlan tag handle for hw. Signed-off-by: Peng Li Signed-off-by: Jian Shen --- .../net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h | 45 ++ .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c| 158

[PATCH V5 net-next 04/17] net: hns3: free the ring_data structrue when change tqps

2017-12-21 Thread Peng Li
This patch fixes a memory leak problems in change tqps process, the function hns3_uninit_all_ring and hns3_init_all_ring may be called many times. Signed-off-by: Peng Li Signed-off-by: Mingguang Qu --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 4 1 file changed, 4 insertions

[PATCH V5 net-next 09/17] net: hns3: add handling vlan tag offload in bd

2017-12-21 Thread Peng Li
This patch deals with the vlan tag information between sk_buff and rx/tx bd. Signed-off-by: Peng Li Signed-off-by: Jian Shen --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 83 +++-- 1 file changed, 78 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet

[PATCH V5 net-next 01/17] net: hns3: add support to query tqps number

2017-12-21 Thread Peng Li
This patch adds the support to query tqps number for PF driver by using ehtool -l command. Signed-off-by: Peng Li Signed-off-by: Mingguang Qu --- drivers/net/ethernet/hisilicon/hns3/hnae3.h | 2 ++ drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | 10 ++ .../net/ethernet

[PATCH V5 net-next 06/17] net: hns3: add a mask initialization for mac_vlan table

2017-12-21 Thread Peng Li
This patch sets vlan masked, in order to avoid the received packets being filtered. Signed-off-by: Peng Li Signed-off-by: Jian Shen --- .../net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h | 10 ++ .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c| 39 +- 2 files

[PATCH V5 net-next 16/17] net: hns3: Increase the default depth of bucket for TM shaper

2017-12-21 Thread Peng Li
Burstiness of a flow is determined by the depth of a bucket, When the upper rate of shaper is large, the current depth of a bucket is not enough. The default upper rate of shaper is 100G, so increase the depth of a bucket according to UM. Signed-off-by: Peng Li Signed-off-by: Yunsheng Lin

[PATCH V5 net-next 08/17] net: hns3: add ethtool related offload command

2017-12-21 Thread Peng Li
This patch adds offload command related to "ethtool -K". Signed-off-by: Peng Li Signed-off-by: Jian Shen --- drivers/net/ethernet/hisilicon/hns3/hnae3.h | 3 +++ drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 16 drivers/net/ethernet/hisi

[PATCH V5 net-next 11/17] net: hns3: fix for getting auto-negotiation state in hclge_get_autoneg

2017-12-21 Thread Peng Li
: 46a3df9f9718 ("net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support") Signed-off-by: Fuyun Liang Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/net/ethernet/hisilic

<    1   2