lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <12a1d143-35d6-43f3-b8b3-ab0198f5540a@ans.pl>
Date: Wed, 11 Sep 2024 23:40:21 -0700
From: Krzysztof Olędzki <ole@....pl>
To: Ido Schimmel <idosch@...dia.com>, Tariq Toukan <tariqt@...dia.com>,
        "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>, Yishai Hadas <yishaih@...dia.com>
Cc: "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        linux-rdma@...r.kernel.org
Subject: [PATCH net-next 2/4] mlx4: Use MLX4_ATTR_CABLE_INFO instead of 0xFF60
 magic value

Use MLX4_ATTR_CABLE_INFO instead of 0xFF60 magic value.

Also, remove MLX4_ATTR_EXTENDED_PORT_INFO which should have been done in
commit 8154c07fe14e ("mlx4_core: Get rid of redundant ext_port_cap flags").

Signed-off-by: Krzysztof Piotr Oledzki <ole@....pl>
---
 drivers/net/ethernet/mellanox/mlx4/port.c | 8 ++++----
 include/linux/mlx4/device.h               | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/port.c b/drivers/net/ethernet/mellanox/mlx4/port.c
index 6dbd505e7f30..1ebd459d1d21 100644
--- a/drivers/net/ethernet/mellanox/mlx4/port.c
+++ b/drivers/net/ethernet/mellanox/mlx4/port.c
@@ -2052,7 +2052,7 @@ static int mlx4_get_module_id(struct mlx4_dev *dev, u8 port, u8 *module_id)
 	inmad->class_version = 0x1;
 	inmad->mgmt_class = 0x1;
 	inmad->base_version = 0x1;
-	inmad->attr_id = cpu_to_be16(0xFF60); /* Module Info */
+	inmad->attr_id = cpu_to_be16(MLX4_ATTR_CABLE_INFO);
 
 	cable_info = (struct mlx4_cable_info *)inmad->data;
 	cable_info->dev_mem_address = 0;
@@ -2071,7 +2071,7 @@ static int mlx4_get_module_id(struct mlx4_dev *dev, u8 port, u8 *module_id)
 		ret = be16_to_cpu(outmad->status);
 		mlx4_warn(dev,
 			  "MLX4_CMD_MAD_IFC Get Module ID attr(%x) port(%d) i2c_addr(%x) offset(%d) size(%d): Response Mad Status(%x) - %s\n",
-			  0xFF60, port, I2C_ADDR_LOW, 0, 1, ret,
+			  MLX4_ATTR_CABLE_INFO, port, I2C_ADDR_LOW, 0, 1, ret,
 			  cable_info_mad_err_str(ret));
 		ret = -ret;
 		goto out;
@@ -2170,7 +2170,7 @@ int mlx4_get_module_info(struct mlx4_dev *dev, u8 port,
 	inmad->class_version = 0x1;
 	inmad->mgmt_class = 0x1;
 	inmad->base_version = 0x1;
-	inmad->attr_id = cpu_to_be16(0xFF60); /* Module Info */
+	inmad->attr_id = cpu_to_be16(MLX4_ATTR_CABLE_INFO);
 
 	if (offset < I2C_PAGE_SIZE && offset + size > I2C_PAGE_SIZE)
 		/* Cross pages reads are not allowed
@@ -2195,7 +2195,7 @@ int mlx4_get_module_info(struct mlx4_dev *dev, u8 port,
 		ret = be16_to_cpu(outmad->status);
 		mlx4_warn(dev,
 			  "MLX4_CMD_MAD_IFC Get Module info attr(%x) port(%d) i2c_addr(%x) offset(%d) size(%d): Response Mad Status(%x) - %s\n",
-			  0xFF60, port, i2c_addr, offset, size,
+			  MLX4_ATTR_CABLE_INFO, port, i2c_addr, offset, size,
 			  ret, cable_info_mad_err_str(ret));
 
 		if (i2c_addr == I2C_ADDR_HIGH &&
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
index a75bfb2a4438..4f2ff466b459 100644
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -265,7 +265,7 @@ enum {
 };
 
 
-#define MLX4_ATTR_EXTENDED_PORT_INFO	cpu_to_be16(0xff90)
+#define MLX4_ATTR_CABLE_INFO		0xff60
 
 enum {
 	MLX4_BMME_FLAG_WIN_TYPE_2B	= 1 <<  1,
-- 
2.46.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ