Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1248473 > unrolled thread
| Started by | yankejian <yankejian@huawei.com> |
|---|---|
| First post | 2015-10-16 10:50 +0200 |
| Last post | 2015-10-19 04:50 +0200 |
| Articles | 4 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH net-next 0/2] net: hns: fixes two bugs in hns driver yankejian <yankejian@huawei.com> - 2015-10-16 10:50 +0200
[PATCH net-next 2/2] net: hns: fixes a bug about timeout by pause frame yankejian <yankejian@huawei.com> - 2015-10-16 10:50 +0200
[PATCH net-next 1/2] net: hns: fixes the issue by using ethtool -s yankejian <yankejian@huawei.com> - 2015-10-16 10:50 +0200
Re: [PATCH net-next 0/2] net: hns: fixes two bugs in hns driver David Miller <davem@davemloft.net> - 2015-10-19 04:50 +0200
| From | yankejian <yankejian@huawei.com> |
|---|---|
| Date | 2015-10-16 10:50 +0200 |
| Subject | [PATCH net-next 0/2] net: hns: fixes two bugs in hns driver |
| Message-ID | <qk8S6-12c-3@gated-at.bofh.it> |
This patchset fixes two bugs in hns driver. - fixes timeout when received pause frame from the connective ports - should be set by using ethtool -s when the devices are link down Chenny Xu (1): net: hns: fixes the issue by using ethtool -s lisheng (1): net: hns: fixes a bug about timeout by pause frame drivers/net/ethernet/hisilicon/hns/hns_enet.c | 13 ++++---- drivers/net/ethernet/hisilicon/hns/hns_ethtool.c | 39 ++++++++---------------- 2 files changed, 18 insertions(+), 34 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | yankejian <yankejian@huawei.com> |
|---|---|
| Date | 2015-10-16 10:50 +0200 |
| Subject | [PATCH net-next 2/2] net: hns: fixes a bug about timeout by pause frame |
| Message-ID | <qk8S7-12c-17@gated-at.bofh.it> |
| In reply to | #1248473 |
From: lisheng <lisheng011@huawei.com>
this patch fixes the bug triggered timeout sequence. when the connective
ports cannot accept the packets with higher speed, they will send out the
pause frame to the Soc's mac. At that time, the driver resets the relevant
of the Soc, then it causes the packets cannot be sent out immediately.
this patch fixes the issue.
Signed-off-by: yankejian <yankejian@huawei.com>
Signed-off-by: Yisen Zhuang <yisen.zhuang@huawei.com>
Signed-off-by: lisheng <lisheng011@huawei.com>
Signed-off-by: lipeng <lipeng321@huawei.com>
---
drivers/net/ethernet/hisilicon/hns/hns_enet.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_enet.c b/drivers/net/ethernet/hisilicon/hns/hns_enet.c
index 6f9091c..302d3ae 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_enet.c
+++ b/drivers/net/ethernet/hisilicon/hns/hns_enet.c
@@ -1315,16 +1315,15 @@ static void hns_nic_reset_subtask(struct hns_nic_priv *priv)
return;
hns_nic_dump(priv);
- netdev_err(priv->netdev, "Reset %s port\n",
- (type == HNAE_PORT_DEBUG ? "debug" : "business"));
+ netdev_info(priv->netdev, "Reset %s port\n",
+ (type == HNAE_PORT_DEBUG ? "debug" : "business"));
rtnl_lock();
- if (type == HNAE_PORT_DEBUG) {
+ /* put off any impending NetWatchDogTimeout */
+ priv->netdev->trans_start = jiffies;
+
+ if (type == HNAE_PORT_DEBUG)
hns_nic_net_reinit(priv->netdev);
- } else {
- hns_nic_net_down(priv->netdev);
- hns_nic_net_reset(priv->netdev);
- }
rtnl_unlock();
}
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | yankejian <yankejian@huawei.com> |
|---|---|
| Date | 2015-10-16 10:50 +0200 |
| Subject | [PATCH net-next 1/2] net: hns: fixes the issue by using ethtool -s |
| Message-ID | <qk8S7-12c-25@gated-at.bofh.it> |
| In reply to | #1248473 |
From: Chenny Xu <chenny.xu@huawei.com>
before this patch, hns driver only permits user to set the net device
by using ethtool -s when the device is link up. it is obviously not so
good. it needs to be set no matter it is link up or down. so this patch
fixes this issue.
Signed-off-by: yankejian <yankejian@huawei.com>
Signed-off-by: Yisen Zhuang <yisen.zhuang@huawei.com>
Signed-off-by: lisheng <lisheng011@huawei.com>
Signed-off-by: lipeng <lipeng321@huawei.com>
Signed-off-by: Chenny Xu <chenny.xu@huawei.com>
---
drivers/net/ethernet/hisilicon/hns/hns_ethtool.c | 39 ++++++++----------------
1 file changed, 12 insertions(+), 27 deletions(-)
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c b/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c
index 2550208..e31c10b 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c
+++ b/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c
@@ -194,9 +194,7 @@ static int hns_nic_set_settings(struct net_device *net_dev,
{
struct hns_nic_priv *priv = netdev_priv(net_dev);
struct hnae_handle *h;
- int link_stat;
u32 speed;
- u8 duplex, autoneg;
if (!netif_running(net_dev))
return -ESRCH;
@@ -206,48 +204,35 @@ static int hns_nic_set_settings(struct net_device *net_dev,
return -ENODEV;
h = priv->ae_handle;
- link_stat = hns_nic_get_link(net_dev);
- duplex = cmd->duplex;
speed = ethtool_cmd_speed(cmd);
- autoneg = cmd->autoneg;
-
- if (!link_stat) {
- if (duplex != (u8)DUPLEX_UNKNOWN || speed != (u32)SPEED_UNKNOWN)
- return -EINVAL;
-
- if (h->phy_if == PHY_INTERFACE_MODE_SGMII && h->phy_node) {
- priv->phy->autoneg = autoneg;
- return phy_start_aneg(priv->phy);
- }
- }
if (h->phy_if == PHY_INTERFACE_MODE_XGMII) {
- if (autoneg != AUTONEG_DISABLE)
- return -EINVAL;
-
- if (speed != SPEED_10000 || duplex != DUPLEX_FULL)
+ if (cmd->autoneg == AUTONEG_ENABLE || speed != SPEED_10000 ||
+ cmd->duplex != DUPLEX_FULL)
return -EINVAL;
} else if (h->phy_if == PHY_INTERFACE_MODE_SGMII) {
- if (!h->phy_node && autoneg != AUTONEG_DISABLE)
+ if (!priv->phy && cmd->autoneg == AUTONEG_ENABLE)
return -EINVAL;
- if (speed == SPEED_1000 && duplex == DUPLEX_HALF)
+ if (speed == SPEED_1000 && cmd->duplex == DUPLEX_HALF)
return -EINVAL;
+ if (priv->phy)
+ return phy_ethtool_sset(priv->phy, cmd);
- if (speed != SPEED_10 && speed != SPEED_100 &&
- speed != SPEED_1000)
+ if ((speed != SPEED_10 && speed != SPEED_100 &&
+ speed != SPEED_1000) || (cmd->duplex != DUPLEX_HALF &&
+ cmd->duplex != DUPLEX_FULL))
return -EINVAL;
} else {
netdev_err(net_dev, "Not supported!");
return -ENOTSUPP;
}
- if (priv->phy) {
- return phy_ethtool_sset(priv->phy, cmd);
- } else if (h->dev->ops->adjust_link && link_stat) {
- h->dev->ops->adjust_link(h, speed, duplex);
+ if (h->dev->ops->adjust_link) {
+ h->dev->ops->adjust_link(h, (int)speed, cmd->duplex);
return 0;
}
+
netdev_err(net_dev, "Not supported!");
return -ENOTSUPP;
}
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | David Miller <davem@davemloft.net> |
|---|---|
| Date | 2015-10-19 04:50 +0200 |
| Message-ID | <ql8Gl-7Ua-1@gated-at.bofh.it> |
| In reply to | #1248473 |
From: yankejian <yankejian@huawei.com> Date: Fri, 16 Oct 2015 17:03:18 +0800 > This patchset fixes two bugs in hns driver. > - fixes timeout when received pause frame from the connective ports > - should be set by using ethtool -s when the devices are link down Series applied, thanks. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web