linux_dsm_epyc7002/drivers/infiniband/hw/hns
Xi Wang 60c3becfd1 RDMA/hns: Fix sg offset non-zero issue
When run perftest in many times, the system will report a BUG as follows:

   BUG: Bad rss-counter state mm:(____ptrval____) idx:0 val:-1
   BUG: Bad rss-counter state mm:(____ptrval____) idx:1 val:1

We tested with different kernel version and found it started from the the
following commit:

commit d10bcf947a ("RDMA/umem: Combine contiguous PAGE_SIZE regions in
SGEs")

In this commit, the sg->offset is always 0 when sg_set_page() is called in
ib_umem_get() and the drivers are not allowed to change the sgl, otherwise
it will get bad page descriptor when unfolding SGEs in __ib_umem_release()
as sg_page_count() will get wrong result while sgl->offset is not 0.

However, there is a weird sgl usage in the current hns driver, the driver
modified sg->offset after calling ib_umem_get(), which caused we iterate
past the wrong number of pages in for_each_sg_page iterator.

This patch fixes it by correcting the non-standard sgl usage found in the
hns_roce_db_map_user() function.

Fixes: d10bcf947a ("RDMA/umem: Combine contiguous PAGE_SIZE regions in SGEs")
Fixes: 0425e3e6e0 ("RDMA/hns: Support flush cqe for hip08 in kernel space")
Link: https://lore.kernel.org/r/1562808737-45723-1-git-send-email-oulijun@huawei.com
Signed-off-by: Xi Wang <wangxi11@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
2019-07-22 14:44:08 -03:00
..
hns_roce_ah.c RDMA: Introduce and use GID attr helper to read RoCE L2 fields 2019-05-03 11:10:02 -03:00
hns_roce_alloc.c RDMA/hns: Cleanup unnecessary exported symbols 2019-06-25 14:48:44 -03:00
hns_roce_cmd.c RDMA/hns: Clean up unnecessary variable initialization 2019-07-07 09:19:38 -03:00
hns_roce_cmd.h RDMA/hns: Dump detailed driver-specific CQ 2019-04-08 13:05:25 -03:00
hns_roce_common.h RDMA/hns: Remove asynchronic QP destroy 2019-04-24 10:55:31 -03:00
hns_roce_cq.c RDMA/hns: Cleanup unnecessary exported symbols 2019-06-25 14:48:44 -03:00
hns_roce_db.c RDMA/hns: Fix sg offset non-zero issue 2019-07-22 14:44:08 -03:00
hns_roce_device.h RDMA/hns: Fix bug when wqe num is larger than 16K 2019-06-20 12:56:34 -04:00
hns_roce_hem.c RDMA/hns: Cleanup unnecessary exported symbols 2019-06-25 14:48:44 -03:00
hns_roce_hem.h RDMa/hns: Don't stuck in endless timeout loop 2019-06-20 15:39:43 -04:00
hns_roce_hw_v1.c 5.3 Merge window RDMA pull request 2019-07-15 20:38:15 -07:00
hns_roce_hw_v1.h RDMA/hns: Remove asynchronic QP destroy 2019-04-24 10:55:31 -03:00
hns_roce_hw_v2_dfx.c RDMA/hns: Dump detailed driver-specific CQ 2019-04-08 13:05:25 -03:00
hns_roce_hw_v2.c RDMA/hns: Clean up unnecessary variable initialization 2019-07-07 09:19:38 -03:00
hns_roce_hw_v2.h RDMA/hns: reset function when removing module 2019-06-20 15:05:48 -04:00
hns_roce_main.c RDMA/hns: Clean up unnecessary variable initialization 2019-07-07 09:19:38 -03:00
hns_roce_mr.c RDMA/hns: Cleanup unnecessary exported symbols 2019-06-25 14:48:44 -03:00
hns_roce_pd.c RDMA/hns: Clean up unnecessary variable initialization 2019-07-07 09:19:38 -03:00
hns_roce_qp.c RDMA/hns: Fixs hw access invalid dma memory error 2019-07-07 09:19:38 -03:00
hns_roce_restrack.c RDMA/hns: Dump detailed driver-specific CQ 2019-04-08 13:05:25 -03:00
hns_roce_srq.c RDMA/hns: Cleanup unnecessary exported symbols 2019-06-25 14:48:44 -03:00
Kconfig Linux 5.2-rc6 2019-06-28 21:18:23 -03:00
Makefile RDMA/hns: Fix building modular hns 2019-07-04 13:41:50 -03:00