Commit 4c133c39 authored by Ariel Elior's avatar Ariel Elior Committed by David S. Miller
Browse files

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: default avatarAriel Elior <>
Signed-off-by: default avatarYuval Mintz <>
Signed-off-by: default avatarDavid S. Miller <>
parent ca9bdb9b
......@@ -3124,7 +3124,7 @@ u32 bnx2x_crc_vf_bulletin(struct bnx2x *bp,
return crc32(BULLETIN_CRC_SEED,
((u8 *)bulletin) + sizeof(bulletin->crc),
BULLETIN_CONTENT_SIZE - sizeof(bulletin->crc));
bulletin->length - sizeof(bulletin->crc));
/* Check for new posts on the bulletin board */
......@@ -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 +
dma_addr_t vf_addr = bnx2x_vf(bp, vf, bulletin_map);
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->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;
......@@ -318,7 +318,8 @@ struct pf_vf_bulletin_content {
u32 crc; /* crc of structure to ensure is not in
* mid-update
u32 version;
u16 version;
u16 length;
aligned_u64 valid_bitmap; /* bitmap indicating which fields
* hold valid values
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment