]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/net/ethernet/cadence/macb_main.c
net: macb: Limit maximum GEM TX length in TSO
[linux.git] / drivers / net / ethernet / cadence / macb_main.c
index 11311923e1662b9684c7cce347c313181fc54649..4508f0d150da95d8e838d0ead806e8ef74794cc5 100644 (file)
@@ -73,7 +73,11 @@ struct sifive_fu540_macb_mgmt {
 /* Max length of transmit frame must be a multiple of 8 bytes */
 #define MACB_TX_LEN_ALIGN      8
 #define MACB_MAX_TX_LEN                ((unsigned int)((1 << MACB_TX_FRMLEN_SIZE) - 1) & ~((unsigned int)(MACB_TX_LEN_ALIGN - 1)))
-#define GEM_MAX_TX_LEN         ((unsigned int)((1 << GEM_TX_FRMLEN_SIZE) - 1) & ~((unsigned int)(MACB_TX_LEN_ALIGN - 1)))
+/* Limit maximum TX length as per Cadence TSO errata. This is to avoid a
+ * false amba_error in TX path from the DMA assuming there is not enough
+ * space in the SRAM (16KB) even when there is.
+ */
+#define GEM_MAX_TX_LEN         (unsigned int)(0x3FC0)
 
 #define GEM_MTU_MIN_SIZE       ETH_MIN_MTU
 #define MACB_NETIF_LSO         NETIF_F_TSO