@@ -55,10 +55,13 @@ int epfd_info::remove_fd_from_epoll_os(int fd)
5555
5656epfd_info::epfd_info (int epfd, int size) :
5757 lock_mutex_recursive(" epfd_info" ), m_epfd(epfd), m_size(size), m_ring_map_lock(" epfd_ring_map_lock" ),
58- m_lock_poll_os(" epfd_lock_poll_os" ), m_sysvar_thread_mode(safe_mce_sys().thread_mode),
59- m_b_os_data_available(false )
58+ m_lock_poll_os(" epfd_lock_poll_os" ),
59+ m_b_os_data_available(false ),
60+ m_sysvar_thread_mode(safe_mce_sys().thread_mode),
61+ m_sysvar_internal_thread_arm_cq(safe_mce_sys().internal_thread_arm_cq)
6062{
6163 __log_funcall (" " );
64+
6265 int max_sys_fd = get_sys_max_fd_num ();
6366 if (m_size<=max_sys_fd)
6467 {
@@ -609,30 +612,34 @@ int epfd_info::ring_poll_and_process_element(uint64_t *p_poll_sn, void* pv_fd_re
609612 m_ring_map_lock.lock ();
610613
611614 for (ring_map_t ::iterator iter = m_ring_map.begin (); iter != m_ring_map.end (); iter++) {
612- int ret = iter->first ->poll_and_process_element_rx (p_poll_sn, pv_fd_ready_array);
613- BULLSEYE_EXCLUDE_BLOCK_START
614- if (ret < 0 && errno != EAGAIN) {
615- __log_err (" Error in RX ring->poll_and_process_element() of %p (errno=%d %m)" , iter->first , errno);
616- m_ring_map_lock.unlock ();
617- return ret;
618- }
619- BULLSEYE_EXCLUDE_BLOCK_END
620- if (ret > 0 ) {
621- __log_func (" ring[%p] RX Returned with: %d (sn=%d)" , iter->first , ret, *p_poll_sn);
622- ret_total += ret;
615+ if (m_sysvar_internal_thread_arm_cq & mce_sys_var::ARM_CQ_RX) {
616+ int ret = iter->first ->poll_and_process_element_rx (p_poll_sn, pv_fd_ready_array);
617+ BULLSEYE_EXCLUDE_BLOCK_START
618+ if (ret < 0 && errno != EAGAIN) {
619+ __log_err (" Error in RX ring->poll_and_process_element() of %p (errno=%d %m)" , iter->first , errno);
620+ m_ring_map_lock.unlock ();
621+ return ret;
622+ }
623+ BULLSEYE_EXCLUDE_BLOCK_END
624+ if (ret > 0 ) {
625+ __log_func (" ring[%p] RX Returned with: %d (sn=%d)" , iter->first , ret, *p_poll_sn);
626+ ret_total += ret;
627+ }
623628 }
624629
625- ret = iter->first ->poll_and_process_element_tx (p_poll_sn);
626- BULLSEYE_EXCLUDE_BLOCK_START
627- if (ret < 0 && errno != EAGAIN) {
628- __log_err (" Error in TX ring->poll_and_process_element() of %p (errno=%d %m)" , iter->first , errno);
629- m_ring_map_lock.unlock ();
630- return ret;
631- }
632- BULLSEYE_EXCLUDE_BLOCK_END
633- if (ret > 0 ) {
634- __log_func (" ring[%p] TX Returned with: %d (sn=%d)" , iter->first , ret, *p_poll_sn);
635- ret_total += ret;
630+ if (m_sysvar_internal_thread_arm_cq & mce_sys_var::ARM_CQ_TX) {
631+ int ret = iter->first ->poll_and_process_element_tx (p_poll_sn);
632+ BULLSEYE_EXCLUDE_BLOCK_START
633+ if (ret < 0 && errno != EAGAIN) {
634+ __log_err (" Error in TX ring->poll_and_process_element() of %p (errno=%d %m)" , iter->first , errno);
635+ m_ring_map_lock.unlock ();
636+ return ret;
637+ }
638+ BULLSEYE_EXCLUDE_BLOCK_END
639+ if (ret > 0 ) {
640+ __log_func (" ring[%p] TX Returned with: %d (sn=%d)" , iter->first , ret, *p_poll_sn);
641+ ret_total += ret;
642+ }
636643 }
637644 }
638645
@@ -660,27 +667,31 @@ int epfd_info::ring_request_notification(uint64_t poll_sn)
660667 m_ring_map_lock.lock ();
661668
662669 for (ring_map_t ::iterator iter = m_ring_map.begin (); iter != m_ring_map.end (); iter++) {
663- int ret = iter->first ->request_notification (CQT_RX, poll_sn);
664- BULLSEYE_EXCLUDE_BLOCK_START
665- if (ret < 0 ) {
666- __log_err (" Error RX ring[%p]->request_notification() (errno=%d %m)" , iter->first , errno);
667- m_ring_map_lock.unlock ();
668- return ret;
670+ if (m_sysvar_internal_thread_arm_cq & mce_sys_var::ARM_CQ_RX) {
671+ int ret = iter->first ->request_notification (CQT_RX, poll_sn);
672+ BULLSEYE_EXCLUDE_BLOCK_START
673+ if (ret < 0 ) {
674+ __log_err (" Error RX ring[%p]->request_notification() (errno=%d %m)" , iter->first , errno);
675+ m_ring_map_lock.unlock ();
676+ return ret;
677+ }
678+ BULLSEYE_EXCLUDE_BLOCK_END
679+ __log_func (" ring[%p] RX Returned with: %d (sn=%d)" , iter->first , ret, poll_sn);
680+ ret_total += ret;
669681 }
670- BULLSEYE_EXCLUDE_BLOCK_END
671- __log_func (" ring[%p] RX Returned with: %d (sn=%d)" , iter->first , ret, poll_sn);
672- ret_total += ret;
673682
674- ret = iter->first ->request_notification (CQT_TX, poll_sn);
675- BULLSEYE_EXCLUDE_BLOCK_START
676- if (ret < 0 ) {
677- __log_err (" Error TX ring[%p]->request_notification() (errno=%d %m)" , iter->first , errno);
678- m_ring_map_lock.unlock ();
679- return ret;
683+ if (m_sysvar_internal_thread_arm_cq & mce_sys_var::ARM_CQ_TX) {
684+ int ret = iter->first ->request_notification (CQT_TX, poll_sn);
685+ BULLSEYE_EXCLUDE_BLOCK_START
686+ if (ret < 0 ) {
687+ __log_err (" Error TX ring[%p]->request_notification() (errno=%d %m)" , iter->first , errno);
688+ m_ring_map_lock.unlock ();
689+ return ret;
690+ }
691+ BULLSEYE_EXCLUDE_BLOCK_END
692+ __log_func (" ring[%p] TX Returned with: %d (sn=%d)" , iter->first , ret, poll_sn);
693+ ret_total += ret;
680694 }
681- BULLSEYE_EXCLUDE_BLOCK_END
682- __log_func (" ring[%p] TX Returned with: %d (sn=%d)" , iter->first , ret, poll_sn);
683- ret_total += ret;
684695 }
685696
686697 m_ring_map_lock.unlock ();
0 commit comments