Skip to content

Commit 89dcaa3

Browse files
grzegorz-andrejczukjgunthorpe
authored andcommitted
IB/hfi1: Rename num_vnic_contexts as num_netdev_contexts
Rename num_vnic_contexts as num_ndetdev_contexts since VNIC and ipoib will share the same set of receive contexts. Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Mike Marciniszyn <[email protected]> Reviewed-by: Dennis Dalessandro <[email protected]> Signed-off-by: Sadanand Warrier <[email protected]> Signed-off-by: Grzegorz Andrejczuk <[email protected]> Signed-off-by: Kaike Wan <[email protected]> Signed-off-by: Dennis Dalessandro <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent 6d72344 commit 89dcaa3

File tree

4 files changed

+20
-20
lines changed

4 files changed

+20
-20
lines changed

drivers/infiniband/hw/hfi1/chip.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13347,12 +13347,12 @@ static int set_up_interrupts(struct hfi1_devdata *dd)
1334713347
* in array of contexts
1334813348
* freectxts - number of free user contexts
1334913349
* num_send_contexts - number of PIO send contexts being used
13350-
* num_vnic_contexts - number of contexts reserved for VNIC
13350+
* num_netdev_contexts - number of contexts reserved for netdev
1335113351
*/
1335213352
static int set_up_context_variables(struct hfi1_devdata *dd)
1335313353
{
1335413354
unsigned long num_kernel_contexts;
13355-
u16 num_vnic_contexts = HFI1_NUM_VNIC_CTXT;
13355+
u16 num_netdev_contexts = HFI1_NUM_VNIC_CTXT;
1335613356
int total_contexts;
1335713357
int ret;
1335813358
unsigned ngroups;
@@ -13391,11 +13391,11 @@ static int set_up_context_variables(struct hfi1_devdata *dd)
1339113391
}
1339213392

1339313393
/* Accommodate VNIC contexts if possible */
13394-
if ((num_kernel_contexts + num_vnic_contexts) > rcv_contexts) {
13394+
if ((num_kernel_contexts + num_netdev_contexts) > rcv_contexts) {
1339513395
dd_dev_err(dd, "No receive contexts available for VNIC\n");
13396-
num_vnic_contexts = 0;
13396+
num_netdev_contexts = 0;
1339713397
}
13398-
total_contexts = num_kernel_contexts + num_vnic_contexts;
13398+
total_contexts = num_kernel_contexts + num_netdev_contexts;
1339913399

1340013400
/*
1340113401
* User contexts:
@@ -13422,15 +13422,15 @@ static int set_up_context_variables(struct hfi1_devdata *dd)
1342213422
* The RMT entries are currently allocated as shown below:
1342313423
* 1. QOS (0 to 128 entries);
1342413424
* 2. FECN (num_kernel_context - 1 + num_user_contexts +
13425-
* num_vnic_contexts);
13426-
* 3. VNIC (num_vnic_contexts).
13427-
* It should be noted that FECN oversubscribe num_vnic_contexts
13428-
* entries of RMT because both VNIC and PSM could allocate any receive
13425+
* num_netdev_contexts);
13426+
* 3. netdev (num_netdev_contexts).
13427+
* It should be noted that FECN oversubscribe num_netdev_contexts
13428+
* entries of RMT because both netdev and PSM could allocate any receive
1342913429
* context between dd->first_dyn_alloc_text and dd->num_rcv_contexts,
1343013430
* and PSM FECN must reserve an RMT entry for each possible PSM receive
1343113431
* context.
1343213432
*/
13433-
rmt_count = qos_rmt_entries(dd, NULL, NULL) + (num_vnic_contexts * 2);
13433+
rmt_count = qos_rmt_entries(dd, NULL, NULL) + (num_netdev_contexts * 2);
1343413434
if (HFI1_CAP_IS_KSET(TID_RDMA))
1343513435
rmt_count += num_kernel_contexts - 1;
1343613436
if (rmt_count + n_usr_ctxts > NUM_MAP_ENTRIES) {
@@ -13449,15 +13449,15 @@ static int set_up_context_variables(struct hfi1_devdata *dd)
1344913449
dd->num_rcv_contexts = total_contexts;
1345013450
dd->n_krcv_queues = num_kernel_contexts;
1345113451
dd->first_dyn_alloc_ctxt = num_kernel_contexts;
13452-
dd->num_vnic_contexts = num_vnic_contexts;
13452+
dd->num_netdev_contexts = num_netdev_contexts;
1345313453
dd->num_user_contexts = n_usr_ctxts;
1345413454
dd->freectxts = n_usr_ctxts;
1345513455
dd_dev_info(dd,
1345613456
"rcv contexts: chip %d, used %d (kernel %d, vnic %u, user %u)\n",
1345713457
rcv_contexts,
1345813458
(int)dd->num_rcv_contexts,
1345913459
(int)dd->n_krcv_queues,
13460-
dd->num_vnic_contexts,
13460+
dd->num_netdev_contexts,
1346113461
dd->num_user_contexts);
1346213462

1346313463
/*

drivers/infiniband/hw/hfi1/hfi.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1167,8 +1167,8 @@ struct hfi1_devdata {
11671167
u64 z_send_schedule;
11681168

11691169
u64 __percpu *send_schedule;
1170-
/* number of reserved contexts for VNIC usage */
1171-
u16 num_vnic_contexts;
1170+
/* number of reserved contexts for netdev usage */
1171+
u16 num_netdev_contexts;
11721172
/* number of receive contexts in use by the driver */
11731173
u32 num_rcv_contexts;
11741174
/* number of pio send contexts in use by the driver */

drivers/infiniband/hw/hfi1/msix.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause)
22
/*
3-
* Copyright(c) 2018 Intel Corporation.
3+
* Copyright(c) 2018 - 2020 Intel Corporation.
44
*
55
* This file is provided under a dual BSD/GPLv2 license. When using or
66
* redistributing this file, you may do so under either license.
@@ -69,7 +69,7 @@ int msix_initialize(struct hfi1_devdata *dd)
6969
* one for each VNIC context
7070
* ...any new IRQs should be added here.
7171
*/
72-
total = 1 + dd->num_sdma + dd->n_krcv_queues + dd->num_vnic_contexts;
72+
total = 1 + dd->num_sdma + dd->n_krcv_queues + dd->num_netdev_contexts;
7373

7474
if (total >= CCE_NUM_MSIX_VECTORS)
7575
return -EINVAL;

drivers/infiniband/hw/hfi1/vnic_main.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright(c) 2017 - 2018 Intel Corporation.
2+
* Copyright(c) 2017 - 2020 Intel Corporation.
33
*
44
* This file is provided under a dual BSD/GPLv2 license. When using or
55
* redistributing this file, you may do so under either license.
@@ -804,7 +804,7 @@ struct net_device *hfi1_vnic_alloc_rn(struct ib_device *device,
804804
struct rdma_netdev *rn;
805805
int i, size, rc;
806806

807-
if (!dd->num_vnic_contexts)
807+
if (!dd->num_netdev_contexts)
808808
return ERR_PTR(-ENOMEM);
809809

810810
if (!port_num || (port_num > dd->num_pports))
@@ -815,15 +815,15 @@ struct net_device *hfi1_vnic_alloc_rn(struct ib_device *device,
815815

816816
size = sizeof(struct opa_vnic_rdma_netdev) + sizeof(*vinfo);
817817
netdev = alloc_netdev_mqs(size, name, name_assign_type, setup,
818-
dd->num_sdma, dd->num_vnic_contexts);
818+
dd->num_sdma, dd->num_netdev_contexts);
819819
if (!netdev)
820820
return ERR_PTR(-ENOMEM);
821821

822822
rn = netdev_priv(netdev);
823823
vinfo = opa_vnic_dev_priv(netdev);
824824
vinfo->dd = dd;
825825
vinfo->num_tx_q = dd->num_sdma;
826-
vinfo->num_rx_q = dd->num_vnic_contexts;
826+
vinfo->num_rx_q = dd->num_netdev_contexts;
827827
vinfo->netdev = netdev;
828828
rn->free_rdma_netdev = hfi1_vnic_free_rn;
829829
rn->set_id = hfi1_vnic_set_vesw_id;

0 commit comments

Comments
 (0)