svn commit: r331575 - in stable/11/sys/dev/mlx5: . mlx5_core mlx5_en
Hans Petter Selasky
hselasky at FreeBSD.org
Mon Mar 26 20:10:51 UTC 2018
Author: hselasky
Date: Mon Mar 26 20:10:49 2018
New Revision: 331575
URL: https://svnweb.freebsd.org/changeset/base/331575
Log:
MFC r330604:
Add log message for unsupported QSFPs in mlx5core.
Submitted by: Matthew Finlay <matt at mellanox.com>
Sponsored by: Mellanox Technologies
Modified:
stable/11/sys/dev/mlx5/device.h
stable/11/sys/dev/mlx5/mlx5_core/mlx5_eq.c
stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
Directory Properties:
stable/11/ (props changed)
Modified: stable/11/sys/dev/mlx5/device.h
==============================================================================
--- stable/11/sys/dev/mlx5/device.h Mon Mar 26 20:09:36 2018 (r331574)
+++ stable/11/sys/dev/mlx5/device.h Mon Mar 26 20:10:49 2018 (r331575)
@@ -501,9 +501,10 @@ struct mlx5_eqe_vport_change {
#define PORT_MODULE_EVENT_ERROR_TYPE_MASK 0xF
enum {
- MLX5_MODULE_STATUS_PLUGGED = 0x1,
- MLX5_MODULE_STATUS_UNPLUGGED = 0x2,
- MLX5_MODULE_STATUS_ERROR = 0x3,
+ MLX5_MODULE_STATUS_PLUGGED_ENABLED = 0x1,
+ MLX5_MODULE_STATUS_UNPLUGGED = 0x2,
+ MLX5_MODULE_STATUS_ERROR = 0x3,
+ MLX5_MODULE_STATUS_PLUGGED_DISABLED = 0x4,
};
enum {
@@ -512,7 +513,7 @@ enum {
MLX5_MODULE_EVENT_ERROR_BUS_STUCK = 0x2,
MLX5_MODULE_EVENT_ERROR_NO_EEPROM_RETRY_TIMEOUT = 0x3,
MLX5_MODULE_EVENT_ERROR_ENFORCE_PART_NUMBER_LIST = 0x4,
- MLX5_MODULE_EVENT_ERROR_UNKNOWN_IDENTIFIER = 0x5,
+ MLX5_MODULE_EVENT_ERROR_UNSUPPORTED_CABLE = 0x5,
MLX5_MODULE_EVENT_ERROR_HIGH_TEMPERATURE = 0x6,
MLX5_MODULE_EVENT_ERROR_CABLE_IS_SHORTED = 0x7,
};
Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_eq.c
==============================================================================
--- stable/11/sys/dev/mlx5/mlx5_core/mlx5_eq.c Mon Mar 26 20:09:36 2018 (r331574)
+++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_eq.c Mon Mar 26 20:10:49 2018 (r331575)
@@ -618,8 +618,8 @@ static const char *mlx5_port_module_event_error_type_t
return "No EEPROM/retry timeout";
case MLX5_MODULE_EVENT_ERROR_ENFORCE_PART_NUMBER_LIST:
return "Enforce part number list";
- case MLX5_MODULE_EVENT_ERROR_UNKNOWN_IDENTIFIER:
- return "Unknown identifier";
+ case MLX5_MODULE_EVENT_ERROR_UNSUPPORTED_CABLE:
+ return "Unsupported Cable";
case MLX5_MODULE_EVENT_ERROR_HIGH_TEMPERATURE:
return "High Temperature";
case MLX5_MODULE_EVENT_ERROR_CABLE_IS_SHORTED:
@@ -655,8 +655,8 @@ static void mlx5_port_module_event(struct mlx5_core_de
PORT_MODULE_EVENT_ERROR_TYPE_MASK;
switch (module_status) {
- case MLX5_MODULE_STATUS_PLUGGED:
- device_printf((&pdev->dev)->bsddev, "INFO: ""Module %u, status: plugged\n", module_num);
+ case MLX5_MODULE_STATUS_PLUGGED_ENABLED:
+ device_printf((&pdev->dev)->bsddev, "INFO: ""Module %u, status: plugged and enabled\n", module_num);
break;
case MLX5_MODULE_STATUS_UNPLUGGED:
@@ -665,6 +665,10 @@ static void mlx5_port_module_event(struct mlx5_core_de
case MLX5_MODULE_STATUS_ERROR:
device_printf((&pdev->dev)->bsddev, "INFO: ""Module %u, status: error, %s\n", module_num, mlx5_port_module_event_error_type_to_string(error_type));
+ break;
+
+ case MLX5_MODULE_STATUS_PLUGGED_DISABLED:
+ device_printf((&pdev->dev)->bsddev, "INFO: ""Module %u, status: plugged but disabled\n", module_num);
break;
default:
Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
==============================================================================
--- stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Mar 26 20:09:36 2018 (r331574)
+++ stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Mar 26 20:10:49 2018 (r331575)
@@ -2534,6 +2534,7 @@ mlx5e_ioctl(struct ifnet *ifp, u_long command, caddr_t
int error = 0;
int mask = 0;
int size_read = 0;
+ int module_status;
int module_num;
int max_mtu;
uint8_t read_addr;
@@ -2723,8 +2724,9 @@ out:
goto err_i2c;
}
/* Check if module is present before doing an access */
- if (mlx5_query_module_status(priv->mdev, module_num) !=
- MLX5_MODULE_STATUS_PLUGGED) {
+ module_status = mlx5_query_module_status(priv->mdev, module_num);
+ if (module_status != MLX5_MODULE_STATUS_PLUGGED_ENABLED &&
+ module_status != MLX5_MODULE_STATUS_PLUGGED_DISABLED) {
error = EINVAL;
goto err_i2c;
}
More information about the svn-src-all
mailing list