Subject: Re: [PATCH v3] net: dsa: qca8k: enable port flow control

From: [email-masked]
Date: Mon, 29 Jul 2019 13:01:24 +0800

On 2019-07-29 06:31, Andrew Lunn wrote:
> On Sun, Jul 28, 2019 at 08:57:50AM +0800, xiaofeis wrote:
>> Set phy device advertising to enable MAC flow control.
> 
> Hi Xiaofei.
> 
> This is half of the needed change for MAC flow control.
> 
> phy_support_asym_pause(phy) is used by the MAC to tell the PHY layer
> that the MAC supports flow control. The PHY will then advertise
> this. When auto-negotiation is completed, the PHY layer will call
> qca8k_adjust_link() with the results. It could be that the peer does
> not support flow control, or only supports symmetric flow control.  So
> in that function, you need to program the MAC with the results of the
> auto-neg. This is currently missing. You need to look at phydev->pause
> and phydev->asym_pause to decide how to configure the MAC.
> 
>        Andrew
Hi Andrew

You are correct. With the change, the auto-negotiation result still 
depends on the peer.

But our qca8k HW can auto sync the pause status to MAC from phy with the 
auto-negotiated result.
So no need to set in qca8k_adjust_link, since there is one setting in 
qca8k_port_set_status: mask |= QCA8K_PORT_STATUS_LINK_AUTO;

This change's purpose is to keep enable advertise on our side.

Thanks
Xiaofeis