Netdev List
 help / color / mirror / Atom feed
From: "Krzysztof Olędzki" <ole@ans.pl>
To: Ido Schimmel <idosch@nvidia.com>,
	Tariq Toukan <tariqt@nvidia.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Yishai Hadas <yishaih@nvidia.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	linux-rdma@vger.kernel.org
Subject: Re: [PATCH net-next 2/4] mlx4: Use MLX4_ATTR_CABLE_INFO instead of 0xFF60 magic value
Date: Thu, 12 Sep 2024 09:03:33 -0700	[thread overview]
Message-ID: <f8ebfe69-d169-4e97-9191-4fb06db3a9fc@ans.pl> (raw)
In-Reply-To: <12a1d143-35d6-43f3-b8b3-ab0198f5540a@ans.pl>

On 11.09.2024 at 23:40, Krzysztof Olędzki wrote:
> 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").

Turns out this is not true, as it is still used in ib_link_query_port() from drivers/infiniband/hw/mlx4/main.c

Will wait for other comments and then send v2, for consistency how about I'll move cpu_to_be16() into that function?

> 
> Signed-off-by: Krzysztof Piotr Oledzki <ole@ans.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,


  reply	other threads:[~2024-09-12 16:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-12  6:40 [PATCH net-next 2/4] mlx4: Use MLX4_ATTR_CABLE_INFO instead of 0xFF60 magic value Krzysztof Olędzki
2024-09-12 16:03 ` Krzysztof Olędzki [this message]
2024-09-13  4:26 ` kernel test robot
2024-09-13  4:48 ` kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f8ebfe69-d169-4e97-9191-4fb06db3a9fc@ans.pl \
    --to=ole@ans.pl \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=idosch@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=tariqt@nvidia.com \
    --cc=yishaih@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox