@@ -291,7 +291,7 @@ static void stream_process_mem2s(struct Stream *s, StreamSink *tx_data_dev,
StreamSink *tx_control_dev)
{
uint32_t prev_d;
- uint32_t txlen;
+ uint32_t txlen, origin_txlen;
uint64_t addr;
bool eop;
@@ -314,6 +314,7 @@ static void stream_process_mem2s(struct Stream *s, StreamSink *tx_data_dev,
}
txlen = s->desc.control & SDESC_CTRL_LEN_MASK;
+ origin_txlen = txlen;
eop = stream_desc_eof(&s->desc);
addr = s->desc.buffer_address;
@@ -334,7 +335,7 @@ static void stream_process_mem2s(struct Stream *s, StreamSink *tx_data_dev,
}
/* Update the descriptor. */
- s->desc.status = txlen | SDESC_STATUS_COMPLETE;
+ s->desc.status = origin_txlen | SDESC_STATUS_COMPLETE;
stream_desc_store(s, s->regs[R_CURDESC]);
/* Advance. */
Currently, txlen is always decremented to 0 before filling to the descriptor. Keep the origin txlen value to have the correct value of descriptor status field. It will fix the 'tx_bytes' statistic value in linux axi-ethernet driver. Signed-off-by: Jim Shu <jim.shu@sifive.com> --- hw/dma/xilinx_axidma.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)