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 @@ -1348,7 +1348,6 @@ static void wx_configure_rx_ring(struct wx *wx,
1348
1348
struct wx_ring * ring )
1349
1349
{
1350
1350
u16 reg_idx = ring -> reg_idx ;
1351
- union wx_rx_desc * rx_desc ;
1352
1351
u64 rdba = ring -> dma ;
1353
1352
u32 rxdctl ;
1354
1353
@@ -1378,9 +1377,9 @@ static void wx_configure_rx_ring(struct wx *wx,
1378
1377
memset (ring -> rx_buffer_info , 0 ,
1379
1378
sizeof (struct wx_rx_buffer ) * ring -> count );
1380
1379
1381
- /* initialize Rx descriptor 0 */
1382
- rx_desc = WX_RX_DESC ( ring , 0 ) ;
1383
- rx_desc -> wb . upper . length = 0 ;
1380
+ /* reset ntu and ntc to place SW in sync with hardware */
1381
+ ring -> next_to_clean = 0 ;
1382
+ ring -> next_to_use = 0 ;
1384
1383
1385
1384
/* enable receive descriptor ring */
1386
1385
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 );
@@ -2173,6 +2175,9 @@ static void wx_clean_rx_ring(struct wx_ring *rx_ring)
2173
2175
}
2174
2176
}
2175
2177
2178
+ /* Zero out the descriptor ring */
2179
+ memset (rx_ring -> desc , 0 , rx_ring -> size );
2180
+
2176
2181
rx_ring -> next_to_alloc = 0 ;
2177
2182
rx_ring -> next_to_clean = 0 ;
2178
2183
rx_ring -> next_to_use = 0 ;
You can’t perform that action at this time.
0 commit comments