Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'bnx2x'

Yuval Mintz says:

====================
This patch contains various bug fixes, half of which are SR-IOV related
(some fixing issues in the recently added VF RSS support), while the other fix
a wide assortments of issues in the driver.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>

+44 -38
+1 -2
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
··· 2481 2481 load_error_cnic1: 2482 2482 bnx2x_napi_disable_cnic(bp); 2483 2483 /* Update the number of queues without the cnic queues */ 2484 - rc = bnx2x_set_real_num_queues(bp, 0); 2485 - if (rc) 2484 + if (bnx2x_set_real_num_queues(bp, 0)) 2486 2485 BNX2X_ERR("Unable to set real_num_queues not including cnic\n"); 2487 2486 load_error_cnic0: 2488 2487 BNX2X_ERR("CNIC-related load failed\n");
+15 -9
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
··· 4703 4703 attn.sig[3] = REG_RD(bp, 4704 4704 MISC_REG_AEU_AFTER_INVERT_4_FUNC_0 + 4705 4705 port*4); 4706 + /* Since MCP attentions can't be disabled inside the block, we need to 4707 + * read AEU registers to see whether they're currently disabled 4708 + */ 4709 + attn.sig[3] &= ((REG_RD(bp, 4710 + !port ? MISC_REG_AEU_ENABLE4_FUNC_0_OUT_0 4711 + : MISC_REG_AEU_ENABLE4_FUNC_1_OUT_0) & 4712 + MISC_AEU_ENABLE_MCP_PRTY_BITS) | 4713 + ~MISC_AEU_ENABLE_MCP_PRTY_BITS); 4706 4714 4707 4715 if (!CHIP_IS_E1x(bp)) 4708 4716 attn.sig[4] = REG_RD(bp, ··· 5455 5447 if (IS_PF(bp) && 5456 5448 !BP_NOMCP(bp)) { 5457 5449 int mb_idx = BP_FW_MB_IDX(bp); 5458 - u32 drv_pulse; 5459 - u32 mcp_pulse; 5450 + u16 drv_pulse; 5451 + u16 mcp_pulse; 5460 5452 5461 5453 ++bp->fw_drv_pulse_wr_seq; 5462 5454 bp->fw_drv_pulse_wr_seq &= DRV_PULSE_SEQ_MASK; 5463 - /* TBD - add SYSTEM_TIME */ 5464 5455 drv_pulse = bp->fw_drv_pulse_wr_seq; 5465 5456 bnx2x_drv_pulse(bp); 5466 5457 5467 5458 mcp_pulse = (SHMEM_RD(bp, func_mb[mb_idx].mcp_pulse_mb) & 5468 5459 MCP_PULSE_SEQ_MASK); 5469 5460 /* The delta between driver pulse and mcp response 5470 - * should be 1 (before mcp response) or 0 (after mcp response) 5461 + * should not get too big. If the MFW is more than 5 pulses 5462 + * behind, we should worry about it enough to generate an error 5463 + * log. 5471 5464 */ 5472 - if ((drv_pulse != mcp_pulse) && 5473 - (drv_pulse != ((mcp_pulse + 1) & MCP_PULSE_SEQ_MASK))) { 5474 - /* someone lost a heartbeat... */ 5475 - BNX2X_ERR("drv_pulse (0x%x) != mcp_pulse (0x%x)\n", 5465 + if (((drv_pulse - mcp_pulse) & MCP_PULSE_SEQ_MASK) > 5) 5466 + BNX2X_ERR("MFW seems hanged: drv_pulse (0x%x) != mcp_pulse (0x%x)\n", 5476 5467 drv_pulse, mcp_pulse); 5477 - } 5478 5468 } 5479 5469 5480 5470 if (bp->state == BNX2X_STATE_OPEN)
+4 -1
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
··· 1819 1819 fid = GET_FIELD((val), IGU_REG_MAPPING_MEMORY_FID); 1820 1820 if (fid & IGU_FID_ENCODE_IS_PF) 1821 1821 current_pf = fid & IGU_FID_PF_NUM_MASK; 1822 - else if (current_pf == BP_ABS_FUNC(bp)) 1822 + else if (current_pf == BP_FUNC(bp)) 1823 1823 bnx2x_vf_set_igu_info(bp, sb_id, 1824 1824 (fid & IGU_FID_VF_NUM_MASK)); 1825 1825 DP(BNX2X_MSG_IOV, "%s[%d], igu_sb_id=%d, msix=%d\n", ··· 3180 3180 /* set local queue arrays */ 3181 3181 vf->vfqs = &bp->vfdb->vfqs[qcount]; 3182 3182 qcount += vf_sb_count(vf); 3183 + bnx2x_iov_static_resc(bp, vf); 3183 3184 } 3184 3185 3185 3186 /* prepare msix vectors in VF configuration space */ ··· 3188 3187 bnx2x_pretend_func(bp, HW_VF_HANDLE(bp, vf_idx)); 3189 3188 REG_WR(bp, PCICFG_OFFSET + GRC_CONFIG_REG_VF_MSIX_CONTROL, 3190 3189 num_vf_queues); 3190 + DP(BNX2X_MSG_IOV, "set msix vec num in VF %d cfg space to %d\n", 3191 + vf_idx, num_vf_queues); 3191 3192 } 3192 3193 bnx2x_pretend_func(bp, BP_ABS_FUNC(bp)); 3193 3194
+24 -26
drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c
··· 1765 1765 switch (mbx->first_tlv.tl.type) { 1766 1766 case CHANNEL_TLV_ACQUIRE: 1767 1767 bnx2x_vf_mbx_acquire(bp, vf, mbx); 1768 - break; 1768 + return; 1769 1769 case CHANNEL_TLV_INIT: 1770 1770 bnx2x_vf_mbx_init_vf(bp, vf, mbx); 1771 - break; 1771 + return; 1772 1772 case CHANNEL_TLV_SETUP_Q: 1773 1773 bnx2x_vf_mbx_setup_q(bp, vf, mbx); 1774 - break; 1774 + return; 1775 1775 case CHANNEL_TLV_SET_Q_FILTERS: 1776 1776 bnx2x_vf_mbx_set_q_filters(bp, vf, mbx); 1777 - break; 1777 + return; 1778 1778 case CHANNEL_TLV_TEARDOWN_Q: 1779 1779 bnx2x_vf_mbx_teardown_q(bp, vf, mbx); 1780 - break; 1780 + return; 1781 1781 case CHANNEL_TLV_CLOSE: 1782 1782 bnx2x_vf_mbx_close_vf(bp, vf, mbx); 1783 - break; 1783 + return; 1784 1784 case CHANNEL_TLV_RELEASE: 1785 1785 bnx2x_vf_mbx_release_vf(bp, vf, mbx); 1786 - break; 1786 + return; 1787 1787 case CHANNEL_TLV_UPDATE_RSS: 1788 1788 bnx2x_vf_mbx_update_rss(bp, vf, mbx); 1789 - break; 1789 + return; 1790 1790 } 1791 1791 1792 1792 } else { ··· 1802 1802 for (i = 0; i < 20; i++) 1803 1803 DP_CONT(BNX2X_MSG_IOV, "%x ", 1804 1804 mbx->msg->req.tlv_buf_size.tlv_buffer[i]); 1805 + } 1805 1806 1806 - /* test whether we can respond to the VF (do we have an address 1807 - * for it?) 1807 + /* can we respond to VF (do we have an address for it?) */ 1808 + if (vf->state == VF_ACQUIRED || vf->state == VF_ENABLED) { 1809 + /* mbx_resp uses the op_rc of the VF */ 1810 + vf->op_rc = PFVF_STATUS_NOT_SUPPORTED; 1811 + 1812 + /* notify the VF that we do not support this request */ 1813 + bnx2x_vf_mbx_resp(bp, vf); 1814 + } else { 1815 + /* can't send a response since this VF is unknown to us 1816 + * just ack the FW to release the mailbox and unlock 1817 + * the channel. 1808 1818 */ 1809 - if (vf->state == VF_ACQUIRED || vf->state == VF_ENABLED) { 1810 - /* mbx_resp uses the op_rc of the VF */ 1811 - vf->op_rc = PFVF_STATUS_NOT_SUPPORTED; 1812 - 1813 - /* notify the VF that we do not support this request */ 1814 - bnx2x_vf_mbx_resp(bp, vf); 1815 - } else { 1816 - /* can't send a response since this VF is unknown to us 1817 - * just ack the FW to release the mailbox and unlock 1818 - * the channel. 1819 - */ 1820 - storm_memset_vf_mbx_ack(bp, vf->abs_vfid); 1821 - mmiowb(); 1822 - bnx2x_unlock_vf_pf_channel(bp, vf, 1823 - mbx->first_tlv.tl.type); 1824 - } 1819 + storm_memset_vf_mbx_ack(bp, vf->abs_vfid); 1820 + /* Firmware ack should be written before unlocking channel */ 1821 + mmiowb(); 1822 + bnx2x_unlock_vf_pf_channel(bp, vf, mbx->first_tlv.tl.type); 1825 1823 } 1826 1824 } 1827 1825