1. 11 6月, 2019 3 次提交
  2. 07 6月, 2019 1 次提交
  3. 31 5月, 2019 1 次提交
  4. 30 5月, 2019 1 次提交
    • I
      net: phylink: Add struct phylink_config to PHYLINK API · 44cc27e4
      Ioana Ciornei 提交于
      The phylink_config structure will encapsulate a pointer to a struct
      device and the operation type requested for this instance of PHYLINK.
      This patch does not make any functional changes, it just transitions the
      PHYLINK internals and all its users to the new API.
      
      A pointer to a phylink_config structure will be passed to
      phylink_create() instead of the net_device directly. Also, the same
      phylink_config pointer will be passed back to all phylink_mac_ops
      callbacks instead of the net_device. Using this mechanism, a PHYLINK
      user can get the original net_device using a structure such as
      'to_net_dev(config->dev)' or directly the structure containing the
      phylink_config using a container_of call.
      
      At the moment, only the PHYLINK_NETDEV is defined as a valid operation
      type for PHYLINK. In this mode, a valid reference to a struct device
      linked to the original net_device should be passed to PHYLINK through
      the phylink_config structure.
      
      This API changes is mainly driven by the necessity of adding a new
      operation type in PHYLINK that disconnects the phy_device from the
      net_device and also works when the net_device is lacking.
      Signed-off-by: NIoana Ciornei <ioana.ciornei@nxp.com>
      Signed-off-by: NVladimir Oltean <olteanv@gmail.com>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Reviewed-by: NMaxime Chevallier <maxime.chevallier@bootlin.com>
      Tested-by: NMaxime Chevallier <maxime.chevallier@bootlin.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      44cc27e4
  5. 26 5月, 2019 2 次提交
    • M
      net: mvpp2: cls: Use RSS contexts to handle RSS tables · 895586d5
      Maxime Chevallier 提交于
      The PPv2 controller has 8 RSS tables that are shared across all ports on
      a given PPv2 instance. The previous implementation allocated one table
      per port, leaving others unused.
      
      By using RSS contexts, we can make use of multiple RSS tables per
      port, one being the default table (always id 0), the other ones being
      used as destinations for flow steering, in the same way as rx rings.
      
      This commit introduces RSS contexts management in the PPv2 driver. We
      always reserve one table per port, allocated when the port is probed.
      
      The global table list is stored in the struct mvpp2, as it's a global
      resource. Each port then maintains a list of indices in that global
      table, that way each port can have it's own numbering scheme starting
      from 0.
      
      One limitation that seems unavoidable is that the hashing parameters are
      shared across all RSS contexts for a given port. Hashing parameters for
      ctx 0 will be applied to all contexts.
      Signed-off-by: NMaxime Chevallier <maxime.chevallier@bootlin.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      895586d5
    • M
      net: mvpp2: cls: Use the correct number of rules in various places · ae8e1d5e
      Maxime Chevallier 提交于
      As of today, the classification offload implementation only supports 4
      different rules to be offloaded. This number has been hardcoded in the
      rule insertion function, and the wrong define is being used elsewhere.
      
      Use the correct #define everywhere to make sure we always check for the
      correct number of rules.
      Signed-off-by: NMaxime Chevallier <maxime.chevallier@bootlin.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ae8e1d5e
  6. 13 5月, 2019 1 次提交
  7. 02 5月, 2019 1 次提交
    • M
      net: mvpp2: cls: Add Classification offload support · 90b509b3
      Maxime Chevallier 提交于
      This commit introduces basic classification offloading support for the
      PPv2 controller.
      
      The PPv2 classifier has many classification engines, for now we only use
      the C2 TCAM match engine.
      
      This engine allows to perform ternary lookups on 64 bits keys (called
      Header Extracted Key), that are built by extracting fields from the packet
      header and concatenating them. At most 4 fields can be extracted for a
      single lookup.
      
      This basic implementation allows to build the HEK from the following
      fields :
       - L4 source and destination ports (for UDP and TCP)
      
      More fields are to be added in the future.
      
      Classification flows are added through the ethtool interface, using the
      newly introduced flow_rule infrastructure as an internal rule
      representation, allowing to more easily implement tc flower rules if
      need be.
      
      The internal design for now allocates one range of 4 rules per port
      due to the internal design of the flow table, which uses 22 sub-flows.
      
      When inserting a classification rule, the rule is created in every
      relevant sub-flow.
      
      This low rule-count is a very simple design which reaches quickly the
      limitations of the flow table ordering, but guarantees that the rule
      ordering will always be respected.
      
      This commit only introduces support for the "steer to rxq" action.
      Signed-off-by: NMaxime Chevallier <maxime.chevallier@bootlin.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      90b509b3
  8. 28 3月, 2019 2 次提交
  9. 02 3月, 2019 12 次提交
  10. 25 2月, 2019 1 次提交
  11. 13 2月, 2019 2 次提交
  12. 10 2月, 2019 1 次提交
    • R
      net: marvell: mvpp2: clear flow control modes in 10G mode · e240b7db
      Russell King 提交于
      When mvpp2 configures the flow control modes in mvpp2_xlg_config() for
      10G mode, it only ever set the flow control enable bits.  There is no
      mechanism to clear these bits, which means that userspace is unable to
      use standard APIs to disable flow control (the only way is to poke the
      register directly.)
      
      Fix the missing bit clearance to allow flow control to be disabled.
      This means that, by default, as there is no negotiation in 10G modes
      with mvpp2, flow control is now disabled rather than being rx-only.
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e240b7db
  13. 09 2月, 2019 4 次提交
    • R
      net: marvell: mvpp2: fix AN restart · a4650477
      Russell King 提交于
      phylink already limits which interface modes are able to call the
      MACs AN restart function, but in any case, the commentry seems
      incorrect: the AN restart bit does not automatically clear when
      set.  This has been found via manual setting using devmem2, and
      we can observe that the AN does indeed restart and complete, yet
      the AN restart bit remains set.  Explicitly clear the AN restart
      bit.
      Tested-by: NSven Auhagen <sven.auhagen@voleatech.de>
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a4650477
    • R
      net: marvell: mvpp2: only reprogram what is necessary on mac_config · d14e078f
      Russell King 提交于
      mac_config() can be called at any point, and the expected behaviour
      from MAC drivers is to only reprogram when necessary - and certainly
      avoid taking the link down on every call.
      
      Unfortunately, mvpp2 does exactly that - it takes the link down, and
      reprograms everything, and then releases the forced-link down.
      
      This is bad, it can cause the link to bounce:
      
      - SFP detects signal, disables LOS indication.
      - SFP code calls into phylink, calling phylink_sfp_link_up() which
        triggers a resolve.
      - phylink_resolve() calls phylink_get_mac_state() and finds the MAC
        reporting link up.
      - phylink wants to configure the pause mode on the MAC, so calls
        phylink_mac_config()
      - mvpp2 takes the link down temporarily, generating a MAC link down
        event followed by another MAC link event.
      - phylink calls mac_link_up() and then processes the MAC link down
        event.
      - phylink_resolve() gets called again, registers the link down, and
        calls mach_link_down() before re-running itself.
      - phylink_resolve() starts again at step 3 above.  This sequence
        repeats.
      
      GMAC versions prior to mvpp2 do not require the link to be taken down
      except when certain link properties (eg, switching between SGMII and
      1000base-X mode, or enabling/disabling in-band negotiation) are
      changed.  Implement this for mvpp2.
      Tested-by: NSven Auhagen <sven.auhagen@voleatech.de>
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d14e078f
    • R
      net: marvell: mvpp2: fix stuck in-band SGMII negotiation · 316734fd
      Russell King 提交于
      It appears that the mvpp22 can get stuck with SGMII negotiation.  The
      symptoms are that in-band negotiation never completes and the partner
      (eg, PHY) never reports SGMII link up, or if it supports negotiation
      bypass, goes into negotiation bypass mode (which will happen when the
      PHY sees that the MAC is alive but gets no response.)
      
      Triggering the PHY end of the link to re-negotiate results in the
      bypass bit clearing on the PHY, and then re-setting - indicating that
      the problem is at the mvpp22 GMAC end.
      
      Asserting the GMAC reset and de-asserting it resolves the issue.
      Arrange to assert the GMAC reset at probe time, and deassert it only
      after we have configured the GMAC for the appropriate mode.  This
      resolves the issue.
      Tested-by: NSven Auhagen <sven.auhagen@voleatech.de>
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      316734fd
    • R
      net: marvell: mvpp2: phylink compliance updates · 388ca27f
      Russell King 提交于
      Sven Auhagen reported issues with negotiation on a couple of his
      platforms using a mixture of SFP and PHYs in various different
      modes.  Debugging to root cause proved difficult, but essentially
      the problem comes down to the mvpp2 phylink implementation being
      slightly at odds with what is expected.
      
      phylink operates in three modes: phy, fixed-link, and in-band mode.
      
      In the first two modes, the expected behaviour from a MAC driver is
      that phylink resolves the operating mode and passes the mode to the
      MAC driver for it to program, including when the link should be
      brought up or taken down.  This is basically the same as the libphy
      approach.  This does not negate the requirement to advertise a correct
      control word for interface modes that have control words where that
      can be reasonably controlled.
      
      The second mode is in-band mode, where the MAC is expected to use the
      in-band control word to determine the operating mode.
      
      The mvneta driver implements the correct pattern required to support
      this: configure the port interface type separately from the in-band
      mode(s).  This is now specified in the phylink documentation patches.
      
      mvpp2 was programming in-band mode for SGMII and the 802.3z modes no
      what, and avoided forcing the link up in fixed/phy modes.  This caused
      a problem with some boards where the PHY is by default programmed to
      enter AN bypass mode, the PHY would report that the link was up, but
      the mvpp2 never completed the exchange of control word.
      
      Another issue that mvpp2 has is it sets SGMII AN format control word
      for both SGMII and 802.3z modes. The format of the control word is
      defined by MVPP2_GMAC_INBAND_AN_MASK, which should be set for SGMII
      and clear for 802.3z. Available Marvell documentation for earlier
      GMAC implementations does not make this clear, but this has been
      ascertained via extensive testing on earlier GMAC implementations,
      and then confirmed with a Macchiatobin Single Shot connected to a
      Clearfog: when MVPP2_GMAC_INBAND_AN_MASK is set, the clearfog does
      not receive the advertised pause mode settings.
      
      Lastly, there is no flow control in the in-band control word in Cisco
      SGMII, setting the flow control autonegotiation bit even with a PHY
      that has the Marvell extension to send this information does not result
      in the flow control being enabled at the MAC.  We need to do this
      manually using the information provided via phylink.
      
      Re-code mvpp2's mac_config() and mac_link_up() to follow this pattern.
      This allows Sven Auhagen's board and Macchiatobin to reliably bring
      the link up with the 88e1512 PHY with phylink operating in PHY mode
      with COMPHY built as a module but the rest of the networking built-in,
      and u-boot having brought up the interface.  in-band mode requires an
      additional patch to resolve another problem.
      Tested-by: NSven Auhagen <sven.auhagen@voleatech.de>
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      388ca27f
  14. 06 2月, 2019 2 次提交
    • R
      net: marvell: mvpp2: fix lack of link interrupts · bf2fa125
      Russell King 提交于
      Sven Auhagen reports that if he changes a SFP+ module for a SFP module
      on the Macchiatobin Single Shot, the link does not come back up.  For
      Sven, it is as easy as:
      
      - Insert a SFP+ module connected, and use ping6 to verify link is up.
      - Remove SFP+ module
      - Insert SFP 1000base-X module use ping6 to verify link is up: Link
        up event did not trigger and the link is down
      
      but that doesn't show the problem for me.  Locally, this has been
      reproduced by:
      
      - Boot with no modules.
      - Insert SFP+ module, confirm link is up.
      - Replace module with 25000base-X module.  Confirm link is up.
      - Set remote end down, link is reported as dropped at both ends.
      - Set remote end up, link is reported up at remote end, but not local
        end due to lack of link interrupt.
      
      Fix this by setting up both GMAC and XLG interrupts for port 0, but
      only unmasking the appropriate interrupt according to the current mode
      set in the mac_config() method.  However, only do the mask/unmask
      dance when we are really changing the link mode to avoid missing any
      link interrupts.
      Tested-by: NSven Auhagen <sven.auhagen@voleatech.de>
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bf2fa125
    • R
      net: marvell: mvpp2: use phy_interface_mode_is_8023z() helper · 4a4cec72
      Russell King 提交于
      Use the phy_interface_mode_is_8023z() helper for detecting interface
      modes that use 802.3z serial encoding.  This is equivalent to testing
      for both 1000base-X and 2500base-X.
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4a4cec72
  15. 08 1月, 2019 1 次提交
  16. 28 12月, 2018 1 次提交
  17. 20 12月, 2018 1 次提交
  18. 19 12月, 2018 1 次提交
  19. 12 12月, 2018 1 次提交
  20. 05 12月, 2018 1 次提交