-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Probe the device's capabilities to see if it supports RDMA. If so, allocate and reserve resources to support its operation; populate structures with initial values. Signed-off-by: Dave Ertman <david.m.ertman@intel.com> Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
- Loading branch information
Dave Ertman
authored and
Tony Nguyen
committed
May 29, 2021
1 parent
e860fa9
commit d25a0fc
Showing
10 changed files
with
183 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// SPDX-License-Identifier: GPL-2.0 | ||
/* Copyright (C) 2021, Intel Corporation. */ | ||
|
||
/* Inter-Driver Communication */ | ||
#include "ice.h" | ||
#include "ice_lib.h" | ||
#include "ice_dcb_lib.h" | ||
|
||
/** | ||
* ice_reserve_rdma_qvector - Reserve vector resources for RDMA driver | ||
* @pf: board private structure to initialize | ||
*/ | ||
static int ice_reserve_rdma_qvector(struct ice_pf *pf) | ||
{ | ||
if (test_bit(ICE_FLAG_RDMA_ENA, pf->flags)) { | ||
int index; | ||
|
||
index = ice_get_res(pf, pf->irq_tracker, pf->num_rdma_msix, | ||
ICE_RES_RDMA_VEC_ID); | ||
if (index < 0) | ||
return index; | ||
pf->num_avail_sw_msix -= pf->num_rdma_msix; | ||
pf->rdma_base_vector = (u16)index; | ||
} | ||
return 0; | ||
} | ||
|
||
/** | ||
* ice_init_rdma - initializes PF for RDMA use | ||
* @pf: ptr to ice_pf | ||
*/ | ||
int ice_init_rdma(struct ice_pf *pf) | ||
{ | ||
struct device *dev = &pf->pdev->dev; | ||
int ret; | ||
|
||
/* Reserve vector resources */ | ||
ret = ice_reserve_rdma_qvector(pf); | ||
if (ret < 0) | ||
dev_err(dev, "failed to reserve vectors for RDMA\n"); | ||
|
||
return ret; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters