@@ -1485,7 +1485,7 @@ static int tsnep_rx_poll(struct tsnep_rx *rx, struct napi_struct *napi,
1485
1485
1486
1486
xdp_prepare_buff (& xdp , page_address (entry -> page ),
1487
1487
XDP_PACKET_HEADROOM + TSNEP_RX_INLINE_METADATA_SIZE ,
1488
- length , false);
1488
+ length - ETH_FCS_LEN , false);
1489
1489
1490
1490
consume = tsnep_xdp_run_prog (rx , prog , & xdp ,
1491
1491
& xdp_status , tx_nq , tx );
@@ -1568,7 +1568,7 @@ static int tsnep_rx_poll_zc(struct tsnep_rx *rx, struct napi_struct *napi,
1568
1568
prefetch (entry -> xdp -> data );
1569
1569
length = __le32_to_cpu (entry -> desc_wb -> properties ) &
1570
1570
TSNEP_DESC_LENGTH_MASK ;
1571
- xsk_buff_set_size (entry -> xdp , length );
1571
+ xsk_buff_set_size (entry -> xdp , length - ETH_FCS_LEN );
1572
1572
xsk_buff_dma_sync_for_cpu (entry -> xdp , rx -> xsk_pool );
1573
1573
1574
1574
/* RX metadata with timestamps is in front of actual data,
@@ -1762,6 +1762,19 @@ static void tsnep_rx_reopen_xsk(struct tsnep_rx *rx)
1762
1762
allocated -- ;
1763
1763
}
1764
1764
}
1765
+
1766
+ /* set need wakeup flag immediately if ring is not filled completely,
1767
+ * first polling would be too late as need wakeup signalisation would
1768
+ * be delayed for an indefinite time
1769
+ */
1770
+ if (xsk_uses_need_wakeup (rx -> xsk_pool )) {
1771
+ int desc_available = tsnep_rx_desc_available (rx );
1772
+
1773
+ if (desc_available )
1774
+ xsk_set_rx_need_wakeup (rx -> xsk_pool );
1775
+ else
1776
+ xsk_clear_rx_need_wakeup (rx -> xsk_pool );
1777
+ }
1765
1778
}
1766
1779
1767
1780
static bool tsnep_pending (struct tsnep_queue * queue )
0 commit comments