mlxsw: Use dev_level_ratelimited instead of net_ratelimit & dev_level
authorJiri Pirko <jiri@mellanox.com>
Thu, 15 Oct 2015 15:43:22 +0000 (17:43 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 16 Oct 2015 06:27:51 +0000 (23:27 -0700)
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/pci.c
drivers/net/ethernet/mellanox/mlxsw/switchx2.c

index 87afa5f7ef8037d36b5a92beebfa3ea54ed88234..974ce47cec051473c3ea028d2985e916d643045d 100644 (file)
@@ -431,8 +431,7 @@ static int mlxsw_pci_wqe_frag_map(struct mlxsw_pci *mlxsw_pci, char *wqe,
 
        mapaddr = pci_map_single(pdev, frag_data, frag_len, direction);
        if (unlikely(pci_dma_mapping_error(pdev, mapaddr))) {
-               if (net_ratelimit())
-                       dev_err(&pdev->dev, "failed to dma map tx frag\n");
+               dev_err_ratelimited(&pdev->dev, "failed to dma map tx frag\n");
                return -EIO;
        }
        mlxsw_pci_wqe_address_set(wqe, index, mapaddr);
@@ -700,8 +699,8 @@ static void mlxsw_pci_cqe_rdq_handle(struct mlxsw_pci *mlxsw_pci,
 put_new_skb:
        memset(wqe, 0, q->elem_size);
        err = mlxsw_pci_rdq_skb_alloc(mlxsw_pci, elem_info);
-       if (err && net_ratelimit())
-               dev_dbg(&pdev->dev, "Failed to alloc skb for RDQ\n");
+       if (err)
+               dev_dbg_ratelimited(&pdev->dev, "Failed to alloc skb for RDQ\n");
        /* Everything is set up, ring doorbell to pass elem to HW */
        q->producer_counter++;
        mlxsw_pci_queue_doorbell_producer_ring(mlxsw_pci, q);
index f057d43826f1f00b18aaa0553caede67830247de..698b182c77a3976c34f22a6af735572ac511dd48 100644 (file)
@@ -1210,9 +1210,8 @@ static void mlxsw_sx_rx_listener_func(struct sk_buff *skb, u8 local_port,
        struct mlxsw_sx_port_pcpu_stats *pcpu_stats;
 
        if (unlikely(!mlxsw_sx_port)) {
-               if (net_ratelimit())
-                       dev_warn(mlxsw_sx->bus_info->dev, "Port %d: skb received for non-existent port\n",
-                                local_port);
+               dev_warn_ratelimited(mlxsw_sx->bus_info->dev, "Port %d: skb received for non-existent port\n",
+                                    local_port);
                return;
        }