Commit 341c5ee2 authored by Huy Nguyen's avatar Huy Nguyen Committed by David S. Miller

net/mlx5: Add DCBX firmware commands support

Add set/query commands for DCBX_PARAM register
Signed-off-by: default avatarHuy Nguyen <huyn@mellanox.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 820c2c5e
...@@ -548,6 +548,26 @@ int mlx5_max_tc(struct mlx5_core_dev *mdev) ...@@ -548,6 +548,26 @@ int mlx5_max_tc(struct mlx5_core_dev *mdev)
return num_tc - 1; return num_tc - 1;
} }
int mlx5_query_port_dcbx_param(struct mlx5_core_dev *mdev, u32 *out)
{
u32 in[MLX5_ST_SZ_DW(dcbx_param)] = {0};
MLX5_SET(dcbx_param, in, port_number, 1);
return mlx5_core_access_reg(mdev, in, sizeof(in), out,
sizeof(in), MLX5_REG_DCBX_PARAM, 0, 0);
}
int mlx5_set_port_dcbx_param(struct mlx5_core_dev *mdev, u32 *in)
{
u32 out[MLX5_ST_SZ_DW(dcbx_param)];
MLX5_SET(dcbx_param, in, port_number, 1);
return mlx5_core_access_reg(mdev, in, sizeof(out), out,
sizeof(out), MLX5_REG_DCBX_PARAM, 0, 1);
}
int mlx5_set_port_prio_tc(struct mlx5_core_dev *mdev, u8 *prio_tc) int mlx5_set_port_prio_tc(struct mlx5_core_dev *mdev, u8 *prio_tc)
{ {
u32 in[MLX5_ST_SZ_DW(qtct_reg)] = {0}; u32 in[MLX5_ST_SZ_DW(qtct_reg)] = {0};
......
...@@ -104,6 +104,8 @@ enum { ...@@ -104,6 +104,8 @@ enum {
enum { enum {
MLX5_REG_QETCR = 0x4005, MLX5_REG_QETCR = 0x4005,
MLX5_REG_QTCT = 0x400a, MLX5_REG_QTCT = 0x400a,
MLX5_REG_DCBX_PARAM = 0x4020,
MLX5_REG_DCBX_APP = 0x4021,
MLX5_REG_PCAP = 0x5001, MLX5_REG_PCAP = 0x5001,
MLX5_REG_PMTU = 0x5003, MLX5_REG_PMTU = 0x5003,
MLX5_REG_PTYS = 0x5004, MLX5_REG_PTYS = 0x5004,
...@@ -124,6 +126,11 @@ enum { ...@@ -124,6 +126,11 @@ enum {
MLX5_REG_MPCNT = 0x9051, MLX5_REG_MPCNT = 0x9051,
}; };
enum mlx5_dcbx_oper_mode {
MLX5E_DCBX_PARAM_VER_OPER_HOST = 0x0,
MLX5E_DCBX_PARAM_VER_OPER_AUTO = 0x3,
};
enum { enum {
MLX5_ATOMIC_OPS_CMP_SWAP = 1 << 0, MLX5_ATOMIC_OPS_CMP_SWAP = 1 << 0,
MLX5_ATOMIC_OPS_FETCH_ADD = 1 << 1, MLX5_ATOMIC_OPS_FETCH_ADD = 1 << 1,
......
...@@ -162,4 +162,6 @@ void mlx5_query_port_fcs(struct mlx5_core_dev *mdev, bool *supported, ...@@ -162,4 +162,6 @@ void mlx5_query_port_fcs(struct mlx5_core_dev *mdev, bool *supported,
int mlx5_query_module_eeprom(struct mlx5_core_dev *dev, int mlx5_query_module_eeprom(struct mlx5_core_dev *dev,
u16 offset, u16 size, u8 *data); u16 offset, u16 size, u8 *data);
int mlx5_query_port_dcbx_param(struct mlx5_core_dev *mdev, u32 *out);
int mlx5_set_port_dcbx_param(struct mlx5_core_dev *mdev, u32 *in);
#endif /* __MLX5_PORT_H__ */ #endif /* __MLX5_PORT_H__ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment