1. 12 Oct, 2020 9 commits
  2. 11 Oct, 2020 9 commits
    • Jakub Kicinski's avatar
      Merge branch 'Offload-tc-vlan-mangle-to-mscc_ocelot-switch' · bc081a69
      Jakub Kicinski authored
      Vladimir Oltean says:
      
      ====================
      Offload tc-vlan mangle to mscc_ocelot switch
      
      This series offloads one more action to the VCAP IS1 ingress TCAM, which
      is to change the classified VLAN for packets, according to the VCAP IS1
      keys (VLAN, source MAC, source IP, EtherType, etc).
      ====================
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      bc081a69
    • Vladimir Oltean's avatar
      selftests: net: mscc: ocelot: add test for VLAN modify action · 82c200be
      Vladimir Oltean authored
      Create a test that changes a VLAN ID from 200 to 300.
      
      We also need to modify the preferences of the filters installed for the
      other rules so that they are unique, because we now install the "tc-vlan
      modify" filter in VCAP IS1 only temporarily, and we need to perform the
      deletion by filter preference number.
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      82c200be
    • Vladimir Oltean's avatar
      net: dsa: tag_ocelot: use VLAN information from tagging header when available · ea440cd2
      Vladimir Oltean authored
      When the Extraction Frame Header contains a valid classified VLAN, use
      that instead of the VLAN header present in the packet.
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      ea440cd2
    • Vladimir Oltean's avatar
      net: mscc: ocelot: offload VLAN mangle action to VCAP IS1 · 70edfae1
      Vladimir Oltean authored
      The VCAP_IS1_ACT_VID_REPLACE_ENA action, from the VCAP IS1 ingress TCAM,
      changes the classified VLAN.
      
      We are only exposing this ability for switch ports that are under VLAN
      aware bridges. This is because in standalone ports mode and under a
      bridge with vlan_filtering=0, the ocelot driver configures the switch to
      operate as VLAN-unaware, so the classified VLAN is not derived from the
      802.1Q header from the packet, but instead is always equal to the
      port-based VLAN ID of the ingress port. We _can_ still change the
      classified VLAN for packets when operating in this mode, but the end
      result will most likely be a drop, since both the ingress and the egress
      port need to be members of the modified VLAN. And even if we install the
      new classified VLAN into the VLAN table of the switch, the result would
      still not be as expected: we wouldn't see, on the output port, the
      modified VLAN tag, but the original one, even though the classified VLAN
      was indeed modified. This is because of how the hardware works: on
      egress, what is pushed to the frame is a "port tag", which gives us the
      following options:
      
      - Tag all frames with port tag (derived from the classified VLAN)
      - Tag all frames with port tag, except if the classified VLAN is 0 or
        equal to the native VLAN of the egress port
      - No port tag
      
      Needless to say, in VLAN-unaware mode we are disabling the port tag.
      Otherwise, the existing VLAN tag would be ignored, and a second VLAN
      tag (the port tag), holding the classified VLAN, would be pushed
      (instead of replacing the existing 802.1Q tag). This is definitely not
      what the user wanted when installing a "vlan modify" action.
      
      So it is simply not worth bothering with VLAN modify rules under other
      configurations except when the ports are fully VLAN-aware.
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      70edfae1
    • Jakub Kicinski's avatar
      Merge branch 'enetc-Migrate-to-PHYLINK-and-PCS_LYNX' · bea4b309
      Jakub Kicinski authored
      Claudiu Manoil says:
      
      ====================
      enetc: Migrate to PHYLINK and PCS_LYNX
      
      Transitioning the enetc driver from phylib to phylink.
      Offloading the serdes configuration to the PCS_LYNX
      module is a mandatory part of this transition. Aiming
      for a cleaner, more maintainable design, and better
      code reuse.
      The first 2 patches are clean up prerequisites.
      
      Tested on a p1028rdb board.
      
      v2: validate() explicitly rejects now all interface modes not
      supported by the driver instead of relying on the device tree
      to provide only supported interfaces, and dropped redundant
      activation of pcs_poll (addressing Ioana's findings)
      ====================
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      bea4b309
    • Claudiu Manoil's avatar
      enetc: Migrate to PHYLINK and PCS_LYNX · 71b77a7a
      Claudiu Manoil authored
      This is a methodical transition of the driver from phylib
      to phylink, following the guidelines from sfp-phylink.rst.
      The MAC register configurations based on interface mode
      were moved from the probing path to the mac_config() hook.
      MAC enable and disable commands (enabling Rx and Tx paths
      at MAC level) were also extracted and assigned to their
      corresponding phylink hooks.
      As part of the migration to phylink, the serdes configuration
      from the driver was offloaded to the PCS_LYNX module,
      introduced in commit 0da4c3d3 ("net: phy: add Lynx PCS module"),
      the PCS_LYNX module being a mandatory component required to
      make the enetc driver work with phylink.
      Signed-off-by: default avatarClaudiu Manoil <claudiu.manoil@nxp.com>
      Reviewed-by: default avatarIoana Ciornei <ioana.cionei@nxp.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      71b77a7a
    • Claudiu Manoil's avatar
      arm64: dts: fsl-ls1028a-rdb: Specify in-band mode for ENETC port 0 · 9fce74bf
      Claudiu Manoil authored
      As part of the transition of the enetc ethernet driver from phylib
      to phylink, the in-band operation mode of the SGMII interface
      from enetc port 0 needs to be specified explicitly for phylink.
      Signed-off-by: default avatarClaudiu Manoil <claudiu.manoil@nxp.com>
      Reviewed-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      9fce74bf
    • Claudiu Manoil's avatar
      enetc: Clean up serdes configuration · 46456ccf
      Claudiu Manoil authored
      Decouple internal mdio bus creation from serdes
      configuration, as a prerequisite to offloading
      serdes configuration to a different module.
      Group together mdio bus creation routines, cleanup.
      Signed-off-by: default avatarClaudiu Manoil <claudiu.manoil@nxp.com>
      Reviewed-by: default avatarIoana Ciornei <ioana.ciornei@nxp.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      46456ccf
    • Claudiu Manoil's avatar
      enetc: Clean up MAC and link configuration · 08f90fc9
      Claudiu Manoil authored
      Decouple level MAC configuration based on phy interface type
      from general port configuration.
      Group together MAC and link configuration code.
      Decouple external mdio bus creation from interface type
      parsing.  No longer return an (unhandled) error code when
      phy_node not found, use phy_node to indicate whether the
      port has a phy or not.  No longer fall-through when serdes
      configuration fails for the link modes that require
      internal link configuration.
      Signed-off-by: default avatarClaudiu Manoil <claudiu.manoil@nxp.com>
      Reviewed-by: default avatarIoana Ciornei <ioana.ciornei@nxp.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      08f90fc9
  3. 10 Oct, 2020 17 commits
  4. 09 Oct, 2020 5 commits
    • Jakub Kicinski's avatar
      Merge branch '100GbE-Intel-Wired-LAN-Driver-Updates-2020-10-07' · 3b8f56ee
      Jakub Kicinski authored
      Tony Nguyen says:
      
      ====================
      100GbE Intel Wired LAN Driver Updates 2020-10-07
      
      This series contains updates to ice driver only.
      
      Andy Shevchenko changes usage to %*phD format to print small buffer as hex
      string.
      
      Bruce removes repeated words reported by checkpatch.
      
      Ani changes ice_info_get_dsn() to return void as it always returns
      success.
      
      Jake adds devlink reporting of fw.app.bundle_id. Moves devlink_port
      structure to ice_vsi to resolve issues with cleanup. Adds additional
      debug info for firmware updates.
      
      Bixuan Cui resolves -Wpointer-to-int-cast warnings.
      
      Dan adds additional packet type masks and checks to prevent overwriting
      existing Flow Director rules.
      ====================
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      3b8f56ee
    • Dan Nowlin's avatar
      ice: fix adding IP4 IP6 Flow Director rules · 051d2b5c
      Dan Nowlin authored
      A subsequent addition of an IP4 or IP6 rule after other rules would
      overwrite any existing TCAM entries of related L4 protocols(ex: tcp4 or
      udp6). This was due to the mask including too many TCAM entries. Add new
      packet type masks with bits properly excluded so rules are not overwritten.
      Signed-off-by: default avatarDan Nowlin <dan.nowlin@intel.com>
      Signed-off-by: default avatarHenry Tieman <henry.w.tieman@intel.com>
      Tested-by: default avatarBrijesh Behera <brijeshx.behera@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      051d2b5c
    • Bixuan Cui's avatar
      ice: Fix pointer cast warnings · ecfb751f
      Bixuan Cui authored
      pointers should be casted to unsigned long to avoid
      -Wpointer-to-int-cast warnings:
      
      drivers/net/ethernet/intel/ice/ice_flow.h:197:33: warning:
          cast from pointer to integer of different size
      drivers/net/ethernet/intel/ice/ice_flow.h:198:32: warning:
          cast to pointer from integer of different size
      Signed-off-by: default avatarBixuan Cui <cuibixuan@huawei.com>
      Tested-by: default avatarAaron Brown <aaron.f.brown@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      ecfb751f
    • Jacob Keller's avatar
      ice: add additional debug logging for firmware update · 1e8249cc
      Jacob Keller authored
      While debugging a recent failure to update the flash of an ice device,
      I found it helpful to add additional logging which helped determine the
      root cause of the problem being a timeout issue.
      
      Add some extra dev_dbg() logging messages which can be enabled using the
      dynamic debug facility, including one for ice_aq_wait_for_event that
      will use jiffies to capture a rough estimate of how long we waited for
      the completion of a firmware command.
      Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
      Tested-by: default avatarBrijesh Behera <brijeshx.behera@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      1e8249cc
    • Jacob Keller's avatar
      ice: refactor devlink_port to be per-VSI · 48d40025
      Jacob Keller authored
      Currently, the devlink_port structure is stored within the ice_pf. This
      made sense because we create a single devlink_port for each PF. This
      setup does not mesh with the abstractions in the driver very well, and
      led to a flow where we accidentally call devlink_port_unregister twice
      during error cleanup.
      
      In particular, if devlink_port_register or devlink_port_unregister are
      called twice, this leads to a kernel panic. This appears to occur during
      some possible flows while cleaning up from a failure during driver
      probe.
      
      If register_netdev fails, then we will call devlink_port_unregister in
      ice_cfg_netdev as it cleans up. Later, we again call
      devlink_port_unregister since we assume that we must cleanup the port
      that is associated with the PF structure.
      
      This occurs because we cleanup the devlink_port for the main PF even
      though it was not allocated. We allocated the port within a per-VSI
      function for managing the main netdev, but did not release the port when
      cleaning up that VSI, the allocation and destruction are not aligned.
      
      Instead of attempting to manage the devlink_port as part of the PF
      structure, manage it as part of the PF VSI. Doing this has advantages,
      as we can match the de-allocation of the devlink_port with the
      unregister_netdev associated with the main PF VSI.
      
      Moving the port to the VSI is preferable as it paves the way for
      handling devlink ports allocated for other purposes such as SR-IOV VFs.
      
      Since we're changing up how we allocate the devlink_port, also change
      the indexing. Originally, we indexed the port using the PF id number.
      This came from an old goal of sharing a devlink for each physical
      function. Managing devlink instances across multiple function drivers is
      not workable. Instead, lets set the port number to the logical port
      number returned by firmware and set the index using the VSI index
      (sometimes referred to as VSI handle).
      Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
      Tested-by: default avatarAaron Brown <aaron.f.brown@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      48d40025