File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
drivers/net/ethernet/wangxun/libwx Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -1919,7 +1919,6 @@ static void wx_configure_rx_ring(struct wx *wx,
1919
1919
struct wx_ring * ring )
1920
1920
{
1921
1921
u16 reg_idx = ring -> reg_idx ;
1922
- union wx_rx_desc * rx_desc ;
1923
1922
u64 rdba = ring -> dma ;
1924
1923
u32 rxdctl ;
1925
1924
@@ -1949,9 +1948,9 @@ static void wx_configure_rx_ring(struct wx *wx,
1949
1948
memset (ring -> rx_buffer_info , 0 ,
1950
1949
sizeof (struct wx_rx_buffer ) * ring -> count );
1951
1950
1952
- /* initialize Rx descriptor 0 */
1953
- rx_desc = WX_RX_DESC ( ring , 0 ) ;
1954
- rx_desc -> wb . upper . length = 0 ;
1951
+ /* reset ntu and ntc to place SW in sync with hardware */
1952
+ ring -> next_to_clean = 0 ;
1953
+ ring -> next_to_use = 0 ;
1955
1954
1956
1955
/* enable receive descriptor ring */
1957
1956
wr32m (wx , WX_PX_RR_CFG (reg_idx ),
Original file line number Diff line number Diff line change @@ -357,6 +357,8 @@ void wx_alloc_rx_buffers(struct wx_ring *rx_ring, u16 cleaned_count)
357
357
358
358
/* clear the status bits for the next_to_use descriptor */
359
359
rx_desc -> wb .upper .status_error = 0 ;
360
+ /* clear the length for the next_to_use descriptor */
361
+ rx_desc -> wb .upper .length = 0 ;
360
362
361
363
cleaned_count -- ;
362
364
} while (cleaned_count );
@@ -2443,6 +2445,9 @@ static void wx_clean_rx_ring(struct wx_ring *rx_ring)
2443
2445
}
2444
2446
}
2445
2447
2448
+ /* Zero out the descriptor ring */
2449
+ memset (rx_ring -> desc , 0 , rx_ring -> size );
2450
+
2446
2451
rx_ring -> next_to_alloc = 0 ;
2447
2452
rx_ring -> next_to_clean = 0 ;
2448
2453
rx_ring -> next_to_use = 0 ;
You can’t perform that action at this time.
0 commit comments