Skip to content
  1. Sep 22, 2020
  2. Sep 21, 2020
  3. Sep 12, 2020
    • Barry Song's avatar
      net: hns: use IRQ_NOAUTOEN to avoid irq is enabled due to request_irq · 5a6bd84f
      Barry Song authored
      
      
      Rather than doing request_irq and then disabling the irq immediately, it
      should be safer to use IRQ_NOAUTOEN flag for the irq. It removes any gap
      between request_irq() and disable_irq().
      
      Cc: Salil Mehta <salil.mehta@huawei.com>
      Reviewed-by: default avatarYunsheng Lin <linyunsheng@huawei.com>
      Signed-off-by: default avatarBarry Song <song.bao.hua@hisilicon.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5a6bd84f
    • David S. Miller's avatar
      Merge branch 'net-ethernet-ti-ale-add-static-configuration' · 1cf814a0
      David S. Miller authored
      Grygorii Strashko says:
      
      ====================
      net: ethernet: ti: ale: add static configuration
      
      As existing, as newly introduced CPSW ALE versions have differences in
      supported features and ALE table formats. Especially it's actual for the
      recent AM65x/J721E/J7200 and future AM64x SoCs, which supports more
      features like: auto-aging, classifiers, Link aggregation, additional HW
      filtering, etc.
      
      The existing ALE configuration interface is not practical in terms of
      adding new features and requires consumers to program a lot static
      parameters. And any attempt to add new features will case endless adding
      and maintaining different combination of flags and options. Because CPSW
      ALE configuration is static and fixed for SoC (or set of SoC), It is
      reasonable to add support for static ALE configurations inside ALE module.
      
      This series introduces static ALE configuration table for different ALE
      variants and provides option for consumers to select required ALE
      configuration by providing ALE const char *dev_id identifier (Patch 2).
      And all existing driver have been switched to use new approach (Patches 3-6).
      
      After this ALE HW auto-ageing feature can be enabled for AM65x CPSW ALE
      variant (Patch 7).
      
      Finally, Patches 8-9 introduces tables to describe the ALE VLAN entries
      fields as the ALE VLAN entries are too much differ between different TI
      CPSW ALE versions. So, handling them using flags, defines and get/set
      functions are became over-complicated.
      
      Patch 1 - is preparation patch
      
      Changes in v3:
      - fixed comment for Patch 2
      
      Changes in v2:
      - fixed sparse warnings
      
      v2: https://lore.kernel.org/patchwork/cover/1301684/
      v1: https://lore.kernel.org/patchwork/cover/1301048/
      
      
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1cf814a0
    • Grygorii Strashko's avatar
      net: ethernet: ti: ale: add support for multi port k3 cpsw versions · 06c5c912
      Grygorii Strashko authored
      
      
      The TI J721E (CPSW9g) ALE version is similar, in general, to Sitara AM3/4/5
      CPSW ALE, but has more extended functions and different ALE VLAN entry
      format.
      
      This patch adds support for for multi port TI J721E (CPSW9g) ALE variant.
      
      Signed-off-by: default avatarGrygorii Strashko <grygorii.strashko@ti.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      06c5c912
    • Grygorii Strashko's avatar
      net: ethernet: ti: ale: switch to use tables for vlan entry description · aa61296c
      Grygorii Strashko authored
      
      
      The ALE VLAN entries are too much differ between different TI CPSW ALE
      versions. So, handling them using flags, defines and get/set functions
      became over-complicated.
      
      This patch introduces tables to describe the ALE VLAN entries fields, which
      are different between TI CPSW ALE versions, and new get/set access
      functions. It also allows to detect incorrect access to not available ALL
      entry fields.
      
      Signed-off-by: default avatarGrygorii Strashko <grygorii.strashko@ti.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      aa61296c
    • Grygorii Strashko's avatar
      net: ethernet: ti: am65-cpsw: enable hw auto ageing · 23015ff1
      Grygorii Strashko authored
      
      
      The AM65x ALE supports HW auto-ageing which can be enabled by programming
      ageing interval in ALE_AGING_TIMER register. For this CPSW fck_clk
      frequency has to be know by ALE.
      
      This patch extends cpsw_ale_params with bus_freq field and enables ALE HW
      auto ageing for AM65x CPSW2G ALE version.
      
      Signed-off-by: default avatarGrygorii Strashko <grygorii.strashko@ti.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      23015ff1
    • Grygorii Strashko's avatar
      net: ethernet: ti: ale: make usage of ale dev_id mandatory · 186f5c99
      Grygorii Strashko authored
      
      
      Hence all existing driver updated to use ALE dev_id the usage of ale dev_id
      can be made mandatory and cpsw_ale_create() can be updated to use
      "features" property from ALE static configuration.
      
      Signed-off-by: default avatarGrygorii Strashko <grygorii.strashko@ti.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      186f5c99
    • Grygorii Strashko's avatar
      net: ethernet: ti: am65-cpsw: use dev_id for ale configuration · 720116ad
      Grygorii Strashko authored
      
      
      The previous patch has introduced possibility to select CPSW ALE by using
      ALE dev_id identifier. Switch TI TI AM65x/J721E CPSW NUSS driver to use
      dev_id.
      
      Signed-off-by: default avatarGrygorii Strashko <grygorii.strashko@ti.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      720116ad
    • Grygorii Strashko's avatar
      net: netcp: ethss: use dev_id for ale configuration · 6dcbd0d9
      Grygorii Strashko authored
      
      
      The previous patch has introduced possibility to select CPSW ALE by using
      ALE dev_id identifier. Switch TI Keystone 2 NETCP driver to use dev_id and
      perform clean up by removing "ale_entries" configuration code.
      
      Signed-off-by: default avatarGrygorii Strashko <grygorii.strashko@ti.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6dcbd0d9
    • Grygorii Strashko's avatar
      net: ethernet: ti: cpsw: use dev_id for ale configuration · 64922d37
      Grygorii Strashko authored
      
      
      The previous patch has introduced possibility to select CPSW ALE by using
      ALE dev_id identifier. Switch TI cpsw driver to use dev_id="cpsw" and
      perform clean up by removing "ale_entries" configuration code.
      
      Signed-off-by: default avatarGrygorii Strashko <grygorii.strashko@ti.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      64922d37
    • Grygorii Strashko's avatar
      net: ethernet: ti: ale: add static configuration · 6a68df93
      Grygorii Strashko authored
      
      
      As existing, as newly introduced CPSW ALE versions have differences in
      supported features and ALE table formats. Especially it's actual for the
      recent AM65x/J721E/J7200 SoC and feature AM64x, which supports features
      like: auto-aging, classifiers, Link aggregation, additional hw filtering,
      etc.
      
      Existing ALE configuration interface is not practical in terms of adding
      new features and requires consumers to program a lot static parameters. Any
      attempt to add new options will case endless adding and maintaining
      different combination of flags and options.
      
      Hence CPSW ALE configuration is static and fixed for SoC (or set of SoC) It
      is reasonable to add support for static ALE configurations inside ALE
      module. This patch adds static ALE configuration table for different ALE
      versions and provides option for consumers to select required ALE
      configuration by providing ALE const char *dev_id identifier.
      
      This feature is not enabled by default until existing CPSW drivers will be
      modified by follow up patches.
      
      Signed-off-by: default avatarGrygorii Strashko <grygorii.strashko@ti.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6a68df93
    • Grygorii Strashko's avatar
      net: ethernet: ti: ale: add cpsw_ale_get_num_entries api · b574bf0c
      Grygorii Strashko authored
      
      
      Add cpsw_ale_get_num_entries() API to return number of ALE table entries
      and update existing drivers to use it.
      
      Signed-off-by: default avatarGrygorii Strashko <grygorii.strashko@ti.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b574bf0c
    • David S. Miller's avatar
      Merge branch 'DSA-tag_8021q-cleanup' · c4f33417
      David S. Miller authored
      
      
      Vladimir Oltean says:
      
      ====================
      DSA tag_8021q cleanup
      
      This small series tries to consolidate the VLAN handling in DSA a little
      bit. It reworks tag_8021q to be minimally invasive to the dsa_switch_ops
      structure. This makes the rest of the code a bit easier to follow.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c4f33417
    • Vladimir Oltean's avatar
      Revert "net: dsa: Add more convenient functions for installing port VLANs" · 88236591
      Vladimir Oltean authored
      This reverts commit 314f76d7
      
      .
      
      Citing that commit message, the call graph was:
      
          dsa_slave_vlan_rx_add_vid   dsa_port_setup_8021q_tagging
                      |                        |
                      |                        |
                      |          +-------------+
                      |          |
                      v          v
                     dsa_port_vid_add      dsa_slave_port_obj_add
                            |                         |
                            +-------+         +-------+
                                    |         |
                                    v         v
                                 dsa_port_vlan_add
      
      Now that tag_8021q has its own ops structure, it no longer relies on
      dsa_port_vid_add, and therefore on the dsa_switch_ops to install its
      VLANs.
      
      So dsa_port_vid_add now only has one single caller. So we can simplify
      the call graph to what it was before, aka:
      
              dsa_slave_vlan_rx_add_vid     dsa_slave_port_obj_add
                            |                         |
                            +-------+         +-------+
                                    |         |
                                    v         v
                                 dsa_port_vlan_add
      
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      88236591
    • Vladimir Oltean's avatar
      net: dsa: tag_8021q: add a context structure · 5899ee36
      Vladimir Oltean authored
      
      
      While working on another tag_8021q driver implementation, some things
      became apparent:
      
      - It is not mandatory for a DSA driver to offload the tag_8021q VLANs by
        using the VLAN table per se. For example, it can add custom TCAM rules
        that simply encapsulate RX traffic, and redirect & decapsulate rules
        for TX traffic. For such a driver, it makes no sense to receive the
        tag_8021q configuration through the same callback as it receives the
        VLAN configuration from the bridge and the 8021q modules.
      
      - Currently, sja1105 (the only tag_8021q user) sets a
        priv->expect_dsa_8021q variable to distinguish between the bridge
        calling, and tag_8021q calling. That can be improved, to say the
        least.
      
      - The crosschip bridging operations are, in fact, stateful already. The
        list of crosschip_links must be kept by the caller and passed to the
        relevant tag_8021q functions.
      
      So it would be nice if the tag_8021q configuration was more
      self-contained. This patch attempts to do that.
      
      Create a struct dsa_8021q_context which encapsulates a struct
      dsa_switch, and has 2 function pointers for adding and deleting a VLAN.
      These will replace the previous channel to the driver, which was through
      the .port_vlan_add and .port_vlan_del callbacks of dsa_switch_ops.
      
      Also put the list of crosschip_links into this dsa_8021q_context.
      Drivers that don't support cross-chip bridging can simply omit to
      initialize this list, as long as they dont call any cross-chip function.
      
      The sja1105_vlan_add and sja1105_vlan_del functions are refactored into
      a smaller sja1105_vlan_add_one, which now has 2 entry points:
      - sja1105_vlan_add, from struct dsa_switch_ops
      - sja1105_dsa_8021q_vlan_add, from the tag_8021q ops
      But even this change is fairly trivial. It just reflects the fact that
      for sja1105, the VLANs from these 2 channels end up in the same hardware
      table. However that is not necessarily true in the general sense (and
      that's the reason for making this change).
      
      The rest of the patch is mostly plain refactoring of "ds" -> "ctx". The
      dsa_8021q_context structure needs to be propagated because adding a VLAN
      is now done through the ops function pointers inside of it.
      
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5899ee36