Skip to content

Commit 7ab523c

Browse files
tianx666NipaLocal
authored andcommitted
xsc: Add eth reception data path
rx data path: 1. The hardware writes incoming packets into the RQ ring buffer and generates a event queue entry 2. The event handler function(xsc_eth_completion_event in xsc_eth_events.c) is triggered, invokes napi_schedule() to schedule a softirq. 3. The kernel triggers the softirq handler net_rx_action, which calls the driver's NAPI poll function (xsc_eth_napi_poll in xsc_eth_txrx.c). The driver retrieves CQEs from the Completion Queue (CQ) via xsc_poll_rx_cq. 4. xsc_eth_build_rx_skb constructs an sk_buff structure, and submits the SKB to the kernel network stack via napi_gro_receive 5. The driver recycles the RX buffer and notifies the NIC via xsc_eth_post_rx_wqes to prepare for new packets. Co-developed-by: Honggang Wei <weihg@yunsilicon.com> Signed-off-by: Honggang Wei <weihg@yunsilicon.com> Co-developed-by: Lei Yan <jacky@yunsilicon.com> Signed-off-by: Lei Yan <jacky@yunsilicon.com> Signed-off-by: Xin Tian <tianx@yunsilicon.com> Signed-off-by: NipaLocal <nipa@local>
1 parent 94d79f7 commit 7ab523c

File tree

5 files changed

+547
-23
lines changed

5 files changed

+547
-23
lines changed

drivers/net/ethernet/yunsilicon/xsc/net/xsc_eth_common.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
#define XSC_SW2HW_RX_PKT_LEN(mtu) \
2323
((mtu) + ETH_HLEN + XSC_ETH_RX_MAX_HEAD_ROOM)
2424

25+
#define XSC_RX_MAX_HEAD (256)
26+
2527
#define XSC_QPN_SQN_STUB 1025
2628
#define XSC_QPN_RQN_STUB 1024
2729

@@ -186,4 +188,12 @@ union xsc_send_doorbell {
186188
u32 send_data;
187189
};
188190

191+
union xsc_recv_doorbell {
192+
struct{
193+
s32 next_pid : 13;
194+
u32 qp_num : 15;
195+
};
196+
u32 recv_data;
197+
};
198+
189199
#endif

0 commit comments

Comments
 (0)