@@ -37,11 +37,14 @@ nix_inl_dev_pffunc_get(void)
3737}
3838
3939static void
40- nix_inl_selftest_work_cb (uint64_t * gw , void * args , uint32_t soft_exp_event )
40+ nix_inl_selftest_work_cb (uint64_t * gw , void * args , enum nix_inl_event_type type , void * cq_s ,
41+ uint32_t port_id )
4142{
4243 uintptr_t work = gw [1 ];
4344
44- (void )soft_exp_event ;
45+ (void )type ;
46+ (void )cq_s ;
47+ (void )port_id ;
4548 * ((uintptr_t * )args + (gw [0 ] & 0x1 )) = work ;
4649
4750 plt_atomic_thread_fence (__ATOMIC_ACQ_REL );
@@ -476,8 +479,10 @@ nix_inl_cpt_setup(struct nix_inl_dev *inl_dev, bool inl_dev_sso)
476479
477480 return 0 ;
478481lf_fini :
479- for (i = 0 ; i < inl_dev -> nb_cptlf ; i ++ )
480- cpt_lf_fini (& inl_dev -> cpt_lf [i ], false);
482+ for (i = 0 ; i < inl_dev -> nb_cptlf ; i ++ ) {
483+ struct roc_cpt_lf * lf = & inl_dev -> cpt_lf [i ];
484+ cpt_lf_fini (lf , lf -> cpt_cq_ena );
485+ }
481486lf_free :
482487 rc |= cpt_lfs_free (dev );
483488 return rc ;
@@ -500,9 +505,12 @@ nix_inl_cpt_release(struct nix_inl_dev *inl_dev)
500505 /* TODO: Wait for CPT/RXC queue to drain */
501506
502507 /* Cleanup CPT LF queue */
503- for (i = 0 ; i < inl_dev -> nb_cptlf ; i ++ )
504- cpt_lf_fini (& inl_dev -> cpt_lf [i ], false);
505-
508+ for (i = 0 ; i < inl_dev -> nb_cptlf ; i ++ ) {
509+ struct roc_cpt_lf * lf = & inl_dev -> cpt_lf [i ];
510+ cpt_lf_fini (lf , lf -> cpt_cq_ena );
511+ if (lf -> cpt_cq_ena )
512+ cpt_lf_unregister_irqs (lf , cpt_lf_misc_irq , nix_inl_cpt_done_irq );
513+ }
506514 /* Free LF resources */
507515 rc = cpt_lfs_free (dev );
508516 if (!rc ) {
@@ -1162,7 +1170,7 @@ inl_outb_soft_exp_poll(struct nix_inl_dev *inl_dev, uint32_t ring_idx)
11621170
11631171 if (sa != NULL ) {
11641172 uint64_t tmp = ~(uint32_t )0x0 ;
1165- inl_dev -> work_cb (& tmp , sa , ( port_id << 8 ) | 0x1 );
1173+ inl_dev -> work_cb (& tmp , sa , NIX_INL_SOFT_EXPIRY_THRD , NULL , port_id );
11661174 __atomic_store_n (ring_base + tail_l + 1 , 0ULL ,
11671175 __ATOMIC_RELAXED );
11681176 __atomic_fetch_add ((uint32_t * )ring_base , 1 ,
@@ -1381,6 +1389,7 @@ roc_nix_inl_dev_init(struct roc_nix_inl_dev *roc_inl_dev)
13811389 inl_dev -> nb_meta_bufs = roc_inl_dev -> nb_meta_bufs ;
13821390 inl_dev -> meta_buf_sz = roc_inl_dev -> meta_buf_sz ;
13831391 inl_dev -> soft_exp_poll_freq = roc_inl_dev -> soft_exp_poll_freq ;
1392+ inl_dev -> cpt_cq_ena = roc_inl_dev -> cpt_cq_enable ;
13841393 inl_dev -> custom_inb_sa = roc_inl_dev -> custom_inb_sa ;
13851394 inl_dev -> nix_inb_q_bpid = -1 ;
13861395 inl_dev -> nb_cptlf = 1 ;
@@ -1401,6 +1410,10 @@ roc_nix_inl_dev_init(struct roc_nix_inl_dev *roc_inl_dev)
14011410 inl_dev -> nb_cptlf ++ ;
14021411 }
14031412
1413+ if (roc_feature_nix_has_cpt_cq_support () && inl_dev -> cpt_cq_ena ) {
1414+ inl_dev -> soft_exp_poll_freq = 0 ;
1415+ inl_dev -> set_soft_exp_poll = 0 ;
1416+ }
14041417 /* Attach inline inbound CPT LF to NIX has multi queue support */
14051418 if (roc_feature_nix_has_inl_multi_queue () && roc_inl_dev -> nb_inb_cptlfs ) {
14061419 inl_dev -> nb_inb_cptlfs = roc_inl_dev -> nb_inb_cptlfs ;
0 commit comments