]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
mlx4_core: Disable P_Key Violation Traps
authorHåkon Bugge <Haakon.Bugge@oracle.com>
Thu, 4 Oct 2018 11:04:38 +0000 (13:04 +0200)
committerBrian Maly <brian.maly@oracle.com>
Fri, 11 Jan 2019 18:15:38 +0000 (13:15 -0500)
Exadata virt edition, actively using IB partitions, is exposed to
excessive P_Key Violation Traps being sent to the SM. This is close to
a DoS attack. In addition, the OpenSM logs are flooded with these
messages, hiding potential other log messages deemed important to
investigate customer issues.

In fw version 2.35.6312, the traps are disabled, still counting the
P-Key Violations.

This commit will conditionally disable the P_Key Violation Traps
subject to fw version.

Orabug: 27693633

Signed-off-by: Håkon Bugge <haakon.bugge@oracle.com>
Reviewed-by: Shamir Rabinovitch <shamir.rabinovitch@oracle.com>
---

v1 -> v2:
   * Incorporated review comments form jch
   * Made the disabling dependent on fw version

Signed-off-by: Brian Maly <brian.maly@oracle.com>
drivers/net/ethernet/mellanox/mlx4/fw.c

index fda7a08bcf40d947ee12736e7119f29c0457b30b..f8b4f1ab5bc5e053a9ced3fb4c4954b20f6ef3fd 100644 (file)
@@ -1753,6 +1753,15 @@ int mlx4_INIT_HCA(struct mlx4_dev *dev, struct mlx4_init_hca_param *param)
        if (dev->caps.flags & MLX4_DEV_CAP_FLAG_RSS_IP_FRAG)
                *(inbox + INIT_HCA_FLAGS_OFFSET / 4) |= cpu_to_be32(1 << 13);
 
+       /* Disable P_Key Violation Traps for fw version 2.35.6312 and
+        * newer. This because said fw version counts the P_Key
+        * Violations, a feature missing from earlier versions.
+        */
+       if (dev->caps.fw_ver >= mlx4_fw_ver(2, 35, 6312)) {
+               *(inbox + INIT_HCA_FLAGS_OFFSET / 4) |= cpu_to_be32(1 << 15);
+               mlx4_info(dev, "P_Key Violation Traps disabled\n");
+       }
+
        /* CX3 is capable of extending CQEs/EQEs from 32 to 64 bytes */
        if (dev->caps.flags & MLX4_DEV_CAP_FLAG_64B_EQE) {
                *(inbox + INIT_HCA_EQE_CQE_OFFSETS / 4) |= cpu_to_be32(1 << 29);