Thread (12 messages) flat view 12 messages, 4 authors, 2011-03-24

Re: [PATCH v2 08/16] mlx4_en: Reporting HW revision in ethtool -i

From: David Miller <davem@davemloft.net>
Date: 2011-03-23 19:33:48

From: Ben Hutchings <redacted>
Date: Wed, 23 Mar 2011 14:04:14 +0000
On Wed, 2011-03-23 at 10:38 +0200, Yevgeny Petrilin wrote:
quoted
HW revision is derived from device ID and rev id.
[...]
quoted
-	sprintf(drvinfo->driver, DRV_NAME " (%s)", mdev->dev->board_id);
+	switch (mdev->dev->rev_id) {
+	case 0xa0:
+		if (dev->dev_id >= MLX4_EN_CX3_LOW_ID && dev->dev_id <= MLX4_EN_CX3_HIGH_ID)
+			sprintf(drvinfo->driver, DRV_NAME " (%s_CX-3)", mdev->dev->board_id);
+		else
+			sprintf(drvinfo->driver, DRV_NAME " (%s_CX)", mdev->dev->board_id);
+		break;
+	case 0xb0:
+		sprintf(drvinfo->driver, DRV_NAME " (%s_CX-2)", mdev->dev->board_id);
+		break;
+	default:
+		sprintf(drvinfo->driver, DRV_NAME " (%s)", mdev->dev->board_id);
+		break;
[...]

This is an abuse of the ethtool_drvinfo::driver field.

Your users can use lspci -v, can't they?
Agreed, mlx4 folks please send me a follow-up patch that removes this
conditional string.

The driver string is only meant to identify the software, not the
hardware variant.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help