Re: [PATCH][next] net: hns3: Fix uninitialized return from function
在 2021/2/10 23:26, Colin King 写道: From: Colin Ian King Currently function hns3_reset_notify_uninit_enet is returning the contents of the uninitialized variable ret. Fix this by removing ret (since it is no longer used) and replace it with a return of the literal value 0. you can not remove "ret" this way. try to change "int hns3_uninit_all_ring" to "void hns3_uninit_all_ring" and fix related code is better. Addresses-Coverity: ("Uninitialized scalar variable") Fixes: 64749c9c38a9 ("net: hns3: remove redundant return value of hns3_uninit_all_ring()") Signed-off-by: Colin Ian King --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c index 9565b7999426..bf4302a5cf95 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c @@ -4640,7 +4640,6 @@ static int hns3_reset_notify_uninit_enet(struct hnae3_handle *handle) { struct net_device *netdev = handle->kinfo.netdev; struct hns3_nic_priv *priv = netdev_priv(netdev); - int ret; if (!test_and_clear_bit(HNS3_NIC_STATE_INITED, >state)) { netdev_warn(netdev, "already uninitialized\n"); @@ -4662,7 +4661,7 @@ static int hns3_reset_notify_uninit_enet(struct hnae3_handle *handle) hns3_put_ring_config(priv); - return ret; + return 0; } static int hns3_reset_notify(struct hnae3_handle *handle,
Re: [PATCH net-next] net: hns3: Config NIC port speed same as that of optical module
On 2019/1/1 9:22, dann frazier wrote: On Mon, Nov 26, 2018 at 06:43:00PM +, Salil Mehta wrote: From: Peng Li Port 0/1 of HiP08 supports 10G and 25G. This patch adds a change to configure NIC port speed same as that of optical module(SFP/QFSP). Driver gets the optical module speed and sets NIC port speed accordingly. Hi, I'm getting the following errors in dmesg about every 1s on a D06: [ 766.761823] hns3 :bd:00.0: get sfp speed failed -5 [ 767.785823] hns3 :bd:00.0: get sfp speed failed -5 [ 768.809820] hns3 :bd:00.0: get sfp speed failed -5 [ 769.833818] hns3 :bd:00.0: get sfp speed failed -5 Reverting this patch fixes the issue. -dann Hi,dann, Thanks for your test and report. This patch needs to match new fireware verison , And it does some work to be Compatible with older versions. Can you show me more information? can you use "ethtool -i ethx" to get the fireware version , and shows me some other message about hns3? Thanks .
Re: [PATCH NET 3/3] net: hns: add configuration constraints for 1000M half
On 2018/8/26 2:07, Andrew Lunn wrote: This patch is a theoretical protect, and the problem does not really happen. I think you really get the point, do you think we need this patch? I think it is not needed. And if it was needed, it would indicate there is a bug somewhere else. Hi, Andrew It is a theoretical protect,we can remove this patch from patchset. Thanks. Andrew .
Re: [PATCH NET 3/3] net: hns: add configuration constraints for 1000M half
On 2018/8/26 2:07, Andrew Lunn wrote: This patch is a theoretical protect, and the problem does not really happen. I think you really get the point, do you think we need this patch? I think it is not needed. And if it was needed, it would indicate there is a bug somewhere else. Hi, Andrew It is a theoretical protect,we can remove this patch from patchset. Thanks. Andrew .
Re: [PATCH net-next 00/23] net: hns3: HNS3 bug fixes & code improvements
On 2018/3/8 13:00, David Miller wrote: Sorry, this is way too large of a patch series. Please keep your series to about a dozen or so changes. Anything longer puts an unreasonable burdon upon patch reviewers, and such a large series will often make it so that nearly all reviewers are discouraged from taking a look at all. Thank you. I will split this patchset into 3 patchset: VF driver related patchset(6 patches) + reset related patchset(9 patches) + PF bugfix patchset(8 patches). I think this should be better for review. Thanks .
Re: [PATCH net-next 00/23] net: hns3: HNS3 bug fixes & code improvements
On 2018/3/8 13:00, David Miller wrote: Sorry, this is way too large of a patch series. Please keep your series to about a dozen or so changes. Anything longer puts an unreasonable burdon upon patch reviewers, and such a large series will often make it so that nearly all reviewers are discouraged from taking a look at all. Thank you. I will split this patchset into 3 patchset: VF driver related patchset(6 patches) + reset related patchset(9 patches) + PF bugfix patchset(8 patches). I think this should be better for review. Thanks .
Re: [PATCH net-next 3/5] net: hns3: add ethtool -p support for phy device
On 2018/1/18 22:25, Andrew Lunn wrote: +static int hclge_set_led_status_phy(struct phy_device *phydev, int value) +{ + int ret, cur_page; + + mutex_lock(>lock); + + ret = phy_read(phydev, HCLGE_PHY_PAGE_REG); + if (ret < 0) + goto out; + else + cur_page = ret; + + ret = phy_write(phydev, HCLGE_PHY_PAGE_REG, HCLGE_PHY_PAGE_LED); + if (ret) + goto out; + + ret = phy_write(phydev, HCLGE_LED_FC_REG, value); + if (ret) + goto out; + + ret = phy_write(phydev, HCLGE_PHY_PAGE_REG, cur_page); + +out: + mutex_unlock(>lock); + return ret; +} Sorry, but NACK. Please add an interface to phylib and the phy driver you are using to do this. #define HCLGE_PHY_PAGE_MDIX 0 #define HCLGE_PHY_PAGE_COPPER 0 +#define HCLGE_PHY_PAGE_LED 3 /* Page Selection Reg. */ #define HCLGE_PHY_PAGE_REG22 @@ -73,6 +74,15 @@ /* Copper Specific Status Register */ #define HCLGE_PHY_CSS_REG 17 +/* LED Function Control Register */ +#define HCLGE_LED_FC_REG 16 + +/* LED Polarity Control Register */ +#define HCLGE_LED_PC_REG 17 + +#define HCLGE_LED_FORCE_ON 9 +#define HCLGE_LED_FORCE_OFF8 + By the looks of these defines, you assume you have a Marvell PHY. Please make this generic so anybody with a Marvell PHY can use it. Andrew Hi Andrw, As your suggestion, we need add interface to phylib and the phy driver. We will consider your suggestion and push this patch after we fix your comments. so we will remove this patch in V2 patch-set. Thanks Peng Li .
Re: [PATCH net-next 3/5] net: hns3: add ethtool -p support for phy device
On 2018/1/18 22:25, Andrew Lunn wrote: +static int hclge_set_led_status_phy(struct phy_device *phydev, int value) +{ + int ret, cur_page; + + mutex_lock(>lock); + + ret = phy_read(phydev, HCLGE_PHY_PAGE_REG); + if (ret < 0) + goto out; + else + cur_page = ret; + + ret = phy_write(phydev, HCLGE_PHY_PAGE_REG, HCLGE_PHY_PAGE_LED); + if (ret) + goto out; + + ret = phy_write(phydev, HCLGE_LED_FC_REG, value); + if (ret) + goto out; + + ret = phy_write(phydev, HCLGE_PHY_PAGE_REG, cur_page); + +out: + mutex_unlock(>lock); + return ret; +} Sorry, but NACK. Please add an interface to phylib and the phy driver you are using to do this. #define HCLGE_PHY_PAGE_MDIX 0 #define HCLGE_PHY_PAGE_COPPER 0 +#define HCLGE_PHY_PAGE_LED 3 /* Page Selection Reg. */ #define HCLGE_PHY_PAGE_REG22 @@ -73,6 +74,15 @@ /* Copper Specific Status Register */ #define HCLGE_PHY_CSS_REG 17 +/* LED Function Control Register */ +#define HCLGE_LED_FC_REG 16 + +/* LED Polarity Control Register */ +#define HCLGE_LED_PC_REG 17 + +#define HCLGE_LED_FORCE_ON 9 +#define HCLGE_LED_FORCE_OFF8 + By the looks of these defines, you assume you have a Marvell PHY. Please make this generic so anybody with a Marvell PHY can use it. Andrew Hi Andrw, As your suggestion, we need add interface to phylib and the phy driver. We will consider your suggestion and push this patch after we fix your comments. so we will remove this patch in V2 patch-set. Thanks Peng Li .
Re: [PATCH net-next 00/11] add some new features and fix some bugs
On 2018/1/12 1:07, David Miller wrote: From: Peng LiDate: Thu, 11 Jan 2018 19:45:55 +0800 This patchset adds some new features and fixes some bugs: [patch 1/11] adds ethtool_ops.get_channels support for VF. [patch 2/11] removes TSO config command from VF driver. [patch 3/11] adds ethtool_ops.get_coalesce support to PF. [patch 4/11] adds ethtool_ops.set_coalesce support to PF. [patch 5/11 - 11/11] do some code improvements and fix some bugs. Can you please write a real commit message in your header postings please? Don't just copy the subject lines from the patches, and add one sentence with a brief description. Really write real paragraphs describing what the patch series is doing, how it is doing it, and why it is doing it that way. A real explanation that tells the reader what exactly to expect when they review the patches themselves. Thanks for your advice. A detail explanation is better for review, I will write the "real explanation" in V2 patch-set. Peng Li Thank you. .
Re: [PATCH net-next 00/11] add some new features and fix some bugs
On 2018/1/12 1:07, David Miller wrote: From: Peng Li Date: Thu, 11 Jan 2018 19:45:55 +0800 This patchset adds some new features and fixes some bugs: [patch 1/11] adds ethtool_ops.get_channels support for VF. [patch 2/11] removes TSO config command from VF driver. [patch 3/11] adds ethtool_ops.get_coalesce support to PF. [patch 4/11] adds ethtool_ops.set_coalesce support to PF. [patch 5/11 - 11/11] do some code improvements and fix some bugs. Can you please write a real commit message in your header postings please? Don't just copy the subject lines from the patches, and add one sentence with a brief description. Really write real paragraphs describing what the patch series is doing, how it is doing it, and why it is doing it that way. A real explanation that tells the reader what exactly to expect when they review the patches themselves. Thanks for your advice. A detail explanation is better for review, I will write the "real explanation" in V2 patch-set. Peng Li Thank you. .
Re: [PATCH net-next 12/20] net: hns3: Add packet statistics of netdev
On 2018/1/9 11:06, David Miller wrote: From: "lipeng (Y)" <lipeng...@huawei.com> Date: Tue, 9 Jan 2018 10:48:04 +0800 So I think it is OK if you can revert [patch 12/20 ]("net: hns3: Add packet statistics of netdev"). I think it is OK if you send the revert patch, which is what I am asking for :-) . sure, i will send the revert patch. I have tested it in my local branch. Thanks Peng Li
Re: [PATCH net-next 12/20] net: hns3: Add packet statistics of netdev
On 2018/1/9 11:06, David Miller wrote: From: "lipeng (Y)" Date: Tue, 9 Jan 2018 10:48:04 +0800 So I think it is OK if you can revert [patch 12/20 ]("net: hns3: Add packet statistics of netdev"). I think it is OK if you send the revert patch, which is what I am asking for :-) . sure, i will send the revert patch. I have tested it in my local branch. Thanks Peng Li
Re: [PATCH net-next 12/20] net: hns3: Add packet statistics of netdev
On 2018/1/9 9:54, David Miller wrote: From: Jakub KicinskiDate: Mon, 8 Jan 2018 17:50:21 -0800 Oh, I only noticed this extra misleading comment now. Unless each queue has a netdev, I don't see how these are per-queue. If it isn't per-queue I want this change reverted. [patch 12/20 ] add statistics of netdev for ethtool -S, netdev may have multi queue. As discussion here, it is duplicate to add this patch. I revert [patch 12/20 ] , and then test on my board, HNS3 basic function and ethtool -S work well. So I think it is OK if you can revert [patch 12/20 ]("net: hns3: Add packet statistics of netdev"). Thanks Peng Li .
Re: [PATCH net-next 12/20] net: hns3: Add packet statistics of netdev
On 2018/1/9 9:54, David Miller wrote: From: Jakub Kicinski Date: Mon, 8 Jan 2018 17:50:21 -0800 Oh, I only noticed this extra misleading comment now. Unless each queue has a netdev, I don't see how these are per-queue. If it isn't per-queue I want this change reverted. [patch 12/20 ] add statistics of netdev for ethtool -S, netdev may have multi queue. As discussion here, it is duplicate to add this patch. I revert [patch 12/20 ] , and then test on my board, HNS3 basic function and ethtool -S work well. So I think it is OK if you can revert [patch 12/20 ]("net: hns3: Add packet statistics of netdev"). Thanks Peng Li .
Re: [PATCH net-next 06/20] net: hns3: Modify the update period of packet statistics
On 2018/1/5 22:54, Andrew Lunn wrote: --- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c @@ -1126,6 +1126,7 @@ static int hns3_nic_set_features(struct net_device *netdev, { struct hns3_nic_priv *priv = netdev_priv(netdev); int queue_num = priv->ae_handle->kinfo.num_tqps; + struct hnae3_handle *handle = priv->ae_handle; struct hns3_enet_ring *ring; unsigned int start; unsigned int idx; @@ -1134,6 +1135,8 @@ static int hns3_nic_set_features(struct net_device *netdev, u64 tx_pkts = 0; u64 rx_pkts = 0; + handle->ae_algo->ops->update_stats(handle, >stats); + for (idx = 0; idx < queue_num; idx++) { /* fetch the tx stats */ ring = priv->ring_data[idx].ring; There is something odd going on with patch here. Notice how it says hns3_nic_set_features(). This is not the function being patched, it is actually the next one, hns3_nic_get_stats64(), which makes a lot more sense. Is it because the static void is on the previous line? Yes, it is because the static void is on the previous line. I can add one patch to fix the previous line , and this patch will correct automatically. do it need V2 patchset? or push a new patch after this patchset? It would be nice if the function was correctly reported. It makes it easier to review the patch. Andrew .
Re: [PATCH net-next 06/20] net: hns3: Modify the update period of packet statistics
On 2018/1/5 22:54, Andrew Lunn wrote: --- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c @@ -1126,6 +1126,7 @@ static int hns3_nic_set_features(struct net_device *netdev, { struct hns3_nic_priv *priv = netdev_priv(netdev); int queue_num = priv->ae_handle->kinfo.num_tqps; + struct hnae3_handle *handle = priv->ae_handle; struct hns3_enet_ring *ring; unsigned int start; unsigned int idx; @@ -1134,6 +1135,8 @@ static int hns3_nic_set_features(struct net_device *netdev, u64 tx_pkts = 0; u64 rx_pkts = 0; + handle->ae_algo->ops->update_stats(handle, >stats); + for (idx = 0; idx < queue_num; idx++) { /* fetch the tx stats */ ring = priv->ring_data[idx].ring; There is something odd going on with patch here. Notice how it says hns3_nic_set_features(). This is not the function being patched, it is actually the next one, hns3_nic_get_stats64(), which makes a lot more sense. Is it because the static void is on the previous line? Yes, it is because the static void is on the previous line. I can add one patch to fix the previous line , and this patch will correct automatically. do it need V2 patchset? or push a new patch after this patchset? It would be nice if the function was correctly reported. It makes it easier to review the patch. Andrew .
Re: [PATCH V3 net-next 00/17] add some features and fix some bugs for HNS3 driver
On 2017/12/21 12:04, David Miller wrote: From: "lipeng (Y)" <lipeng...@huawei.com> Date: Thu, 21 Dec 2017 09:30:01 +0800 On 2017/12/21 3:28, David Miller wrote: From: Lipeng <lipeng...@huawei.com> Date: Wed, 20 Dec 2017 16:43:02 +0800 This patchset adds some new feature support and fixes some bugs: [Patch 1/17 - 5/17] add the support to modify/query the tqp number through ethtool -L/l command, and also fix some related bugs for change tqp number. [Patch 6/17 - 9-17] add support vlan tag offload on tx& direction for pf, and fix some related bugs. [patch 10/17 - 11/17] fix bugs for auto negotiation. [patch 12/17] adds support for ethtool command set_pauseparam. [patch 13/17 - 14/17] add support to update flow control settings after autoneg. [patch 15/17 - 17/17] fix some other bugs in net-next. In your From: email field, as well as you and your colleagues signoffs you are not using your full, real, name: From: Lipeng <lipeng...@huawei.com> My first name is 'Peng' and Surname is 'Li'. But it is usually spelled as 'Lipeng' in one go when referring. This is quite usual convention with full names originating from China. Surnames comes first, followed by the first name and they both are inseparable while they are written as well. "Lipeng" is my full real name, and my sign-off's appear like above. The same applies to "qumingguang"? Why is it not capitalized? It seems to just be a copy of the email address username. have checked with him, and will fix his name spelling to "Mingguang Qu". Thanks Lipeng .
Re: [PATCH V3 net-next 00/17] add some features and fix some bugs for HNS3 driver
On 2017/12/21 12:04, David Miller wrote: From: "lipeng (Y)" Date: Thu, 21 Dec 2017 09:30:01 +0800 On 2017/12/21 3:28, David Miller wrote: From: Lipeng Date: Wed, 20 Dec 2017 16:43:02 +0800 This patchset adds some new feature support and fixes some bugs: [Patch 1/17 - 5/17] add the support to modify/query the tqp number through ethtool -L/l command, and also fix some related bugs for change tqp number. [Patch 6/17 - 9-17] add support vlan tag offload on tx& direction for pf, and fix some related bugs. [patch 10/17 - 11/17] fix bugs for auto negotiation. [patch 12/17] adds support for ethtool command set_pauseparam. [patch 13/17 - 14/17] add support to update flow control settings after autoneg. [patch 15/17 - 17/17] fix some other bugs in net-next. In your From: email field, as well as you and your colleagues signoffs you are not using your full, real, name: From: Lipeng My first name is 'Peng' and Surname is 'Li'. But it is usually spelled as 'Lipeng' in one go when referring. This is quite usual convention with full names originating from China. Surnames comes first, followed by the first name and they both are inseparable while they are written as well. "Lipeng" is my full real name, and my sign-off's appear like above. The same applies to "qumingguang"? Why is it not capitalized? It seems to just be a copy of the email address username. have checked with him, and will fix his name spelling to "Mingguang Qu". Thanks Lipeng .
Re: [PATCH V3 net-next 00/17] add some features and fix some bugs for HNS3 driver
On 2017/12/21 3:28, David Miller wrote: From: LipengDate: Wed, 20 Dec 2017 16:43:02 +0800 This patchset adds some new feature support and fixes some bugs: [Patch 1/17 - 5/17] add the support to modify/query the tqp number through ethtool -L/l command, and also fix some related bugs for change tqp number. [Patch 6/17 - 9-17] add support vlan tag offload on tx& direction for pf, and fix some related bugs. [patch 10/17 - 11/17] fix bugs for auto negotiation. [patch 12/17] adds support for ethtool command set_pauseparam. [patch 13/17 - 14/17] add support to update flow control settings after autoneg. [patch 15/17 - 17/17] fix some other bugs in net-next. In your From: email field, as well as you and your colleagues signoffs you are not using your full, real, name: From: Lipeng My first name is 'Peng' and Surname is 'Li'. But it is usually spelled as 'Lipeng' in one go when referring. This is quite usual convention with full names originating from China. Surnames comes first, followed by the first name and they both are inseparable while they are written as well. "Lipeng" is my full real name, and my sign-off's appear like above. The name "lipeng" is very common in china, many guys in HuaWei have the same name "lipeng", So my email is lipeng...@huawei.com, to Distinguish from others. other guys who named "lipeng" in huawei , their email have an id too, such as lipeng...@huawei.com. Wish the explanation is clear. Thanks, Lipeng Signed-off-by: qumingguang Signed-off-by: Lipeng Please fix this. .
Re: [PATCH V3 net-next 00/17] add some features and fix some bugs for HNS3 driver
On 2017/12/21 3:28, David Miller wrote: From: Lipeng Date: Wed, 20 Dec 2017 16:43:02 +0800 This patchset adds some new feature support and fixes some bugs: [Patch 1/17 - 5/17] add the support to modify/query the tqp number through ethtool -L/l command, and also fix some related bugs for change tqp number. [Patch 6/17 - 9-17] add support vlan tag offload on tx& direction for pf, and fix some related bugs. [patch 10/17 - 11/17] fix bugs for auto negotiation. [patch 12/17] adds support for ethtool command set_pauseparam. [patch 13/17 - 14/17] add support to update flow control settings after autoneg. [patch 15/17 - 17/17] fix some other bugs in net-next. In your From: email field, as well as you and your colleagues signoffs you are not using your full, real, name: From: Lipeng My first name is 'Peng' and Surname is 'Li'. But it is usually spelled as 'Lipeng' in one go when referring. This is quite usual convention with full names originating from China. Surnames comes first, followed by the first name and they both are inseparable while they are written as well. "Lipeng" is my full real name, and my sign-off's appear like above. The name "lipeng" is very common in china, many guys in HuaWei have the same name "lipeng", So my email is lipeng...@huawei.com, to Distinguish from others. other guys who named "lipeng" in huawei , their email have an id too, such as lipeng...@huawei.com. Wish the explanation is clear. Thanks, Lipeng Signed-off-by: qumingguang Signed-off-by: Lipeng Please fix this. .
Re: [PATCH V3 net-next 00/17] add some features and fix some bugs for HNS3 driver
On 2017/12/21 3:28, David Miller wrote: From: LipengDate: Wed, 20 Dec 2017 16:43:02 +0800 This patchset adds some new feature support and fixes some bugs: [Patch 1/17 - 5/17] add the support to modify/query the tqp number through ethtool -L/l command, and also fix some related bugs for change tqp number. [Patch 6/17 - 9-17] add support vlan tag offload on tx& direction for pf, and fix some related bugs. [patch 10/17 - 11/17] fix bugs for auto negotiation. [patch 12/17] adds support for ethtool command set_pauseparam. [patch 13/17 - 14/17] add support to update flow control settings after autoneg. [patch 15/17 - 17/17] fix some other bugs in net-next. In your From: email field, as well as you and your colleagues signoffs you are not using your full, real, name: From: Lipeng My first name is 'Peng' and Surname is 'Li'. But it is usually spelled as 'Lipeng' in one go when referring. This is quite usual convention with full names originating from China. Surnames comes first, followed by the first name and they both are inseparable while they are written as well. "Lipeng" is my full real name, and my sign-off's appear like above. Thanks, Lipeng Signed-off-by: qumingguang Signed-off-by: Lipeng Please fix this. .
Re: [PATCH V3 net-next 00/17] add some features and fix some bugs for HNS3 driver
On 2017/12/21 3:28, David Miller wrote: From: Lipeng Date: Wed, 20 Dec 2017 16:43:02 +0800 This patchset adds some new feature support and fixes some bugs: [Patch 1/17 - 5/17] add the support to modify/query the tqp number through ethtool -L/l command, and also fix some related bugs for change tqp number. [Patch 6/17 - 9-17] add support vlan tag offload on tx& direction for pf, and fix some related bugs. [patch 10/17 - 11/17] fix bugs for auto negotiation. [patch 12/17] adds support for ethtool command set_pauseparam. [patch 13/17 - 14/17] add support to update flow control settings after autoneg. [patch 15/17 - 17/17] fix some other bugs in net-next. In your From: email field, as well as you and your colleagues signoffs you are not using your full, real, name: From: Lipeng My first name is 'Peng' and Surname is 'Li'. But it is usually spelled as 'Lipeng' in one go when referring. This is quite usual convention with full names originating from China. Surnames comes first, followed by the first name and they both are inseparable while they are written as well. "Lipeng" is my full real name, and my sign-off's appear like above. Thanks, Lipeng Signed-off-by: qumingguang Signed-off-by: Lipeng Please fix this. .
Re: [PATCH V2 net-next 02/17] net: hns3: add support to modify tqps number
On 2017/12/20 3:18, David Miller wrote: From: LipengDate: Tue, 19 Dec 2017 12:02:24 +0800 @@ -2651,6 +2651,19 @@ static int hns3_get_ring_config(struct hns3_nic_priv *priv) return ret; } +static void hns3_put_ring_config(struct hns3_nic_priv *priv) +{ + struct hnae3_handle *h = priv->ae_handle; + u16 i; + + for (i = 0; i < h->kinfo.num_tqps; i++) { Please use a plain "int" for index iteration loops like this since that is the canonical type to use. will check and fix this , Thanks. +static void hclge_release_tqp(struct hclge_vport *vport) +{ + struct hnae3_knic_private_info *kinfo = >nic.kinfo; + struct hclge_dev *hdev = vport->back; + u16 i; + + for (i = 0; i < kinfo->num_tqps; i++) { Likewise. .
Re: [PATCH V2 net-next 02/17] net: hns3: add support to modify tqps number
On 2017/12/20 3:18, David Miller wrote: From: Lipeng Date: Tue, 19 Dec 2017 12:02:24 +0800 @@ -2651,6 +2651,19 @@ static int hns3_get_ring_config(struct hns3_nic_priv *priv) return ret; } +static void hns3_put_ring_config(struct hns3_nic_priv *priv) +{ + struct hnae3_handle *h = priv->ae_handle; + u16 i; + + for (i = 0; i < h->kinfo.num_tqps; i++) { Please use a plain "int" for index iteration loops like this since that is the canonical type to use. will check and fix this , Thanks. +static void hclge_release_tqp(struct hclge_vport *vport) +{ + struct hnae3_knic_private_info *kinfo = >nic.kinfo; + struct hclge_dev *hdev = vport->back; + u16 i; + + for (i = 0; i < kinfo->num_tqps; i++) { Likewise. .
Re: [PATCH V2 net-next 01/17] net: hns3: add support to query tqps number
On 2017/12/20 3:16, David Miller wrote: From: LipengDate: Tue, 19 Dec 2017 12:02:23 +0800 @@ -5002,6 +5002,26 @@ static void hclge_uninit_ae_dev(struct hnae3_ae_dev *ae_dev) ae_dev->priv = NULL; } +static u32 hclge_get_max_channels(struct hnae3_handle *handle) +{ + struct hclge_vport *vport = hclge_get_vport(handle); + struct hnae3_knic_private_info *kinfo = >kinfo; + struct hclge_dev *hdev = vport->back; + Please order local variables from longest to shortest line. Please audit your entire submission for this problem. . will check this patch-set about this problem. Thanks
Re: [PATCH V2 net-next 01/17] net: hns3: add support to query tqps number
On 2017/12/20 3:16, David Miller wrote: From: Lipeng Date: Tue, 19 Dec 2017 12:02:23 +0800 @@ -5002,6 +5002,26 @@ static void hclge_uninit_ae_dev(struct hnae3_ae_dev *ae_dev) ae_dev->priv = NULL; } +static u32 hclge_get_max_channels(struct hnae3_handle *handle) +{ + struct hclge_vport *vport = hclge_get_vport(handle); + struct hnae3_knic_private_info *kinfo = >kinfo; + struct hclge_dev *hdev = vport->back; + Please order local variables from longest to shortest line. Please audit your entire submission for this problem. . will check this patch-set about this problem. Thanks
Re: [PATCH net-next 17/17] net: hns3: change TM sched mode to TC-based mode when SRIOV enabled
On 2017/12/18 17:08, Sergei Shtylyov wrote: On 12/18/2017 12:31 PM, Lipeng wrote: 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: cc9bb43 (net: hns3: Add tc-based TM support for sriov enabled port) Need at least 12 hex digits. agree , may lost some hex digits, will fix it. Signed-off-by: Lipeng[...] MBR, Sergei
Re: [PATCH net-next 17/17] net: hns3: change TM sched mode to TC-based mode when SRIOV enabled
On 2017/12/18 17:08, Sergei Shtylyov wrote: On 12/18/2017 12:31 PM, Lipeng wrote: 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: cc9bb43 (net: hns3: Add tc-based TM support for sriov enabled port) Need at least 12 hex digits. agree , may lost some hex digits, will fix it. Signed-off-by: Lipeng [...] MBR, Sergei
Re: [PATCH net-next 14/17] net: hns3: add Asym Pause support to phy default features
On 2017/12/18 17:07, Sergei Shtylyov wrote: Hello! On 12/18/2017 12:31 PM, Lipeng wrote: From: Fuyun Liangcommit c4fb2cdf575d (net: hns3: fix a bug for phy supported feature initialization) adds default supported features for phy, but our hardware Ten cited commit's summary needs to be enclosed in (""), not just ()... Thanks , will fix it. also supports Asym Pause. This patch adds Asym Pause support to phy default features to prevent Asym Pause can not be advertised when the phy negotiates flow control. Fixes: c4fb2cdf575d (net: hns3: fix a bug for phy supported feature initialization) Here as well... will fix here too. Thanks Signed-off-by: Fuyun Liang Signed-off-by: Lipeng [...] MBR, Sergei
Re: [PATCH net-next 14/17] net: hns3: add Asym Pause support to phy default features
On 2017/12/18 17:07, Sergei Shtylyov wrote: Hello! On 12/18/2017 12:31 PM, Lipeng wrote: From: Fuyun Liang commit c4fb2cdf575d (net: hns3: fix a bug for phy supported feature initialization) adds default supported features for phy, but our hardware Ten cited commit's summary needs to be enclosed in (""), not just ()... Thanks , will fix it. also supports Asym Pause. This patch adds Asym Pause support to phy default features to prevent Asym Pause can not be advertised when the phy negotiates flow control. Fixes: c4fb2cdf575d (net: hns3: fix a bug for phy supported feature initialization) Here as well... will fix here too. Thanks Signed-off-by: Fuyun Liang Signed-off-by: Lipeng [...] MBR, Sergei
Re: [PATCH net-next 1/2] net: hns3: fix a bug when getting phy address from NCL_config file
On 2017/11/8 22:30, Andrew Lunn wrote: On Wed, Nov 08, 2017 at 03:52:22PM +0800, Lipeng wrote: From: Fuyun LiangDriver gets phy address from NCL_config file and uses the phy address to initialize phydev. There are 5 bits for phy address. And C22 phy address has 5 bits. So 0-31 are all valid address for phy. If there is no phy, it will crash. Because driver always get a valid phy address. Hi Lipeng Any plans for C45? The PHY address is still 5 bits, but do you need to get the device type from your configuration file? Andrew Hi Andrew C45 support is in Plan, now only support C22. This bugfix patch is valid for C22 and C45. As plan , will get the device type(NULL, C22, C45) from configuration file after support C45. Do you think we must do it now? or can add it along with C45 support? Lipeng .
Re: [PATCH net-next 1/2] net: hns3: fix a bug when getting phy address from NCL_config file
On 2017/11/8 22:30, Andrew Lunn wrote: On Wed, Nov 08, 2017 at 03:52:22PM +0800, Lipeng wrote: From: Fuyun Liang Driver gets phy address from NCL_config file and uses the phy address to initialize phydev. There are 5 bits for phy address. And C22 phy address has 5 bits. So 0-31 are all valid address for phy. If there is no phy, it will crash. Because driver always get a valid phy address. Hi Lipeng Any plans for C45? The PHY address is still 5 bits, but do you need to get the device type from your configuration file? Andrew Hi Andrew C45 support is in Plan, now only support C22. This bugfix patch is valid for C22 and C45. As plan , will get the device type(NULL, C22, C45) from configuration file after support C45. Do you think we must do it now? or can add it along with C45 support? Lipeng .
Re: [PATCH net-next 0/2] net: hns3: Bug fixes & Code improvements in HNS3 driver
please ignore this patch-set. I should remove "{topost}" from the subject. sorry for that, I will resend the patch-set. On 2017/11/8 15:31, Lipeng wrote: This patch-set introduces some bug fixes and code improvements. As [patch 1/2] depends on the patch {5392902 net: hns3: Consistently using GENMASK in hns3 driver}, which exists in net-next, not exists in net, so push this serise to nex-next. Fuyun Liang (2): {topost} net: hns3: fix a bug when getting phy address from NCL_config file {topost} net: hns3: cleanup mac auto-negotiation state query in hclge_update_speed_duplex drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h | 2 +- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 13 + 2 files changed, 2 insertions(+), 13 deletions(-)
Re: [PATCH net-next 0/2] net: hns3: Bug fixes & Code improvements in HNS3 driver
please ignore this patch-set. I should remove "{topost}" from the subject. sorry for that, I will resend the patch-set. On 2017/11/8 15:31, Lipeng wrote: This patch-set introduces some bug fixes and code improvements. As [patch 1/2] depends on the patch {5392902 net: hns3: Consistently using GENMASK in hns3 driver}, which exists in net-next, not exists in net, so push this serise to nex-next. Fuyun Liang (2): {topost} net: hns3: fix a bug when getting phy address from NCL_config file {topost} net: hns3: cleanup mac auto-negotiation state query in hclge_update_speed_duplex drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h | 2 +- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 13 + 2 files changed, 2 insertions(+), 13 deletions(-)
Re: [PATCH net-next 4/6] net: hns3: add support for set_link_ksettings
On 2017/11/4 3:52, Florian Fainelli wrote: On 11/02/2017 09:18 PM, Lipeng wrote: From: Fuyun LiangThis patch adds set_link_ksettings support for ethtool cmd. Signed-off-by: Fuyun Liang Signed-off-by: Lipeng --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_ethtool.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_ethtool.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_ethtool.c index c7b8ebd..7fe193b 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_ethtool.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_ethtool.c @@ -653,6 +653,16 @@ static int hns3_get_link_ksettings(struct net_device *netdev, return 0; } +static int hns3_set_link_ksettings(struct net_device *netdev, + const struct ethtool_link_ksettings *cmd) +{ + /* Only support ksettings_set for netdev with phy attached for now */ + if (netdev->phydev) + return phy_ethtool_ksettings_set(netdev->phydev, cmd); + + return -EOPNOTSUPP; Consider using phy_ethtool_get_link_ksettings() which already checks for netdev->phydev. agree, Thanks for your comment. as this patch has been applied to net-next, we will push another cleanup patch.
Re: [PATCH net-next 4/6] net: hns3: add support for set_link_ksettings
On 2017/11/4 3:52, Florian Fainelli wrote: On 11/02/2017 09:18 PM, Lipeng wrote: From: Fuyun Liang This patch adds set_link_ksettings support for ethtool cmd. Signed-off-by: Fuyun Liang Signed-off-by: Lipeng --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_ethtool.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_ethtool.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_ethtool.c index c7b8ebd..7fe193b 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_ethtool.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_ethtool.c @@ -653,6 +653,16 @@ static int hns3_get_link_ksettings(struct net_device *netdev, return 0; } +static int hns3_set_link_ksettings(struct net_device *netdev, + const struct ethtool_link_ksettings *cmd) +{ + /* Only support ksettings_set for netdev with phy attached for now */ + if (netdev->phydev) + return phy_ethtool_ksettings_set(netdev->phydev, cmd); + + return -EOPNOTSUPP; Consider using phy_ethtool_get_link_ksettings() which already checks for netdev->phydev. agree, Thanks for your comment. as this patch has been applied to net-next, we will push another cleanup patch.