@@ -1018,13 +1018,9 @@ static int ena_refill_rx_bufs(struct ena_ring *rx_ring, u32 num)
1018
1018
struct ena_rx_buffer * rx_info ;
1019
1019
1020
1020
req_id = rx_ring -> free_ids [next_to_use ];
1021
- rc = validate_rx_req_id (rx_ring , req_id );
1022
- if (unlikely (rc < 0 ))
1023
- break ;
1024
1021
1025
1022
rx_info = & rx_ring -> rx_buffer_info [req_id ];
1026
1023
1027
-
1028
1024
rc = ena_alloc_rx_page (rx_ring , rx_info ,
1029
1025
GFP_ATOMIC | __GFP_COMP );
1030
1026
if (unlikely (rc < 0 )) {
@@ -1379,9 +1375,15 @@ static struct sk_buff *ena_rx_skb(struct ena_ring *rx_ring,
1379
1375
struct ena_rx_buffer * rx_info ;
1380
1376
u16 len , req_id , buf = 0 ;
1381
1377
void * va ;
1378
+ int rc ;
1382
1379
1383
1380
len = ena_bufs [buf ].len ;
1384
1381
req_id = ena_bufs [buf ].req_id ;
1382
+
1383
+ rc = validate_rx_req_id (rx_ring , req_id );
1384
+ if (unlikely (rc < 0 ))
1385
+ return NULL ;
1386
+
1385
1387
rx_info = & rx_ring -> rx_buffer_info [req_id ];
1386
1388
1387
1389
if (unlikely (!rx_info -> page )) {
@@ -1454,6 +1456,11 @@ static struct sk_buff *ena_rx_skb(struct ena_ring *rx_ring,
1454
1456
buf ++ ;
1455
1457
len = ena_bufs [buf ].len ;
1456
1458
req_id = ena_bufs [buf ].req_id ;
1459
+
1460
+ rc = validate_rx_req_id (rx_ring , req_id );
1461
+ if (unlikely (rc < 0 ))
1462
+ return NULL ;
1463
+
1457
1464
rx_info = & rx_ring -> rx_buffer_info [req_id ];
1458
1465
} while (1 );
1459
1466
@@ -1968,7 +1975,7 @@ static int ena_enable_msix(struct ena_adapter *adapter)
1968
1975
}
1969
1976
1970
1977
/* Reserved the max msix vectors we might need */
1971
- msix_vecs = ENA_MAX_MSIX_VEC (adapter -> num_io_queues );
1978
+ msix_vecs = ENA_MAX_MSIX_VEC (adapter -> max_num_io_queues );
1972
1979
netif_dbg (adapter , probe , adapter -> netdev ,
1973
1980
"trying to enable MSI-X, vectors %d\n" , msix_vecs );
1974
1981
@@ -2068,6 +2075,7 @@ static int ena_request_mgmnt_irq(struct ena_adapter *adapter)
2068
2075
2069
2076
static int ena_request_io_irq (struct ena_adapter * adapter )
2070
2077
{
2078
+ u32 io_queue_count = adapter -> num_io_queues + adapter -> xdp_num_queues ;
2071
2079
unsigned long flags = 0 ;
2072
2080
struct ena_irq * irq ;
2073
2081
int rc = 0 , i , k ;
@@ -2078,7 +2086,7 @@ static int ena_request_io_irq(struct ena_adapter *adapter)
2078
2086
return - EINVAL ;
2079
2087
}
2080
2088
2081
- for (i = ENA_IO_IRQ_FIRST_IDX ; i < adapter -> msix_vecs ; i ++ ) {
2089
+ for (i = ENA_IO_IRQ_FIRST_IDX ; i < ENA_MAX_MSIX_VEC ( io_queue_count ) ; i ++ ) {
2082
2090
irq = & adapter -> irq_tbl [i ];
2083
2091
rc = request_irq (irq -> vector , irq -> handler , flags , irq -> name ,
2084
2092
irq -> data );
@@ -2119,6 +2127,7 @@ static void ena_free_mgmnt_irq(struct ena_adapter *adapter)
2119
2127
2120
2128
static void ena_free_io_irq (struct ena_adapter * adapter )
2121
2129
{
2130
+ u32 io_queue_count = adapter -> num_io_queues + adapter -> xdp_num_queues ;
2122
2131
struct ena_irq * irq ;
2123
2132
int i ;
2124
2133
@@ -2129,7 +2138,7 @@ static void ena_free_io_irq(struct ena_adapter *adapter)
2129
2138
}
2130
2139
#endif /* CONFIG_RFS_ACCEL */
2131
2140
2132
- for (i = ENA_IO_IRQ_FIRST_IDX ; i < adapter -> msix_vecs ; i ++ ) {
2141
+ for (i = ENA_IO_IRQ_FIRST_IDX ; i < ENA_MAX_MSIX_VEC ( io_queue_count ) ; i ++ ) {
2133
2142
irq = & adapter -> irq_tbl [i ];
2134
2143
irq_set_affinity_hint (irq -> vector , NULL );
2135
2144
free_irq (irq -> vector , irq -> data );
@@ -2144,12 +2153,13 @@ static void ena_disable_msix(struct ena_adapter *adapter)
2144
2153
2145
2154
static void ena_disable_io_intr_sync (struct ena_adapter * adapter )
2146
2155
{
2156
+ u32 io_queue_count = adapter -> num_io_queues + adapter -> xdp_num_queues ;
2147
2157
int i ;
2148
2158
2149
2159
if (!netif_running (adapter -> netdev ))
2150
2160
return ;
2151
2161
2152
- for (i = ENA_IO_IRQ_FIRST_IDX ; i < adapter -> msix_vecs ; i ++ )
2162
+ for (i = ENA_IO_IRQ_FIRST_IDX ; i < ENA_MAX_MSIX_VEC ( io_queue_count ) ; i ++ )
2153
2163
synchronize_irq (adapter -> irq_tbl [i ].vector );
2154
2164
}
2155
2165
@@ -3476,6 +3486,7 @@ static int ena_restore_device(struct ena_adapter *adapter)
3476
3486
netif_carrier_on (adapter -> netdev );
3477
3487
3478
3488
mod_timer (& adapter -> timer_service , round_jiffies (jiffies + HZ ));
3489
+ adapter -> last_keep_alive_jiffies = jiffies ;
3479
3490
dev_err (& pdev -> dev ,
3480
3491
"Device reset completed successfully, Driver info: %s\n" ,
3481
3492
version );
0 commit comments