diff options
author | Ariel Elior <ariele@broadcom.com> | 2013-01-01 05:22:26 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-01-02 01:45:05 -0800 |
commit | ad5afc89365e981cffafc241a4c46f56ca943370 (patch) | |
tree | da166146726432ac08804371b0c97832b632c035 /drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h | |
parent | 4513f92576856c552212fb9608aca56b88022454 (diff) | |
download | op-kernel-dev-ad5afc89365e981cffafc241a4c46f56ca943370.zip op-kernel-dev-ad5afc89365e981cffafc241a4c46f56ca943370.tar.gz |
bnx2x: Separate VF and PF logic
Generally, the VF driver cannot access the chip, except by the
narrow window its BAR allows. Care had to be taken so the VF driver
will not reach code which accesses the chip elsewhere.
Refactor the nic_load flow into parts so it would be
easier to separate the VF-only logic from the PF-only logic.
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_cmn.h')
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h index bca371e..91e432d 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h @@ -1128,11 +1128,18 @@ static inline u8 bnx2x_fp_qzone_id(struct bnx2x_fastpath *fp) static inline u32 bnx2x_rx_ustorm_prods_offset(struct bnx2x_fastpath *fp) { struct bnx2x *bp = fp->bp; - - if (!CHIP_IS_E1x(bp)) - return USTORM_RX_PRODS_E2_OFFSET(fp->cl_qzone_id); + u32 offset = BAR_USTRORM_INTMEM; + + if (IS_VF(bp)) + return PXP_VF_ADDR_USDM_QUEUES_START + + bp->acquire_resp.resc.hw_qid[fp->index] * + sizeof(struct ustorm_queue_zone_data); + else if (!CHIP_IS_E1x(bp)) + offset += USTORM_RX_PRODS_E2_OFFSET(fp->cl_qzone_id); else - return USTORM_RX_PRODS_E1X_OFFSET(BP_PORT(bp), fp->cl_id); + offset += USTORM_RX_PRODS_E1X_OFFSET(BP_PORT(bp), fp->cl_id); + + return offset; } static inline void bnx2x_init_txdata(struct bnx2x *bp, |