verbs.c (273806) | verbs.c (297124) |
---|---|
1/* 2 * Copyright (c) 2006-2014 Chelsio, Inc. All rights reserved. 3 * 4 * This software is available to you under a choice of one of two 5 * licenses. You may choose to be licensed under the terms of the GNU 6 * General Public License (GPL) Version 2, available from the file 7 * COPYING in the main directory of this source tree, or the 8 * OpenIB.org BSD license below: --- 199 unchanged lines hidden (view full) --- 208 goto err2; 209 210 chp->cq.ugts = mmap(NULL, c4iw_page_size, PROT_WRITE, MAP_SHARED, 211 context->cmd_fd, resp.gts_key); 212 if (chp->cq.ugts == MAP_FAILED) 213 goto err3; 214 215 if (dev_is_t5(chp->rhp)) | 1/* 2 * Copyright (c) 2006-2014 Chelsio, Inc. All rights reserved. 3 * 4 * This software is available to you under a choice of one of two 5 * licenses. You may choose to be licensed under the terms of the GNU 6 * General Public License (GPL) Version 2, available from the file 7 * COPYING in the main directory of this source tree, or the 8 * OpenIB.org BSD license below: --- 199 unchanged lines hidden (view full) --- 208 goto err2; 209 210 chp->cq.ugts = mmap(NULL, c4iw_page_size, PROT_WRITE, MAP_SHARED, 211 context->cmd_fd, resp.gts_key); 212 if (chp->cq.ugts == MAP_FAILED) 213 goto err3; 214 215 if (dev_is_t5(chp->rhp)) |
216 chp->cq.ugts += 3; | 216 chp->cq.ugts += 5; |
217 else 218 chp->cq.ugts += 1; 219 chp->cq.sw_queue = calloc(chp->cq.size, sizeof *chp->cq.queue); 220 if (!chp->cq.sw_queue) 221 goto err4; 222 223 PDBG("%s cqid 0x%x key %" PRIx64 " va %p memsize %lu gts_key %" 224 PRIx64 " va %p qid_mask 0x%x\n", --- 230 unchanged lines hidden (view full) --- 455 dbva = mmap(NULL, c4iw_page_size, PROT_WRITE, MAP_SHARED, 456 pd->context->cmd_fd, resp.sq_db_gts_key); 457 if (dbva == MAP_FAILED) { 458 PDBG(" %s mmap for sq db failed\n", __func__); 459 abort(); 460 goto err3; 461 } 462 qhp->wq.sq.udb = dbva; | 217 else 218 chp->cq.ugts += 1; 219 chp->cq.sw_queue = calloc(chp->cq.size, sizeof *chp->cq.queue); 220 if (!chp->cq.sw_queue) 221 goto err4; 222 223 PDBG("%s cqid 0x%x key %" PRIx64 " va %p memsize %lu gts_key %" 224 PRIx64 " va %p qid_mask 0x%x\n", --- 230 unchanged lines hidden (view full) --- 455 dbva = mmap(NULL, c4iw_page_size, PROT_WRITE, MAP_SHARED, 456 pd->context->cmd_fd, resp.sq_db_gts_key); 457 if (dbva == MAP_FAILED) { 458 PDBG(" %s mmap for sq db failed\n", __func__); 459 abort(); 460 goto err3; 461 } 462 qhp->wq.sq.udb = dbva; |
463 if (dev_is_t5(qhp->rhp)) { 464 qhp->wq.sq.udb += (128*(qhp->wq.sq.qid & qhp->wq.qid_mask))/4; | 463 if (!dev_is_t4(qhp->rhp)) { 464 unsigned long segment_offset = 128 * (qhp->wq.sq.qid & qhp->wq.qid_mask); 465 466 if (segment_offset < c4iw_page_size) { 467 qhp->wq.sq.udb += segment_offset / 4; 468 qhp->wq.sq.wc_reg_available = 1; 469 } else 470 qhp->wq.sq.bar2_qid = qhp->wq.sq.qid & qhp->wq.qid_mask; |
465 qhp->wq.sq.udb += 2; 466 } 467 468 qhp->wq.sq.queue = mmap(NULL, qhp->wq.sq.memsize, 469 PROT_READ | PROT_WRITE, MAP_SHARED, 470 pd->context->cmd_fd, resp.sq_key); 471 if (qhp->wq.sq.queue == MAP_FAILED) { 472 PDBG(" %s mmap for sq q failed size is qhp->wq.sq.memsize %zu \n", __func__, qhp->wq.sq.memsize); 473 abort(); 474 goto err4; 475 } 476 477 dbva = mmap(NULL, c4iw_page_size, PROT_WRITE, MAP_SHARED, 478 pd->context->cmd_fd, resp.rq_db_gts_key); 479 if (dbva == MAP_FAILED) 480 goto err5; 481 qhp->wq.rq.udb = dbva; | 471 qhp->wq.sq.udb += 2; 472 } 473 474 qhp->wq.sq.queue = mmap(NULL, qhp->wq.sq.memsize, 475 PROT_READ | PROT_WRITE, MAP_SHARED, 476 pd->context->cmd_fd, resp.sq_key); 477 if (qhp->wq.sq.queue == MAP_FAILED) { 478 PDBG(" %s mmap for sq q failed size is qhp->wq.sq.memsize %zu \n", __func__, qhp->wq.sq.memsize); 479 abort(); 480 goto err4; 481 } 482 483 dbva = mmap(NULL, c4iw_page_size, PROT_WRITE, MAP_SHARED, 484 pd->context->cmd_fd, resp.rq_db_gts_key); 485 if (dbva == MAP_FAILED) 486 goto err5; 487 qhp->wq.rq.udb = dbva; |
482 if (dev_is_t5(qhp->rhp)) { 483 qhp->wq.rq.udb += (128*(qhp->wq.rq.qid & qhp->wq.qid_mask))/4; | 488 if (!dev_is_t4(qhp->rhp)) { 489 unsigned long segment_offset = 128 * (qhp->wq.rq.qid & qhp->wq.qid_mask); 490 491 if (segment_offset < c4iw_page_size) { 492 qhp->wq.rq.udb += segment_offset / 4; 493 qhp->wq.rq.wc_reg_available = 1; 494 } else 495 qhp->wq.rq.bar2_qid = qhp->wq.rq.qid & qhp->wq.qid_mask; |
484 qhp->wq.rq.udb += 2; 485 } 486 qhp->wq.rq.queue = mmap(NULL, qhp->wq.rq.memsize, 487 PROT_READ | PROT_WRITE, MAP_SHARED, 488 pd->context->cmd_fd, resp.rq_key); 489 if (qhp->wq.rq.queue == MAP_FAILED) 490 goto err6; 491 --- 211 unchanged lines hidden --- | 496 qhp->wq.rq.udb += 2; 497 } 498 qhp->wq.rq.queue = mmap(NULL, qhp->wq.rq.memsize, 499 PROT_READ | PROT_WRITE, MAP_SHARED, 500 pd->context->cmd_fd, resp.rq_key); 501 if (qhp->wq.rq.queue == MAP_FAILED) 502 goto err6; 503 --- 211 unchanged lines hidden --- |