Skip to contentSkip to conversation

net: dsa: qca8k: enable port flow control

PATCH Superseded xiaofeis 3 participants 5 messages Jul 24, 2019 – Jul 27, 2019 3 messages not in the archive

Subsystems (4)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

xiaofeis

author
#0 lore raw

PATCH v2 1/1 net: dsa: qca8k: enable port flow control

Set phy device advertising to enable MAC flow control.

---
 drivers/net/dsa/qca8k.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/dsa/qca8k.c +3 -1
index 232e8cc..c5ac426 100644
@@ -2,7 +2,7 @@
 /*
  * Copyright (C) 2009 Felix Fietkau <[email protected]>
  * Copyright (C) 2011-2012 Gabor Juhos <[email protected]>
- * Copyright (c) 2015, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2015, 2019, The Linux Foundation. All rights reserved.
  * Copyright (c) 2016 John Crispin <[email protected]>
  */
 
@@ -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;
 }
 
Signature · 1 line
1.9.1
#1 lore raw
Thank you for the patch! Yet something to improve:

Hi xiaofeis,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linus/master]
[also build test ERROR on v5.3-rc1 next-20190724]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url: https://github.com/0day-ci/linux/commits/xiaofeis/net-dsa-qca8k-enable-port-flow-control/20190724-221126
config: arm-allmodconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 7.4.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
GCC_VERSION=7.4.0 make.cross ARCH=arm

If you fix the issue, kindly add following tag

All errors (new ones prefixed by >>):

drivers/net//dsa/qca8k.c: In function 'qca8k_port_enable':

>> drivers/net//dsa/qca8k.c:938:19: error: assignment to expression with array type
     phy->advertising |= ADVERTISED_Pause | ADVERTISED_Asym_Pause;
                      ^~

vim +938 drivers/net//dsa/qca8k.c

928
929 static int
930 qca8k_port_enable(struct dsa_switch *ds, int port,
931 struct phy_device *phy)
932 {
933 struct qca8k_priv *priv = (struct qca8k_priv *)ds->priv;
934
935 qca8k_port_set_status(priv, port, 1);
936 priv->port_sts[port].enabled = 1;
937

 > 938		phy->advertising |= ADVERTISED_Pause | ADVERTISED_Asym_Pause;

939
940 return 0;
941 }
942

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

maintainer
#2 lore raw
In reply to xiaofeis
Quoted 1 line · xiaofeis

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

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

maintainer
#6 lore raw
Quoted 2 lines

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.

Quoted 4 lines

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

#7 lore raw
Quoted 16 lines · Andrew Lunn
Quoted 2 lines

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.

Quoted 4 lines

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.

Quoted 7 lines

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