1. 25 3月, 2016 1 次提交
    • P
      net: bcmgenet: fix dev->stats.tx_bytes accounting · 55868120
      Petri Gynther 提交于
      1. Add bytes_compl local variable to __bcmgenet_tx_reclaim() to collect
         transmitted bytes. dev->stats updates can then be moved outside the
         while-loop. bytes_compl is also needed for future BQL support.
      2. When bcmgenet device uses Tx checksum offload, each transmitted skb
         gets an extra 64-byte header prepended to it. Before this header is
         prepended to the skb, we need to save the skb "wire" length in
         GENET_CB(skb)->bytes_sent, so that proper Tx bytes accounting can
         be done in __bcmgenet_tx_reclaim().
      3. skb->len covers the entire length of skb, whether it is linear or
         fragmented. Thus, when we clean the fragments, do not increase
         transmitted bytes.
      
      Fixes: 1c1008c7 ("net: bcmgenet: add main driver file")
      Signed-off-by: NPetri Gynther <pgynther@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      55868120
  2. 19 3月, 2016 1 次提交
  3. 20 2月, 2016 1 次提交
  4. 19 11月, 2015 1 次提交
  5. 02 11月, 2015 1 次提交
  6. 19 10月, 2015 1 次提交
    • F
      net: bcmgenet: Fix early link interrupt enabling · 37850e37
      Florian Fainelli 提交于
      Link interrupts are enabled in init_umac(), which is too early for us to
      process them since we do not yet have a valid PHY device pointer. On
      BCM7425 chips for instance, we will crash calling phy_mac_interrupt()
      because phydev is NULL.
      
      Fix this by moving the link interrupts enabling in
      bcmgenet_netif_start(), under a specific function:
      bcmgenet_link_intr_enable() and while at it, update the comments
      surrounding the code.
      
      Fixes: 6cc8e6d4 ("net: bcmgenet: Delay PHY initialization to bcmgenet_open()")
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      37850e37
  7. 16 10月, 2015 1 次提交
  8. 22 9月, 2015 2 次提交
  9. 18 9月, 2015 2 次提交
    • F
      net: bcmgenet: Implement RX coalescing control knobs · 4a29645b
      Florian Fainelli 提交于
      Add support for the ethtool rx-frames coalescing parameter which allows
      defining the number of RX interrupts per frames received. The RDMA
      engine supports a configurable timeout with a resolution of
      approximately 8.192 us.
      
      We can no longer enable the BDONE/PDONE interrupts as those would
      fire for each packet/buffer received, which would defeat the MBDONE
      interrupt purpose. The MBDONE interrupt is guaranteed to correspond to a
      PDONE/BDONE interrupt when the threshold is set to 1.
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4a29645b
    • F
      net: bcmgenet: Implement TX coalescing control knobs · 2f913070
      Florian Fainelli 提交于
      Configuring the ethtool tx-frames property, which translates into N
      packets before a TX interrupt is the simplest configuration scheme
      because it requires no locking neither at the softare nor hardware
      level, and is completely indepedent from the link speed. Since ethtool
      does not allow per-tx queue coalescing parameters, we apply the same
      setting to any transmit queue.
      
      We can no longer enable the BDONE/PDONE interrupts as those would fire
      for each packet/buffer received, which would defeat the MBDONE interrupt
      purpose. The MBDONE interrupt is guaranteed to correspond to a
      PDONE/BDONE interrupt when the threshold is set to 1, but offers
      interrupt coalescing when the value is > 1.
      
      Since the HW is configured to generate an interrupt when the ring
      becomes emtpy, we have to deny any timeout/timer settings coming from
      user-space to indicate we can only generate an interrupt very <N>
      packets.
      
      While we are at it, fix the DMA_INTR_THRESHOLD_MASK value which was off
      by one bit (0xff vs. 0x1ff).
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2f913070
  10. 24 8月, 2015 2 次提交
  11. 01 8月, 2015 1 次提交
  12. 27 7月, 2015 1 次提交
  13. 21 7月, 2015 6 次提交
    • F
      net: bcmgenet: Remove init parameter from bcmgenet_mii_config · 28b45910
      Florian Fainelli 提交于
      Now that we have reworked the way we perform the PHY initialization, we
      no longer need to differentiate between init time vs. non-init time
      calls, just use a dev_info_once() print to print the PHY type.
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      28b45910
    • F
      net: bcmgenet: Delay PHY initialization to bcmgenet_open() · 6cc8e6d4
      Florian Fainelli 提交于
      We are currently doing a full PHY initialization and even starting the
      pHY state machine during bcmgenet_mii_init() which is executed in the
      driver's probe function. This is convenient to determine whether we can
      attach to a proper PHY device but comes at the expense of spending up to
      10ms per MDIO transactions (to reach the waitqueue timeout), which slows
      things down.
      
      This also creates a sitaution where we end-up attaching twice to the
      PHY, which is not quite correct either.
      
      Fix this by moving bcmgenet_mii_probe() into bcmgenet_open() and update
      its error path accordingly.
      
      Avoid printing the message "attached PHY at address 1 [...]" every time
      we bring up/down the interface and remove this print since it duplicates
      what the PHY driver already does for us.
      
      Fixes: 1c1008c7 ("net: bcmgenet: add main driver file")
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6cc8e6d4
    • F
      net: bcmgenet: Determine PHY type before scanning MDIO bus · c624f891
      Florian Fainelli 提交于
      Our internal GPHY might be powered off before we attempt scanning the
      MDIO bus and bind a driver to it. The way we are currently determining
      whether a PHY is internal or not is done *after* we have successfully
      matched its driver. If the PHY is powered down, it will not respond to
      the MDIO bus, so we will not be able to bind a driver to it.
      
      Our Device Tree for GENET interfaces specifies a "phy-mode" value:
      "internal" which tells if this internal uses an internal PHY or not.
      
      If of_get_phy_mode() fails to parse the 'phy-mode' property, do an
      additional manual lookup, and if we find "internal" set the
      corresponding internal variable accordingly.
      
      Replace all uses of phy_is_internal() with a check against
      priv->internal_phy to avoid having to rely on whether or not
      priv->phydev is set correctly.
      
      Fixes: 1c1008c7 ("net: bcmgenet: add main driver file")
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c624f891
    • F
      net: bcmgenet: Power on integrated GPHY in bcmgenet_power_up() · bd4060a6
      Florian Fainelli 提交于
      We are currently disabling the GPHY interface during bcmgenet_close(),
      and attempting to power it back on during bcmgenet_open(). This works
      fine for the first time, because we called bcmgenet_mii_config() which
      took care of enabling the interface, however, bcmgenet_power_up() really
      needs to power on the GPHY for correctness.
      
      This will be particularly important as we want to move
      bcmgenet_mii_probe() down to bcmgenet_open() to avoid seeing the "PHY
      already attached" message.
      
      Fixes: a642c4f7 ("net: bcmgenet: power up and down integrated GPHY when unused")
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bd4060a6
    • F
      net: bcmgenet: Use correct dev_id for free_irq · 978ffac4
      Florian Fainelli 提交于
      bcmgenet_open()'s error path call free_irq() with a dev_id argument
      different from the one we used to call request_irq() with, this will
      make us trip over the warning in kernel/irq/manage.c:__free_irq()
      
      Fixes: 1c1008c7 ("net: bcmgenet: add main driver file")
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      978ffac4
    • F
      net: bcmgenet: Remove excessive PHY reset · 6ac3ce82
      Florian Fainelli 提交于
      We are currently issuing multiple PHY resets during a suspend/resume,
      first during bcmgenet_power_up() which does a hardware reset, then a
      software reset by calling bcmgenet_mii_reset(). This is both unnecessary
      and can take as long as 10ms per MDIO transactions while we re-apply
      workarounds because we do not yet have MDIO interrupts enabled.
      
      phy_resume() takes care of re-apply our workarounds in case we need any,
      and bcmgenet_power_up() does a PHY hardware reset, all of this is more
      than enough to guarantee that the PHY operates correctly.
      
      Fixes: 1c1008c7 ("net: bcmgenet: add main driver file")
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6ac3ce82
  14. 12 7月, 2015 1 次提交
  15. 08 6月, 2015 1 次提交
  16. 02 4月, 2015 1 次提交
    • P
      net: bcmgenet: enable MoCA link state change detection · 8d88c6eb
      Petri Gynther 提交于
      Currently, MoCA fixed PHYs are always in link-up state, regardless of
      whether the link is actually up or not.
      
      Add code to properly detect MoCA link state changes and to reflect the
      new state in MoCA fixed PHY. Only GENET V3 and V4 MACs are capable of
      detecting MoCA link state changes.
      
      The code works as follows:
      1. GENET MAC detects MoCA link state change and issues UMAC_IRQ_LINK_UP
         or UMAC_IRQ_LINK_DOWN interrupt.
      2. Link up/down interrupt is processed in bcmgenet_irq_task(), which
         calls phy_mac_interrupt().
      3. phy_mac_interrupt() updates the fixed PHY phydev->link and kicks
         the PHY state machine.
      4. PHY state machine proceeds to read the fixed PHY link status
         register.
      5. When the fixed PHY link status register is being read, the new
         function bcmgenet_fixed_phy_link_update() gets called. It copies
         the fixed PHY phydev->link value to the fixed PHY status->link.
      6. PHY state machine receives the new link state of the fixed PHY.
      7. MoCA fixed PHY link state now correctly reflects the real MoCA
         hardware link state.
      Signed-off-by: NPetri Gynther <pgynther@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8d88c6eb
  17. 01 4月, 2015 5 次提交
  18. 28 3月, 2015 7 次提交
  19. 24 3月, 2015 3 次提交
  20. 16 3月, 2015 1 次提交