1. 09 Jan, 2020 5 commits
    • Dan Carpenter's avatar
      ethtool: fix ->reply_size() error handling · d97772db
      Dan Carpenter authored
      The "ret < 0" comparison is never true because "ret" is still zero.
      
      Fixes: 728480f1 ("ethtool: default handlers for GET requests")
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Reviewed-by: default avatarMichal Kubecek <mkubecek@suse.cz>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d97772db
    • Dan Carpenter's avatar
      ethtool: fix a memory leak in ethnl_default_start() · a6dd0480
      Dan Carpenter authored
      If ethnl_default_parse() fails then we need to free a couple
      memory allocations before returning.
      
      Fixes: 728480f1 ("ethtool: default handlers for GET requests")
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Reviewed-by: default avatarMichal Kubecek <mkubecek@suse.cz>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a6dd0480
    • David S. Miller's avatar
      Merge branch 'Broadcom-tags-support-for-531x5-539x-families' · 78b6d073
      David S. Miller authored
      Florian Fainelli says:
      
      ====================
      Broadcom tags support for 531x5/539x families
      
      This patch series finally allows us to enable Broadcom tags on the
      BCM531x5/BCM539x switch series which are very often cascaded onto
      another on-chip Broadcom switch. Because of that we need to be able to
      detect that Broadcom tags are already enabled on our DSA master which
      happens to be a DSA slave in that case since they are not part of the
      same DSA switch tree, the protocol does not support that.
      
      Due to the way DSA works, get_tag_protocol() is called prior to
      ds->ops->setup and we do not have all data structures set-up (in
      particular dsa_port::cpu_dp is not filed yet) so doing this at the time
      get_tag_protocol() is called and without exporting a helper function is
      desirable to limit our footprint into the framework.
      
      Having the core (net/dsa/dsa2.c) return and enforce DSA_TAG_PROTO_NONE
      was considered and done initially but this leaves the driver outside of
      the decision to force/fallback to a particular protocol, instead of
      letting it in control. Also there is no reason to suspect that all
      tagging protocols are problematic, e.g.: "inner" Marvell EDSA with
      "outer" Broadcom tag may work just fine, and vice versa.
      
      This was tested on:
      
      - Lamobo R1 which now has working Broadcom tags for its external BCM53125 switch
      - BCM7445 which has a BCM53125 hanging off one of its internal switch
        port, the BCM53125 still works with DSA_TAG_PROTO_NONE
      - BCM7278 which has a peculiar dual CPU port set-up (so dual IMP mode
        needs to be enabled)
      - Northstar Plus with DSA_TAG_PROTO_BRCM_PREPEND and no external
        switches hanging off the internal switch
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      78b6d073
    • Florian Fainelli's avatar
      net: dsa: b53: Enable Broadcom tags for 531x5/539x families · 8fab459e
      Florian Fainelli authored
      The BCM531x5 and BCM539x families require that the IMP port be enabled
      within the management page and that management mode (SM_SW_FWD_MODE) be
      turned on. Once this is done, everything works as expected, including
      multicast with standalone DSA devices or bridge devices.
      
      Because such switches are frequencly cascaded with other internal
      Broadcom switches on which we want to enable Broadcom tags, update
      b53_can_enable_brcm_tags() to check the kind of DSA master tagging
      protocol being used, if it is one of the two supported Broadcom tagging
      protocols, force DSA_TAG_PROTO_NONE.
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8fab459e
    • Florian Fainelli's avatar
      net: dsa: Get information about stacked DSA protocol · 4d776482
      Florian Fainelli authored
      It is possible to stack multiple DSA switches in a way that they are not
      part of the tree (disjoint) but the DSA master of a switch is a DSA
      slave of another. When that happens switch drivers may have to know this
      is the case so as to determine whether their tagging protocol has a
      remove chance of working.
      
      This is useful for specific switch drivers such as b53 where devices
      have been known to be stacked in the wild without the Broadcom tag
      protocol supporting that feature. This allows b53 to continue supporting
      those devices by forcing the disabling of Broadcom tags on the outermost
      switches if necessary.
      
      The get_tag_protocol() function is therefore updated to gain an
      additional enum dsa_tag_protocol argument which denotes the current
      tagging protocol used by the DSA master we are attached to, else
      DSA_TAG_PROTO_NONE for the top of the dsa_switch_tree.
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4d776482
  2. 08 Jan, 2020 33 commits
  3. 07 Jan, 2020 2 commits