Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next v4 06/12] mscc: ocelot: Implement ndo_get_port_parent_id()
From: Florian Fainelli @ 2019-02-06 17:45 UTC (permalink / raw)
  To: netdev
  Cc: Florian Fainelli, David S. Miller, Ido Schimmel, open list,
	open list:MELLANOX MLX5 core VPI driver,
	open list:NETRONOME ETHERNET DRIVERS, open list:STAGING SUBSYSTEM,
	moderated list:ETHERNET BRIDGE
In-Reply-To: <20190206174546.23597-1-f.fainelli@gmail.com>

Ocelot only supports SWITCHDEV_ATTR_ID_PORT_PARENT_ID as a valid
switchdev attribute getter, convert it to use ndo_get_port_parent_id()
and get rid of the switchdev_ops::switchdev_port_attr_get altogether.

Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/net/ethernet/mscc/ocelot.c | 33 ++++++++++++------------------
 1 file changed, 13 insertions(+), 20 deletions(-)

diff --git a/drivers/net/ethernet/mscc/ocelot.c b/drivers/net/ethernet/mscc/ocelot.c
index c6a575eb0ff5..195306d05bcd 100644
--- a/drivers/net/ethernet/mscc/ocelot.c
+++ b/drivers/net/ethernet/mscc/ocelot.c
@@ -916,6 +916,18 @@ static int ocelot_set_features(struct net_device *dev,
 	return 0;
 }
 
+static int ocelot_get_port_parent_id(struct net_device *dev,
+				     struct netdev_phys_item_id *ppid)
+{
+	struct ocelot_port *ocelot_port = netdev_priv(dev);
+	struct ocelot *ocelot = ocelot_port->ocelot;
+
+	ppid->id_len = sizeof(ocelot->base_mac);
+	memcpy(&ppid->id, &ocelot->base_mac, ppid->id_len);
+
+	return 0;
+}
+
 static const struct net_device_ops ocelot_port_netdev_ops = {
 	.ndo_open			= ocelot_port_open,
 	.ndo_stop			= ocelot_port_stop,
@@ -930,6 +942,7 @@ static const struct net_device_ops ocelot_port_netdev_ops = {
 	.ndo_vlan_rx_add_vid		= ocelot_vlan_rx_add_vid,
 	.ndo_vlan_rx_kill_vid		= ocelot_vlan_rx_kill_vid,
 	.ndo_set_features		= ocelot_set_features,
+	.ndo_get_port_parent_id		= ocelot_get_port_parent_id,
 };
 
 static void ocelot_get_strings(struct net_device *netdev, u32 sset, u8 *data)
@@ -1013,25 +1026,6 @@ static const struct ethtool_ops ocelot_ethtool_ops = {
 	.set_link_ksettings	= phy_ethtool_set_link_ksettings,
 };
 
-static int ocelot_port_attr_get(struct net_device *dev,
-				struct switchdev_attr *attr)
-{
-	struct ocelot_port *ocelot_port = netdev_priv(dev);
-	struct ocelot *ocelot = ocelot_port->ocelot;
-
-	switch (attr->id) {
-	case SWITCHDEV_ATTR_ID_PORT_PARENT_ID:
-		attr->u.ppid.id_len = sizeof(ocelot->base_mac);
-		memcpy(&attr->u.ppid.id, &ocelot->base_mac,
-		       attr->u.ppid.id_len);
-		break;
-	default:
-		return -EOPNOTSUPP;
-	}
-
-	return 0;
-}
-
 static int ocelot_port_attr_stp_state_set(struct ocelot_port *ocelot_port,
 					  struct switchdev_trans *trans,
 					  u8 state)
@@ -1331,7 +1325,6 @@ static int ocelot_port_obj_del(struct net_device *dev,
 }
 
 static const struct switchdev_ops ocelot_port_switchdev_ops = {
-	.switchdev_port_attr_get	= ocelot_port_attr_get,
 	.switchdev_port_attr_set	= ocelot_port_attr_set,
 };
 
-- 
2.17.1


^ permalink raw reply related

* [PATCH net-next v4 04/12] net/mlx5e: Implement ndo_get_port_parent_id()
From: Florian Fainelli @ 2019-02-06 17:45 UTC (permalink / raw)
  To: netdev
  Cc: Florian Fainelli, David S. Miller, Ido Schimmel, open list,
	open list:MELLANOX MLX5 core VPI driver,
	open list:NETRONOME ETHERNET DRIVERS, open list:STAGING SUBSYSTEM,
	moderated list:ETHERNET BRIDGE
In-Reply-To: <20190206174546.23597-1-f.fainelli@gmail.com>

mlx5e only supports SWITCHDEV_ATTR_ID_PORT_PARENT_ID, which makes it a
great candidate to be converted to use the ndo_get_port_parent_id() NDO
instead of implementing switchdev_port_attr_get().

Since mlx5e makes use of switchdev_port_parent_id() convert it to use
netdev_port_same_parent_id().

Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 .../ethernet/mellanox/mlx5/core/en/tc_tun.c   |  2 +-
 .../net/ethernet/mellanox/mlx5/core/en_rep.c  | 31 +++++++------------
 .../net/ethernet/mellanox/mlx5/core/en_tc.c   |  5 ++-
 3 files changed, 14 insertions(+), 24 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c
index 046948ead152..19dc4a963b90 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c
@@ -25,7 +25,7 @@ static int get_route_and_out_devs(struct mlx5e_priv *priv,
 	/* if the egress device isn't on the same HW e-switch or
 	 * it's a LAG device, use the uplink
 	 */
-	if (!switchdev_port_same_parent_id(priv->netdev, dev) ||
+	if (!netdev_port_same_parent_id(priv->netdev, dev) ||
 	    dst_is_lag_dev) {
 		*route_dev = uplink_dev;
 		*out_dev = *route_dev;
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
index 5d2e0c2f6624..0b1988b330f3 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
@@ -381,7 +381,8 @@ static const struct ethtool_ops mlx5e_uplink_rep_ethtool_ops = {
 	.set_pauseparam    = mlx5e_uplink_rep_set_pauseparam,
 };
 
-static int mlx5e_attr_get(struct net_device *dev, struct switchdev_attr *attr)
+static int mlx5e_rep_get_port_parent_id(struct net_device *dev,
+					struct netdev_phys_item_id *ppid)
 {
 	struct mlx5e_priv *priv = netdev_priv(dev);
 	struct mlx5_eswitch *esw = priv->mdev->priv.eswitch;
@@ -398,20 +399,14 @@ static int mlx5e_attr_get(struct net_device *dev, struct switchdev_attr *attr)
 		uplink_priv = netdev_priv(uplink_dev);
 	}
 
-	switch (attr->id) {
-	case SWITCHDEV_ATTR_ID_PORT_PARENT_ID:
-		attr->u.ppid.id_len = ETH_ALEN;
-		if (uplink_upper && mlx5_lag_is_sriov(uplink_priv->mdev)) {
-			ether_addr_copy(attr->u.ppid.id, uplink_upper->dev_addr);
-		} else {
-			struct mlx5e_rep_priv *rpriv = priv->ppriv;
-			struct mlx5_eswitch_rep *rep = rpriv->rep;
+	ppid->id_len = ETH_ALEN;
+	if (uplink_upper && mlx5_lag_is_sriov(uplink_priv->mdev)) {
+		ether_addr_copy(ppid->id, uplink_upper->dev_addr);
+	} else {
+		struct mlx5e_rep_priv *rpriv = priv->ppriv;
+		struct mlx5_eswitch_rep *rep = rpriv->rep;
 
-			ether_addr_copy(attr->u.ppid.id, rep->hw_id);
-		}
-		break;
-	default:
-		return -EOPNOTSUPP;
+		ether_addr_copy(ppid->id, rep->hw_id);
 	}
 
 	return 0;
@@ -1284,10 +1279,6 @@ static int mlx5e_uplink_rep_set_vf_vlan(struct net_device *dev, int vf, u16 vlan
 	return 0;
 }
 
-static const struct switchdev_ops mlx5e_rep_switchdev_ops = {
-	.switchdev_port_attr_get	= mlx5e_attr_get,
-};
-
 static const struct net_device_ops mlx5e_netdev_ops_vf_rep = {
 	.ndo_open                = mlx5e_vf_rep_open,
 	.ndo_stop                = mlx5e_vf_rep_close,
@@ -1298,6 +1289,7 @@ static const struct net_device_ops mlx5e_netdev_ops_vf_rep = {
 	.ndo_has_offload_stats	 = mlx5e_rep_has_offload_stats,
 	.ndo_get_offload_stats	 = mlx5e_rep_get_offload_stats,
 	.ndo_change_mtu          = mlx5e_vf_rep_change_mtu,
+	.ndo_get_port_parent_id	 = mlx5e_rep_get_port_parent_id,
 };
 
 static const struct net_device_ops mlx5e_netdev_ops_uplink_rep = {
@@ -1319,6 +1311,7 @@ static const struct net_device_ops mlx5e_netdev_ops_uplink_rep = {
 	.ndo_get_vf_config       = mlx5e_get_vf_config,
 	.ndo_get_vf_stats        = mlx5e_get_vf_stats,
 	.ndo_set_vf_vlan         = mlx5e_uplink_rep_set_vf_vlan,
+	.ndo_get_port_parent_id	 = mlx5e_rep_get_port_parent_id,
 };
 
 bool mlx5e_eswitch_rep(struct net_device *netdev)
@@ -1393,8 +1386,6 @@ static void mlx5e_build_rep_netdev(struct net_device *netdev)
 	netdev->watchdog_timeo    = 15 * HZ;
 
 
-	netdev->switchdev_ops = &mlx5e_rep_switchdev_ops;
-
 	netdev->features	 |= NETIF_F_HW_TC | NETIF_F_NETNS_LOCAL;
 	netdev->hw_features      |= NETIF_F_HW_TC;
 
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
index 74159d39dd66..098b28feba0c 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
@@ -38,7 +38,6 @@
 #include <linux/mlx5/fs.h>
 #include <linux/mlx5/device.h>
 #include <linux/rhashtable.h>
-#include <net/switchdev.h>
 #include <net/tc_act/tc_mirred.h>
 #include <net/tc_act/tc_vlan.h>
 #include <net/tc_act/tc_tunnel_key.h>
@@ -2569,8 +2568,8 @@ static int parse_tc_fdb_actions(struct mlx5e_priv *priv, struct tcf_exts *exts,
 
 			action |= MLX5_FLOW_CONTEXT_ACTION_FWD_DEST |
 				  MLX5_FLOW_CONTEXT_ACTION_COUNT;
-			if (switchdev_port_same_parent_id(priv->netdev,
-							  out_dev) ||
+			if (netdev_port_same_parent_id(priv->netdev,
+						       out_dev) ||
 			    is_merged_eswitch_dev(priv, out_dev)) {
 				struct mlx5_eswitch *esw = priv->mdev->priv.eswitch;
 				struct net_device *uplink_dev = mlx5_eswitch_uplink_get_proto_dev(esw, REP_ETH);
-- 
2.17.1


^ permalink raw reply related

* [PATCH net-next v4 08/12] rocker: Implement ndo_get_port_parent_id()
From: Florian Fainelli @ 2019-02-06 17:45 UTC (permalink / raw)
  To: netdev
  Cc: Florian Fainelli, David S. Miller, Ido Schimmel, open list,
	open list:MELLANOX MLX5 core VPI driver,
	open list:NETRONOME ETHERNET DRIVERS, open list:STAGING SUBSYSTEM,
	moderated list:ETHERNET BRIDGE
In-Reply-To: <20190206174546.23597-1-f.fainelli@gmail.com>

mlxsw implements SWITCHDEV_ATTR_ID_PORT_PARENT_ID and we want to get rid
of switchdev_ops eventually, ease that migration by implementing a
ndo_get_port_parent_id() function which returns what
switchdev_port_attr_get() would do.

Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/net/ethernet/rocker/rocker_main.c | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/rocker/rocker_main.c b/drivers/net/ethernet/rocker/rocker_main.c
index 62a205eba9f7..596f44dbfae1 100644
--- a/drivers/net/ethernet/rocker/rocker_main.c
+++ b/drivers/net/ethernet/rocker/rocker_main.c
@@ -2026,6 +2026,18 @@ static void rocker_port_neigh_destroy(struct net_device *dev,
 			    err);
 }
 
+static int rocker_port_get_port_parent_id(struct net_device *dev,
+					  struct netdev_phys_item_id *ppid)
+{
+	const struct rocker_port *rocker_port = netdev_priv(dev);
+	const struct rocker *rocker = rocker_port->rocker;
+
+	ppid->id_len = sizeof(rocker->hw.id);
+	memcpy(&ppid->id, &rocker->hw.id, ppid->id_len);
+
+	return 0;
+}
+
 static const struct net_device_ops rocker_port_netdev_ops = {
 	.ndo_open			= rocker_port_open,
 	.ndo_stop			= rocker_port_stop,
@@ -2035,6 +2047,7 @@ static const struct net_device_ops rocker_port_netdev_ops = {
 	.ndo_get_phys_port_name		= rocker_port_get_phys_port_name,
 	.ndo_change_proto_down		= rocker_port_change_proto_down,
 	.ndo_neigh_destroy		= rocker_port_neigh_destroy,
+	.ndo_get_port_parent_id		= rocker_port_get_port_parent_id,
 };
 
 /********************
@@ -2049,10 +2062,6 @@ static int rocker_port_attr_get(struct net_device *dev,
 	int err = 0;
 
 	switch (attr->id) {
-	case SWITCHDEV_ATTR_ID_PORT_PARENT_ID:
-		attr->u.ppid.id_len = sizeof(rocker->hw.id);
-		memcpy(&attr->u.ppid.id, &rocker->hw.id, attr->u.ppid.id_len);
-		break;
 	case SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS:
 		err = rocker_world_port_attr_bridge_flags_get(rocker_port,
 							      &attr->u.brport_flags);
-- 
2.17.1


^ permalink raw reply related

* [PATCH net-next v4 10/12] staging: fsl-dpaa2: ethsw: Implement ndo_get_port_parent_id()
From: Florian Fainelli @ 2019-02-06 17:45 UTC (permalink / raw)
  To: netdev
  Cc: Florian Fainelli, David S. Miller, Ido Schimmel, open list,
	open list:MELLANOX MLX5 core VPI driver,
	open list:NETRONOME ETHERNET DRIVERS, open list:STAGING SUBSYSTEM,
	moderated list:ETHERNET BRIDGE
In-Reply-To: <20190206174546.23597-1-f.fainelli@gmail.com>

ethsw implements SWITCHDEV_ATTR_ID_PORT_PARENT_ID and we want to get rid
of switchdev_ops eventually, ease that migration by implementing a
ndo_get_port_parent_id() function which returns what
switchdev_port_attr_get() would do.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/staging/fsl-dpaa2/ethsw/ethsw.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/fsl-dpaa2/ethsw/ethsw.c b/drivers/staging/fsl-dpaa2/ethsw/ethsw.c
index daabaceeea52..e559f4c25cf7 100644
--- a/drivers/staging/fsl-dpaa2/ethsw/ethsw.c
+++ b/drivers/staging/fsl-dpaa2/ethsw/ethsw.c
@@ -505,6 +505,17 @@ static netdev_tx_t port_dropframe(struct sk_buff *skb,
 	return NETDEV_TX_OK;
 }
 
+static int swdev_get_port_parent_id(struct net_device *dev,
+				    struct netdev_phys_item_id *ppid)
+{
+	struct ethsw_port_priv *port_priv = netdev_priv(dev);
+
+	ppid->id_len = 1;
+	ppid->id[0] = port_priv->ethsw_data->dev_id;
+
+	return 0;
+}
+
 static const struct net_device_ops ethsw_port_ops = {
 	.ndo_open		= port_open,
 	.ndo_stop		= port_stop,
@@ -515,6 +526,7 @@ static const struct net_device_ops ethsw_port_ops = {
 	.ndo_get_offload_stats	= port_get_offload_stats,
 
 	.ndo_start_xmit		= port_dropframe,
+	.ndo_get_port_parent_id	= swdev_get_port_parent_id,
 };
 
 static void ethsw_links_state_update(struct ethsw_core *ethsw)
@@ -634,10 +646,6 @@ static int swdev_port_attr_get(struct net_device *netdev,
 	struct ethsw_port_priv *port_priv = netdev_priv(netdev);
 
 	switch (attr->id) {
-	case SWITCHDEV_ATTR_ID_PORT_PARENT_ID:
-		attr->u.ppid.id_len = 1;
-		attr->u.ppid.id[0] = port_priv->ethsw_data->dev_id;
-		break;
 	case SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS:
 		attr->u.brport_flags =
 			(port_priv->ethsw_data->learning ? BR_LEARNING : 0) |
-- 
2.17.1


^ permalink raw reply related

* [PATCH net-next v4 09/12] netdevsim: Implement ndo_get_port_parent_id()
From: Florian Fainelli @ 2019-02-06 17:45 UTC (permalink / raw)
  To: netdev
  Cc: Florian Fainelli, David S. Miller, Ido Schimmel, open list,
	open list:MELLANOX MLX5 core VPI driver,
	open list:NETRONOME ETHERNET DRIVERS, open list:STAGING SUBSYSTEM,
	moderated list:ETHERNET BRIDGE
In-Reply-To: <20190206174546.23597-1-f.fainelli@gmail.com>

netdevsim only supports SWITCHDEV_ATTR_ID_PORT_PARENT_ID, which makes it a
great candidate to be converted to use the ndo_get_port_parent_id() NDO
instead of implementing switchdev_port_attr_get().

Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/net/netdevsim/netdev.c | 23 ++++++-----------------
 1 file changed, 6 insertions(+), 17 deletions(-)

diff --git a/drivers/net/netdevsim/netdev.c b/drivers/net/netdevsim/netdev.c
index 8d8e2b3f263e..75a50b59cb8f 100644
--- a/drivers/net/netdevsim/netdev.c
+++ b/drivers/net/netdevsim/netdev.c
@@ -22,7 +22,6 @@
 #include <net/netlink.h>
 #include <net/pkt_cls.h>
 #include <net/rtnetlink.h>
-#include <net/switchdev.h>
 
 #include "netdevsim.h"
 
@@ -148,26 +147,16 @@ static struct device_type nsim_dev_type = {
 	.release = nsim_dev_release,
 };
 
-static int
-nsim_port_attr_get(struct net_device *dev, struct switchdev_attr *attr)
+static int nsim_get_port_parent_id(struct net_device *dev,
+				   struct netdev_phys_item_id *ppid)
 {
 	struct netdevsim *ns = netdev_priv(dev);
 
-	switch (attr->id) {
-	case SWITCHDEV_ATTR_ID_PORT_PARENT_ID:
-		attr->u.ppid.id_len = sizeof(ns->sdev->switch_id);
-		memcpy(&attr->u.ppid.id, &ns->sdev->switch_id,
-		       attr->u.ppid.id_len);
-		return 0;
-	default:
-		return -EOPNOTSUPP;
-	}
+	ppid->id_len = sizeof(ns->sdev->switch_id);
+	memcpy(&ppid->id, &ns->sdev->switch_id, ppid->id_len);
+	return 0;
 }
 
-static const struct switchdev_ops nsim_switchdev_ops = {
-	.switchdev_port_attr_get	= nsim_port_attr_get,
-};
-
 static int nsim_init(struct net_device *dev)
 {
 	char sdev_ddir_name[10], sdev_link_name[32];
@@ -214,7 +203,6 @@ static int nsim_init(struct net_device *dev)
 		goto err_bpf_uninit;
 
 	SET_NETDEV_DEV(dev, &ns->dev);
-	SWITCHDEV_SET_OPS(dev, &nsim_switchdev_ops);
 
 	err = nsim_devlink_setup(ns);
 	if (err)
@@ -493,6 +481,7 @@ static const struct net_device_ops nsim_netdev_ops = {
 	.ndo_setup_tc		= nsim_setup_tc,
 	.ndo_set_features	= nsim_set_features,
 	.ndo_bpf		= nsim_bpf,
+	.ndo_get_port_parent_id	= nsim_get_port_parent_id,
 };
 
 static void nsim_setup(struct net_device *dev)
-- 
2.17.1


^ permalink raw reply related

* [PATCH] Using rates in bits when limits are specified in %
From: Marcos Antonio Moraes @ 2019-02-06 17:14 UTC (permalink / raw)
  To: netdev; +Cc: Marcos Antonio Moraes

As /sys/class/net/<iface>/speed indicates a value in Mbits/sec, the
transformation is necessary to create the correct limitations.
---
 tc/tc_util.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tc/tc_util.c b/tc/tc_util.c
index ab717890..b82142ab 100644
--- a/tc/tc_util.c
+++ b/tc/tc_util.c
@@ -194,7 +194,7 @@ static int parse_percent_rate(char *rate, const char *str, const char *dev)
 {
 	long dev_mbit;
 	int ret;
-	double perc, rate_mbit;
+	double perc, rate_bit;
 	char *str_perc;
 
 	if (!dev[0]) {
@@ -219,9 +219,9 @@ static int parse_percent_rate(char *rate, const char *str, const char *dev)
 		return -1;
 	}
 
-	rate_mbit = perc * dev_mbit;
+	rate_bit = perc * dev_mbit * 1000 * 1000;
 
-	ret = snprintf(rate, 20, "%lf", rate_mbit);
+	ret = snprintf(rate, 20, "%lf", rate_bit);
 	if (ret <= 0 || ret >= 20) {
 		fprintf(stderr, "Unable to parse calculated rate\n");
 		return -1;
-- 
2.17.1


^ permalink raw reply related

* [PATCH net-next v4 12/12] net: Get rid of SWITCHDEV_ATTR_ID_PORT_PARENT_ID
From: Florian Fainelli @ 2019-02-06 17:45 UTC (permalink / raw)
  To: netdev
  Cc: Florian Fainelli, David S. Miller, Ido Schimmel, open list,
	open list:MELLANOX MLX5 core VPI driver,
	open list:NETRONOME ETHERNET DRIVERS, open list:STAGING SUBSYSTEM,
	moderated list:ETHERNET BRIDGE
In-Reply-To: <20190206174546.23597-1-f.fainelli@gmail.com>

Now that we have a dedicated NDO for getting a port's parent ID, get rid
of SWITCHDEV_ATTR_ID_PORT_PARENT_ID and convert all callers to use the
NDO exclusively. This is a preliminary change to getting rid of
switchdev_ops eventually.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 include/net/switchdev.h   | 11 -----------
 net/bridge/br_switchdev.c | 14 +++-----------
 net/core/net-sysfs.c      | 19 ++++---------------
 net/core/rtnetlink.c      | 16 +++-------------
 net/ipv4/ipmr.c           | 19 +++++--------------
 net/switchdev/switchdev.c | 20 --------------------
 6 files changed, 15 insertions(+), 84 deletions(-)

diff --git a/include/net/switchdev.h b/include/net/switchdev.h
index 63843ae5dc81..5e87b54c5dc5 100644
--- a/include/net/switchdev.h
+++ b/include/net/switchdev.h
@@ -43,7 +43,6 @@ static inline bool switchdev_trans_ph_commit(struct switchdev_trans *trans)
 
 enum switchdev_attr_id {
 	SWITCHDEV_ATTR_ID_UNDEFINED,
-	SWITCHDEV_ATTR_ID_PORT_PARENT_ID,
 	SWITCHDEV_ATTR_ID_PORT_STP_STATE,
 	SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS,
 	SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS_SUPPORT,
@@ -61,7 +60,6 @@ struct switchdev_attr {
 	void *complete_priv;
 	void (*complete)(struct net_device *dev, int err, void *priv);
 	union {
-		struct netdev_phys_item_id ppid;	/* PORT_PARENT_ID */
 		u8 stp_state;				/* PORT_STP_STATE */
 		unsigned long brport_flags;		/* PORT_BRIDGE_FLAGS */
 		unsigned long brport_flags_support;	/* PORT_BRIDGE_FLAGS_SUPPORT */
@@ -208,9 +206,6 @@ void switchdev_port_fwd_mark_set(struct net_device *dev,
 				 struct net_device *group_dev,
 				 bool joining);
 
-bool switchdev_port_same_parent_id(struct net_device *a,
-				   struct net_device *b);
-
 int switchdev_handle_port_obj_add(struct net_device *dev,
 			struct switchdev_notifier_port_obj_info *port_obj_info,
 			bool (*check_cb)(const struct net_device *dev),
@@ -295,12 +290,6 @@ call_switchdev_blocking_notifiers(unsigned long val,
 	return NOTIFY_DONE;
 }
 
-static inline bool switchdev_port_same_parent_id(struct net_device *a,
-						 struct net_device *b)
-{
-	return false;
-}
-
 static inline int
 switchdev_handle_port_obj_add(struct net_device *dev,
 			struct switchdev_notifier_port_obj_info *port_obj_info,
diff --git a/net/bridge/br_switchdev.c b/net/bridge/br_switchdev.c
index 06b0ae44585f..db9e8ab96d48 100644
--- a/net/bridge/br_switchdev.c
+++ b/net/bridge/br_switchdev.c
@@ -14,8 +14,7 @@ static int br_switchdev_mark_get(struct net_bridge *br, struct net_device *dev)
 
 	/* dev is yet to be added to the port list. */
 	list_for_each_entry(p, &br->port_list, list) {
-		if (netdev_port_same_parent_id(dev, p->dev) ||
-		    switchdev_port_same_parent_id(dev, p->dev))
+		if (netdev_port_same_parent_id(dev, p->dev))
 			return p->offload_fwd_mark;
 	}
 
@@ -24,19 +23,12 @@ static int br_switchdev_mark_get(struct net_bridge *br, struct net_device *dev)
 
 int nbp_switchdev_mark_set(struct net_bridge_port *p)
 {
-	const struct net_device_ops *ops = p->dev->netdev_ops;
-	struct switchdev_attr attr = {
-		.orig_dev = p->dev,
-		.id = SWITCHDEV_ATTR_ID_PORT_PARENT_ID,
-	};
+	struct netdev_phys_item_id ppid = { };
 	int err;
 
 	ASSERT_RTNL();
 
-	if (ops->ndo_get_port_parent_id)
-		err = dev_get_port_parent_id(p->dev, &attr.u.ppid, true);
-	else
-		err = switchdev_port_attr_get(p->dev, &attr);
+	err = dev_get_port_parent_id(p->dev, &ppid, true);
 	if (err) {
 		if (err == -EOPNOTSUPP)
 			return 0;
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
index 4eace9f1dcf9..7c5061123ead 100644
--- a/net/core/net-sysfs.c
+++ b/net/core/net-sysfs.c
@@ -12,7 +12,6 @@
 #include <linux/capability.h>
 #include <linux/kernel.h>
 #include <linux/netdevice.h>
-#include <net/switchdev.h>
 #include <linux/if_arp.h>
 #include <linux/slab.h>
 #include <linux/sched/signal.h>
@@ -495,27 +494,17 @@ static ssize_t phys_switch_id_show(struct device *dev,
 				   struct device_attribute *attr, char *buf)
 {
 	struct net_device *netdev = to_net_dev(dev);
-	const struct net_device_ops *ops = netdev->netdev_ops;
 	ssize_t ret = -EINVAL;
 
 	if (!rtnl_trylock())
 		return restart_syscall();
 
 	if (dev_isalive(netdev)) {
-		struct switchdev_attr attr = {
-			.orig_dev = netdev,
-			.id = SWITCHDEV_ATTR_ID_PORT_PARENT_ID,
-			.flags = SWITCHDEV_F_NO_RECURSE,
-		};
-
-		if (ops->ndo_get_port_parent_id)
-			ret = dev_get_port_parent_id(netdev, &attr.u.ppid,
-						     false);
-		else
-			ret = switchdev_port_attr_get(netdev, &attr);
+		struct netdev_phys_item_id ppid = { };
+
+		ret = dev_get_port_parent_id(netdev, &ppid, false);
 		if (!ret)
-			ret = sprintf(buf, "%*phN\n", attr.u.ppid.id_len,
-				      attr.u.ppid.id);
+			ret = sprintf(buf, "%*phN\n", ppid.id_len, ppid.id);
 	}
 	rtnl_unlock();
 
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 90dd02c1f561..a51cab95ba64 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -46,7 +46,6 @@
 
 #include <linux/inet.h>
 #include <linux/netdevice.h>
-#include <net/switchdev.h>
 #include <net/ip.h>
 #include <net/protocol.h>
 #include <net/arp.h>
@@ -1146,26 +1145,17 @@ static int rtnl_phys_port_name_fill(struct sk_buff *skb, struct net_device *dev)
 
 static int rtnl_phys_switch_id_fill(struct sk_buff *skb, struct net_device *dev)
 {
-	const struct net_device_ops *ops = dev->netdev_ops;
+	struct netdev_phys_item_id ppid = { };
 	int err;
-	struct switchdev_attr attr = {
-		.orig_dev = dev,
-		.id = SWITCHDEV_ATTR_ID_PORT_PARENT_ID,
-		.flags = SWITCHDEV_F_NO_RECURSE,
-	};
 
-	if (ops->ndo_get_port_parent_id)
-		err = dev_get_port_parent_id(dev, &attr.u.ppid, false);
-	else
-		err = switchdev_port_attr_get(dev, &attr);
+	err = dev_get_port_parent_id(dev, &ppid, false);
 	if (err) {
 		if (err == -EOPNOTSUPP)
 			return 0;
 		return err;
 	}
 
-	if (nla_put(skb, IFLA_PHYS_SWITCH_ID, attr.u.ppid.id_len,
-		    attr.u.ppid.id))
+	if (nla_put(skb, IFLA_PHYS_SWITCH_ID, ppid.id_len, ppid.id))
 		return -EMSGSIZE;
 
 	return 0;
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
index c71bcc42d66d..e536970557dd 100644
--- a/net/ipv4/ipmr.c
+++ b/net/ipv4/ipmr.c
@@ -67,7 +67,6 @@
 #include <net/fib_rules.h>
 #include <linux/netconf.h>
 #include <net/nexthop.h>
-#include <net/switchdev.h>
 
 #include <linux/nospec.h>
 
@@ -837,11 +836,8 @@ static void ipmr_update_thresholds(struct mr_table *mrt, struct mr_mfc *cache,
 static int vif_add(struct net *net, struct mr_table *mrt,
 		   struct vifctl *vifc, int mrtsock)
 {
-	const struct net_device_ops *ops;
+	struct netdev_phys_item_id ppid = { };
 	int vifi = vifc->vifc_vifi;
-	struct switchdev_attr attr = {
-		.id = SWITCHDEV_ATTR_ID_PORT_PARENT_ID,
-	};
 	struct vif_device *v = &mrt->vif_table[vifi];
 	struct net_device *dev;
 	struct in_device *in_dev;
@@ -920,15 +916,10 @@ static int vif_add(struct net *net, struct mr_table *mrt,
 			vifc->vifc_flags | (!mrtsock ? VIFF_STATIC : 0),
 			(VIFF_TUNNEL | VIFF_REGISTER));
 
-	attr.orig_dev = dev;
-	ops = dev->netdev_ops;
-	if (ops->ndo_get_port_parent_id &&
-	    !dev_get_port_parent_id(dev, &attr.u.ppid, true)) {
-		memcpy(v->dev_parent_id.id, attr.u.ppid.id, attr.u.ppid.id_len);
-		v->dev_parent_id.id_len = attr.u.ppid.id_len;
-	} else if (!switchdev_port_attr_get(dev, &attr)) {
-		memcpy(v->dev_parent_id.id, attr.u.ppid.id, attr.u.ppid.id_len);
-		v->dev_parent_id.id_len = attr.u.ppid.id_len;
+	err = dev_get_port_parent_id(dev, &ppid, true);
+	if (err == 0) {
+		memcpy(v->dev_parent_id.id, ppid.id, ppid.id_len);
+		v->dev_parent_id.id_len = ppid.id_len;
 	} else {
 		v->dev_parent_id.id_len = 0;
 	}
diff --git a/net/switchdev/switchdev.c b/net/switchdev/switchdev.c
index cd78253de31d..7e1357db33d7 100644
--- a/net/switchdev/switchdev.c
+++ b/net/switchdev/switchdev.c
@@ -592,26 +592,6 @@ int call_switchdev_blocking_notifiers(unsigned long val, struct net_device *dev,
 }
 EXPORT_SYMBOL_GPL(call_switchdev_blocking_notifiers);
 
-bool switchdev_port_same_parent_id(struct net_device *a,
-				   struct net_device *b)
-{
-	struct switchdev_attr a_attr = {
-		.orig_dev = a,
-		.id = SWITCHDEV_ATTR_ID_PORT_PARENT_ID,
-	};
-	struct switchdev_attr b_attr = {
-		.orig_dev = b,
-		.id = SWITCHDEV_ATTR_ID_PORT_PARENT_ID,
-	};
-
-	if (switchdev_port_attr_get(a, &a_attr) ||
-	    switchdev_port_attr_get(b, &b_attr))
-		return false;
-
-	return netdev_phys_item_id_same(&a_attr.u.ppid, &b_attr.u.ppid);
-}
-EXPORT_SYMBOL_GPL(switchdev_port_same_parent_id);
-
 static int __switchdev_handle_port_obj_add(struct net_device *dev,
 			struct switchdev_notifier_port_obj_info *port_obj_info,
 			bool (*check_cb)(const struct net_device *dev),
-- 
2.17.1


^ permalink raw reply related

* [PATCH net-next v4 11/12] net: dsa: Implement ndo_get_port_parent_id()
From: Florian Fainelli @ 2019-02-06 17:45 UTC (permalink / raw)
  To: netdev
  Cc: Florian Fainelli, David S. Miller, Ido Schimmel, open list,
	open list:MELLANOX MLX5 core VPI driver,
	open list:NETRONOME ETHERNET DRIVERS, open list:STAGING SUBSYSTEM,
	moderated list:ETHERNET BRIDGE
In-Reply-To: <20190206174546.23597-1-f.fainelli@gmail.com>

DSA implements SWITCHDEV_ATTR_ID_PORT_PARENT_ID and we want to get rid
of switchdev_ops eventually, ease that migration by implementing a
ndo_get_port_parent_id() function which returns what
switchdev_port_attr_get() would do.

Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 net/dsa/slave.c | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index 91de3a663226..70395a0ae52e 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -362,18 +362,23 @@ static int dsa_slave_port_obj_del(struct net_device *dev,
 	return err;
 }
 
-static int dsa_slave_port_attr_get(struct net_device *dev,
-				   struct switchdev_attr *attr)
+static int dsa_slave_get_port_parent_id(struct net_device *dev,
+					struct netdev_phys_item_id *ppid)
 {
 	struct dsa_port *dp = dsa_slave_to_port(dev);
 	struct dsa_switch *ds = dp->ds;
 	struct dsa_switch_tree *dst = ds->dst;
 
+	ppid->id_len = sizeof(dst->index);
+	memcpy(&ppid->id, &dst->index, ppid->id_len);
+
+	return 0;
+}
+
+static int dsa_slave_port_attr_get(struct net_device *dev,
+				   struct switchdev_attr *attr)
+{
 	switch (attr->id) {
-	case SWITCHDEV_ATTR_ID_PORT_PARENT_ID:
-		attr->u.ppid.id_len = sizeof(dst->index);
-		memcpy(&attr->u.ppid.id, &dst->index, attr->u.ppid.id_len);
-		break;
 	case SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS_SUPPORT:
 		attr->u.brport_flags_support = 0;
 		break;
@@ -1046,6 +1051,7 @@ static const struct net_device_ops dsa_slave_netdev_ops = {
 	.ndo_get_phys_port_name	= dsa_slave_get_phys_port_name,
 	.ndo_setup_tc		= dsa_slave_setup_tc,
 	.ndo_get_stats64	= dsa_slave_get_stats64,
+	.ndo_get_port_parent_id	= dsa_slave_get_port_parent_id,
 };
 
 static const struct switchdev_ops dsa_slave_switchdev_ops = {
-- 
2.17.1


^ permalink raw reply related

* [PATCH net-next v4 07/12] nfp: Implement ndo_get_port_parent_id()
From: Florian Fainelli @ 2019-02-06 17:45 UTC (permalink / raw)
  To: netdev
  Cc: Florian Fainelli, David S. Miller, Ido Schimmel, open list,
	open list:MELLANOX MLX5 core VPI driver,
	open list:NETRONOME ETHERNET DRIVERS, open list:STAGING SUBSYSTEM,
	moderated list:ETHERNET BRIDGE
In-Reply-To: <20190206174546.23597-1-f.fainelli@gmail.com>

NFP only supports SWITCHDEV_ATTR_ID_PORT_PARENT_ID, which makes it a
great candidate to be converted to use the ndo_get_port_parent_id() NDO
instead of implementing switchdev_port_attr_get().

Since NFP uses switchdev_port_same_parent_id() convert it to use
netdev_port_same_parent_id().

Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 .../ethernet/netronome/nfp/flower/action.c    |  3 +--
 .../ethernet/netronome/nfp/nfp_net_common.c   |  4 +---
 .../net/ethernet/netronome/nfp/nfp_net_repr.c |  4 +---
 drivers/net/ethernet/netronome/nfp/nfp_port.c | 22 +++++--------------
 drivers/net/ethernet/netronome/nfp/nfp_port.h |  4 +++-
 5 files changed, 11 insertions(+), 26 deletions(-)

diff --git a/drivers/net/ethernet/netronome/nfp/flower/action.c b/drivers/net/ethernet/netronome/nfp/flower/action.c
index 8d54b36afee8..7b217d7285c7 100644
--- a/drivers/net/ethernet/netronome/nfp/flower/action.c
+++ b/drivers/net/ethernet/netronome/nfp/flower/action.c
@@ -3,7 +3,6 @@
 
 #include <linux/bitfield.h>
 #include <net/pkt_cls.h>
-#include <net/switchdev.h>
 #include <net/tc_act/tc_csum.h>
 #include <net/tc_act/tc_gact.h>
 #include <net/tc_act/tc_mirred.h>
@@ -137,7 +136,7 @@ nfp_fl_output(struct nfp_app *app, struct nfp_fl_output *output,
 
 		if (nfp_netdev_is_nfp_repr(in_dev)) {
 			/* Confirm ingress and egress are on same device. */
-			if (!switchdev_port_same_parent_id(in_dev, out_dev))
+			if (!netdev_port_same_parent_id(in_dev, out_dev))
 				return -EOPNOTSUPP;
 		}
 
diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
index 7d2d4241498f..776f6c07701b 100644
--- a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
+++ b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
@@ -36,7 +36,6 @@
 #include <linux/vmalloc.h>
 #include <linux/ktime.h>
 
-#include <net/switchdev.h>
 #include <net/vxlan.h>
 
 #include "nfpcore/nfp_nsp.h"
@@ -3531,6 +3530,7 @@ const struct net_device_ops nfp_net_netdev_ops = {
 	.ndo_udp_tunnel_add	= nfp_net_add_vxlan_port,
 	.ndo_udp_tunnel_del	= nfp_net_del_vxlan_port,
 	.ndo_bpf		= nfp_net_xdp,
+	.ndo_get_port_parent_id	= nfp_port_get_port_parent_id,
 };
 
 /**
@@ -3815,8 +3815,6 @@ static void nfp_net_netdev_init(struct nfp_net *nn)
 	netdev->netdev_ops = &nfp_net_netdev_ops;
 	netdev->watchdog_timeo = msecs_to_jiffies(5 * 1000);
 
-	SWITCHDEV_SET_OPS(netdev, &nfp_port_switchdev_ops);
-
 	/* MTU range: 68 - hw-specific max */
 	netdev->min_mtu = ETH_MIN_MTU;
 	netdev->max_mtu = nn->max_mtu;
diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_repr.c b/drivers/net/ethernet/netronome/nfp/nfp_net_repr.c
index 69d7aebda09b..62839807e21e 100644
--- a/drivers/net/ethernet/netronome/nfp/nfp_net_repr.c
+++ b/drivers/net/ethernet/netronome/nfp/nfp_net_repr.c
@@ -5,7 +5,6 @@
 #include <linux/io-64-nonatomic-hi-lo.h>
 #include <linux/lockdep.h>
 #include <net/dst_metadata.h>
-#include <net/switchdev.h>
 
 #include "nfpcore/nfp_cpp.h"
 #include "nfpcore/nfp_nsp.h"
@@ -273,6 +272,7 @@ const struct net_device_ops nfp_repr_netdev_ops = {
 	.ndo_fix_features	= nfp_repr_fix_features,
 	.ndo_set_features	= nfp_port_set_features,
 	.ndo_set_mac_address    = eth_mac_addr,
+	.ndo_get_port_parent_id	= nfp_port_get_port_parent_id,
 };
 
 void
@@ -336,8 +336,6 @@ int nfp_repr_init(struct nfp_app *app, struct net_device *netdev,
 
 	netdev->max_mtu = pf_netdev->max_mtu;
 
-	SWITCHDEV_SET_OPS(netdev, &nfp_port_switchdev_ops);
-
 	/* Set features the lower device can support with representors */
 	if (repr_cap & NFP_NET_CFG_CTRL_LIVE_ADDR)
 		netdev->priv_flags |= IFF_LIVE_ADDR_CHANGE;
diff --git a/drivers/net/ethernet/netronome/nfp/nfp_port.c b/drivers/net/ethernet/netronome/nfp/nfp_port.c
index 86bc149ca231..7e90880fa46b 100644
--- a/drivers/net/ethernet/netronome/nfp/nfp_port.c
+++ b/drivers/net/ethernet/netronome/nfp/nfp_port.c
@@ -31,34 +31,22 @@ struct nfp_port *nfp_port_from_netdev(struct net_device *netdev)
 	return NULL;
 }
 
-static int
-nfp_port_attr_get(struct net_device *netdev, struct switchdev_attr *attr)
+int nfp_port_get_port_parent_id(struct net_device *netdev,
+				struct netdev_phys_item_id *ppid)
 {
 	struct nfp_port *port;
+	const u8 *serial;
 
 	port = nfp_port_from_netdev(netdev);
 	if (!port)
 		return -EOPNOTSUPP;
 
-	switch (attr->id) {
-	case SWITCHDEV_ATTR_ID_PORT_PARENT_ID: {
-		const u8 *serial;
-		/* N.B: attr->u.ppid.id is binary data */
-		attr->u.ppid.id_len = nfp_cpp_serial(port->app->cpp, &serial);
-		memcpy(&attr->u.ppid.id, serial, attr->u.ppid.id_len);
-		break;
-	}
-	default:
-		return -EOPNOTSUPP;
-	}
+	ppid->id_len = nfp_cpp_serial(port->app->cpp, &serial);
+	memcpy(&ppid->id, serial, ppid->id_len);
 
 	return 0;
 }
 
-const struct switchdev_ops nfp_port_switchdev_ops = {
-	.switchdev_port_attr_get	= nfp_port_attr_get,
-};
-
 int nfp_port_setup_tc(struct net_device *netdev, enum tc_setup_type type,
 		      void *type_data)
 {
diff --git a/drivers/net/ethernet/netronome/nfp/nfp_port.h b/drivers/net/ethernet/netronome/nfp/nfp_port.h
index b2479a2a49e5..90ae053f5c07 100644
--- a/drivers/net/ethernet/netronome/nfp/nfp_port.h
+++ b/drivers/net/ethernet/netronome/nfp/nfp_port.h
@@ -7,6 +7,7 @@
 #include <net/devlink.h>
 
 struct net_device;
+struct netdev_phys_item_id;
 struct nfp_app;
 struct nfp_pf;
 struct nfp_port;
@@ -90,7 +91,6 @@ struct nfp_port {
 };
 
 extern const struct ethtool_ops nfp_port_ethtool_ops;
-extern const struct switchdev_ops nfp_port_switchdev_ops;
 
 __printf(2, 3) u8 *nfp_pr_et(u8 *data, const char *fmt, ...);
 
@@ -106,6 +106,8 @@ int
 nfp_port_set_features(struct net_device *netdev, netdev_features_t features);
 
 struct nfp_port *nfp_port_from_netdev(struct net_device *netdev);
+int nfp_port_get_port_parent_id(struct net_device *netdev,
+				struct netdev_phys_item_id *ppid);
 struct nfp_port *
 nfp_port_from_id(struct nfp_pf *pf, enum nfp_port_type type, unsigned int id);
 struct nfp_eth_table_port *__nfp_port_get_eth_port(struct nfp_port *port);
-- 
2.17.1


^ permalink raw reply related

* Re: [Patch net-next] mlx5: use RCU lock in mlx5_eq_cq_get()
From: Cong Wang @ 2019-02-06 17:43 UTC (permalink / raw)
  To: Saeed Mahameed; +Cc: netdev@vger.kernel.org, Tariq Toukan
In-Reply-To: <f1a0ff14f4c7c970dda40dd6e59adb994d1989de.camel@mellanox.com>

On Wed, Feb 6, 2019 at 9:35 AM Saeed Mahameed <saeedm@mellanox.com> wrote:
>
> On Wed, 2019-02-06 at 09:15 -0800, Cong Wang wrote:
> > On Wed, Feb 6, 2019 at 8:55 AM Saeed Mahameed <saeedm@mellanox.com>
> > wrote:
> > > Hi Cong,
> > >
> > > The patch is ok to me, but i really doubt that you can hit a
> > > contention
> > > on latest upstream driver, since we already have spinlock per EQ,
> > > which
> > > means spinlock per core,  each EQ (core) msix handler can only
> > > access
> > > one spinlock (its own), so I am surprised how you got the
> > > contention,
> > > Maybe you are not running on latest upstream driver ?
> >
> > We are running 4.14 stable release. Which commit changes the game
> > here? We can consider to backport it unless it is complicated.
> >
>
> Ok, so there is no issue upstream, you are just missing the following
> patch:
>
> commit 02d92f7903647119e125b24f5470f96cee0d4b4b
> Author: Saeed Mahameed <saeedm@mellanox.com>
> Date:   Fri Jan 19 16:13:01 2018 -0800
>
>     net/mlx5: CQ Database per EQ
>
>     Before this patch the driver had one CQ database protected via one
>     spinlock, this spinlock is meant to synchronize between CQ
>     adding/removing and CQ IRQ interrupt handling.


Thanks for pointing it out! I will evaluate if we should backport it to
4.14.

^ permalink raw reply

* Re: [PATCH net] net: dsa: Fix NULL checking in dsa_slave_set_eee()
From: Florian Fainelli @ 2019-02-06 17:42 UTC (permalink / raw)
  To: Dan Carpenter, Andrew Lunn
  Cc: Vivien Didelot, David S. Miller, netdev, kernel-janitors
In-Reply-To: <20190206153514.GA11033@kadam>

On 2/6/19 7:35 AM, Dan Carpenter wrote:
> This function can't succeed if dp->pl is NULL.  It will Oops inside the
> call to return phylink_ethtool_get_eee(dp->pl, e);
> 
> Fixes: 1be52e97ed3e ("dsa: slave: eee: Allow ports to use phylink")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

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

thanks Dan!
-- 
Florian

^ permalink raw reply

* Re: [PATCH] rhashtable: use irq-safe spinlock in rhashtable_rehash_table()
From: David Miller @ 2019-02-06 17:40 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, netdev, j, tgraf, herbert
In-Reply-To: <726dba28e925c6ade53f362c4f48b2ee28841dc2.camel@sipsolutions.net>

From: Johannes Berg <johannes@sipsolutions.net>
Date: Wed, 06 Feb 2019 09:15:15 +0100

> On Tue, 2019-02-05 at 15:37 +0100, Johannes Berg wrote:
>> From: Johannes Berg <johannes.berg@intel.com>
>> 
>> When an rhashtabl walk is done from irq/bh context, we rightfully
>> get a lockdep complaint saying that we could get a (soft-)IRQ in
>> the middle of a rehash. This happened e.g. in mac80211 as it does
>> a walk in soft-irq context.
>> 
>> Fix this by using irq-safe locking here. We don't need _irqsave()
>> as we know this will be called only in process context from the
>> workqueue. We could get away with _bh() but that seems a bit less
>> generic, though I'm not sure anyone would want to do a walk from
>> a real IRQ handler.
> 
> Please drop this, it doesn't make sense.
> 
> I'll resend with all the spinlock usage changed to either _bh or
> _irqsave(), since it makes no sense to enforce any kind of outside
> BH/irq disabling for purposes of the inner lock.

Ok.

^ permalink raw reply

* Re: [Patch net-next] mlx5: use RCU lock in mlx5_eq_cq_get()
From: Saeed Mahameed @ 2019-02-06 17:40 UTC (permalink / raw)
  To: netdev@vger.kernel.org, xiyou.wangcong@gmail.com; +Cc: Tariq Toukan
In-Reply-To: <04cf201a72e3c75c706fb12f235eeba9203ce0dd.camel@mellanox.com>

On Wed, 2019-02-06 at 09:35 -0800, Saeed Mahameed wrote:
> On Tue, 2019-02-05 at 16:35 -0800, Cong Wang wrote:
> > mlx5_eq_cq_get() is called in IRQ handler, the spinlock inside
> > gets a lot of contentions when we test some heavy workload
> > with 60 RX queues and 80 CPU's, and it is clearly shown in the
> > flame graph.
> > 
> > In fact, radix_tree_lookup() is perfectly fine with RCU read lock,
> > we don't have to take a spinlock on this hot path. It is pretty
> > much
> > similar to commit 291c566a2891
> > ("net/mlx4_core: Fix racy CQ (Completion Queue) free"). Slow paths
> > are still serialized with the spinlock, and with synchronize_irq()
> > it should be safe to just move the fast path to RCU read lock.
> > 
> > This patch itself reduces the latency by about 50% with our
> > workload.
> > 
> > Cc: Saeed Mahameed <saeedm@mellanox.com>
> > Cc: Tariq Toukan <tariqt@mellanox.com>
> > Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
> 
> Acked-by: Saeed Mahameed <saeedm@mellanox.com>
> 

Actually, the commit message needs some rework, since there is no
contention upstream, Cong can you take care of this and post a V2 ?

Thanks,
Saeed.

^ permalink raw reply

* Re: [Patch net-next] mlx5: use RCU lock in mlx5_eq_cq_get()
From: Saeed Mahameed @ 2019-02-06 17:37 UTC (permalink / raw)
  To: eric.dumazet@gmail.com, netdev@vger.kernel.org, Tariq Toukan,
	xiyou.wangcong@gmail.com
In-Reply-To: <8df59337-8c20-de92-6088-d008031da6f2@gmail.com>

On Wed, 2019-02-06 at 09:17 -0800, Eric Dumazet wrote:
> 
> On 02/06/2019 08:55 AM, Saeed Mahameed wrote:
> > On Wed, 2019-02-06 at 12:02 +0000, Tariq Toukan wrote:
> > > On 2/6/2019 2:35 AM, Cong Wang wrote:
> > > > mlx5_eq_cq_get() is called in IRQ handler, the spinlock inside
> > > > gets a lot of contentions when we test some heavy workload
> > > > with 60 RX queues and 80 CPU's, and it is clearly shown in the
> > > > flame graph.
> > > > 
> > 
> > Hi Cong,
> > 
> > The patch is ok to me, but i really doubt that you can hit a
> > contention
> > on latest upstream driver, since we already have spinlock per EQ,
> > which
> > means spinlock per core,  each EQ (core) msix handler can only
> > access
> > one spinlock (its own), so I am surprised how you got the
> > contention,
> > Maybe you are not running on latest upstream driver ?
> > 
> > what is the workload ? 
> 
> Surprisingly (or not), atomic operations, even on _not_ contended
> cache lines can
> stall the cpu enough for perf tools to notice...
> 
> If the atomic operation can be trivially replaced by RCU, then do it
> by any mean.
> 
> 

Totally agree, Thanks Eric.

^ permalink raw reply

* Re: pull-request: wireless-drivers-next 2019-02-06
From: David Miller @ 2019-02-06 17:37 UTC (permalink / raw)
  To: kvalo; +Cc: linux-wireless, netdev, linux-kernel
In-Reply-To: <878sytbd3d.fsf@kamboji.qca.qualcomm.com>

From: Kalle Valo <kvalo@codeaurora.org>
Date: Wed, 06 Feb 2019 09:17:10 +0200

> here's a pull request to net-next for 5.1, more info below. Please let
> me know if there are any problems.

Pulled, thanks Kalle!

^ permalink raw reply

* [BUG] kernel panic 4.14.95 in kmem_cache_alloc / build_skb
From: Frank Wunderlich @ 2019-02-06 17:36 UTC (permalink / raw)
  To: netdev

Hi,

linux-net-mailinglist for reporting bugs seems not existing anymore and i have not found out the right one..."scripts/get_maintainer.pl -f ./include/linux/skbuff.h" shows only linux-kernel as mailing list which is not specific for network, so sorry, if i'm in the wrong mailinglist.

i've recently noticed panics on my bananapi-r2 with kernel 4.14.95, but can't locate them in detail...all is pointing to kmem_cache_alloc and build_skb, but over complete different ways. so i guess it's network-related

i currently don't know what is triggering this crashes, so i cannot reproduce them on my test-machine :(

it's not only an oops...the machine stays still and have to be resettet, sometimes after an half hour running

i had kernel 4.14.78 running before, so i think it's a change between these 2 Kernel-versions and no OS-related (debian-stretch) or Hardware-issue

currently i test with 4.14.90, if it has same behaviour...at the moment it seems stable...

i cannot test it with another kernel-branch (4.19+), because i need to test it on my productive machine till i find a way to reproduce it....maybe you can see a hint in stacktrace to guide me...at the moment crash occours unexpectely

i looked through git-tree but did not found anything related

regards Frank

here my 3 recorded crash-logs...maybe you can point me in the right direction (reproduce/debug/fix):

first is thrown out of mt76-module (had mt7612 inserted which i had disabled on last 2 crashes):

[ 1281.724002] Unable to handle kernel NULL pointer dereference at virtual address 00000001
[ 1281.732105] pgd = c0004000
[ 1281.734836] [00000001] *pgd=00000000
[ 1281.738425] Internal error: Oops: 5 [#1] SMP ARM
[ 1281.743016] Modules linked in: xt_addrtype veth pppoe pppox ppp_generic slhc sit tunnel4 ip_tunnel bridge ip6t_REJECT nf_reject_ipv6 xt_mac
ip6t_rt nf_conntrack_ipv6 nf_defrag_ipv6 ip6table_filter ip6_tables ipt_REJECT nf_reject_ipv4 xt_limit xt_iprange xt_recent xt_conntrack iptabl
e_filter ipt_MASQUERADE nf_nat_masquerade_ipv4 xt_nat tun xt_tcpudp iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrac
k xt_mark iptable_mangle mt76x2e mt76 mtk_thermal spi_mt65xx thermal_sys mt6577_auxadc pwm_mediatek nvmem_mtk_efuse mtk_pmic_keys evbug rtc_mt6
397 nfsd ip_tables x_tables ipv6
[ 1281.795425] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.14.95-bpi-r2-main #49
[ 1281.802510] Hardware name: Mediatek Cortex-A7 (Device Tree)
[ 1281.808043] task: c11073c0 task.stack: c1100000
[ 1281.812551] PC is at kmem_cache_alloc+0xd0/0x21c
[ 1281.817134] LR is at 0x391d6
[ 1281.819990] pc : [<c028c0f4>] lr : [<000391d6>] psr: 280f0113
[ 1281.826209] sp : c1101c18 ip : a80f0113 fp : c1101c4c
[ 1281.831393] r10: 00000001 r9 : dbdf6900 r8 : c0895b9c
[ 1281.836578] r7 : de801cc0 r6 : 01080020 r5 : c1226790 r4 : de801cc0
[ 1281.843056] r3 : 00000000 r2 : df5a39d4 r1 : 1e4e9000 r0 : 000391d5
[ 1281.849535] Flags: nzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none
[ 1281.856617] Control: 10c5387d Table: 9bdc006a DAC: 00000051
[ 1281.862319] Process swapper/0 (pid: 0, stack limit = 0xc1100218)
[ 1281.868280] Stack: (0xc1101c18 to 0xc1102000)
[ 1281.872608] 1c00: db119900 df5a0fb8
[ 1281.880733] 1c20: c1101c54 df5a0784 00000000 00000300 da308b00 680f0113 00000000 da1dd6b0
[ 1281.888858] 1c40: c1101c74 c1101c50 c0895b9c c028c030 df5a0784 00000000 00000300 da308b00
[ 1281.896983] 1c60: 680f0113 00000000 c1101c9c c1101c78 c0895d10 c0895b70 00000000 dcc48b78
[ 1281.905109] 1c80: db6e5f00 dcc48580 de8ec460 c1101d10 c1101d04 c1101ca0 c0a729cc c0895c88
[ 1281.913234] 1ca0: c015ff18 c01593b4 d63e99d9 00000000 c1101d0c c01525cc c0b02a08 df5a0f80
[ 1281.921359] 1cc0: c1101ce4 c1101cd0 c01525cc c0151994 df5a0f80 da029e00 c1101d1c 00000000
[ 1281.929484] 1ce0: 00000000 de8ec460 bf16bb90 dcc48b78 00000001 00000003 c1101d3c c1101d08
[ 1281.937608] 1d00: c0a72ba8 c0a727b4 00000002 c04e15c8 00000000 00000000 c04e15c8 de8ecd20
[ 1281.945732] 1d20: dcc48b78 00000002 bf16bb90 de8ecd20 c1101d54 c1101d40 bf16bbd4 c0a72b74
[ 1281.953858] 1d40: dcc48580 de8ecab0 c1101d8c c1101d58 c0a78f20 bf16bb9c c1101d64 de8ec460
[ 1281.961983] 1d60: ff76abc0 de8ecd20 de8ed868 c1101db0 bf16baf8 c10af2a8 ffffe000 00000040
[ 1281.970108] 1d80: c1101d9c c1101d90 c0a78fbc c0a78e90 c1101e04 c1101da0 bf16c0a8 c0a78fac
[ 1281.978232] 1da0: de8ecd20 00200000 c1101ddc de8ecd20 c1101db0 c1101db0 00000000 00000000
[ 1281.986357] 1dc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 1281.994482] 1de0: c0aa6524 de8ed864 de8ed868 00000000 00000000 c10af2a8 c1101e2c c1101e08
[ 1282.002607] 1e00: c012cf74 bf16c058 c1102098 00000006 c11bcd08 00000100 00000007 ffffe000
[ 1282.010732] 1e20: c1101e8c c1101e30 c0101614 c012cf10 c0182400 c0185260 00000001 00200102
[ 1282.018858] 1e40: c1102d00 00017f7c c0b023a8 0000000a c11f4c40 c1103c6c c10af310 c1102080
[ 1282.026982] 1e60: c0185740 c10b7b3c 00000000 00000000 00000001 de819000 e1003000 e07fcc00
[ 1282.035107] 1e80: c1101e9c c1101e90 c012c998 c01014f4 c1101ec4 c1101ea0 c01818f4 c012c8c0
[ 1282.043231] 1ea0: c11043f8 c1168010 e100200c e1002000 c1101ef0 e1003000 c1101eec c1101ec8
[ 1282.051357] 1ec0: c01014a0 c0181890 c01098b0 680f0013 ffffffff c1101f24 c0d2c0e0 c1100000
[ 1282.059481] 1ee0: c1101f4c c1101ef0 c010e24c c0101450 00000000 0018f100 1e4e9000 c011f8e0
[ 1282.067607] 1f00: ffffe000 c1103ccc c1103c6c c11bc85f c0d2c0e0 00000001 e07fcc00 c1101f4c
[ 1282.075731] 1f20: c1101f50 c1101f40 c01098ac c01098b0 680f0013 ffffffff 00000051 00000000
[ 1282.083856] 1f40: c1101f5c c1101f50 c0ac2d88 c0109874 c1101f84 c1101f60 c016e3b0 c0ac2d64
[ 1282.091982] 1f60: 000000be c11f3f00 c1103c40 ffffffff c11f3f00 c1079e30 c1101f94 c1101f88
[ 1282.100107] 1f80: c016e6b0 c016e2d0 c1101fac c1101f98 c0abcc9c c016e694 c11f3f40 c11f3f00
[ 1282.108231] 1fa0: c1101ff4 c1101fb0 c1000e28 c0abcbe8 ffffffff ffffffff 00000000 c1000784
[ 1282.116357] 1fc0: 00000000 c1079e30 00000000 c11f4494 c1103c58 c1079e2c c1108800 8000406a
[ 1282.124481] 1fe0: 410fc073 00000000 00000000 c1101ff8 8000807c c1000a7c 00000000 00000000
[ 1282.132624] [<c028c0f4>] (kmem_cache_alloc) from [<c0895b9c>] (__build_skb+0x38/0xa0)
[ 1282.140411] [<c0895b9c>] (__build_skb) from [<c0895d10>] (__netdev_alloc_skb+0x94/0x110)
[ 1282.148456] [<c0895d10>] (__netdev_alloc_skb) from [<c0a729cc>] (__ieee80211_beacon_get+0x224/0x3a0)
[ 1282.157535] [<c0a729cc>] (__ieee80211_beacon_get) from [<c0a72ba8>] (ieee80211_beacon_get_tim+0x40/0x11c)
[ 1282.167077] [<c0a72ba8>] (ieee80211_beacon_get_tim) from [<bf16bbd4>] (mt76x2_update_beacon_iter+0x44/0x5c [mt76x2e])
[ 1282.177647] [<bf16bbd4>] (mt76x2_update_beacon_iter [mt76x2e]) from [<c0a78f20>] (__iterate_interfaces+0x9c/0x11c)
[ 1282.187936] [<c0a78f20>] (__iterate_interfaces) from [<c0a78fbc>] (ieee80211_iterate_active_interfaces_atomic+0x1c/0x20)
[ 1282.198756] [<c0a78fbc>] (ieee80211_iterate_active_interfaces_atomic) from [<bf16c0a8>] (mt76x2_pre_tbtt_tasklet+0x5c/0x148 [mt76x2e])
[ 1282.210783] [<bf16c0a8>] (mt76x2_pre_tbtt_tasklet [mt76x2e]) from [<c012cf74>] (tasklet_action+0x70/0x104)
[ 1282.220379] [<c012cf74>] (tasklet_action) from [<c0101614>] (__do_softirq+0x12c/0x378)
[ 1282.228248] [<c0101614>] (__do_softirq) from [<c012c998>] (irq_exit+0xe4/0x15c)
[ 1282.235516] [<c012c998>] (irq_exit) from [<c01818f4>] (__handle_domain_irq+0x70/0xc4)
[ 1282.243299] [<c01818f4>] (__handle_domain_irq) from [<c01014a0>] (gic_handle_irq+0x5c/0xa0)
[ 1282.251601] [<c01014a0>] (gic_handle_irq) from [<c010e24c>] (__irq_svc+0x6c/0x90)
[ 1282.259031] Exception stack(0xc1101ef0 to 0xc1101f38)
[ 1282.264048] 1ee0: 00000000 0018f100 1e4e9000 c011f8e0
[ 1282.272173] 1f00: ffffe000 c1103ccc c1103c6c c11bc85f c0d2c0e0 00000001 e07fcc00 c1101f4c
[ 1282.280296] 1f20: c1101f50 c1101f40 c01098ac c01098b0 680f0013 ffffffff
[ 1282.286872] [<c010e24c>] (__irq_svc) from [<c01098b0>] (arch_cpu_idle+0x48/0x4c)
[ 1282.294225] [<c01098b0>] (arch_cpu_idle) from [<c0ac2d88>] (default_idle_call+0x30/0x3c)
[ 1282.302267] [<c0ac2d88>] (default_idle_call) from [<c016e3b0>] (do_idle+0xec/0x150)
[ 1282.309877] [<c016e3b0>] (do_idle) from [<c016e6b0>] (cpu_startup_entry+0x28/0x2c)
[ 1282.317402] [<c016e6b0>] (cpu_startup_entry) from [<c0abcc9c>] (rest_init+0xc0/0xc4)
[ 1282.325101] [<c0abcc9c>] (rest_init) from [<c1000e28>] (start_kernel+0x3b8/0x3c4)
[ 1282.332539] Code: e121f00c e35a0000 0a000002 e5943014 (e79a3003)

Message from[ 1282.338703] ---[ end trace 8329366c083f9bce ]---
syslogd@bpi-r2-[ 1282.344651] Kernel panic - not syncing: Fatal exception in interrupt
[ 1282.352323] CPU2: stopping
[ 1282.355026] CPU: 2 PID: 3188 Comm: dmesg Tainted: G D 4.14.95-bpi-r2-main #49
[ 1282.363232] Hardware name: Mediatek Cortex-A7 (Device Tree)
[ 1282.368786] [<c0113358>] (unwind_backtrace) from [<c010d580>] (show_stack+0x20/0x24)
[ 1282.376485] [<c010d580>] (show_stack) from [<c0aa8e18>] (dump_stack+0x94/0xa8)
[ 1282.383666] [<c0aa8e18>] (dump_stack) from [<c011124c>] (handle_IPI+0x358/0x378)
[ 1282.391017] [<c011124c>] (handle_IPI) from [<c01014e0>] (gic_handle_irq+0x9c/0xa0)
[ 1282.398539] [<c01014e0>] (gic_handle_irq) from [<c010e614>] (__irq_usr+0x54/0x80)
[ 1282.405970] Exception stack(0xd8149fb0 to 0xd8149ff8)
[ 1282.410987] 9fa0: beaaa9e8 004c62e1 00000000 00000032
[ 1282.419113] 9fc0: beaaa9e4 004c62e4 beaaa980 004c62e0 b6f144c0 004cb758 beaaa9e0 beaaa9e4
[ 1282.427236] 9fe0: 004c60b4 beaaa8e8 beaaa9e4 b6de2a3c 800f0030 ffffffff
[ 1282.433804] CPU1: stopping
[ 1282.436496] CPU: 1 PID: 0 Comm: swapper/1 Tainted: G D 4.14.95-bpi-r2-main #49
[ 1282.444789] Hardware name: Mediatek Cortex-A7 (Device Tree)
[ 1282.450328] [<c0113358>] (unwind_backtrace) from [<c010d580>] (show_stack+0x20/0x24)
[ 1282.458024] [<c010d580>] (show_stack) from [<c0aa8e18>] (dump_stack+0x94/0xa8)
[ 1282.465202] [<c0aa8e18>] (dump_stack) from [<c011124c>] (handle_IPI+0x358/0x378)
[ 1282.472552] [<c011124c>] (handle_IPI) from [<c01014e0>] (gic_handle_irq+0x9c/0xa0)
[ 1282.480073] [<c01014e0>] (gic_handle_irq) from [<c010e24c>] (__irq_svc+0x6c/0x90)
[ 1282.487503] Exception stack(0xde943f38 to 0xde943f80)
[ 1282.492517] 3f20: 00000000 000b9204
[ 1282.500642] 3f40: 1e4fa000 c011f8e0 ffffe000 c1103ccc c1103c6c c11bc85f c0d2c0e0 00000001
[ 1282.508767] 3f60: 00000000 de943f94 de943f98 de943f88 c01098ac c01098b0 60000013 ffffffff
[ 1282.516895] [<c010e24c>] (__irq_svc) from [<c01098b0>] (arch_cpu_idle+0x48/0x4c)
[ 1282.524247] [<c01098b0>] (arch_cpu_idle) from [<c0ac2d88>] (default_idle_call+0x30/0x3c)
[ 1282.532289] [<c0ac2d88>] (default_idle_call) from [<c016e3b0>] (do_idle+0xec/0x150)
[ 1282.539898] [<c016e3b0>] (do_idle) from [<c016e6b0>] (cpu_startup_entry+0x28/0x2c)
[ 1282.547421] [<c016e6b0>] (cpu_startup_entry) from [<c0110c60>] (secondary_start_kernel+0x170/0x194)
[ 1282.556409] [<c0110c60>] (secondary_start_kernel) from [<801018ec>] (0x801018ec)
[ 1282.563755] CPU3: stopping
[ 1282.566447] CPU: 3 PID: 0 Comm: swapper/3 Tainted: G D 4.14.95-bpi-r2-main #49
[ 1282.574739] Hardware name: Mediatek Cortex-A7 (Device Tree)
[ 1282.580279] [<c0113358>] (unwind_backtrace) from [<c010d580>] (show_stack+0x20/0x24)
[ 1282.587975] [<c010d580>] (show_stack) from [<c0aa8e18>] (dump_stack+0x94/0xa8)
[ 1282.595152] [<c0aa8e18>] (dump_stack) from [<c011124c>] (handle_IPI+0x358/0x378)
[ 1282.602503] [<c011124c>] (handle_IPI) from [<c01014e0>] (gic_handle_irq+0x9c/0xa0)
[ 1282.610024] [<c01014e0>] (gic_handle_irq) from [<c010e24c>] (__irq_svc+0x6c/0x90)
[ 1282.617454] Exception stack(0xde947ea0 to 0xde947ee8)
[ 1282.622474] 7ea0: dbc09200 00000001 dbc09200 0000b59f c10b7f80 00000000 df5d3f80 1e51c000
[ 1282.630598] 7ec0: c0abdbfc ffffe000 de91c800 de947f34 de947f38 de947ef0 c0abdbfc c015028c
[ 1282.638718] 7ee0: 600d0013 ffffffff
[ 1282.642188] [<c010e24c>] (__irq_svc) from [<c015028c>] (finish_task_switch+0xf0/0x244)
[ 1282.650059] [<c015028c>] (finish_task_switch) from [<c0abdbfc>] (__schedule+0x21c/0x6f8)
[ 1282.658101] [<c0abdbfc>] (__schedule) from [<c0abe500>] (schedule_idle+0x44/0x84)
[ 1282.665538] [<c0abe500>] (schedule_idle) from [<c016e3d4>] (do_idle+0x110/0x150)
[ 1282.672889] [<c016e3d4>] (do_idle) from [<c016e6b0>] (cpu_startup_entry+0x28/0x2c)
[ 1282.680413] [<c016e6b0>] (cpu_startup_entry) from [<c0110c60>] (secondary_start_kernel+0x170/0x194)
[ 1282.689400] [<c0110c60>] (secondary_start_kernel) from [<801018ec>] (0x801018ec)
[ 1282.696754] ---[ end Kernel panic - not syncing: Fatal exception in interrupt
e at Feb 4 19:03:43 ...
kernel:[ 1281.738425] Internal error: Oops: 5 [#1] SMP ARM

=============================================================================================================================

19:15] root@bpi-r2-e:~ (156)# [ 666.687166] Unable to handle kernel NULL pointer dereference at virtual address 00000001
[ 666.695237] pgd = c0004000
[ 666.697927] [00000001] *pgd=00000000
[ 666.701484] Internal error: Oops: 5 [#1] SMP ARM
[ 666.706066] Modules linked in: xt_addrtype veth pppoe pppox ppp_generic slhc sit tunnel4 ip_tunnel bridge ip6t_REJECT nf_reject_ipv6 xt_mac
ip6t_rt nf_conntrack_ipv6 nf_defrag_ipv6 ip6table_filter ip6_tables ipt_REJECT nf_reject_ipv4 xt_limit xt_iprange xt_recent xt_conntrack iptabl
e_filter ipt_MASQUERADE nf_nat_masquerade_ipv4 tun xt_nat xt_tcpudp iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrac
k xt_mark iptable_mangle spi_mt65xx mtk_thermal thermal_sys evbug mt6577_auxadc pwm_mediatek mtk_pmic_keys rtc_mt6397 nvmem_mtk_efuse nfsd ip_t
ables x_tables ipv6 [last unloaded: mt76]
[ 666.759246] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.14.95-bpi-r2-main #49
[ 666.766329] Hardware name: Mediatek Cortex-A7 (Device Tree)
[ 666.771860] task: c11073c0 task.stack: c1100000
[ 666.776363] PC is at kmem_cache_alloc+0xd0/0x21c
[ 666.780945] LR is at 0x179ab
[ 666.783801] pc : [<c028c0f4>] lr : [<000179ab>] psr: 200f0113
[ 666.790020] sp : c1101cd0 ip : a00f0113 fp : c1101d04
[ 666.795204] r10: 00000001 r9 : de97cb40 r8 : c0895b9c
[ 666.800389] r7 : de801cc0 r6 : 01080020 r5 : c1226790 r4 : de801cc0
[ 666.806867] r3 : 00000000 r2 : df5a39d4 r1 : 1e4e9000 r0 : 000179aa
[ 666.813347] Flags: nzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none
[ 666.820429] Control: 10c5387d Table: 9bbc806a DAC: 00000051
[ 666.826133] Process swapper/0 (pid: 0, stack limit = 0xc1100218)
[ 666.832093] Stack: (0xc1101cd0 to 0xc1102000)
[ 666.836423] 1cc0: 9a7c0c40 df9b1700 00000500 da723ec0
[ 666.844549] 1ce0: 00000740 00000740 da723ec0 dd8a0000 9a7c0500 deb6c728 c1101d2c c1101d08
[ 666.852674] 1d00: c0895b9c c028c030 da723ec0 00000740 da723ec0 e1038b00 dd8a0000 9a7c0500
[ 666.860799] 1d20: c1101d44 c1101d30 c0895c24 c0895b70 deb6c628 000005b0 c1101dbc c1101d48
[ 666.868924] 1d40: c071b4a0 c0895c10 00000002 00000000 c0dba83c 00000040 deb6c010 c1225940
[ 666.877050] 1d60: 3fff0000 00000000 c0b0184c 9a723f00 e1033000 c5ee0004 c08a9a98 c08a6ef0
[ 666.885175] 1d80: 00000040 da7c04c0 2a678002 00000000 c1101dbc deb6c728 00000001 00000040
[ 666.893299] 1da0: c11c0048 0000012c 00008f3d c1101df0 c1101e2c c1101dc0 c08ae4d8 c071b328
[ 666.901424] 1dc0: dd889940 dead4d00 c1101de4 c0debe30 c1104fcc c1103c6c ffffe000 c11bcb49
[ 666.909550] 1de0: c10b8840 df5a1840 1e4e9000 c1102d00 c1101df0 c1101df0 c1101df8 c1101df8
[ 666.917675] 1e00: ffffe000 c110208c 00000003 c11bcd08 00000100 00000004 ffffe000 00000008
[ 666.925800] 1e20: c1101e8c c1101e30 c0101614 c08ae39c c0182400 c0185260 00000001 00200102
[ 666.933925] 1e40: c1102d00 00008f3d c0b023a8 0000000a c11f4c40 c1103c6c c10af310 c1102080
[ 666.942050] 1e60: c0185740 c10b7b3c 00000000 00000000 00000001 de819000 e1003000 e07fcc00
[ 666.950176] 1e80: c1101e9c c1101e90 c012c998 c01014f4 c1101ec4 c1101ea0 c01818f4 c012c8c0
[ 666.958302] 1ea0: c11043f8 c1168010 e100200c e1002000 c1101ef0 e1003000 c1101eec c1101ec8
[ 666.966428] 1ec0: c01014a0 c0181890 c01098b0 600f0013 ffffffff c1101f24 c0d2c0e0 c1100000
[ 666.974553] 1ee0: c1101f4c c1101ef0 c010e24c c0101450 00000000 000aeb14 1e4e9000 c011f8e0
[ 666.982678] 1f00: ffffe000 c1103ccc c1103c6c c11bc85f c0d2c0e0 00000001 e07fcc00 c1101f4c
[ 666.990803] 1f20: c1101f50 c1101f40 c01098ac c01098b0 600f0013 ffffffff 00000051 00000000
[ 666.998927] 1f40: c1101f5c c1101f50 c0ac2d88 c0109874 c1101f84 c1101f60 c016e3b0 c0ac2d64
[ 667.007053] 1f60: 000000be c11f3f00 c1103c40 ffffffff c11f3f00 c1079e30 c1101f94 c1101f88
[ 667.015180] 1f80: c016e6b0 c016e2d0 c1101fac c1101f98 c0abcc9c c016e694 c11f3f40 c11f3f00
[ 667.023305] 1fa0: c1101ff4 c1101fb0 c1000e28 c0abcbe8 ffffffff ffffffff 00000000 c1000784
[ 667.031431] 1fc0: 00000000 c1079e30 00000000 c11f4494 c1103c58 c1079e2c c1108800 8000406a
[ 667.039556] 1fe0: 410fc073 00000000 00000000 c1101ff8 8000807c c1000a7c 00000000 00000000
[ 667.047698] [<c028c0f4>] (kmem_cache_alloc) from [<c0895b9c>] (__build_skb+0x38/0xa0)
[ 667.055485] [<c0895b9c>] (__build_skb) from [<c0895c24>] (build_skb+0x20/0x78)
[ 667.062671] [<c0895c24>] (build_skb) from [<c071b4a0>] (mtk_napi_rx+0x184/0x568)
[ 667.070024] [<c071b4a0>] (mtk_napi_rx) from [<c08ae4d8>] (net_rx_action+0x148/0x400)
[ 667.077722] [<c08ae4d8>] (net_rx_action) from [<c0101614>] (__do_softirq+0x12c/0x378)
[ 667.085507] [<c0101614>] (__do_softirq) from [<c012c998>] (irq_exit+0xe4/0x15c)
[ 667.092775] [<c012c998>] (irq_exit) from [<c01818f4>] (__handle_domain_irq+0x70/0xc4)
[ 667.100561] [<c01818f4>] (__handle_domain_irq) from [<c01014a0>] (gic_handle_irq+0x5c/0xa0)
[ 667.108861] [<c01014a0>] (gic_handle_irq) from [<c010e24c>] (__irq_svc+0x6c/0x90)
[ 667.116293] Exception stack(0xc1101ef0 to 0xc1101f38)
[ 667.121309] 1ee0: 00000000 000aeb14 1e4e9000 c011f8e0
[ 667.129436] 1f00: ffffe000 c1103ccc c1103c6c c11bc85f c0d2c0e0 00000001 e07fcc00 c1101f4c
[ 667.137560] 1f20: c1101f50 c1101f40 c01098ac c01098b0 600f0013 ffffffff
[ 667.144138] [<c010e24c>] (__irq_svc) from [<c01098b0>] (arch_cpu_idle+0x48/0x4c)
[ 667.151494] [<c01098b0>] (arch_cpu_idle) from [<c0ac2d88>] (default_idle_call+0x30/0x3c)
[ 667.159537] [<c0ac2d88>] (default_idle_call) from [<c016e3b0>] (do_idle+0xec/0x150)
[ 667.167150] [<c016e3b0>] (do_idle) from [<c016e6b0>] (cpu_startup_entry+0x28/0x2c)
[ 667.174675] [<c016e6b0>] (cpu_startup_entry) from [<c0abcc9c>] (rest_init+0xc0/0xc4)
[ 667.182376] [<c0abcc9c>] (rest_init) from [<c1000e28>] (start_kernel+0x3b8/0x3c4)
[ 667.189815] Code: e121f00c e35a0000 0a000002 e5943014 (e79a3003)
[ 667.195994] ---[ end trace 2a6dec570c221166 ]---
[ 667.200595] Kernel panic - not syncing: Fatal exception in interrupt
[ 667.206914] CPU3: stopping
[ 667.209614] CPU: 3 PID: 165 Comm: systemd-journal Tainted: G D 4.14.95-bpi-r2-main #49
[ 667.218596] Hardware name: Mediatek Cortex-A7 (Device Tree)
[ 667.224148] [<c0113358>] (unwind_backtrace) from [<c010d580>] (show_stack+0x20/0x24)
[ 667.231845] [<c010d580>] (show_stack) from [<c0aa8e18>] (dump_stack+0x94/0xa8)
[ 667.239025] [<c0aa8e18>] (dump_stack) from [<c011124c>] (handle_IPI+0x358/0x378)
[ 667.246376] [<c011124c>] (handle_IPI) from [<c01014e0>] (gic_handle_irq+0x9c/0xa0)
[ 667.253898] [<c01014e0>] (gic_handle_irq) from [<c010e614>] (__irq_usr+0x54/0x80)
[ 667.261329] Exception stack(0xdde3ffb0 to 0xdde3fff8)
[ 667.266346] ffa0: bec8224f 0000000a 00000001 000005e8
[ 667.274471] ffc0: 00000001 b6ccd97d bec81e28 bec81db0 00000000 bec82280 00000009 00000000
[ 667.282594] ffe0: b6d69010 bec81d90 b6cb24cb b6cb1a5e 200d0030 ffffffff
[ 667.289161] CPU2: stopping
[ 667.291854] CPU: 2 PID: 0 Comm: swapper/2 Tainted: G D 4.14.95-bpi-r2-main #49
[ 667.300146] Hardware name: Mediatek Cortex-A7 (Device Tree)
[ 667.305685] [<c0113358>] (unwind_backtrace) from [<c010d580>] (show_stack+0x20/0x24)
[ 667.313380] [<c010d580>] (show_stack) from [<c0aa8e18>] (dump_stack+0x94/0xa8)
[ 667.320559] [<c0aa8e18>] (dump_stack) from [<c011124c>] (handle_IPI+0x358/0x378)
[ 667.327909] [<c011124c>] (handle_IPI) from [<c01014e0>] (gic_handle_irq+0x9c/0xa0)
[ 667.335431] [<c01014e0>] (gic_handle_irq) from [<c010e24c>] (__irq_svc+0x6c/0x90)
[ 667.342861] Exception stack(0xde945f38 to 0xde945f80)
[ 667.347875] 5f20: 00000000 000611a4
[ 667.356000] 5f40: 1e50b000 c011f8e0 ffffe000 c1103ccc c1103c6c c11bc85f c0d2c0e0 00000001
[ 667.364125] 5f60: 00000000 de945f94 de945f98 de945f88 c01098ac c01098b0 600f0013 ffffffff
[ 667.372253] [<c010e24c>] (__irq_svc) from [<c01098b0>] (arch_cpu_idle+0x48/0x4c)
[ 667.379605] [<c01098b0>] (arch_cpu_idle) from [<c0ac2d88>] (default_idle_call+0x30/0x3c)
[ 667.387646] [<c0ac2d88>] (default_idle_call) from [<c016e3b0>] (do_idle+0xec/0x150)
[ 667.395254] [<c016e3b0>] (do_idle) from [<c016e6b0>] (cpu_startup_entry+0x28/0x2c)
[ 667.402778] [<c016e6b0>] (cpu_startup_entry) from [<c0110c60>] (secondary_start_kernel+0x170/0x194)
[ 667.411766] [<c0110c60>] (secondary_start_kernel) from [<801018ec>] (0x801018ec)
[ 667.419113] CPU1: stopping
[ 667.421805] CPU: 1 PID: 0 Comm: swapper/1 Tainted: G D 4.14.95-bpi-r2-main #49
[ 667.430098] Hardware name: Mediatek Cortex-A7 (Device Tree)
[ 667.435639] [<c0113358>] (unwind_backtrace) from [<c010d580>] (show_stack+0x20/0x24)
[ 667.443334] [<c010d580>] (show_stack) from [<c0aa8e18>] (dump_stack+0x94/0xa8)
[ 667.450513] [<c0aa8e18>] (dump_stack) from [<c011124c>] (handle_IPI+0x358/0x378)
[ 667.457863] [<c011124c>] (handle_IPI) from [<c01014e0>] (gic_handle_irq+0x9c/0xa0)
[ 667.465385] [<c01014e0>] (gic_handle_irq) from [<c010e24c>] (__irq_svc+0x6c/0x90)
[ 667.472816] Exception stack(0xde943f38 to 0xde943f80)
[ 667.477831] 3f20: 00000000 00071d18
[ 667.485956] 3f40: 1e4fa000 c011f8e0 ffffe000 c1103ccc c1103c6c c11bc85f c0d2c0e0 00000001
[ 667.494081] 3f60: 00000000 de943f94 de943f98 de943f88 c01098ac c01098b0 680e0013 ffffffff
[ 667.502208] [<c010e24c>] (__irq_svc) from [<c01098b0>] (arch_cpu_idle+0x48/0x4c)
[ 667.509558] [<c01098b0>] (arch_cpu_idle) from [<c0ac2d88>] (default_idle_call+0x30/0x3c)
[ 667.517598] [<c0ac2d88>] (default_idle_call) from [<c016e3b0>] (do_idle+0xec/0x150)
[ 667.525207] [<c016e3b0>] (do_idle) from [<c016e6b0>] (cpu_startup_entry+0x28/0x2c)
[ 667.532730] [<c016e6b0>] (cpu_startup_entry) from [<c0110c60>] (secondary_start_kernel+0x170/0x194)
[ 667.541717] [<c0110c60>] (secondary_start_kernel) from [<801018ec>] (0x801018ec)
[ 667.549071] ---[ end Kernel panic - not syncing: Fatal exception in interrupt

=============================================================================================================

[ 1851.777568] Internal err
or: Oops: 5 [#1] SMP ARM
[ 1851.782161] Modules linked in: xt_addrtype veth pppoe pppox ppp_generic slhc sit tunnel4 ip_tunnel brid
ge ip6t_REJECT nf_reject_ipv6 xt_mac ip6t_rt nf_conntrack_ipv6 nf_defrag_ipv6 ip6table_filter ip6_tables i
pt_REJECT nf_reject_ipv4 xt_limit xt_iprange xt_recent xt_conntrack iptable_filter ipt_MASQUERADE nf_nat_m
asquerade_ipv4 xt_nat tun xt_tcpudp iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_con
ntrack xt_mark iptable_mangle mtk_thermal thermal_sys mt6577_auxadc pwm_mediatek spi_mt65xx evbug mtk_pmic
_keys rtc_mt6397 nvmem_mtk_efuse nfsd ip_tables x_tables ipv6 [last unloaded: mt76]
[ 1851.835334] CPU: 0 PID: 3428 Comm: SoftwareVsyncTh Not tainted 4.14.95-bpi-r2-main #49
[ 1851.843192] Hardware name: Mediatek Cortex-A7 (Device Tree)
[ 1851.848722] task: da788600 task.stack: da77e000
[ 1851.853226] PC is at kmem_cache_alloc+0xd0/0x21c
[ 1851.857807] LR is at 0x6fc3d
[ 1851.860663] pc : [<c028c0f4>] lr : [<0006fc3d>] psr: 20070113
[ 1851.866881] sp : da77fd70 ip : a0070113 fp : da77fda4
[ 1851.872064] r10: 00000001 r9 : de950900 r8 : c08958f0
[ 1851.877249] r7 : de801cc0 r6 : 01080020 r5 : c1226790 r4 : de801cc0
[ 1851.883727] r3 : 00000000 r2 : df5a39d4 r1 : 1e4e9000 r0 : 0006fc3c
[ 1851.890207] Flags: nzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none
[ 1851.897290] Control: 10c5387d Table: 9bba006a DAC: 00000051
[ 1851.902992] Process SoftwareVsyncTh (pid: 3428, stack limit = 0xda77e218)
[ 1851.909729] Stack: (0xda77fd70 to 0xda780000)
[ 1851.914054] fd60: 1e4e9000 c019d1cc 20070193 01080020
[ 1851.922175] fd80: 00000080 00000000 de801cc0 01080020 00000000 00000000 da77fdd4 da77fda8
[ 1851.930302] fda0: c08958f0 c028c030 00000000 df59eb9c 01080020 db7b8300 c119f040 db7b8314
[ 1851.938428] fdc0: 0000001c 00000000 da77fe0c da77fdd8 c08b965c c08958a8 da77fdfc da77fde8
[ 1851.946553] fde0: c0149494 db7b8300 db7b8318 00000001 db7b8314 00000003 00000000 ffffe000
[ 1851.954678] fe00: da77fe34 da77fe10 c08be820 c08b961c c11bd17c 00000100 c08be68c db7b8330
[ 1851.962803] fe20: 00000200 00000000 da77fe6c da77fe38 c019bdc4 c08be698 c019db48 df5a4140
[ 1851.970928] fe40: 00000000 2617d280 000001af db7b8330 df59c440 da77fea8 c11bd17c 00000200
[ 1851.979053] fe60: da77fea4 da77fe70 c019c008 c019bd84 df5a4140 c1103c6c 00000000 da77fea4
[ 1851.987179] fe80: df59c440 da77fea4 c1102d00 c10b3440 1e4e9000 00000282 da77feec da77fea8
[ 1851.995304] fea0: c019c158 c019bf20 00000000 df59d5f8 da77ff0c da77fec0 c019ea04 c01af384
[ 1852.003429] fec0: a54fec74 000001af c1102084 00000001 c11bcd08 00000100 00000002 ffffe000
[ 1852.011554] fee0: da77ff4c da77fef0 c0101614 c019c090 00000010 de819000 e1003000 00400040
[ 1852.019679] ff00: c1102d00 00025e29 c0b023a8 0000000a c11f4c40 c1103c6c c10af310 c1102080
[ 1852.027804] ff20: c0186bf8 c10b7b3c 00000000 00000000 00000001 de819000 e1003000 6e5f9d25
[ 1852.035929] ff40: da77ff5c da77ff50 c012c998 c01014f4 da77ff84 da77ff60 c01818f4 c012c8c0
[ 1852.044054] ff60: c11043f8 c1168010 e100200c e1002000 da77ffb0 e1003000 da77ffac da77ff88
[ 1852.052178] ff80: c01014a0 c0181890 b6d8875e 20070030 ffffffff 10c5387d 10c5387d a54fec30
[ 1852.060303] ffa0: 00000000 da77ffb0 c010e614 c0101450 00000b98 000003e8 b6d88688 0002eaba
[ 1852.068427] ffc0: a556b64c a54fec30 b6f86ce8 a54fec70 a54fec44 a54fec30 6e5f9d25 00000000
[ 1852.076551] ffe0: 2d4ca952 a54febf0 b361d339 b6d8875e 20070030 ffffffff 00000000 00000000
[ 1852.084692] [<c028c0f4>] (kmem_cache_alloc) from [<c08958f0>] (__alloc_skb+0x54/0x140)
[ 1852.092568] [<c08958f0>] (__alloc_skb) from [<c08b965c>] (__neigh_notify+0x4c/0xdc)
[ 1852.100181] [<c08b965c>] (__neigh_notify) from [<c08be820>] (neigh_timer_handler+0x194/0x278)
[ 1852.108657] [<c08be820>] (neigh_timer_handler) from [<c019bdc4>] (call_timer_fn+0x4c/0x19c)
[ 1852.116959] [<c019bdc4>] (call_timer_fn) from [<c019c008>] (expire_timers+0xf4/0x170)
[ 1852.124742] [<c019c008>] (expire_timers) from [<c019c158>] (run_timer_softirq+0xd4/0x1cc)
[ 1852.132870] [<c019c158>] (run_timer_softirq) from [<c0101614>] (__do_softirq+0x12c/0x378)
[ 1852.140999] [<c0101614>] (__do_softirq) from [<c012c998>] (irq_exit+0xe4/0x15c)
[ 1852.148266] [<c012c998>] (irq_exit) from [<c01818f4>] (__handle_domain_irq+0x70/0xc4)
[ 1852.156049] [<c01818f4>] (__handle_domain_irq) from [<c01014a0>] (gic_handle_irq+0x5c/0xa0)
[ 1852.164349] [<c01014a0>] (gic_handle_irq) from [<c010e614>] (__irq_usr+0x54/0x80)
[ 1852.171779] Exception stack(0xda77ffb0 to 0xda77fff8)
[ 1852.176795] ffa0: 00000b98 000003e8 b6d88688 0002eaba
[ 1852.184920] ffc0: a556b64c a54fec30 b6f86ce8 a54fec70 a54fec44 a54fec30 6e5f9d25 00000000
[ 1852.193043] ffe0: 2d4ca952 a54febf0 b361d339 b6d8875e 20070030 ffffffff
[ 1852.199615] Code: e121f00c e35a0000 0a000002 e5943014 (e79a3003)
[ 1852.205765] ---[ end trace eeb67939bd037a21 ]---
[ 1852.210418] Kernel panic - not syncing: Fatal exception in interrupt
[ 1852.216750] CPU2: stopping
[ 1852.219449] CPU: 2 PID: 164 Comm: systemd-journal Tainted: G D 4.14.95-bpi-r2-main #49
[ 1852.228431] Hardware name: Mediatek Cortex-A7 (Device Tree)
[ 1852.233982] [<c0113358>] (unwind_backtrace) from [<c010d580>] (show_stack+0x20/0x24)
[ 1852.241680] [<c010d580>] (show_stack) from [<c0aa8e18>] (dump_stack+0x94/0xa8)
[ 1852.248860] [<c0aa8e18>] (dump_stack) from [<c011124c>] (handle_IPI+0x358/0x378)
[ 1852.256212] [<c011124c>] (handle_IPI) from [<c01014e0>] (gic_handle_irq+0x9c/0xa0)
[ 1852.263734] [<c01014e0>] (gic_handle_irq) from [<c010e24c>] (__irq_svc+0x6c/0x90)
[ 1852.271165] Exception stack(0xdde57eb0 to 0xdde57ef8)
[ 1852.276183] 7ea0: 004e6190 beffffff 00000055 00000010
[ 1852.284308] 7ec0: ffffe000 00000051 004e6180 80808080 deb6d01c fefefeff 00000ff0 dde57f34
[ 1852.292431] 7ee0: 00000fe0 dde57f00 c04a9fd4 c0aa688c 20000013 ffffffff
[ 1852.299004] [<c010e24c>] (__irq_svc) from [<c0aa688c>] (__get_user_4+0x0/0x20)
[ 1852.306177] CPU1: stopping
[ 1852.308869] CPU: 1 PID: 402 Comm: rs:main Q:Reg Tainted: G D 4.14.95-bpi-r2-main #49
[ 1852.317679] Hardware name: Mediatek Cortex-A7 (Device Tree)
[ 1852.323219] [<c0113358>] (unwind_backtrace) from [<c010d580>] (show_stack+0x20/0x24)
[ 1852.330914] [<c010d580>] (show_stack) from [<c0aa8e18>] (dump_stack+0x94/0xa8)
[ 1852.338092] [<c0aa8e18>] (dump_stack) from [<c011124c>] (handle_IPI+0x358/0x378)
[ 1852.345443] [<c011124c>] (handle_IPI) from [<c01014e0>] (gic_handle_irq+0x9c/0xa0)
[ 1852.352964] [<c01014e0>] (gic_handle_irq) from [<c010e24c>] (__irq_svc+0x6c/0x90)
[ 1852.360395] Exception stack(0xdc0d5da0 to 0xdc0d5de8)
[ 1852.365413] 5da0: c1232c48 a0030013 00000007 00004fbe c1232c48 dec3a000 00000000 00000076
[ 1852.373537] 5dc0: 00000fff dcd36400 dc18a076 dc0d5dfc dc0d5e00 dc0d5df0 c052f398 c0ac2f24
[ 1852.381658] 5de0: 80030013 ffffffff
[ 1852.385127] [<c010e24c>] (__irq_svc) from [<c0ac2f24>] (_raw_spin_unlock_irqrestore+0x30/0x34)
[ 1852.393686] [<c0ac2f24>] (_raw_spin_unlock_irqrestore) from [<c052f398>] (uart_write+0x128/0x194)
[ 1852.402505] [<c052f398>] (uart_write) from [<c0514660>] (n_tty_write+0x1c8/0x454)
[ 1852.409942] [<c0514660>] (n_tty_write) from [<c05103c4>] (tty_write+0x19c/0x378)
[ 1852.417296] [<c05103c4>] (tty_write) from [<c029fd28>] (__vfs_write+0x38/0x130)
[ 1852.424563] [<c029fd28>] (__vfs_write) from [<c029ffb4>] (vfs_write+0xb4/0x178)
[ 1852.431829] [<c029ffb4>] (vfs_write) from [<c02a01a8>] (SyS_write+0x4c/0xa0)
[ 1852.438833] [<c02a01a8>] (SyS_write) from [<c0108c80>] (ret_fast_syscall+0x0/0x54)
[ 1852.446352] CPU3: stopping
[ 1852.449046] CPU: 3 PID: 0 Comm: swapper/3 Tainted: G D 4.14.95-bpi-r2-main #49
[ 1852.457338] Hardware name: Mediatek Cortex-A7 (Device Tree)
[ 1852.462878] [<c0113358>] (unwind_backtrace) from [<c010d580>] (show_stack+0x20/0x24)
[ 1852.470574] [<c010d580>] (show_stack) from [<c0aa8e18>] (dump_stack+0x94/0xa8)
[ 1852.477753] [<c0aa8e18>] (dump_stack) from [<c011124c>] (handle_IPI+0x358/0x378)
[ 1852.485103] [<c011124c>] (handle_IPI) from [<c01014e0>] (gic_handle_irq+0x9c/0xa0)
[ 1852.492625] [<c01014e0>] (gic_handle_irq) from [<c010e24c>] (__irq_svc+0x6c/0x90)
[ 1852.500055] Exception stack(0xde947f38 to 0xde947f80)
[ 1852.505071] 7f20: 00000000 000fa8e8
[ 1852.513195] 7f40: 1e51c000 c011f8e0 ffffe000 c1103ccc c1103c6c c11bc85f c0d2c0e0 00000001
[ 1852.521320] 7f60: 00000000 de947f94 de947f98 de947f88 c01098ac c01098b0 60000013 ffffffff
[ 1852.529447] [<c010e24c>] (__irq_svc) from [<c01098b0>] (arch_cpu_idle+0x48/0x4c)
[ 1852.536799] [<c01098b0>] (arch_cpu_idle) from [<c0ac2d88>] (default_idle_call+0x30/0x3c)
[ 1852.544841] [<c0ac2d88>] (default_idle_call) from [<c016e3b0>] (do_idle+0xec/0x150)
[ 1852.552451] [<c016e3b0>] (do_idle) from [<c016e6b0>] (cpu_startup_entry+0x28/0x2c)
[ 1852.559974] [<c016e6b0>] (cpu_startup_entry) from [<c0110c60>] (secondary_start_kernel+0x170/0x194)
[ 1852.568962] [<c0110c60>] (secondary_start_kernel) from [<801018ec>] (0x801018ec)
[ 1852.576318] ---[ end Kernel panic - not syncing: Fatal exception in interrupt

^ permalink raw reply

* Re: [Patch net-next] mlx5: use RCU lock in mlx5_eq_cq_get()
From: Saeed Mahameed @ 2019-02-06 17:35 UTC (permalink / raw)
  To: netdev@vger.kernel.org, xiyou.wangcong@gmail.com; +Cc: Tariq Toukan
In-Reply-To: <20190206003525.5041-1-xiyou.wangcong@gmail.com>

On Tue, 2019-02-05 at 16:35 -0800, Cong Wang wrote:
> mlx5_eq_cq_get() is called in IRQ handler, the spinlock inside
> gets a lot of contentions when we test some heavy workload
> with 60 RX queues and 80 CPU's, and it is clearly shown in the
> flame graph.
> 
> In fact, radix_tree_lookup() is perfectly fine with RCU read lock,
> we don't have to take a spinlock on this hot path. It is pretty much
> similar to commit 291c566a2891
> ("net/mlx4_core: Fix racy CQ (Completion Queue) free"). Slow paths
> are still serialized with the spinlock, and with synchronize_irq()
> it should be safe to just move the fast path to RCU read lock.
> 
> This patch itself reduces the latency by about 50% with our workload.
> 
> Cc: Saeed Mahameed <saeedm@mellanox.com>
> Cc: Tariq Toukan <tariqt@mellanox.com>
> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>

Acked-by: Saeed Mahameed <saeedm@mellanox.com>


^ permalink raw reply

* Re: [Patch net-next] mlx5: use RCU lock in mlx5_eq_cq_get()
From: Saeed Mahameed @ 2019-02-06 17:35 UTC (permalink / raw)
  To: xiyou.wangcong@gmail.com; +Cc: netdev@vger.kernel.org, Tariq Toukan
In-Reply-To: <CAM_iQpW5GQD8PS1d34tNF5Dfd63pTJDfz_5kJWyqJOOrAMdU7g@mail.gmail.com>

On Wed, 2019-02-06 at 09:15 -0800, Cong Wang wrote:
> On Wed, Feb 6, 2019 at 8:55 AM Saeed Mahameed <saeedm@mellanox.com>
> wrote:
> > Hi Cong,
> > 
> > The patch is ok to me, but i really doubt that you can hit a
> > contention
> > on latest upstream driver, since we already have spinlock per EQ,
> > which
> > means spinlock per core,  each EQ (core) msix handler can only
> > access
> > one spinlock (its own), so I am surprised how you got the
> > contention,
> > Maybe you are not running on latest upstream driver ?
> 
> We are running 4.14 stable release. Which commit changes the game
> here? We can consider to backport it unless it is complicated.
> 

Ok, so there is no issue upstream, you are just missing the following
patch:

commit 02d92f7903647119e125b24f5470f96cee0d4b4b
Author: Saeed Mahameed <saeedm@mellanox.com>
Date:   Fri Jan 19 16:13:01 2018 -0800

    net/mlx5: CQ Database per EQ
    
    Before this patch the driver had one CQ database protected via one
    spinlock, this spinlock is meant to synchronize between CQ
    adding/removing and CQ IRQ interrupt handling.
[...]

> Also, if you don't like this patch, we are happy to carry it for our
> own,
> sometimes it isn't worth the time to push into upstream.

I Do like it and it always worth it to push upstream, we all get to
learn cool new stuff.

> 
> > what is the workload ?
> > 
> 
> It's a memcached RPC performance test, that is all I can tell.

cool, thanks, so the missing commit should fix your issue.

> (Apparently I have almost zero knowledge about memcached.)
> 
> 
> > > > In fact, radix_tree_lookup() is perfectly fine with RCU read
> > > > lock,
> > > > we don't have to take a spinlock on this hot path. It is pretty
> > > > much
> > > > similar to commit 291c566a2891
> > > > ("net/mlx4_core: Fix racy CQ (Completion Queue) free"). Slow
> > > > paths
> > > > are still serialized with the spinlock, and with
> > > > synchronize_irq()
> > > > it should be safe to just move the fast path to RCU read lock.
> > > > 
> > > > This patch itself reduces the latency by about 50% with our
> > > > workload.
> > > > 
> > > > Cc: Saeed Mahameed <saeedm@mellanox.com>
> > > > Cc: Tariq Toukan <tariqt@mellanox.com>
> > > > Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
> > > > ---
> > > >   drivers/net/ethernet/mellanox/mlx5/core/eq.c | 12 ++++++-----
> > > > -
> > > >   1 file changed, 6 insertions(+), 6 deletions(-)
> > > > 
> > > > diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eq.c
> > > > b/drivers/net/ethernet/mellanox/mlx5/core/eq.c
> > > > index ee04aab65a9f..7092457705a2 100644
> > > > --- a/drivers/net/ethernet/mellanox/mlx5/core/eq.c
> > > > +++ b/drivers/net/ethernet/mellanox/mlx5/core/eq.c
> > > > @@ -114,11 +114,11 @@ static struct mlx5_core_cq
> > > > *mlx5_eq_cq_get(struct mlx5_eq *eq, u32 cqn)
> > > >     struct mlx5_cq_table *table = &eq->cq_table;
> > > >     struct mlx5_core_cq *cq = NULL;
> > > > 
> > > > -   spin_lock(&table->lock);
> > > > +   rcu_read_lock();
> > > >     cq = radix_tree_lookup(&table->tree, cqn);
> > > >     if (likely(cq))
> > > >             mlx5_cq_hold(cq);
> > > > -   spin_unlock(&table->lock);
> > > > +   rcu_read_unlock();
> > > 
> > > Thanks for you patch.
> > > 
> > > I think we can improve it further, by taking the if statement out
> > > of
> > > the
> > > critical section.
> > > 
> > 
> > No, mlx5_cq_hold must stay under RCU read, otherwise cq might get
> > freed
> > before the irq gets a change to increment ref count on it.
> > 
> 
> Agreed.
> 

Cool, I will ack the patch.. 

> 
> Thanks.

^ permalink raw reply

* [PATCH 3/3] iw_cxgb4: fix srqidx leak during connection abort
From: Raju Rangoju @ 2019-02-06 17:24 UTC (permalink / raw)
  To: jgg, davem, linux-rdma; +Cc: netdev, swise, rajur
In-Reply-To: <20190206172444.21997-1-rajur@chelsio.com>

When an application aborts the connection by moving QP from RTS to
ERROR, then iw_cxgb4's modify_rc_qp() RTS->ERROR logic sets the
*srqidxp to 0 via t4_set_wq_in_error(&qhp->wq, 0), and aborts the
connection by calling c4iw_ep_disconnect().

c4iw_ep_disconnect() does the following:
 1. sends up a close_complete_upcall(ep, -ECONNRESET) to libcxgb4.
 2. sends abort request CPL to hw.

But, since the close_complete_upcall() is sent before sending the
ABORT_REQ to hw, libcxgb4 would fail to release the srqidx if the
connection holds one. Because, the srqidx is passed up to libcxgb4
only after corresponding ABORT_RPL is processed by kernel in
abort_rpl().

This patch handle the corner-case by moving the call to
close_complete_upcall() from c4iw_ep_disconnect() to abort_rpl().
So that libcxgb4 is notified about the -ECONNRESET only after
abort_rpl(), and libcxgb4 can relinquish the srqidx properly.

Signed-off-by: Raju Rangoju <rajur@chelsio.com>
---
 drivers/infiniband/hw/cxgb4/cm.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c
index 7aca5d73c19e..f45044d8de4d 100644
--- a/drivers/infiniband/hw/cxgb4/cm.c
+++ b/drivers/infiniband/hw/cxgb4/cm.c
@@ -1941,8 +1941,10 @@ static int abort_rpl(struct c4iw_dev *dev, struct sk_buff *skb)
 	}
 	mutex_unlock(&ep->com.mutex);
 
-	if (release)
+	if (release) {
+		close_complete_upcall(ep, -ECONNRESET);
 		release_ep_resources(ep);
+	}
 	c4iw_put_ep(&ep->com);
 	return 0;
 }
@@ -3675,7 +3677,6 @@ int c4iw_ep_disconnect(struct c4iw_ep *ep, int abrupt, gfp_t gfp)
 	if (close) {
 		if (abrupt) {
 			set_bit(EP_DISC_ABORT, &ep->com.history);
-			close_complete_upcall(ep, -ECONNRESET);
 			ret = send_abort(ep);
 		} else {
 			set_bit(EP_DISC_CLOSE, &ep->com.history);
-- 
2.13.0


^ permalink raw reply related

* [PATCH 2/3] iw_cxgb4: complete the cached SRQ buffers
From: Raju Rangoju @ 2019-02-06 17:24 UTC (permalink / raw)
  To: jgg, davem, linux-rdma; +Cc: netdev, swise, rajur
In-Reply-To: <20190206172444.21997-1-rajur@chelsio.com>

If TP fetches an SRQ buffer but ends up not using it before the
connection is aborted, then it passes the index of that SRQ
buffer to the host in ABORT_REQ_RSS or ABORT_RPL CPL message.

But, if the srqidx field is zero in the received ABORT_RPL or
ABORT_REQ_RSS CPL, then we need to read the tcb.rq_start field
to see if it really did have an RQE cached. This works around a
case where HW does not include the srqidx in the
ABORT_RPL/ABORT_REQ_RSS CPL.

The final value of rq_start is the one present in TCB with the
TF_RX_PDU_OUT bit cleared. So, we need to read the TCB, examine
the TF_RX_PDU_OUT (bit 49 of t_flags) in order to determine if
there's a rx PDU feedback event pending.

Signed-off-by: Raju Rangoju <rajur@chelsio.com>
---
 drivers/infiniband/hw/cxgb4/cm.c       | 161 +++++++++++++++++++++++++++++++--
 drivers/infiniband/hw/cxgb4/iw_cxgb4.h |   3 +
 drivers/infiniband/hw/cxgb4/t4.h       |   1 +
 3 files changed, 157 insertions(+), 8 deletions(-)

diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c
index 8221813219e5..7aca5d73c19e 100644
--- a/drivers/infiniband/hw/cxgb4/cm.c
+++ b/drivers/infiniband/hw/cxgb4/cm.c
@@ -655,7 +655,33 @@ static int send_halfclose(struct c4iw_ep *ep)
 	return c4iw_l2t_send(&ep->com.dev->rdev, skb, ep->l2t);
 }
 
-static int send_abort(struct c4iw_ep *ep)
+void read_tcb(struct c4iw_ep *ep)
+{
+	struct sk_buff *skb;
+	struct cpl_get_tcb *req;
+	int wrlen = roundup(sizeof(*req), 16);
+
+	skb = get_skb(NULL, sizeof(*req), GFP_KERNEL);
+	if (WARN_ON(!skb))
+		return;
+
+	set_wr_txq(skb, CPL_PRIORITY_CONTROL, ep->ctrlq_idx);
+	req = (struct cpl_get_tcb *) skb_put(skb, wrlen);
+	memset(req, 0, wrlen);
+	INIT_TP_WR(req, ep->hwtid);
+	OPCODE_TID(req) = cpu_to_be32(MK_OPCODE_TID(CPL_GET_TCB, ep->hwtid));
+	req->reply_ctrl = htons(REPLY_CHAN_V(0) | QUEUENO_V(ep->rss_qid));
+
+	/*
+	 * keep a ref on the ep so the tcb is not unlocked before this
+	 * cpl completes. The ref is released in read_tcb_rpl().
+	 */
+	c4iw_get_ep(&ep->com);
+	if (WARN_ON(c4iw_ofld_send(&ep->com.dev->rdev, skb)))
+		c4iw_put_ep(&ep->com);
+}
+
+static int send_abort_req(struct c4iw_ep *ep)
 {
 	u32 wrlen = roundup(sizeof(struct cpl_abort_req), 16);
 	struct sk_buff *req_skb = skb_dequeue(&ep->com.ep_skb_list);
@@ -670,6 +696,17 @@ static int send_abort(struct c4iw_ep *ep)
 	return c4iw_l2t_send(&ep->com.dev->rdev, req_skb, ep->l2t);
 }
 
+static int send_abort(struct c4iw_ep *ep)
+{
+	if (!ep->com.qp || !ep->com.qp->srq) {
+		send_abort_req(ep);
+		return 0;
+	}
+	set_bit(ABORT_REQ_IN_PROGRESS, &ep->com.flags);
+	read_tcb(ep);
+	return 0;
+}
+
 static int send_connect(struct c4iw_ep *ep)
 {
 	struct cpl_act_open_req *req = NULL;
@@ -1851,14 +1888,11 @@ static int rx_data(struct c4iw_dev *dev, struct sk_buff *skb)
 	return 0;
 }
 
-static void complete_cached_srq_buffers(struct c4iw_ep *ep,
-					__be32 srqidx_status)
+static void complete_cached_srq_buffers(struct c4iw_ep *ep, u32 srqidx)
 {
 	enum chip_type adapter_type;
-	u32 srqidx;
 
 	adapter_type = ep->com.dev->rdev.lldi.adapter_type;
-	srqidx = ABORT_RSS_SRQIDX_G(be32_to_cpu(srqidx_status));
 
 	/*
 	 * If this TCB had a srq buffer cached, then we must complete
@@ -1876,6 +1910,7 @@ static void complete_cached_srq_buffers(struct c4iw_ep *ep,
 
 static int abort_rpl(struct c4iw_dev *dev, struct sk_buff *skb)
 {
+	u32 srqidx;
 	struct c4iw_ep *ep;
 	struct cpl_abort_rpl_rss6 *rpl = cplhdr(skb);
 	int release = 0;
@@ -1887,7 +1922,10 @@ static int abort_rpl(struct c4iw_dev *dev, struct sk_buff *skb)
 		return 0;
 	}
 
-	complete_cached_srq_buffers(ep, rpl->srqidx_status);
+	if (ep->com.qp && ep->com.qp->srq) {
+		srqidx = ABORT_RSS_SRQIDX_G(be32_to_cpu(rpl->srqidx_status));
+		complete_cached_srq_buffers(ep, srqidx ? srqidx : ep->srqe_idx);
+	}
 
 	pr_debug("ep %p tid %u\n", ep, ep->hwtid);
 	mutex_lock(&ep->com.mutex);
@@ -2740,6 +2778,21 @@ static int peer_close(struct c4iw_dev *dev, struct sk_buff *skb)
 	return 0;
 }
 
+static void finish_peer_abort(struct c4iw_dev *dev, struct c4iw_ep *ep)
+{
+	complete_cached_srq_buffers(ep, ep->srqe_idx);
+	if (ep->com.cm_id && ep->com.qp) {
+		struct c4iw_qp_attributes attrs;
+
+		attrs.next_state = C4IW_QP_STATE_ERROR;
+		c4iw_modify_qp(ep->com.qp->rhp, ep->com.qp,
+			       C4IW_QP_ATTR_NEXT_STATE,	&attrs, 1);
+	}
+	peer_abort_upcall(ep);
+	release_ep_resources(ep);
+	c4iw_put_ep(&ep->com);
+}
+
 static int peer_abort(struct c4iw_dev *dev, struct sk_buff *skb)
 {
 	struct cpl_abort_req_rss6 *req = cplhdr(skb);
@@ -2750,6 +2803,7 @@ static int peer_abort(struct c4iw_dev *dev, struct sk_buff *skb)
 	int release = 0;
 	unsigned int tid = GET_TID(req);
 	u8 status;
+	u32 srqidx;
 
 	u32 len = roundup(sizeof(struct cpl_abort_rpl), 16);
 
@@ -2769,8 +2823,6 @@ static int peer_abort(struct c4iw_dev *dev, struct sk_buff *skb)
 		goto deref_ep;
 	}
 
-	complete_cached_srq_buffers(ep, req->srqidx_status);
-
 	pr_debug("ep %p tid %u state %u\n", ep, ep->hwtid,
 		 ep->com.state);
 	set_bit(PEER_ABORT, &ep->com.history);
@@ -2819,6 +2871,23 @@ static int peer_abort(struct c4iw_dev *dev, struct sk_buff *skb)
 		stop_ep_timer(ep);
 		/*FALLTHROUGH*/
 	case FPDU_MODE:
+		if (ep->com.qp && ep->com.qp->srq) {
+			srqidx = ABORT_RSS_SRQIDX_G(
+					be32_to_cpu(req->srqidx_status));
+			if (srqidx) {
+				complete_cached_srq_buffers(ep,
+							    req->srqidx_status);
+			} else {
+				/* Hold ep ref until finish_peer_abort() */
+				c4iw_get_ep(&ep->com);
+				__state_set(&ep->com, ABORTING);
+				set_bit(PEER_ABORT_IN_PROGRESS, &ep->com.flags);
+				read_tcb(ep);
+				break;
+
+			}
+		}
+
 		if (ep->com.cm_id && ep->com.qp) {
 			attrs.next_state = C4IW_QP_STATE_ERROR;
 			ret = c4iw_modify_qp(ep->com.qp->rhp,
@@ -3717,6 +3786,80 @@ static void passive_ofld_conn_reply(struct c4iw_dev *dev, struct sk_buff *skb,
 	return;
 }
 
+static inline u64 t4_tcb_get_field64(__be64 *tcb, u16 word)
+{
+	u64 tlo = be64_to_cpu(tcb[((31 - word) / 2)]);
+	u64 thi = be64_to_cpu(tcb[((31 - word) / 2) - 1]);
+	u64 t;
+	u32 shift = 32;
+
+	t = (thi << shift) | (tlo >> shift);
+
+	return t;
+}
+
+static inline u32 t4_tcb_get_field32(__be64 *tcb, u16 word, u32 mask, u32 shift)
+{
+	u32 v;
+	u64 t = be64_to_cpu(tcb[(31 - word) / 2]);
+
+	if (word & 0x1)
+		shift += 32;
+	v = (t >> shift) & mask;
+	return v;
+}
+
+static int read_tcb_rpl(struct c4iw_dev *dev, struct sk_buff *skb)
+{
+	struct cpl_get_tcb_rpl *rpl = cplhdr(skb);
+	__be64 *tcb = (__be64 *)(rpl + 1);
+	unsigned int tid = GET_TID(rpl);
+	struct c4iw_ep *ep;
+	u64 t_flags_64;
+	u32 rx_pdu_out;
+
+	ep = get_ep_from_tid(dev, tid);
+	if (!ep)
+		return 0;
+	/* Examine the TF_RX_PDU_OUT (bit 49 of the t_flags) in order to
+	 * determine if there's a rx PDU feedback event pending.
+	 *
+	 * If that bit is set, it means we'll need to re-read the TCB's
+	 * rq_start value. The final value is the one present in a TCB
+	 * with the TF_RX_PDU_OUT bit cleared.
+	 */
+
+	t_flags_64 = t4_tcb_get_field64(tcb, TCB_T_FLAGS_W);
+	rx_pdu_out = (t_flags_64 & TF_RX_PDU_OUT_V(1)) >> TF_RX_PDU_OUT_S;
+
+	c4iw_put_ep(&ep->com); /* from get_ep_from_tid() */
+	c4iw_put_ep(&ep->com); /* from read_tcb() */
+
+	/* If TF_RX_PDU_OUT bit is set, re-read the TCB */
+	if (rx_pdu_out) {
+		if (++ep->rx_pdu_out_cnt >= 2) {
+			WARN_ONCE(1, "tcb re-read() reached the guard limit, finishing the cleanup\n");
+			goto cleanup;
+		}
+		read_tcb(ep);
+		return 0;
+	}
+
+	ep->srqe_idx = t4_tcb_get_field32(tcb, TCB_RQ_START_W, TCB_RQ_START_W,
+			TCB_RQ_START_S);
+cleanup:
+	pr_debug("ep %p tid %u %016x\n", ep, ep->hwtid, ep->srqe_idx);
+
+	if (test_bit(PEER_ABORT_IN_PROGRESS, &ep->com.flags))
+		finish_peer_abort(dev, ep);
+	else if (test_bit(ABORT_REQ_IN_PROGRESS, &ep->com.flags))
+		send_abort_req(ep);
+	else
+		WARN_ONCE(1, "unexpected state!");
+
+	return 0;
+}
+
 static int deferred_fw6_msg(struct c4iw_dev *dev, struct sk_buff *skb)
 {
 	struct cpl_fw6_msg *rpl = cplhdr(skb);
@@ -4037,6 +4180,7 @@ static c4iw_handler_func work_handlers[NUM_CPL_CMDS + NUM_FAKE_CPLS] = {
 	[CPL_CLOSE_CON_RPL] = close_con_rpl,
 	[CPL_RDMA_TERMINATE] = terminate,
 	[CPL_FW4_ACK] = fw4_ack,
+	[CPL_GET_TCB_RPL] = read_tcb_rpl,
 	[CPL_FW6_MSG] = deferred_fw6_msg,
 	[CPL_RX_PKT] = rx_pkt,
 	[FAKE_CPL_PUT_EP_SAFE] = _put_ep_safe,
@@ -4268,6 +4412,7 @@ c4iw_handler_func c4iw_handlers[NUM_CPL_CMDS] = {
 	[CPL_RDMA_TERMINATE] = sched,
 	[CPL_FW4_ACK] = sched,
 	[CPL_SET_TCB_RPL] = set_tcb_rpl,
+	[CPL_GET_TCB_RPL] = sched,
 	[CPL_FW6_MSG] = fw6_msg,
 	[CPL_RX_PKT] = sched
 };
diff --git a/drivers/infiniband/hw/cxgb4/iw_cxgb4.h b/drivers/infiniband/hw/cxgb4/iw_cxgb4.h
index f0fceadd0d12..3a0923f7c60e 100644
--- a/drivers/infiniband/hw/cxgb4/iw_cxgb4.h
+++ b/drivers/infiniband/hw/cxgb4/iw_cxgb4.h
@@ -982,6 +982,9 @@ struct c4iw_ep {
 	int rcv_win;
 	u32 snd_wscale;
 	struct c4iw_ep_stats stats;
+	u32 srqe_idx;
+	u32 rx_pdu_out_cnt;
+	struct sk_buff *peer_abort_skb;
 };
 
 static inline struct c4iw_ep *to_ep(struct iw_cm_id *cm_id)
diff --git a/drivers/infiniband/hw/cxgb4/t4.h b/drivers/infiniband/hw/cxgb4/t4.h
index fff6d48d262f..b170817b2741 100644
--- a/drivers/infiniband/hw/cxgb4/t4.h
+++ b/drivers/infiniband/hw/cxgb4/t4.h
@@ -35,6 +35,7 @@
 #include "t4_regs.h"
 #include "t4_values.h"
 #include "t4_msg.h"
+#include "t4_tcb.h"
 #include "t4fw_ri_api.h"
 
 #define T4_MAX_NUM_PD 65536
-- 
2.13.0


^ permalink raw reply related

* [PATCH 1/3] cxgb4: add tcb flags and tcb rpl struct
From: Raju Rangoju @ 2019-02-06 17:24 UTC (permalink / raw)
  To: jgg, davem, linux-rdma; +Cc: netdev, swise, rajur
In-Reply-To: <20190206172444.21997-1-rajur@chelsio.com>

This patch adds the tcb flags and structures needed for querying tcb
information.

Signed-off-by: Raju Rangoju <rajur@chelsio.com>
---
 drivers/net/ethernet/chelsio/cxgb4/t4_msg.h |  8 ++++++++
 drivers/net/ethernet/chelsio/cxgb4/t4_tcb.h | 12 ++++++++++++
 2 files changed, 20 insertions(+)

diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4_msg.h b/drivers/net/ethernet/chelsio/cxgb4/t4_msg.h
index c62a0c830705..38dd41eb959e 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/t4_msg.h
+++ b/drivers/net/ethernet/chelsio/cxgb4/t4_msg.h
@@ -56,6 +56,7 @@ enum {
 	CPL_TX_DATA_ISO	      = 0x1F,
 
 	CPL_CLOSE_LISTSRV_RPL = 0x20,
+	CPL_GET_TCB_RPL       = 0x22,
 	CPL_L2T_WRITE_RPL     = 0x23,
 	CPL_PASS_OPEN_RPL     = 0x24,
 	CPL_ACT_OPEN_RPL      = 0x25,
@@ -688,6 +689,13 @@ struct cpl_get_tcb {
 #define NO_REPLY_V(x) ((x) << NO_REPLY_S)
 #define NO_REPLY_F    NO_REPLY_V(1U)
 
+struct cpl_get_tcb_rpl {
+	union opcode_tid ot;
+	__u8 cookie;
+	__u8 status;
+	__be16 len;
+};
+
 struct cpl_set_tcb_field {
 	WR_HDR;
 	union opcode_tid ot;
diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4_tcb.h b/drivers/net/ethernet/chelsio/cxgb4/t4_tcb.h
index 3297ce025e8b..1b9afb192f7f 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/t4_tcb.h
+++ b/drivers/net/ethernet/chelsio/cxgb4/t4_tcb.h
@@ -41,6 +41,14 @@
 #define TCB_SMAC_SEL_V(x)	((x) << TCB_SMAC_SEL_S)
 
 #define TCB_T_FLAGS_W		1
+#define TCB_T_FLAGS_S		0
+#define TCB_T_FLAGS_M		0xffffffffffffffffULL
+#define TCB_T_FLAGS_V(x)	((__u64)(x) << TCB_T_FLAGS_S)
+
+#define TCB_RQ_START_W		30
+#define TCB_RQ_START_S		0
+#define TCB_RQ_START_M		0x3ffffffULL
+#define TCB_RQ_START_V(x)	((x) << TCB_RQ_START_S)
 
 #define TF_CCTRL_ECE_S		60
 #define TF_CCTRL_CWR_S		61
@@ -66,4 +74,8 @@
 #define TCB_RX_FRAG3_LEN_RAW_W	29
 #define TCB_RX_FRAG3_START_IDX_OFFSET_RAW_W	30
 #define TCB_PDU_HDR_LEN_W	31
+
+#define TF_RX_PDU_OUT_S		49
+#define TF_RX_PDU_OUT_V(x)	((__u64)(x) << TF_RX_PDU_OUT_S)
+
 #endif /* __T4_TCB_H */
-- 
2.13.0


^ permalink raw reply related

* [PATCH 0/3] iw_cxgb4: add support for completing cached SRQ buffers
From: Raju Rangoju @ 2019-02-06 17:24 UTC (permalink / raw)
  To: jgg, davem, linux-rdma; +Cc: netdev, swise, rajur

This series adds support for completing the SRQ buffers that were
fetched but could not be completed by hw due to connection aborts,
also fixes the potential srqidx leak during the connection abort.

This series has both net(cxgb4) and rdma(iw_cxgb4) changes,
and I would request this merge via rdma repo.

I have made sure this series applies cleanly on both net-next
and rdma-for-next and doesn't cause any merge conflicts.

Raju Rangoju (3):
  cxgb4: add tcb flags and tcb rpl struct
  iw_cxgb4: complete the cached SRQ buffers
  iw_cxgb4: fix srqidx leak during connection abort

 drivers/infiniband/hw/cxgb4/cm.c            | 166 ++++++++++++++++++++++++++--
 drivers/infiniband/hw/cxgb4/iw_cxgb4.h      |   3 +
 drivers/infiniband/hw/cxgb4/t4.h            |   1 +
 drivers/net/ethernet/chelsio/cxgb4/t4_msg.h |   8 ++
 drivers/net/ethernet/chelsio/cxgb4/t4_tcb.h |  12 ++
 5 files changed, 180 insertions(+), 10 deletions(-)

-- 
2.13.0


^ permalink raw reply

* Re: [PATCH net-next 5/6] net: marvell: neta: add comphy support
From: Russell King - ARM Linux admin @ 2019-02-06 17:23 UTC (permalink / raw)
  To: Maxime Chevallier
  Cc: Andrew Lunn, Gregory Clement, Jason Cooper,
	Kishon Vijay Abraham I, Sebastian Hesselbarth, Thomas Petazzoni,
	devicetree, linux-arm-kernel, netdev, David S. Miller
In-Reply-To: <20190206160928.56fb4808@bootlin.com>

On Wed, Feb 06, 2019 at 04:09:28PM +0100, Maxime Chevallier wrote:
> Hello Russell,
> 
> On Wed, 06 Feb 2019 11:35:07 +0000
> Russell King <rmk+kernel@armlinux.org.uk> wrote:
> 
> 
> >+	if (pp->comphy) {
> >+		enum phy_mode mode = PHY_MODE_INVALID;
> >+
> >+		switch (state->interface) {
> >+		case PHY_INTERFACE_MODE_SGMII:
> >+		case PHY_INTERFACE_MODE_1000BASEX:
> >+			mode = PHY_MODE_SGMII;
> 
> PHY_MODE_SGMII no longer exists, the new PHY_MODE_ETHERNET must be used
> with the correct submode now, so this doesn't build unfortunately.
> 
> >+			break;
> >+		case PHY_INTERFACE_MODE_2500BASEX:
> >+			mode = PHY_MODE_2500SGMII;
> 
> Same here.

Of course, I knew there was some reason I hadn't sent them yet... thanks
for spotting.

-- 
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 iproute2-next v5] devlink: add info subcommand
From: David Ahern @ 2019-02-06 17:20 UTC (permalink / raw)
  To: Jakub Kicinski, jiri; +Cc: stephen, netdev, oss-drivers
In-Reply-To: <20190204161011.7808-1-jakub.kicinski@netronome.com>

On 2/4/19 8:10 AM, Jakub Kicinski wrote:
> Add support for reading the device serial number, driver name
> and various versions.  Example:
> 
> $ devlink dev info pci/0000:82:00.0
> pci/0000:82:00.0:
>   driver nfp
>   serial_number 16240145
>   versions:
>       fixed:
>         board.id AMDA0081-0001
>         board.rev 15
>         board.vendor SMA
>         board.model hydrogen
>       running:
>         fw.mgmt 010181.010181.0101d4
>         fw.cpld 0x1030000
>         fw.app abm-d372b6
>         fw.undi 0.0.2
>         chip.init AMDA-0081-0001  20160318164536
>       stored:
>         fw.mgmt 010181.010181.0101d4
>         fw.app abm-d372b6
>         fw.undi 0.0.2
>         chip.init AMDA-0081-0001  20160318164536
> 
> $ devlink -jp dev info pci/0000:82:00.0
> {
>     "info": {
>         "pci/0000:82:00.0": {
>             "driver": "nfp",
>             "serial_number": "16240145",
>             "versions": {
>                 "fixed": {
>                     "board.id": "AMDA0081-0001",
>                     "board.rev": "15",
>                     "board.vendor": "SMA",
>                     "board.model": "hydrogen"
>                 },
>                 "running": {
>                     "fw.mgmt": "010181.010181.0101d4",
>                     "fw.cpld": "0x1030000",
>                     "fw.app": "abm-d372b6",
>                     "fw.undi": "0.0.2",
>                     "chip.init": "AMDA-0081-0001  20160318164536"
>                 },
>                 "stored": {
>                     "fw.mgmt": "010181.010181.0101d4",
>                     "fw.app": "abm-d372b6",
>                     "fw.undi": "0.0.2",
>                     "chip.init": "AMDA-0081-0001  20160318164536"
>                 }
>             }
>         }
>     }
> }
> 
> v5:
>  - remove spurious new line.
> v4:
>  - more commit message improvements.
> v3:
>  - show up-to-date output in the commit message.
> v2 (Jiri):
>  - remove filtering;
>  - add example in the commit message.
> RFCv2:
>  - make info subcommand of dev.
> 
> Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
> ---
>  devlink/devlink.c      | 171 +++++++++++++++++++++++++++++++++++++++++
>  man/man8/devlink-dev.8 |  26 +++++++
>  2 files changed, 197 insertions(+)
> 
applied to iproute2-next.
Thanks for adding the example output


^ permalink raw reply

* Re: [PATCH iproute2-next v3] devlink: report cell size
From: David Ahern @ 2019-02-06 17:19 UTC (permalink / raw)
  To: Jakub Kicinski, idosch, jiri; +Cc: stephen, oss-drivers, netdev
In-Reply-To: <20190204152859.6667-1-jakub.kicinski@netronome.com>

On 2/4/19 7:28 AM, Jakub Kicinski wrote:
> Print the value of DEVLINK_ATTR_SB_POOL_CELL_SIZE, if reported.
> 
> Example:
> pci/0000:82:00.0:
>   sb 1 pool 0 type egress size 40945664 thtype static cell_size 2048
>   sb 2 pool 0 type egress size 258867200 thtype static cell_size 10240
> ...
> 
> v3: - don't double space.
> v2: - fix spelling.
> 
> Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
> Reviewed-by: Quentin Monnet <quentin.monnet@netronome.com>
> ---
>  devlink/devlink.c     |  3 +++
>  man/man8/devlink-sb.8 | 10 ++++++++++
>  2 files changed, 13 insertions(+)

applied to iproute2-next. Thanks

^ 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