1. 15 1月, 2020 13 次提交
    • A
      net: phy: mscc: macsec initialization · 1bbe0ecc
      Antoine Tenart 提交于
      This patch adds support for initializing the MACsec engine found within
      some Microsemi PHYs. The engine is initialized in a passthrough mode and
      does not modify any incoming or outgoing packet. But thanks to this it
      now can be configured to perform MACsec transformations on packets,
      which will be supported by a future patch.
      
      The MACsec read and write functions are wrapped into two versions: one
      called during the init phase, and the other one later on. This is
      because the init functions in the Microsemi PHY driver are called while
      the MDIO bus lock is taken.
      Signed-off-by: NAntoine Tenart <antoine.tenart@bootlin.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1bbe0ecc
    • A
      net: macsec: add nla support for changing the offloading selection · dcb780fb
      Antoine Tenart 提交于
      MACsec offloading to underlying hardware devices is disabled by default
      (the software implementation is used). This patch adds support for
      changing this setting through the MACsec netlink interface. Many checks
      are done when enabling offloading on a given MACsec interface as there
      are limitations (it must be supported by the hardware, only a single
      interface can be offloaded on a given physical device at a time, rules
      can't be moved for now).
      Signed-off-by: NAntoine Tenart <antoine.tenart@bootlin.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      dcb780fb
    • A
      net: macsec: hardware offloading infrastructure · 3cf3227a
      Antoine Tenart 提交于
      This patch introduces the MACsec hardware offloading infrastructure.
      
      The main idea here is to re-use the logic and data structures of the
      software MACsec implementation. This allows not to duplicate definitions
      and structure storing the same kind of information. It also allows to
      use a unified genlink interface for both MACsec implementations (so that
      the same userspace tool, `ip macsec`, is used with the same arguments).
      The MACsec offloading support cannot be disabled if an interface
      supports it at the moment.
      
      The MACsec configuration is passed to device drivers supporting it
      through macsec_ops which are called from the MACsec genl helpers. Those
      functions call the macsec ops of PHY and Ethernet drivers in two steps:
      a preparation one, and a commit one. The first step is allowed to fail
      and should be used to check if a provided configuration is compatible
      with the features provided by a MACsec engine, while the second step is
      not allowed to fail and should only be used to enable a given MACsec
      configuration. Two extra calls are made: when a virtual MACsec interface
      is created and when it is deleted, so that the hardware driver can stay
      in sync.
      
      The Rx and TX handlers are modified to take in account the special case
      were the MACsec transformation happens in the hardware, whether in a PHY
      or in a MAC, as the packets seen by the networking stack on both the
      physical and MACsec virtual interface are exactly the same. This leads
      to some limitations: the hardware and software implementations can't be
      used on the same physical interface, as the policies would be impossible
      to fulfill (such as strict validation of the frames). Also only a single
      virtual MACsec interface can be offloaded to a physical port supporting
      hardware offloading as it would be impossible to guess onto which
      interface a given packet should go (for ingress traffic).
      
      Another limitation as of now is that the counters and statistics are not
      reported back from the hardware to the software MACsec implementation.
      This isn't an issue when using offloaded MACsec transformations, but it
      should be added in the future so that the MACsec state can be reported
      to the user (which would also improve the debug).
      Signed-off-by: NAntoine Tenart <antoine.tenart@bootlin.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3cf3227a
    • A
      net: phy: add MACsec ops in phy_device · 2e181358
      Antoine Tenart 提交于
      This patch adds a reference to MACsec ops in the phy_device, to allow
      PHYs to support offloading MACsec operations. The phydev lock will be
      held while calling those helpers.
      Signed-off-by: NAntoine Tenart <antoine.tenart@bootlin.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2e181358
    • A
      net: macsec: introduce MACsec ops · 0830e20b
      Antoine Tenart 提交于
      This patch introduces MACsec ops for drivers to support offloading
      MACsec operations.
      Signed-off-by: NAntoine Tenart <antoine.tenart@bootlin.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0830e20b
    • A
      net: macsec: introduce the macsec_context structure · 76564261
      Antoine Tenart 提交于
      This patch introduces the macsec_context structure. It will be used
      in the kernel to exchange information between the common MACsec
      implementation (macsec.c) and the MACsec hardware offloading
      implementations. This structure contains pointers to MACsec specific
      structures which contain the actual MACsec configuration, and to the
      underlying device (phydev for now).
      Signed-off-by: NAntoine Tenart <antoine.tenart@bootlin.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      76564261
    • A
      net: macsec: move some definitions in a dedicated header · c0e4eadf
      Antoine Tenart 提交于
      This patch moves some structure, type and identifier definitions into a
      MACsec specific header. This patch does not modify how the MACsec code
      is running and only move things around. This is a preparation for the
      future MACsec hardware offloading support, which will re-use those
      definitions outside macsec.c.
      Signed-off-by: NAntoine Tenart <antoine.tenart@bootlin.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c0e4eadf
    • D
      Merge branch 'netns-Optimise-netns-ID-lookups' · 169af346
      David S. Miller 提交于
      Guillaume Nault says:
      
      ====================
      netns: Optimise netns ID lookups
      
      Netns ID lookups can be easily protected by RCU, rather than by holding
      a spinlock.
      
      Patch 1 prepares the code, patch 2 does the RCU conversion, and finally
      patch 3 stops disabling BHs on updates (patch 2 makes that unnecessary).
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      169af346
    • G
      netns: don't disable BHs when locking "nsid_lock" · 8d7e5dee
      Guillaume Nault 提交于
      When peernet2id() had to lock "nsid_lock" before iterating through the
      nsid table, we had to disable BHs, because VXLAN can call peernet2id()
      from the xmit path:
        vxlan_xmit() -> vxlan_fdb_miss() -> vxlan_fdb_notify()
          -> __vxlan_fdb_notify() -> vxlan_fdb_info() -> peernet2id().
      
      Now that peernet2id() uses RCU protection, "nsid_lock" isn't used in BH
      context anymore. Therefore, we can safely use plain
      spin_lock()/spin_unlock() and let BHs run when holding "nsid_lock".
      Signed-off-by: NGuillaume Nault <gnault@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8d7e5dee
    • G
      netns: protect netns ID lookups with RCU · 2dce224f
      Guillaume Nault 提交于
      __peernet2id() can be protected by RCU as it only calls idr_for_each(),
      which is RCU-safe, and never modifies the nsid table.
      
      rtnl_net_dumpid() can also do lockless lookups. It does two nested
      idr_for_each() calls on nsid tables (one direct call and one indirect
      call because of rtnl_net_dumpid_one() calling __peernet2id()). The
      netnsid tables are never updated. Therefore it is safe to not take the
      nsid_lock and run within an RCU-critical section instead.
      Signed-off-by: NGuillaume Nault <gnault@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2dce224f
    • G
      netns: Remove __peernet2id_alloc() · 49052941
      Guillaume Nault 提交于
      __peernet2id_alloc() was used for both plain lookups and for netns ID
      allocations (depending the value of '*alloc'). Let's separate lookups
      from allocations instead. That is, integrate the lookup code into
      __peernet2id() and make peernet2id_alloc() responsible for allocating
      new netns IDs when necessary.
      
      This makes it clear that __peernet2id() doesn't modify the idr and
      prepares the code for lockless lookups.
      
      Also, mark the 'net' argument of __peernet2id() as 'const', since we're
      modifying this line.
      Signed-off-by: NGuillaume Nault <gnault@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      49052941
    • G
      mdio_bus: Simplify reset handling and extend to non-DT systems · 62140036
      Geert Uytterhoeven 提交于
      Convert mdiobus_register_reset() from open-coded DT-only optional reset
      handling to reset_control_get_optional_exclusive().  This not only
      simplifies the code, but also adds support for lookup-based resets on
      non-DT systems.
      Signed-off-by: NGeert Uytterhoeven <geert+renesas@glider.be>
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Reviewed-by: NPhilipp Zabel <p.zabel@pengutronix.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      62140036
    • F
      net: phy: Added IRQ print to phylink_bringup_phy() · e27f1787
      Florian Fainelli 提交于
      The information about the PHY attached to the PHYLINK instance is useful
      but is missing the IRQ prints that phy_attached_info() adds.
      phy_attached_info() is a bit long and it would not be possible to use
      phylink_info() anyway.
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e27f1787
  2. 14 1月, 2020 12 次提交
  3. 13 1月, 2020 14 次提交
  4. 12 1月, 2020 1 次提交
    • D
      Merge branch 'hns3-next' · 5c9166f0
      David S. Miller 提交于
      Huazhong Tan says:
      
      ====================
      net: hns3: add some misc update about reset issue
      
      This series includes some misc update relating to reset issue.
      [patch 1/7] & [patch 2/7] splits hclge_reset()/hclgevf_reset()
      into two parts: preparing and rebuilding. Since the procedure
      of FLR should be separated out from the reset task([patch 3/7 &
      patch 3/7]), then the FLR's processing can reuse these codes.
      
      pci_error_handlers.reset_prepare() is void type function, so
      [patch 6/7] & [patch 7/7] factor some codes related to PF
      function reset to make the preparing done before .reset_prepare()
      return.
      
      BTW, [patch 5/7] enlarges the waiting time of reset for matching
      the hardware's.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5c9166f0