summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c
diff options
context:
space:
mode:
authorAriel Elior <ariele@broadcom.com>2013-01-23 03:21:54 +0000
committerDavid S. Miller <davem@davemloft.net>2013-01-23 13:58:30 -0500
commit4c133c39ae1bc541b3db5903a680da738a0c57e3 (patch)
tree7db74a71be645a8fb774340bc3829d4492d5eb4d /drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c
parentca9bdb9b279d3bffb7f8a0dc15686a2c23fa0c12 (diff)
downloadlinux-4c133c39ae1bc541b3db5903a680da738a0c57e3.tar.bz2
bnx2x: SR-IOV version compatibility bugfix
When posting a message on the bulletin board, the PF calculates crc over the message and places the result in the message. When the VF samples the Bulletin Board it copies the message aside and validates this crc. The length of the message is crucial here and must be the same in both parties. Since the PF is running in the Hypervisor and the VF is running in a Vm, they can possibly be of different versions. As the Bulletin Board is designed to grow forward in future versions, in the VF the length must not be the size of the message structure but instead it should be a field in the message itself. Signed-off-by: Ariel Elior <ariele@broadcom.com> Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c')
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c
index 9cef520e9b93..36246129864c 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c
@@ -1631,7 +1631,6 @@ int bnx2x_post_vf_bulletin(struct bnx2x *bp, int vf)
dma_addr_t pf_addr = BP_VF_BULLETIN_DMA(bp)->mapping +
vf * BULLETIN_CONTENT_SIZE;
dma_addr_t vf_addr = bnx2x_vf(bp, vf, bulletin_map);
- u32 len = BULLETIN_CONTENT_SIZE;
int rc;
/* can only update vf after init took place */
@@ -1641,11 +1640,12 @@ int bnx2x_post_vf_bulletin(struct bnx2x *bp, int vf)
/* increment bulletin board version and compute crc */
bulletin->version++;
+ bulletin->length = BULLETIN_CONTENT_SIZE;
bulletin->crc = bnx2x_crc_vf_bulletin(bp, bulletin);
/* propagate bulletin board via dmae to vm memory */
rc = bnx2x_copy32_vf_dmae(bp, false, pf_addr,
bnx2x_vf(bp, vf, abs_vfid), U64_HI(vf_addr),
- U64_LO(vf_addr), len/4);
+ U64_LO(vf_addr), bulletin->length / 4);
return rc;
}