Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next 2/7] net: phy: marvell10g: Use linkmode_set_bit helper instead of __set_bit
From: Maxime Chevallier @ 2019-02-21  9:51 UTC (permalink / raw)
  To: davem
  Cc: Maxime Chevallier, netdev, linux-kernel, Andrew Lunn,
	Florian Fainelli, Heiner Kallweit, Russell King, linux-arm-kernel,
	Antoine Tenart, thomas.petazzoni, gregory.clement, miquel.raynal,
	nadavh, stefanc, mw
In-Reply-To: <20190221095128.28188-1-maxime.chevallier@bootlin.com>

Cosmetic patch making use of helpers dedicated to linkmodes handling.

Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
---
 drivers/net/phy/marvell10g.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c
index 65ef469adf58..8e2d6039b9b3 100644
--- a/drivers/net/phy/marvell10g.c
+++ b/drivers/net/phy/marvell10g.c
@@ -252,8 +252,8 @@ static int mv3310_get_features(struct phy_device *phydev)
 			return val;
 
 		if (val & MDIO_AN_STAT1_ABLE)
-			__set_bit(ETHTOOL_LINK_MODE_Autoneg_BIT,
-				  phydev->supported);
+			linkmode_set_bit(ETHTOOL_LINK_MODE_Autoneg_BIT,
+					 phydev->supported);
 	}
 
 	ret = genphy_c45_pma_read_abilities(phydev);
-- 
2.19.2


^ permalink raw reply related

* [PATCH net-next 1/7] net: phy: marvell10g: Use get_features to get the PHY abilities
From: Maxime Chevallier @ 2019-02-21  9:51 UTC (permalink / raw)
  To: davem
  Cc: Maxime Chevallier, netdev, linux-kernel, Andrew Lunn,
	Florian Fainelli, Heiner Kallweit, Russell King, linux-arm-kernel,
	Antoine Tenart, thomas.petazzoni, gregory.clement, miquel.raynal,
	nadavh, stefanc, mw
In-Reply-To: <20190221095128.28188-1-maxime.chevallier@bootlin.com>

The Alaska family of 10G PHYs has more abilities than the ones listed in
PHY_10GBIT_FULL_FEATURES, the exact list depending on the model.

Make use of the newly introduced .get_features call to build this list,
using genphy_c45_pma_read_abilities to build the list of supported
linkmodes, and adding autoneg ability based on what's reported by the AN
MMD.

.config_init is still used to validate the interface_mode.

Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
---
 drivers/net/phy/marvell10g.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c
index 9ea27acf05ad..65ef469adf58 100644
--- a/drivers/net/phy/marvell10g.c
+++ b/drivers/net/phy/marvell10g.c
@@ -233,8 +233,6 @@ static int mv3310_resume(struct phy_device *phydev)
 
 static int mv3310_config_init(struct phy_device *phydev)
 {
-	int ret, val;
-
 	/* Check that the PHY interface type is compatible */
 	if (phydev->interface != PHY_INTERFACE_MODE_SGMII &&
 	    phydev->interface != PHY_INTERFACE_MODE_XAUI &&
@@ -242,6 +240,12 @@ static int mv3310_config_init(struct phy_device *phydev)
 	    phydev->interface != PHY_INTERFACE_MODE_10GKR)
 		return -ENODEV;
 
+	return 0;
+}
+
+static int mv3310_get_features(struct phy_device *phydev)
+{
+	int ret, val;
 	if (phydev->c45_ids.devices_in_package & MDIO_DEVS_AN) {
 		val = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_STAT1);
 		if (val < 0)
@@ -429,7 +433,7 @@ static struct phy_driver mv3310_drivers[] = {
 		.phy_id		= 0x002b09aa,
 		.phy_id_mask	= MARVELL_PHY_ID_MASK,
 		.name		= "mv88x3310",
-		.features	= PHY_10GBIT_FEATURES,
+		.get_features	= mv3310_get_features,
 		.soft_reset	= gen10g_no_soft_reset,
 		.config_init	= mv3310_config_init,
 		.probe		= mv3310_probe,
-- 
2.19.2


^ permalink raw reply related

* [PATCH net-next 0/7] net: phy: marvell10g: Add 2.5GBaseT
From: Maxime Chevallier @ 2019-02-21  9:51 UTC (permalink / raw)
  To: davem
  Cc: Maxime Chevallier, netdev, linux-kernel, Andrew Lunn,
	Florian Fainelli, Heiner Kallweit, Russell King, linux-arm-kernel,
	Antoine Tenart, thomas.petazzoni, gregory.clement, miquel.raynal,
	nadavh, stefanc, mw

This series adds the missing bits necessary to fully support 2.5GBaseT
in the Marvell Alaska PHYs.

The main points for that support are :

 - Making use of the .get_features call, recently introduced by Heiner
   and Andrew, that allows having a fully populated list of supported
   modes, including 2500BaseT.  

 - Configuring the MII to 2500BaseX when establishing a link at 2.5G

 - Adding a small quirk to take into account the fact that some PHYs in
   the family won't report the correct supported abilities

The rest of the series consists of small cosmetic improvements such as
using the correct helper to set a linkmode bit and adding macros for the
PHY ids.

We also add support for the 88E2110 PHY, which doesn't require the
quirk, and support for 2500BaseT in the PPv2 driver, in order to have a
fully working setup on the MacchiatoBin board.

Maxime Chevallier (7):
  net: phy: marvell10g: Use get_features to get the PHY abilities
  net: phy: marvell10g: Use linkmode_set_bit helper instead of __set_bit
  net: phy: marvell10g: Use 2500BASEX when using 2.5GBASET
  net: phy: marvell10g: Use a #define for 88X3310 family id
  net: phy: marvell10g: Force reading of 2.5/5G
  net: mvpp2: Add 2.5GBaseT support
  net: phy: marvell10g: add support for the 88x2110 PHY

 .../net/ethernet/marvell/mvpp2/mvpp2_main.c   |  1 +
 drivers/net/phy/marvell10g.c                  | 92 ++++++++++++++++---
 include/linux/marvell_phy.h                   |  2 +
 3 files changed, 81 insertions(+), 14 deletions(-)

-- 
2.19.2


^ permalink raw reply

* Re: [RFC PATCH net-next v3 00/21] ethtool netlink interface, part 1
From: Michal Kubecek @ 2019-02-21  9:54 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: netdev, David Miller, Andrew Lunn, Jakub Kicinski, Jiri Pirko,
	linux-kernel
In-Reply-To: <1cef1440-7345-a9a0-eab8-ab1c79c0d075@gmail.com>

On Wed, Feb 20, 2019 at 07:21:18PM -0800, Florian Fainelli wrote:
> > Main changes between RFC v2 and RFC v3:
> > 
> > - do not allow building as a module (no netdev notifiers needed)
> 
> I would very much prefer that we could build this as a module. Some
> systems might be memory constrained or opt to disable ethtool entirely
> (security?). If this is not too much trouble, can we try to maintain that?

There were two reasons why I agreed so quickly to the suggestion to make
CONFIG_ETHTOOL a bool:

1. I didn't really think there would be anyone who would benefit from
having the interface as a loadable module and the only reason why I made
it possible originally was that it was easier to test changes that way.
That was rather poor reason for keeping it once submitted but if there
is an actual demand from real life users, it's something different.

2. Using of ethtool netdev notifiers for triggering netlink
notifications from other code (mostly ioctl interface) was rather
clumsy. However, it could be worked around using an RCU pointer and some
simple helpers (as discussed in the devlink thread) so this not not
a serious problem either.

> > - some features provided by ethtool would rather belong to devlink (and
> >   some are already superseded by devlink); however, only few drivers
> >   provide devlink interface at the moment and as recent discussion on
> >   flashing revealed, we cannot rely on devlink's presence
> 
> Should we just move everything under devlink given that ethtool over
> netlink or devlink are essentially manipulating the same (or close to)
> objects? It seems to me that at least now is the right time to make
> decisions about what should stay in ethtool and be offered via netlink,
> what should be migrated to something else (e.g.: Jiri mentioned
> rtnetlink), and what is a devlink candidate.
> 
> How do we proceed to easily triage which of these netlink facilities
> should things be routed to/from?

At the moment I would say the likely candidates for rtnetlink are
permanent hw address (ethtool -P), netdev features (-k / -K) and link
state (part of "ethtool <dev>"). (I'm not very happy about the prospect
of moving netdev features to rtnetlink but it seems hard to argue why
they shouldn't belong there.) As for devlink, I would see eeprom dump
(-e) and write (-E), register dump (-d), firmware dump (-w / -W) and
flash (-f), and module eeprom dump (-m) as candidates. Maybe also device
reset (--reset) (which was put into ethtool_ops, though, even if added
only recently).

There is also another question: at which level to do the split.

I would like to avoid doint it between user and ethtool utility, i.e.
dropping some functions from ethtool and pointing people to iproute2
tools (or even replacing ethtool with some new tool). There is the
"ifconfig memento": 20 years after it became obsolete, I still keep
hearing people say "I don't want to learn some new tool with unfamiliar
syntax". (Some of them learning to use ifconfig few years ago doesn't
really help. Neither them saying the same about ss which copied the most
of netstat's basic options.) I'm afraid the result would be exactly the
same with ethtool.

Then there is an option of providing the functions in ethtool but using
both ethtool netlink and devlink (and probably also rtnetlink) to talk
to kernel. This means a bit more complicated userspace code but nothing
serious. The bigger problem I see with this approach is that so far only
few NIC drivers have any devlink support. Unless we would want to add
ethtool_ops fallback for devlink, we would have to wait until the
relevant features are available via devlink in all in-tree NIC drivers
which provide them via ethtool_ops now.

Providing the features via ethtool netlink interface but having them
backed up by devlink would mean we would have two userspace interfaces
for the same (or almost the same) function. It's something I could live
with but I understand that not everyone would like this. The advantage
is that it would allow migrating the features from ethtool_ops to
devlink gradually.

> > - while the netlink interface allows easy future extensions, ethtool_ops
> >   interface does not; some settings could be implemented using tunables and
> >   accessed via relevant netlink messages (as well as tunables) from
> >   userspace but in the long term, something better will be needed
> 
> Right, so as a driver writer, one thing I kind of hate is having to fill
> a netlink skb myself because that's a lot of work, and it makes it
> fairly hard to do mass conversion of internal APIs due to the increased
> complexity in auditing what drivers do.

I would also prefer to avoid parsing and generating netlink messages in
drivers for regular operations.

Michal

^ permalink raw reply

* Re: [PATCH net-next v3 1/8] net: switchdev: Add PORT_PRE_BRIDGE_FLAGS
From: Ido Schimmel @ 2019-02-21  9:55 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: netdev@vger.kernel.org, David S. Miller, open list,
	open list:STAGING SUBSYSTEM, moderated list:ETHERNET BRIDGE,
	Jiri Pirko, andrew@lunn.ch, vivien.didelot@gmail.com
In-Reply-To: <20190221005826.26317-2-f.fainelli@gmail.com>

On Wed, Feb 20, 2019 at 04:58:19PM -0800, Florian Fainelli wrote:
> In preparation for removing switchdev_port_attr_get(), introduce
> PORT_PRE_BRIDGE_FLAGS which will be called through
> switchdev_port_attr_set(), in the caller's context (possibly atomic) and
> which must be checked by the switchdev driver in order to return whether
> the operation is supported or not.
> 
> This is entirely analoguous to how the BRIDGE_FLAGS_SUPPORT works,
> except it goes through a set() instead of get().
> 
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>

Reviewed-by: Ido Schimmel <idosch@mellanox.com>

^ permalink raw reply

* Re: [PATCH net-next v3 2/8] mlxsw: spectrum: Handle PORT_PRE_BRIDGE_FLAGS
From: Ido Schimmel @ 2019-02-21  9:56 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: netdev@vger.kernel.org, David S. Miller, open list,
	open list:STAGING SUBSYSTEM, moderated list:ETHERNET BRIDGE,
	Jiri Pirko, andrew@lunn.ch, vivien.didelot@gmail.com
In-Reply-To: <20190221005826.26317-3-f.fainelli@gmail.com>

On Wed, Feb 20, 2019 at 04:58:20PM -0800, Florian Fainelli wrote:
> In preparation for getting rid of switchdev_port_attr_get(), have mlxsw
> check for the bridge flags being set through switchdev_port_attr_set()
> when the SWITCHDEV_ATTR_ID_PORT_PRE_BRIDGE_FLAGS attribute identifier is
> used.
> 
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>

Reviewed-by: Ido Schimmel <idosch@mellanox.com>

^ permalink raw reply

* Re: [PATCH] perf record: Add support for limit perf output file size
From: Jiri Olsa @ 2019-02-21  9:56 UTC (permalink / raw)
  To: Jiwei Sun
  Cc: peterz, mingo, acme, alexander.shishkin, namhyung, ast, daniel,
	kafai, songliubraving, yhs, linux-kernel, netdev
In-Reply-To: <20190221064419.6166-1-jiwei.sun@windriver.com>

On Thu, Feb 21, 2019 at 02:44:19PM +0800, Jiwei Sun wrote:
> The patch adds a new option to limit the output file size, then based
> on it, we can create a wrapper of the perf command that uses the option
> to avoid exhausting the disk space by the unconscious user.
> 
> Signed-off-by: Jiwei Sun <jiwei.sun@windriver.com>
> ---
>  tools/perf/builtin-record.c | 39 +++++++++++++++++++++++++++++++++++++
>  1 file changed, 39 insertions(+)
> 
> diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
> index 882285fb9f64..28a03929166d 100644
> --- a/tools/perf/builtin-record.c
> +++ b/tools/perf/builtin-record.c
> @@ -81,6 +81,7 @@ struct record {
>  	bool			timestamp_boundary;
>  	struct switch_output	switch_output;
>  	unsigned long long	samples;
> +	unsigned long		output_max_size;	/* = 0: unlimited */

please rebase to latest Arnaldo's perf/core,
there are new fields in here now

>  };
>  
>  static volatile int auxtrace_record__snapshot_started;
> @@ -106,6 +107,12 @@ static bool switch_output_time(struct record *rec)
>  	       trigger_is_ready(&switch_output_trigger);
>  }
>  
> +static bool record__output_max_size_exceeded(struct record *rec)
> +{
> +	return (rec->output_max_size &&
> +			rec->bytes_written >= rec->output_max_size);
> +}
> +
>  static int record__write(struct record *rec, struct perf_mmap *map __maybe_unused,
>  			 void *bf, size_t size)
>  {
> @@ -118,6 +125,9 @@ static int record__write(struct record *rec, struct perf_mmap *map __maybe_unuse
>  
>  	rec->bytes_written += size;
>  
> +	if (record__output_max_size_exceeded(rec))
> +		raise(SIGTERM);

perhaps display some message saying we reached the limit

other than that looks good to me

thanks,
jirka


> +
>  	if (switch_output_size(rec))
>  		trigger_hit(&switch_output_trigger);
>  
> @@ -1639,6 +1649,33 @@ static int parse_clockid(const struct option *opt, const char *str, int unset)
>  	return -1;
>  }
>  
> +static int parse_output_max_size(const struct option *opt, const char *str,
> +				 int unset)
> +{
> +	unsigned long *s = (unsigned long *)opt->value;
> +	static struct parse_tag tags_size[] = {
> +		{ .tag  = 'B', .mult = 1       },
> +		{ .tag  = 'K', .mult = 1 << 10 },
> +		{ .tag  = 'M', .mult = 1 << 20 },
> +		{ .tag  = 'G', .mult = 1 << 30 },
> +		{ .tag  = 0 },
> +	};
> +	unsigned long val;
> +
> +	if (unset) {
> +		*s = 0;
> +		return 0;
> +	}
> +
> +	val = parse_tag_value(str, tags_size);
> +	if (val != (unsigned long) -1) {
> +		*s = val;
> +		return 0;
> +	}
> +
> +	return -1;
> +}
> +
>  static int record__parse_mmap_pages(const struct option *opt,
>  				    const char *str,
>  				    int unset __maybe_unused)
> @@ -1946,6 +1983,8 @@ static struct option __record_options[] = {
>  		     &nr_cblocks_default, "n", "Use <n> control blocks in asynchronous trace writing mode (default: 1, max: 4)",
>  		     record__aio_parse),
>  #endif
> +	OPT_CALLBACK(0, "output-max-size", &record.output_max_size,
> +		     "size", "Output file maximum size", parse_output_max_size),
>  	OPT_END()
>  };
>  
> -- 
> 2.20.1
> 

^ permalink raw reply

* Re: [PATCH net-next v3 6/8] net: bridge: Stop calling switchdev_port_attr_get()
From: Ido Schimmel @ 2019-02-21  9:56 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: netdev@vger.kernel.org, David S. Miller, open list,
	open list:STAGING SUBSYSTEM, moderated list:ETHERNET BRIDGE,
	Jiri Pirko, andrew@lunn.ch, vivien.didelot@gmail.com
In-Reply-To: <20190221005826.26317-7-f.fainelli@gmail.com>

On Wed, Feb 20, 2019 at 04:58:24PM -0800, Florian Fainelli wrote:
> Now that all switchdev drivers have been converted to check the
> SWITCHDEV_ATTR_ID_PORT_PRE_BRIDGE_FLAGS flags and report flags that they
> do not support accordingly, we can migrate the bridge code to try to set
> that attribute first, check the results and then do the actual setting.
> 
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>

Reviewed-by: Ido Schimmel <idosch@mellanox.com>

^ permalink raw reply

* Re: [RFC PATCH net-next v3 14/21] ethtool: provide link mode names as a string set
From: Michal Kubecek @ 2019-02-21  9:57 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: netdev, David Miller, Andrew Lunn, Jakub Kicinski, Jiri Pirko,
	linux-kernel
In-Reply-To: <9a26eed3-f69a-b5fd-66e1-b926c6e92c2f@gmail.com>

On Wed, Feb 20, 2019 at 07:21:58PM -0800, Florian Fainelli wrote:
> > +const char *const link_mode_names[] = {
> 
> Maybe you can define a macro (totally untested) to build the table an
> avoid some of the repetition, something like:
> 
> #define ETHTOOL_LINK_NAME(speed, duplex) \
> 	[ETHTOOL_LINK_MODE_##speed_##duplex_BIT]	= stringify(speed ## "/" ##
> duplex)

Thanks for the tip, that should work for most of the modes.

Michal

^ permalink raw reply

* Re: [PATCH net-next v3 8/8] net: Get rid of switchdev_port_attr_get()
From: Ido Schimmel @ 2019-02-21  9:57 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: netdev@vger.kernel.org, David S. Miller, open list,
	open list:STAGING SUBSYSTEM, moderated list:ETHERNET BRIDGE,
	Jiri Pirko, andrew@lunn.ch, vivien.didelot@gmail.com
In-Reply-To: <20190221005826.26317-9-f.fainelli@gmail.com>

On Wed, Feb 20, 2019 at 04:58:26PM -0800, Florian Fainelli wrote:
> With the bridge no longer calling switchdev_port_attr_get() to obtain
> the supported bridge port flags from a driver but instead trying to set
> the bridge port flags directly and relying on driver to reject
> unsupported configurations, we can effectively get rid of
> switchdev_port_attr_get() entirely since this was the only place where
> it was called.
> 
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>

Reviewed-by: Ido Schimmel <idosch@mellanox.com>

^ permalink raw reply

* Re: [PATCH net-next v3 1/8] net: switchdev: Add PORT_PRE_BRIDGE_FLAGS
From: Jiri Pirko @ 2019-02-21  9:56 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: netdev, David S. Miller, Ido Schimmel, open list,
	open list:STAGING SUBSYSTEM, moderated list:ETHERNET BRIDGE, jiri,
	andrew, vivien.didelot
In-Reply-To: <20190221005826.26317-2-f.fainelli@gmail.com>

Thu, Feb 21, 2019 at 01:58:19AM CET, f.fainelli@gmail.com wrote:
>In preparation for removing switchdev_port_attr_get(), introduce
>PORT_PRE_BRIDGE_FLAGS which will be called through
>switchdev_port_attr_set(), in the caller's context (possibly atomic) and
>which must be checked by the switchdev driver in order to return whether
>the operation is supported or not.
>
>This is entirely analoguous to how the BRIDGE_FLAGS_SUPPORT works,
>except it goes through a set() instead of get().
>
>Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>

Acked-by: Jiri Pirko <jiri@mellanox.com>

^ permalink raw reply

* Re: [PATCH net-next v3 2/8] mlxsw: spectrum: Handle PORT_PRE_BRIDGE_FLAGS
From: Jiri Pirko @ 2019-02-21  9:56 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: netdev, David S. Miller, Ido Schimmel, open list,
	open list:STAGING SUBSYSTEM, moderated list:ETHERNET BRIDGE, jiri,
	andrew, vivien.didelot
In-Reply-To: <20190221005826.26317-3-f.fainelli@gmail.com>

Thu, Feb 21, 2019 at 01:58:20AM CET, f.fainelli@gmail.com wrote:
>In preparation for getting rid of switchdev_port_attr_get(), have mlxsw
>check for the bridge flags being set through switchdev_port_attr_set()
>when the SWITCHDEV_ATTR_ID_PORT_PRE_BRIDGE_FLAGS attribute identifier is
>used.
>
>Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>

Acked-by: Jiri Pirko <jiri@mellanox.com>

^ permalink raw reply

* Re: [PATCH net-next v3 3/8] staging: fsl-dpaa2: ethsw: Handle PORT_PRE_BRIDGE_FLAGS
From: Jiri Pirko @ 2019-02-21  9:57 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: netdev, David S. Miller, Ido Schimmel, open list,
	open list:STAGING SUBSYSTEM, moderated list:ETHERNET BRIDGE, jiri,
	andrew, vivien.didelot
In-Reply-To: <20190221005826.26317-4-f.fainelli@gmail.com>

Thu, Feb 21, 2019 at 01:58:21AM CET, f.fainelli@gmail.com wrote:
>In preparation for removing SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS_SUPPORT,
>handle the SWITCHDEV_ATTR_ID_PORT_PRE_BRIDGE_FLAGS attribute and check
>that the bridge port flags being configured are supported.
>
>Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>

Acked-by: Jiri Pirko <jiri@mellanox.com>

^ permalink raw reply

* Re: [PATCH net-next v3 4/8] net: dsa: Add setter for SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS
From: Jiri Pirko @ 2019-02-21  9:57 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: netdev, David S. Miller, Ido Schimmel, open list,
	open list:STAGING SUBSYSTEM, moderated list:ETHERNET BRIDGE, jiri,
	andrew, vivien.didelot
In-Reply-To: <20190221005826.26317-5-f.fainelli@gmail.com>

Thu, Feb 21, 2019 at 01:58:22AM CET, f.fainelli@gmail.com wrote:
>In preparation for removing SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS_SUPPORT,
>add support for a function that processes the
>SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS and
>SWITCHDEV_ATTR_ID_PORT_PRE_BRIDGE_FLAGS attributes and returns not
>supported for any flag set, since DSA does not currently support
>toggling those bridge port attributes (yet).
>
>Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>

Acked-by: Jiri Pirko <jiri@mellanox.com>

^ permalink raw reply

* Re: [PATCH net-next v3 5/8] rocker: Check Handle PORT_PRE_BRIDGE_FLAGS
From: Jiri Pirko @ 2019-02-21  9:57 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: netdev, David S. Miller, Ido Schimmel, open list,
	open list:STAGING SUBSYSTEM, moderated list:ETHERNET BRIDGE, jiri,
	andrew, vivien.didelot
In-Reply-To: <20190221005826.26317-6-f.fainelli@gmail.com>

Thu, Feb 21, 2019 at 01:58:23AM CET, f.fainelli@gmail.com wrote:
>In preparation for getting rid of switchdev_port_attr_get(), have rocker
>check for the bridge flags being set through switchdev_port_attr_set()
>with the SWITCHDEV_ATTR_ID_PORT_PRE_BRIDGE_FLAGS attribute identifier.
>
>Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>

Acked-by: Jiri Pirko <jiri@mellanox.com>

^ permalink raw reply

* Re: [PATCH net-next v3 6/8] net: bridge: Stop calling switchdev_port_attr_get()
From: Jiri Pirko @ 2019-02-21  9:57 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: netdev, David S. Miller, Ido Schimmel, open list,
	open list:STAGING SUBSYSTEM, moderated list:ETHERNET BRIDGE, jiri,
	andrew, vivien.didelot
In-Reply-To: <20190221005826.26317-7-f.fainelli@gmail.com>

Thu, Feb 21, 2019 at 01:58:24AM CET, f.fainelli@gmail.com wrote:
>Now that all switchdev drivers have been converted to check the
>SWITCHDEV_ATTR_ID_PORT_PRE_BRIDGE_FLAGS flags and report flags that they
>do not support accordingly, we can migrate the bridge code to try to set
>that attribute first, check the results and then do the actual setting.
>
>Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>

Acked-by: Jiri Pirko <jiri@mellanox.com>

^ permalink raw reply

* Re: [PATCH net-next v3 7/8] net: Remove SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS_SUPPORT
From: Jiri Pirko @ 2019-02-21  9:57 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: netdev, David S. Miller, Ido Schimmel, open list,
	open list:STAGING SUBSYSTEM, moderated list:ETHERNET BRIDGE, jiri,
	andrew, vivien.didelot
In-Reply-To: <20190221005826.26317-8-f.fainelli@gmail.com>

Thu, Feb 21, 2019 at 01:58:25AM CET, f.fainelli@gmail.com wrote:
>Now that we have converted the bridge code and the drivers to check for
>bridge port(s) flags at the time we try to set them, there is no need
>for a get() -> set() sequence anymore and
>SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS_SUPPORT therefore becomes unused.
>
>Reviewed-by: Ido Schimmel <idosch@mellanox.com>
>Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>

Acked-by: Jiri Pirko <jiri@mellanox.com>

^ permalink raw reply

* Re: [PATCH net-next v3 8/8] net: Get rid of switchdev_port_attr_get()
From: Jiri Pirko @ 2019-02-21  9:57 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: netdev, David S. Miller, Ido Schimmel, open list,
	open list:STAGING SUBSYSTEM, moderated list:ETHERNET BRIDGE, jiri,
	andrew, vivien.didelot
In-Reply-To: <20190221005826.26317-9-f.fainelli@gmail.com>

Thu, Feb 21, 2019 at 01:58:26AM CET, f.fainelli@gmail.com wrote:
>With the bridge no longer calling switchdev_port_attr_get() to obtain
>the supported bridge port flags from a driver but instead trying to set
>the bridge port flags directly and relying on driver to reject
>unsupported configurations, we can effectively get rid of
>switchdev_port_attr_get() entirely since this was the only place where
>it was called.
>
>Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>

Acked-by: Jiri Pirko <jiri@mellanox.com>

Thanks!

^ permalink raw reply

* Re: [RFC PATCH net-next v3 15/21] ethtool: provide link settings and link modes in GET_SETTINGS request
From: Michal Kubecek @ 2019-02-21 10:14 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: netdev, David Miller, Andrew Lunn, Jakub Kicinski, Jiri Pirko,
	linux-kernel
In-Reply-To: <f2f8ccdd-c8bb-7f0a-5df7-dd54359e859e@gmail.com>

On Wed, Feb 20, 2019 at 07:14:50PM -0800, Florian Fainelli wrote:
> On 2/18/2019 10:22 AM, Michal Kubecek wrote:
> > +#define ETH_SETTINGS_IM_LINKINFO		0x01
> > +#define ETH_SETTINGS_IM_LINKMODES		0x02
> > +
> > +#define ETH_SETTINGS_IM_ALL			0x03
> 
> You could define ETH_SETTINGS_IM_ALL as:
> 
> #define ETH_SETTING_IM_ALL		\
> 		(ETH_SETTINGS_IM_LINKINFO |
> 		 ETH_SETTINGS_IM_LINMODES)
> 
> that would scale better IMHO, especially given that you have to keep
> bumping that mask with new bits in subsequent patches.

I'm considering going even further and using something similar to what
is used for NETIF_F_* constants so that the *_ALL value would be
calculated automatically. But I'm not sure if it's not too fancy for
a uapi header file.

> > +	if (tb[ETHA_SETTINGS_INFOMASK])
> > +		req_info->req_mask = nla_get_u32(tb[ETHA_SETTINGS_INFOMASK]);
> > +	if (tb[ETHA_SETTINGS_COMPACT])
> > +		req_info->compact = true;
> > +	if (req_info->req_mask == 0)
> > +		req_info->req_mask = ETH_SETTINGS_IM_ALL;
> 
> What if userland is newer than the kernel and specifies a req_mask with
> bits set that you don't support? Should not you always do an &
> ETH_SETTINGS_IM_ALL here?

In that case only known bits would be handled and the check at the end
of prepare_info() would add a warning to extack that part of the
information couldn't be provided (same as if some of the recognized
parts didn't have necessary ethtool_ops handlers or if they failed).

Michal

^ permalink raw reply

* [PATCH net v2 0/2] ipv6: route: enforce RCU protection for fib6_info->from
From: Paolo Abeni @ 2019-02-21 10:19 UTC (permalink / raw)
  To: netdev; +Cc: David Ahern, David S. Miller

This series addresses a couple of RCU left-over dating back to rt6_info->from
conversion to RCU

v1 -> v2:
 - fix a possible race in patch 1

Paolo Abeni (2):
  ipv6: route: enforce RCU protection in rt6_update_exception_stamp_rt()
  ipv6: route: enforce RCU protection in ip6_route_check_nh_onlink()

 net/ipv6/route.c | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

-- 
2.20.1


^ permalink raw reply

* [PATCH net v2 2/2] ipv6: route: enforce RCU protection in ip6_route_check_nh_onlink()
From: Paolo Abeni @ 2019-02-21 10:19 UTC (permalink / raw)
  To: netdev; +Cc: David Ahern, David S. Miller
In-Reply-To: <cover.1550684182.git.pabeni@redhat.com>

We need a RCU critical section around rt6_info->from deference, and
proper annotation.

Fixes: 4ed591c8ab44 ("net/ipv6: Allow onlink routes to have a device mismatch if it is the default route")
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
---
 net/ipv6/route.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 1597a3746b40..047c47224dba 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -2754,20 +2754,24 @@ static int ip6_route_check_nh_onlink(struct net *net,
 	u32 tbid = l3mdev_fib_table(dev) ? : RT_TABLE_MAIN;
 	const struct in6_addr *gw_addr = &cfg->fc_gateway;
 	u32 flags = RTF_LOCAL | RTF_ANYCAST | RTF_REJECT;
+	struct fib6_info *from;
 	struct rt6_info *grt;
 	int err;
 
 	err = 0;
 	grt = ip6_nh_lookup_table(net, cfg, gw_addr, tbid, 0);
 	if (grt) {
+		rcu_read_lock();
+		from = rcu_dereference(grt->from);
 		if (!grt->dst.error &&
 		    /* ignore match if it is the default route */
-		    grt->from && !ipv6_addr_any(&grt->from->fib6_dst.addr) &&
+		    from && !ipv6_addr_any(&from->fib6_dst.addr) &&
 		    (grt->rt6i_flags & flags || dev != grt->dst.dev)) {
 			NL_SET_ERR_MSG(extack,
 				       "Nexthop has invalid gateway or device mismatch");
 			err = -EINVAL;
 		}
+		rcu_read_unlock();
 
 		ip6_rt_put(grt);
 	}
-- 
2.20.1


^ permalink raw reply related

* [PATCH net v2 1/2] ipv6: route: enforce RCU protection in rt6_update_exception_stamp_rt()
From: Paolo Abeni @ 2019-02-21 10:19 UTC (permalink / raw)
  To: netdev; +Cc: David Ahern, David S. Miller
In-Reply-To: <cover.1550684182.git.pabeni@redhat.com>

We must access rt6_info->from under RCU read lock: move the
dereference under such lock, with proper annotation.

v1 -> v2:
 - avoid using multiple, racy, fetch operations for rt->from

Fixes: a68886a69180 ("net/ipv6: Make from in rt6_info rcu protected")
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
---
 net/ipv6/route.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index bd09abd1fb22..1597a3746b40 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -1610,15 +1610,15 @@ static int rt6_remove_exception_rt(struct rt6_info *rt)
 static void rt6_update_exception_stamp_rt(struct rt6_info *rt)
 {
 	struct rt6_exception_bucket *bucket;
-	struct fib6_info *from = rt->from;
 	struct in6_addr *src_key = NULL;
 	struct rt6_exception *rt6_ex;
-
-	if (!from ||
-	    !(rt->rt6i_flags & RTF_CACHE))
-		return;
+	struct fib6_info *from;
 
 	rcu_read_lock();
+	from = rcu_dereference(rt->from);
+	if (!from || !(rt->rt6i_flags & RTF_CACHE))
+		goto unlock;
+
 	bucket = rcu_dereference(from->rt6i_exception_bucket);
 
 #ifdef CONFIG_IPV6_SUBTREES
@@ -1637,6 +1637,7 @@ static void rt6_update_exception_stamp_rt(struct rt6_info *rt)
 	if (rt6_ex)
 		rt6_ex->stamp = jiffies;
 
+unlock:
 	rcu_read_unlock();
 }
 
-- 
2.20.1


^ permalink raw reply related

* Re: mlx5 stable backport help
From: Or Gerlitz @ 2019-02-21 10:21 UTC (permalink / raw)
  To: Saeed Mahameed; +Cc: davem@davemloft.net, netdev@vger.kernel.org, Or Gerlitz
In-Reply-To: <33b67a2b9a67bc9fe307edc0a3eeeab875598a09.camel@mellanox.com>

On Wed, Feb 20, 2019 at 10:03 PM Saeed Mahameed <saeedm@mellanox.com> wrote:
> On Tue, 2019-02-19 at 22:36 -0800, David Miller wrote:

>> I need help backporting two changes for -stable.  Namely:
> Hi Dave Thanks for trying,

here too

> > 6707f74be8621ae067d2cf1c4485900e2742c20f ("net/mlx5e: Update hw flows
> > when encap source mac changed")
>
> The fixes tag of the above commit is wrong and it should have been
>
> commit e32ee6c78efa6a32bff782bbe7a9970b018996ca
> Author: Eli Britstein <elibr@mellanox.com>
> Date:   Mon Dec 3 17:09:54 2018 +0200
>
>     net/mlx5e: Support tunnel encap over tagged Ethernet
>
> Before this patch we didn't have the support for "tunnel encap over
> tagged Ethernet" which introduced the whole route_dev logic to generate
> the encap headers, so the patch should only exist in -rc, let's just skip it.

Hi Saeed,

The issue exists prior to the commit you mentioned, we are doing this
code since day one of
tc tunnel offloads support which lacked the neigh update flow

linux-stable.git]# git grep -pe "eth->h_source"
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c=static void
gen_vxlan_header_ipv4(struct net_device *out_dev,
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c:
ether_addr_copy(eth->h_source, out_dev->dev_addr);
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c=static void
gen_vxlan_header_ipv6(struct net_device *out_dev,
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c:
ether_addr_copy(eth->h_source, out_dev->dev_addr);

later when 232c001398ae ("net/mlx5e: Add support to neighbour update
flow") was done, we went short
and did not address the case of source address change. Until the
commit you mentioned, we didn't have the
out_dev vs route_dev notion, but the problem exists and it's possible
to backport the patch by

[1] using  e->out_dev instead of e->route_dev
[2] use the hunks from mlx5e_tc_tun_create_header_ipv4/6() in
mlx5e_create_encap_header_ipv4/6()

Or.

^ permalink raw reply

* Re: [PATCH net-next 1/7] net: phy: marvell10g: Use get_features to get the PHY abilities
From: Russell King - ARM Linux admin @ 2019-02-21 10:22 UTC (permalink / raw)
  To: Maxime Chevallier
  Cc: davem, netdev, linux-kernel, Andrew Lunn, Florian Fainelli,
	Heiner Kallweit, linux-arm-kernel, Antoine Tenart,
	thomas.petazzoni, gregory.clement, miquel.raynal, nadavh, stefanc,
	mw
In-Reply-To: <20190221095128.28188-2-maxime.chevallier@bootlin.com>

On Thu, Feb 21, 2019 at 10:51:22AM +0100, Maxime Chevallier wrote:
> The Alaska family of 10G PHYs has more abilities than the ones listed in
> PHY_10GBIT_FULL_FEATURES, the exact list depending on the model.
> 
> Make use of the newly introduced .get_features call to build this list,
> using genphy_c45_pma_read_abilities to build the list of supported
> linkmodes, and adding autoneg ability based on what's reported by the AN
> MMD.
> 
> .config_init is still used to validate the interface_mode.
> 
> Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
> ---
>  drivers/net/phy/marvell10g.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c
> index 9ea27acf05ad..65ef469adf58 100644
> --- a/drivers/net/phy/marvell10g.c
> +++ b/drivers/net/phy/marvell10g.c
> @@ -233,8 +233,6 @@ static int mv3310_resume(struct phy_device *phydev)
>  
>  static int mv3310_config_init(struct phy_device *phydev)
>  {
> -	int ret, val;
> -
>  	/* Check that the PHY interface type is compatible */
>  	if (phydev->interface != PHY_INTERFACE_MODE_SGMII &&
>  	    phydev->interface != PHY_INTERFACE_MODE_XAUI &&
> @@ -242,6 +240,12 @@ static int mv3310_config_init(struct phy_device *phydev)
>  	    phydev->interface != PHY_INTERFACE_MODE_10GKR)
>  		return -ENODEV;
>  
> +	return 0;
> +}
> +
> +static int mv3310_get_features(struct phy_device *phydev)
> +{
> +	int ret, val;

Please try to keep the formatting/style consistent in the file you are
editing.  A blank line here would do that.  Thanks.

>  	if (phydev->c45_ids.devices_in_package & MDIO_DEVS_AN) {
>  		val = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_STAT1);
>  		if (val < 0)
> @@ -429,7 +433,7 @@ static struct phy_driver mv3310_drivers[] = {
>  		.phy_id		= 0x002b09aa,
>  		.phy_id_mask	= MARVELL_PHY_ID_MASK,
>  		.name		= "mv88x3310",
> -		.features	= PHY_10GBIT_FEATURES,
> +		.get_features	= mv3310_get_features,
>  		.soft_reset	= gen10g_no_soft_reset,
>  		.config_init	= mv3310_config_init,
>  		.probe		= mv3310_probe,
> -- 
> 2.19.2
> 
> 

-- 
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

* [PATCH net-next v4 0/2] net: phy: at803x: Update delays for RGMII modes
From: Vinod Koul @ 2019-02-21 10:23 UTC (permalink / raw)
  To: David S Miller
  Cc: linux-arm-msm, Bjorn Andersson, Vinod Koul, netdev, Niklas Cassel,
	Andrew Lunn, Florian Fainelli, Nori, Sekhar, Peter Ujfalusi,
	Marc Gonzalez

Peter[1] reported that patch cd28d1d6e52e: ("net: phy: at803x: Disable
phy delay for RGMII mode") caused regression on am335x-evmsk board.
This board expects the Phy delay to be enabled but specified RGMII mode
which refers to delays being disabled. So fix this by disabling delay only
for RGMII mode and enable for RGMII_ID and RGMII_TXID/RXID modes.

While at it, as pointed by Dave, don't inline the helpers.

[1]: https://www.spinics.net/lists/netdev/msg550749.html

Changes in v4:
 - fix log & comments nbased on Marc's feedback

Vinod Koul (2):
  net: phy: at803x: don't inline helpers
  net: phy: at803x: disable delay only for RGMII mode

 drivers/net/phy/at803x.c | 57 +++++++++++++++++++++++++++++++---------
 1 file changed, 44 insertions(+), 13 deletions(-)

-- 
2.20.1


^ 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