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 @@ -1912,7 +1912,6 @@ static void wx_configure_rx_ring(struct wx *wx,
1912
1912
struct wx_ring * ring )
1913
1913
{
1914
1914
u16 reg_idx = ring -> reg_idx ;
1915
- union wx_rx_desc * rx_desc ;
1916
1915
u64 rdba = ring -> dma ;
1917
1916
u32 rxdctl ;
1918
1917
@@ -1942,9 +1941,9 @@ static void wx_configure_rx_ring(struct wx *wx,
1942
1941
memset (ring -> rx_buffer_info , 0 ,
1943
1942
sizeof (struct wx_rx_buffer ) * ring -> count );
1944
1943
1945
- /* initialize Rx descriptor 0 */
1946
- rx_desc = WX_RX_DESC ( ring , 0 ) ;
1947
- rx_desc -> wb . upper . length = 0 ;
1944
+ /* reset ntu and ntc to place SW in sync with hardware */
1945
+ ring -> next_to_clean = 0 ;
1946
+ ring -> next_to_use = 0 ;
1948
1947
1949
1948
/* enable receive descriptor ring */
1950
1949
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 );
@@ -2438,6 +2440,9 @@ static void wx_clean_rx_ring(struct wx_ring *rx_ring)
2438
2440
}
2439
2441
}
2440
2442
2443
+ /* Zero out the descriptor ring */
2444
+ memset (rx_ring -> desc , 0 , rx_ring -> size );
2445
+
2441
2446
rx_ring -> next_to_alloc = 0 ;
2442
2447
rx_ring -> next_to_clean = 0 ;
2443
2448
rx_ring -> next_to_use = 0 ;
You can’t perform that action at this time.
0 commit comments