mirror of https://gitee.com/openkylin/linux.git
bnx2x: Fix bnx2x_panic_dump for VFs
bnx2x_panic_dump() prints all kind of driver information, including slowpath information. Since VFs don't initialize slowpath information, a VF reaching this flow will likely cause a panic in the system as it will access NULL pointers. Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com> Signed-off-by: Ariel Elior <ariele@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
3a3534ecf2
commit
0155a27cda
|
@ -918,7 +918,7 @@ void bnx2x_panic_dump(struct bnx2x *bp, bool disable_int)
|
||||||
u16 start = 0, end = 0;
|
u16 start = 0, end = 0;
|
||||||
u8 cos;
|
u8 cos;
|
||||||
#endif
|
#endif
|
||||||
if (disable_int)
|
if (IS_PF(bp) && disable_int)
|
||||||
bnx2x_int_disable(bp);
|
bnx2x_int_disable(bp);
|
||||||
|
|
||||||
bp->stats_state = STATS_STATE_DISABLED;
|
bp->stats_state = STATS_STATE_DISABLED;
|
||||||
|
@ -929,33 +929,41 @@ void bnx2x_panic_dump(struct bnx2x *bp, bool disable_int)
|
||||||
|
|
||||||
/* Indices */
|
/* Indices */
|
||||||
/* Common */
|
/* Common */
|
||||||
BNX2X_ERR("def_idx(0x%x) def_att_idx(0x%x) attn_state(0x%x) spq_prod_idx(0x%x) next_stats_cnt(0x%x)\n",
|
if (IS_PF(bp)) {
|
||||||
bp->def_idx, bp->def_att_idx, bp->attn_state,
|
struct host_sp_status_block *def_sb = bp->def_status_blk;
|
||||||
bp->spq_prod_idx, bp->stats_counter);
|
int data_size, cstorm_offset;
|
||||||
BNX2X_ERR("DSB: attn bits(0x%x) ack(0x%x) id(0x%x) idx(0x%x)\n",
|
|
||||||
bp->def_status_blk->atten_status_block.attn_bits,
|
|
||||||
bp->def_status_blk->atten_status_block.attn_bits_ack,
|
|
||||||
bp->def_status_blk->atten_status_block.status_block_id,
|
|
||||||
bp->def_status_blk->atten_status_block.attn_bits_index);
|
|
||||||
BNX2X_ERR(" def (");
|
|
||||||
for (i = 0; i < HC_SP_SB_MAX_INDICES; i++)
|
|
||||||
pr_cont("0x%x%s",
|
|
||||||
bp->def_status_blk->sp_sb.index_values[i],
|
|
||||||
(i == HC_SP_SB_MAX_INDICES - 1) ? ") " : " ");
|
|
||||||
|
|
||||||
for (i = 0; i < sizeof(struct hc_sp_status_block_data)/sizeof(u32); i++)
|
BNX2X_ERR("def_idx(0x%x) def_att_idx(0x%x) attn_state(0x%x) spq_prod_idx(0x%x) next_stats_cnt(0x%x)\n",
|
||||||
*((u32 *)&sp_sb_data + i) = REG_RD(bp, BAR_CSTRORM_INTMEM +
|
bp->def_idx, bp->def_att_idx, bp->attn_state,
|
||||||
CSTORM_SP_STATUS_BLOCK_DATA_OFFSET(func) +
|
bp->spq_prod_idx, bp->stats_counter);
|
||||||
i*sizeof(u32));
|
BNX2X_ERR("DSB: attn bits(0x%x) ack(0x%x) id(0x%x) idx(0x%x)\n",
|
||||||
|
def_sb->atten_status_block.attn_bits,
|
||||||
|
def_sb->atten_status_block.attn_bits_ack,
|
||||||
|
def_sb->atten_status_block.status_block_id,
|
||||||
|
def_sb->atten_status_block.attn_bits_index);
|
||||||
|
BNX2X_ERR(" def (");
|
||||||
|
for (i = 0; i < HC_SP_SB_MAX_INDICES; i++)
|
||||||
|
pr_cont("0x%x%s",
|
||||||
|
def_sb->sp_sb.index_values[i],
|
||||||
|
(i == HC_SP_SB_MAX_INDICES - 1) ? ") " : " ");
|
||||||
|
|
||||||
pr_cont("igu_sb_id(0x%x) igu_seg_id(0x%x) pf_id(0x%x) vnic_id(0x%x) vf_id(0x%x) vf_valid (0x%x) state(0x%x)\n",
|
data_size = sizeof(struct hc_sp_status_block_data) /
|
||||||
sp_sb_data.igu_sb_id,
|
sizeof(u32);
|
||||||
sp_sb_data.igu_seg_id,
|
cstorm_offset = CSTORM_SP_STATUS_BLOCK_DATA_OFFSET(func);
|
||||||
sp_sb_data.p_func.pf_id,
|
for (i = 0; i < data_size; i++)
|
||||||
sp_sb_data.p_func.vnic_id,
|
*((u32 *)&sp_sb_data + i) =
|
||||||
sp_sb_data.p_func.vf_id,
|
REG_RD(bp, BAR_CSTRORM_INTMEM + cstorm_offset +
|
||||||
sp_sb_data.p_func.vf_valid,
|
i * sizeof(u32));
|
||||||
sp_sb_data.state);
|
|
||||||
|
pr_cont("igu_sb_id(0x%x) igu_seg_id(0x%x) pf_id(0x%x) vnic_id(0x%x) vf_id(0x%x) vf_valid (0x%x) state(0x%x)\n",
|
||||||
|
sp_sb_data.igu_sb_id,
|
||||||
|
sp_sb_data.igu_seg_id,
|
||||||
|
sp_sb_data.p_func.pf_id,
|
||||||
|
sp_sb_data.p_func.vnic_id,
|
||||||
|
sp_sb_data.p_func.vf_id,
|
||||||
|
sp_sb_data.p_func.vf_valid,
|
||||||
|
sp_sb_data.state);
|
||||||
|
}
|
||||||
|
|
||||||
for_each_eth_queue(bp, i) {
|
for_each_eth_queue(bp, i) {
|
||||||
struct bnx2x_fastpath *fp = &bp->fp[i];
|
struct bnx2x_fastpath *fp = &bp->fp[i];
|
||||||
|
@ -1013,6 +1021,11 @@ void bnx2x_panic_dump(struct bnx2x *bp, bool disable_int)
|
||||||
pr_cont("0x%x%s",
|
pr_cont("0x%x%s",
|
||||||
fp->sb_index_values[j],
|
fp->sb_index_values[j],
|
||||||
(j == loop - 1) ? ")" : " ");
|
(j == loop - 1) ? ")" : " ");
|
||||||
|
|
||||||
|
/* VF cannot access FW refelection for status block */
|
||||||
|
if (IS_VF(bp))
|
||||||
|
continue;
|
||||||
|
|
||||||
/* fw sb data */
|
/* fw sb data */
|
||||||
data_size = CHIP_IS_E1x(bp) ?
|
data_size = CHIP_IS_E1x(bp) ?
|
||||||
sizeof(struct hc_status_block_data_e1x) :
|
sizeof(struct hc_status_block_data_e1x) :
|
||||||
|
@ -1064,16 +1077,18 @@ void bnx2x_panic_dump(struct bnx2x *bp, bool disable_int)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef BNX2X_STOP_ON_ERROR
|
#ifdef BNX2X_STOP_ON_ERROR
|
||||||
|
if (IS_PF(bp)) {
|
||||||
|
/* event queue */
|
||||||
|
BNX2X_ERR("eq cons %x prod %x\n", bp->eq_cons, bp->eq_prod);
|
||||||
|
for (i = 0; i < NUM_EQ_DESC; i++) {
|
||||||
|
u32 *data = (u32 *)&bp->eq_ring[i].message.data;
|
||||||
|
|
||||||
/* event queue */
|
BNX2X_ERR("event queue [%d]: header: opcode %d, error %d\n",
|
||||||
BNX2X_ERR("eq cons %x prod %x\n", bp->eq_cons, bp->eq_prod);
|
i, bp->eq_ring[i].message.opcode,
|
||||||
for (i = 0; i < NUM_EQ_DESC; i++) {
|
bp->eq_ring[i].message.error);
|
||||||
u32 *data = (u32 *)&bp->eq_ring[i].message.data;
|
BNX2X_ERR("data: %x %x %x\n",
|
||||||
|
data[0], data[1], data[2]);
|
||||||
BNX2X_ERR("event queue [%d]: header: opcode %d, error %d\n",
|
}
|
||||||
i, bp->eq_ring[i].message.opcode,
|
|
||||||
bp->eq_ring[i].message.error);
|
|
||||||
BNX2X_ERR("data: %x %x %x\n", data[0], data[1], data[2]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Rings */
|
/* Rings */
|
||||||
|
@ -1140,8 +1155,10 @@ void bnx2x_panic_dump(struct bnx2x *bp, bool disable_int)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
bnx2x_fw_dump(bp);
|
if (IS_PF(bp)) {
|
||||||
bnx2x_mc_assert(bp);
|
bnx2x_fw_dump(bp);
|
||||||
|
bnx2x_mc_assert(bp);
|
||||||
|
}
|
||||||
BNX2X_ERR("end crash dump -----------------\n");
|
BNX2X_ERR("end crash dump -----------------\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue