]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
IB/mlx4: Print error messages when GID table update failed
authorMoni Shoua <monis@mellanox.co.il>
Wed, 11 Dec 2013 11:29:29 +0000 (13:29 +0200)
committerMukesh Kacker <mukesh.kacker@oracle.com>
Tue, 7 Jul 2015 21:45:17 +0000 (14:45 -0700)
When trying to add a GID to a full GID table or when trying
to delete a GID which is not in the GID table an error will
be printed to the kernel log.

Signed-off-by: Moni Shoua <monis@mellanox.co.il>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
drivers/infiniband/hw/mlx4/main.c

index 78010087765965e6d5cd020730f305b9c39f2c81..199cfa15fde5a85bc773c5b266e6b30dfd98473a 100644 (file)
@@ -1626,6 +1626,15 @@ static int update_gid_table(struct mlx4_ib_dev *dev, int port,
                }
        }
 
+       if (found == -1 && !clear && free < 0) {
+               pr_err("GID table of port %d is full. Can't add %pI6\n",
+                      port, gid);
+               return -ENOMEM;
+       }
+       if (found == -1 && clear) {
+               pr_err("%pI6 is not in GID table of port %d\n", gid, port);
+               return -EINVAL;
+       }
        if (found == -1 && !clear && free >= 0) {
                dev->iboe.gid_table[port - 1][free] = *gid;
                need_update = 1;