From: Håkon Bugge Date: Thu, 4 Oct 2018 11:04:38 +0000 (+0200) Subject: mlx4_core: Disable P_Key Violation Traps X-Git-Tag: v4.1.12-124.31.3~335 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=ca4da9d5e9d460f583414b94ed68f9ca953eecc5;p=users%2Fjedix%2Flinux-maple.git mlx4_core: Disable P_Key Violation Traps 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 Reviewed-by: Shamir Rabinovitch --- v1 -> v2: * Incorporated review comments form jch * Made the disabling dependent on fw version Signed-off-by: Brian Maly --- diff --git a/drivers/net/ethernet/mellanox/mlx4/fw.c b/drivers/net/ethernet/mellanox/mlx4/fw.c index fda7a08bcf40d..f8b4f1ab5bc5e 100644 --- a/drivers/net/ethernet/mellanox/mlx4/fw.c +++ b/drivers/net/ethernet/mellanox/mlx4/fw.c @@ -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);