Skip to content

Commit 50bad6f

Browse files
Gerhard EnglederPaolo Abeni
authored andcommitted
tsnep: Remove FCS for XDP data path
The RX data buffer includes the FCS. The FCS is already stripped for the normal data path. But for the XDP data path the FCS is included and acts like additional/useless data. Remove the FCS from the RX data buffer also for XDP. Fixes: 65b28c8 ("tsnep: Add XDP RX support") Fixes: 3fc2333 ("tsnep: Add XDP socket zero-copy RX support") Signed-off-by: Gerhard Engleder <gerhard@engleder-embedded.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
1 parent 5da4597 commit 50bad6f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/ethernet/engleder/tsnep_main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1485,7 +1485,7 @@ static int tsnep_rx_poll(struct tsnep_rx *rx, struct napi_struct *napi,
14851485

14861486
xdp_prepare_buff(&xdp, page_address(entry->page),
14871487
XDP_PACKET_HEADROOM + TSNEP_RX_INLINE_METADATA_SIZE,
1488-
length, false);
1488+
length - ETH_FCS_LEN, false);
14891489

14901490
consume = tsnep_xdp_run_prog(rx, prog, &xdp,
14911491
&xdp_status, tx_nq, tx);
@@ -1568,7 +1568,7 @@ static int tsnep_rx_poll_zc(struct tsnep_rx *rx, struct napi_struct *napi,
15681568
prefetch(entry->xdp->data);
15691569
length = __le32_to_cpu(entry->desc_wb->properties) &
15701570
TSNEP_DESC_LENGTH_MASK;
1571-
xsk_buff_set_size(entry->xdp, length);
1571+
xsk_buff_set_size(entry->xdp, length - ETH_FCS_LEN);
15721572
xsk_buff_dma_sync_for_cpu(entry->xdp, rx->xsk_pool);
15731573

15741574
/* RX metadata with timestamps is in front of actual data,

0 commit comments

Comments
 (0)