Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 31 Jul 2017 12:09:24 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r321782 - in head/sys/dev/mlx4: . mlx4_core mlx4_en
Message-ID:  <201707311209.v6VC9O01014385@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Mon Jul 31 12:09:24 2017
New Revision: 321782
URL: https://svnweb.freebsd.org/changeset/base/321782

Log:
  Remove some dead statistics related code and a structure field from the
  mlx4en driver which is used by its Linux counterpart, but not under
  FreeBSD.
  
  Sponsored by:	Mellanox Technologies
  MFC after:	1 week

Modified:
  head/sys/dev/mlx4/device.h
  head/sys/dev/mlx4/mlx4_core/mlx4_port.c
  head/sys/dev/mlx4/mlx4_en/en.h
  head/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c
  head/sys/dev/mlx4/stats.h

Modified: head/sys/dev/mlx4/device.h
==============================================================================
--- head/sys/dev/mlx4/device.h	Mon Jul 31 12:08:44 2017	(r321781)
+++ head/sys/dev/mlx4/device.h	Mon Jul 31 12:09:24 2017	(r321782)
@@ -1273,7 +1273,6 @@ int mlx4_register_mac(struct mlx4_dev *dev, u8 port, u
 void mlx4_unregister_mac(struct mlx4_dev *dev, u8 port, u64 mac);
 int mlx4_get_base_qpn(struct mlx4_dev *dev, u8 port);
 int __mlx4_replace_mac(struct mlx4_dev *dev, u8 port, int qpn, u64 new_mac);
-void mlx4_set_stats_bitmap(struct mlx4_dev *dev, unsigned long *stats_bitmap);
 int mlx4_SET_PORT_general(struct mlx4_dev *dev, u8 port, int mtu,
 			  u8 pptx, u8 pfctx, u8 pprx, u8 pfcrx);
 int mlx4_SET_PORT_qpn_calc(struct mlx4_dev *dev, u8 port, u32 base_qpn,

Modified: head/sys/dev/mlx4/mlx4_core/mlx4_port.c
==============================================================================
--- head/sys/dev/mlx4/mlx4_core/mlx4_port.c	Mon Jul 31 12:08:44 2017	(r321781)
+++ head/sys/dev/mlx4/mlx4_core/mlx4_port.c	Mon Jul 31 12:09:24 2017	(r321782)
@@ -982,38 +982,6 @@ int mlx4_DUMP_ETH_STATS_wrapper(struct mlx4_dev *dev, 
 	return 0;
 }
 
-void mlx4_set_stats_bitmap(struct mlx4_dev *dev, unsigned long *stats_bitmap)
-{
-	int last_i = 0;
-
-	bitmap_zero(stats_bitmap, NUM_ALL_STATS);
-
-	if (mlx4_is_slave(dev)) {
-		last_i = dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_FLOWSTATS_EN ?
-			NUM_PKT_STATS + NUM_FLOW_STATS : NUM_PKT_STATS;
-	} else {
-		bitmap_set(stats_bitmap, last_i, NUM_PKT_STATS);
-		last_i = NUM_PKT_STATS;
-
-		if (dev->caps.flags2 &
-		    MLX4_DEV_CAP_FLAG2_FLOWSTATS_EN) {
-			bitmap_set(stats_bitmap, last_i, NUM_FLOW_STATS);
-			last_i += NUM_FLOW_STATS;
-		}
-	}
-
-	if (mlx4_is_slave(dev))
-		bitmap_set(stats_bitmap, last_i, NUM_VF_STATS);
-	last_i += NUM_VF_STATS;
-
-	if (mlx4_is_master(dev))
-		bitmap_set(stats_bitmap, last_i, NUM_VPORT_STATS);
-	last_i += NUM_VPORT_STATS;
-
-	bitmap_set(stats_bitmap, last_i, NUM_PORT_STATS);
-}
-EXPORT_SYMBOL(mlx4_set_stats_bitmap);
-
 int mlx4_get_slave_from_roce_gid(struct mlx4_dev *dev, int port, u8 *gid, int *slave_id)
 {
 	struct mlx4_priv *priv = mlx4_priv(dev);

Modified: head/sys/dev/mlx4/mlx4_en/en.h
==============================================================================
--- head/sys/dev/mlx4/mlx4_en/en.h	Mon Jul 31 12:08:44 2017	(r321781)
+++ head/sys/dev/mlx4/mlx4_en/en.h	Mon Jul 31 12:09:24 2017	(r321782)
@@ -572,7 +572,6 @@ struct mlx4_en_priv {
 	struct mlx4_en_port_stats port_stats;
 	struct mlx4_en_vport_stats vport_stats;
 	struct mlx4_en_vf_stats vf_stats;
-	DECLARE_BITMAP(stats_bitmap, NUM_ALL_STATS);
 	struct list_head mc_list;
 	struct list_head curr_list;
 	u64 broadcast_id;

Modified: head/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c
==============================================================================
--- head/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c	Mon Jul 31 12:08:44 2017	(r321781)
+++ head/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c	Mon Jul 31 12:09:24 2017	(r321782)
@@ -1377,8 +1377,6 @@ int mlx4_en_start_port(struct net_device *dev)
 	/* Schedule multicast task to populate multicast list */
 	queue_work(mdev->workqueue, &priv->rx_mode_task);
 
-	mlx4_set_stats_bitmap(mdev->dev, priv->stats_bitmap);
-
 	priv->port_up = true;
 
         /* Enable the queues. */
@@ -2731,28 +2729,6 @@ static void mlx4_en_sysctl_stat(struct mlx4_en_priv *p
 	SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "rx_gt_1548_bytes_packets", CTLFLAG_RD,
 	    &priv->pkstats.rx_gt_1548_bytes_packets,
 	    "RX Greater Then 1548 bytes Packets");
-
-struct mlx4_en_pkt_stats {
-	unsigned long tx_packets;
-	unsigned long tx_bytes;
-	unsigned long tx_multicast_packets;
-	unsigned long tx_broadcast_packets;
-	unsigned long tx_errors;
-	unsigned long tx_dropped;
-	unsigned long tx_lt_64_bytes_packets;
-	unsigned long tx_127_bytes_packets;
-	unsigned long tx_255_bytes_packets;
-	unsigned long tx_511_bytes_packets;
-	unsigned long tx_1023_bytes_packets;
-	unsigned long tx_1518_bytes_packets;
-	unsigned long tx_1522_bytes_packets;
-	unsigned long tx_1548_bytes_packets;
-	unsigned long tx_gt_1548_bytes_packets;
-	unsigned long rx_prio[NUM_PRIORITIES][NUM_PRIORITY_STATS];
-	unsigned long tx_prio[NUM_PRIORITIES][NUM_PRIORITY_STATS];
-#define NUM_PKT_STATS		72
-};
-
 
 	SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "tx_packets", CTLFLAG_RD,
 	    &priv->pkstats.tx_packets, "TX packets");

Modified: head/sys/dev/mlx4/stats.h
==============================================================================
--- head/sys/dev/mlx4/stats.h	Mon Jul 31 12:08:44 2017	(r321781)
+++ head/sys/dev/mlx4/stats.h	Mon Jul 31 12:09:24 2017	(r321782)
@@ -82,7 +82,6 @@ struct mlx4_en_pkt_stats {
 	unsigned long tx_gt_1548_bytes_packets;
 	unsigned long rx_prio[NUM_PRIORITIES][NUM_PRIORITY_STATS];
 	unsigned long tx_prio[NUM_PRIORITIES][NUM_PRIORITY_STATS];
-#define NUM_PKT_STATS		72
 };
 
 struct mlx4_en_vf_stats {
@@ -97,7 +96,6 @@ struct mlx4_en_vf_stats {
 	unsigned long tx_multicast_packets;
 	unsigned long tx_broadcast_packets;
 	unsigned long tx_errors;
-#define NUM_VF_STATS		11
 };
 
 struct mlx4_en_vport_stats {
@@ -116,7 +114,6 @@ struct mlx4_en_vport_stats {
 	unsigned long tx_broadcast_packets;
 	unsigned long tx_broadcast_bytes;
 	unsigned long tx_errors;
-#define NUM_VPORT_STATS		15
 };
 
 struct mlx4_en_port_stats {
@@ -129,7 +126,6 @@ struct mlx4_en_port_stats {
 	unsigned long rx_chksum_good;
 	unsigned long rx_chksum_none;
 	unsigned long tx_chksum_offload;
-#define NUM_PORT_STATS		8
 };
 
 struct mlx4_en_perf_stats {
@@ -139,7 +135,6 @@ struct mlx4_en_perf_stats {
 	u16 tx_coal_avg;
 	u16 rx_coal_avg;
 	u32 napi_quota;
-#define NUM_PERF_COUNTERS		6
 };
 
 struct mlx4_en_flow_stats {
@@ -151,8 +146,6 @@ struct mlx4_en_flow_stats {
 	u64 tx_pause_transition;
 };
 #define MLX4_NUM_PRIORITIES	8
-#define NUM_FLOW_PRIORITY_STATS	6
-#define NUM_FLOW_STATS		(NUM_FLOW_PRIORITY_STATS*MLX4_NUM_PRIORITIES)
 
 
 struct mlx4_en_stat_out_flow_control_mbox {
@@ -180,6 +173,4 @@ int mlx4_get_vport_ethtool_stats(struct mlx4_dev *dev,
                          struct mlx4_en_vport_stats *vport_stats,
                          int reset);
 
-#define NUM_ALL_STATS	(NUM_PKT_STATS + NUM_FLOW_STATS + NUM_VPORT_STATS + \
-			 NUM_VF_STATS + NUM_PORT_STATS + NUM_PERF_STATS)
 #endif



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201707311209.v6VC9O01014385>