IB/hfi1: Fetch monitor values on-demand for CableInfo query
Subsystems (2)
PATCH 1/1 IB/hfi1: Fetch monitor values on-demand for CableInfo query
From: Easwar Hariharan <[email protected]>
The monitor values from bytes 22 through 81 of the QSFP memory space (SFF 8636) are dynamic and serving them out of the QSFP memory cache maintained by the driver provides stale data to the CableInfo SMA query. This patch refreshes the dynamic values from the QSFP memory on request and overwrites the stale data from the cache for the overlap between the requested range and the monitor range.
--- drivers/infiniband/hw/hfi1/qsfp.c | 32 ++++++++++++++++++++++++++++++-- drivers/infiniband/hw/hfi1/qsfp.h | 3 +++ 2 files changed, 33 insertions(+), 2 deletions(-)
drivers/infiniband/hw/hfi1/qsfp.c +30 -2
@@ -706,8 +706,8 @@ int get_cable_info(struct hfi1_devdata *dd, u32 port_num, u32 addr, u32 len, u8 *data) {struct hfi1_pportdata *ppd; -u32 excess_len =0 ; -int ret =0 ; +u32 excess_len = len; +int ret =0 , offset =0 ;if (port_num > dd->num_pports || port_num <1 ) { dd_dev_info(dd, "%s: Invalid port number %d\n",
@@ -740,6 +740,34 @@ int get_cable_info(struct hfi1_devdata *dd, u32 port_num, u32 addr, u32 len, }memcpy (data, &ppd->qsfp_info.cache[addr], len); + +if (addr <=QSFP_MONITOR_VAL_END && + (addr + len) >=QSFP_MONITOR_VAL_START ) { +/* Overlap with the dynamic channel monitor range */ +if (addr <QSFP_MONITOR_VAL_START ) { +if (addr + len <=QSFP_MONITOR_VAL_END ) + len = addr + len -QSFP_MONITOR_VAL_START ; +else + len =QSFP_MONITOR_RANGE ; + offset =QSFP_MONITOR_VAL_START - addr; + addr =QSFP_MONITOR_VAL_START ; + }else if (addr ==QSFP_MONITOR_VAL_START ) { + offset =0 ; +if (addr + len >QSFP_MONITOR_VAL_END ) + len =QSFP_MONITOR_RANGE ; + }else { + offset =0 ; +if (addr + len >QSFP_MONITOR_VAL_END ) + len =QSFP_MONITOR_VAL_END - addr +1 ; + } +/* Refresh the values of the dynamic monitors from the cable */ + ret =one_qsfp_read (ppd, dd->hfi1_id, addr, data + offset, len); +if (ret != len) { + ret = -EAGAIN ; + goto set_zeroes; + } + } +return 0 ; set_zeroes:
drivers/infiniband/hw/hfi1/qsfp.h +3 -0
@@ -74,6 +74,9 @@/* Defined fields that Intel requires of qualified cables */ /* Byte 0 is Identifier, not checked */ /* Byte 1 is reserved "status MSB" */ +#define QSFP_MONITOR_VAL_START 22 +#define QSFP_MONITOR_VAL_END 81 +#define QSFP_MONITOR_RANGE (QSFP_MONITOR_VAL_END - QSFP_MONITOR_VAL_START + 1)#define QSFP_TX_CTRL_BYTE_OFFS 86#define QSFP_PWR_CTRL_BYTE_OFFS 93#define QSFP_CDR_CTRL_BYTE_OFFS 98
Signature · 6 lines
1.8.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 1470755838-14117-1-git-send-email-ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org
Quoted 10 lines · On Tue, Aug 09, 2016 at 11:17:18AM -0400…
From: Easwar Hariharan <[email protected]>
The monitor values from bytes 22 through 81 of the QSFP memory space (SFF 8636) are dynamic and serving them out of the QSFP memory cache maintained by the driver provides stale data to the CableInfo SMA query. This patch refreshes the dynamic values from the QSFP memory on request and overwrites the stale data from the cache for the overlap between the requested range and the monitor range.
Ira,
On all your patches, you have double line between commit message and tags.
Quoted 3 lines
Reviewed-by Jubin John <[email protected]>Reviewed-by Ira Weiny <[email protected]>Signed-off-by Easwar Hariharan <[email protected]>
A message that is not in the archive (sent off-list or not yet received): 20160809175801.GD23921-2ukJVAZIZ/[email protected]
Quoted 12 lines · Leon Romanovsky
Quoted 10 lines · On Tue, Aug 09, 2016 at 11:17:18AM -0400…
From: Easwar Hariharan <[email protected]>
The monitor values from bytes 22 through 81 of the QSFP memory space (SFF 8636) are dynamic and serving them out of the QSFP memory cache maintained by the driver provides stale data to the CableInfo SMA query. This patch refreshes the dynamic values from the QSFP memory on request and overwrites the stale data from the cache for the overlap between the requested range and the monitor range.
Quoted 3 lines
Ira,
On all your patches, you have double line between commit message and tags.
Does this cause a problem?
Ira
Quoted 4 lines
Quoted 4 lines
Reviewed-by Jubin John <[email protected]>Reviewed-by Ira Weiny <[email protected]>Signed-off-by Easwar Hariharan <[email protected]>
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 20160810053549.GA32695-W4f6Xiosr+yv7QzWx2u06xL4W9x8LtSr@public.gmane.org
Quoted 13 lines · ira.weiny
Quoted 12 lines · Leon Romanovsky
Quoted 10 lines · On Tue, Aug 09, 2016 at 11:17:18AM -0400…
From: Easwar Hariharan <[email protected]>
The monitor values from bytes 22 through 81 of the QSFP memory space (SFF 8636) are dynamic and serving them out of the QSFP memory cache maintained by the driver provides stale data to the CableInfo SMA query. This patch refreshes the dynamic values from the QSFP memory on request and overwrites the stale data from the cache for the overlap between the requested range and the monitor range.
Quoted 5 lines
Quoted 3 lines
Ira,
On all your patches, you have double line between commit message and tags.Does this cause a problem?
Problem - no, inconvenience - yes.
It doesn't look pretty in git history.
Quoted 9 lines
Ira
Quoted 4 lines
Quoted 4 lines
Reviewed-by Jubin John <[email protected]>Reviewed-by Ira Weiny <[email protected]>Signed-off-by Easwar Hariharan <[email protected]>
A message that is not in the archive (sent off-list or not yet received): 20160810055138.GH23921-2ukJVAZIZ/[email protected]
T24gV2VkLCAyMDE2LTA4LTEwIGF0IDA4OjUxICswMzAwLCBMZW9uIFJvbWFub3Zza3kgd3JvdGU6 DQo+IE9uIFdlZCwgQXVnIDEwLCAyMDE2IGF0IDAxOjM1OjUwQU0gLTA0MDAsIGlyYS53ZWlueSB3 cm90ZToNCj4gPiBPbiBUdWUsIEF1ZyAwOSwgMjAxNiBhdCAwODo1ODowMVBNICswMzAwLCBMZW9u IFJvbWFub3Zza3kgd3JvdGU6DQo+ID4g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 YWdzLg0KPiA+IA0KPiA+IERvZXMgdGhpcyBjYXVzZSBhIHByb2JsZW0/DQo+IA0KPiBQcm9ibGVt IC0gbm8sIGluY29udmVuaWVuY2UgLSB5ZXMuDQo+IEl0IGRvZXNuJ3QgbG9vayBwcmV0dHkgaW4g Z2l0IGhpc3RvcnkuDQoNCldlJ2xsIGNhdGNoIGl0IG5leHQgdGltZT8gTm90IHdvcnRoIHJlc3Vi bWl0dGluZyBJIGRvbid0IHRoaW5rLg0KDQotRGVubnk=
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 26 lines · Dennis
Quoted 25 lines · Leon Romanovsky
Quoted 24 lines · ira.weiny
Quoted 22 lines · Leon Romanovsky
Quoted 15 lines · On Tue, Aug 09, 2016 at 11:17:18AM -0400…
From: Easwar Hariharan <[email protected]>
The monitor values from bytes 22 through 81 of the QSFP memory space
(SFF 8636) are dynamic and serving them out of the QSFP memory cache
maintained by the driver provides stale data to the CableInfo SMA query.
This patch refreshes the dynamic values from the QSFP memory on request
and overwrites the stale data from the cache for the overlap between the
requested range and the monitor range.Ira,
On all your patches, you have double line between commit message and
tags.
Quoted 6 lines
Quoted 4 lines
Quoted 1 line
Does this cause a problem?
Problem - no, inconvenience - yes.
It doesn't look pretty in git history.We'll catch it next time? Not worth resubmitting I don't think.
Sure, no problems.
Quoted 2 lines
-Denny
Quoted 13 lines · ira.weiny
Quoted 12 lines · Leon Romanovsky
Quoted 10 lines · On Tue, Aug 09, 2016 at 11:17:18AM -0400…
From: Easwar Hariharan <[email protected]>
The monitor values from bytes 22 through 81 of the QSFP memory space (SFF 8636) are dynamic and serving them out of the QSFP memory cache maintained by the driver provides stale data to the CableInfo SMA query. This patch refreshes the dynamic values from the QSFP memory on request and overwrites the stale data from the cache for the overlap between the requested range and the monitor range.
Quoted 5 lines
Quoted 3 lines
Ira,
On all your patches, you have double line between commit message and tags.Does this cause a problem?
Problem - no, inconvenience - yes.
It doesn't look good in git history.
Quoted 9 lines
Ira
Quoted 4 lines
Quoted 4 lines
Reviewed-by Jubin John <[email protected]>Reviewed-by Ira Weiny <[email protected]>Signed-off-by Easwar Hariharan <[email protected]>
Doug Ledford
AppliedQuoted 10 lines · On 8/9/2016 11:17 AM, [email protected] wrote:
From: Easwar Hariharan <[email protected]>
The monitor values from bytes 22 through 81 of the QSFP memory space (SFF 8636) are dynamic and serving them out of the QSFP memory cache maintained by the driver provides stale data to the CableInfo SMA query. This patch refreshes the dynamic values from the QSFP memory on request and overwrites the stale data from the cache for the overlap between the requested range and the monitor range.
Quoted 3 lines
Reviewed-by Jubin John <[email protected]>Reviewed-by Ira Weiny <[email protected]>Signed-off-by Easwar Hariharan <[email protected]>
Thanks, applied.
Signature · 2 lines
Doug Ledford <[email protected]> GPG Key ID: 0E572FDD