mbox series

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

Message ID 1535335170-111030-1-git-send-email-lipeng321@huawei.com
Headers show
Series net: hns: fix some bugs about speed and duplex change | expand

Message

lipeng (Y) Aug. 27, 2018, 1:59 a.m. UTC
If there are packets in hardware when changing the spped
or duplex, it may cause hardware hang up.

This patchset adds the code for waiting chip to clean the all
pkts(TX & RX) in chip when the driver uses the function named
"adjust link".

This patchset cleans the pkts as follows:
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 in chip
  net: hns: add netif_carrier_off before change speed and duplex

 drivers/net/ethernet/hisilicon/hns/hnae.h          |  2 +
 drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c  | 67 +++++++++++++++++++++-
 drivers/net/ethernet/hisilicon/hns/hns_dsaf_gmac.c | 36 ++++++++++++
 drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c  | 44 ++++++++++++++
 drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.h  |  8 +++
 drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c | 29 ++++++++++
 drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.h |  3 +
 drivers/net/ethernet/hisilicon/hns/hns_dsaf_ppe.c  | 23 ++++++++
 drivers/net/ethernet/hisilicon/hns/hns_dsaf_ppe.h  |  1 +
 drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.c  | 23 ++++++++
 drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.h  |  1 +
 drivers/net/ethernet/hisilicon/hns/hns_dsaf_reg.h  |  1 +
 drivers/net/ethernet/hisilicon/hns/hns_enet.c      | 21 ++++++-
 drivers/net/ethernet/hisilicon/hns/hns_ethtool.c   |  2 +
 14 files changed, 257 insertions(+), 4 deletions(-)

Comments

David Miller Aug. 30, 2018, 1:08 a.m. UTC | #1
From: Peng Li <lipeng321@huawei.com>
Date: Mon, 27 Aug 2018 09:59:28 +0800

> If there are packets in hardware when changing the spped
> or duplex, it may cause hardware hang up.
> 
> This patchset adds the code for waiting chip to clean the all
> pkts(TX & RX) in chip when the driver uses the function named
> "adjust link".
> 
> This patchset cleans the pkts as follows:
> 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.

Series applied, thank you.