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,
1531
1531
struct wx_ring * ring )
1532
1532
{
1533
1533
u16 reg_idx = ring -> reg_idx ;
1534
- union wx_rx_desc * rx_desc ;
1535
1534
u64 rdba = ring -> dma ;
1536
1535
u32 rxdctl ;
1537
1536
@@ -1561,9 +1560,9 @@ static void wx_configure_rx_ring(struct wx *wx,
1561
1560
memset (ring -> rx_buffer_info , 0 ,
1562
1561
sizeof (struct wx_rx_buffer ) * ring -> count );
1563
1562
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 ;
1567
1566
1568
1567
/* enable receive descriptor ring */
1569
1568
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)
355
355
356
356
/* clear the status bits for the next_to_use descriptor */
357
357
rx_desc -> wb .upper .status_error = 0 ;
358
+ /* clear the length for the next_to_use descriptor */
359
+ rx_desc -> wb .upper .length = 0 ;
358
360
359
361
cleaned_count -- ;
360
362
} while (cleaned_count );
@@ -2234,6 +2236,9 @@ static void wx_clean_rx_ring(struct wx_ring *rx_ring)
2234
2236
}
2235
2237
}
2236
2238
2239
+ /* Zero out the descriptor ring */
2240
+ memset (rx_ring -> desc , 0 , rx_ring -> size );
2241
+
2237
2242
rx_ring -> next_to_alloc = 0 ;
2238
2243
rx_ring -> next_to_clean = 0 ;
2239
2244
rx_ring -> next_to_use = 0 ;
You can’t perform that action at this time.
0 commit comments