Re: [PATCH for-rc 4/4] RDMA/hns: Fix the type of doorbell array

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Lijun,

I love your patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v4.17-rc5 next-20180517]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Lijun-Ou/RDMA-hns-Bugfix-for-cq-record-db-for-kernel/20180520-140651
reproduce:
        # apt-get install sparse
        make ARCH=x86_64 allmodconfig
        make C=1 CF=-D__CHECK_ENDIAN__


sparse warnings: (new ones prefixed by >>)

   drivers/infiniband/hw/hns/hns_roce_hem.c:300:17: sparse: invalid assignment: &=
   drivers/infiniband/hw/hns/hns_roce_hem.c:300:17:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hem.c:300:17:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hem.c:300:17: sparse: invalid assignment: |=
   drivers/infiniband/hw/hns/hns_roce_hem.c:300:17:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hem.c:300:17:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hem.c:304:17: sparse: invalid assignment: &=
   drivers/infiniband/hw/hns/hns_roce_hem.c:304:17:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hem.c:304:17:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hem.c:304:17: sparse: invalid assignment: |=
   drivers/infiniband/hw/hns/hns_roce_hem.c:304:17:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hem.c:304:17:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hem.c:309:17: sparse: invalid assignment: &=
   drivers/infiniband/hw/hns/hns_roce_hem.c:309:17:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hem.c:309:17:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hem.c:309:17: sparse: invalid assignment: |=
   drivers/infiniband/hw/hns/hns_roce_hem.c:309:17:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hem.c:309:17:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hem.c:313:17: sparse: invalid assignment: &=
   drivers/infiniband/hw/hns/hns_roce_hem.c:313:17:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hem.c:313:17:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hem.c:313:17: sparse: invalid assignment: |=
   drivers/infiniband/hw/hns/hns_roce_hem.c:313:17:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hem.c:313:17:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hem.c:320:9: sparse: invalid assignment: &=
   drivers/infiniband/hw/hns/hns_roce_hem.c:320:9:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hem.c:320:9:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hem.c:320:9: sparse: invalid assignment: |=
   drivers/infiniband/hw/hns/hns_roce_hem.c:320:9:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hem.c:320:9:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hem.c:322:9: sparse: invalid assignment: &=
   drivers/infiniband/hw/hns/hns_roce_hem.c:322:9:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hem.c:322:9:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hem.c:322:9: sparse: invalid assignment: |=
   drivers/infiniband/hw/hns/hns_roce_hem.c:322:9:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hem.c:322:9:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hem.c:323:9: sparse: invalid assignment: &=
   drivers/infiniband/hw/hns/hns_roce_hem.c:323:9:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hem.c:323:9:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hem.c:323:9: sparse: invalid assignment: |=
   drivers/infiniband/hw/hns/hns_roce_hem.c:323:9:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hem.c:323:9:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hem.c:349:17: sparse: invalid assignment: &=
   drivers/infiniband/hw/hns/hns_roce_hem.c:349:17:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hem.c:349:17:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hem.c:349:17: sparse: invalid assignment: |=
   drivers/infiniband/hw/hns/hns_roce_hem.c:349:17:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hem.c:349:17:    right side has type restricted __le32
>> drivers/infiniband/hw/hns/hns_roce_hem.c:355:36: sparse: incorrect type in argument 1 (different base types) @@    expected restricted __le32 [usertype] *val @@    got 2 [usertype] *val @@
   drivers/infiniband/hw/hns/hns_roce_hem.c:355:36:    expected restricted __le32 [usertype] *val
   drivers/infiniband/hw/hns/hns_roce_hem.c:355:36:    got unsigned int *<noident>
--
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:177:25: sparse: restricted __le32 degrades to integer
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:409:25: sparse: invalid assignment: &=
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:409:25:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:409:25:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:409:25: sparse: invalid assignment: |=
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:409:25:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:409:25:    right side has type restricted __le32
>> drivers/infiniband/hw/hns/hns_roce_hw_v1.c:433:44: sparse: incorrect type in argument 1 (different base types) @@    expected restricted __le32 [usertype] *val @@    got 2 [usertype] *val @@
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:433:44:    expected restricted __le32 [usertype] *val
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:433:44:    got unsigned int *<noident>
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:447:9: sparse: invalid assignment: &=
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:447:9:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:447:9:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:447:9: sparse: invalid assignment: |=
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:447:9:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:447:9:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:448:9: sparse: invalid assignment: &=
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:448:9:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:448:9:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:448:9: sparse: invalid assignment: |=
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:448:9:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:448:9:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:459:9: sparse: invalid assignment: &=
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:459:9:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:459:9:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:459:9: sparse: invalid assignment: |=
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:459:9:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:459:9:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:460:9: sparse: invalid assignment: &=
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:460:9:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:460:9:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:460:9: sparse: invalid assignment: |=
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:460:9:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:460:9:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:471:9: sparse: invalid assignment: &=
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:471:9:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:471:9:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:471:9: sparse: invalid assignment: |=
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:471:9:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:471:9:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:473:9: sparse: invalid assignment: &=
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:473:9:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:473:9:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:473:9: sparse: invalid assignment: |=
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:473:9:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:473:9:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:485:9: sparse: invalid assignment: &=
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:485:9:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:485:9:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:485:9: sparse: invalid assignment: |=
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:485:9:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:485:9:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:487:9: sparse: invalid assignment: &=
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:487:9:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:487:9:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:487:9: sparse: invalid assignment: |=
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:487:9:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:487:9:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:514:9: sparse: invalid assignment: &=
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:514:9:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:514:9:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:514:9: sparse: invalid assignment: |=
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:514:9:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:514:9:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:522:9: sparse: invalid assignment: &=
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:522:9:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:522:9:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:522:9: sparse: invalid assignment: |=
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:522:9:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:522:9:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:553:9: sparse: invalid assignment: &=
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:553:9:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:553:9:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:553:9: sparse: invalid assignment: |=
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:553:9:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:553:9:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:556:9: sparse: invalid assignment: &=
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:556:9:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:556:9:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:556:9: sparse: invalid assignment: |=
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:556:9:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:556:9:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:744:23: sparse: incorrect type in assignment (different base types) @@    expected unsigned long long [unsigned] [usertype] subnet_prefix @@    got g long [unsigned] [usertype] subnet_prefix @@
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:744:23:    expected unsigned long long [unsigned] [usertype] subnet_prefix
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:744:23:    got restricted __be64 [usertype] <noident>
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:1191:9: sparse: invalid assignment: &=
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:1191:9:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:1191:9:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:1191:9: sparse: invalid assignment: |=
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:1191:9:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:1191:9:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:1198:9: sparse: invalid assignment: &=
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:1198:9:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:1198:9:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:1198:9: sparse: invalid assignment: |=
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:1198:9:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:1198:9:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:1206:9: sparse: invalid assignment: &=
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:1206:9:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:1206:9:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:1206:9: sparse: invalid assignment: |=
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:1206:9:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:1206:9:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:1214:9: sparse: invalid assignment: &=
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:1214:9:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:1214:9:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:1214:9: sparse: invalid assignment: |=
   drivers/infiniband/hw/hns/hns_roce_hw_v1.c:1214:9:    left side has type unsigned int
--
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:802:18: sparse: restricted __le16 degrades to integer
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:819:34: sparse: incorrect type in assignment (different base types) @@    expected unsigned short [unsigned] [usertype] desc_ret @@    got  short [unsigned] [usertype] desc_ret @@
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:819:34:    expected unsigned short [unsigned] [usertype] desc_ret
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:819:34:    got restricted __le16 [usertype] retval
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:858:26: sparse: cast to restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:858:26: sparse: cast from restricted __le16
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:859:29: sparse: cast to restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:859:29: sparse: cast from restricted __le16
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1220:9: sparse: invalid assignment: &=
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1220:9:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1220:9:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1220:9: sparse: invalid assignment: |=
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1220:9:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1220:9:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1222:9: sparse: invalid assignment: &=
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1222:9:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1222:9:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1222:9: sparse: invalid assignment: |=
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1222:9:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1222:9:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1224:9: sparse: invalid assignment: &=
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1224:9:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1224:9:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1224:9: sparse: invalid assignment: |=
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1224:9:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1224:9:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1226:9: sparse: invalid assignment: &=
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1226:9:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1226:9:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1226:9: sparse: invalid assignment: |=
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1226:9:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1226:9:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1306:9: sparse: invalid assignment: &=
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1306:9:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1306:9:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1306:9: sparse: invalid assignment: |=
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1306:9:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1306:9:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1327:9: sparse: invalid assignment: &=
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1327:9:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1327:9:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1327:9: sparse: invalid assignment: |=
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1327:9:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1327:9:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1358:39: sparse: cast from restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1372:39: sparse: cast from restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1376:36: sparse: cast from restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1393:38: sparse: cast from restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1419:36: sparse: cast from restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1430:38: sparse: cast from restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1477:33: sparse: cast from restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1584:38: sparse: cast from restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1589:38: sparse: incorrect type in assignment (different base types) @@    expected restricted __le32 [usertype] cqe_cur_blk_addr @@    got unsignrestricted __le32 [usertype] cqe_cur_blk_addr @@
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1589:38:    expected restricted __le32 [usertype] cqe_cur_blk_addr
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1589:38:    got unsigned int [unsigned] [usertype] <noident>
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1591:33: sparse: cast from restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1593:9: sparse: cast from restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1602:38: sparse: incorrect type in assignment (different base types) @@    expected restricted __le32 [usertype] cqe_nxt_blk_addr @@    got unsignrestricted __le32 [usertype] cqe_nxt_blk_addr @@
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1602:38:    expected restricted __le32 [usertype] cqe_nxt_blk_addr
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1602:38:    got unsigned int [unsigned] [usertype] <noident>
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1603:9: sparse: cast from restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1616:28: sparse: incorrect type in assignment (different base types) @@    expected restricted __le32 [usertype] cqe_ba @@    got unsignrestricted __le32 [usertype] cqe_ba @@
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1616:28:    expected restricted __le32 [usertype] cqe_ba
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1616:28:    got unsigned int [unsigned] [usertype] <noident>
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1629:36: sparse: incorrect type in assignment (different base types) @@    expected restricted __le32 [usertype] db_record_addr @@    got __le32 [usertype] db_record_addr @@
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1629:36:    expected restricted __le32 [usertype] db_record_addr
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1629:36:    got unsigned long long
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1657:9: sparse: invalid assignment: &=
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1657:9:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1657:9:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1657:9: sparse: invalid assignment: |=
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1657:9:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1657:9:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1659:9: sparse: invalid assignment: &=
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1659:9:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1659:9:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1659:9: sparse: invalid assignment: |=
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1659:9:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1659:9:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1661:9: sparse: invalid assignment: &=
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1661:9:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1661:9:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1661:9: sparse: invalid assignment: |=
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1661:9:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1661:9:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1664:9: sparse: invalid assignment: &=
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1664:9:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1664:9:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1664:9: sparse: invalid assignment: |=
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1664:9:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1664:9:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1666:9: sparse: invalid assignment: &=
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1666:9:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1666:9:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1666:9: sparse: invalid assignment: |=
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1666:9:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1666:9:    right side has type restricted __le32
>> drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1669:28: sparse: incorrect type in argument 1 (different base types) @@    expected restricted __le32 [usertype] *val @@    got 2 [usertype] *val @@
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1669:28:    expected restricted __le32 [usertype] *val
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1669:28:    got unsigned int *<noident>
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1693:24: sparse: expression using sizeof(void)
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1693:24: sparse: expression using sizeof(void)
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:2263:36: sparse: incorrect type in assignment (different base types) @@    expected restricted __le32 [usertype] qkey_xrcd @@    got unsigned intrestricted __le32 [usertype] qkey_xrcd @@
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:2263:36:    expected restricted __le32 [usertype] qkey_xrcd
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:2263:36:    got unsigned int const [unsigned] [usertype] qkey
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:2282:36: sparse: incorrect type in assignment (different base types) @@    expected restricted __le32 [usertype] rq_db_record_addr @@    got __le32 [usertype] rq_db_record_addr @@
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:2282:36:    expected restricted __le32 [usertype] rq_db_record_addr
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:2282:36:    got unsigned long long
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:2594:36: sparse: incorrect type in assignment (different base types) @@    expected restricted __le32 [usertype] qkey_xrcd @@    got unsigned intrestricted __le32 [usertype] qkey_xrcd @@
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:2594:36:    expected restricted __le32 [usertype] qkey_xrcd
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:2594:36:    got unsigned int const [unsigned] [usertype] qkey
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:2669:29: sparse: incorrect type in assignment (different base types) @@    expected restricted __le32 [usertype] wqe_sge_ba @@    got unsignrestricted __le32 [usertype] wqe_sge_ba @@
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:2669:29:    expected restricted __le32 [usertype] wqe_sge_ba
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:2669:29:    got unsigned int [unsigned] [usertype] <noident>
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:2732:34: sparse: incorrect type in assignment (different base types) @@    expected restricted __le32 [usertype] rq_cur_blk_addr @@    got unsignrestricted __le32 [usertype] rq_cur_blk_addr @@
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:2732:34:    expected restricted __le32 [usertype] rq_cur_blk_addr
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:2732:34:    got unsigned int [unsigned] [usertype] <noident>
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:2745:34: sparse: incorrect type in assignment (different base types) @@    expected restricted __le32 [usertype] rq_nxt_blk_addr @@    got unsignrestricted __le32 [usertype] rq_nxt_blk_addr @@
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:2745:34:    expected restricted __le32 [usertype] rq_nxt_blk_addr
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:2745:34:    got unsigned int [unsigned] [usertype] <noident>
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:2769:26: sparse: incorrect type in assignment (different base types) @@    expected restricted __le32 [usertype] trrl_ba @@    got unsignrestricted __le32 [usertype] trrl_ba @@
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:2769:26:    expected restricted __le32 [usertype] trrl_ba
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:2769:26:    got unsigned int [unsigned] [usertype] <noident>
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:2777:26: sparse: incorrect type in assignment (different base types) @@    expected restricted __le32 [usertype] irrl_ba @@    got unsignrestricted __le32 [usertype] irrl_ba @@
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:2777:26:    expected restricted __le32 [usertype] irrl_ba
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:2777:26:    got unsigned int [unsigned] [usertype] <noident>
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:2788:9: sparse: cast from restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:2956:34: sparse: incorrect type in assignment (different base types) @@    expected restricted __le32 [usertype] sq_cur_blk_addr @@    got unsignrestricted __le32 [usertype] sq_cur_blk_addr @@
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:2956:34:    expected restricted __le32 [usertype] sq_cur_blk_addr
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:2956:34:    got unsigned int [unsigned] [usertype] <noident>
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:2967:38: sparse: incorrect type in assignment (different base types) @@    expected restricted __le32 [usertype] sq_cur_sge_blk_addr @@    got  [usertype] sq_cur_sge_blk_addr @@
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:2967:38:    expected restricted __le32 [usertype] sq_cur_sge_blk_addr
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:2967:38:    got unsigned int
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:2982:37: sparse: incorrect type in assignment (different base types) @@    expected restricted __le32 [usertype] rx_sq_cur_blk_addr @@    got unsignrestricted __le32 [usertype] rx_sq_cur_blk_addr @@
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:2982:37:    expected restricted __le32 [usertype] rx_sq_cur_blk_addr
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:2982:37:    got unsigned int [unsigned] [usertype] <noident>
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3383:28: sparse: incorrect type in assignment (different base types) @@    expected unsigned char [unsigned] [usertype] rnr_retry @@    got d char [unsigned] [usertype] rnr_retry @@
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3383:28:    expected unsigned char [unsigned] [usertype] rnr_retry
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3383:28:    got restricted __le32 [usertype] rq_rnr_timer
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3542:17: sparse: invalid assignment: &=
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3542:17:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3542:17:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3542:17: sparse: invalid assignment: |=
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3542:17:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3542:17:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3548:17: sparse: invalid assignment: &=
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3548:17:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3548:17:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3548:17: sparse: invalid assignment: |=
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3548:17:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3548:17:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3551:17: sparse: invalid assignment: &=
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3551:17:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3551:17:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3551:17: sparse: invalid assignment: |=
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3551:17:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3551:17:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3558:9: sparse: invalid assignment: &=
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3558:9:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3558:9:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3558:9: sparse: invalid assignment: |=
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3558:9:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3558:9:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3562:28: sparse: incorrect type in argument 1 (different base types) @@    expected restricted __le32 [usertype] *val @@    got 2 [usertype] *val @@
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3562:28:    expected restricted __le32 [usertype] *val
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3562:28:    got unsigned int *<noident>
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3573:20: sparse: cast to restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3604:20: sparse: cast to restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3641:15: sparse: cast to restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3675:15: sparse: cast to restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3731:17: sparse: cast to restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3750:30: sparse: cast to restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3849:20: sparse: cast to restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3868:23: sparse: cast to restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3916:13: sparse: cast to restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3919:17: sparse: invalid assignment: &=
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3919:17:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3919:17:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3919:17: sparse: invalid assignment: |=
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3919:17:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3919:17:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3922:17: sparse: invalid assignment: &=
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3922:17:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3922:17:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3922:17: sparse: invalid assignment: |=
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3922:17:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3922:17:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3926:20: sparse: cast to restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3929:17: sparse: invalid assignment: &=
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3929:17:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3929:17:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3929:17: sparse: invalid assignment: |=
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3929:17:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3929:17:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3932:17: sparse: invalid assignment: &=
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3932:17:    left side has type unsigned int
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3932:17:    right side has type restricted __le32
   drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3932:17: sparse: invalid assignment: |=

vim +433 drivers/infiniband/hw/hns/hns_roce_hw_v1.c

9a4435375 oulijun         2016-07-21  344  
d61d6de07 Bart Van Assche 2017-10-11  345  static int hns_roce_v1_post_recv(struct ib_qp *ibqp, struct ib_recv_wr *wr,
9a4435375 oulijun         2016-07-21  346  				 struct ib_recv_wr **bad_wr)
9a4435375 oulijun         2016-07-21  347  {
9a4435375 oulijun         2016-07-21  348  	int ret = 0;
9a4435375 oulijun         2016-07-21  349  	int nreq = 0;
9a4435375 oulijun         2016-07-21  350  	int ind = 0;
9a4435375 oulijun         2016-07-21  351  	int i = 0;
9a4435375 oulijun         2016-07-21  352  	u32 reg_val = 0;
9a4435375 oulijun         2016-07-21  353  	unsigned long flags = 0;
9a4435375 oulijun         2016-07-21  354  	struct hns_roce_rq_wqe_ctrl *ctrl = NULL;
9a4435375 oulijun         2016-07-21  355  	struct hns_roce_wqe_data_seg *scat = NULL;
9a4435375 oulijun         2016-07-21  356  	struct hns_roce_qp *hr_qp = to_hr_qp(ibqp);
9a4435375 oulijun         2016-07-21  357  	struct hns_roce_dev *hr_dev = to_hr_dev(ibqp->device);
9a4435375 oulijun         2016-07-21  358  	struct device *dev = &hr_dev->pdev->dev;
9a4435375 oulijun         2016-07-21  359  	struct hns_roce_rq_db rq_db;
9a4435375 oulijun         2016-07-21  360  	uint32_t doorbell[2] = {0};
9a4435375 oulijun         2016-07-21  361  
9a4435375 oulijun         2016-07-21  362  	spin_lock_irqsave(&hr_qp->rq.lock, flags);
9a4435375 oulijun         2016-07-21  363  	ind = hr_qp->rq.head & (hr_qp->rq.wqe_cnt - 1);
9a4435375 oulijun         2016-07-21  364  
9a4435375 oulijun         2016-07-21  365  	for (nreq = 0; wr; ++nreq, wr = wr->next) {
9a4435375 oulijun         2016-07-21  366  		if (hns_roce_wq_overflow(&hr_qp->rq, nreq,
9a4435375 oulijun         2016-07-21  367  			hr_qp->ibqp.recv_cq)) {
9a4435375 oulijun         2016-07-21  368  			ret = -ENOMEM;
9a4435375 oulijun         2016-07-21  369  			*bad_wr = wr;
9a4435375 oulijun         2016-07-21  370  			goto out;
9a4435375 oulijun         2016-07-21  371  		}
9a4435375 oulijun         2016-07-21  372  
9a4435375 oulijun         2016-07-21  373  		if (unlikely(wr->num_sge > hr_qp->rq.max_gs)) {
9a4435375 oulijun         2016-07-21  374  			dev_err(dev, "rq:num_sge=%d > qp->sq.max_gs=%d\n",
9a4435375 oulijun         2016-07-21  375  				wr->num_sge, hr_qp->rq.max_gs);
9a4435375 oulijun         2016-07-21  376  			ret = -EINVAL;
9a4435375 oulijun         2016-07-21  377  			*bad_wr = wr;
9a4435375 oulijun         2016-07-21  378  			goto out;
9a4435375 oulijun         2016-07-21  379  		}
9a4435375 oulijun         2016-07-21  380  
9a4435375 oulijun         2016-07-21  381  		ctrl = get_recv_wqe(hr_qp, ind);
9a4435375 oulijun         2016-07-21  382  
9a4435375 oulijun         2016-07-21  383  		roce_set_field(ctrl->rwqe_byte_12,
9a4435375 oulijun         2016-07-21  384  			       RQ_WQE_CTRL_RWQE_BYTE_12_RWQE_SGE_NUM_M,
9a4435375 oulijun         2016-07-21  385  			       RQ_WQE_CTRL_RWQE_BYTE_12_RWQE_SGE_NUM_S,
9a4435375 oulijun         2016-07-21  386  			       wr->num_sge);
9a4435375 oulijun         2016-07-21  387  
9a4435375 oulijun         2016-07-21  388  		scat = (struct hns_roce_wqe_data_seg *)(ctrl + 1);
9a4435375 oulijun         2016-07-21  389  
9a4435375 oulijun         2016-07-21  390  		for (i = 0; i < wr->num_sge; i++)
9a4435375 oulijun         2016-07-21  391  			set_data_seg(scat + i, wr->sg_list + i);
9a4435375 oulijun         2016-07-21  392  
9a4435375 oulijun         2016-07-21  393  		hr_qp->rq.wrid[ind] = wr->wr_id;
9a4435375 oulijun         2016-07-21  394  
9a4435375 oulijun         2016-07-21  395  		ind = (ind + 1) & (hr_qp->rq.wqe_cnt - 1);
9a4435375 oulijun         2016-07-21  396  	}
9a4435375 oulijun         2016-07-21  397  
9a4435375 oulijun         2016-07-21  398  out:
9a4435375 oulijun         2016-07-21  399  	if (likely(nreq)) {
9a4435375 oulijun         2016-07-21  400  		hr_qp->rq.head += nreq;
9a4435375 oulijun         2016-07-21  401  		/* Memory barrier */
9a4435375 oulijun         2016-07-21  402  		wmb();
9a4435375 oulijun         2016-07-21  403  
9a4435375 oulijun         2016-07-21  404  		if (ibqp->qp_type == IB_QPT_GSI) {
9a4435375 oulijun         2016-07-21  405  			/* SW update GSI rq header */
9a4435375 oulijun         2016-07-21  406  			reg_val = roce_read(to_hr_dev(ibqp->device),
9a4435375 oulijun         2016-07-21  407  					    ROCEE_QP1C_CFG3_0_REG +
7716809ef Lijun Ou        2016-09-15  408  					    QP1C_CFGN_OFFSET * hr_qp->phy_port);
9a4435375 oulijun         2016-07-21  409  			roce_set_field(reg_val,
9a4435375 oulijun         2016-07-21  410  				       ROCEE_QP1C_CFG3_0_ROCEE_QP1C_RQ_HEAD_M,
9a4435375 oulijun         2016-07-21  411  				       ROCEE_QP1C_CFG3_0_ROCEE_QP1C_RQ_HEAD_S,
9a4435375 oulijun         2016-07-21  412  				       hr_qp->rq.head);
9a4435375 oulijun         2016-07-21  413  			roce_write(to_hr_dev(ibqp->device),
9a4435375 oulijun         2016-07-21  414  				   ROCEE_QP1C_CFG3_0_REG +
7716809ef Lijun Ou        2016-09-15  415  				   QP1C_CFGN_OFFSET * hr_qp->phy_port, reg_val);
9a4435375 oulijun         2016-07-21  416  		} else {
9a4435375 oulijun         2016-07-21  417  			rq_db.u32_4 = 0;
9a4435375 oulijun         2016-07-21  418  			rq_db.u32_8 = 0;
9a4435375 oulijun         2016-07-21  419  
9a4435375 oulijun         2016-07-21  420  			roce_set_field(rq_db.u32_4, RQ_DOORBELL_U32_4_RQ_HEAD_M,
9a4435375 oulijun         2016-07-21  421  				       RQ_DOORBELL_U32_4_RQ_HEAD_S,
9a4435375 oulijun         2016-07-21  422  				       hr_qp->rq.head);
9a4435375 oulijun         2016-07-21  423  			roce_set_field(rq_db.u32_8, RQ_DOORBELL_U32_8_QPN_M,
9a4435375 oulijun         2016-07-21  424  				       RQ_DOORBELL_U32_8_QPN_S, hr_qp->qpn);
9a4435375 oulijun         2016-07-21  425  			roce_set_field(rq_db.u32_8, RQ_DOORBELL_U32_8_CMD_M,
9a4435375 oulijun         2016-07-21  426  				       RQ_DOORBELL_U32_8_CMD_S, 1);
9a4435375 oulijun         2016-07-21  427  			roce_set_bit(rq_db.u32_8, RQ_DOORBELL_U32_8_HW_SYNC_S,
9a4435375 oulijun         2016-07-21  428  				     1);
9a4435375 oulijun         2016-07-21  429  
8b9b8d143 oulijun         2018-02-05  430  			doorbell[0] = le32_to_cpu(rq_db.u32_4);
8b9b8d143 oulijun         2018-02-05  431  			doorbell[1] = le32_to_cpu(rq_db.u32_8);
9a4435375 oulijun         2016-07-21  432  
9a4435375 oulijun         2016-07-21 @433  			hns_roce_write64_k(doorbell, hr_qp->rq.db_reg_l);
9a4435375 oulijun         2016-07-21  434  		}
9a4435375 oulijun         2016-07-21  435  	}
9a4435375 oulijun         2016-07-21  436  	spin_unlock_irqrestore(&hr_qp->rq.lock, flags);
9a4435375 oulijun         2016-07-21  437  
9a4435375 oulijun         2016-07-21  438  	return ret;
9a4435375 oulijun         2016-07-21  439  }
9a4435375 oulijun         2016-07-21  440  

:::::: The code at line 433 was first introduced by commit
:::::: 9a4435375cd151e07c0c38fa601b00115986091b IB/hns: Add driver files for hns RoCE driver

:::::: TO: oulijun <oulijun@xxxxxxxxxx>
:::::: CC: Doug Ledford <dledford@xxxxxxxxxx>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux