730-10-v6.3-net-ethernet-mtk_eth_soc-drop-packets-to-WDMA-if-the.patch 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. From: Felix Fietkau <[email protected]>
  2. Date: Thu, 3 Nov 2022 17:46:25 +0100
  3. Subject: [PATCH] net: ethernet: mtk_eth_soc: drop packets to WDMA if the
  4. ring is full
  5. Improves handling of DMA ring overflow.
  6. Clarify other WDMA drop related comment.
  7. Signed-off-by: Felix Fietkau <[email protected]>
  8. ---
  9. --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
  10. +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
  11. @@ -3714,9 +3714,12 @@ static int mtk_hw_init(struct mtk_eth *e
  12. mtk_w32(eth, 0x21021000, MTK_FE_INT_GRP);
  13. if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2)) {
  14. - /* PSE should not drop port8 and port9 packets */
  15. + /* PSE should not drop port8 and port9 packets from WDMA Tx */
  16. mtk_w32(eth, 0x00000300, PSE_DROP_CFG);
  17. + /* PSE should drop packets to port 8/9 on WDMA Rx ring full */
  18. + mtk_w32(eth, 0x00000300, PSE_PPE0_DROP);
  19. +
  20. /* PSE Free Queue Flow Control */
  21. mtk_w32(eth, 0x01fa01f4, PSE_FQFC_CFG2);
  22. --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
  23. +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
  24. @@ -140,6 +140,7 @@
  25. #define PSE_FQFC_CFG1 0x100
  26. #define PSE_FQFC_CFG2 0x104
  27. #define PSE_DROP_CFG 0x108
  28. +#define PSE_PPE0_DROP 0x110
  29. /* PSE Input Queue Reservation Register*/
  30. #define PSE_IQ_REV(x) (0x140 + (((x) - 1) << 2))