Message ID | 1563944576-62844-1-git-send-email-xiaofeis@codeaurora.org |
---|---|
State | Not Applicable |
Delegated to: | David Miller |
Headers | show |
Series | [v2] net: dsa: qca8k: enable port flow control | expand |
On Wed, Jul 24, 2019 at 01:02:56PM +0800, xiaofeis wrote:
> Set phy device advertising to enable MAC flow control.
Hi Xiaofeis
It seems like you are still using the wrong, and old tree. Please
rebase on net-next/master.
Thanks
Andrew
> I didn't compile it on this tree, same code is just compiled and tested on > kernel v4.14. For kernel development work, v4.14 is dead. It died 12th November 2017. It gets backports of bug fixes, but kernel developers otherwise don't touch it. > We are working on one google project, all the change is > required to upstream by Google. > But if I do the change based on the new type for kernel 5.3, then the commit > can't be used directly for Google's project. So you will need to backport the change. In this case, you will have a very different patch in v4.14 than in mainline, due to changes like this. That is part of the pain in using such an old kernel. You should use the function void phy_support_asym_pause(struct phy_device *phydev); to indicate the MAC supports asym pause. Andrew
On 2019-07-26 21:29, Andrew Lunn wrote: >> I didn't compile it on this tree, same code is just compiled and >> tested on >> kernel v4.14. > > For kernel development work, v4.14 is dead. It died 12th November > 2017. It gets backports of bug fixes, but kernel developers otherwise > don't touch it. > >> We are working on one google project, all the change is >> required to upstream by Google. >> But if I do the change based on the new type for kernel 5.3, then the >> commit >> can't be used directly for Google's project. > > So you will need to backport the change. In this case, you will have a > very different patch in v4.14 than in mainline, due to changes like > this. That is part of the pain in using such an old kernel. > > You should use the function > > void phy_support_asym_pause(struct phy_device *phydev); > > to indicate the MAC supports asym pause. > > Andrew Hi Andrew Thanks a lot, you are correct. phy_support_asym_pause is the API to do this. Very appreciate for all your patinet explaination and good suggestion. Thanks Xiaofeis
diff --git a/drivers/net/dsa/qca8k.c b/drivers/net/dsa/qca8k.c index 232e8cc..c5ac426 100644 --- a/drivers/net/dsa/qca8k.c +++ b/drivers/net/dsa/qca8k.c @@ -2,7 +2,7 @@ /* * Copyright (C) 2009 Felix Fietkau <nbd@nbd.name> * Copyright (C) 2011-2012 Gabor Juhos <juhosg@openwrt.org> - * Copyright (c) 2015, The Linux Foundation. All rights reserved. + * Copyright (c) 2015, 2019, The Linux Foundation. All rights reserved. * Copyright (c) 2016 John Crispin <john@phrozen.org> */ @@ -935,6 +935,8 @@ qca8k_port_set_status(priv, port, 1); priv->port_sts[port].enabled = 1; + phy->advertising |= ADVERTISED_Pause | ADVERTISED_Asym_Pause; + return 0; }
Set phy device advertising to enable MAC flow control. Signed-off-by: Xiaofei Shen <xiaofeis@codeaurora.org> --- drivers/net/dsa/qca8k.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)