Thread (18 messages) flat view 18 messages, 3 authors, 2019-08-13

Re: [PATCH net-next v2 01/12] net: stmmac: Get correct timestamp values from XGMAC

From: Jakub Kicinski <hidden>
Date: 2019-08-13 20:57:37
Also in: linux-arm-kernel, lkml

On Mon, 12 Aug 2019 11:44:00 +0200, Jose Abreu wrote:
TX Timestamp in XGMAC comes from MAC instead of descriptors. Implement
this in a new callback.

Also, RX Timestamp in XGMAC must be cheked against corruption and we need
a barrier to make sure that descriptor fields are read correctly.

Changes from v1:
	- Rework the get timestamp function (David)

Signed-off-by: Jose Abreu <redacted>
The barrier sounds like it might be a bug fix, does it occur in he wild?
quoted hunk ↗ jump to hunk
@@ -113,13 +119,11 @@ static int dwxgmac2_get_rx_timestamp_status(void *desc, void *next_desc,
 	unsigned int rdes3 = le32_to_cpu(p->des3);
 	int ret = -EBUSY;
 
-	if (likely(rdes3 & XGMAC_RDES3_CDA)) {
+	if (likely(rdes3 & XGMAC_RDES3_CDA))
 		ret = dwxgmac2_rx_check_timestamp(next_desc);
-		if (ret)
-			return ret;
-	}
-
-	return ret;
+	if (!ret)
+		return 1;
+	return 0;
nit:

	return !ret;
 }
 
 static void dwxgmac2_init_rx_desc(struct dma_desc *p, int disable_rx_ic,
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help