@@ -2086,6 +2086,9 @@ static int bnxt_async_event_process(struct bnxt *bp,
20862086 u32 data1 = le32_to_cpu (cmpl -> event_data1 );
20872087 u32 data2 = le32_to_cpu (cmpl -> event_data2 );
20882088
2089+ netdev_dbg (bp -> dev , "hwrm event 0x%x {0x%x, 0x%x}\n" ,
2090+ event_id , data1 , data2 );
2091+
20892092 /* TODO CHIMP_FW: Define event id's for link change, error etc */
20902093 switch (event_id ) {
20912094 case ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CFG_CHANGE : {
@@ -7691,19 +7694,6 @@ static void __bnxt_map_fw_health_reg(struct bnxt *bp, u32 reg)
76917694 BNXT_FW_HEALTH_WIN_MAP_OFF );
76927695}
76937696
7694- bool bnxt_is_fw_healthy (struct bnxt * bp )
7695- {
7696- if (bp -> fw_health && bp -> fw_health -> status_reliable ) {
7697- u32 fw_status ;
7698-
7699- fw_status = bnxt_fw_health_readl (bp , BNXT_FW_HEALTH_REG );
7700- if (fw_status && !BNXT_FW_IS_HEALTHY (fw_status ))
7701- return false;
7702- }
7703-
7704- return true;
7705- }
7706-
77077697static void bnxt_inv_fw_health_reg (struct bnxt * bp )
77087698{
77097699 struct bnxt_fw_health * fw_health = bp -> fw_health ;
@@ -8031,6 +8021,12 @@ static int bnxt_hwrm_ver_get(struct bnxt *bp)
80318021 bp -> hwrm_cmd_timeout = le16_to_cpu (resp -> def_req_timeout );
80328022 if (!bp -> hwrm_cmd_timeout )
80338023 bp -> hwrm_cmd_timeout = DFLT_HWRM_CMD_TIMEOUT ;
8024+ bp -> hwrm_cmd_max_timeout = le16_to_cpu (resp -> max_req_timeout ) * 1000 ;
8025+ if (!bp -> hwrm_cmd_max_timeout )
8026+ bp -> hwrm_cmd_max_timeout = HWRM_CMD_MAX_TIMEOUT ;
8027+ else if (bp -> hwrm_cmd_max_timeout > HWRM_CMD_MAX_TIMEOUT )
8028+ netdev_warn (bp -> dev , "Device requests max timeout of %d seconds, may trigger hung task watchdog\n" ,
8029+ bp -> hwrm_cmd_max_timeout / 1000 );
80348030
80358031 if (resp -> hwrm_intf_maj_8b >= 1 ) {
80368032 bp -> hwrm_max_req_len = le16_to_cpu (resp -> max_req_win_len );
@@ -8634,7 +8630,10 @@ static int bnxt_init_chip(struct bnxt *bp, bool irq_re_init)
86348630 /* Filter for default vnic 0 */
86358631 rc = bnxt_hwrm_set_vnic_filter (bp , 0 , 0 , bp -> dev -> dev_addr );
86368632 if (rc ) {
8637- netdev_err (bp -> dev , "HWRM vnic filter failure rc: %x\n" , rc );
8633+ if (BNXT_VF (bp ) && rc == - ENODEV )
8634+ netdev_err (bp -> dev , "Cannot configure L2 filter while PF is unavailable\n" );
8635+ else
8636+ netdev_err (bp -> dev , "HWRM vnic filter failure rc: %x\n" , rc );
86388637 goto err_out ;
86398638 }
86408639 vnic -> uc_filter_count = 1 ;
@@ -9427,6 +9426,10 @@ int bnxt_update_link(struct bnxt *bp, bool chng_link_state)
94279426 rc = hwrm_req_send (bp , req );
94289427 if (rc ) {
94299428 hwrm_req_drop (bp , req );
9429+ if (BNXT_VF (bp ) && rc == - ENODEV ) {
9430+ netdev_warn (bp -> dev , "Cannot obtain link state while PF unavailable.\n" );
9431+ rc = 0 ;
9432+ }
94309433 return rc ;
94319434 }
94329435
@@ -10825,12 +10828,21 @@ static int bnxt_cfg_rx_mode(struct bnxt *bp)
1082510828 for (i = 1 , off = 0 ; i < vnic -> uc_filter_count ; i ++ , off += ETH_ALEN ) {
1082610829 rc = bnxt_hwrm_set_vnic_filter (bp , 0 , i , vnic -> uc_list + off );
1082710830 if (rc ) {
10828- netdev_err (bp -> dev , "HWRM vnic filter failure rc: %x\n" ,
10829- rc );
10831+ if (BNXT_VF (bp ) && rc == - ENODEV ) {
10832+ if (!test_and_set_bit (BNXT_STATE_L2_FILTER_RETRY , & bp -> state ))
10833+ netdev_warn (bp -> dev , "Cannot configure L2 filters while PF is unavailable, will retry\n" );
10834+ else
10835+ netdev_dbg (bp -> dev , "PF still unavailable while configuring L2 filters.\n" );
10836+ rc = 0 ;
10837+ } else {
10838+ netdev_err (bp -> dev , "HWRM vnic filter failure rc: %x\n" , rc );
10839+ }
1083010840 vnic -> uc_filter_count = i ;
1083110841 return rc ;
1083210842 }
1083310843 }
10844+ if (test_and_clear_bit (BNXT_STATE_L2_FILTER_RETRY , & bp -> state ))
10845+ netdev_notice (bp -> dev , "Retry of L2 filter configuration successful.\n" );
1083410846
1083510847skip_uc :
1083610848 if ((vnic -> rx_mask & CFA_L2_SET_RX_MASK_REQ_MASK_PROMISCUOUS ) &&
@@ -11395,6 +11407,11 @@ static void bnxt_timer(struct timer_list *t)
1139511407 }
1139611408 }
1139711409
11410+ if (test_bit (BNXT_STATE_L2_FILTER_RETRY , & bp -> state )) {
11411+ set_bit (BNXT_RX_MASK_SP_EVENT , & bp -> sp_event );
11412+ bnxt_queue_sp_work (bp );
11413+ }
11414+
1139811415 if ((bp -> flags & BNXT_FLAG_CHIP_P5 ) && !bp -> chip_rev &&
1139911416 netif_carrier_ok (dev )) {
1140011417 set_bit (BNXT_RING_COAL_NOW_SP_EVENT , & bp -> sp_event );
@@ -13101,7 +13118,7 @@ static int bnxt_set_dflt_rings(struct bnxt *bp, bool sh)
1310113118 bp -> tx_nr_rings = bp -> tx_nr_rings_per_tc ;
1310213119
1310313120 rc = __bnxt_reserve_rings (bp );
13104- if (rc )
13121+ if (rc && rc != - ENODEV )
1310513122 netdev_warn (bp -> dev , "Unable to reserve tx rings\n" );
1310613123 bp -> tx_nr_rings_per_tc = bp -> tx_nr_rings ;
1310713124 if (sh )
@@ -13110,7 +13127,7 @@ static int bnxt_set_dflt_rings(struct bnxt *bp, bool sh)
1311013127 /* Rings may have been trimmed, re-reserve the trimmed rings. */
1311113128 if (bnxt_need_reserve_rings (bp )) {
1311213129 rc = __bnxt_reserve_rings (bp );
13113- if (rc )
13130+ if (rc && rc != - ENODEV )
1311413131 netdev_warn (bp -> dev , "2nd rings reservation failed.\n" );
1311513132 bp -> tx_nr_rings_per_tc = bp -> tx_nr_rings ;
1311613133 }
@@ -13136,7 +13153,10 @@ static int bnxt_init_dflt_ring_mode(struct bnxt *bp)
1313613153 bnxt_clear_int_mode (bp );
1313713154 rc = bnxt_set_dflt_rings (bp , true);
1313813155 if (rc ) {
13139- netdev_err (bp -> dev , "Not enough rings available.\n" );
13156+ if (BNXT_VF (bp ) && rc == - ENODEV )
13157+ netdev_err (bp -> dev , "Cannot configure VF rings while PF is unavailable.\n" );
13158+ else
13159+ netdev_err (bp -> dev , "Not enough rings available.\n" );
1314013160 goto init_dflt_ring_err ;
1314113161 }
1314213162 rc = bnxt_init_int_mode (bp );
@@ -13424,8 +13444,12 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
1342413444 bnxt_set_ring_params (bp );
1342513445 rc = bnxt_set_dflt_rings (bp , true);
1342613446 if (rc ) {
13427- netdev_err (bp -> dev , "Not enough rings available.\n" );
13428- rc = - ENOMEM ;
13447+ if (BNXT_VF (bp ) && rc == - ENODEV ) {
13448+ netdev_err (bp -> dev , "Cannot configure VF rings while PF is unavailable.\n" );
13449+ } else {
13450+ netdev_err (bp -> dev , "Not enough rings available.\n" );
13451+ rc = - ENOMEM ;
13452+ }
1342913453 goto init_err_pci_clean ;
1343013454 }
1343113455
0 commit comments