@@ -6896,7 +6896,8 @@ int bnxt_hwrm_vnic_cfg(struct bnxt *bp, struct bnxt_vnic_info *vnic)
68966896#endif
68976897 if ((bp -> flags & BNXT_FLAG_STRIP_VLAN ) || def_vlan )
68986898 req -> flags |= cpu_to_le32 (VNIC_CFG_REQ_FLAGS_VLAN_STRIP_MODE );
6899- if (vnic -> vnic_id == BNXT_VNIC_DEFAULT && bnxt_ulp_registered (bp -> edev ))
6899+ if (vnic -> vnic_id == BNXT_VNIC_DEFAULT &&
6900+ bnxt_ulp_registered (bp -> edev [BNXT_AUXDEV_RDMA ]))
69006901 req -> flags |= cpu_to_le32 (bnxt_get_roce_vnic_mode (bp ));
69016902
69026903 return hwrm_req_send (bp , req );
@@ -8031,6 +8032,7 @@ static int bnxt_get_avail_msix(struct bnxt *bp, int num);
80318032
80328033static int __bnxt_reserve_rings (struct bnxt * bp )
80338034{
8035+ struct bnxt_en_dev * edev = bp -> edev [BNXT_AUXDEV_RDMA ];
80348036 struct bnxt_hw_rings hwr = {0 };
80358037 int rx_rings , old_rx_rings , rc ;
80368038 int cp = bp -> cp_nr_rings ;
@@ -8041,7 +8043,7 @@ static int __bnxt_reserve_rings(struct bnxt *bp)
80418043 if (!bnxt_need_reserve_rings (bp ))
80428044 return 0 ;
80438045
8044- if (BNXT_NEW_RM (bp ) && !bnxt_ulp_registered (bp -> edev )) {
8046+ if (BNXT_NEW_RM (bp ) && !bnxt_ulp_registered (edev )) {
80458047 ulp_msix = bnxt_get_avail_msix (bp , bp -> ulp_num_msix_want );
80468048 if (!ulp_msix )
80478049 bnxt_set_ulp_stat_ctxs (bp , 0 );
@@ -8092,8 +8094,7 @@ static int __bnxt_reserve_rings(struct bnxt *bp)
80928094 }
80938095 rx_rings = min_t (int , rx_rings , hwr .grp );
80948096 hwr .cp = min_t (int , hwr .cp , bp -> cp_nr_rings );
8095- if (bnxt_ulp_registered (bp -> edev ) &&
8096- hwr .stat > bnxt_get_ulp_stat_ctxs (bp ))
8097+ if (bnxt_ulp_registered (edev ) && hwr .stat > bnxt_get_ulp_stat_ctxs (bp ))
80978098 hwr .stat -= bnxt_get_ulp_stat_ctxs (bp );
80988099 hwr .cp = min_t (int , hwr .cp , hwr .stat );
80998100 rc = bnxt_trim_rings (bp , & rx_rings , & hwr .tx , hwr .cp , sh );
@@ -8137,7 +8138,7 @@ static int __bnxt_reserve_rings(struct bnxt *bp)
81378138 !netif_is_rxfh_configured (bp -> dev ))
81388139 bnxt_set_dflt_rss_indir_tbl (bp , NULL );
81398140
8140- if (!bnxt_ulp_registered (bp -> edev ) && BNXT_NEW_RM (bp )) {
8141+ if (!bnxt_ulp_registered (edev ) && BNXT_NEW_RM (bp )) {
81418142 int resv_msix , resv_ctx , ulp_ctxs ;
81428143 struct bnxt_hw_resc * hw_resc ;
81438144
@@ -11494,6 +11495,7 @@ static void bnxt_clear_int_mode(struct bnxt *bp)
1149411495
1149511496int bnxt_reserve_rings (struct bnxt * bp , bool irq_re_init )
1149611497{
11498+ struct bnxt_en_dev * edev = bp -> edev [BNXT_AUXDEV_RDMA ];
1149711499 bool irq_cleared = false;
1149811500 bool irq_change = false;
1149911501 int tcs = bp -> num_tc ;
@@ -11503,7 +11505,7 @@ int bnxt_reserve_rings(struct bnxt *bp, bool irq_re_init)
1150311505 if (!bnxt_need_reserve_rings (bp ))
1150411506 return 0 ;
1150511507
11506- if (BNXT_NEW_RM (bp ) && !bnxt_ulp_registered (bp -> edev )) {
11508+ if (BNXT_NEW_RM (bp ) && !bnxt_ulp_registered (edev )) {
1150711509 int ulp_msix = bnxt_get_avail_msix (bp , bp -> ulp_num_msix_want );
1150811510
1150911511 if (ulp_msix > bp -> ulp_num_msix_want )
@@ -14593,7 +14595,7 @@ static void bnxt_fw_echo_reply(struct bnxt *bp)
1459314595static void bnxt_ulp_restart (struct bnxt * bp )
1459414596{
1459514597 bnxt_ulp_stop (bp );
14596- bnxt_ulp_start (bp , 0 );
14598+ bnxt_ulp_start (bp );
1459714599}
1459814600
1459914601static void bnxt_sp_task (struct work_struct * work )
@@ -14750,7 +14752,7 @@ int bnxt_check_rings(struct bnxt *bp, int tx, int rx, bool sh, int tcs,
1475014752 hwr .cp_p5 = hwr .tx + rx ;
1475114753 rc = bnxt_hwrm_check_rings (bp , & hwr );
1475214754 if (!rc && pci_msix_can_alloc_dyn (bp -> pdev )) {
14753- if (!bnxt_ulp_registered (bp -> edev )) {
14755+ if (!bnxt_ulp_registered (bp -> edev [ BNXT_AUXDEV_RDMA ] )) {
1475414756 hwr .cp += bnxt_get_ulp_msix_num (bp );
1475514757 hwr .cp = min_t (int , hwr .cp , bnxt_get_max_func_irqs (bp ));
1475614758 }
@@ -15270,7 +15272,7 @@ static void bnxt_fw_reset_task(struct work_struct *work)
1527015272 bnxt_dl_health_fw_status_update (bp , true);
1527115273 }
1527215274 netdev_unlock (bp -> dev );
15273- bnxt_ulp_start (bp , 0 );
15275+ bnxt_ulp_start (bp );
1527415276 bnxt_reenable_sriov (bp );
1527515277 netdev_lock (bp -> dev );
1527615278 bnxt_vf_reps_alloc (bp );
@@ -15292,7 +15294,8 @@ static void bnxt_fw_reset_task(struct work_struct *work)
1529215294 bnxt_fw_reset_abort (bp , rc );
1529315295 netdev_unlock (bp -> dev );
1529415296ulp_start :
15295- bnxt_ulp_start (bp , rc );
15297+ if (!rc )
15298+ bnxt_ulp_start (bp );
1529615299}
1529715300
1529815301static int bnxt_init_board (struct pci_dev * pdev , struct net_device * dev )
@@ -16327,12 +16330,13 @@ static void bnxt_remove_one(struct pci_dev *pdev)
1632716330 if (BNXT_PF (bp ))
1632816331 __bnxt_sriov_disable (bp );
1632916332
16330- bnxt_rdma_aux_device_del (bp );
16333+ bnxt_aux_devices_del (bp );
1633116334
1633216335 unregister_netdev (dev );
1633316336 bnxt_ptp_clear (bp );
1633416337
16335- bnxt_rdma_aux_device_uninit (bp );
16338+ bnxt_aux_devices_uninit (bp );
16339+ bnxt_auxdev_id_free (bp , bp -> auxdev_id );
1633616340
1633716341 bnxt_free_l2_filters (bp , true);
1633816342 bnxt_free_ntp_fltrs (bp , true);
@@ -16918,7 +16922,9 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
1691816922 bnxt_set_tpa_flags (bp );
1691916923 bnxt_init_ring_params (bp );
1692016924 bnxt_set_ring_params (bp );
16921- bnxt_rdma_aux_device_init (bp );
16925+ mutex_init (& bp -> auxdev_lock );
16926+ if (!bnxt_auxdev_id_alloc (bp ))
16927+ bnxt_aux_devices_init (bp );
1692216928 rc = bnxt_set_dflt_rings (bp , true);
1692316929 if (rc ) {
1692416930 if (BNXT_VF (bp ) && rc == - ENODEV ) {
@@ -16983,15 +16989,16 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
1698316989
1698416990 bnxt_dl_fw_reporters_create (bp );
1698516991
16986- bnxt_rdma_aux_device_add (bp );
16992+ bnxt_aux_devices_add (bp );
1698716993
1698816994 bnxt_print_device_info (bp );
1698916995
1699016996 pci_save_state (pdev );
1699116997
1699216998 return 0 ;
1699316999init_err_cleanup :
16994- bnxt_rdma_aux_device_uninit (bp );
17000+ bnxt_aux_devices_uninit (bp );
17001+ bnxt_auxdev_id_free (bp , bp -> auxdev_id );
1699517002 bnxt_dl_unregister (bp );
1699617003init_err_dl :
1699717004 bnxt_shutdown_tc (bp );
@@ -17125,9 +17132,10 @@ static int bnxt_resume(struct device *device)
1712517132
1712617133resume_exit :
1712717134 netdev_unlock (bp -> dev );
17128- bnxt_ulp_start ( bp , rc );
17129- if (! rc )
17135+ if (! rc ) {
17136+ bnxt_ulp_start ( bp );
1713017137 bnxt_reenable_sriov (bp );
17138+ }
1713117139 return rc ;
1713217140}
1713317141
@@ -17307,9 +17315,10 @@ static void bnxt_io_resume(struct pci_dev *pdev)
1730717315 netif_device_attach (netdev );
1730817316
1730917317 netdev_unlock (netdev );
17310- bnxt_ulp_start ( bp , err );
17311- if (! err )
17318+ if (! err ) {
17319+ bnxt_ulp_start ( bp );
1731217320 bnxt_reenable_sriov (bp );
17321+ }
1731317322}
1731417323
1731517324static const struct pci_error_handlers bnxt_err_handler = {
0 commit comments