Skip to content
  1. Nov 28, 2020
  2. Nov 26, 2020
    • Jakub Kicinski's avatar
      Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue · 594e31bc
      Jakub Kicinski authored
      
      
      Tony Nguyen says:
      
      ====================
      40GbE Intel Wired LAN Driver Updates 2020-11-24
      
      This series contains updates to i40e and igbvf drivers.
      
      Marek removes a redundant assignment for i40e.
      
      Stefan Assmann corrects reporting of VF link speed for i40e.
      
      Karen revises a couple of error messages to warnings for igbvf as they
      could be misinterpreted as issues when they are not.
      
      v2: Dropped PTP patch as it's being updated.
      
      * '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue:
        igbvf: Refactor traces
        i40e: report correct VF link speed when link state is set to enable
        i40e: remove redundant assignment
      ====================
      
      Link: https://lore.kernel.org/r/20201124165245.2844118-1-anthony.l.nguyen@intel.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      594e31bc
    • Jakub Kicinski's avatar
      Merge branch 'net-dsa-mv88e6xxx-serdes-link-without-phy' · 64088b2a
      Jakub Kicinski authored
      
      
      Chris Packham says:
      
      ====================
      net: dsa: mv88e6xxx: serdes link without phy
      
      This small series gets my hardware into a working state. The key points are to
      make sure we don't force the link and that we ask the MAC for the link status.
      I also have updated my dts to say `phy-mode = "1000base-x";` and `managed =
      "in-band-status";`
      
      I've dropped the patch for the 88E6123 as it's a distraction and I lack
      hardware to do any proper testing with it. Earlier versions are on the mailing
      list if anyone wants to pick it up in the future.
      
      I notice there's a series for mv88e6393x circulating on the netdev mailing
      list. As patch #1 is adding a new device specific op either this series will
      need updating to cover the mv88e6393x or the mv88e6393x series will need
      updating for the new op depenting on which lands first.
      ====================
      
      Link: https://lore.kernel.org/r/20201124043440.28400-1-chris.packham@alliedtelesis.co.nz
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      64088b2a
    • Chris Packham's avatar
      net: dsa: mv88e6xxx: Handle error in serdes_get_regs · 0fd5d79e
      Chris Packham authored
      
      
      If the underlying read operation failed we would end up writing stale
      data to the supplied buffer. This would end up with the last
      successfully read value repeating. Fix this by only writing the data
      when we know the read was good. This will mean that failed values will
      return 0xffff.
      
      Signed-off-by: default avatarChris Packham <chris.packham@alliedtelesis.co.nz>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      0fd5d79e
    • Chris Packham's avatar
      net: dsa: mv88e6xxx: Add serdes interrupt support for MV88E6097 · 5c19bc8b
      Chris Packham authored
      
      
      The MV88E6097 presents the serdes interrupts for ports 8 and 9 via the
      Switch Global 2 registers. There is no additional layer of
      enablinh/disabling the serdes interrupts like other mv88e6xxx switches.
      Even though most of the serdes behaviour is the same as the MV88E6185
      that chip does not provide interrupts for serdes events so unlike
      earlier commits the functions added here are specific to the MV88E6097.
      
      Signed-off-by: default avatarChris Packham <chris.packham@alliedtelesis.co.nz>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      5c19bc8b
    • Chris Packham's avatar
      net: dsa: mv88e6xxx: Support serdes ports on MV88E6097/6095/6185 · f5be107c
      Chris Packham authored
      
      
      Implement serdes_power, serdes_get_lane and serdes_pcs_get_state ops for
      the MV88E6097/6095/6185 so that ports 8 & 9 can be supported as serdes
      ports and directly connected to other network interfaces or to SFPs
      without a PHY.
      
      Signed-off-by: default avatarChris Packham <chris.packham@alliedtelesis.co.nz>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      f5be107c
    • Chris Packham's avatar
      net: dsa: mv88e6xxx: Don't force link when using in-band-status · 4efe7662
      Chris Packham authored
      
      
      When a port is configured with 'managed = "in-band-status"' switch chips
      like the 88E6390 need to propagate the SERDES link state to the MAC
      because the link state is not correctly detected. This causes problems
      on the 88E6185/88E6097 where the link partner won't see link state
      changes because we're forcing the link.
      
      To address this introduce a new device specific op port_sync_link() and
      push the logic from mv88e6xxx_mac_link_up() into that. Provide an
      implementation for the 88E6185 like devices which doesn't force the
      link.
      
      Signed-off-by: default avatarChris Packham <chris.packham@alliedtelesis.co.nz>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      4efe7662
    • Jakub Kicinski's avatar
      Merge branch 'dt-bindings-net-dsa-microchip-convert-ksz-bindings-to-yaml' · 0f614511
      Jakub Kicinski authored
      
      
      Christian Eggers says:
      
      ====================
      dt-bindings: net: dsa: microchip: convert KSZ bindings to yaml
      
      These patches are orginally from the series
      
      "net: dsa: microchip: PTP support for KSZ956x"
      
      As the the device tree conversion to yaml is not really related to the
      PTP patches and the original series is going to take more time than
      I expected, I would like to split this.
      
      Changes (original series -> v1)
      --------------------------------
      - dts: moved "allOf" below "maintainers"
      - dts: use "unevaluatedProperties" instead of "additionalProperties"
      - dts: removed "spi-cpha" and "spi-cpol" flags as the hardware is fixed
      - ksz8795: setup SPI for mode 3
      - ksz9477: dito
      ====================
      
      Link: https://lore.kernel.org/r/20201120112107.16334-1-ceggers@arri.de
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      0f614511
    • Christian Eggers's avatar
      net: dsa: microchip: ksz8795: setup SPI mode · 8c4599f4
      Christian Eggers authored
      
      
      This should be done in the device driver instead of the device tree.
      
      Signed-off-by: default avatarChristian Eggers <ceggers@arri.de>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      8c4599f4
    • Christian Eggers's avatar
      net: dsa: microchip: ksz9477: setup SPI mode · 9ed602ba
      Christian Eggers authored
      
      
      This should be done in the device driver instead of the device tree.
      
      Signed-off-by: default avatarChristian Eggers <ceggers@arri.de>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      9ed602ba
    • Christian Eggers's avatar
      net: dsa: microchip: support for "ethernet-ports" node · 44e53c88
      Christian Eggers authored
      
      
      The dsa.yaml device tree binding allows "ethernet-ports" (preferred) and
      "ports".
      
      Signed-off-by: default avatarChristian Eggers <ceggers@arri.de>
      Reviewed-by: default avatarVladimir Oltean <olteanv@gmail.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      44e53c88
    • Christian Eggers's avatar
      dt-bindings: net: dsa: convert ksz bindings document to yaml · 4f36d977
      Christian Eggers authored
      
      
      Convert the bindings document for Microchip KSZ Series Ethernet switches
      from txt to yaml. Removed spi-cpha and spi-cpol flags is this should be
      handled by the device driver.
      
      Signed-off-by: default avatarChristian Eggers <ceggers@arri.de>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      4f36d977
    • Jakub Kicinski's avatar
      Merge branch 'add-an-assert-in-napi_consume_skb' · 0e1f1cc8
      Jakub Kicinski authored
      
      
      Yunsheng Lin says:
      
      ====================
      Add an assert in napi_consume_skb()
      
      This patch introduces a lockdep_assert_in_softirq() interface and
      uses it to assert the case when napi_consume_skb() is not called in
      the softirq context.
      ====================
      
      Link: https://lore.kernel.org/r/1606214969-97849-1-git-send-email-linyunsheng@huawei.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      0e1f1cc8
    • Yunsheng Lin's avatar
      net: Use lockdep_assert_in_softirq() in napi_consume_skb() · 6454eca8
      Yunsheng Lin authored
      
      
      Use napi_consume_skb() to assert the case when it is not called
      in a atomic softirq context.
      
      Signed-off-by: default avatarYunsheng Lin <linyunsheng@huawei.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      6454eca8
    • Yunsheng Lin's avatar
      lockdep: Introduce in_softirq lockdep assert · 8b5536ad
      Yunsheng Lin authored
      
      
      The current semantic for napi_consume_skb() is that caller need
      to provide non-zero budget when calling from NAPI context, and
      breaking this semantic will cause hard to debug problem, because
      _kfree_skb_defer() need to run in atomic context in order to push
      the skb to the particular cpu' napi_alloc_cache atomically.
      
      So add the lockdep_assert_in_softirq() to assert when the running
      context is not in_softirq, in_softirq means softirq is serving or
      BH is disabled, which has a ambiguous semantics due to the BH
      disabled confusion, so add a comment to emphasize that.
      
      And the softirq context can be interrupted by hard IRQ or NMI
      context, lockdep_assert_in_softirq() need to assert about hard
      IRQ or NMI context too.
      
      Suggested-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarYunsheng Lin <linyunsheng@huawei.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      8b5536ad
    • Rikard Falkeborn's avatar
      soc: qcom: ipa: Constify static qmi structs · b5094a3b
      Rikard Falkeborn authored
      
      
      These are only used as input arguments to qmi_handle_init() which
      accepts const pointers to both qmi_ops and qmi_msg_handler. Make them
      const to allow the compiler to put them in read-only memory.
      
      Signed-off-by: default avatarRikard Falkeborn <rikard.falkeborn@gmail.com>
      Acked-by: default avatarAlex Elder <elder@linaro.org>
      Link: https://lore.kernel.org/r/20201122234031.33432-2-rikard.falkeborn@gmail.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      b5094a3b
    • Paolo Abeni's avatar
      mptcp: be careful on MPTCP-level ack. · fd897679
      Paolo Abeni authored
      
      
      We can enter the main mptcp_recvmsg() loop even when
      no subflows are connected. As note by Eric, that would
      result in a divide by zero oops on ack generation.
      
      Address the issue by checking the subflow status before
      sending the ack.
      
      Additionally protect mptcp_recvmsg() against invocation
      with weird socket states.
      
      v1 -> v2:
       - removed unneeded inline keyword - Jakub
      
      Reported-and-suggested-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
      Fixes: ea4ca586
      
       ("mptcp: refine MPTCP-level ack scheduling")
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Link: https://lore.kernel.org/r/5370c0ae03449239e3d1674ddcfb090cf6f20abe.1606253206.git.pabeni@redhat.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      fd897679
    • Horatiu Vultur's avatar
      bridge: mrp: Implement LC mode for MRP · bfd04232
      Horatiu Vultur authored
      
      
      Extend MRP to support LC mode(link check) for the interconnect port.
      This applies only to the interconnect ring.
      
      Opposite to RC mode(ring check) the LC mode is using CFM frames to
      detect when the link goes up or down and based on that the userspace
      will need to react.
      One advantage of the LC mode over RC mode is that there will be fewer
      frames in the normal rings. Because RC mode generates InTest on all
      ports while LC mode sends CFM frame only on the interconnect port.
      
      All 4 nodes part of the interconnect ring needs to have the same mode.
      And it is not possible to have running LC and RC mode at the same time
      on a node.
      
      Whenever the MIM starts it needs to detect the status of the other 3
      nodes in the interconnect ring so it would send a frame called
      InLinkStatus, on which the clients needs to reply with their link
      status.
      
      This patch adds InLinkStatus frame type and extends existing rules on
      how to forward this frame.
      
      Acked-by: default avatarNikolay Aleksandrov <nikolay@nvidia.com>
      Signed-off-by: default avatarHoratiu Vultur <horatiu.vultur@microchip.com>
      Link: https://lore.kernel.org/r/20201124082525.273820-1-horatiu.vultur@microchip.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      bfd04232
    • Vlad Buslov's avatar
      net: sched: alias action flags with TCA_ACT_ prefix · f460019b
      Vlad Buslov authored
      
      
      Currently both filter and action flags use same "TCA_" prefix which makes
      them hard to distinguish to code and confusing for users. Create aliases
      for existing action flags constants with "TCA_ACT_" prefix.
      
      Signed-off-by: default avatarVlad Buslov <vlad@buslov.dev>
      Link: https://lore.kernel.org/r/20201124164054.893168-1-vlad@buslov.dev
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      f460019b
    • Florian Westphal's avatar
      mptcp: put reference in mptcp timeout timer · b6d69fc8
      Florian Westphal authored
      On close this timer might be scheduled. mptcp uses sk_reset_timer for
      this, so the a reference on the mptcp socket is taken.
      
      This causes a refcount leak which can for example be reproduced
      with 'mp_join_server_v4.pkt' from the mptcp-packetdrill repo.
      
      The leak has nothing to do with join requests, v1_mp_capable_bind_no_cs.pkt
      works too when replacing the last ack mpcapable to v1 instead of v0.
      
      unreferenced object 0xffff888109bba040 (size 2744):
        comm "packetdrill", [..]
        backtrace:
          [..] sk_prot_alloc.isra.0+0x2b/0xc0
          [..] sk_clone_lock+0x2f/0x740
          [..] mptcp_sk_clone+0x33/0x1a0
          [..] subflow_syn_recv_sock+0x2b1/0x690 [..]
      
      Fixes: e16163b6
      
       ("mptcp: refactor shutdown and close")
      Cc: Davide Caratti <dcaratti@redhat.com>
      Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
      Acked-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Link: https://lore.kernel.org/r/20201124162446.11448-1-fw@strlen.de
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      b6d69fc8
    • Antonio Borneo's avatar
      net: phy: realtek: read actual speed on rtl8211f to detect downshift · 4826d2c4
      Antonio Borneo authored
      The rtl8211f supports downshift and before commit 5502b218
      ("net: phy: use phy_resolve_aneg_linkmode in genphy_read_status")
      the read-back of register MII_CTRL1000 was used to detect the
      negotiated link speed.
      The code added in commit d445dff2
      
       ("net: phy: realtek: read
      actual speed to detect downshift") is working fine also for this
      phy and it's trivial re-using it to restore the downshift
      detection on rtl8211f.
      
      Add the phy specific read_status() pointing to the existing
      function rtlgen_read_status().
      
      Signed-off-by: default avatarAntonio Borneo <antonio.borneo@st.com>
      Link: https://lore.kernel.org/r/478f871a-583d-01f1-9cc5-2eea56d8c2a7@huawei.com
      Tested-by: default avatarYonglong Liu <liuyonglong@huawei.com>
      Link: https://lore.kernel.org/r/20201124230756.887925-1-antonio.borneo@st.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      4826d2c4
    • Jakub Kicinski's avatar
      Merge branch 'net-ptp-use-common-defines-for-ptp-message-types-in-further-drivers' · 16d07c38
      Jakub Kicinski authored
      
      
      Christian Eggers says:
      
      ====================
      net: ptp: use common defines for PTP message types in further drivers
      
      This series replaces further driver internal enumeration / uses of magic
      numbers with the newly introduced PTP_MSGTYPE_* defines.
      ====================
      
      Link: https://lore.kernel.org/r/20201124074418.2609-1-ceggers@arri.de
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      16d07c38
    • Christian Eggers's avatar
      net: phy: mscc: use new PTP_MSGTYPE_* defines · 29872216
      Christian Eggers authored
      
      
      Use recently introduced PTP_MSGTYPE_SYNC and PTP_MSGTYPE_DELAY_REQ
      defines instead of a driver internal enumeration.
      
      Signed-off-by: default avatarChristian Eggers <ceggers@arri.de>
      Reviewed-by: default avatarAntoine Tenart <atenart@kernel.org>
      Acked-by: default avatarRichard Cochran <richardcochran@gmail.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      29872216
    • Christian Eggers's avatar
      mlxsw: spectrum_ptp: use PTP wide message type definitions · 37e9d055
      Christian Eggers authored
      
      
      Use recently introduced PTP wide defines instead of a driver internal
      enumeration.
      
      Signed-off-by: default avatarChristian Eggers <ceggers@arri.de>
      Reviewed-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Cc: Petr Machata <petrm@mellanox.com>
      Cc: Jiri Pirko <jiri@nvidia.com>
      Acked-by: default avatarRichard Cochran <richardcochran@gmail.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      37e9d055
    • Christian Eggers's avatar
      net: phy: dp83640: use new PTP_MSGTYPE_SYNC define · 651c814f
      Christian Eggers authored
      
      
      Replace use of magic number with recently introduced define.
      
      Signed-off-by: default avatarChristian Eggers <ceggers@arri.de>
      Reviewed-by: default avatarKurt Kanzenbach <kurt@linutronix.de>
      Acked-by: default avatarRichard Cochran <richardcochran@gmail.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      651c814f
    • Jakub Kicinski's avatar
      Merge branch 'net-phy-add-support-for-shared-interrupts-part-3' · 06254738
      Jakub Kicinski authored
      
      
      Ioana Ciornei says:
      
      ====================
      net: phy: add support for shared interrupts (part 3)
      
      This patch set aims to actually add support for shared interrupts in
      phylib and not only for multi-PHY devices. While we are at it,
      streamline the interrupt handling in phylib.
      
      For a bit of context, at the moment, there are multiple phy_driver ops
      that deal with this subject:
      
      - .config_intr() - Enable/disable the interrupt line.
      
      - .ack_interrupt() - Should quiesce any interrupts that may have been
        fired.  It's also used by phylib in conjunction with .config_intr() to
        clear any pending interrupts after the line was disabled, and before
        it is going to be enabled.
      
      - .did_interrupt() - Intended for multi-PHY devices with a shared IRQ
        line and used by phylib to discern which PHY from the package was the
        one that actually fired the interrupt.
      
      - .handle_interrupt() - Completely overrides the default interrupt
        handling logic from phylib. The PHY driver is responsible for checking
        if any interrupt was fired by the respective PHY and choose
        accordingly if it's the one that should trigger the link state machine.
      
      From my point of view, the interrupt handling in phylib has become
      somewhat confusing with all these callbacks that actually read the same
      PHY register - the interrupt status.  A more streamlined approach would
      be to just move the responsibility to write an interrupt handler to the
      driver (as any other device driver does) and make .handle_interrupt()
      the only way to deal with interrupts.
      
      Another advantage with this approach would be that phylib would gain
      support for shared IRQs between different PHY (not just multi-PHY
      devices), something which at the moment would require extending every
      PHY driver anyway in order to implement their .did_interrupt() callback
      and duplicate the same logic as in .ack_interrupt(). The disadvantage
      of making .did_interrupt() mandatory would be that we are slightly
      changing the semantics of the phylib API and that would increase
      confusion instead of reducing it.
      
      What I am proposing is the following:
      
      - As a first step, make the .ack_interrupt() callback optional so that
        we do not break any PHY driver amid the transition.
      
      - Every PHY driver gains a .handle_interrupt() implementation that, for
        the most part, would look like below:
      
      	irq_status = phy_read(phydev, INTR_STATUS);
      	if (irq_status < 0) {
      		phy_error(phydev);
      		return IRQ_NONE;
      	}
      
      	if (!(irq_status & irq_mask))
      		return IRQ_NONE;
      
      	phy_trigger_machine(phydev);
      
      	return IRQ_HANDLED;
      
      - Remove each PHY driver's implementation of the .ack_interrupt() by
        actually taking care of quiescing any pending interrupts before
        enabling/after disabling the interrupt line.
      
      - Finally, after all drivers have been ported, remove the
        .ack_interrupt() and .did_interrupt() callbacks from phy_driver.
      
      This patch set is part 3 (and final) of the entire change set and it
      addresses the remaining PHY drivers that have not been migrated
      previosly. Also, it finally removed the .did_interrupt() and
      .ack_interrupt() callbacks since they are of no use anymore.
      
      I do not have access to most of these PHY's, therefore I Cc-ed the
      latest contributors to the individual PHY drivers in order to have
      access, hopefully, to more regression testing.
      ====================
      
      Link: https://lore.kernel.org/r/20201123153817.1616814-1-ciorneiioana@gmail.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      06254738