diff options
author | Ariel Elior <ariele@broadcom.com> | 2013-01-01 05:22:43 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-01-02 01:45:07 -0800 |
commit | abc5a021ba645cd162205209bd5664a0d4b866a6 (patch) | |
tree | 8dafb2e16c204c01f7387f454d32c40ae8c2e00f /drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c | |
parent | d16132cef8a72ff7563aff95f03bf505779fe3e6 (diff) |
bnx2x: Support PF <-> VF Bulletin Board
The PF <-> VF Bulletin Board is a simple interface between the
PF and the VF. The main reason for the Bulletin Board is to allow
the PF to be the initiator. The VF publishes at 'acquire' stage
the GPA of a Bulletin Board structure it has allocated. The PF notes
this GPA in the VF database. The VF samples the Bulletin Board
periodically for new messages. The latest version of the BB is always
used.
Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c')
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c index c96ce5bbf446..1f1e823b7bdf 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c @@ -2058,6 +2058,10 @@ void bnx2x_iov_free_mem(struct bnx2x *bp) BNX2X_PCI_FREE(BP_VF_MBX_DMA(bp)->addr, BP_VF_MBX_DMA(bp)->mapping, BP_VF_MBX_DMA(bp)->size); + + BNX2X_PCI_FREE(BP_VF_BULLETIN_DMA(bp)->addr, + BP_VF_BULLETIN_DMA(bp)->mapping, + BP_VF_BULLETIN_DMA(bp)->size); } int bnx2x_iov_alloc_mem(struct bnx2x *bp) @@ -2097,6 +2101,12 @@ int bnx2x_iov_alloc_mem(struct bnx2x *bp) tot_size); BP_VF_MBX_DMA(bp)->size = tot_size; + /* allocate local bulletin boards */ + tot_size = BNX2X_NR_VIRTFN(bp) * BULLETIN_CONTENT_SIZE; + BNX2X_PCI_ALLOC(BP_VF_BULLETIN_DMA(bp)->addr, + &BP_VF_BULLETIN_DMA(bp)->mapping, tot_size); + BP_VF_BULLETIN_DMA(bp)->size = tot_size; + return 0; alloc_mem_err: @@ -2810,6 +2820,9 @@ int bnx2x_vf_init(struct bnx2x *bp, struct bnx2x_virtf *vf, dma_addr_t *sb_map) vf->state = VF_ENABLED; + /* update vf bulletin board */ + bnx2x_post_vf_bulletin(bp, vf->index); + return 0; } |