Skip to content
  1. May 27, 2019
  2. May 26, 2019
  3. May 25, 2019
    • David S. Miller's avatar
      Merge branch 'net-stmmac-Improvements-and-Selftests' · 22942498
      David S. Miller authored
      
      
      Jose Abreu says:
      
      ====================
      net: stmmac: Improvements and Selftests
      
      [ Thanks to the introducion of selftests this series ended up being a misc
      of improvements and the selftests additions per-se. ]
      
      This introduces selftests support in stmmac driver. We add 9 basic sanity
      checks and MAC loopback support for all cores within the driver. This way
      more tests can easily be added in the future and can be run in virtually
      any MAC/GMAC/QoS/XGMAC platform.
      
      Having this we can find regressions and missing features in the driver
      while at the same time we can check if the IP is correctly working.
      
      We have been using this for some time now and I do have more tests to
      submit in the feature. My experience is that although writing the tests
      adds more development time, the gain results are obvious.
      
      I let this feature optional within the driver under a Kconfig option.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      22942498
    • Jose Abreu's avatar
      net: stmmac: Prevent missing interrupts when running NAPI · a976ca79
      Jose Abreu authored
      
      
      When we trigger NAPI we are disabling interrupts but in case we receive
      or send a packet in the meantime, as interrupts are disabled, we will
      miss this event.
      
      Trigger both NAPI instances (RX and TX) when at least one event happens
      so that we don't miss any interrupts.
      
      Signed-off-by: default avatarJose Abreu <joabreu@synopsys.com>
      Cc: Joao Pinto <jpinto@synopsys.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
      Cc: Alexandre Torgue <alexandre.torgue@st.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a976ca79
    • Jose Abreu's avatar
      net: stmmac: dwmac4/5: Clear unused address entries · 0620ec6c
      Jose Abreu authored
      
      
      In case we don't use a given address entry we need to clear it because
      it could contain previous values that are no longer valid.
      
      Found out while running stmmac selftests.
      
      Signed-off-by: default avatarJose Abreu <joabreu@synopsys.com>
      Cc: Joao Pinto <jpinto@synopsys.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
      Cc: Alexandre Torgue <alexandre.torgue@st.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0620ec6c
    • Jose Abreu's avatar
      net: stmmac: dwxgmac2: Do not disable whole RX in dma_stop_rx() · eaabcd9e
      Jose Abreu authored
      
      
      We don't need to disable the whole RX when dma_stop_rx() is called
      because there may be the need of just disabling 1 DMA channel.
      
      This is also needed for stmmac Flow Control selftest.
      
      Signed-off-by: default avatarJose Abreu <joabreu@synopsys.com>
      Cc: Joao Pinto <jpinto@synopsys.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
      Cc: Alexandre Torgue <alexandre.torgue@st.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      eaabcd9e
    • Jose Abreu's avatar
      net: stmmac: dwmac4/5: Do not disable whole RX in dma_stop_rx() · a8b91b30
      Jose Abreu authored
      
      
      We don't need to disable the whole RX when dma_stop_rx() is called
      because there may be the need of just disabling 1 DMA channel.
      
      This is also needed for stmmac Flow Control selftest.
      
      Signed-off-by: default avatarJose Abreu <joabreu@synopsys.com>
      Cc: Joao Pinto <jpinto@synopsys.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
      Cc: Alexandre Torgue <alexandre.torgue@st.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a8b91b30
    • Jose Abreu's avatar
      net: stmmac: dwmac4/5: Fix Hash Filter · f9c5f7d7
      Jose Abreu authored
      
      
      In order for hash filter to work we need to set the HPF bit.
      
      Fout out while running stmmac selftests
      
      Signed-off-by: default avatarJose Abreu <joabreu@synopsys.com>
      Cc: Joao Pinto <jpinto@synopsys.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
      Cc: Alexandre Torgue <alexandre.torgue@st.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f9c5f7d7
    • Jose Abreu's avatar
      net: stmmac: dwmac1000: Clear unused address entries · 9463c445
      Jose Abreu authored
      
      
      In case we don't use a given address entry we need to clear it because
      it could contain previous values that are no longer valid.
      
      Found out while running stmmac selftests.
      
      Signed-off-by: default avatarJose Abreu <joabreu@synopsys.com>
      Cc: Joao Pinto <jpinto@synopsys.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
      Cc: Alexandre Torgue <alexandre.torgue@st.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9463c445
    • Jose Abreu's avatar
      net: stmmac: dwmac1000: Fix Hash Filter · 09261426
      Jose Abreu authored
      
      
      In order for hash filter to work we need to set the HPF bit.
      
      Found out while running stmmac selftests.
      
      Signed-off-by: default avatarJose Abreu <joabreu@synopsys.com>
      Cc: Joao Pinto <jpinto@synopsys.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
      Cc: Alexandre Torgue <alexandre.torgue@st.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      09261426
    • Jose Abreu's avatar
      net: stmmac: Introduce selftests support · 091810db
      Jose Abreu authored
      
      
      We add support for selftests on stmmac driver with 9 basic sanity checks
      for now:
      	- MAC Loopback
      	- PHY Loopback
      	- MMC Counters
      	- EEE
      	- Hash Filter Multicast
      	- Perfect Filter Unicast
      	- Multicast Filter All
      	- Unicast Filter All
      	- Flow Control
      
      This allows for fast tracking of regressions in the driver and helps in
      spotting mis-configuration of HW.
      
      Changes from v1:
      	- Fix build error as module (David)
      	- Check for link status before running tests
      Changes from RFC v2:
      	- Return proper error code in stmmac_test_mmc (Corentin)
      	- Use only 1 MMC counter in stmmac_test_mmc (Alexandre)
      Changes from RFC v1:
      	- Change test_loopback to test_mac_loopback (Andrew)
      	- Change timeout to retries (Andrew)
      	- Add MC/UC filter tests (Andrew)
      	- Only test in offline mode (Andrew)
      	- Do not call phy_loopback twice (Alexandre)
      
      Signed-off-by: default avatarJose Abreu <joabreu@synopsys.com>
      Cc: Joao Pinto <jpinto@synopsys.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
      Cc: Alexandre Torgue <alexandre.torgue@st.com>
      Cc: Corentin Labbe <clabbe.montjoie@gmail.com>
      Cc: Andrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      091810db
    • Jose Abreu's avatar
      net: stmmac: dwxgmac2: Also pass control frames while in promisc mode · 8c5f48d9
      Jose Abreu authored
      
      
      In order for the selftests to run the Flow Control selftest we need to
      also pass pause frames to the stack.
      
      Pass this type of frames while in promiscuous mode.
      
      Signed-off-by: default avatarJose Abreu <joabreu@synopsys.com>
      Cc: Joao Pinto <jpinto@synopsys.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
      Cc: Alexandre Torgue <alexandre.torgue@st.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8c5f48d9
    • Jose Abreu's avatar
      net: stmmac: dwmac4/5: Also pass control frames while in promisc mode · 2b783e61
      Jose Abreu authored
      
      
      In order for the selftests to run the Flow Control selftest we need to
      also pass pause frames to the stack.
      
      Pass this type of frames while in promiscuous mode.
      
      Signed-off-by: default avatarJose Abreu <joabreu@synopsys.com>
      Cc: Joao Pinto <jpinto@synopsys.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
      Cc: Alexandre Torgue <alexandre.torgue@st.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2b783e61
    • Jose Abreu's avatar
      net: stmmac: dwmac1000: Also pass control frames while in promisc mode · 52ef6d92
      Jose Abreu authored
      
      
      In order for the selftests to run the Flow Control selftest we need to
      also pass pause frames to the stack.
      
      Pass this type of frames while in promiscuous mode.
      
      Signed-off-by: default avatarJose Abreu <joabreu@synopsys.com>
      Cc: Joao Pinto <jpinto@synopsys.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
      Cc: Alexandre Torgue <alexandre.torgue@st.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      52ef6d92
    • Jose Abreu's avatar
      net: stmmac: Switch MMC functions to HWIF callbacks · 3b1dd2c5
      Jose Abreu authored
      
      
      XGMAC has a different MMC module. Lets use HWIF callbacks for MMC module
      so that correct callbacks are automatically selected.
      
      Signed-off-by: default avatarJose Abreu <joabreu@synopsys.com>
      Cc: Joao Pinto <jpinto@synopsys.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
      Cc: Alexandre Torgue <alexandre.torgue@st.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3b1dd2c5