1. 15 Dec, 2015 12 commits
    • Ido Schimmel's avatar
      mlxsw: spectrum: Split vFID range in two · 7f71eb46
      Ido Schimmel authored
      Up until now we used a 1:1 mapping - based on VID - to map a VLAN
      interface to a vFID. However, a different scheme is needed in order to
      support bridges between VLAN interfaces, as all the member interfaces -
      which can have different VIDs - need to share the same vFID.
      
      Solve that by splitting the vFID range in two:
       1. Non-bridged VLAN interfaces
       2. Bridged VLAN interfaces
      
      When a VLAN interface is created, assign it the next available vFID in
      the first range, unless one already exists for that VID or number of
      vFIDs in the range was exceeded. When interface is removed, free the
      vFID, unless other interfaces are mapped to it.
      
      To accomplish the above:
       1. Store the VID to vFID mapping in a new struct (mlxsw_sp_vfid), which
          has a global context and holds a reference count.
       2. Create a vPort (dummy in case of bridge SELF invocation) on top of
          of the physical port and hold a reference to the associated vFID.
      
      	     vfid                    vfid
      	+-------------+	        +-------------+
      	| vfid        |         | vfid        |
      	| vid         +---> ... | vid         |
      	| nr_vports   |         | nr_vports   |
      	+------+------+         +------+------+
      				       |
      	       +-----------------------+-------+
      	       |			       |
      	     vport			     vport
      	+-------------+         	+-------------+
      	| ...	      |         	| ...	      |
      	| *vfid	      +---> ... 	| *vfid	      +---> ...
      	| ...	      |         	| ...	      |
      	+------+------+         	+------+------+
      	       |                               |
      	     port			     port
      	+-------------+         	+-------------+
      	| ...         |         	| ...         |
      	| vports_list |         	| vports_list |
      	| ...         |         	| ...         |
      	+-------------+         	+-------------+
      	     swXpY			     swXpZ
      
      Next patches in the series will add the missing infrastructure for the
      second range and transfer vPorts between the two ranges according to the
      received notifications.
      Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7f71eb46
    • Ido Schimmel's avatar
      mlxsw: spectrum: Allocate active VLANs only for port netdevs · bd40e9d6
      Ido Schimmel authored
      When adding support for bridges between VLAN interfaces, we'll introduce
      a new entity called a vPort, which is a represntation of the VLAN
      interface in the hardware.
      
      The main difference between a vPort and a physical port is that several
      FIDs can be bound to the latter, whereas only one (called a vFID) can be
      bound to the first.
      
      Therefore, it makes sense to use the same struct to represent the two,
      but to only allocate the 'active_vlans' bitmap in case of a physical
      port.
      Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bd40e9d6
    • Ido Schimmel's avatar
      switchdev: Pass original device to port netdev driver · 6ff64f6f
      Ido Schimmel authored
      switchdev drivers need to know the netdev on which the switchdev op was
      invoked. For example, the STP state of a VLAN interface configured on top
      of a port can change while being member in a bridge. In this case, the
      underlying driver should only change the STP state of that particular
      VLAN and not of all the VLANs configured on the port.
      
      However, current switchdev infrastructure only passes the port netdev down
      to the driver. Solve that by passing the original device down to the
      driver as part of the required switchdev object / attribute.
      
      This doesn't entail any change in current switchdev drivers. It simply
      enables those supporting stacked devices to know the originating device
      and act accordingly.
      Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6ff64f6f
    • Ido Schimmel's avatar
      switchdev: vlan: Use switchdev_port* in vlan_netdev_ops · 9d547833
      Ido Schimmel authored
      We need to be able to propagate static FDB entries and certain bridge
      port attributes (e.g. learning, flooding) down to the port netdev
      driver when bridge port is a VLAN interface.
      
      Achieve that by setting ndo_bridge* and ndo_fdb* in vlan_netdev_ops to
      the corresponding switchdev_port* functions. This is consistent with
      team and bond devices.
      Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9d547833
    • David S. Miller's avatar
      Merge branch '1GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue · 335b3209
      David S. Miller authored
      Jeff Kirsher says:
      
      ====================
      1GbE Intel Wired LAN Driver Updates 2015-12-14
      
      This series contains updates to e1000e and igb.
      
      Alex Duyck changes e1000_up() to void since it always returned 0, also
      by making it void, we can drop some code since we no longer have to worry
      about non-zero return values.
      
      Aaron Sierra removes GS40G specific defines and functions since the i210
      internal PHY can be accessed with the access functions shared by 82580,
      i350 and i354 devices.  Also removes the code to add the PHY address into
      the PCDL register address, since there is no real reason to do so.
      
      Joe updates the cable length function reports all four pairs true min, max
      and average cable length for i210.  Also updated ethtool to use enum-based
      labels instead of hard coded values.
      
      Benjamin Poirier cleans up code that is never reachable since MSI-X
      interrupts are not shared in e1000e.  Also removes the ICR read in the
      other interrupt handler, since the information is not needed and IMS is
      configured such that the only link status change can trigger the other
      interrupt handler.  Fixed in MSI-X mode, there is no handler for the LSC
      interrupt so there is no point in writing that to ICS now that we always
      assume other interrupts are caused by LSC.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      335b3209
    • Benjamin Poirier's avatar
      e1000e: Fix msi-x interrupt automask · 0a8047ac
      Benjamin Poirier authored
      Since the introduction of 82574 support in e1000e, the driver has worked
      on the assumption that msi-x interrupt generation is automatically
      disabled after each irq. As it turns out, this is not the case.
      Currently, rx interrupts can fire multiple times before and during napi
      processing. This can be a problem for users because frames that arrive
      in a certain window (after adapter->clean_rx() but before
      napi_complete_done() has cleared NAPI_STATE_SCHED) generate an interrupt
      which does not lead to napi_schedule(). These frames sit in the rx queue
      until another frame arrives (a tcp retransmit for example).
      
      While the EIAC and CTRL_EXT registers are properly configured for irq
      automask, the modification of IAM in e1000_configure_msix() is what
      prevents automask from working as intended.
      
      This patch removes that erroneous write and fixes interrupt rearming for
      tx interrupts. It also clears IAME from CTRL_EXT. This is not strictly
      necessary for operation of the driver but it is to avoid disruption from
      potential programs that access the registers directly, like `ethregs -c`.
      Reported-by: default avatarFrank Steiner <steiner-reg@bio.ifi.lmu.de>
      Signed-off-by: default avatarBenjamin Poirier <bpoirier@suse.com>
      Tested-by: default avatarAaron Brown <aaron.f.brown@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      0a8047ac
    • Benjamin Poirier's avatar
      e1000e: Do not write lsc to ics in msi-x mode · a61cfe4f
      Benjamin Poirier authored
      In msi-x mode, there is no handler for the lsc interrupt so there is no
      point in writing that to ics now that we always assume Other interrupts
      are caused by lsc.
      Reviewed-by: default avatarJasna Hodzic <jhodzic@ucdavis.edu>
      Signed-off-by: default avatarBenjamin Poirier <bpoirier@suse.com>
      Tested-by: default avatarAaron Brown <aaron.f.brown@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      a61cfe4f
    • Benjamin Poirier's avatar
      e1000e: Do not read ICR in Other interrupt · 16ecba59
      Benjamin Poirier authored
      Removes the ICR read in the other interrupt handler, uses EIAC to
      autoclear the Other bit from ICR and IMS. This allows us to avoid
      interference with Rx and Tx interrupts in the Other interrupt handler.
      
      The information read from ICR is not needed. IMS is configured such that
      the only interrupt cause that can trigger the Other interrupt is Link
      Status Change.
      Signed-off-by: default avatarBenjamin Poirier <bpoirier@suse.com>
      Tested-by: default avatarAaron Brown <aaron.f.brown@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      16ecba59
    • Benjamin Poirier's avatar
      e1000e: Remove unreachable code · 4d432f67
      Benjamin Poirier authored
      msi-x interrupts are not shared so there's no need to check if the
      interrupt was really from this adapter.
      Signed-off-by: default avatarBenjamin Poirier <bpoirier@suse.com>
      Tested-by: default avatarAaron Brown <aaron.f.brown@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      4d432f67
    • Gregory CLEMENT's avatar
      net/macb: add support for resetting PHY using GPIO · 5833e052
      Gregory CLEMENT authored
      With device tree it is no more possible to reset the PHY at board
      level. Furthermore, doing in the driver allow to power down the PHY when
      the network interface is no more used.
      
      This reset can't be done at the PHY driver level. The PHY must be able to
      answer the to the mii bus scan to let the kernel creating a PHY device.
      
      The patch introduces a new optional property "phy-reset-gpios" inspired
      from the one use for the FEC.
      Signed-off-by: default avatarGregory CLEMENT <gregory.clement@free-electrons.com>
      Acked-by: default avatarRob Herring <robh@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5833e052
    • Joe Schultz's avatar
      igb: Explicitly label self-test result indices · d602de05
      Joe Schultz authored
      Previously, the ethtool self-test gstrings/data arrays were accessed via
      hardcoded indices, which made the code difficult to follow. This patch
      replaces the hardcoded values with enum-based labels.
      Signed-off-by: default avatarJoe Schultz <jschultz@xes-inc.com>
      Signed-off-by: default avatarAaron Sierra <asierra@xes-inc.com>
      Tested-by: default avatarAaron Brown <aaron.f.brown@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      d602de05
    • Joe Schultz's avatar
      igb: Improve cable length function for I210, etc. · 3627f8f1
      Joe Schultz authored
      Previously, the PHY-specific code to get the cable length for the
      I210 internal and related PHYs was reporting the cable length of a
      single pair and reporting it as the min, max, and total cable length.
      Update it so that all four pairs are checked so the true min, max,
      and average cable lengths are reported.
      Signed-off-by: default avatarJoe Schultz <jschultz@xes-inc.com>
      Signed-off-by: default avatarAaron Sierra <asierra@xes-inc.com>
      Tested-by: default avatarAaron Brown <aaron.f.brown@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      3627f8f1
  2. 14 Dec, 2015 26 commits
  3. 13 Dec, 2015 2 commits