1. 18 7月, 2020 3 次提交
    • E
      net: openvswitch: reorder masks array based on usage · eac87c41
      Eelco Chaudron 提交于
      This patch reorders the masks array every 4 seconds based on their
      usage count. This greatly reduces the masks per packet hit, and
      hence the overall performance. Especially in the OVS/OVN case for
      OpenShift.
      
      Here are some results from the OVS/OVN OpenShift test, which use
      8 pods, each pod having 512 uperf connections, each connection
      sends a 64-byte request and gets a 1024-byte response (TCP).
      All uperf clients are on 1 worker node while all uperf servers are
      on the other worker node.
      
      Kernel without this patch     :  7.71 Gbps
      Kernel with this patch applied: 14.52 Gbps
      
      We also run some tests to verify the rebalance activity does not
      lower the flow insertion rate, which does not.
      Signed-off-by: NEelco Chaudron <echaudro@redhat.com>
      Tested-by: NAndrew Theurer <atheurer@redhat.com>
      Reviewed-by: NPaolo Abeni <pabeni@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      eac87c41
    • C
      net: phy: sfp: Cotsworks SFF module EEPROM fixup · b18432c5
      Chris Healy 提交于
      Some Cotsworks SFF have invalid data in the first few bytes of the
      module EEPROM.  This results in these modules not being detected as
      valid modules.
      
      Address this by poking the correct EEPROM values into the module
      EEPROM when the model/PN match and the existing module EEPROM contents
      are not correct.
      Signed-off-by: NChris Healy <cphealy@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b18432c5
    • V
      net: phy: continue searching for C45 MMDs even if first returned ffff:ffff · bba238ed
      Vladimir Oltean 提交于
      At the time of introduction, in commit bdeced75 ("net: dsa: felix:
      Add PCS operations for PHYLINK"), support for the Lynx PCS inside Felix
      was relying, for USXGMII support, on the fact that get_phy_device() is
      able to parse the Lynx PCS "device-in-package" registers for this C45
      MDIO device and identify it correctly.
      
      However, this was actually working somewhat by mistake (in the sense
      that, even though it was detected, it was detected for the wrong
      reasons).
      
      The get_phy_c45_ids() function works by iterating through all MMDs
      starting from 1 (MDIO_MMD_PMAPMD) and stops at the first one which
      returns a non-zero value in the "device-in-package" register pair,
      proceeding to see what that non-zero value is.
      
      For the Felix PCS, the first MMD (1, for the PMA/PMD) returns a non-zero
      value of 0xffffffff in the "device-in-package" registers. There is a
      code branch which is supposed to treat this case and flag it as wrong,
      and normally, this would have caught my attention when adding initial
      support for this PCS:
      
      	if ((devs_in_pkg & 0x1fffffff) == 0x1fffffff) {
      		/* If mostly Fs, there is no device there, then let's probe
      		 * MMD 0, as some 10G PHYs have zero Devices In package,
      		 * e.g. Cortina CS4315/CS4340 PHY.
      		 */
      
      However, this code never actually kicked in, it seems, because this
      snippet from get_phy_c45_devs_in_pkg() was basically sabotaging itself,
      by returning 0xfffffffe instead of 0xffffffff:
      
      	/* Bit 0 doesn't represent a device, it indicates c22 regs presence */
      	*devices_in_package &= ~BIT(0);
      
      Then the rest of the code just carried on thinking "ok, MMD 1 (PMA/PMD)
      says that there are 31 devices in that package, each having a device id
      of ffff:ffff, that's perfectly fine, let's go ahead and probe this PHY
      device".
      
      But after cleanup commit 320ed3bf ("net: phy: split
      devices_in_package"), this got "fixed", and now devs_in_pkg is no longer
      0xfffffffe, but 0xffffffff. So now, get_phy_device is returning -ENODEV
      for the Lynx PCS, because the semantics have remained mostly unchanged:
      the loop stops at the first MMD that returns a non-zero value, and that
      is MMD 1.
      
      But the Lynx PCS is simply a clause 37 PCS which implements the required
      MAC-side functionality for USXGMII (when operated in C45 mode, which is
      where C45 devices-in-package detection is relevant to). Of course it
      will fail the PMD/PMA test (MMD 1), since it is not a PHY. But it does
      implement detection for MDIO_MMD_PCS (3):
      
      - MDIO_DEVS1=0x008a, MDIO_DEVS2=0x0000,
      - MDIO_DEVID1=0x0083, MDIO_DEVID2=0xe400
      
      Let get_phy_c45_ids() continue searching for valid MMDs, and don't
      assume that every phy_device has a PMA/PMD MMD implemented.
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bba238ed
  2. 17 7月, 2020 10 次提交
    • J
      Merge branch 'net-sched-do-not-drop-root-lock-in-tcf_qevent_handle' · 4291dc1a
      Jakub Kicinski 提交于
      Petr Machata says:
      
      ====================
      net: sched: Do not drop root lock in tcf_qevent_handle()
      
      Mirred currently does not mix well with blocks executed after the qdisc
      root lock is taken. This includes classification blocks (such as in PRIO,
      ETS, DRR qdiscs) and qevents. The locking caused by the packet mirrored by
      mirred can cause deadlocks: either when the thread of execution attempts to
      take the lock a second time, or when two threads end up waiting on each
      other's locks.
      
      The qevent patchset attempted to not introduce further badness of this
      sort, and dropped the lock before executing the qevent block. However this
      lead to too little locking and races between qdisc configuration and packet
      enqueue in the RED qdisc.
      
      Before the deadlock issues are solved in a way that can be applied across
      many qdiscs reasonably easily, do for qevents what is done for the
      classification blocks and just keep holding the root lock.
      
      That is done in patch #1. Patch #2 then drops the now unnecessary root_lock
      argument from Qdisc_ops.enqueue.
      ====================
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      4291dc1a
    • P
      Revert "net: sched: Pass root lock to Qdisc_ops.enqueue" · ac5c66f2
      Petr Machata 提交于
      This reverts commit aebe4426.
      Signed-off-by: NPetr Machata <petrm@mellanox.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      ac5c66f2
    • P
      net: sched: Do not drop root lock in tcf_qevent_handle() · 55f656cd
      Petr Machata 提交于
      Mirred currently does not mix well with blocks executed after the qdisc
      root lock is taken. This includes classification blocks (such as in PRIO,
      ETS, DRR qdiscs) and qevents. The locking caused by the packet mirrored by
      mirred can cause deadlocks: either when the thread of execution attempts to
      take the lock a second time, or when two threads end up waiting on each
      other's locks.
      
      The qevent patchset attempted to not introduce further badness of this
      sort, and dropped the lock before executing the qevent block. However this
      lead to too little locking and races between qdisc configuration and packet
      enqueue in the RED qdisc.
      
      Before the deadlock issues are solved in a way that can be applied across
      many qdiscs reasonably easily, do for qevents what is done for the
      classification blocks and just keep holding the root lock.
      Signed-off-by: NPetr Machata <petrm@mellanox.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      55f656cd
    • V
      net: mscc: ocelot: rethink Kconfig dependencies again · 89e35f66
      Vladimir Oltean 提交于
      Having the users of MSCC_OCELOT_SWITCH_LIB depend on REGMAP_MMIO was a
      bad idea, since that symbol is not user-selectable. So we should have
      kept a 'select REGMAP_MMIO'.
      
      When we do that, we run into 2 more problems:
      
      - By depending on GENERIC_PHY, we are causing a recursive dependency.
        But it looks like GENERIC_PHY has no other dependencies, and other
        drivers select it, so we can select it too:
      
      drivers/of/Kconfig:69:error: recursive dependency detected!
      drivers/of/Kconfig:69:  symbol OF_IRQ depends on IRQ_DOMAIN
      kernel/irq/Kconfig:68:  symbol IRQ_DOMAIN is selected by REGMAP
      drivers/base/regmap/Kconfig:7:  symbol REGMAP default is visible depending on REGMAP_MMIO
      drivers/base/regmap/Kconfig:39: symbol REGMAP_MMIO is selected by MSCC_OCELOT_SWITCH_LIB
      drivers/net/ethernet/mscc/Kconfig:15:   symbol MSCC_OCELOT_SWITCH_LIB is selected by MSCC_OCELOT_SWITCH
      drivers/net/ethernet/mscc/Kconfig:22:   symbol MSCC_OCELOT_SWITCH depends on GENERIC_PHY
      drivers/phy/Kconfig:8:  symbol GENERIC_PHY is selected by PHY_BCM_NS_USB3
      drivers/phy/broadcom/Kconfig:41:        symbol PHY_BCM_NS_USB3 depends on MDIO_BUS
      drivers/net/phy/Kconfig:13:     symbol MDIO_BUS depends on MDIO_DEVICE
      drivers/net/phy/Kconfig:6:      symbol MDIO_DEVICE is selected by PHYLIB
      drivers/net/phy/Kconfig:254:    symbol PHYLIB is selected by ARC_EMAC_CORE
      drivers/net/ethernet/arc/Kconfig:19:    symbol ARC_EMAC_CORE is selected by ARC_EMAC
      drivers/net/ethernet/arc/Kconfig:25:    symbol ARC_EMAC depends on OF_IRQ
      
      - By depending on PHYLIB, we are causing a recursive dependency. PHYLIB
        only has a single dependency, "depends on NETDEVICES", which we are
        already depending on, so we can again hack our way into conformance by
        turning the PHYLIB dependency into a select.
      
      drivers/of/Kconfig:69:error: recursive dependency detected!
      drivers/of/Kconfig:69:  symbol OF_IRQ depends on IRQ_DOMAIN
      kernel/irq/Kconfig:68:  symbol IRQ_DOMAIN is selected by REGMAP
      drivers/base/regmap/Kconfig:7:  symbol REGMAP default is visible depending on REGMAP_MMIO
      drivers/base/regmap/Kconfig:39: symbol REGMAP_MMIO is selected by MSCC_OCELOT_SWITCH_LIB
      drivers/net/ethernet/mscc/Kconfig:15:   symbol MSCC_OCELOT_SWITCH_LIB is selected by MSCC_OCELOT_SWITCH
      drivers/net/ethernet/mscc/Kconfig:22:   symbol MSCC_OCELOT_SWITCH depends on PHYLIB
      drivers/net/phy/Kconfig:254:    symbol PHYLIB is selected by ARC_EMAC_CORE
      drivers/net/ethernet/arc/Kconfig:19:    symbol ARC_EMAC_CORE is selected by ARC_EMAC
      drivers/net/ethernet/arc/Kconfig:25:    symbol ARC_EMAC depends on OF_IRQ
      
      Fixes: f4d0323b ("net: mscc: ocelot: convert MSCC_OCELOT_SWITCH into a library")
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      89e35f66
    • J
      af_packet: TPACKET_V3: replace busy-wait loop · 632ca50f
      John Ogness 提交于
      A busy-wait loop is used to implement waiting for bits to be copied
      from the skb to the kernel buffer before retiring a block. This is
      a problem on PREEMPT_RT because the copying task could be preempted
      by the busy-waiting task and thus live lock in the busy-wait loop.
      
      Replace the busy-wait logic with an rwlock_t. This provides lockdep
      coverage and makes the code RT ready.
      Signed-off-by: NJohn Ogness <john.ogness@linutronix.de>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      632ca50f
    • J
      Merge branch 'net-fec-a-few-improvements' · 999cf8ae
      Jakub Kicinski 提交于
      Sergey Organov says:
      
      ====================
      net: fec: a few improvements
      
      This is a collection of simple improvements that reduce and/or
      simplify code. They got developed out of attempt to use DP83640 PTP
      PHY connected to built-in FEC (that has its own PTP support) of the
      iMX 6SX micro-controller. The primary bug-fix was now submitted
      separately, and this is the rest of the changes.
      
      NOTE: the patches are developed and tested on 4.9.146, and rebased on
      top of recent 'net-next/master', where, besides visual inspection, I
      only tested that they do compile.
      ====================
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      999cf8ae
    • S
      net: fec: replace snprintf() with strlcpy() in fec_ptp_init() · 31bb1a56
      Sergey Organov 提交于
      No need to use snprintf() on a constant string, nor using magic
      constant in the fixed code was a good idea.
      Signed-off-by: NSergey Organov <sorganov@gmail.com>
      Acked-by: NFugang Duan <fugang.duan@nxp.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      31bb1a56
    • S
      net: fec: get rid of redundant code in fec_ptp_set() · 2b803088
      Sergey Organov 提交于
      Code of the form "if(x) x = 0" replaced with "x = 0".
      
      Code of the form "if(x == a) x = a" removed.
      Signed-off-by: NSergey Organov <sorganov@gmail.com>
      Acked-by: NFugang Duan <fugang.duan@nxp.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      2b803088
    • S
      net: fec: initialize clock with 0 rather than current kernel time · 19956034
      Sergey Organov 提交于
      Initializing with 0 makes it much easier to identify time stamps from
      otherwise uninitialized clock.
      
      Initialization of PTP clock with current kernel time makes little sense as
      PTP time scale differs from UTC time scale that kernel time represents.
      It only leads to confusion when no actual PTP initialization happens, as
      these time scales differ in a small integer number of seconds (37 at the
      time of writing.)
      Signed-off-by: NSergey Organov <sorganov@gmail.com>
      Acked-by: NFugang Duan <fugang.duan@nxp.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      19956034
    • S
      net: fec: enable to use PPS feature without time stamping · e53a57e5
      Sergey Organov 提交于
      PPS feature could be useful even when hardware time stamping
      of network packets is not in use, so remove offending check
      for this condition from fec_ptp_enable_pps().
      Signed-off-by: NSergey Organov <sorganov@gmail.com>
      Acked-by: NFugang Duan <fugang.duan@nxp.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      e53a57e5
  3. 16 7月, 2020 26 次提交
  4. 15 7月, 2020 1 次提交