@@ -1561,7 +1561,7 @@ static int ena_clean_rx_irq(struct ena_ring *rx_ring, struct napi_struct *napi,
15611561
15621562#ifdef ENA_XDP_SUPPORT
15631563 if (xdp_flags & ENA_XDP_REDIRECT )
1564- xdp_do_flush_map ();
1564+ xdp_do_flush ();
15651565 if (xdp_flags & ENA_XDP_TX )
15661566 ena_ring_tx_doorbell (rx_ring -> xdp_ring );
15671567#endif
@@ -3462,15 +3462,21 @@ static int ena_calc_io_queue_size(struct ena_adapter *adapter,
34623462{
34633463 struct ena_admin_feature_llq_desc * llq = & get_feat_ctx -> llq ;
34643464 struct ena_com_dev * ena_dev = adapter -> ena_dev ;
3465- u32 tx_queue_size = ENA_DEFAULT_RING_SIZE ;
34663465 u32 max_tx_queue_size ;
34673466 u32 max_rx_queue_size ;
3467+ u32 tx_queue_size ;
34683468
34693469 /* If this function is called after driver load, the ring sizes have already
34703470 * been configured. Take it into account when recalculating ring size.
34713471 */
3472- if (adapter -> tx_ring -> ring_size )
3472+ if (adapter -> tx_ring -> ring_size ) {
34733473 tx_queue_size = adapter -> tx_ring -> ring_size ;
3474+ } else if (adapter -> llq_policy == ENA_LLQ_HEADER_SIZE_POLICY_LARGE &&
3475+ ena_dev -> tx_mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_DEV ) {
3476+ tx_queue_size = ENA_DEFAULT_WIDE_LLQ_RING_SIZE ;
3477+ } else {
3478+ tx_queue_size = ENA_DEFAULT_RING_SIZE ;
3479+ }
34743480
34753481 if (adapter -> rx_ring -> ring_size )
34763482 rx_queue_size = adapter -> rx_ring -> ring_size ;
@@ -3513,6 +3519,33 @@ static int ena_calc_io_queue_size(struct ena_adapter *adapter,
35133519 max_queues -> max_packet_rx_descs );
35143520 }
35153521
3522+ if (adapter -> llq_policy == ENA_LLQ_HEADER_SIZE_POLICY_LARGE ) {
3523+ if (ena_dev -> tx_mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_DEV ) {
3524+ u32 max_wide_llq_size = max_tx_queue_size ;
3525+
3526+ if (llq -> max_wide_llq_depth == 0 ) {
3527+ /* if there is no large llq max depth from device, we divide
3528+ * the queue size by 2, leaving the amount of memory
3529+ * used by the queues unchanged.
3530+ */
3531+ max_wide_llq_size /= 2 ;
3532+ } else if (llq -> max_wide_llq_depth < max_wide_llq_size ) {
3533+ max_wide_llq_size = llq -> max_wide_llq_depth ;
3534+ }
3535+ if (max_wide_llq_size != max_tx_queue_size ) {
3536+ max_tx_queue_size = max_wide_llq_size ;
3537+ dev_info (& adapter -> pdev -> dev ,
3538+ "Forcing large headers and decreasing maximum TX queue size to %d\n" ,
3539+ max_tx_queue_size );
3540+ }
3541+ } else {
3542+ dev_err (& adapter -> pdev -> dev ,
3543+ "Forcing large headers failed: LLQ is disabled or device does not support large headers\n" );
3544+
3545+ adapter -> llq_policy = ENA_LLQ_HEADER_SIZE_POLICY_NORMAL ;
3546+ }
3547+ }
3548+
35163549 max_tx_queue_size = rounddown_pow_of_two (max_tx_queue_size );
35173550 max_rx_queue_size = rounddown_pow_of_two (max_rx_queue_size );
35183551
@@ -3528,23 +3561,6 @@ static int ena_calc_io_queue_size(struct ena_adapter *adapter,
35283561 return - EFAULT ;
35293562 }
35303563
3531- /* When forcing large headers, we multiply the entry size by 2, and therefore divide
3532- * the queue size by 2, leaving the amount of memory used by the queues unchanged.
3533- */
3534- if (adapter -> llq_policy == ENA_LLQ_HEADER_SIZE_POLICY_LARGE ) {
3535- if (ena_dev -> tx_mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_DEV ) {
3536- max_tx_queue_size /= 2 ;
3537- dev_info (& adapter -> pdev -> dev ,
3538- "Forcing large headers and decreasing maximum TX queue size to %d\n" ,
3539- max_tx_queue_size );
3540- } else {
3541- dev_err (& adapter -> pdev -> dev ,
3542- "Forcing large headers failed: LLQ is disabled or device does not support large headers\n" );
3543-
3544- adapter -> llq_policy = ENA_LLQ_HEADER_SIZE_POLICY_NORMAL ;
3545- }
3546- }
3547-
35483564 tx_queue_size = clamp_val (tx_queue_size , ENA_MIN_RING_SIZE ,
35493565 max_tx_queue_size );
35503566 rx_queue_size = clamp_val (rx_queue_size , ENA_MIN_RING_SIZE ,
@@ -3808,6 +3824,11 @@ static int ena_device_init(struct ena_adapter *adapter, struct pci_dev *pdev,
38083824 if (unlikely (rc ))
38093825 goto err_admin_init ;
38103826
3827+ if (ena_dev -> tx_mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_DEV )
3828+ dev_info (& pdev -> dev , "ENA Large LLQ is %s\n" ,
3829+ adapter -> llq_policy == ENA_LLQ_HEADER_SIZE_POLICY_LARGE ?
3830+ "enabled" : "disabled" );
3831+
38113832 /* Turned on features shouldn't change due to reset. */
38123833 prev_netdev_features = adapter -> netdev -> features ;
38133834 ena_set_dev_offloads (get_feat_ctx , adapter -> netdev );
@@ -4070,11 +4091,11 @@ static int check_missing_comp_in_tx_queue(struct ena_adapter *adapter, struct en
40704091 struct net_device * netdev = adapter -> netdev ;
40714092 unsigned long jiffies_since_last_napi ;
40724093 unsigned long jiffies_since_last_intr ;
4094+ u32 missed_tx = 0 , new_missed_tx = 0 ;
40734095 unsigned long graceful_timeout ;
40744096 struct ena_tx_buffer * tx_buf ;
40754097 unsigned long timeout ;
40764098 int napi_scheduled ;
4077- u32 missed_tx = 0 ;
40784099 bool is_expired ;
40794100 int i , rc = 0 ;
40804101
@@ -4117,20 +4138,24 @@ static int check_missing_comp_in_tx_queue(struct ena_adapter *adapter, struct en
41174138 reset_reason = ENA_REGS_RESET_SUSPECTED_POLL_STARVATION ;
41184139 }
41194140
4141+ missed_tx ++ ;
4142+
41204143 if (tx_buf -> print_once )
41214144 continue ;
41224145
4146+ /* Add new TX completions which are missed */
4147+ new_missed_tx ++ ;
4148+
41234149 netif_notice (adapter , tx_err , netdev ,
41244150 "TX hasn't completed, qid %d, index %d. %u msecs since last interrupt, %u msecs since last napi execution, napi scheduled: %d\n" ,
41254151 tx_ring -> qid , i , jiffies_to_msecs (jiffies_since_last_intr ),
41264152 jiffies_to_msecs (jiffies_since_last_napi ), napi_scheduled );
41274153
4128- missed_tx ++ ;
41294154 tx_buf -> print_once = 1 ;
41304155 }
41314156 }
41324157
4133- /* Checking if this TX ring got to max missing TX completes */
4158+ /* Checking if this TX ring missing TX completions have passed the threshold */
41344159 if (unlikely (missed_tx > missed_tx_thresh )) {
41354160 jiffies_since_last_intr = jiffies - READ_ONCE (ena_napi -> last_intr_jiffies );
41364161 jiffies_since_last_napi = jiffies - READ_ONCE (tx_ring -> tx_stats .last_napi_jiffies );
@@ -4156,7 +4181,8 @@ static int check_missing_comp_in_tx_queue(struct ena_adapter *adapter, struct en
41564181 rc = - EIO ;
41574182 }
41584183
4159- ena_increase_stat (& tx_ring -> tx_stats .missed_tx , missed_tx , & tx_ring -> syncp );
4184+ /* Add the newly discovered missing TX completions */
4185+ ena_increase_stat (& tx_ring -> tx_stats .missed_tx , new_missed_tx , & tx_ring -> syncp );
41604186
41614187 return rc ;
41624188}
@@ -4288,7 +4314,12 @@ static void check_for_admin_com_state(struct ena_adapter *adapter)
42884314 if (unlikely (!ena_com_get_admin_running_state (adapter -> ena_dev ))) {
42894315 netif_err (adapter , drv , adapter -> netdev ,
42904316 "ENA admin queue is not in running state!\n" );
4291- ena_reset_device (adapter , ENA_REGS_RESET_ADMIN_TO );
4317+ ena_increase_stat (& adapter -> dev_stats .admin_q_pause , 1 ,
4318+ & adapter -> syncp );
4319+ if (ena_com_get_missing_admin_interrupt (adapter -> ena_dev ))
4320+ ena_reset_device (adapter , ENA_REGS_RESET_MISSING_ADMIN_INTERRUPT );
4321+ else
4322+ ena_reset_device (adapter , ENA_REGS_RESET_ADMIN_TO );
42924323 }
42934324}
42944325
0 commit comments