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 @@ -1531,7 +1531,6 @@ static void wx_configure_rx_ring(struct wx *wx,
15311531 struct wx_ring * ring )
15321532{
15331533 u16 reg_idx = ring -> reg_idx ;
1534- union wx_rx_desc * rx_desc ;
15351534 u64 rdba = ring -> dma ;
15361535 u32 rxdctl ;
15371536
@@ -1561,9 +1560,9 @@ static void wx_configure_rx_ring(struct wx *wx,
15611560 memset (ring -> rx_buffer_info , 0 ,
15621561 sizeof (struct wx_rx_buffer ) * ring -> count );
15631562
1564- /* initialize Rx descriptor 0 */
1565- rx_desc = WX_RX_DESC ( ring , 0 ) ;
1566- rx_desc -> wb . upper . length = 0 ;
1563+ /* reset ntu and ntc to place SW in sync with hardware */
1564+ ring -> next_to_clean = 0 ;
1565+ ring -> next_to_use = 0 ;
15671566
15681567 /* enable receive descriptor ring */
15691568 wr32m (wx , WX_PX_RR_CFG (reg_idx ),
Original file line number Diff line number Diff line change @@ -355,6 +355,8 @@ void wx_alloc_rx_buffers(struct wx_ring *rx_ring, u16 cleaned_count)
355355
356356 /* clear the status bits for the next_to_use descriptor */
357357 rx_desc -> wb .upper .status_error = 0 ;
358+ /* clear the length for the next_to_use descriptor */
359+ rx_desc -> wb .upper .length = 0 ;
358360
359361 cleaned_count -- ;
360362 } while (cleaned_count );
@@ -2234,6 +2236,9 @@ static void wx_clean_rx_ring(struct wx_ring *rx_ring)
22342236 }
22352237 }
22362238
2239+ /* Zero out the descriptor ring */
2240+ memset (rx_ring -> desc , 0 , rx_ring -> size );
2241+
22372242 rx_ring -> next_to_alloc = 0 ;
22382243 rx_ring -> next_to_clean = 0 ;
22392244 rx_ring -> next_to_use = 0 ;
You can’t perform that action at this time.
0 commit comments