mlx4: Remove unused functions
authorDr. David Alan Gilbert <linux@treblig.org>
Mon, 3 Feb 2025 18:52:29 +0000 (18:52 +0000)
committerJakub Kicinski <kuba@kernel.org>
Tue, 4 Feb 2025 22:05:07 +0000 (14:05 -0800)
The last use of mlx4_find_cached_mac() was removed in 2014 by
commit 2f5bb473681b ("mlx4: Add ref counting to port MAC table for RoCE")

mlx4_zone_free_entries() was added in 2014 by
commit 7a89399ffad7 ("net/mlx4: Add mlx4_bitmap zone allocator")
but hasn't been used. (The _unique version is used)

Remove them.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Link: https://patch.msgid.link/20250203185229.204279-1-linux@treblig.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlx4/alloc.c
drivers/net/ethernet/mellanox/mlx4/mlx4.h
drivers/net/ethernet/mellanox/mlx4/port.c
include/linux/mlx4/device.h

index b330020dc0d674ee103c0651a0d48e8f7a2ea0b2..598df63518c5514a9c2d2f0bb283fae2da6a0c7e 100644 (file)
@@ -526,28 +526,6 @@ out:
        return res;
 }
 
-u32 mlx4_zone_free_entries(struct mlx4_zone_allocator *zones, u32 uid, u32 obj, u32 count)
-{
-       struct mlx4_zone_entry *zone;
-       int res = 0;
-
-       spin_lock(&zones->lock);
-
-       zone = __mlx4_find_zone_by_uid(zones, uid);
-
-       if (NULL == zone) {
-               res = -1;
-               goto out;
-       }
-
-       __mlx4_free_from_zone(zone, obj, count);
-
-out:
-       spin_unlock(&zones->lock);
-
-       return res;
-}
-
 u32 mlx4_zone_free_entries_unique(struct mlx4_zone_allocator *zones, u32 obj, u32 count)
 {
        struct mlx4_zone_entry *zone;
index d7d856d1758a39b4e06cd07da0dd0f5b39b0a1e3..b213094ea30f3b2eae0b73c77ed50f28072bad10 100644 (file)
@@ -1478,12 +1478,6 @@ void mlx4_zone_allocator_destroy(struct mlx4_zone_allocator *zone_alloc);
 u32 mlx4_zone_alloc_entries(struct mlx4_zone_allocator *zones, u32 uid, int count,
                            int align, u32 skip_mask, u32 *puid);
 
-/* Free <count> objects, start from <obj> of the uid <uid> from zone_allocator
- * <zones>.
- */
-u32 mlx4_zone_free_entries(struct mlx4_zone_allocator *zones,
-                          u32 uid, u32 obj, u32 count);
-
 /* If <zones> was allocated with MLX4_ZONE_ALLOC_FLAGS_NO_OVERLAP, instead of
  * specifying the uid when freeing an object, zone allocator could figure it by
  * itself. Other parameters are similar to mlx4_zone_free.
index 4e43f4a7d2466692e907c6011fa96f7080f1e198..e3d0b13c1610edc98335dec5a622170fefdf5e46 100644 (file)
@@ -147,26 +147,6 @@ static int mlx4_set_port_mac_table(struct mlx4_dev *dev, u8 port,
        return err;
 }
 
-int mlx4_find_cached_mac(struct mlx4_dev *dev, u8 port, u64 mac, int *idx)
-{
-       struct mlx4_port_info *info = &mlx4_priv(dev)->port[port];
-       struct mlx4_mac_table *table = &info->mac_table;
-       int i;
-
-       for (i = 0; i < MLX4_MAX_MAC_NUM; i++) {
-               if (!table->refs[i])
-                       continue;
-
-               if (mac == (MLX4_MAC_MASK & be64_to_cpu(table->entries[i]))) {
-                       *idx = i;
-                       return 0;
-               }
-       }
-
-       return -ENOENT;
-}
-EXPORT_SYMBOL_GPL(mlx4_find_cached_mac);
-
 static bool mlx4_need_mf_bond(struct mlx4_dev *dev)
 {
        int i, num_eth_ports = 0;
index 27f42f713c891cf2491331ecec9e99bbe33d6926..87edb7a8173b14df4af30c436f9c29d78158778b 100644 (file)
@@ -1415,7 +1415,6 @@ int mlx4_get_is_vlan_offload_disabled(struct mlx4_dev *dev, u8 port,
                                      bool *vlan_offload_disabled);
 void mlx4_handle_eth_header_mcast_prio(struct mlx4_net_trans_rule_hw_ctrl *ctrl,
                                       struct _rule_hw *eth_header);
-int mlx4_find_cached_mac(struct mlx4_dev *dev, u8 port, u64 mac, int *idx);
 int mlx4_find_cached_vlan(struct mlx4_dev *dev, u8 port, u16 vid, int *idx);
 int mlx4_register_vlan(struct mlx4_dev *dev, u8 port, u16 vlan, int *index);
 void mlx4_unregister_vlan(struct mlx4_dev *dev, u8 port, u16 vlan);