Netdev List
 help / color / mirror / Atom feed
* [PATCH v2 net-next 2/2] net: phy: marvell10g: improve mv3310_config_aneg
From: Heiner Kallweit @ 2019-02-16 19:44 UTC (permalink / raw)
  To: Andrew Lunn, Florian Fainelli, David Miller,
	Russell King - ARM Linux
  Cc: netdev@vger.kernel.org
In-Reply-To: <c029e3b6-5fbe-08fb-a012-90ceef3be100@gmail.com>

Now that genphy_c45_pma_setup_forced() makes sure the "aneg enabled"
bit is cleared, the call to genphy_c45_an_disable_aneg() isn't needed
any longer. And the code pattern is now the same as in
genphy_config_aneg().

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 drivers/net/phy/marvell10g.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c
index 496805c0d..4a6ae63ab 100644
--- a/drivers/net/phy/marvell10g.c
+++ b/drivers/net/phy/marvell10g.c
@@ -271,13 +271,8 @@ static int mv3310_config_aneg(struct phy_device *phydev)
 	/* We don't support manual MDI control */
 	phydev->mdix_ctrl = ETH_TP_MDI_AUTO;
 
-	if (phydev->autoneg == AUTONEG_DISABLE) {
-		ret = genphy_c45_pma_setup_forced(phydev);
-		if (ret < 0)
-			return ret;
-
-		return genphy_c45_an_disable_aneg(phydev);
-	}
+	if (phydev->autoneg == AUTONEG_DISABLE)
+		return genphy_c45_pma_setup_forced(phydev);
 
 	linkmode_and(phydev->advertising, phydev->advertising,
 		     phydev->supported);
-- 
2.20.1




^ permalink raw reply related

* [PATCH net-next 0/4] net: phy: add and use genphy_c45_an_config_an
From: Heiner Kallweit @ 2019-02-16 19:49 UTC (permalink / raw)
  To: Andrew Lunn, Florian Fainelli, David Miller,
	Russell King - ARM Linux
  Cc: netdev@vger.kernel.org

This series adds genphy_c45_an_config_an() and uses it in the
marvell10g diver. In addition patch 4 aligns the aneg configuration
with what is done in genphy_config_aneg().

Heiner Kallweit (4):
  net: phy: add helper linkmode_adv_to_mii_10gbt_adv_t
  net: phy: add genphy_c45_an_config_an
  net: phy: marvell10g: use genphy_c45_an_config_an
  net: phy: marvell10g: check for newly set aneg in mv3310_config_aneg

 drivers/net/phy/marvell10g.c | 28 ++++++++---------------
 drivers/net/phy/phy-c45.c    | 44 ++++++++++++++++++++++++++++++++++++
 include/linux/mdio.h         | 25 ++++++++++++++++++++
 include/linux/phy.h          |  1 +
 4 files changed, 79 insertions(+), 19 deletions(-)

-- 
2.20.1


^ permalink raw reply

* [PATCH net-next 1/4] net: phy: add helper linkmode_adv_to_mii_10gbt_adv_t
From: Heiner Kallweit @ 2019-02-16 19:50 UTC (permalink / raw)
  To: Andrew Lunn, Florian Fainelli, David Miller,
	Russell King - ARM Linux
  Cc: netdev@vger.kernel.org
In-Reply-To: <0423e795-0215-053f-57ff-386242a6d7ce@gmail.com>

Add a helper linkmode_adv_to_mii_10gbt_adv_t(), similar to
linkmode_adv_to_mii_adv_t.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 include/linux/mdio.h | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/include/linux/mdio.h b/include/linux/mdio.h
index 5b872c45f..5a65f32d8 100644
--- a/include/linux/mdio.h
+++ b/include/linux/mdio.h
@@ -280,6 +280,31 @@ static inline void mii_10gbt_stat_mod_linkmode_lpa_t(unsigned long *advertising,
 			 advertising, lpa & MDIO_AN_10GBT_STAT_LP10G);
 }
 
+/**
+ * linkmode_adv_to_mii_10gbt_adv_t
+ * @advertising: the linkmode advertisement settings
+ *
+ * A small helper function that translates linkmode advertisement
+ * settings to phy autonegotiation advertisements for the C45
+ * 10GBASE-T AN CONTROL (7.32) register.
+ */
+static inline u32 linkmode_adv_to_mii_10gbt_adv_t(unsigned long *advertising)
+{
+	u32 result = 0;
+
+	if (linkmode_test_bit(ETHTOOL_LINK_MODE_2500baseT_Full_BIT,
+			      advertising))
+		result |= MDIO_AN_10GBT_CTRL_ADV2_5G;
+	if (linkmode_test_bit(ETHTOOL_LINK_MODE_5000baseT_Full_BIT,
+			      advertising))
+		result |= MDIO_AN_10GBT_CTRL_ADV5G;
+	if (linkmode_test_bit(ETHTOOL_LINK_MODE_10000baseT_Full_BIT,
+			      advertising))
+		result |= MDIO_AN_10GBT_CTRL_ADV10G;
+
+	return result;
+}
+
 int __mdiobus_read(struct mii_bus *bus, int addr, u32 regnum);
 int __mdiobus_write(struct mii_bus *bus, int addr, u32 regnum, u16 val);
 
-- 
2.20.1



^ permalink raw reply related

* [PATCH net-next 2/4] net: phy: add genphy_c45_an_config_an
From: Heiner Kallweit @ 2019-02-16 19:51 UTC (permalink / raw)
  To: Andrew Lunn, Florian Fainelli, David Miller,
	Russell King - ARM Linux
  Cc: netdev@vger.kernel.org
In-Reply-To: <0423e795-0215-053f-57ff-386242a6d7ce@gmail.com>

From: Andrew Lunn <andrew@lunn.ch>
C45 configuration of 10/100 and multi-giga bit auto negotiation
advertisement is standardized. Configuration of 1000Base-T however
appears to be vendor specific. Move the generic code out of the
Marvell driver into the common phy-c45.c file.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
[hkallweit1@gmail.com: use new helper linkmode_adv_to_mii_10gbt_adv_t and split patch]
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 drivers/net/phy/phy-c45.c | 44 +++++++++++++++++++++++++++++++++++++++
 include/linux/phy.h       |  1 +
 2 files changed, 45 insertions(+)

diff --git a/drivers/net/phy/phy-c45.c b/drivers/net/phy/phy-c45.c
index 0374c50b1..bea1b0c6e 100644
--- a/drivers/net/phy/phy-c45.c
+++ b/drivers/net/phy/phy-c45.c
@@ -78,6 +78,50 @@ int genphy_c45_pma_setup_forced(struct phy_device *phydev)
 }
 EXPORT_SYMBOL_GPL(genphy_c45_pma_setup_forced);
 
+/**
+ * genphy_c45_an_config_an - configure advertisement registers
+ * @phydev: target phy_device struct
+ *
+ * Configure advertisement registers based on modes set in phydev->advertising
+ *
+ * Returns negative errno code on failure, 0 if advertisement didn't change,
+ * or 1 if advertised modes changed.
+ */
+int genphy_c45_an_config_an(struct phy_device *phydev)
+{
+	int changed = 0, ret;
+	u32 adv;
+
+	linkmode_and(phydev->advertising, phydev->advertising,
+		     phydev->supported);
+
+	adv = linkmode_adv_to_mii_adv_t(phydev->advertising);
+
+	ret = phy_modify_mmd(phydev, MDIO_MMD_AN, MDIO_AN_ADVERTISE,
+			     ADVERTISE_ALL | ADVERTISE_100BASE4 |
+			     ADVERTISE_PAUSE_CAP | ADVERTISE_PAUSE_ASYM,
+			     adv);
+	if (ret < 0)
+		return ret;
+	if (ret > 0)
+		changed = 1;
+
+	adv = linkmode_adv_to_mii_10gbt_adv_t(phydev->advertising);
+
+	ret = phy_modify_mmd(phydev, MDIO_MMD_AN, MDIO_AN_10GBT_CTRL,
+			     MDIO_AN_10GBT_CTRL_ADV10G |
+			     MDIO_AN_10GBT_CTRL_ADV5G |
+			     MDIO_AN_10GBT_CTRL_ADV2_5G,
+			     adv);
+	if (ret < 0)
+		return ret;
+	if (ret > 0)
+		changed = 1;
+
+	return changed;
+}
+EXPORT_SYMBOL_GPL(genphy_c45_an_config_an);
+
 /**
  * genphy_c45_an_disable_aneg - disable auto-negotiation
  * @phydev: target phy_device struct
diff --git a/include/linux/phy.h b/include/linux/phy.h
index bf1070c2a..dabcef5ba 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -1101,6 +1101,7 @@ int genphy_c45_read_link(struct phy_device *phydev);
 int genphy_c45_read_lpa(struct phy_device *phydev);
 int genphy_c45_read_pma(struct phy_device *phydev);
 int genphy_c45_pma_setup_forced(struct phy_device *phydev);
+int genphy_c45_an_config_an(struct phy_device *phydev);
 int genphy_c45_an_disable_aneg(struct phy_device *phydev);
 int genphy_c45_read_mdix(struct phy_device *phydev);
 int genphy_c45_pma_read_abilities(struct phy_device *phydev);
-- 
2.20.1



^ permalink raw reply related

* [PATCH net-next 3/4] net: phy: marvell10g: use genphy_c45_an_config_an
From: Heiner Kallweit @ 2019-02-16 19:52 UTC (permalink / raw)
  To: Andrew Lunn, Florian Fainelli, David Miller,
	Russell King - ARM Linux
  Cc: netdev@vger.kernel.org
In-Reply-To: <0423e795-0215-053f-57ff-386242a6d7ce@gmail.com>

From: Andrew Lunn <andrew@lunn.ch>
Use new function genphy_c45_config_aneg() in mv3310_config_aneg().

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
[hkallweit1@gmail.com: patch splitted]
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 drivers/net/phy/marvell10g.c | 22 +---------------------
 1 file changed, 1 insertion(+), 21 deletions(-)

diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c
index 4a6ae63ab..03fa50087 100644
--- a/drivers/net/phy/marvell10g.c
+++ b/drivers/net/phy/marvell10g.c
@@ -274,13 +274,7 @@ static int mv3310_config_aneg(struct phy_device *phydev)
 	if (phydev->autoneg == AUTONEG_DISABLE)
 		return genphy_c45_pma_setup_forced(phydev);
 
-	linkmode_and(phydev->advertising, phydev->advertising,
-		     phydev->supported);
-
-	ret = phy_modify_mmd_changed(phydev, MDIO_MMD_AN, MDIO_AN_ADVERTISE,
-			     ADVERTISE_ALL | ADVERTISE_100BASE4 |
-			     ADVERTISE_PAUSE_CAP | ADVERTISE_PAUSE_ASYM,
-			     linkmode_adv_to_mii_adv_t(phydev->advertising));
+	ret = genphy_c45_an_config_an(phydev);
 	if (ret < 0)
 		return ret;
 	if (ret > 0)
@@ -294,20 +288,6 @@ static int mv3310_config_aneg(struct phy_device *phydev)
 	if (ret > 0)
 		changed = true;
 
-	/* 10G control register */
-	if (linkmode_test_bit(ETHTOOL_LINK_MODE_10000baseT_Full_BIT,
-			      phydev->advertising))
-		reg = MDIO_AN_10GBT_CTRL_ADV10G;
-	else
-		reg = 0;
-
-	ret = phy_modify_mmd_changed(phydev, MDIO_MMD_AN, MDIO_AN_10GBT_CTRL,
-				     MDIO_AN_10GBT_CTRL_ADV10G, reg);
-	if (ret < 0)
-		return ret;
-	if (ret > 0)
-		changed = true;
-
 	if (changed)
 		ret = genphy_c45_restart_aneg(phydev);
 
-- 
2.20.1



^ permalink raw reply related

* [PATCH net-next 4/4] net: phy: marvell10g: check for newly set aneg in mv3310_config_aneg
From: Heiner Kallweit @ 2019-02-16 19:53 UTC (permalink / raw)
  To: Andrew Lunn, Florian Fainelli, David Miller,
	Russell King - ARM Linux
  Cc: netdev@vger.kernel.org
In-Reply-To: <0423e795-0215-053f-57ff-386242a6d7ce@gmail.com>

Even if the advertisement registers content didn't change, we may have
just switched to aneg, and therefore have to trigger an aneg restart.
This matches the behavior of genphy_config_aneg().

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 drivers/net/phy/marvell10g.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c
index 03fa50087..4d8a290eb 100644
--- a/drivers/net/phy/marvell10g.c
+++ b/drivers/net/phy/marvell10g.c
@@ -288,6 +288,16 @@ static int mv3310_config_aneg(struct phy_device *phydev)
 	if (ret > 0)
 		changed = true;
 
+	if (!changed) {
+		/* Configure and restart aneg if it wasn't set before */
+		ret = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_CTRL1);
+		if (ret < 0)
+			return ret;
+
+		if (!(ret & MDIO_AN_CTRL1_ENABLE))
+			changed = 1;
+	}
+
 	if (changed)
 		ret = genphy_c45_restart_aneg(phydev);
 
-- 
2.20.1



^ permalink raw reply related

* Re: [PATCH RFC] net: bridge: don't flood known multicast traffic when snooping is enabled
From: Linus Lüssing @ 2019-02-16 20:04 UTC (permalink / raw)
  To: Nikolay Aleksandrov, Ido Schimmel
  Cc: netdev, roopa, wkok, anuradhak, bridge, davem, stephen
In-Reply-To: <733b151e-47dd-ad9a-b112-473cf551fbeb@cumulusnetworks.com>

Hi Nik, hi Ido,

By the way speaking about the IGMP/MLD querier mechanism. Not sure if
you are subscribed to the pim@ietf.org or mcast-wifi@ietf.org mailing lists.

There was a call for volunteers to progress IGMP/MLD to standards
track not that long ago:

"[pim] Volunteers needed for work on progressing IGMP/MLD on the standards track"
https://mailarchive.ietf.org/arch/msg/pim/F5y_w6jnrtzBpEiC7F_TxBv9PXI

I had voiced some concerns regarding the IGMPv2/MLDv1 report
suppression and the querier mechanism and their unfavourable
implications, as well as some issues (or ambiguities at least) with RFC4541:

https://mailarchive.ietf.org/arch/msg/pim/DWWYpnsZsbqHtafwYZ_swhDpbcQ
https://mailarchive.ietf.org/arch/msg/pim/omI4-pg-12vO88YuZcRP5TCz4wY


It seems that some bigger vendors had gathered for a phone call:

https://mailarchive.ietf.org/arch/msg/pim/jPAbf-PHgtgpwe8lgyjOzCHlhc0

But I haven't heard anything back from that meeting on those
lists.


Just wanted to forward this, in case you guys might maybe be
interested to participate there in some way. :-)

Cheers, Linus

^ permalink raw reply

* Re: [pull request][net-next 00/13] Mellanox, BlueField SmartNIC
From: David Miller @ 2019-02-16 20:11 UTC (permalink / raw)
  To: saeedm; +Cc: netdev
In-Reply-To: <20190216013452.21131-1-saeedm@mellanox.com>

From: Saeed Mahameed <saeedm@mellanox.com>
Date: Fri, 15 Feb 2019 17:34:39 -0800

> This series adds the support for Melanox BlueField SmartNIC.
> For more information please see tag log below.
> 
> Please note the merge commit of mlx5-next at the base of the pull request:
> 259fae5a2cff ("Merge branch 'mlx5-next' of git://git.kernel.org/.../mellanox/linux")
> 
> Please pull and let me know if there is any problem.

Pulled, thanks for all of the contextual info, it really helps.

I'll push this out after my build tests complete.

^ permalink raw reply

* Re: [PATCH RFC] net: bridge: don't flood known multicast traffic when snooping is enabled
From: Linus Lüssing @ 2019-02-16 20:37 UTC (permalink / raw)
  To: nikolay
  Cc: Ido Schimmel, netdev, roopa, wkok, anuradhak, bridge, davem,
	stephen
In-Reply-To: <E8A29F94-091F-44CA-9E33-481BF21C359D@cumulusnetworks.com>

On Sat, Feb 16, 2019 at 09:27:26PM +0200, nikolay@cumulusnetworks.com wrote:
> >>The no querier condition is not currently reflected via switchdev, so
> >>the behavior you're proposing in your patch is what actually happens
> >in
> >>the data plane.
> >>
> >>We already hit the problem Linus mentioned in commit b00589af3b04
> >>("bridge: disable snooping if there is no querier"). Namely, IPv6 ND
> >>broke because a port joined before the bridge was created.
> >>
> >>I introduced a workaround in commit 9d45deb04c59 ("mlxsw: spectrum:
> >>Treat IPv6 unregistered multicast as broadcast"). I'm interested to
> >>know
> >>what other vendors are doing. Can you elaborate?
> >>
> >
> >Exactly like your fix. :) Flood it, this patch unfortunately breaks it 
> >because of mrouters flag, but we can retain the behaviour
> >by forwarding only known mdsts to their ports and flooding
> >unregistered mcast when there is no querier. I think that is 
> >what others do by default too, actually I think they flood with querier
> >as well. Maybe unknown mcast flooding should be controlled by a flag
> >when a querier is present
> >because we've had this behaviour for a long time, personally I'd have
> >it on
> >by default. 
> 
> Ugh, mispoke please read the above statement to be only about no querier. 
> I meant flooding v6 link-local always. 

And for routable IPv6 multicast, how would you detect multicast
listeners on the local link in absence of a querier?

^ permalink raw reply

* Re: [PATCH] net: Fix for_each_netdev_feature on Big endian
From: Eric Dumazet @ 2019-02-16 21:01 UTC (permalink / raw)
  To: David Miller, hauke.mehrtens; +Cc: netdev, jarod, hauke, stable
In-Reply-To: <20190215.202453.382883236911745765.davem@davemloft.net>



On 02/15/2019 08:24 PM, David Miller wrote:
> From: Hauke Mehrtens <hauke.mehrtens@intel.com>
> Date: Fri, 15 Feb 2019 17:58:54 +0100
> 
>> The features attribute is of type u64 and stored in the native endianes on
>> the system. The for_each_set_bit() macro takes a pointer to a 32 bit array
>> and goes over the bits in this area. On little Endian systems this also
>> works with an u64 as the most significant bit is on the highest address,
>> but on big endian the words are swapped. When we expect bit 15 here we get
>> bit 47 (15 + 32).
>>
>> This patch converts it more or less to its own for_each_set_bit()
>> implementation which works on 64 bit integers directly. This is then
>> completely in host endianness and should work like expected.
>>
>> Fixes: fd867d51f ("net/core: generic support for disabling netdev features down stack")
>> Cc: stable@vger.kernel.org
>> Signed-off-by: Hauke Mehrtens <hauke.mehrtens@intel.com>
> 
> Applied and queued up for -stable.
> 
> Please do not CC: stable for networking fixes, I handle -stable submissions
> myself manually and this is documented in the netdev FAQ.
> 

This commit added a call to fls64(), but not the needed include.

This might break some uses I think.

I suggest the following fix :

diff --git a/include/linux/netdev_features.h b/include/linux/netdev_features.h
index c50cedb65cf56fe7d722a5a321b714ed83f449a0..d3f61011f4346e4ea80b61f88bd24541dd006014 100644
--- a/include/linux/netdev_features.h
+++ b/include/linux/netdev_features.h
@@ -11,6 +11,7 @@
 #define _LINUX_NETDEV_FEATURES_H
 
 #include <linux/types.h>
+#include <linux/bitops.h>
 #include <asm/byteorder.h>
 
 typedef u64 netdev_features_t;

^ permalink raw reply related

* Re: [PATCH] net: Fix for_each_netdev_feature on Big endian
From: David Miller @ 2019-02-16 21:46 UTC (permalink / raw)
  To: eric.dumazet; +Cc: hauke.mehrtens, netdev, jarod, hauke, stable
In-Reply-To: <8e03f4cb-11e2-9e85-ed5e-019da79b3806@gmail.com>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Sat, 16 Feb 2019 13:01:28 -0800

> This commit added a call to fls64(), but not the needed include.
> 
> This might break some uses I think.
> 
> I suggest the following fix :
> 
> diff --git a/include/linux/netdev_features.h b/include/linux/netdev_features.h
> index c50cedb65cf56fe7d722a5a321b714ed83f449a0..d3f61011f4346e4ea80b61f88bd24541dd006014 100644
> --- a/include/linux/netdev_features.h
> +++ b/include/linux/netdev_features.h
> @@ -11,6 +11,7 @@
>  #define _LINUX_NETDEV_FEATURES_H
>  
>  #include <linux/types.h>
> +#include <linux/bitops.h>
>  #include <asm/byteorder.h>
>  
>  typedef u64 netdev_features_t;

Ok I'm build testing that right now, thanks.

====================
From 8681ef1f3d295bd3600315325f3b3396d76d02f6 Mon Sep 17 00:00:00 2001
From: "David S. Miller" <davem@davemloft.net>
Date: Sat, 16 Feb 2019 13:44:39 -0800
Subject: [PATCH] net: Add header for usage of fls64()

Fixes: 3b89ea9c5902 ("net: Fix for_each_netdev_feature on Big endian")
Suggested-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
---
 include/linux/netdev_features.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/linux/netdev_features.h b/include/linux/netdev_features.h
index fce28562bed2..4c76fe2c8488 100644
--- a/include/linux/netdev_features.h
+++ b/include/linux/netdev_features.h
@@ -11,6 +11,7 @@
 #define _LINUX_NETDEV_FEATURES_H
 
 #include <linux/types.h>
+#include <linux/bitops.h>
 #include <asm/byteorder.h>
 
 typedef u64 netdev_features_t;
-- 
2.20.1


^ permalink raw reply related

* ax25: fix possible use-after-free
From: f6bvp @ 2019-02-16 22:33 UTC (permalink / raw)
  To: netdev


Patch applied successfully on Linux draws-f6bvp 4.14.79-v7+ #1159 SMP Sun Nov 4 17:50:20 GMT 2018 armv7l GNU/Linux

However ax25_route_lock_use and ax25_route_lock_unuse() are not declared and compile failed.

make : on entre dans le répertoire « /usr/src/linux-headers-4.14.79-v7+ »
  CC [M]  /usr/src/linux-4.14.y/net/ax25/ax25_ip.o
/usr/src/linux-4.14.y/net/ax25/ax25_ip.c: In function ‘ax25_ip_xmit’:
/usr/src/linux-4.14.y/net/ax25/ax25_ip.c:117:2: error: implicit declaration of function ‘ax25_route_lock_use’ [-Werror=implicit-function-declaration]
  ax25_route_lock_use();
  ^~~~~~~~~~~~~~~~~~~
/usr/src/linux-4.14.y/net/ax25/ax25_ip.c:211:2: error: implicit declaration of function ‘ax25_route_lock_unuse’ [-Werror=implicit-function-declaration]
  ax25_route_lock_unuse();
  ^~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
scripts/Makefile.build:328 : la recette pour la cible « /usr/src/linux-4.14.y/net/ax25/ax25_ip.o » a echouee
make[1]: *** [/usr/src/linux-4.14.y/net/ax25/ax25_ip.o] Erreur 1
Makefile:1527 : la recette pour la cible « _module_/usr/src/linux-4.14.y/net/ax25 » a echouee
make: *** [_module_/usr/src/linux-4.14.y/net/ax25] Erreur 2
make : on quitte le repertoire « /usr/src/linux-headers-4.14.79-v7+ »


Bernard, f6bvp






^ permalink raw reply

* Re: [PATCH net-next 1/2] net: phy: disable aneg in genphy_c45_pma_setup_forced
From: Russell King - ARM Linux admin @ 2019-02-16 22:43 UTC (permalink / raw)
  To: Heiner Kallweit
  Cc: Andrew Lunn, Florian Fainelli, David Miller,
	netdev@vger.kernel.org
In-Reply-To: <27bb134f-eb4e-e43a-5d9d-2c551a22428c@gmail.com>

On Sat, Feb 16, 2019 at 08:10:24PM +0100, Heiner Kallweit wrote:
> When genphy_c45_pma_setup_forced() is called the "aneg enabled" bit may
> still be set, therefore clear it. This is also in line with what
> genphy_setup_forced() does for Clause 22.
> 
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
> ---
>  drivers/net/phy/phy-c45.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/net/phy/phy-c45.c b/drivers/net/phy/phy-c45.c
> index bef126344..0374c50b1 100644
> --- a/drivers/net/phy/phy-c45.c
> +++ b/drivers/net/phy/phy-c45.c
> @@ -71,6 +71,10 @@ int genphy_c45_pma_setup_forced(struct phy_device *phydev)
>  		return ret;
>  
>  	return phy_write_mmd(phydev, MDIO_MMD_PMAPMD, MDIO_CTRL2, ctrl2);
> +	if (ret < 0)

This patch does not make sense.

> +		return ret;
> +
> +	return genphy_c45_an_disable_aneg(phydev);
>  }
>  EXPORT_SYMBOL_GPL(genphy_c45_pma_setup_forced);
>  
> -- 
> 2.20.1
> 
> 
> 

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up
According to speedtest.net: 11.9Mbps down 500kbps up

^ permalink raw reply

* Re: [PATCH net-next 1/2] net: phy: disable aneg in genphy_c45_pma_setup_forced
From: Heiner Kallweit @ 2019-02-16 22:45 UTC (permalink / raw)
  To: Russell King - ARM Linux admin
  Cc: Andrew Lunn, Florian Fainelli, David Miller,
	netdev@vger.kernel.org
In-Reply-To: <20190216224320.kwefivz2kpzqnmqm@shell.armlinux.org.uk>

On 16.02.2019 23:43, Russell King - ARM Linux admin wrote:
> On Sat, Feb 16, 2019 at 08:10:24PM +0100, Heiner Kallweit wrote:
>> When genphy_c45_pma_setup_forced() is called the "aneg enabled" bit may
>> still be set, therefore clear it. This is also in line with what
>> genphy_setup_forced() does for Clause 22.
>>
>> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
>> ---
>>  drivers/net/phy/phy-c45.c | 4 ++++
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/drivers/net/phy/phy-c45.c b/drivers/net/phy/phy-c45.c
>> index bef126344..0374c50b1 100644
>> --- a/drivers/net/phy/phy-c45.c
>> +++ b/drivers/net/phy/phy-c45.c
>> @@ -71,6 +71,10 @@ int genphy_c45_pma_setup_forced(struct phy_device *phydev)
>>  		return ret;
>>  
>>  	return phy_write_mmd(phydev, MDIO_MMD_PMAPMD, MDIO_CTRL2, ctrl2);
>> +	if (ret < 0)
> 
> This patch does not make sense.
> 
Right, was a typo. Interestingly the compiler didn't complain.
I sent a v2 already.

>> +		return ret;
>> +
>> +	return genphy_c45_an_disable_aneg(phydev);
>>  }
>>  EXPORT_SYMBOL_GPL(genphy_c45_pma_setup_forced);
>>  
>> -- 
>> 2.20.1
>>
>>
>>
> 


^ permalink raw reply

* Re: [PATCH bpf-next] selftests: bpf: test_lwt_ip_encap: add negative tests.
From: David Ahern @ 2019-02-16 23:13 UTC (permalink / raw)
  To: Peter Oskolkov, Alexei Starovoitov, Daniel Borkmann, netdev
  Cc: Peter Oskolkov
In-Reply-To: <20190215234933.208398-1-posk@google.com>

On 2/15/19 4:49 PM, Peter Oskolkov wrote:
> @@ -178,7 +205,7 @@ set -e  # exit on error
>  	# configure IPv4 GRE device in NS3, and a route to it via the "bottom" route
>  	ip -netns ${NS3} tunnel add gre_dev mode gre remote ${IPv4_1} local ${IPv4_GRE} ttl 255
>  	ip -netns ${NS3} link set gre_dev up
> -	ip -netns ${NS3} addr add ${IPv4_GRE} dev gre_dev
> +	ip -netns ${NS3} addr add ${IPv4_GRE} nodad dev gre_dev

nodad is only effective for IPv6.

other than that LGTM. Thanks for the update.

Reviewed-by: David Ahern <dsahern@gmail.com>

^ permalink raw reply

* Re: [PATCH net-next] sock: consistent handling of extreme SO_SNDBUF/SO_RCVBUF values
From: David Miller @ 2019-02-17  2:10 UTC (permalink / raw)
  To: gnault; +Cc: netdev, linux-api, edumazet, mleitner, pabeni
In-Reply-To: <2cb69b6987b6e23f8b8c1aa8dc524efa6bd53191.1550026643.git.gnault@redhat.com>

From: Guillaume Nault <gnault@redhat.com>
Date: Wed, 13 Feb 2019 04:30:34 +0100

> SO_SNDBUF and SO_RCVBUF (and their *BUFFORCE version) may overflow or
> underflow their input value. This patch aims at providing explicit
> handling of these extreme cases, to get a clear behaviour even with
> values bigger than INT_MAX / 2 or lower than INT_MIN / 2.
 ...
> Signed-off-by: Guillaume Nault <gnault@redhat.com>

Thank you so much for writing such a detailed commit message.

Applied.

^ permalink raw reply

* Re: [PATCH] atm: clean up vcc_seq_next()
From: David Miller @ 2019-02-17  2:14 UTC (permalink / raw)
  To: dan.carpenter; +Cc: joe, netdev, kernel-janitors
In-Reply-To: <20190214065635.GA21768@kadam>

From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Thu, 14 Feb 2019 09:56:35 +0300

> It's confusing to call PTR_ERR(v).  The PTR_ERR() function is basically
> a fancy cast to long so it makes you wonder, was IS_ERR() intended?  But
> that doesn't make sense because vcc_walk() doesn't return error
> pointers.
> 
> This patch doesn't affect runtime, it's just a cleanup.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Applied.

^ permalink raw reply

* Re: [PATCH net-next] net/tls: Move protocol constants from cipher context to tls context
From: David Miller @ 2019-02-17  2:14 UTC (permalink / raw)
  To: vakul.garg; +Cc: netdev, borisp, aviadye, davejwatson, doronrk
In-Reply-To: <20190214070913.14647-1-vakul.garg@nxp.com>

From: Vakul Garg <vakul.garg@nxp.com>
Date: Thu, 14 Feb 2019 07:11:35 +0000

> Each tls context maintains two cipher contexts (one each for tx and rx
> directions). For each tls session, the constants such as protocol
> version, ciphersuite, iv size, associated data size etc are same for
> both the directions and need to be stored only once per tls context.
> Hence these are moved from 'struct cipher_context' to 'struct
> tls_prot_info' and stored only once in 'struct tls_context'.
> 
> Signed-off-by: Vakul Garg <vakul.garg@nxp.com>

Applied.

^ permalink raw reply

* Re: [net-next, PATCH v2] net: stmmac: use correct define to get rx timestamp on GMAC4
From: David Miller @ 2019-02-17  2:15 UTC (permalink / raw)
  To: alexandre.torgue
  Cc: peppe.cavallaro, joabreu, netdev, linux-stm32, linux-arm-kernel,
	linux-kernel
In-Reply-To: <1550160224-8927-1-git-send-email-alexandre.torgue@st.com>

From: Alexandre Torgue <alexandre.torgue@st.com>
Date: Thu, 14 Feb 2019 17:03:44 +0100

> In dwmac4_wrback_get_rx_timestamp_status we looking for a RX timestamp.
> For that receive descriptors are handled and so we should use defines
> related to receive descriptors. It'll no change the functional behavior
> as RDES3_RDES1_VALID=TDES3_RS1V=BIT(26) but it makes code easier to read.
> 
> Signed-off-by: Alexandre Torgue <alexandre.torgue@st.com>

Applied.

^ permalink raw reply

* Re: [PATCH net-next v2 1/2] net: phy: add helper mii_10gbt_stat_mod_linkmode_lpa_t
From: Florian Fainelli @ 2019-02-17  2:35 UTC (permalink / raw)
  To: Heiner Kallweit, Andrew Lunn, David Miller; +Cc: netdev@vger.kernel.org
In-Reply-To: <ebde74fb-2d0e-365c-f04c-288ce6d60368@gmail.com>



On 2/16/2019 8:26 AM, Heiner Kallweit wrote:
> Similar to the existing helpers for the Clause 22 registers add helper
> mii_10gbt_stat_mod_linkmode_lpa_t.
> 
> Note that this helper is defined in linux/mdio.h, not like the
> Clause 22 helpers in linux/mii.h. Reason is that the Clause 45 register
> constants are defined in uapi/linux/mdio.h. And uapi/linux/mdio.h
> includes linux/mii.h before defining the C45 register constants.

Nit: this also processes 2.5G and 5G but I can't suggest a better name,
so this is as good as any.

> 
> v2:
> - remove helpers that don't have users in this series
> 
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

^ permalink raw reply

* Re: [PATCH net-next v2 2/2] net: phy: use mii_10gbt_stat_mod_linkmode_lpa_t in genphy_c45_read_lpa
From: Florian Fainelli @ 2019-02-17  2:35 UTC (permalink / raw)
  To: Heiner Kallweit, Andrew Lunn, David Miller; +Cc: netdev@vger.kernel.org
In-Reply-To: <05e7f5fd-5783-f576-b164-2a64239ff6d7@gmail.com>



On 2/16/2019 8:26 AM, Heiner Kallweit wrote:
> Use mii_10gbt_stat_mod_linkmode_lpa_t() in genphy_c45_read_lpa() to
> simplify the code.
> 
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

^ permalink raw reply

* Re: [PATCH v2 net-next 1/2] net: phy: disable aneg in genphy_c45_pma_setup_forced
From: Florian Fainelli @ 2019-02-17  2:37 UTC (permalink / raw)
  To: Heiner Kallweit, Andrew Lunn, David Miller,
	Russell King - ARM Linux
  Cc: netdev@vger.kernel.org
In-Reply-To: <0ac9be2a-ce73-8938-f25b-6dd1a169a1a7@gmail.com>



On 2/16/2019 11:44 AM, Heiner Kallweit wrote:
> When genphy_c45_pma_setup_forced() is called the "aneg enabled" bit may
> still be set, therefore clear it. This is also in line with what
> genphy_setup_forced() does for Clause 22.
> 
> v2:
> - fix typo
> 
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
--
Florian

^ permalink raw reply

* Re: [PATCH v2 net-next 2/2] net: phy: marvell10g: improve mv3310_config_aneg
From: Florian Fainelli @ 2019-02-17  2:37 UTC (permalink / raw)
  To: Heiner Kallweit, Andrew Lunn, David Miller,
	Russell King - ARM Linux
  Cc: netdev@vger.kernel.org
In-Reply-To: <6827daf4-3ee0-c537-2b97-493bcc2a48ab@gmail.com>



On 2/16/2019 11:44 AM, Heiner Kallweit wrote:
> Now that genphy_c45_pma_setup_forced() makes sure the "aneg enabled"
> bit is cleared, the call to genphy_c45_an_disable_aneg() isn't needed
> any longer. And the code pattern is now the same as in
> genphy_config_aneg().
> 
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

^ permalink raw reply

* Re: [PATCH net-next 1/4] net: phy: add helper linkmode_adv_to_mii_10gbt_adv_t
From: Florian Fainelli @ 2019-02-17  2:38 UTC (permalink / raw)
  To: Heiner Kallweit, Andrew Lunn, David Miller,
	Russell King - ARM Linux
  Cc: netdev@vger.kernel.org
In-Reply-To: <789f6af7-47a2-1c8c-0c4c-d1f49524e08f@gmail.com>



On 2/16/2019 11:50 AM, Heiner Kallweit wrote:
> Add a helper linkmode_adv_to_mii_10gbt_adv_t(), similar to
> linkmode_adv_to_mii_adv_t.
> 
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

^ permalink raw reply

* Re: [PATCH net-next 2/4] net: phy: add genphy_c45_an_config_an
From: Florian Fainelli @ 2019-02-17  2:44 UTC (permalink / raw)
  To: Heiner Kallweit, Andrew Lunn, David Miller,
	Russell King - ARM Linux
  Cc: netdev@vger.kernel.org
In-Reply-To: <a5b17bc8-1aab-053b-dee8-c412215a70c8@gmail.com>



On 2/16/2019 11:51 AM, Heiner Kallweit wrote:
> From: Andrew Lunn <andrew@lunn.ch>
> C45 configuration of 10/100 and multi-giga bit auto negotiation
> advertisement is standardized. Configuration of 1000Base-T however
> appears to be vendor specific. Move the generic code out of the
> Marvell driver into the common phy-c45.c file.
> 
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>
> [hkallweit1@gmail.com: use new helper linkmode_adv_to_mii_10gbt_adv_t and split patch]
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
> ---
>  drivers/net/phy/phy-c45.c | 44 +++++++++++++++++++++++++++++++++++++++
>  include/linux/phy.h       |  1 +
>  2 files changed, 45 insertions(+)
> 
> diff --git a/drivers/net/phy/phy-c45.c b/drivers/net/phy/phy-c45.c
> index 0374c50b1..bea1b0c6e 100644
> --- a/drivers/net/phy/phy-c45.c
> +++ b/drivers/net/phy/phy-c45.c
> @@ -78,6 +78,50 @@ int genphy_c45_pma_setup_forced(struct phy_device *phydev)
>  }
>  EXPORT_SYMBOL_GPL(genphy_c45_pma_setup_forced);
>  
> +/**
> + * genphy_c45_an_config_an - configure advertisement registers

Nit: are not the two "an" redundant" here? Unless the first one means
something different in which case naming this:
genphy_c45_an_config_aneg() would be clearer?


> + * @phydev: target phy_device struct
> + *
> + * Configure advertisement registers based on modes set in phydev->advertising
> + *
> + * Returns negative errno code on failure, 0 if advertisement didn't change,
> + * or 1 if advertised modes changed.
> + */
> +int genphy_c45_an_config_an(struct phy_device *phydev)
> +{
> +	int changed = 0, ret;
> +	u32 adv;
> +
> +	linkmode_and(phydev->advertising, phydev->advertising,
> +		     phydev->supported);
> +
> +	adv = linkmode_adv_to_mii_adv_t(phydev->advertising);
> +
> +	ret = phy_modify_mmd(phydev, MDIO_MMD_AN, MDIO_AN_ADVERTISE,
> +			     ADVERTISE_ALL | ADVERTISE_100BASE4 |
> +			     ADVERTISE_PAUSE_CAP | ADVERTISE_PAUSE_ASYM,
> +			     adv);
> +	if (ret < 0)
> +		return ret;
> +	if (ret > 0)
> +		changed = 1;

'changed' is essentially a short hand for 'ret >= 0' given it is
initialized to 0 by default and only assigned 1 if 'ret > 0', and since
you do early returns in case 'ret < 0', you might as well drop 'changed'
entirely?

Other than that and the naming:

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox