Commit 50bad6f7 authored by Gerhard Engleder's avatar Gerhard Engleder Committed by Paolo Abeni

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: 65b28c81 ("tsnep: Add XDP RX support")
Fixes: 3fc23339 ("tsnep: Add XDP socket zero-copy RX support")
Signed-off-by: default avatarGerhard Engleder <gerhard@engleder-embedded.com>
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent 5da45971
...@@ -1485,7 +1485,7 @@ static int tsnep_rx_poll(struct tsnep_rx *rx, struct napi_struct *napi, ...@@ -1485,7 +1485,7 @@ static int tsnep_rx_poll(struct tsnep_rx *rx, struct napi_struct *napi,
xdp_prepare_buff(&xdp, page_address(entry->page), xdp_prepare_buff(&xdp, page_address(entry->page),
XDP_PACKET_HEADROOM + TSNEP_RX_INLINE_METADATA_SIZE, XDP_PACKET_HEADROOM + TSNEP_RX_INLINE_METADATA_SIZE,
length, false); length - ETH_FCS_LEN, false);
consume = tsnep_xdp_run_prog(rx, prog, &xdp, consume = tsnep_xdp_run_prog(rx, prog, &xdp,
&xdp_status, tx_nq, tx); &xdp_status, tx_nq, tx);
...@@ -1568,7 +1568,7 @@ static int tsnep_rx_poll_zc(struct tsnep_rx *rx, struct napi_struct *napi, ...@@ -1568,7 +1568,7 @@ static int tsnep_rx_poll_zc(struct tsnep_rx *rx, struct napi_struct *napi,
prefetch(entry->xdp->data); prefetch(entry->xdp->data);
length = __le32_to_cpu(entry->desc_wb->properties) & length = __le32_to_cpu(entry->desc_wb->properties) &
TSNEP_DESC_LENGTH_MASK; TSNEP_DESC_LENGTH_MASK;
xsk_buff_set_size(entry->xdp, length); xsk_buff_set_size(entry->xdp, length - ETH_FCS_LEN);
xsk_buff_dma_sync_for_cpu(entry->xdp, rx->xsk_pool); xsk_buff_dma_sync_for_cpu(entry->xdp, rx->xsk_pool);
/* RX metadata with timestamps is in front of actual data, /* RX metadata with timestamps is in front of actual data,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment