Blame SOURCES/0010-ionic_add_more_ethtool_stats.patch

1632d2
Date: Thu, 18 Jun 2020 19:42:46 -0400
1632d2
From: Jonathan Toppins <jtoppins@redhat.com>
1632d2
To: rhkernel-list@redhat.com
1632d2
Cc: darcari@redhat.com, nhorman@redhat.com, linville@redhat.com
1632d2
Subject: [PATCH RHEL-8.3 11/16] ionic: add more ethtool stats
1632d2
1632d2
Add hardware port stats and a few more driver collected
1632d2
statistics to the ethtool stats output.
1632d2
1632d2
Signed-off-by: Shannon Nelson <snelson@pensando.io>
1632d2
Signed-off-by: David S. Miller <davem@davemloft.net>
1632d2
(cherry picked from commit f64e0c5698b7b1abb08b3d5bc07f95db45e87d76)
1632d2
Bugzilla: 1848149
1632d2
Build Info: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=29498383
1632d2
Tested: QE tested devel kernel as well as the partner
1632d2
Signed-off-by: Jonathan Toppins <jtoppins@redhat.com>
1632d2
---
1632d2
 drivers/net/ethernet/pensando/ionic/ionic_lif.c   |   4 +-
1632d2
 drivers/net/ethernet/pensando/ionic/ionic_lif.h   |  15 ++-
1632d2
 drivers/net/ethernet/pensando/ionic/ionic_stats.c | 136 +++++++++++++++++++++-
1632d2
 drivers/net/ethernet/pensando/ionic/ionic_stats.h |   6 +
1632d2
 drivers/net/ethernet/pensando/ionic/ionic_txrx.c  |  22 ++--
1632d2
 5 files changed, 170 insertions(+), 13 deletions(-)
1632d2
1632d2
diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c
1632d2
index e47da3127bf3..7321a92f8395 100644
1632d2
--- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c
1632d2
+++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c
1632d2
@@ -792,8 +792,8 @@ static int ionic_adminq_napi(struct napi_struct *napi, int budget)
1632d2
 	return max(n_work, a_work);
1632d2
 }
1632d2
 
1632d2
-static void ionic_get_stats64(struct net_device *netdev,
1632d2
-			      struct rtnl_link_stats64 *ns)
1632d2
+void ionic_get_stats64(struct net_device *netdev,
1632d2
+		       struct rtnl_link_stats64 *ns)
1632d2
 {
1632d2
 	struct ionic_lif *lif = netdev_priv(netdev);
1632d2
 	struct ionic_lif_stats *ls;
1632d2
diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.h b/drivers/net/ethernet/pensando/ionic/ionic_lif.h
1632d2
index 1a30f0fb20b9..c3428034a17b 100644
1632d2
--- a/drivers/net/ethernet/pensando/ionic/ionic_lif.h
1632d2
+++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.h
1632d2
@@ -20,11 +20,13 @@ struct ionic_tx_stats {
1632d2
 	u64 bytes;
1632d2
 	u64 clean;
1632d2
 	u64 linearize;
1632d2
-	u64 no_csum;
1632d2
+	u64 csum_none;
1632d2
 	u64 csum;
1632d2
 	u64 crc32_csum;
1632d2
 	u64 tso;
1632d2
+	u64 tso_bytes;
1632d2
 	u64 frags;
1632d2
+	u64 vlan_inserted;
1632d2
 	u64 sg_cntr[IONIC_MAX_NUM_SG_CNTR];
1632d2
 };
1632d2
 
1632d2
@@ -38,6 +40,7 @@ struct ionic_rx_stats {
1632d2
 	u64 csum_error;
1632d2
 	u64 buffers_posted;
1632d2
 	u64 dropped;
1632d2
+	u64 vlan_stripped;
1632d2
 };
1632d2
 
1632d2
 #define IONIC_QCQ_F_INITED		BIT(0)
1632d2
@@ -114,11 +117,17 @@ struct ionic_lif_sw_stats {
1632d2
 	u64 rx_packets;
1632d2
 	u64 rx_bytes;
1632d2
 	u64 tx_tso;
1632d2
-	u64 tx_no_csum;
1632d2
+	u64 tx_tso_bytes;
1632d2
+	u64 tx_csum_none;
1632d2
 	u64 tx_csum;
1632d2
 	u64 rx_csum_none;
1632d2
 	u64 rx_csum_complete;
1632d2
 	u64 rx_csum_error;
1632d2
+	u64 hw_tx_dropped;
1632d2
+	u64 hw_rx_dropped;
1632d2
+	u64 hw_rx_over_errors;
1632d2
+	u64 hw_rx_missed_errors;
1632d2
+	u64 hw_tx_aborted_errors;
1632d2
 };
1632d2
 
1632d2
 enum ionic_lif_state_flags {
1632d2
@@ -240,6 +249,8 @@ static inline u32 ionic_coal_hw_to_usec(struct ionic *ionic, u32 units)
1632d2
 }
1632d2
 
1632d2
 void ionic_link_status_check_request(struct ionic_lif *lif);
1632d2
+void ionic_get_stats64(struct net_device *netdev,
1632d2
+		       struct rtnl_link_stats64 *ns);
1632d2
 void ionic_lif_deferred_enqueue(struct ionic_deferred *def,
1632d2
 				struct ionic_deferred_work *work);
1632d2
 int ionic_lifs_alloc(struct ionic *ionic);
1632d2
diff --git a/drivers/net/ethernet/pensando/ionic/ionic_stats.c b/drivers/net/ethernet/pensando/ionic/ionic_stats.c
1632d2
index 8f2a8fb029f1..2a1885da58a6 100644
1632d2
--- a/drivers/net/ethernet/pensando/ionic/ionic_stats.c
1632d2
+++ b/drivers/net/ethernet/pensando/ionic/ionic_stats.c
1632d2
@@ -15,11 +15,109 @@ static const struct ionic_stat_desc ionic_lif_stats_desc[] = {
1632d2
 	IONIC_LIF_STAT_DESC(rx_packets),
1632d2
 	IONIC_LIF_STAT_DESC(rx_bytes),
1632d2
 	IONIC_LIF_STAT_DESC(tx_tso),
1632d2
-	IONIC_LIF_STAT_DESC(tx_no_csum),
1632d2
+	IONIC_LIF_STAT_DESC(tx_tso_bytes),
1632d2
+	IONIC_LIF_STAT_DESC(tx_csum_none),
1632d2
 	IONIC_LIF_STAT_DESC(tx_csum),
1632d2
 	IONIC_LIF_STAT_DESC(rx_csum_none),
1632d2
 	IONIC_LIF_STAT_DESC(rx_csum_complete),
1632d2
 	IONIC_LIF_STAT_DESC(rx_csum_error),
1632d2
+	IONIC_LIF_STAT_DESC(hw_tx_dropped),
1632d2
+	IONIC_LIF_STAT_DESC(hw_rx_dropped),
1632d2
+	IONIC_LIF_STAT_DESC(hw_rx_over_errors),
1632d2
+	IONIC_LIF_STAT_DESC(hw_rx_missed_errors),
1632d2
+	IONIC_LIF_STAT_DESC(hw_tx_aborted_errors),
1632d2
+};
1632d2
+
1632d2
+static const struct ionic_stat_desc ionic_port_stats_desc[] = {
1632d2
+	IONIC_PORT_STAT_DESC(frames_rx_ok),
1632d2
+	IONIC_PORT_STAT_DESC(frames_rx_all),
1632d2
+	IONIC_PORT_STAT_DESC(frames_rx_bad_fcs),
1632d2
+	IONIC_PORT_STAT_DESC(frames_rx_bad_all),
1632d2
+	IONIC_PORT_STAT_DESC(octets_rx_ok),
1632d2
+	IONIC_PORT_STAT_DESC(octets_rx_all),
1632d2
+	IONIC_PORT_STAT_DESC(frames_rx_unicast),
1632d2
+	IONIC_PORT_STAT_DESC(frames_rx_multicast),
1632d2
+	IONIC_PORT_STAT_DESC(frames_rx_broadcast),
1632d2
+	IONIC_PORT_STAT_DESC(frames_rx_pause),
1632d2
+	IONIC_PORT_STAT_DESC(frames_rx_bad_length),
1632d2
+	IONIC_PORT_STAT_DESC(frames_rx_undersized),
1632d2
+	IONIC_PORT_STAT_DESC(frames_rx_oversized),
1632d2
+	IONIC_PORT_STAT_DESC(frames_rx_fragments),
1632d2
+	IONIC_PORT_STAT_DESC(frames_rx_jabber),
1632d2
+	IONIC_PORT_STAT_DESC(frames_rx_pripause),
1632d2
+	IONIC_PORT_STAT_DESC(frames_rx_stomped_crc),
1632d2
+	IONIC_PORT_STAT_DESC(frames_rx_too_long),
1632d2
+	IONIC_PORT_STAT_DESC(frames_rx_vlan_good),
1632d2
+	IONIC_PORT_STAT_DESC(frames_rx_dropped),
1632d2
+	IONIC_PORT_STAT_DESC(frames_rx_less_than_64b),
1632d2
+	IONIC_PORT_STAT_DESC(frames_rx_64b),
1632d2
+	IONIC_PORT_STAT_DESC(frames_rx_65b_127b),
1632d2
+	IONIC_PORT_STAT_DESC(frames_rx_128b_255b),
1632d2
+	IONIC_PORT_STAT_DESC(frames_rx_256b_511b),
1632d2
+	IONIC_PORT_STAT_DESC(frames_rx_512b_1023b),
1632d2
+	IONIC_PORT_STAT_DESC(frames_rx_1024b_1518b),
1632d2
+	IONIC_PORT_STAT_DESC(frames_rx_1519b_2047b),
1632d2
+	IONIC_PORT_STAT_DESC(frames_rx_2048b_4095b),
1632d2
+	IONIC_PORT_STAT_DESC(frames_rx_4096b_8191b),
1632d2
+	IONIC_PORT_STAT_DESC(frames_rx_8192b_9215b),
1632d2
+	IONIC_PORT_STAT_DESC(frames_rx_other),
1632d2
+	IONIC_PORT_STAT_DESC(frames_tx_ok),
1632d2
+	IONIC_PORT_STAT_DESC(frames_tx_all),
1632d2
+	IONIC_PORT_STAT_DESC(frames_tx_bad),
1632d2
+	IONIC_PORT_STAT_DESC(octets_tx_ok),
1632d2
+	IONIC_PORT_STAT_DESC(octets_tx_total),
1632d2
+	IONIC_PORT_STAT_DESC(frames_tx_unicast),
1632d2
+	IONIC_PORT_STAT_DESC(frames_tx_multicast),
1632d2
+	IONIC_PORT_STAT_DESC(frames_tx_broadcast),
1632d2
+	IONIC_PORT_STAT_DESC(frames_tx_pause),
1632d2
+	IONIC_PORT_STAT_DESC(frames_tx_pripause),
1632d2
+	IONIC_PORT_STAT_DESC(frames_tx_vlan),
1632d2
+	IONIC_PORT_STAT_DESC(frames_tx_less_than_64b),
1632d2
+	IONIC_PORT_STAT_DESC(frames_tx_64b),
1632d2
+	IONIC_PORT_STAT_DESC(frames_tx_65b_127b),
1632d2
+	IONIC_PORT_STAT_DESC(frames_tx_128b_255b),
1632d2
+	IONIC_PORT_STAT_DESC(frames_tx_256b_511b),
1632d2
+	IONIC_PORT_STAT_DESC(frames_tx_512b_1023b),
1632d2
+	IONIC_PORT_STAT_DESC(frames_tx_1024b_1518b),
1632d2
+	IONIC_PORT_STAT_DESC(frames_tx_1519b_2047b),
1632d2
+	IONIC_PORT_STAT_DESC(frames_tx_2048b_4095b),
1632d2
+	IONIC_PORT_STAT_DESC(frames_tx_4096b_8191b),
1632d2
+	IONIC_PORT_STAT_DESC(frames_tx_8192b_9215b),
1632d2
+	IONIC_PORT_STAT_DESC(frames_tx_other),
1632d2
+	IONIC_PORT_STAT_DESC(frames_tx_pri_0),
1632d2
+	IONIC_PORT_STAT_DESC(frames_tx_pri_1),
1632d2
+	IONIC_PORT_STAT_DESC(frames_tx_pri_2),
1632d2
+	IONIC_PORT_STAT_DESC(frames_tx_pri_3),
1632d2
+	IONIC_PORT_STAT_DESC(frames_tx_pri_4),
1632d2
+	IONIC_PORT_STAT_DESC(frames_tx_pri_5),
1632d2
+	IONIC_PORT_STAT_DESC(frames_tx_pri_6),
1632d2
+	IONIC_PORT_STAT_DESC(frames_tx_pri_7),
1632d2
+	IONIC_PORT_STAT_DESC(frames_rx_pri_0),
1632d2
+	IONIC_PORT_STAT_DESC(frames_rx_pri_1),
1632d2
+	IONIC_PORT_STAT_DESC(frames_rx_pri_2),
1632d2
+	IONIC_PORT_STAT_DESC(frames_rx_pri_3),
1632d2
+	IONIC_PORT_STAT_DESC(frames_rx_pri_4),
1632d2
+	IONIC_PORT_STAT_DESC(frames_rx_pri_5),
1632d2
+	IONIC_PORT_STAT_DESC(frames_rx_pri_6),
1632d2
+	IONIC_PORT_STAT_DESC(frames_rx_pri_7),
1632d2
+	IONIC_PORT_STAT_DESC(tx_pripause_0_1us_count),
1632d2
+	IONIC_PORT_STAT_DESC(tx_pripause_1_1us_count),
1632d2
+	IONIC_PORT_STAT_DESC(tx_pripause_2_1us_count),
1632d2
+	IONIC_PORT_STAT_DESC(tx_pripause_3_1us_count),
1632d2
+	IONIC_PORT_STAT_DESC(tx_pripause_4_1us_count),
1632d2
+	IONIC_PORT_STAT_DESC(tx_pripause_5_1us_count),
1632d2
+	IONIC_PORT_STAT_DESC(tx_pripause_6_1us_count),
1632d2
+	IONIC_PORT_STAT_DESC(tx_pripause_7_1us_count),
1632d2
+	IONIC_PORT_STAT_DESC(rx_pripause_0_1us_count),
1632d2
+	IONIC_PORT_STAT_DESC(rx_pripause_1_1us_count),
1632d2
+	IONIC_PORT_STAT_DESC(rx_pripause_2_1us_count),
1632d2
+	IONIC_PORT_STAT_DESC(rx_pripause_3_1us_count),
1632d2
+	IONIC_PORT_STAT_DESC(rx_pripause_4_1us_count),
1632d2
+	IONIC_PORT_STAT_DESC(rx_pripause_5_1us_count),
1632d2
+	IONIC_PORT_STAT_DESC(rx_pripause_6_1us_count),
1632d2
+	IONIC_PORT_STAT_DESC(rx_pripause_7_1us_count),
1632d2
+	IONIC_PORT_STAT_DESC(rx_pause_1us_count),
1632d2
+	IONIC_PORT_STAT_DESC(frames_tx_truncated),
1632d2
 };
1632d2
 
1632d2
 static const struct ionic_stat_desc ionic_tx_stats_desc[] = {
1632d2
@@ -29,6 +127,11 @@ static const struct ionic_stat_desc ionic_tx_stats_desc[] = {
1632d2
 	IONIC_TX_STAT_DESC(dma_map_err),
1632d2
 	IONIC_TX_STAT_DESC(linearize),
1632d2
 	IONIC_TX_STAT_DESC(frags),
1632d2
+	IONIC_TX_STAT_DESC(tso),
1632d2
+	IONIC_TX_STAT_DESC(tso_bytes),
1632d2
+	IONIC_TX_STAT_DESC(csum_none),
1632d2
+	IONIC_TX_STAT_DESC(csum),
1632d2
+	IONIC_TX_STAT_DESC(vlan_inserted),
1632d2
 };
1632d2
 
1632d2
 static const struct ionic_stat_desc ionic_rx_stats_desc[] = {
1632d2
@@ -40,6 +143,7 @@ static const struct ionic_stat_desc ionic_rx_stats_desc[] = {
1632d2
 	IONIC_RX_STAT_DESC(csum_complete),
1632d2
 	IONIC_RX_STAT_DESC(csum_error),
1632d2
 	IONIC_RX_STAT_DESC(dropped),
1632d2
+	IONIC_RX_STAT_DESC(vlan_stripped),
1632d2
 };
1632d2
 
1632d2
 static const struct ionic_stat_desc ionic_txq_stats_desc[] = {
1632d2
@@ -62,6 +166,7 @@ static const struct ionic_stat_desc ionic_dbg_napi_stats_desc[] = {
1632d2
 };
1632d2
 
1632d2
 #define IONIC_NUM_LIF_STATS ARRAY_SIZE(ionic_lif_stats_desc)
1632d2
+#define IONIC_NUM_PORT_STATS ARRAY_SIZE(ionic_port_stats_desc)
1632d2
 #define IONIC_NUM_TX_STATS ARRAY_SIZE(ionic_tx_stats_desc)
1632d2
 #define IONIC_NUM_RX_STATS ARRAY_SIZE(ionic_rx_stats_desc)
1632d2
 #define IONIC_NUM_TX_Q_STATS ARRAY_SIZE(ionic_txq_stats_desc)
1632d2
@@ -76,6 +181,7 @@ static void ionic_get_lif_stats(struct ionic_lif *lif,
1632d2
 {
1632d2
 	struct ionic_tx_stats *tstats;
1632d2
 	struct ionic_rx_stats *rstats;
1632d2
+	struct rtnl_link_stats64 ns;
1632d2
 	struct ionic_qcq *txqcq;
1632d2
 	struct ionic_qcq *rxqcq;
1632d2
 	int q_num;
1632d2
@@ -89,7 +195,8 @@ static void ionic_get_lif_stats(struct ionic_lif *lif,
1632d2
 			stats->tx_packets += tstats->pkts;
1632d2
 			stats->tx_bytes += tstats->bytes;
1632d2
 			stats->tx_tso += tstats->tso;
1632d2
-			stats->tx_no_csum += tstats->no_csum;
1632d2
+			stats->tx_tso_bytes += tstats->tso_bytes;
1632d2
+			stats->tx_csum_none += tstats->csum_none;
1632d2
 			stats->tx_csum += tstats->csum;
1632d2
 		}
1632d2
 
1632d2
@@ -103,6 +210,13 @@ static void ionic_get_lif_stats(struct ionic_lif *lif,
1632d2
 			stats->rx_csum_error += rstats->csum_error;
1632d2
 		}
1632d2
 	}
1632d2
+
1632d2
+	ionic_get_stats64(lif->netdev, &ns);
1632d2
+	stats->hw_tx_dropped = ns.tx_dropped;
1632d2
+	stats->hw_rx_dropped = ns.rx_dropped;
1632d2
+	stats->hw_rx_over_errors = ns.rx_over_errors;
1632d2
+	stats->hw_rx_missed_errors = ns.rx_missed_errors;
1632d2
+	stats->hw_tx_aborted_errors = ns.tx_aborted_errors;
1632d2
 }
1632d2
 
1632d2
 static u64 ionic_sw_stats_get_count(struct ionic_lif *lif)
1632d2
@@ -118,6 +232,9 @@ static u64 ionic_sw_stats_get_count(struct ionic_lif *lif)
1632d2
 	/* rx stats */
1632d2
 	total += MAX_Q(lif) * IONIC_NUM_RX_STATS;
1632d2
 
1632d2
+	/* port stats */
1632d2
+	total += IONIC_NUM_PORT_STATS;
1632d2
+
1632d2
 	if (test_bit(IONIC_LIF_F_UP, lif->state) &&
1632d2
 	    test_bit(IONIC_LIF_F_SW_DEBUG_STATS, lif->state)) {
1632d2
 		/* tx debug stats */
1632d2
@@ -144,6 +261,13 @@ static void ionic_sw_stats_get_strings(struct ionic_lif *lif, u8 **buf)
1632d2
 		snprintf(*buf, ETH_GSTRING_LEN, ionic_lif_stats_desc[i].name);
1632d2
 		*buf += ETH_GSTRING_LEN;
1632d2
 	}
1632d2
+
1632d2
+	for (i = 0; i < IONIC_NUM_PORT_STATS; i++) {
1632d2
+		snprintf(*buf, ETH_GSTRING_LEN,
1632d2
+			 ionic_port_stats_desc[i].name);
1632d2
+		*buf += ETH_GSTRING_LEN;
1632d2
+	}
1632d2
+
1632d2
 	for (q_num = 0; q_num < MAX_Q(lif); q_num++) {
1632d2
 		for (i = 0; i < IONIC_NUM_TX_STATS; i++) {
1632d2
 			snprintf(*buf, ETH_GSTRING_LEN, "tx_%d_%s",
1632d2
@@ -225,6 +349,7 @@ static void ionic_sw_stats_get_strings(struct ionic_lif *lif, u8 **buf)
1632d2
 
1632d2
 static void ionic_sw_stats_get_values(struct ionic_lif *lif, u64 **buf)
1632d2
 {
1632d2
+	struct ionic_port_stats *port_stats;
1632d2
 	struct ionic_lif_sw_stats lif_stats;
1632d2
 	struct ionic_qcq *txqcq, *rxqcq;
1632d2
 	struct ionic_tx_stats *txstats;
1632d2
@@ -238,6 +363,13 @@ static void ionic_sw_stats_get_values(struct ionic_lif *lif, u64 **buf)
1632d2
 		(*buf)++;
1632d2
 	}
1632d2
 
1632d2
+	port_stats = &lif->ionic->idev.port_info->stats;
1632d2
+	for (i = 0; i < IONIC_NUM_PORT_STATS; i++) {
1632d2
+		**buf = IONIC_READ_STAT_LE64(port_stats,
1632d2
+					     &ionic_port_stats_desc[i]);
1632d2
+		(*buf)++;
1632d2
+	}
1632d2
+
1632d2
 	for (q_num = 0; q_num < MAX_Q(lif); q_num++) {
1632d2
 		txstats = &lif_to_txstats(lif, q_num);
1632d2
 
1632d2
diff --git a/drivers/net/ethernet/pensando/ionic/ionic_stats.h b/drivers/net/ethernet/pensando/ionic/ionic_stats.h
1632d2
index d2c1122a2c6e..3f543512616e 100644
1632d2
--- a/drivers/net/ethernet/pensando/ionic/ionic_stats.h
1632d2
+++ b/drivers/net/ethernet/pensando/ionic/ionic_stats.h
1632d2
@@ -11,6 +11,9 @@
1632d2
 	.offset = IONIC_STAT_TO_OFFSET(type, stat_name) \
1632d2
 }
1632d2
 
1632d2
+#define IONIC_PORT_STAT_DESC(stat_name) \
1632d2
+	IONIC_STAT_DESC(struct ionic_port_stats, stat_name)
1632d2
+
1632d2
 #define IONIC_LIF_STAT_DESC(stat_name) \
1632d2
 	IONIC_STAT_DESC(struct ionic_lif_sw_stats, stat_name)
1632d2
 
1632d2
@@ -45,6 +48,9 @@ extern const int ionic_num_stats_grps;
1632d2
 #define IONIC_READ_STAT64(base_ptr, desc_ptr) \
1632d2
 	(*((u64 *)(((u8 *)(base_ptr)) + (desc_ptr)->offset)))
1632d2
 
1632d2
+#define IONIC_READ_STAT_LE64(base_ptr, desc_ptr) \
1632d2
+	__le64_to_cpu(*((u64 *)(((u8 *)(base_ptr)) + (desc_ptr)->offset)))
1632d2
+
1632d2
 struct ionic_stat_desc {
1632d2
 	char name[ETH_GSTRING_LEN];
1632d2
 	u64 offset;
1632d2
diff --git a/drivers/net/ethernet/pensando/ionic/ionic_txrx.c b/drivers/net/ethernet/pensando/ionic/ionic_txrx.c
1632d2
index 6b14e55a6780..b7f900c11834 100644
1632d2
--- a/drivers/net/ethernet/pensando/ionic/ionic_txrx.c
1632d2
+++ b/drivers/net/ethernet/pensando/ionic/ionic_txrx.c
1632d2
@@ -214,10 +214,11 @@ static void ionic_rx_clean(struct ionic_queue *q,
1632d2
 		     (comp->csum_flags & IONIC_RXQ_COMP_CSUM_F_IP_BAD)))
1632d2
 		stats->csum_error++;
1632d2
 
1632d2
-	if (likely(netdev->features & NETIF_F_HW_VLAN_CTAG_RX)) {
1632d2
-		if (comp->csum_flags & IONIC_RXQ_COMP_CSUM_F_VLAN)
1632d2
-			__vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q),
1632d2
-					       le16_to_cpu(comp->vlan_tci));
1632d2
+	if (likely(netdev->features & NETIF_F_HW_VLAN_CTAG_RX) &&
1632d2
+	    (comp->csum_flags & IONIC_RXQ_COMP_CSUM_F_VLAN)) {
1632d2
+		__vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q),
1632d2
+				       le16_to_cpu(comp->vlan_tci));
1632d2
+		stats->vlan_stripped++;
1632d2
 	}
1632d2
 
1632d2
 	if (le16_to_cpu(comp->len) <= q->lif->rx_copybreak)
1632d2
@@ -860,6 +861,7 @@ static int ionic_tx_tso(struct ionic_queue *q, struct sk_buff *skb)
1632d2
 	stats->pkts += total_pkts;
1632d2
 	stats->bytes += total_bytes;
1632d2
 	stats->tso++;
1632d2
+	stats->tso_bytes += total_bytes;
1632d2
 
1632d2
 	return 0;
1632d2
 
1632d2
@@ -898,9 +900,12 @@ static int ionic_tx_calc_csum(struct ionic_queue *q, struct sk_buff *skb)
1632d2
 				  flags, skb_shinfo(skb)->nr_frags, dma_addr);
1632d2
 	desc->cmd = cpu_to_le64(cmd);
1632d2
 	desc->len = cpu_to_le16(skb_headlen(skb));
1632d2
-	desc->vlan_tci = cpu_to_le16(skb_vlan_tag_get(skb));
1632d2
 	desc->csum_start = cpu_to_le16(skb_checksum_start_offset(skb));
1632d2
 	desc->csum_offset = cpu_to_le16(skb->csum_offset);
1632d2
+	if (has_vlan) {
1632d2
+		desc->vlan_tci = cpu_to_le16(skb_vlan_tag_get(skb));
1632d2
+		stats->vlan_inserted++;
1632d2
+	}
1632d2
 
1632d2
 	if (skb->csum_not_inet)
1632d2
 		stats->crc32_csum++;
1632d2
@@ -935,9 +940,12 @@ static int ionic_tx_calc_no_csum(struct ionic_queue *q, struct sk_buff *skb)
1632d2
 				  flags, skb_shinfo(skb)->nr_frags, dma_addr);
1632d2
 	desc->cmd = cpu_to_le64(cmd);
1632d2
 	desc->len = cpu_to_le16(skb_headlen(skb));
1632d2
-	desc->vlan_tci = cpu_to_le16(skb_vlan_tag_get(skb));
1632d2
+	if (has_vlan) {
1632d2
+		desc->vlan_tci = cpu_to_le16(skb_vlan_tag_get(skb));
1632d2
+		stats->vlan_inserted++;
1632d2
+	}
1632d2
 
1632d2
-	stats->no_csum++;
1632d2
+	stats->csum_none++;
1632d2
 
1632d2
 	return 0;
1632d2
 }
1632d2
-- 
1632d2
2.16.4
1632d2
1632d2