Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
Commit a47a5227 authored by Grygorii Strashko's avatar Grygorii Strashko Committed by Vignesh Raghavendra
Browse files

net: ethernet: ti: prueth: fix handling packets with timestamp

The packets with timestamp (TS) got the TS placed in the data block
following the packet data and TS data block has corresponding Buffer
descriptor allocated. Now ICSS prueth driver reads packet data and TS
properly, but releases only Buffer descriptors allocated for Packet data
and misses Buffer descriptor allocated for TS. As result, the queue rd_ptr
points on Buffer descriptor allocated for TS when driver switches to next
packet processing which is all 0.

This situation is detected by driver as critical error and driver tries to
recover by discarding all existing packets in the RX queue (rd_ptr =
wr_ptr).

Hence, fix packets with timestamp processing by properly account Buffer
descriptor allocated for TS.

Fixes: 813f7dc8

 ("net: ti: prueth: Add support for reading timestamps from rx packets")
Signed-off-by: default avatarGrygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: default avatarVignesh Raghavendra <vigneshr@ti.com>
parent 70781a6b
Branches
Tags
No related merge requests found
......@@ -1208,6 +1208,8 @@ int emac_rx_packet(struct prueth_emac *emac, u16 *bd_rd_ptr,
buffer_desc_count++;
read_block = (*bd_rd_ptr - rxqueue->buffer_desc_offset) / BD_SIZE;
pkt_block_size = DIV_ROUND_UP(pkt_info.length, ICSS_BLOCK_SIZE);
if (pkt_info.timestamp)
pkt_block_size++;
/* calculate end BD address post read */
update_block = read_block + pkt_block_size;
......
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