Skip to content

Commit 2280740

Browse files
nvishwa1dledford
authored andcommitted
IB/hfi1: Virtual Network Interface Controller (VNIC) HW support
HFI1 HW specific support for VNIC functionality. Dynamically allocate a set of contexts for VNIC when the first vnic port is instantiated. Allocate VNIC contexts from user contexts pool and return them back to the same pool while freeing up. Set aside enough MSI-X interrupts for VNIC contexts and assign them when the contexts are allocated. On the receive side, use an RSM rule to spread TCP/UDP streams among VNIC contexts. Reviewed-by: Dennis Dalessandro <[email protected]> Reviewed-by: Ira Weiny <[email protected]> Signed-off-by: Niranjana Vishwanathapura <[email protected]> Signed-off-by: Andrzej Kacprowski <[email protected]> Signed-off-by: Doug Ledford <[email protected]>
1 parent d4829ea commit 2280740

File tree

18 files changed

+661
-105
lines changed

18 files changed

+661
-105
lines changed

drivers/infiniband/hw/hfi1/aspm.h

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright(c) 2015, 2016 Intel Corporation.
2+
* Copyright(c) 2015-2017 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.
@@ -229,14 +229,17 @@ static inline void aspm_ctx_timer_function(unsigned long data)
229229
spin_unlock_irqrestore(&rcd->aspm_lock, flags);
230230
}
231231

232-
/* Disable interrupt processing for verbs contexts when PSM contexts are open */
232+
/*
233+
* Disable interrupt processing for verbs contexts when PSM or VNIC contexts
234+
* are open.
235+
*/
233236
static inline void aspm_disable_all(struct hfi1_devdata *dd)
234237
{
235238
struct hfi1_ctxtdata *rcd;
236239
unsigned long flags;
237240
unsigned i;
238241

239-
for (i = 0; i < dd->first_user_ctxt; i++) {
242+
for (i = 0; i < dd->first_dyn_alloc_ctxt; i++) {
240243
rcd = dd->rcd[i];
241244
del_timer_sync(&rcd->aspm_timer);
242245
spin_lock_irqsave(&rcd->aspm_lock, flags);
@@ -260,7 +263,7 @@ static inline void aspm_enable_all(struct hfi1_devdata *dd)
260263
if (aspm_mode != ASPM_MODE_DYNAMIC)
261264
return;
262265

263-
for (i = 0; i < dd->first_user_ctxt; i++) {
266+
for (i = 0; i < dd->first_dyn_alloc_ctxt; i++) {
264267
rcd = dd->rcd[i];
265268
spin_lock_irqsave(&rcd->aspm_lock, flags);
266269
rcd->aspm_intr_enable = true;
@@ -276,7 +279,7 @@ static inline void aspm_ctx_init(struct hfi1_ctxtdata *rcd)
276279
(unsigned long)rcd);
277280
rcd->aspm_intr_supported = rcd->dd->aspm_supported &&
278281
aspm_mode == ASPM_MODE_DYNAMIC &&
279-
rcd->ctxt < rcd->dd->first_user_ctxt;
282+
rcd->ctxt < rcd->dd->first_dyn_alloc_ctxt;
280283
}
281284

282285
static inline void aspm_init(struct hfi1_devdata *dd)
@@ -286,7 +289,7 @@ static inline void aspm_init(struct hfi1_devdata *dd)
286289
spin_lock_init(&dd->aspm_lock);
287290
dd->aspm_supported = aspm_hw_l1_supported(dd);
288291

289-
for (i = 0; i < dd->first_user_ctxt; i++)
292+
for (i = 0; i < dd->first_dyn_alloc_ctxt; i++)
290293
aspm_ctx_init(dd->rcd[i]);
291294

292295
/* Start with ASPM disabled */

0 commit comments

Comments
 (0)