APPLIED[D]/NAK[B]: [PATCH 3/4][B/D] net: hns3: fix flow control configure issue for fibre port

Kleber Souza kleber.souza at canonical.com
Fri Feb 7 19:51:53 UTC 2020


On 2020-01-07 08:30, Kleber Souza wrote:
> On 2020-01-01 17:09, Ike Panhc wrote:
>> From: Jian Shen <shenjian15 at huawei.com>
>>
>> BugLink: https://launchpad.net/bugs/1853948
>>
>> Flow control autoneg is unsupported for fibre port. It takes no
>> effect for flow control when restart autoneg. This patch fixes
>> it, return -EOPNOTSUPP when user tries to enable flow control
>> autoneg.
>>
>> Signed-off-by: Jian Shen <shenjian15 at huawei.com>
>> Signed-off-by: Peng Li <lipeng321 at huawei.com>
>> Signed-off-by: Huazhong Tan <tanhuazhong at huawei.com>
>> Signed-off-by: David S. Miller <davem at davemloft.net>
>> (cherry picked from commit fb89629f2ecfa0feb07f9981c1bd66a4b4407f44)
>> Signed-off-by: Ike Panhc <ike.pan at canonical.com>
>> ---
>>  .../hisilicon/hns3/hns3pf/hclge_main.c        | 22 +++++++++----------
>>  1 file changed, 11 insertions(+), 11 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
>> index b6660bbcaf01..c460ab117eca 100644
>> --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
>> +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
>> @@ -8065,8 +8065,9 @@ static void hclge_get_pauseparam(struct hnae3_handle *handle, u32 *auto_neg,
>>  {
>>  	struct hclge_vport *vport = hclge_get_vport(handle);
>>  	struct hclge_dev *hdev = vport->back;
>> +	struct phy_device *phydev = hdev->hw.mac.phydev;
>>  
>> -	*auto_neg = hclge_get_autoneg(handle);
>> +	*auto_neg = phydev ? hclge_get_autoneg(handle) : 0;
>>  
>>  	if (hdev->tm_info.fc_mode == HCLGE_FC_PFC) {
>>  		*rx_en = 0;
>> @@ -8097,11 +8098,13 @@ static int hclge_set_pauseparam(struct hnae3_handle *handle, u32 auto_neg,
>>  	struct phy_device *phydev = hdev->hw.mac.phydev;
>>  	u32 fc_autoneg;
>>  
>> -	fc_autoneg = hclge_get_autoneg(handle);
>> -	if (auto_neg != fc_autoneg) {
>> -		dev_info(&hdev->pdev->dev,
>> -			 "To change autoneg please use: ethtool -s <dev> autoneg <on|off>\n");
>> -		return -EOPNOTSUPP;
>> +	if (phydev) {
>> +		fc_autoneg = hclge_get_autoneg(handle);
>> +		if (auto_neg != fc_autoneg) {
>> +			dev_info(&hdev->pdev->dev,
>> +				 "To change autoneg please use: ethtool -s <dev> autoneg <on|off>\n");
>> +			return -EOPNOTSUPP;
>> +		}
>>  	}
>>  
>>  	if (hdev->tm_info.fc_mode == HCLGE_FC_PFC) {
>> @@ -8112,16 +8115,13 @@ static int hclge_set_pauseparam(struct hnae3_handle *handle, u32 auto_neg,
>>  
>>  	hclge_set_flowctrl_adv(hdev, rx_en, tx_en);
>>  
>> -	if (!fc_autoneg)
>> +	if (!auto_neg)
>>  		return hclge_cfg_pauseparam(hdev, rx_en, tx_en);
>>  
>>  	if (phydev)
>>  		return phy_start_aneg(phydev);
>>  
>> -	if (hdev->pdev->revision == 0x20)
>> -		return -EOPNOTSUPP;
>> -
>> -	return hclge_restart_autoneg(handle);
>> +	return -EOPNOTSUPP;
>>  }
>>  
>>  static void hclge_get_ksettings_an_result(struct hnae3_handle *handle,
>>
> 
> Hi Ike,
> 
> This patch doesn't apply to Bionic anymore because of some upstream stable
> fixes applied in them meantime. Could you please re-send this patch for
> Bionic?
> 
> 
> Applied to disco/linux.
> 
> Thanks,
> Kleber
> 

Hi Ike,

Please note that this bug is still not fixed for Bionic since we are still
waiting for it to be resent.


Thanks,
Kleber



More information about the kernel-team mailing list