All of lore.kernel.org
 help / color / mirror / Atom feed
* [pull request][net-next 00/15] Mellanox, mlx5 updates 2017-08-17
@ 2017-08-17 13:29 Saeed Mahameed
  2017-08-17 13:29 ` [net-next 01/15] net/mlx5e: Send PAOS command on interface up/down Saeed Mahameed
                   ` (14 more replies)
  0 siblings, 15 replies; 21+ messages in thread
From: Saeed Mahameed @ 2017-08-17 13:29 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Leon Romanovsky, Saeed Mahameed

Hi Dave,

Tthe following changes provide updates for mlx5 ethernet and IPoIB
netdevice driver.

For more details please see tag log message below.
Please pull and let me know if there's any problem.

Thanks,
Saeed.

---

The following changes since commit f03b488b2fb1af20a290509b1ed25db08391b4e7:

  Merge branch 'vmbus-sendpacket-cleanups' (2017-08-16 16:27:45 -0700)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux.git tags/mlx5-updates-2017-08-17

for you to fetch changes up to 9a1ceef8a42cb90406b6adc620e63e9a11e04dbb:

  net/mlx5e: Use size_t to store byte offset in statistics descriptors (2017-08-17 15:57:15 +0300)

----------------------------------------------------------------
mlx5-updates-2017-08-17

Some updates for mlx5 ethernet and IPoIB device driver.

Eran added the support for manage physical link state from netdevice upon
interface open/close requests.

Feras fixed the driver name showed in ethtool for IPoIB interfaces.
Shalom Added the support for IPoIB netdevice ethtool get link settings.

Gal and Eran exposed new diagnostic counters for outbound PCIe stalls and overflow
and RX buffer fullness statistics.

Code cleanups from Or Gerlitz.
Variable types cleanup from Gal.

Thanks,
Saeed.

----------------------------------------------------------------
Eran Ben Elisha (2):
      net/mlx5e: Send PAOS command on interface up/down
      net/mlx5e: Add outbound PCI buffer overflow counter

Feras Daoud (1):
      net/mlx5e: IPoIB, Fix driver name retrieved by ethtool

Gal Pressman (6):
      net/mlx5: Add PCIe outbound stalls counters infrastructure
      net/mlx5e: Add PCIe outbound stalls counters
      net/mlx5: Add RX buffer fullness counters infrastructure
      net/mlx5e: Add RX buffer fullness counters
      net/mlx5e: Use kernel types instead of uint*_t in ethtool callbacks
      net/mlx5e: Use size_t to store byte offset in statistics descriptors

Or Gerlitz (5):
      net/mlx5: Avoid blank lines after/before open/close brace
      net/mlx5: Add a blank line after declarations
      net/mlx5e: Properly indent within conditional statements
      net/mlx5e: Avoid using multiple blank lines
      net/mlx5e: Place constants on the right side of comparisons

Shalom Lagziel (1):
      net/mlx5e: IPoIB, Add support for get_link_ksettings in ethtool

 drivers/net/ethernet/mellanox/mlx5/core/alloc.c    |   1 +
 drivers/net/ethernet/mellanox/mlx5/core/cmd.c      |   1 -
 .../net/ethernet/mellanox/mlx5/core/en_ethtool.c   |  55 ++++++---
 drivers/net/ethernet/mellanox/mlx5/core/en_main.c  |  13 ++
 drivers/net/ethernet/mellanox/mlx5/core/en_rep.c   |  20 +--
 drivers/net/ethernet/mellanox/mlx5/core/en_rx.c    |   4 +-
 drivers/net/ethernet/mellanox/mlx5/core/en_stats.h |  46 ++++++-
 drivers/net/ethernet/mellanox/mlx5/core/eq.c       |   1 +
 .../ethernet/mellanox/mlx5/core/ipoib/ethtool.c    | 135 ++++++++++++++++++---
 drivers/net/ethernet/mellanox/mlx5/core/main.c     |   1 -
 drivers/net/ethernet/mellanox/mlx5/core/sriov.c    |   1 -
 include/linux/mlx5/mlx5_ifc.h                      |  34 +++++-
 12 files changed, 261 insertions(+), 51 deletions(-)

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [net-next 01/15] net/mlx5e: Send PAOS command on interface up/down
  2017-08-17 13:29 [pull request][net-next 00/15] Mellanox, mlx5 updates 2017-08-17 Saeed Mahameed
@ 2017-08-17 13:29 ` Saeed Mahameed
  2017-08-17 13:29 ` [net-next 02/15] net/mlx5e: IPoIB, Fix driver name retrieved by ethtool Saeed Mahameed
                   ` (13 subsequent siblings)
  14 siblings, 0 replies; 21+ messages in thread
From: Saeed Mahameed @ 2017-08-17 13:29 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Leon Romanovsky, Eran Ben Elisha, Saeed Mahameed

From: Eran Ben Elisha <eranbe@mellanox.com>

Upon interface up/down, driver will send POAS (Ports Administrative and
Operational Status Register) in order to inform the Firmware on the
desired status of the port by the driver.

Since now we might change physical link status on mlx5e_open/close,
logical VF representor should not use mlx5e_open/close ndos as is, and
should call the logical version mlx5e_open/closed_locked.

Signed-off-by: Eran Ben Elisha <eranbe@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en_main.c |  7 +++++++
 drivers/net/ethernet/mellanox/mlx5/core/en_rep.c  | 20 +++++++++++++-------
 2 files changed, 20 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index 8633ca5af6ed..6921c6fe3087 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -2682,6 +2682,8 @@ int mlx5e_open(struct net_device *netdev)
 
 	mutex_lock(&priv->state_lock);
 	err = mlx5e_open_locked(netdev);
+	if (!err)
+		mlx5_set_port_admin_status(priv->mdev, MLX5_PORT_UP);
 	mutex_unlock(&priv->state_lock);
 
 	return err;
@@ -2716,6 +2718,7 @@ int mlx5e_close(struct net_device *netdev)
 		return -ENODEV;
 
 	mutex_lock(&priv->state_lock);
+	mlx5_set_port_admin_status(priv->mdev, MLX5_PORT_DOWN);
 	err = mlx5e_close_locked(netdev);
 	mutex_unlock(&priv->state_lock);
 
@@ -4187,6 +4190,10 @@ static void mlx5e_nic_enable(struct mlx5e_priv *priv)
 
 	mlx5e_init_l2_addr(priv);
 
+	/* Marking the link as currently not needed by the Driver */
+	if (!netif_running(netdev))
+		mlx5_set_port_admin_status(mdev, MLX5_PORT_DOWN);
+
 	/* MTU range: 68 - hw-specific max */
 	netdev->min_mtu = ETH_MIN_MTU;
 	mlx5_query_port_max_mtu(priv->mdev, &max_mtu, 1);
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
index f34c00fbf78c..5e0f2d234ace 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
@@ -613,15 +613,18 @@ static int mlx5e_rep_open(struct net_device *dev)
 	struct mlx5_eswitch *esw = priv->mdev->priv.eswitch;
 	int err;
 
-	err = mlx5e_open(dev);
+	mutex_lock(&priv->state_lock);
+	err = mlx5e_open_locked(dev);
 	if (err)
-		return err;
+		goto unlock;
 
-	err = mlx5_eswitch_set_vport_state(esw, rep->vport, MLX5_ESW_VPORT_ADMIN_STATE_UP);
-	if (!err)
+	if (!mlx5_eswitch_set_vport_state(esw, rep->vport,
+					  MLX5_ESW_VPORT_ADMIN_STATE_UP))
 		netif_carrier_on(dev);
 
-	return 0;
+unlock:
+	mutex_unlock(&priv->state_lock);
+	return err;
 }
 
 static int mlx5e_rep_close(struct net_device *dev)
@@ -630,10 +633,13 @@ static int mlx5e_rep_close(struct net_device *dev)
 	struct mlx5e_rep_priv *rpriv = priv->ppriv;
 	struct mlx5_eswitch_rep *rep = rpriv->rep;
 	struct mlx5_eswitch *esw = priv->mdev->priv.eswitch;
+	int ret;
 
+	mutex_lock(&priv->state_lock);
 	(void)mlx5_eswitch_set_vport_state(esw, rep->vport, MLX5_ESW_VPORT_ADMIN_STATE_DOWN);
-
-	return mlx5e_close(dev);
+	ret = mlx5e_close_locked(dev);
+	mutex_unlock(&priv->state_lock);
+	return ret;
 }
 
 static int mlx5e_rep_get_phys_port_name(struct net_device *dev,
-- 
2.13.0

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [net-next 02/15] net/mlx5e: IPoIB, Fix driver name retrieved by ethtool
  2017-08-17 13:29 [pull request][net-next 00/15] Mellanox, mlx5 updates 2017-08-17 Saeed Mahameed
  2017-08-17 13:29 ` [net-next 01/15] net/mlx5e: Send PAOS command on interface up/down Saeed Mahameed
@ 2017-08-17 13:29 ` Saeed Mahameed
  2017-08-17 13:29 ` [net-next 03/15] net/mlx5e: IPoIB, Add support for get_link_ksettings in ethtool Saeed Mahameed
                   ` (12 subsequent siblings)
  14 siblings, 0 replies; 21+ messages in thread
From: Saeed Mahameed @ 2017-08-17 13:29 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Leon Romanovsky, Feras Daoud, Saeed Mahameed

From: Feras Daoud <ferasda@mellanox.com>

Printing an enhanced IPoIB device information using
"ethtool -i DEVNAME", prints the low level driver name: mlx5_core.
This commit changes the name to mlx5_core [ib_ipoib], to include the
ipoib device driver infromation.

Fixes: 076b0936e5fb ("net/mlx5e: IPoIB, Add ethtool support")
Signed-off-by: Feras Daoud <ferasda@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/ipoib/ethtool.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ethtool.c b/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ethtool.c
index eb04e97d8765..b080fabfe8de 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ethtool.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ethtool.c
@@ -39,6 +39,8 @@ static void mlx5i_get_drvinfo(struct net_device *dev,
 	struct mlx5e_priv *priv = mlx5i_epriv(dev);
 
 	mlx5e_ethtool_get_drvinfo(priv, drvinfo);
+	strlcpy(drvinfo->driver, DRIVER_NAME "[ib_ipoib]",
+		sizeof(drvinfo->driver));
 }
 
 static void mlx5i_get_strings(struct net_device *dev,
-- 
2.13.0

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [net-next 03/15] net/mlx5e: IPoIB, Add support for get_link_ksettings in ethtool
  2017-08-17 13:29 [pull request][net-next 00/15] Mellanox, mlx5 updates 2017-08-17 Saeed Mahameed
  2017-08-17 13:29 ` [net-next 01/15] net/mlx5e: Send PAOS command on interface up/down Saeed Mahameed
  2017-08-17 13:29 ` [net-next 02/15] net/mlx5e: IPoIB, Fix driver name retrieved by ethtool Saeed Mahameed
@ 2017-08-17 13:29 ` Saeed Mahameed
  2017-08-17 13:29 ` [net-next 04/15] net/mlx5: Add PCIe outbound stalls counters infrastructure Saeed Mahameed
                   ` (11 subsequent siblings)
  14 siblings, 0 replies; 21+ messages in thread
From: Saeed Mahameed @ 2017-08-17 13:29 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Leon Romanovsky, Shalom Lagziel, Saeed Mahameed

From: Shalom Lagziel <shaloml@mellanox.com>

Add support for "ethtool DEVNAME" over ipoib ports,
Display standard port information for IPoIB netdevices using ethtool
For example:
$ ethtool ib2
> Settings for ib2:
        Supported ports: [ ]
        Supported link modes:   Not reported
        Supported pause frame use: No
        Supports auto-negotiation: No
        Advertised link modes:  Not reported
        Advertised pause frame use: No
        Advertised auto-negotiation: No
        Speed: 100000Mb/s
        Duplex: Full
        Port: Other
        PHYAD: 0
        Transceiver: internal
        Auto-negotiation: off
        Link detected: yes

Signed-off-by: Shalom Lagziel <shaloml@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 .../ethernet/mellanox/mlx5/core/ipoib/ethtool.c    | 130 +++++++++++++++++++--
 1 file changed, 118 insertions(+), 12 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ethtool.c b/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ethtool.c
index b080fabfe8de..dd49a59854e5 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ethtool.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ethtool.c
@@ -131,17 +131,123 @@ static int mlx5i_flash_device(struct net_device *netdev,
 	return mlx5e_ethtool_flash_device(priv, flash);
 }
 
+enum mlx5_ptys_width {
+	MLX5_PTYS_WIDTH_1X	= 1 << 0,
+	MLX5_PTYS_WIDTH_2X	= 1 << 1,
+	MLX5_PTYS_WIDTH_4X	= 1 << 2,
+	MLX5_PTYS_WIDTH_8X	= 1 << 3,
+	MLX5_PTYS_WIDTH_12X	= 1 << 4,
+};
+
+static inline int mlx5_ptys_width_enum_to_int(enum mlx5_ptys_width width)
+{
+	switch (width) {
+	case MLX5_PTYS_WIDTH_1X:  return  1;
+	case MLX5_PTYS_WIDTH_2X:  return  2;
+	case MLX5_PTYS_WIDTH_4X:  return  4;
+	case MLX5_PTYS_WIDTH_8X:  return  8;
+	case MLX5_PTYS_WIDTH_12X: return 12;
+	default:		  return -1;
+	}
+}
+
+enum mlx5_ptys_rate {
+	MLX5_PTYS_RATE_SDR	= 1 << 0,
+	MLX5_PTYS_RATE_DDR	= 1 << 1,
+	MLX5_PTYS_RATE_QDR	= 1 << 2,
+	MLX5_PTYS_RATE_FDR10	= 1 << 3,
+	MLX5_PTYS_RATE_FDR	= 1 << 4,
+	MLX5_PTYS_RATE_EDR	= 1 << 5,
+	MLX5_PTYS_RATE_HDR	= 1 << 6,
+};
+
+static inline int mlx5_ptys_rate_enum_to_int(enum mlx5_ptys_rate rate)
+{
+	switch (rate) {
+	case MLX5_PTYS_RATE_SDR:   return 2500;
+	case MLX5_PTYS_RATE_DDR:   return 5000;
+	case MLX5_PTYS_RATE_QDR:
+	case MLX5_PTYS_RATE_FDR10: return 10000;
+	case MLX5_PTYS_RATE_FDR:   return 14000;
+	case MLX5_PTYS_RATE_EDR:   return 25000;
+	case MLX5_PTYS_RATE_HDR:   return 50000;
+	default:		   return -1;
+	}
+}
+
+static int mlx5i_get_port_settings(struct net_device *netdev,
+				   u16 *ib_link_width_oper, u16 *ib_proto_oper)
+{
+	struct mlx5e_priv *priv    = mlx5i_epriv(netdev);
+	struct mlx5_core_dev *mdev = priv->mdev;
+	u32 out[MLX5_ST_SZ_DW(ptys_reg)] = {0};
+	int ret;
+
+	ret = mlx5_query_port_ptys(mdev, out, sizeof(out), MLX5_PTYS_IB, 1);
+	if (ret)
+		return ret;
+
+	*ib_link_width_oper = MLX5_GET(ptys_reg, out, ib_link_width_oper);
+	*ib_proto_oper      = MLX5_GET(ptys_reg, out, ib_proto_oper);
+
+	return 0;
+}
+
+static int mlx5i_get_speed_settings(u16 ib_link_width_oper, u16 ib_proto_oper)
+{
+	int rate, width;
+
+	rate = mlx5_ptys_rate_enum_to_int(ib_proto_oper);
+	if (rate < 0)
+		return -EINVAL;
+	width = mlx5_ptys_width_enum_to_int(ib_link_width_oper);
+	if (width < 0)
+		return -EINVAL;
+
+	return rate * width;
+}
+
+static int mlx5i_get_link_ksettings(struct net_device *netdev,
+				    struct ethtool_link_ksettings *link_ksettings)
+{
+	u16 ib_link_width_oper;
+	u16 ib_proto_oper;
+	int speed, ret;
+
+	ret = mlx5i_get_port_settings(netdev, &ib_link_width_oper, &ib_proto_oper);
+	if (ret)
+		return ret;
+
+	ethtool_link_ksettings_zero_link_mode(link_ksettings, supported);
+	ethtool_link_ksettings_zero_link_mode(link_ksettings, advertising);
+
+	speed = mlx5i_get_speed_settings(ib_link_width_oper, ib_proto_oper);
+	if (speed < 0)
+		return -EINVAL;
+
+	link_ksettings->base.duplex = DUPLEX_FULL;
+	link_ksettings->base.port = PORT_OTHER;
+
+	link_ksettings->base.autoneg = AUTONEG_DISABLE;
+
+	link_ksettings->base.speed = speed;
+
+	return 0;
+}
+
 const struct ethtool_ops mlx5i_ethtool_ops = {
-	.get_drvinfo       = mlx5i_get_drvinfo,
-	.get_strings       = mlx5i_get_strings,
-	.get_sset_count    = mlx5i_get_sset_count,
-	.get_ethtool_stats = mlx5i_get_ethtool_stats,
-	.get_ringparam     = mlx5i_get_ringparam,
-	.set_ringparam     = mlx5i_set_ringparam,
-	.flash_device      = mlx5i_flash_device,
-	.get_channels      = mlx5i_get_channels,
-	.set_channels      = mlx5i_set_channels,
-	.get_coalesce      = mlx5i_get_coalesce,
-	.set_coalesce      = mlx5i_set_coalesce,
-	.get_ts_info       = mlx5i_get_ts_info,
+	.get_drvinfo        = mlx5i_get_drvinfo,
+	.get_strings        = mlx5i_get_strings,
+	.get_sset_count     = mlx5i_get_sset_count,
+	.get_ethtool_stats  = mlx5i_get_ethtool_stats,
+	.get_ringparam      = mlx5i_get_ringparam,
+	.set_ringparam      = mlx5i_set_ringparam,
+	.flash_device       = mlx5i_flash_device,
+	.get_channels       = mlx5i_get_channels,
+	.set_channels       = mlx5i_set_channels,
+	.get_coalesce       = mlx5i_get_coalesce,
+	.set_coalesce       = mlx5i_set_coalesce,
+	.get_ts_info        = mlx5i_get_ts_info,
+	.get_link_ksettings = mlx5i_get_link_ksettings,
+	.get_link           = ethtool_op_get_link,
 };
-- 
2.13.0

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [net-next 04/15] net/mlx5: Add PCIe outbound stalls counters infrastructure
  2017-08-17 13:29 [pull request][net-next 00/15] Mellanox, mlx5 updates 2017-08-17 Saeed Mahameed
                   ` (2 preceding siblings ...)
  2017-08-17 13:29 ` [net-next 03/15] net/mlx5e: IPoIB, Add support for get_link_ksettings in ethtool Saeed Mahameed
@ 2017-08-17 13:29 ` Saeed Mahameed
  2017-08-17 13:29 ` [net-next 05/15] net/mlx5e: Add PCIe outbound stalls counters Saeed Mahameed
                   ` (10 subsequent siblings)
  14 siblings, 0 replies; 21+ messages in thread
From: Saeed Mahameed @ 2017-08-17 13:29 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Leon Romanovsky, Gal Pressman, Saeed Mahameed

From: Gal Pressman <galp@mellanox.com>

Add capability bit in MCAM register and counters to MPCNT register.

Signed-off-by: Gal Pressman <galp@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 include/linux/mlx5/mlx5_ifc.h | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h
index c99daffc3c3c..ba533b39c885 100644
--- a/include/linux/mlx5/mlx5_ifc.h
+++ b/include/linux/mlx5/mlx5_ifc.h
@@ -1854,7 +1854,17 @@ struct mlx5_ifc_pcie_perf_cntrs_grp_data_layout_bits {
 
 	u8         crc_error_tlp[0x20];
 
-	u8         reserved_at_140[0x680];
+	u8         reserved_at_140[0x40];
+
+	u8         outbound_stalled_reads[0x20];
+
+	u8         outbound_stalled_writes[0x20];
+
+	u8         outbound_stalled_reads_events[0x20];
+
+	u8         outbound_stalled_writes_events[0x20];
+
+	u8         reserved_at_200[0x5c0];
 };
 
 struct mlx5_ifc_cmd_inter_comp_event_bits {
@@ -7744,8 +7754,9 @@ struct mlx5_ifc_pcam_reg_bits {
 };
 
 struct mlx5_ifc_mcam_enhanced_features_bits {
-	u8         reserved_at_0[0x7d];
-
+	u8         reserved_at_0[0x7b];
+	u8         pcie_outbound_stalled[0x1];
+	u8         reserved_at_7c[0x1];
 	u8         mtpps_enh_out_per_adj[0x1];
 	u8         mtpps_fs[0x1];
 	u8         pcie_performance_group[0x1];
-- 
2.13.0

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [net-next 05/15] net/mlx5e: Add PCIe outbound stalls counters
  2017-08-17 13:29 [pull request][net-next 00/15] Mellanox, mlx5 updates 2017-08-17 Saeed Mahameed
                   ` (3 preceding siblings ...)
  2017-08-17 13:29 ` [net-next 04/15] net/mlx5: Add PCIe outbound stalls counters infrastructure Saeed Mahameed
@ 2017-08-17 13:29 ` Saeed Mahameed
  2017-08-17 13:29 ` [net-next 06/15] net/mlx5: Add RX buffer fullness counters infrastructure Saeed Mahameed
                   ` (9 subsequent siblings)
  14 siblings, 0 replies; 21+ messages in thread
From: Saeed Mahameed @ 2017-08-17 13:29 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Leon Romanovsky, Gal Pressman, Saeed Mahameed

From: Gal Pressman <galp@mellanox.com>

outbound_pci_stalled_rd - The percentage of time within the last second
that the NIC had outbound non-posted read requests but could not perform
the operation due to insufficient non-posted credits.

outbound_pci_stalled_wr - The percentage of time within the
last second that the NIC had outbound posted writes requests but could
not perform the operation due to insufficient posted credits.

outbound_pci_stalled_rd_events - The number of events where
outbound_pci_stalled_rd was above the threshold.

outbound_pci_stalled_wr_events - The number of events where
outbound_pci_stalled_wr was above the threshold.

Signed-off-by: Gal Pressman <galp@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c |  8 ++++++++
 drivers/net/ethernet/mellanox/mlx5/core/en_stats.h   | 13 ++++++++++++-
 2 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
index 917fade5f5d5..07202f7322fc 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
@@ -246,6 +246,10 @@ static void mlx5e_fill_stats_strings(struct mlx5e_priv *priv, uint8_t *data)
 		strcpy(data + (idx++) * ETH_GSTRING_LEN,
 		       pcie_perf_stats_desc[i].format);
 
+	for (i = 0; i < NUM_PCIE_PERF_STALL_COUNTERS(priv); i++)
+		strcpy(data + (idx++) * ETH_GSTRING_LEN,
+		       pcie_perf_stall_stats_desc[i].format);
+
 	for (prio = 0; prio < NUM_PPORT_PRIO; prio++) {
 		for (i = 0; i < NUM_PPORT_PER_PRIO_TRAFFIC_COUNTERS; i++)
 			sprintf(data + (idx++) * ETH_GSTRING_LEN,
@@ -377,6 +381,10 @@ void mlx5e_ethtool_get_ethtool_stats(struct mlx5e_priv *priv,
 		data[idx++] = MLX5E_READ_CTR32_BE(&priv->stats.pcie.pcie_perf_counters,
 						  pcie_perf_stats_desc, i);
 
+	for (i = 0; i < NUM_PCIE_PERF_STALL_COUNTERS(priv); i++)
+		data[idx++] = MLX5E_READ_CTR32_BE(&priv->stats.pcie.pcie_perf_counters,
+						  pcie_perf_stall_stats_desc, i);
+
 	for (prio = 0; prio < NUM_PPORT_PRIO; prio++) {
 		for (i = 0; i < NUM_PPORT_PER_PRIO_TRAFFIC_COUNTERS; i++)
 			data[idx++] = MLX5E_READ_CTR64_BE(&priv->stats.pport.per_prio_counters[prio],
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h
index e65517eafc58..bdddddc46170 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h
@@ -305,6 +305,13 @@ static const struct counter_desc pcie_perf_stats_desc[] = {
 	{ "tx_pci_signal_integrity", PCIE_PERF_OFF(tx_errors) },
 };
 
+static const struct counter_desc pcie_perf_stall_stats_desc[] = {
+	{ "outbound_pci_stalled_rd", PCIE_PERF_OFF(outbound_stalled_reads) },
+	{ "outbound_pci_stalled_wr", PCIE_PERF_OFF(outbound_stalled_writes) },
+	{ "outbound_pci_stalled_rd_events", PCIE_PERF_OFF(outbound_stalled_reads_events) },
+	{ "outbound_pci_stalled_wr_events", PCIE_PERF_OFF(outbound_stalled_writes_events) },
+};
+
 struct mlx5e_rq_stats {
 	u64 packets;
 	u64 bytes;
@@ -397,6 +404,9 @@ static const struct counter_desc sq_stats_desc[] = {
 #define NUM_PCIE_PERF_COUNTERS(priv) \
 	(ARRAY_SIZE(pcie_perf_stats_desc) * \
 	 MLX5_CAP_MCAM_FEATURE((priv)->mdev, pcie_performance_group))
+#define NUM_PCIE_PERF_STALL_COUNTERS(priv) \
+	(ARRAY_SIZE(pcie_perf_stall_stats_desc) * \
+	 MLX5_CAP_MCAM_FEATURE((priv)->mdev, pcie_outbound_stalled))
 #define NUM_PPORT_PER_PRIO_TRAFFIC_COUNTERS \
 	ARRAY_SIZE(pport_per_prio_traffic_stats_desc)
 #define NUM_PPORT_PER_PRIO_PFC_COUNTERS \
@@ -407,7 +417,8 @@ static const struct counter_desc sq_stats_desc[] = {
 					 NUM_PPORT_PHY_STATISTICAL_COUNTERS(priv) + \
 					 NUM_PPORT_PER_PRIO_TRAFFIC_COUNTERS * \
 					 NUM_PPORT_PRIO)
-#define NUM_PCIE_COUNTERS(priv)		NUM_PCIE_PERF_COUNTERS(priv)
+#define NUM_PCIE_COUNTERS(priv)		(NUM_PCIE_PERF_COUNTERS(priv) + \
+					 NUM_PCIE_PERF_STALL_COUNTERS(priv))
 #define NUM_RQ_STATS			ARRAY_SIZE(rq_stats_desc)
 #define NUM_SQ_STATS			ARRAY_SIZE(sq_stats_desc)
 
-- 
2.13.0

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [net-next 06/15] net/mlx5: Add RX buffer fullness counters infrastructure
  2017-08-17 13:29 [pull request][net-next 00/15] Mellanox, mlx5 updates 2017-08-17 Saeed Mahameed
                   ` (4 preceding siblings ...)
  2017-08-17 13:29 ` [net-next 05/15] net/mlx5e: Add PCIe outbound stalls counters Saeed Mahameed
@ 2017-08-17 13:29 ` Saeed Mahameed
  2017-08-17 13:29 ` [net-next 07/15] net/mlx5e: Add RX buffer fullness counters Saeed Mahameed
                   ` (8 subsequent siblings)
  14 siblings, 0 replies; 21+ messages in thread
From: Saeed Mahameed @ 2017-08-17 13:29 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Leon Romanovsky, Gal Pressman, Saeed Mahameed

From: Gal Pressman <galp@mellanox.com>

Add capability bit in PCAM register and counters to PPCNT register.

Signed-off-by: Gal Pressman <galp@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 include/linux/mlx5/mlx5_ifc.h | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h
index ba533b39c885..cf7ff52c594e 100644
--- a/include/linux/mlx5/mlx5_ifc.h
+++ b/include/linux/mlx5/mlx5_ifc.h
@@ -1538,7 +1538,17 @@ struct mlx5_ifc_eth_extended_cntrs_grp_data_layout_bits {
 
 	u8         port_transmit_wait_low[0x20];
 
-	u8         reserved_at_40[0x780];
+	u8         reserved_at_40[0x100];
+
+	u8         rx_buffer_almost_full_high[0x20];
+
+	u8         rx_buffer_almost_full_low[0x20];
+
+	u8         rx_buffer_full_high[0x20];
+
+	u8         rx_buffer_full_low[0x20];
+
+	u8         reserved_at_1c0[0x600];
 };
 
 struct mlx5_ifc_eth_3635_cntrs_grp_data_layout_bits {
@@ -7723,8 +7733,9 @@ struct mlx5_ifc_peir_reg_bits {
 };
 
 struct mlx5_ifc_pcam_enhanced_features_bits {
-	u8         reserved_at_0[0x7c];
+	u8         reserved_at_0[0x7b];
 
+	u8         rx_buffer_fullness_counters[0x1];
 	u8         ptys_connector_type[0x1];
 	u8         reserved_at_7d[0x1];
 	u8         ppcnt_discard_group[0x1];
-- 
2.13.0

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [net-next 07/15] net/mlx5e: Add RX buffer fullness counters
  2017-08-17 13:29 [pull request][net-next 00/15] Mellanox, mlx5 updates 2017-08-17 Saeed Mahameed
                   ` (5 preceding siblings ...)
  2017-08-17 13:29 ` [net-next 06/15] net/mlx5: Add RX buffer fullness counters infrastructure Saeed Mahameed
@ 2017-08-17 13:29 ` Saeed Mahameed
  2017-08-17 13:29 ` [net-next 08/15] net/mlx5e: Add outbound PCI buffer overflow counter Saeed Mahameed
                   ` (7 subsequent siblings)
  14 siblings, 0 replies; 21+ messages in thread
From: Saeed Mahameed @ 2017-08-17 13:29 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Leon Romanovsky, Gal Pressman, Saeed Mahameed

From: Gal Pressman <galp@mellanox.com>

rx_buffer_passed_thres_phy - The number of events where the port RX
buffer has passed a fullness threshold.

rx_buffer_full_phy - The number of events where the port RX buffer has
reached 100% fullness.

Signed-off-by: Gal Pressman <galp@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c |  8 ++++++++
 drivers/net/ethernet/mellanox/mlx5/core/en_main.c    |  6 ++++++
 drivers/net/ethernet/mellanox/mlx5/core/en_stats.h   | 17 ++++++++++++++++-
 3 files changed, 30 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
index 07202f7322fc..8c013a521319 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
@@ -242,6 +242,10 @@ static void mlx5e_fill_stats_strings(struct mlx5e_priv *priv, uint8_t *data)
 		strcpy(data + (idx++) * ETH_GSTRING_LEN,
 		       pport_phy_statistical_stats_desc[i].format);
 
+	for (i = 0; i < NUM_PPORT_ETH_EXT_COUNTERS(priv); i++)
+		strcpy(data + (idx++) * ETH_GSTRING_LEN,
+		       pport_eth_ext_stats_desc[i].format);
+
 	for (i = 0; i < NUM_PCIE_PERF_COUNTERS(priv); i++)
 		strcpy(data + (idx++) * ETH_GSTRING_LEN,
 		       pcie_perf_stats_desc[i].format);
@@ -377,6 +381,10 @@ void mlx5e_ethtool_get_ethtool_stats(struct mlx5e_priv *priv,
 		data[idx++] = MLX5E_READ_CTR64_BE(&priv->stats.pport.phy_statistical_counters,
 						  pport_phy_statistical_stats_desc, i);
 
+	for (i = 0; i < NUM_PPORT_ETH_EXT_COUNTERS(priv); i++)
+		data[idx++] = MLX5E_READ_CTR64_BE(&priv->stats.pport.eth_ext_counters,
+						  pport_eth_ext_stats_desc, i);
+
 	for (i = 0; i < NUM_PCIE_PERF_COUNTERS(priv); i++)
 		data[idx++] = MLX5E_READ_CTR32_BE(&priv->stats.pcie.pcie_perf_counters,
 						  pcie_perf_stats_desc, i);
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index 6921c6fe3087..2b0c891ad2a9 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -288,6 +288,12 @@ static void mlx5e_update_pport_counters(struct mlx5e_priv *priv, bool full)
 		mlx5_core_access_reg(mdev, in, sz, out, sz, MLX5_REG_PPCNT, 0, 0);
 	}
 
+	if (MLX5_CAP_PCAM_FEATURE(mdev, rx_buffer_fullness_counters)) {
+		out = pstats->eth_ext_counters;
+		MLX5_SET(ppcnt_reg, in, grp, MLX5_ETHERNET_EXTENDED_COUNTERS_GROUP);
+		mlx5_core_access_reg(mdev, in, sz, out, sz, MLX5_REG_PPCNT, 0, 0);
+	}
+
 	MLX5_SET(ppcnt_reg, in, grp, MLX5_PER_PRIORITY_COUNTERS_GROUP);
 	for (prio = 0; prio < NUM_PPORT_PRIO; prio++) {
 		out = pstats->per_prio_counters[prio];
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h
index bdddddc46170..be49df4bedd9 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h
@@ -216,6 +216,12 @@ static const struct counter_desc vport_stats_desc[] = {
 	MLX5_GET64(ppcnt_reg, pstats->per_prio_counters[prio], \
 		   counter_set.eth_per_prio_grp_data_layout.c##_high)
 #define NUM_PPORT_PRIO				8
+#define PPORT_ETH_EXT_OFF(c) \
+	MLX5_BYTE_OFF(ppcnt_reg, \
+		      counter_set.eth_extended_cntrs_grp_data_layout.c##_high)
+#define PPORT_ETH_EXT_GET(pstats, c) \
+	MLX5_GET64(ppcnt_reg, (pstats)->eth_ext_counters, \
+		   counter_set.eth_extended_cntrs_grp_data_layout.c##_high)
 
 struct mlx5e_pport_stats {
 	__be64 IEEE_802_3_counters[MLX5_ST_SZ_QW(ppcnt_reg)];
@@ -224,6 +230,7 @@ struct mlx5e_pport_stats {
 	__be64 per_prio_counters[NUM_PPORT_PRIO][MLX5_ST_SZ_QW(ppcnt_reg)];
 	__be64 phy_counters[MLX5_ST_SZ_QW(ppcnt_reg)];
 	__be64 phy_statistical_counters[MLX5_ST_SZ_QW(ppcnt_reg)];
+	__be64 eth_ext_counters[MLX5_ST_SZ_QW(ppcnt_reg)];
 };
 
 static const struct counter_desc pport_802_3_stats_desc[] = {
@@ -290,6 +297,10 @@ static const struct counter_desc pport_per_prio_pfc_stats_desc[] = {
 	{ "rx_%s_pause_transition", PPORT_PER_PRIO_OFF(rx_pause_transition) },
 };
 
+static const struct counter_desc pport_eth_ext_stats_desc[] = {
+	{ "rx_buffer_passed_thres_phy", PPORT_ETH_EXT_OFF(rx_buffer_almost_full) },
+};
+
 #define PCIE_PERF_OFF(c) \
 	MLX5_BYTE_OFF(mpcnt_reg, counter_set.pcie_perf_cntrs_grp_data_layout.c)
 #define PCIE_PERF_GET(pcie_stats, c) \
@@ -411,12 +422,16 @@ static const struct counter_desc sq_stats_desc[] = {
 	ARRAY_SIZE(pport_per_prio_traffic_stats_desc)
 #define NUM_PPORT_PER_PRIO_PFC_COUNTERS \
 	ARRAY_SIZE(pport_per_prio_pfc_stats_desc)
+#define NUM_PPORT_ETH_EXT_COUNTERS(priv) \
+	(ARRAY_SIZE(pport_eth_ext_stats_desc) * \
+	 MLX5_CAP_PCAM_FEATURE((priv)->mdev, rx_buffer_fullness_counters))
 #define NUM_PPORT_COUNTERS(priv)	(NUM_PPORT_802_3_COUNTERS + \
 					 NUM_PPORT_2863_COUNTERS  + \
 					 NUM_PPORT_2819_COUNTERS  + \
 					 NUM_PPORT_PHY_STATISTICAL_COUNTERS(priv) + \
 					 NUM_PPORT_PER_PRIO_TRAFFIC_COUNTERS * \
-					 NUM_PPORT_PRIO)
+					 NUM_PPORT_PRIO + \
+					 NUM_PPORT_ETH_EXT_COUNTERS(priv))
 #define NUM_PCIE_COUNTERS(priv)		(NUM_PCIE_PERF_COUNTERS(priv) + \
 					 NUM_PCIE_PERF_STALL_COUNTERS(priv))
 #define NUM_RQ_STATS			ARRAY_SIZE(rq_stats_desc)
-- 
2.13.0

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [net-next 08/15] net/mlx5e: Add outbound PCI buffer overflow counter
  2017-08-17 13:29 [pull request][net-next 00/15] Mellanox, mlx5 updates 2017-08-17 Saeed Mahameed
                   ` (6 preceding siblings ...)
  2017-08-17 13:29 ` [net-next 07/15] net/mlx5e: Add RX buffer fullness counters Saeed Mahameed
@ 2017-08-17 13:29 ` Saeed Mahameed
  2017-08-17 13:29 ` [net-next 09/15] net/mlx5: Avoid blank lines after/before open/close brace Saeed Mahameed
                   ` (6 subsequent siblings)
  14 siblings, 0 replies; 21+ messages in thread
From: Saeed Mahameed @ 2017-08-17 13:29 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Leon Romanovsky, Eran Ben Elisha, Saeed Mahameed

From: Eran Ben Elisha <eranbe@mellanox.com>

Add outbound_pci_buffer_overflow to ethtool output for monitoring the
number of packets that were dropped due to lack of PCIe buffers on
receive path from NIC port toward the host(s).

This counter is valid only in case that tx_overflow_buffer_pkt is
supported in MCAM enhanced features.

Signed-off-by: Eran Ben Elisha <eranbe@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c | 12 ++++++++++--
 drivers/net/ethernet/mellanox/mlx5/core/en_stats.h   | 14 ++++++++++++++
 include/linux/mlx5/mlx5_ifc.h                        |  6 ++++--
 3 files changed, 28 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
index 8c013a521319..d453a11f41fe 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
@@ -250,9 +250,13 @@ static void mlx5e_fill_stats_strings(struct mlx5e_priv *priv, uint8_t *data)
 		strcpy(data + (idx++) * ETH_GSTRING_LEN,
 		       pcie_perf_stats_desc[i].format);
 
-	for (i = 0; i < NUM_PCIE_PERF_STALL_COUNTERS(priv); i++)
+	for (i = 0; i < NUM_PCIE_PERF_COUNTERS64(priv); i++)
 		strcpy(data + (idx++) * ETH_GSTRING_LEN,
-		       pcie_perf_stall_stats_desc[i].format);
+		       pcie_perf_stats_desc64[i].format);
+
+	for (i = 0; i < NUM_PCIE_PERF_STALL_COUNTERS(priv); i++)
+	 strcpy(data + (idx++) * ETH_GSTRING_LEN,
+		pcie_perf_stall_stats_desc[i].format);
 
 	for (prio = 0; prio < NUM_PPORT_PRIO; prio++) {
 		for (i = 0; i < NUM_PPORT_PER_PRIO_TRAFFIC_COUNTERS; i++)
@@ -389,6 +393,10 @@ void mlx5e_ethtool_get_ethtool_stats(struct mlx5e_priv *priv,
 		data[idx++] = MLX5E_READ_CTR32_BE(&priv->stats.pcie.pcie_perf_counters,
 						  pcie_perf_stats_desc, i);
 
+	for (i = 0; i < NUM_PCIE_PERF_COUNTERS64(priv); i++)
+		data[idx++] = MLX5E_READ_CTR64_BE(&priv->stats.pcie.pcie_perf_counters,
+						  pcie_perf_stats_desc64, i);
+
 	for (i = 0; i < NUM_PCIE_PERF_STALL_COUNTERS(priv); i++)
 		data[idx++] = MLX5E_READ_CTR32_BE(&priv->stats.pcie.pcie_perf_counters,
 						  pcie_perf_stall_stats_desc, i);
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h
index be49df4bedd9..40b5c73e5e26 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h
@@ -307,6 +307,12 @@ static const struct counter_desc pport_eth_ext_stats_desc[] = {
 	MLX5_GET(mpcnt_reg, (pcie_stats)->pcie_perf_counters, \
 		 counter_set.pcie_perf_cntrs_grp_data_layout.c)
 
+#define PCIE_PERF_OFF64(c) \
+	MLX5_BYTE_OFF(mpcnt_reg, counter_set.pcie_perf_cntrs_grp_data_layout.c##_high)
+#define PCIE_PERF_GET64(pcie_stats, c) \
+	MLX5_GET64(mpcnt_reg, (pcie_stats)->pcie_perf_counters, \
+		   counter_set.pcie_perf_cntrs_grp_data_layout.c##_high)
+
 struct mlx5e_pcie_stats {
 	__be64 pcie_perf_counters[MLX5_ST_SZ_QW(mpcnt_reg)];
 };
@@ -316,6 +322,10 @@ static const struct counter_desc pcie_perf_stats_desc[] = {
 	{ "tx_pci_signal_integrity", PCIE_PERF_OFF(tx_errors) },
 };
 
+static const struct counter_desc pcie_perf_stats_desc64[] = {
+	{ "outbound_pci_buffer_overflow", PCIE_PERF_OFF64(tx_overflow_buffer_pkt) },
+};
+
 static const struct counter_desc pcie_perf_stall_stats_desc[] = {
 	{ "outbound_pci_stalled_rd", PCIE_PERF_OFF(outbound_stalled_reads) },
 	{ "outbound_pci_stalled_wr", PCIE_PERF_OFF(outbound_stalled_writes) },
@@ -415,6 +425,9 @@ static const struct counter_desc sq_stats_desc[] = {
 #define NUM_PCIE_PERF_COUNTERS(priv) \
 	(ARRAY_SIZE(pcie_perf_stats_desc) * \
 	 MLX5_CAP_MCAM_FEATURE((priv)->mdev, pcie_performance_group))
+#define NUM_PCIE_PERF_COUNTERS64(priv) \
+	(ARRAY_SIZE(pcie_perf_stats_desc64) * \
+	 MLX5_CAP_MCAM_FEATURE((priv)->mdev, tx_overflow_buffer_pkt))
 #define NUM_PCIE_PERF_STALL_COUNTERS(priv) \
 	(ARRAY_SIZE(pcie_perf_stall_stats_desc) * \
 	 MLX5_CAP_MCAM_FEATURE((priv)->mdev, pcie_outbound_stalled))
@@ -433,6 +446,7 @@ static const struct counter_desc sq_stats_desc[] = {
 					 NUM_PPORT_PRIO + \
 					 NUM_PPORT_ETH_EXT_COUNTERS(priv))
 #define NUM_PCIE_COUNTERS(priv)		(NUM_PCIE_PERF_COUNTERS(priv) + \
+					 NUM_PCIE_PERF_COUNTERS64(priv) +\
 					 NUM_PCIE_PERF_STALL_COUNTERS(priv))
 #define NUM_RQ_STATS			ARRAY_SIZE(rq_stats_desc)
 #define NUM_SQ_STATS			ARRAY_SIZE(sq_stats_desc)
diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h
index cf7ff52c594e..ae7d09b9c52f 100644
--- a/include/linux/mlx5/mlx5_ifc.h
+++ b/include/linux/mlx5/mlx5_ifc.h
@@ -1864,7 +1864,9 @@ struct mlx5_ifc_pcie_perf_cntrs_grp_data_layout_bits {
 
 	u8         crc_error_tlp[0x20];
 
-	u8         reserved_at_140[0x40];
+	u8         tx_overflow_buffer_pkt_high[0x20];
+
+	u8         tx_overflow_buffer_pkt_low[0x20];
 
 	u8         outbound_stalled_reads[0x20];
 
@@ -7767,7 +7769,7 @@ struct mlx5_ifc_pcam_reg_bits {
 struct mlx5_ifc_mcam_enhanced_features_bits {
 	u8         reserved_at_0[0x7b];
 	u8         pcie_outbound_stalled[0x1];
-	u8         reserved_at_7c[0x1];
+	u8         tx_overflow_buffer_pkt[0x1];
 	u8         mtpps_enh_out_per_adj[0x1];
 	u8         mtpps_fs[0x1];
 	u8         pcie_performance_group[0x1];
-- 
2.13.0

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [net-next 09/15] net/mlx5: Avoid blank lines after/before open/close brace
  2017-08-17 13:29 [pull request][net-next 00/15] Mellanox, mlx5 updates 2017-08-17 Saeed Mahameed
                   ` (7 preceding siblings ...)
  2017-08-17 13:29 ` [net-next 08/15] net/mlx5e: Add outbound PCI buffer overflow counter Saeed Mahameed
@ 2017-08-17 13:29 ` Saeed Mahameed
  2017-08-17 13:29 ` [net-next 10/15] net/mlx5: Add a blank line after declarations Saeed Mahameed
                   ` (5 subsequent siblings)
  14 siblings, 0 replies; 21+ messages in thread
From: Saeed Mahameed @ 2017-08-17 13:29 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Leon Romanovsky, Or Gerlitz, Saeed Mahameed

From: Or Gerlitz <ogerlitz@mellanox.com>

To fix these checkpatch complaints:

CHECK: Blank lines aren't necessary after an open brace '{'
CHECK: Blank lines aren't necessary before a close brace '}'

Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c | 1 -
 drivers/net/ethernet/mellanox/mlx5/core/sriov.c      | 1 -
 2 files changed, 2 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
index d453a11f41fe..a75ac4d11c5b 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
@@ -176,7 +176,6 @@ static bool mlx5e_query_global_pause_combined(struct mlx5e_priv *priv)
 
 int mlx5e_ethtool_get_sset_count(struct mlx5e_priv *priv, int sset)
 {
-
 	switch (sset) {
 	case ETH_SS_STATS:
 		return NUM_SW_COUNTERS +
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/sriov.c b/drivers/net/ethernet/mellanox/mlx5/core/sriov.c
index 5e7ffc9fad78..55b07c5ecd12 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/sriov.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/sriov.c
@@ -71,7 +71,6 @@ static int mlx5_device_enable_sriov(struct mlx5_core_dev *dev, int num_vfs)
 		sriov->vfs_ctx[vf].enabled = 1;
 		sriov->enabled_vfs++;
 		mlx5_core_dbg(dev, "successfully enabled VF* %d\n", vf);
-
 	}
 
 	return 0;
-- 
2.13.0

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [net-next 10/15] net/mlx5: Add a blank line after declarations
  2017-08-17 13:29 [pull request][net-next 00/15] Mellanox, mlx5 updates 2017-08-17 Saeed Mahameed
                   ` (8 preceding siblings ...)
  2017-08-17 13:29 ` [net-next 09/15] net/mlx5: Avoid blank lines after/before open/close brace Saeed Mahameed
@ 2017-08-17 13:29 ` Saeed Mahameed
  2017-08-23 22:39   ` Joe Perches
  2017-08-17 13:29 ` [net-next 11/15] net/mlx5e: Properly indent within conditional statements Saeed Mahameed
                   ` (4 subsequent siblings)
  14 siblings, 1 reply; 21+ messages in thread
From: Saeed Mahameed @ 2017-08-17 13:29 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Leon Romanovsky, Or Gerlitz, Saeed Mahameed

From: Or Gerlitz <ogerlitz@mellanox.com>

To fix these checkpatch complaints:

WARNING: Missing a blank line after declarations

Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/alloc.c | 1 +
 drivers/net/ethernet/mellanox/mlx5/core/eq.c    | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/alloc.c b/drivers/net/ethernet/mellanox/mlx5/core/alloc.c
index 3c95f7f53802..47239bf7bf43 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/alloc.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/alloc.c
@@ -258,6 +258,7 @@ EXPORT_SYMBOL_GPL(mlx5_db_alloc);
 void mlx5_db_free(struct mlx5_core_dev *dev, struct mlx5_db *db)
 {
 	u32 db_per_page = PAGE_SIZE / cache_line_size();
+
 	mutex_lock(&dev->priv.pgdir_mutex);
 
 	__set_bit(db->index, db->u.pgdir->bitmap);
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eq.c b/drivers/net/ethernet/mellanox/mlx5/core/eq.c
index de704ff5619a..a08027b8f3ce 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eq.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eq.c
@@ -188,6 +188,7 @@ static enum mlx5_dev_event port_subtype_event(u8 subtype)
 static void eq_update_ci(struct mlx5_eq *eq, int arm)
 {
 	__be32 __iomem *addr = eq->doorbell + (arm ? 0 : 2);
+
 	u32 val = (eq->cons_index & 0xffffff) | (eq->eqn << 24);
 	__raw_writel((__force u32)cpu_to_be32(val), addr);
 	/* We still want ordering, just not swabbing, so add a barrier */
-- 
2.13.0

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [net-next 11/15] net/mlx5e: Properly indent within conditional statements
  2017-08-17 13:29 [pull request][net-next 00/15] Mellanox, mlx5 updates 2017-08-17 Saeed Mahameed
                   ` (9 preceding siblings ...)
  2017-08-17 13:29 ` [net-next 10/15] net/mlx5: Add a blank line after declarations Saeed Mahameed
@ 2017-08-17 13:29 ` Saeed Mahameed
  2017-08-17 14:18   ` David Laight
  2017-08-17 13:30 ` [net-next 12/15] net/mlx5e: Avoid using multiple blank lines Saeed Mahameed
                   ` (3 subsequent siblings)
  14 siblings, 1 reply; 21+ messages in thread
From: Saeed Mahameed @ 2017-08-17 13:29 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Leon Romanovsky, Or Gerlitz, Saeed Mahameed

From: Or Gerlitz <ogerlitz@mellanox.com>

To fix these checkpatch complaints:

WARNING: suspect code indent for conditional statements (8, 24)
+       if (eth_proto & (MLX5E_PROT_MASK(MLX5E_10GBASE_SR)
[...]
+                       return PORT_FIBRE;

Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 .../net/ethernet/mellanox/mlx5/core/en_ethtool.c   | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
index a75ac4d11c5b..ed161312a773 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
@@ -988,23 +988,23 @@ static u8 get_connector_port(u32 eth_proto, u8 connector_type)
 		return ptys2connector_type[connector_type];
 
 	if (eth_proto & (MLX5E_PROT_MASK(MLX5E_10GBASE_SR)
-			 | MLX5E_PROT_MASK(MLX5E_40GBASE_SR4)
-			 | MLX5E_PROT_MASK(MLX5E_100GBASE_SR4)
-			 | MLX5E_PROT_MASK(MLX5E_1000BASE_CX_SGMII))) {
-			return PORT_FIBRE;
+	    | MLX5E_PROT_MASK(MLX5E_40GBASE_SR4)
+	    | MLX5E_PROT_MASK(MLX5E_100GBASE_SR4)
+	    | MLX5E_PROT_MASK(MLX5E_1000BASE_CX_SGMII))) {
+		return PORT_FIBRE;
 	}
 
 	if (eth_proto & (MLX5E_PROT_MASK(MLX5E_40GBASE_CR4)
-			 | MLX5E_PROT_MASK(MLX5E_10GBASE_CR)
-			 | MLX5E_PROT_MASK(MLX5E_100GBASE_CR4))) {
-			return PORT_DA;
+	    | MLX5E_PROT_MASK(MLX5E_10GBASE_CR)
+	    | MLX5E_PROT_MASK(MLX5E_100GBASE_CR4))) {
+		return PORT_DA;
 	}
 
 	if (eth_proto & (MLX5E_PROT_MASK(MLX5E_10GBASE_KX4)
-			 | MLX5E_PROT_MASK(MLX5E_10GBASE_KR)
-			 | MLX5E_PROT_MASK(MLX5E_40GBASE_KR4)
-			 | MLX5E_PROT_MASK(MLX5E_100GBASE_KR4))) {
-			return PORT_NONE;
+	    | MLX5E_PROT_MASK(MLX5E_10GBASE_KR)
+	    | MLX5E_PROT_MASK(MLX5E_40GBASE_KR4)
+	    | MLX5E_PROT_MASK(MLX5E_100GBASE_KR4))) {
+		return PORT_NONE;
 	}
 
 	return PORT_OTHER;
-- 
2.13.0

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [net-next 12/15] net/mlx5e: Avoid using multiple blank lines
  2017-08-17 13:29 [pull request][net-next 00/15] Mellanox, mlx5 updates 2017-08-17 Saeed Mahameed
                   ` (10 preceding siblings ...)
  2017-08-17 13:29 ` [net-next 11/15] net/mlx5e: Properly indent within conditional statements Saeed Mahameed
@ 2017-08-17 13:30 ` Saeed Mahameed
  2017-08-17 13:30 ` [net-next 13/15] net/mlx5e: Place constants on the right side of comparisons Saeed Mahameed
                   ` (2 subsequent siblings)
  14 siblings, 0 replies; 21+ messages in thread
From: Saeed Mahameed @ 2017-08-17 13:30 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Leon Romanovsky, Or Gerlitz, Saeed Mahameed

From: Or Gerlitz <ogerlitz@mellanox.com>

To fix these checkpatch complaints:

CHECK: Please don't use multiple blank lines

Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/cmd.c  | 1 -
 drivers/net/ethernet/mellanox/mlx5/core/main.c | 1 -
 2 files changed, 2 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/cmd.c b/drivers/net/ethernet/mellanox/mlx5/core/cmd.c
index 31cbe5e86a01..0ef68a7c051e 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/cmd.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/cmd.c
@@ -802,7 +802,6 @@ static void cmd_work_handler(struct work_struct *work)
 	bool poll_cmd = ent->polling;
 	int alloc_ret;
 
-
 	sem = ent->page_queue ? &cmd->pages_sem : &cmd->sem;
 	down(sem);
 	if (!ent->page_queue) {
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c
index 7e6e24398926..514c22d21729 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c
@@ -836,7 +836,6 @@ static int mlx5_core_set_issi(struct mlx5_core_dev *dev)
 	return -EOPNOTSUPP;
 }
 
-
 static int mlx5_pci_init(struct mlx5_core_dev *dev, struct mlx5_priv *priv)
 {
 	struct pci_dev *pdev = dev->pdev;
-- 
2.13.0

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [net-next 13/15] net/mlx5e: Place constants on the right side of comparisons
  2017-08-17 13:29 [pull request][net-next 00/15] Mellanox, mlx5 updates 2017-08-17 Saeed Mahameed
                   ` (11 preceding siblings ...)
  2017-08-17 13:30 ` [net-next 12/15] net/mlx5e: Avoid using multiple blank lines Saeed Mahameed
@ 2017-08-17 13:30 ` Saeed Mahameed
  2017-08-17 13:30 ` [net-next 14/15] net/mlx5e: Use kernel types instead of uint*_t in ethtool callbacks Saeed Mahameed
  2017-08-17 13:30 ` [net-next 15/15] net/mlx5e: Use size_t to store byte offset in statistics descriptors Saeed Mahameed
  14 siblings, 0 replies; 21+ messages in thread
From: Saeed Mahameed @ 2017-08-17 13:30 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Leon Romanovsky, Or Gerlitz, Saeed Mahameed

From: Or Gerlitz <ogerlitz@mellanox.com>

To fix these checkpatch complaints:

WARNING: Comparisons should place the constant on the right side of the test

Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
index 8e224bcbc6a6..55a6786d3c4c 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
@@ -509,8 +509,8 @@ static void mlx5e_lro_update_hdr(struct sk_buff *skb, struct mlx5_cqe64 *cqe,
 	u16 tot_len;
 
 	u8 l4_hdr_type = get_cqe_l4_hdr_type(cqe);
-	int tcp_ack = ((CQE_L4_HDR_TYPE_TCP_ACK_NO_DATA  == l4_hdr_type) ||
-		       (CQE_L4_HDR_TYPE_TCP_ACK_AND_DATA == l4_hdr_type));
+	int tcp_ack = ((l4_hdr_type == CQE_L4_HDR_TYPE_TCP_ACK_NO_DATA) ||
+		       (l4_hdr_type == CQE_L4_HDR_TYPE_TCP_ACK_AND_DATA));
 
 	skb->mac_len = ETH_HLEN;
 	proto = __vlan_get_protocol(skb, eth->h_proto, &network_depth);
-- 
2.13.0

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [net-next 14/15] net/mlx5e: Use kernel types instead of uint*_t in ethtool callbacks
  2017-08-17 13:29 [pull request][net-next 00/15] Mellanox, mlx5 updates 2017-08-17 Saeed Mahameed
                   ` (12 preceding siblings ...)
  2017-08-17 13:30 ` [net-next 13/15] net/mlx5e: Place constants on the right side of comparisons Saeed Mahameed
@ 2017-08-17 13:30 ` Saeed Mahameed
  2017-08-17 13:30 ` [net-next 15/15] net/mlx5e: Use size_t to store byte offset in statistics descriptors Saeed Mahameed
  14 siblings, 0 replies; 21+ messages in thread
From: Saeed Mahameed @ 2017-08-17 13:30 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Leon Romanovsky, Gal Pressman, Saeed Mahameed

From: Gal Pressman <galp@mellanox.com>

Fix checkpatch errors:
CHECK:PREFER_KERNEL_TYPES: Prefer kernel type 'u32' over 'uint32_t'

Signed-off-by: Gal Pressman <galp@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c    | 8 +++-----
 drivers/net/ethernet/mellanox/mlx5/core/ipoib/ethtool.c | 3 +--
 2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
index ed161312a773..03b130408359 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
@@ -206,7 +206,7 @@ static int mlx5e_get_sset_count(struct net_device *dev, int sset)
 	return mlx5e_ethtool_get_sset_count(priv, sset);
 }
 
-static void mlx5e_fill_stats_strings(struct mlx5e_priv *priv, uint8_t *data)
+static void mlx5e_fill_stats_strings(struct mlx5e_priv *priv, u8 *data)
 {
 	int i, j, tc, prio, idx = 0;
 	unsigned long pfc_combined;
@@ -308,8 +308,7 @@ static void mlx5e_fill_stats_strings(struct mlx5e_priv *priv, uint8_t *data)
 					priv->channel_tc2txq[i][tc]);
 }
 
-void mlx5e_ethtool_get_strings(struct mlx5e_priv *priv,
-			       uint32_t stringset, uint8_t *data)
+void mlx5e_ethtool_get_strings(struct mlx5e_priv *priv, u32 stringset, u8 *data)
 {
 	int i;
 
@@ -331,8 +330,7 @@ void mlx5e_ethtool_get_strings(struct mlx5e_priv *priv,
 	}
 }
 
-static void mlx5e_get_strings(struct net_device *dev,
-			      uint32_t stringset, uint8_t *data)
+static void mlx5e_get_strings(struct net_device *dev, u32 stringset, u8 *data)
 {
 	struct mlx5e_priv *priv = netdev_priv(dev);
 
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ethtool.c b/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ethtool.c
index dd49a59854e5..43c126c63955 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ethtool.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ethtool.c
@@ -43,8 +43,7 @@ static void mlx5i_get_drvinfo(struct net_device *dev,
 		sizeof(drvinfo->driver));
 }
 
-static void mlx5i_get_strings(struct net_device *dev,
-			      uint32_t stringset, uint8_t *data)
+static void mlx5i_get_strings(struct net_device *dev, u32 stringset, u8 *data)
 {
 	struct mlx5e_priv *priv  = mlx5i_epriv(dev);
 
-- 
2.13.0

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [net-next 15/15] net/mlx5e: Use size_t to store byte offset in statistics descriptors
  2017-08-17 13:29 [pull request][net-next 00/15] Mellanox, mlx5 updates 2017-08-17 Saeed Mahameed
                   ` (13 preceding siblings ...)
  2017-08-17 13:30 ` [net-next 14/15] net/mlx5e: Use kernel types instead of uint*_t in ethtool callbacks Saeed Mahameed
@ 2017-08-17 13:30 ` Saeed Mahameed
  14 siblings, 0 replies; 21+ messages in thread
From: Saeed Mahameed @ 2017-08-17 13:30 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Leon Romanovsky, Gal Pressman, Saeed Mahameed

From: Gal Pressman <galp@mellanox.com>

The byte offset of counter descriptors should be stored in size_t variable
instead of an integer.

Signed-off-by: Gal Pressman <galp@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en_stats.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h
index 40b5c73e5e26..6761796e803c 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h
@@ -47,7 +47,7 @@
 
 struct counter_desc {
 	char		format[ETH_GSTRING_LEN];
-	int		offset; /* Byte offset */
+	size_t		offset; /* Byte offset */
 };
 
 struct mlx5e_sw_stats {
-- 
2.13.0

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* RE: [net-next 11/15] net/mlx5e: Properly indent within conditional statements
  2017-08-17 13:29 ` [net-next 11/15] net/mlx5e: Properly indent within conditional statements Saeed Mahameed
@ 2017-08-17 14:18   ` David Laight
  2017-08-17 15:35     ` Saeed Mahameed
  2017-08-17 17:21     ` David Miller
  0 siblings, 2 replies; 21+ messages in thread
From: David Laight @ 2017-08-17 14:18 UTC (permalink / raw)
  To: 'Saeed Mahameed', David S. Miller
  Cc: netdev, Leon Romanovsky, Or Gerlitz

From: Saeed Mahameed
> Sent: 17 August 2017 14:30
> To: David S. Miller
> Cc: netdev@vger.kernel.org; Leon Romanovsky; Or Gerlitz; Saeed Mahameed
> Subject: [net-next 11/15] net/mlx5e: Properly indent within conditional statements
> 
> From: Or Gerlitz <ogerlitz@mellanox.com>
> 
> To fix these checkpatch complaints:
> 
> WARNING: suspect code indent for conditional statements (8, 24)
> +       if (eth_proto & (MLX5E_PROT_MASK(MLX5E_10GBASE_SR)
> [...]
> +                       return PORT_FIBRE;
> 
> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
> ---
>  .../net/ethernet/mellanox/mlx5/core/en_ethtool.c   | 22 +++++++++++-----------
>  1 file changed, 11 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
> b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
> index a75ac4d11c5b..ed161312a773 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
> @@ -988,23 +988,23 @@ static u8 get_connector_port(u32 eth_proto, u8 connector_type)
>  		return ptys2connector_type[connector_type];
> 
>  	if (eth_proto & (MLX5E_PROT_MASK(MLX5E_10GBASE_SR)
> -			 | MLX5E_PROT_MASK(MLX5E_40GBASE_SR4)
> -			 | MLX5E_PROT_MASK(MLX5E_100GBASE_SR4)
> -			 | MLX5E_PROT_MASK(MLX5E_1000BASE_CX_SGMII))) {
> -			return PORT_FIBRE;
> +	    | MLX5E_PROT_MASK(MLX5E_40GBASE_SR4)
> +	    | MLX5E_PROT_MASK(MLX5E_100GBASE_SR4)
> +	    | MLX5E_PROT_MASK(MLX5E_1000BASE_CX_SGMII))) {
> +		return PORT_FIBRE;

Gah, that is why the rules are stupid.
If anything the continuation lines want indenting a few more bytes.

	David

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [net-next 11/15] net/mlx5e: Properly indent within conditional statements
  2017-08-17 14:18   ` David Laight
@ 2017-08-17 15:35     ` Saeed Mahameed
  2017-08-17 17:21     ` David Miller
  1 sibling, 0 replies; 21+ messages in thread
From: Saeed Mahameed @ 2017-08-17 15:35 UTC (permalink / raw)
  To: David Laight
  Cc: Saeed Mahameed, David S. Miller, netdev, Leon Romanovsky, Or Gerlitz

On Thu, Aug 17, 2017 at 5:18 PM, David Laight <David.Laight@aculab.com> wrote:
> From: Saeed Mahameed
>> Sent: 17 August 2017 14:30
>> To: David S. Miller
>> Cc: netdev@vger.kernel.org; Leon Romanovsky; Or Gerlitz; Saeed Mahameed
>> Subject: [net-next 11/15] net/mlx5e: Properly indent within conditional statements
>>
>> From: Or Gerlitz <ogerlitz@mellanox.com>
>>
>> To fix these checkpatch complaints:
>>
>> WARNING: suspect code indent for conditional statements (8, 24)
>> +       if (eth_proto & (MLX5E_PROT_MASK(MLX5E_10GBASE_SR)
>> [...]
>> +                       return PORT_FIBRE;
>>
>> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
>> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
>> ---
>>  .../net/ethernet/mellanox/mlx5/core/en_ethtool.c   | 22 +++++++++++-----------
>>  1 file changed, 11 insertions(+), 11 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
>> b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
>> index a75ac4d11c5b..ed161312a773 100644
>> --- a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
>> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
>> @@ -988,23 +988,23 @@ static u8 get_connector_port(u32 eth_proto, u8 connector_type)
>>               return ptys2connector_type[connector_type];
>>
>>       if (eth_proto & (MLX5E_PROT_MASK(MLX5E_10GBASE_SR)
>> -                      | MLX5E_PROT_MASK(MLX5E_40GBASE_SR4)
>> -                      | MLX5E_PROT_MASK(MLX5E_100GBASE_SR4)
>> -                      | MLX5E_PROT_MASK(MLX5E_1000BASE_CX_SGMII))) {
>> -                     return PORT_FIBRE;
>> +         | MLX5E_PROT_MASK(MLX5E_40GBASE_SR4)
>> +         | MLX5E_PROT_MASK(MLX5E_100GBASE_SR4)
>> +         | MLX5E_PROT_MASK(MLX5E_1000BASE_CX_SGMII))) {
>> +             return PORT_FIBRE;
>
> Gah, that is why the rules are stupid.
> If anything the continuation lines want indenting a few more bytes.
>

Totally agree,
But if Or wants to follow the rules, I won't stand in his way :).

>         David
>

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [net-next 11/15] net/mlx5e: Properly indent within conditional statements
  2017-08-17 14:18   ` David Laight
  2017-08-17 15:35     ` Saeed Mahameed
@ 2017-08-17 17:21     ` David Miller
  1 sibling, 0 replies; 21+ messages in thread
From: David Miller @ 2017-08-17 17:21 UTC (permalink / raw)
  To: David.Laight; +Cc: saeedm, netdev, leonro, ogerlitz

From: David Laight <David.Laight@ACULAB.COM>
Date: Thu, 17 Aug 2017 14:18:29 +0000

> From: Saeed Mahameed
>> Sent: 17 August 2017 14:30
>> To: David S. Miller
>> Cc: netdev@vger.kernel.org; Leon Romanovsky; Or Gerlitz; Saeed Mahameed
>> Subject: [net-next 11/15] net/mlx5e: Properly indent within conditional statements
>> 
>> From: Or Gerlitz <ogerlitz@mellanox.com>
>> 
>> To fix these checkpatch complaints:
>> 
>> WARNING: suspect code indent for conditional statements (8, 24)
>> +       if (eth_proto & (MLX5E_PROT_MASK(MLX5E_10GBASE_SR)
>> [...]
>> +                       return PORT_FIBRE;
>> 
>> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
>> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
>> ---
>>  .../net/ethernet/mellanox/mlx5/core/en_ethtool.c   | 22 +++++++++++-----------
>>  1 file changed, 11 insertions(+), 11 deletions(-)
>> 
>> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
>> b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
>> index a75ac4d11c5b..ed161312a773 100644
>> --- a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
>> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
>> @@ -988,23 +988,23 @@ static u8 get_connector_port(u32 eth_proto, u8 connector_type)
>>  		return ptys2connector_type[connector_type];
>> 
>>  	if (eth_proto & (MLX5E_PROT_MASK(MLX5E_10GBASE_SR)
>> -			 | MLX5E_PROT_MASK(MLX5E_40GBASE_SR4)
>> -			 | MLX5E_PROT_MASK(MLX5E_100GBASE_SR4)
>> -			 | MLX5E_PROT_MASK(MLX5E_1000BASE_CX_SGMII))) {
>> -			return PORT_FIBRE;
>> +	    | MLX5E_PROT_MASK(MLX5E_40GBASE_SR4)
>> +	    | MLX5E_PROT_MASK(MLX5E_100GBASE_SR4)
>> +	    | MLX5E_PROT_MASK(MLX5E_1000BASE_CX_SGMII))) {
>> +		return PORT_FIBRE;
> 
> Gah, that is why the rules are stupid.
> If anything the continuation lines want indenting a few more bytes.

And in fact, operators should be at the end rather the beginning of lines.
This statement therefore must be formatted like this:

	if (x & (A |
		 B |
		 C |
		 C))

The indentation shows the grouping, therefore each line after the first must
start exactly at the column after the inner openning parenthesis.

Please fix this properly.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [net-next 10/15] net/mlx5: Add a blank line after declarations
  2017-08-17 13:29 ` [net-next 10/15] net/mlx5: Add a blank line after declarations Saeed Mahameed
@ 2017-08-23 22:39   ` Joe Perches
  2017-08-24 12:58     ` Saeed Mahameed
  0 siblings, 1 reply; 21+ messages in thread
From: Joe Perches @ 2017-08-23 22:39 UTC (permalink / raw)
  To: Saeed Mahameed, David S. Miller; +Cc: netdev, Leon Romanovsky, Or Gerlitz

On Thu, 2017-08-17 at 16:29 +0300, Saeed Mahameed wrote:
> From: Or Gerlitz <ogerlitz@mellanox.com>
[]
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eq.c b/drivers/net/ethernet/mellanox/mlx5/core/eq.c
[]
> @@ -188,6 +188,7 @@ static enum mlx5_dev_event port_subtype_event(u8 subtype)
>  static void eq_update_ci(struct mlx5_eq *eq, int arm)
>  {
>  	__be32 __iomem *addr = eq->doorbell + (arm ? 0 : 2);
> +
>  	u32 val = (eq->cons_index & 0xffffff) | (eq->eqn << 24);
>  	__raw_writel((__force u32)cpu_to_be32(val), addr);
>  	/* We still want ordering, just not swabbing, so add a barrier */

checkpatch is stupid.

The blank line should be after u32 val = ...
and not after __be32 __iomem *addr = ...

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [net-next 10/15] net/mlx5: Add a blank line after declarations
  2017-08-23 22:39   ` Joe Perches
@ 2017-08-24 12:58     ` Saeed Mahameed
  0 siblings, 0 replies; 21+ messages in thread
From: Saeed Mahameed @ 2017-08-24 12:58 UTC (permalink / raw)
  To: Joe Perches
  Cc: Saeed Mahameed, David S. Miller, Linux Netdev List,
	Leon Romanovsky, Or Gerlitz

On Thu, Aug 24, 2017 at 1:39 AM, Joe Perches <joe@perches.com> wrote:
> On Thu, 2017-08-17 at 16:29 +0300, Saeed Mahameed wrote:
>> From: Or Gerlitz <ogerlitz@mellanox.com>
> []
>> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eq.c b/drivers/net/ethernet/mellanox/mlx5/core/eq.c
> []
>> @@ -188,6 +188,7 @@ static enum mlx5_dev_event port_subtype_event(u8 subtype)
>>  static void eq_update_ci(struct mlx5_eq *eq, int arm)
>>  {
>>       __be32 __iomem *addr = eq->doorbell + (arm ? 0 : 2);
>> +
>>       u32 val = (eq->cons_index & 0xffffff) | (eq->eqn << 24);
>>       __raw_writel((__force u32)cpu_to_be32(val), addr);
>>       /* We still want ordering, just not swabbing, so add a barrier */
>
> checkpatch is stupid.
>
> The blank line should be after u32 val = ...
> and not after __be32 __iomem *addr = ...
>
>

You are completely right ! will fix this, Thanks !

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2017-08-24 12:59 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-17 13:29 [pull request][net-next 00/15] Mellanox, mlx5 updates 2017-08-17 Saeed Mahameed
2017-08-17 13:29 ` [net-next 01/15] net/mlx5e: Send PAOS command on interface up/down Saeed Mahameed
2017-08-17 13:29 ` [net-next 02/15] net/mlx5e: IPoIB, Fix driver name retrieved by ethtool Saeed Mahameed
2017-08-17 13:29 ` [net-next 03/15] net/mlx5e: IPoIB, Add support for get_link_ksettings in ethtool Saeed Mahameed
2017-08-17 13:29 ` [net-next 04/15] net/mlx5: Add PCIe outbound stalls counters infrastructure Saeed Mahameed
2017-08-17 13:29 ` [net-next 05/15] net/mlx5e: Add PCIe outbound stalls counters Saeed Mahameed
2017-08-17 13:29 ` [net-next 06/15] net/mlx5: Add RX buffer fullness counters infrastructure Saeed Mahameed
2017-08-17 13:29 ` [net-next 07/15] net/mlx5e: Add RX buffer fullness counters Saeed Mahameed
2017-08-17 13:29 ` [net-next 08/15] net/mlx5e: Add outbound PCI buffer overflow counter Saeed Mahameed
2017-08-17 13:29 ` [net-next 09/15] net/mlx5: Avoid blank lines after/before open/close brace Saeed Mahameed
2017-08-17 13:29 ` [net-next 10/15] net/mlx5: Add a blank line after declarations Saeed Mahameed
2017-08-23 22:39   ` Joe Perches
2017-08-24 12:58     ` Saeed Mahameed
2017-08-17 13:29 ` [net-next 11/15] net/mlx5e: Properly indent within conditional statements Saeed Mahameed
2017-08-17 14:18   ` David Laight
2017-08-17 15:35     ` Saeed Mahameed
2017-08-17 17:21     ` David Miller
2017-08-17 13:30 ` [net-next 12/15] net/mlx5e: Avoid using multiple blank lines Saeed Mahameed
2017-08-17 13:30 ` [net-next 13/15] net/mlx5e: Place constants on the right side of comparisons Saeed Mahameed
2017-08-17 13:30 ` [net-next 14/15] net/mlx5e: Use kernel types instead of uint*_t in ethtool callbacks Saeed Mahameed
2017-08-17 13:30 ` [net-next 15/15] net/mlx5e: Use size_t to store byte offset in statistics descriptors Saeed Mahameed

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.