IB/iser: Handle lack of memory management extentions correctly
Subsystems (2)
PATCH 1/1 IB/iser: Handle lack of memory management extentions correctly
max_fast_reg_page_list_len is only valid when the memory management extentions are signaled by the underlying driver.
Fix by adjusting iser_calc_scsi_params() to use ISCSI_ISER_MAX_SG_TABLESIZE when the extentions are not indicated.
--- drivers/infiniband/ulp/iser/iser_verbs.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/infiniband/ulp/iser/iser_verbs.c +8 -2
@@ -708,8 +708,14 @@ static void iser_connect_error(struct rdma_cm_id *cma_id)unsigned short sg_tablesize, sup_sg_tablesize; sg_tablesize =DIV_ROUND_UP (max_sectors *512 ,SIZE_4K ); - sup_sg_tablesize =min_t (unsigned,ISCSI_ISER_MAX_SG_TABLESIZE , - device->ib_device->attrs.max_fast_reg_page_list_len); +if (device->ib_device->attrs.device_cap_flags & +IB_DEVICE_MEM_MGT_EXTENSIONS ) + sup_sg_tablesize = +min_t ( + uint,ISCSI_ISER_MAX_SG_TABLESIZE , + device->ib_device->attrs.max_fast_reg_page_list_len); +else + sup_sg_tablesize =ISCSI_ISER_MAX_SG_TABLESIZE ; iser_conn->scsi_sg_tablesize =min (sg_tablesize, sup_sg_tablesize); }
--
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): 20170622190110.27788.19910.stgit-K+u1se/DcYrLESAwzcoQNrvm/[email protected]
Sagi Grimberg
Acked-byHi Mike, for the patch itself, it addresses a bug so,
But,
As for not having any max pages for FMR it's really annoying.
What do you think about exposing max_fast_reg_page_list_len to limit also for FMRs? We can also rename it to max_reg_page_list_len to get rid of the FRWR association.
Thoughts?
--
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): 55a85363-da66-f6d6-f5cc-08b20f148f36-NQWnxTmZq1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d2lsbCBhdWRpdCBrZXJuZWwgcHJvdmlk ZXJzIGZvciB3aGljaCBvbmVzIGJlc2lkZXMgcWliIGRvIG5vdCBzdXBwb3J0IHRoZSBleHRlbnNp b25zIGFuZCBGTVIuDQoNCk1pa2UNCg==
--
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): 32E1700B9017364D9B60AED9960492BC34327953-RjuIdWtd+YbTXloPLtfHfbfspsVTdybXVpNB7YpNyf8@public.gmane.org
Hi Mike,
will take a look at it tomorrow, on which kernel version is the patch based?
Thomas
Quoted 16 lines · Mike
Quoted 6 lines
Hi Mike, for the patch itself, it addresses a bug so,
Acked-by Sagi Grimberg <[email protected]>But,
Quoted 7 lines
As for not having any max pages for FMR it's really annoying.
What do you think about exposing
max_fast_reg_page_list_lento limit also for FMRs? We can also rename it tomax_reg_page_list_lento get rid of the FRWR association.Thoughts?
I have no issue with your proposal, but I would rather get this fixed and adjust the API with an additional fix. I suspect we probably want to mark this fix stable.
Quoted 7 lines
I did audit the kernel ULPs for FMR vs. FRMR usage and the only one that looked at
max_fast_reg_page_list_lenunconditionally was iser.Thomas, can you verify this patch and reply with a Tested-by:
Meanwhile, I will audit kernel providers for which ones besides qib do not support the extensions and FMR.
Mike
--
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): 3AAAAD6A-8C14-4B33-AB7A-2AFB49239DFB-+32LHaKS/[email protected]
Quoted 7 lines
Hi Mike,
will take a look at it tomorrow, on which kernel version is the patch based?
Thomas
The latest 4.12-rc should be fine.
Mike
--
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
Quoted 2 lines
I have no issue with your proposal, but I would rather get this fixed and adjust the API with an additional fix. I suspect we probably want to mark this fix stable.
I agree, we should get it in and fix the API incrementally.
Quoted 1 line
I did audit the kernel ULPs for FMR vs. FRMR usage and the only one that looked at
max_fast_reg_page_list_lenunconditionally was iser.
Correct, but it doesn't mean that others get it right.
nfs uses a hard coded value without even knowing what the device is capable of, and srp calculates it from max_mr_size which is a user-space mr capability and has nothing to do with fmrs.
So no one got it right, which is not surprising as we don't have a cap for it.
--
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
Quoted 9 lines
Quoted 8 lines
As for not having any max pages for FMR it's really annoying.
What do you think about exposing
max_fast_reg_page_list_lento limit also for FMRs? We can also rename it tomax_reg_page_list_lento get rid of the FRWR association.Thoughts?
Quoted 7 lines
I have no issue with your proposal, but I would rather get this fixed and adjust the API with an additional fix. I suspect we probably want to mark this fix stable.
I did audit the kernel ULPs for FMR vs. FRMR usage and the only one that looked at
max_fast_reg_page_list_lenunconditionally was iser.Thomas, can you verify this patch and reply with a Tested-by:
Meanwhile, I will audit kernel providers for which ones besides qib do not support the extensions and FMR.
So what is the page_list limitation for qib? I want to prepare some patches... --
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): a5bcb1b5-6f9a-f6bd-cd3a-bf750bc19869-NQWnxTmZq1alnMjI0IkVqw@public.gmane.org
Quoted 1 line
So what is the
page_listlimitation for qib? I want to prepare some patches...
Ping?
--
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): 873c3816-990a-ab20-058d-2aa15c7318b4-NQWnxTmZq1alnMjI0IkVqw@public.gmane.org
PiBTdWJqZWN0OiBSZTogW1BBVENIXSBJQi9pc2VyOiBIYW5kbGUgbGFjayBvZiBtZW1vcnkgbWFu YWdlbWVudA0KPiBleHRlbnRpb25zIGNvcnJlY3RseQ0KPiANCj4gPiBTbyB3aGF0IGlzIHRoZSBw YWdlX2xpc3QgbGltaXRhdGlvbiBmb3IgcWliPyBJIHdhbnQgdG8gcHJlcGFyZSBzb21lDQo+ID4g cGF0Y2hlcy4uLg0KPiANCg0KU29ycnksIHN0aWxsIGNhdGNoaW5nIHVwIGFmdGVyIGEgZmV3IGRh eXMgb2ZmLg0KDQpJIHdvdWxkIHN1Z2dlc3QgVUlOVF9NQVggd2hpY2ggbWF0Y2hlcyBoZmkxIHJl Z2lzdHJhdGlvbiBmb3IgZmFzdCByZWcgbm93Lg0KDQpNaWtlDQoNCg0KDQoNCg0KDQo= --
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
Thomas Rosenstein
Tested-byQuoted 38 lines · Mike Marciniszyn
max_fast_reg_page_list_lenis only valid when the memory management extentions are signaled by the underlying driver.Fix by adjusting
iser_calc_scsi_params()to useISCSI_ISER_MAX_SG_TABLESIZEwhen the extentions are not indicated.Fixes Commit df749cdc45d9 ("IB/iser: Support up to 8MB data transfer in a single command")Reviewed-by Dennis Dalessandro <[email protected]>Signed-off-by Mike Marciniszyn <[email protected]>--- drivers/infiniband/ulp/iser/iser_verbs.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)drivers/infiniband/ulp/iser/iser_verbs.c +8
-2@@ -708,8 +708,14 @@ static void iser_connect_error(struct rdma_cm_id *cma_id)unsigned short sg_tablesize, sup_sg_tablesize; sg_tablesize =DIV_ROUND_UP (max_sectors *512 ,SIZE_4K ); - sup_sg_tablesize =min_t (unsigned,ISCSI_ISER_MAX_SG_TABLESIZE , - device->ib_device->attrs.max_fast_reg_page_list_len); +if (device->ib_device->attrs.device_cap_flags & +IB_DEVICE_MEM_MGT_EXTENSIONS ) + sup_sg_tablesize = +min_t ( + uint,ISCSI_ISER_MAX_SG_TABLESIZE , + device->ib_device->attrs.max_fast_reg_page_list_len); +else + sup_sg_tablesize =ISCSI_ISER_MAX_SG_TABLESIZE ; iser_conn->scsi_sg_tablesize =min (sg_tablesize, sup_sg_tablesize);}
Quoted 4 lines
--
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
--
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
Quoted 11 lines · Mike Marciniszyn
max_fast_reg_page_list_lenis only valid when the memory management extentions are signaled by the underlying driver.Fix by adjusting
iser_calc_scsi_params()to useISCSI_ISER_MAX_SG_TABLESIZEwhen the extentions are not indicated.Fixes Commit df749cdc45d9 ("IB/iser: Support up to 8MB data transfer in a single command")Reviewed-by Dennis Dalessandro <[email protected]>Signed-off-by Mike Marciniszyn <[email protected]>
This was accepted in 4.13-rc, thanks.
Signature · 3 lines
Doug Ledford <[email protected]> GPG Key ID: B826A3330E572FDD Key fingerprint = AE6B 1BDA 122B 23B4 265B 1274 B826 A333 0E57 2FDD