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,
13481348 struct wx_ring * ring )
13491349{
13501350 u16 reg_idx = ring -> reg_idx ;
1351- union wx_rx_desc * rx_desc ;
13521351 u64 rdba = ring -> dma ;
13531352 u32 rxdctl ;
13541353
@@ -1378,9 +1377,9 @@ static void wx_configure_rx_ring(struct wx *wx,
13781377 memset (ring -> rx_buffer_info , 0 ,
13791378 sizeof (struct wx_rx_buffer ) * ring -> count );
13801379
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 ;
13841383
13851384 /* enable receive descriptor ring */
13861385 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)
357357
358358 /* clear the status bits for the next_to_use descriptor */
359359 rx_desc -> wb .upper .status_error = 0 ;
360+ /* clear the length for the next_to_use descriptor */
361+ rx_desc -> wb .upper .length = 0 ;
360362
361363 cleaned_count -- ;
362364 } while (cleaned_count );
@@ -2173,6 +2175,9 @@ static void wx_clean_rx_ring(struct wx_ring *rx_ring)
21732175 }
21742176 }
21752177
2178+ /* Zero out the descriptor ring */
2179+ memset (rx_ring -> desc , 0 , rx_ring -> size );
2180+
21762181 rx_ring -> next_to_alloc = 0 ;
21772182 rx_ring -> next_to_clean = 0 ;
21782183 rx_ring -> next_to_use = 0 ;
You can’t perform that action at this time.
0 commit comments