Skip to content

Commit 3c47e8a

Browse files
Jiawen Wudavem330
authored andcommitted
net: libwx: Support to receive packets in NAPI
Clean all queues associated with a q_vector, to simple receive packets without hardware features. Signed-off-by: Jiawen Wu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 0ef7e15 commit 3c47e8a

File tree

4 files changed

+706
-1
lines changed

4 files changed

+706
-1
lines changed

drivers/net/ethernet/wangxun/libwx/wx_hw.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <linux/pci.h>
99

1010
#include "wx_type.h"
11+
#include "wx_lib.h"
1112
#include "wx_hw.h"
1213

1314
static void wx_intr_disable(struct wx *wx, u64 qmask)
@@ -1368,6 +1369,7 @@ static void wx_configure_rx_ring(struct wx *wx,
13681369
struct wx_ring *ring)
13691370
{
13701371
u16 reg_idx = ring->reg_idx;
1372+
union wx_rx_desc *rx_desc;
13711373
u64 rdba = ring->dma;
13721374
u32 rxdctl;
13731375

@@ -1393,11 +1395,20 @@ static void wx_configure_rx_ring(struct wx *wx,
13931395

13941396
wx_configure_srrctl(wx, ring);
13951397

1398+
/* initialize rx_buffer_info */
1399+
memset(ring->rx_buffer_info, 0,
1400+
sizeof(struct wx_rx_buffer) * ring->count);
1401+
1402+
/* initialize Rx descriptor 0 */
1403+
rx_desc = WX_RX_DESC(ring, 0);
1404+
rx_desc->wb.upper.length = 0;
1405+
13961406
/* enable receive descriptor ring */
13971407
wr32m(wx, WX_PX_RR_CFG(reg_idx),
13981408
WX_PX_RR_CFG_RR_EN, WX_PX_RR_CFG_RR_EN);
13991409

14001410
wx_enable_rx_queue(wx, ring);
1411+
wx_alloc_rx_buffers(ring, wx_desc_unused(ring));
14011412
}
14021413

14031414
/**

0 commit comments

Comments
 (0)