git: 026babd427e6 - main - mlx4: purge EOL release compatibility

From: Warner Losh <imp_at_FreeBSD.org>
Date: Sat, 04 Feb 2023 16:20:30 UTC
The branch main has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=026babd427e6511e53478814ce0aa1cc3f7a9988

commit 026babd427e6511e53478814ce0aa1cc3f7a9988
Author:     Elliott Mitchell <ehem+freebsd@m5p.com>
AuthorDate: 2022-06-23 00:53:47 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2023-02-04 16:13:09 +0000

    mlx4: purge EOL release compatibility
    
    Remove FreeBSD 10 support code.
    
    Reviewed by: imp
    Pull Request: https://github.com/freebsd/freebsd-src/pull/603
    Differential Revision: https://reviews.freebsd.org/D35560
---
 sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c |  4 ----
 sys/dev/mlx4/mlx4_en/mlx4_en_port.c   | 12 ------------
 sys/dev/mlx4/mlx4_en/mlx4_en_tx.c     |  3 +--
 3 files changed, 1 insertion(+), 18 deletions(-)

diff --git a/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c b/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c
index 14289cb20e13..bae22317574b 100644
--- a/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c
+++ b/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c
@@ -2067,7 +2067,6 @@ out:
 		mutex_unlock(&mdev->state_lock);
 		VLAN_CAPABILITIES(dev);
 		break;
-#if __FreeBSD_version >= 1100036
 	case SIOCGI2C: {
 		struct ifi2creq i2c;
 
@@ -2091,7 +2090,6 @@ out:
 		error = copyout(&i2c, ifr_data_get_ptr(ifr), sizeof(i2c));
 		break;
 	}
-#endif
 	case SIOCGIFRSSKEY:
 		ifrk = (struct ifrsskey *)data;
 		ifrk->ifrk_func = RSS_FUNC_TOEPLITZ;
@@ -2263,12 +2261,10 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port,
 	if (mdev->LSO_support)
 		dev->if_capabilities |= IFCAP_TSO4 | IFCAP_TSO6 | IFCAP_VLAN_HWTSO;
 
-#if __FreeBSD_version >= 1100000
 	/* set TSO limits so that we don't have to drop TX packets */
 	dev->if_hw_tsomax = MLX4_EN_TX_MAX_PAYLOAD_SIZE - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN) /* hdr */;
 	dev->if_hw_tsomaxsegcount = MLX4_EN_TX_MAX_MBUF_FRAGS - 1 /* hdr */;
 	dev->if_hw_tsomaxsegsize = MLX4_EN_TX_MAX_MBUF_SIZE;
-#endif
 
 	dev->if_capenable = dev->if_capabilities;
 
diff --git a/sys/dev/mlx4/mlx4_en/mlx4_en_port.c b/sys/dev/mlx4/mlx4_en/mlx4_en_port.c
index 2e19130b9e96..89193c68a055 100644
--- a/sys/dev/mlx4/mlx4_en/mlx4_en_port.c
+++ b/sys/dev/mlx4/mlx4_en/mlx4_en_port.c
@@ -346,7 +346,6 @@ int mlx4_en_DUMP_ETH_STATS(struct mlx4_en_dev *mdev, u8 port, u8 reset)
 		vport_stats->tx_frames = be64_to_cpu(tmp_vport_stats.tx_frames);
 	}
 
-#if __FreeBSD_version >= 1100000
 	if (reset == 0) {
 		if_inc_counter(dev, IFCOUNTER_IPACKETS,
 		    priv->pkstats.rx_packets - priv->pkstats_last.rx_packets);
@@ -366,17 +365,6 @@ int mlx4_en_DUMP_ETH_STATS(struct mlx4_en_dev *mdev, u8 port, u8 reset)
 		    priv->pkstats.tx_multicast_packets - priv->pkstats_last.tx_multicast_packets);
 	}
 	priv->pkstats_last = priv->pkstats;
-#else
-	dev->if_ipackets        = priv->pkstats.rx_packets;
-	dev->if_opackets        = priv->pkstats.tx_packets;
-	dev->if_ibytes          = priv->pkstats.rx_bytes;
-	dev->if_obytes          = priv->pkstats.tx_bytes;
-	dev->if_ierrors         = priv->pkstats.rx_errors;
-	dev->if_iqdrops         = priv->pkstats.rx_dropped;
-	dev->if_imcasts         = priv->pkstats.rx_multicast_packets;
-	dev->if_omcasts         = priv->pkstats.tx_multicast_packets;
-	dev->if_collisions      = 0;
-#endif
 
 	spin_unlock(&priv->stats_lock);
 
diff --git a/sys/dev/mlx4/mlx4_en/mlx4_en_tx.c b/sys/dev/mlx4/mlx4_en/mlx4_en_tx.c
index 34af99ae0340..7cff1a224e9a 100644
--- a/sys/dev/mlx4/mlx4_en/mlx4_en_tx.c
+++ b/sys/dev/mlx4/mlx4_en/mlx4_en_tx.c
@@ -981,10 +981,9 @@ mlx4_en_transmit(struct ifnet *dev, struct mbuf *m)
 	/* Poll CQ here */
 	mlx4_en_xmit_poll(priv, i);
 
-#if __FreeBSD_version >= 1100000
 	if (unlikely(err != 0))
 		if_inc_counter(dev, IFCOUNTER_IQDROPS, 1);
-#endif
+
 	return (err);
 }