Skip to content
  1. Nov 18, 2020
    • Hariprasad Kelam's avatar
      octeontx2-pf: Implement ingress/egress VLAN offload · fd9d7859
      Hariprasad Kelam authored
      
      
      This patch implements egress VLAN offload by appending NIX_SEND_EXT_S
      header to NIX_SEND_HDR_S. The VLAN TCI information is specified
      in the NIX_SEND_EXT_S. The VLAN offload in the ingress path is
      implemented by configuring the NIX_RX_VTAG_ACTION_S to strip and
      capture the outer vlan fields. The NIX PF allocates one MCAM entry
      for Rx VLAN offload.
      
      Signed-off-by: default avatarHariprasad Kelam <hkelam@marvell.com>
      Signed-off-by: default avatarSunil Goutham <sgoutham@marvell.com>
      Signed-off-by: default avatarNaveen Mamindlapalli <naveenm@marvell.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      fd9d7859
    • Vamsi Attunuru's avatar
      octeontx2-af: Modify nix_vtag_cfg mailbox to support TX VTAG entries · 9a946def
      Vamsi Attunuru authored
      
      
      This patch modifies the existing nix_vtag_config mailbox message
      to allocate and free TX VTAG entries as requested by a NIX PF.
      The TX VTAG entries are global resource that shared by all PFs
      and each entry specifies the size of VTAG to insert and the VTAG
      header data to insert. The mailbox response contains the entry
      index which is used by mailbox requester in configuring the
      NPC_TX_VTAG_ACTION for any MCAM entry.
      
      Signed-off-by: default avatarVamsi Attunuru <vattunuru@marvell.com>
      Signed-off-by: default avatarSunil Goutham <sgoutham@marvell.com>
      Signed-off-by: default avatarNaveen Mamindlapalli <naveenm@marvell.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      9a946def
    • Subbaraya Sundeep's avatar
      octeontx2-af: Add debugfs entry to dump the MCAM rules · 4d6beb9c
      Subbaraya Sundeep authored
      
      
      Add debugfs support to dump the MCAM rules installed using
      NPC_INSTALL_FLOW mbox message. Debugfs file can display mcam
      entry, counter if any, flow type and counter hits.
      
      Ethtool will dump the ntuple flows related to the PF only.
      The debugfs file gives systemwide view of the MCAM rules
      installed by all the PF's.
      
      Below is the example output when the debugfs file is read:
      ~ # mount -t debugfs none /sys/kernel/debug
      ~ # cat /sys/kernel/debug/octeontx2/npc/mcam_rules
      
      	Installed by: PF1
      	direction: RX
              mcam entry: 227
      	udp source port 23 mask 0xffff
      	Forward to: PF1 VF0
              action: Direct to queue 0
      	enabled: yes
              counter: 1
              hits: 0
      
      Signed-off-by: default avatarSubbaraya Sundeep <sbhatta@marvell.com>
      Signed-off-by: default avatarSunil Goutham <sgoutham@marvell.com>
      Signed-off-by: default avatarNaveen Mamindlapalli <naveenm@marvell.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      4d6beb9c
    • Hariprasad Kelam's avatar
      octeontx2-pf: Add support for unicast MAC address filtering · 63ee5157
      Hariprasad Kelam authored
      
      
      Add unicast MAC address filtering support using install flow
      message. Total of 8 MCAM entries are allocated for adding
      unicast mac filtering rules. If the MCAM allocation fails,
      the unicast filtering support will not be advertised.
      
      Signed-off-by: default avatarHariprasad Kelam <hkelam@marvell.com>
      Signed-off-by: default avatarSunil Goutham <sgoutham@marvell.com>
      Signed-off-by: default avatarNaveen Mamindlapalli <naveenm@marvell.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      63ee5157
    • Subbaraya Sundeep's avatar
      octeontx2-pf: Add support for ethtool ntuple filters · f0a1913f
      Subbaraya Sundeep authored
      
      
      This patch adds support for adding and deleting ethtool ntuple
      filters. The filters for ether, ipv4, ipv6, tcp, udp and sctp
      are supported. The mask is also supported. The supported actions
      are drop and direct to a queue. Additionally we support FLOW_EXT
      field vlan_tci and FLOW_MAC_EXT.
      
      The NIX PF will allocate total 32 MCAM entries for the use of
      ethtool ntuple filters. The Administrative Function(AF) will
      install/delete the MCAM rules when NIX PF sends mailbox message
      to install/delete the ntuple filters.
      
      Ethtool ntuple filters support is restricted to PFs as of now
      and PF can install ntuple filters to direct the traffic to its
      VFs. Hence added a separate callback for VFs to get/set RSS
      configuration.
      
      Signed-off-by: default avatarSubbaraya Sundeep <sbhatta@marvell.com>
      Signed-off-by: default avatarSunil Goutham <sgoutham@marvell.com>
      Signed-off-by: default avatarNaveen Mamindlapalli <naveenm@marvell.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      f0a1913f
    • Subbaraya Sundeep's avatar
      octeontx2-af: Add mbox messages to install and delete MCAM rules · 55307fcb
      Subbaraya Sundeep authored
      
      
      Added new mailbox messages to install and delete MCAM rules.
      These mailbox messages will be used for adding/deleting ethtool
      n-tuple filters by NIX PF. The installed MCAM rules are stored
      in a list that will be traversed later to delete the MCAM entries
      when the interface is brought down or when PCIe FLR is received.
      The delete mailbox supports deleting a single MCAM entry or range
      of entries or all the MCAM entries owned by the pcifunc. Each MCAM
      entry can be associated with a HW match stat entry if the mailbox
      requester wants to check the hit count for debugging.
      
      Modified adding default unicast DMAC match rule using install
      flow API. The default unicast DMAC match entry installed by
      Administrative Function is saved and can be changed later by the
      mailbox user to fit additional fields, or the default MCAM entry
      rule action can be used for other flow rules installed later.
      
      Modified rvu_mbox_handler_nix_lf_free mailbox to add a flag to
      disable or delete the MCAM entries. The MCAM entries are disabled
      when the interface is brought down and deleted in FLR handler.
      The disabled MCAM entries will be re-enabled when the interface
      is brought up again.
      
      Signed-off-by: default avatarSubbaraya Sundeep <sbhatta@marvell.com>
      Signed-off-by: default avatarSunil Goutham <sgoutham@marvell.com>
      Signed-off-by: default avatarNaveen Mamindlapalli <naveenm@marvell.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      55307fcb
    • Subbaraya Sundeep's avatar
      octeontx2-af: Generate key field bit mask from KEX profile · 9b179a96
      Subbaraya Sundeep authored
      
      
      Key Extraction(KEX) profile decides how the packet metadata such as
      layer information and selected packet data bytes at each layer are
      placed in MCAM search key. This patch reads the configured KEX profile
      parameters to find out the bit position and bit mask for each field.
      The information is used when programming the MCAM match data by SW
      to match a packet flow and take appropriate action on the flow. This
      patch also verifies the mandatory fields such as channel and DMAC
      are not overwritten by the KEX configuration of other fields.
      
      Signed-off-by: default avatarSubbaraya Sundeep <sbhatta@marvell.com>
      Signed-off-by: default avatarSunil Goutham <sgoutham@marvell.com>
      Signed-off-by: default avatarNaveen Mamindlapalli <naveenm@marvell.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      9b179a96
    • Subbaraya Sundeep's avatar
      octeontx2-af: Verify MCAM entry channel and PF_FUNC · 041a1c17
      Subbaraya Sundeep authored
      
      
      This patch adds support to verify the channel number sent by
      mailbox requester before writing MCAM entry for Ingress packets.
      Similarly for Egress packets, verifying the PF_FUNC sent by the
      mailbox user.
      
      Signed-off-by: default avatarSubbaraya Sundeep <sbhatta@marvell.com>
      Signed-off-by: default avatarKiran Kumar K <kirankumark@marvell.com>
      Signed-off-by: default avatarSunil Goutham <sgoutham@marvell.com>
      Signed-off-by: default avatarNaveen Mamindlapalli <naveenm@marvell.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      041a1c17
    • Stanislaw Kardach's avatar
      octeontx2-af: Modify default KEX profile to extract TX packet fields · f1517f6f
      Stanislaw Kardach authored
      
      
      The current default Key Extraction(KEX) profile can only use RX
      packet fields while generating the MCAM search key. The profile
      can't be used for matching TX packet fields. This patch modifies
      the default KEX profile to add support for extracting TX packet
      fields into MCAM search key. Enabled Tx KPU packet parsing by
      configuring TX PKIND in tx_parse_cfg.
      
      Modified the KEX profile to extract 2 bytes of VLAN TCI from an
      offset of 2 bytes from LB_PTR. The LB_PTR points to the byte offset
      where the VLAN header starts. The NPC KPU parser profile has been
      modified to point LB_PTR to the starting byte offset of VLAN header
      which points to the tpid field.
      
      Signed-off-by: default avatarStanislaw Kardach <skardach@marvell.com>
      Signed-off-by: default avatarSunil Goutham <sgoutham@marvell.com>
      Signed-off-by: default avatarNaveen Mamindlapalli <naveenm@marvell.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      f1517f6f
    • Xie He's avatar
      net: wan: Delete the DLCI / SDLA drivers · f7365919
      Xie He authored
      The DLCI driver (dlci.c) implements the Frame Relay protocol. However,
      we already have another newer and better implementation of Frame Relay
      provided by the HDLC_FR driver (hdlc_fr.c).
      
      The DLCI driver's implementation of Frame Relay is used by only one
      hardware driver in the kernel - the SDLA driver (sdla.c).
      
      The SDLA driver provides Frame Relay support for the Sangoma S50x devices.
      However, the vendor provides their own driver (along with their own
      multi-WAN-protocol implementations including Frame Relay), called WANPIPE.
      I believe most users of the hardware would use the vendor-provided WANPIPE
      driver instead.
      
      (The WANPIPE driver was even once in the kernel, but was deleted in
      commit 8db60bcf
      
       ("[WAN]: Remove broken and unmaintained Sangoma
      drivers.") because the vendor no longer updated the in-kernel WANPIPE
      driver.)
      
      Cc: Mike McLagan <mike.mclagan@linux.org>
      Signed-off-by: default avatarXie He <xie.he.0141@gmail.com>
      Link: https://lore.kernel.org/r/20201114150921.685594-1-xie.he.0141@gmail.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      f7365919
    • Jakub Kicinski's avatar
      Merge branch 'net-hns3-updates-for-next' · fccf111e
      Jakub Kicinski authored
      
      
      Huazhong Tan says:
      
      ====================
      net: hns3: updates for -next
      
      There are several updates relating to the interrupt coalesce for
      the HNS3 ethernet driver.
      
         based on the frame quantity).
         a fixed value in code.
         based on the gap time).
         its new usage.
      
      change log:
      V4 - remove #5~#10 from this series, which needs more discussion.
      V3 - fix a typo error in #1 reported by Jakub Kicinski.
           rewrite #9 commit log.
           remove #11 from this series.
      V2 - reorder #2 & #3 to fix compiler error.
           fix some checkpatch warnings in #10 & #11.
      
      previous version:
      V3: https://patchwork.ozlabs.org/project/netdev/cover/1605151998-12633-1-git-send-email-tanhuazhong@huawei.com/
      V2: https://patchwork.ozlabs.org/project/netdev/cover/1604892159-19990-1-git-send-email-tanhuazhong@huawei.com/
      V1: https://patchwork.ozlabs.org/project/netdev/cover/1604730681-32559-1-git-send-email-tanhuazhong@huawei.com/
      ====================
      
      Link: https://lore.kernel.org/r/1605514854-11205-1-git-send-email-tanhuazhong@huawei.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      fccf111e
    • Huazhong Tan's avatar
      net: hns3: rename gl_adapt_enable in struct hns3_enet_coalesce · de25bcc4
      Huazhong Tan authored
      
      
      Besides GL(Gap Limiting), QL(Quantity Limiting) can be modified
      dynamically when DIM is supported. So rename gl_adapt_enable as
      adapt_enable in struct hns3_enet_coalesce.
      
      Signed-off-by: default avatarHuazhong Tan <tanhuazhong@huawei.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      de25bcc4
    • Huazhong Tan's avatar
      net: hns3: add support for 1us unit GL configuration · 5ac84b02
      Huazhong Tan authored
      
      
      For device whose version is above V3(include V3), the GL
      configuration can set as 1us unit, so adds support for
      configuring this field.
      
      Signed-off-by: default avatarHuazhong Tan <tanhuazhong@huawei.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      5ac84b02
    • Huazhong Tan's avatar
      net: hns3: add support for querying maximum value of GL · ab16b49c
      Huazhong Tan authored
      
      
      For maintainability and compatibility, add support for querying
      the maximum value of GL.
      
      Signed-off-by: default avatarHuazhong Tan <tanhuazhong@huawei.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      ab16b49c
    • Huazhong Tan's avatar
      net: hns3: add support for configuring interrupt quantity limiting · 91bfae25
      Huazhong Tan authored
      
      
      QL(quantity limiting) means that hardware supports the interrupt
      coalesce based on the frame quantity.  QL can be configured when
      int_ql_max in device's specification is non-zero, so add support
      to configure it. Also, rename two coalesce init function to fit
      their purpose.
      
      Signed-off-by: default avatarHuazhong Tan <tanhuazhong@huawei.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      91bfae25
    • Jakub Kicinski's avatar
      Merge branch 'net-phy-add-support-for-shared-interrupts-part-2' · 0676a4ea
      Jakub Kicinski authored
      
      
      Ioana Ciornei says:
      
      ====================
      net: phy: add support for shared interrupts (part 2)
      
      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 2 of the entire change set and it addresses the
      changes needed in 9 PHY drivers. The rest can be found on my Github
      branch here:
      https://github.com/IoanaCiornei/linux/commits/phylib-shared-irq
      ====================
      
      Link: https://lore.kernel.org/r/20201113165226.561153-1-ciorneiioana@gmail.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      0676a4ea
    • Ioana Ciornei's avatar
      net: phy: adin: remove the use of the .ack_interrupt() · 1d8300d3
      Ioana Ciornei authored
      
      
      In preparation of removing the .ack_interrupt() callback, we must replace
      its occurrences (aka phy_clear_interrupt), from the 2 places where it is
      called from (phy_enable_interrupts and phy_disable_interrupts), with
      equivalent functionality.
      
      This means that clearing interrupts now becomes something that the PHY
      driver is responsible of doing, before enabling interrupts and after
      clearing them. Make this driver follow the new contract.
      
      Signed-off-by: default avatarIoana Ciornei <ioana.ciornei@nxp.com>
      Acked-by: default avatarAlexandru Ardelean <alexandru.ardelean@analog.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      1d8300d3
    • Ioana Ciornei's avatar
      net: phy: adin: implement generic .handle_interrupt() callback · 66d7439e
      Ioana Ciornei authored
      
      
      In an attempt to actually support shared IRQs in phylib, we now move the
      responsibility of triggering the phylib state machine or just returning
      IRQ_NONE, based on the IRQ status register, to the PHY driver. Having
      3 different IRQ handling callbacks (.handle_interrupt(),
      .did_interrupt() and .ack_interrupt() ) is confusing so let the PHY
      driver implement directly an IRQ handler like any other device driver.
      Make this driver follow the new convention.
      
      Signed-off-by: default avatarIoana Ciornei <ioana.ciornei@nxp.com>
      Acked-by: default avatarAlexandru Ardelean <alexandru.ardelean@analog.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      66d7439e
    • Ioana Ciornei's avatar
      net: phy: ste10Xp: remove the use of .ack_interrupt() · e1bc534d
      Ioana Ciornei authored
      
      
      In preparation of removing the .ack_interrupt() callback, we must replace
      its occurrences (aka phy_clear_interrupt), from the 2 places where it is
      called from (phy_enable_interrupts and phy_disable_interrupts), with
      equivalent functionality.
      
      This means that clearing interrupts now becomes something that the PHY
      driver is responsible of doing, before enabling interrupts and after
      clearing them. Make this driver follow the new contract.
      
      Signed-off-by: default avatarIoana Ciornei <ioana.ciornei@nxp.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      e1bc534d
    • Ioana Ciornei's avatar
      net: phy: ste10Xp: implement generic .handle_interrupt() callback · 80ca9ee7
      Ioana Ciornei authored
      
      
      In an attempt to actually support shared IRQs in phylib, we now move the
      responsibility of triggering the phylib state machine or just returning
      IRQ_NONE, based on the IRQ status register, to the PHY driver. Having
      3 different IRQ handling callbacks (.handle_interrupt(),
      .did_interrupt() and .ack_interrupt() ) is confusing so let the PHY
      driver implement directly an IRQ handler like any other device driver.
      Make this driver follow the new convention.
      
      Signed-off-by: default avatarIoana Ciornei <ioana.ciornei@nxp.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      80ca9ee7
    • Ioana Ciornei's avatar
      net: phy: smsc: remove the use of .ack_interrupt() · 824ef51f
      Ioana Ciornei authored
      
      
      In preparation of removing the .ack_interrupt() callback, we must replace
      its occurrences (aka phy_clear_interrupt), from the 2 places where it is
      called from (phy_enable_interrupts and phy_disable_interrupts), with
      equivalent functionality.
      
      This means that clearing interrupts now becomes something that the PHY
      driver is responsible of doing, before enabling interrupts and after
      clearing them. Make this driver follow the new contract.
      
      Cc: Andre Edich <andre.edich@microchip.com>
      Cc: Marco Felsch <m.felsch@pengutronix.de>
      Signed-off-by: default avatarIoana Ciornei <ioana.ciornei@nxp.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      824ef51f
    • Ioana Ciornei's avatar
      net: phy: smsc: implement generic .handle_interrupt() callback · 36b25c26
      Ioana Ciornei authored
      
      
      In an attempt to actually support shared IRQs in phylib, we now move the
      responsibility of triggering the phylib state machine or just returning
      IRQ_NONE, based on the IRQ status register, to the PHY driver. Having
      3 different IRQ handling callbacks (.handle_interrupt(),
      .did_interrupt() and .ack_interrupt() ) is confusing so let the PHY
      driver implement directly an IRQ handler like any other device driver.
      Make this driver follow the new convention.
      
      Cc: Andre Edich <andre.edich@microchip.com>
      Cc: Marco Felsch <m.felsch@pengutronix.de>
      Signed-off-by: default avatarIoana Ciornei <ioana.ciornei@nxp.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      36b25c26
    • Ioana Ciornei's avatar
      net: phy: amd: remove the use of .ack_interrupt() · 347917c7
      Ioana Ciornei authored
      
      
      In preparation of removing the .ack_interrupt() callback, we must replace
      its occurrences (aka phy_clear_interrupt), from the 2 places where it is
      called from (phy_enable_interrupts and phy_disable_interrupts), with
      equivalent functionality.
      
      This means that clearing interrupts now becomes something that the PHY
      driver is responsible of doing, before enabling interrupts and after
      clearing them. Make this driver follow the new contract.
      
      Signed-off-by: default avatarIoana Ciornei <ioana.ciornei@nxp.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      347917c7
    • Ioana Ciornei's avatar
      net: phy: amd: implement generic .handle_interrupt() callback · d995a36b
      Ioana Ciornei authored
      
      
      In an attempt to actually support shared IRQs in phylib, we now move the
      responsibility of triggering the phylib state machine or just returning
      IRQ_NONE, based on the IRQ status register, to the PHY driver. Having
      3 different IRQ handling callbacks (.handle_interrupt(),
      .did_interrupt() and .ack_interrupt() ) is confusing so let the PHY
      driver implement directly an IRQ handler like any other device driver.
      Make this driver follow the new convention.
      
      Signed-off-by: default avatarIoana Ciornei <ioana.ciornei@nxp.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      d995a36b
    • Ioana Ciornei's avatar
      net: phy: nxp-tja11xx: remove the use of .ack_interrupt() · 45f52f12
      Ioana Ciornei authored
      
      
      In preparation of removing the .ack_interrupt() callback, we must replace
      its occurrences (aka phy_clear_interrupt), from the 2 places where it is
      called from (phy_enable_interrupts and phy_disable_interrupts), with
      equivalent functionality.
      
      This means that clearing interrupts now becomes something that the PHY
      driver is responsible of doing, before enabling interrupts and after
      clearing them. Make this driver follow the new contract.
      
      Cc: Marek Vasut <marex@denx.de>
      Cc: Oleksij Rempel <o.rempel@pengutronix.de>
      Signed-off-by: default avatarIoana Ciornei <ioana.ciornei@nxp.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      45f52f12
    • Ioana Ciornei's avatar
      net: phy: nxp-tja11xx: implement generic .handle_interrupt() callback · 52b1984a
      Ioana Ciornei authored
      
      
      In an attempt to actually support shared IRQs in phylib, we now move the
      responsibility of triggering the phylib state machine or just returning
      IRQ_NONE, based on the IRQ status register, to the PHY driver. Having
      3 different IRQ handling callbacks (.handle_interrupt(),
      .did_interrupt() and .ack_interrupt() ) is confusing so let the PHY
      driver implement directly an IRQ handler like any other device driver.
      Make this driver follow the new convention.
      
      Cc: Marek Vasut <marex@denx.de>
      Cc: Oleksij Rempel <o.rempel@pengutronix.de>
      Signed-off-by: default avatarIoana Ciornei <ioana.ciornei@nxp.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      52b1984a
    • Ioana Ciornei's avatar
      net: phy: lxt: remove the use of .ack_interrupt() · 9a12dd6f
      Ioana Ciornei authored
      
      
      In preparation of removing the .ack_interrupt() callback, we must replace
      its occurrences (aka phy_clear_interrupt), from the 2 places where it is
      called from (phy_enable_interrupts and phy_disable_interrupts), with
      equivalent functionality.
      
      This means that clearing interrupts now becomes something that the PHY
      driver is responsible of doing, before enabling interrupts and after
      clearing them. Make this driver follow the new contract.
      
      Cc: Christophe Leroy <christophe.leroy@c-s.fr>
      Signed-off-by: default avatarIoana Ciornei <ioana.ciornei@nxp.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      9a12dd6f
    • Ioana Ciornei's avatar
      net: phy: lxt: implement generic .handle_interrupt() callback · 01c4a00b
      Ioana Ciornei authored
      
      
      In an attempt to actually support shared IRQs in phylib, we now move the
      responsibility of triggering the phylib state machine or just returning
      IRQ_NONE, based on the IRQ status register, to the PHY driver. Having
      3 different IRQ handling callbacks (.handle_interrupt(),
      .did_interrupt() and .ack_interrupt() ) is confusing so let the PHY
      driver implement directly an IRQ handler like any other device driver.
      Make this driver follow the new convention.
      
      Cc: Christophe Leroy <christophe.leroy@c-s.fr>
      Signed-off-by: default avatarIoana Ciornei <ioana.ciornei@nxp.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      01c4a00b
    • Ioana Ciornei's avatar
      net: phy: marvell: remove the use of .ack_interrupt() · 1f6d0f26
      Ioana Ciornei authored
      
      
      In preparation of removing the .ack_interrupt() callback, we must replace
      its occurrences (aka phy_clear_interrupt), from the 2 places where it is
      called from (phy_enable_interrupts and phy_disable_interrupts), with
      equivalent functionality.
      
      This means that clearing interrupts now becomes something that the PHY
      driver is responsible of doing, before enabling interrupts and after
      clearing them. Make this driver follow the new contract.
      
      Cc: Maxim Kochetkov <fido_max@inbox.ru>
      Cc: Baruch Siach <baruch@tkos.co.il>
      Cc: Robert Hancock <robert.hancock@calian.com>
      Signed-off-by: default avatarIoana Ciornei <ioana.ciornei@nxp.com>
      Tested-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      1f6d0f26
    • Ioana Ciornei's avatar
      net: phy: marvell: implement generic .handle_interrupt() callback · a0723b37
      Ioana Ciornei authored
      
      
      In an attempt to actually support shared IRQs in phylib, we now move the
      responsibility of triggering the phylib state machine or just returning
      IRQ_NONE, based on the IRQ status register, to the PHY driver. Having
      3 different IRQ handling callbacks (.handle_interrupt(),
      .did_interrupt() and .ack_interrupt() ) is confusing so let the PHY
      driver implement directly an IRQ handler like any other device driver.
      Make this driver follow the new convention.
      
      Cc: Maxim Kochetkov <fido_max@inbox.ru>
      Cc: Baruch Siach <baruch@tkos.co.il>
      Cc: Robert Hancock <robert.hancock@calian.com>
      Signed-off-by: default avatarIoana Ciornei <ioana.ciornei@nxp.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      a0723b37
    • Ioana Ciornei's avatar
      net: phy: microchip: remove the use of .ack_interrupt() · cf499391
      Ioana Ciornei authored
      
      
      In preparation of removing the .ack_interrupt() callback, we must replace
      its occurrences (aka phy_clear_interrupt), from the 2 places where it is
      called from (phy_enable_interrupts and phy_disable_interrupts), with
      equivalent functionality.
      
      This means that clearing interrupts now becomes something that the PHY
      driver is responsible of doing, before enabling interrupts and after
      clearing them. Make this driver follow the new contract.
      
      Cc: Nisar Sayed <Nisar.Sayed@microchip.com>
      Cc: Yuiko Oshino <yuiko.oshino@microchip.com>
      Signed-off-by: default avatarIoana Ciornei <ioana.ciornei@nxp.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      cf499391
    • Ioana Ciornei's avatar
      net: phy: microchip: implement generic .handle_interrupt() callback · e01a3feb
      Ioana Ciornei authored
      
      
      In an attempt to actually support shared IRQs in phylib, we now move the
      responsibility of triggering the phylib state machine or just returning
      IRQ_NONE, based on the IRQ status register, to the PHY driver. Having
      3 different IRQ handling callbacks (.handle_interrupt(),
      .did_interrupt() and .ack_interrupt() ) is confusing so let the PHY
      driver implement directly an IRQ handler like any other device driver.
      Make this driver follow the new convention.
      
      Cc: Nisar Sayed <Nisar.Sayed@microchip.com>
      Cc: Yuiko Oshino <yuiko.oshino@microchip.com>
      Signed-off-by: default avatarIoana Ciornei <ioana.ciornei@nxp.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      e01a3feb
    • Ioana Ciornei's avatar
      net: phy: vitesse: remove the use of .ack_interrupt() · e96a0d97
      Ioana Ciornei authored
      
      
      In preparation of removing the .ack_interrupt() callback, we must replace
      its occurrences (aka phy_clear_interrupt), from the 2 places where it is
      called from (phy_enable_interrupts and phy_disable_interrupts), with
      equivalent functionality.
      
      This means that clearing interrupts now becomes something that the PHY
      driver is responsible of doing, before enabling interrupts and after
      clearing them. Make this driver follow the new contract.
      
      Cc: Kavya Sree Kotagiri <kavyasree.kotagiri@microchip.com>
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Signed-off-by: default avatarIoana Ciornei <ioana.ciornei@nxp.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      e96a0d97
    • Ioana Ciornei's avatar
      net: phy: vitesse: implement generic .handle_interrupt() callback · b606ad8f
      Ioana Ciornei authored
      
      
      In an attempt to actually support shared IRQs in phylib, we now move the
      responsibility of triggering the phylib state machine or just returning
      IRQ_NONE, based on the IRQ status register, to the PHY driver. Having
      3 different IRQ handling callbacks (.handle_interrupt(),
      .did_interrupt() and .ack_interrupt() ) is confusing so let the PHY
      driver implement directly an IRQ handler like any other device driver.
      Make this driver follow the new convention.
      
      Cc: Kavya Sree Kotagiri <kavyasree.kotagiri@microchip.com>
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Signed-off-by: default avatarIoana Ciornei <ioana.ciornei@nxp.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      b606ad8f
    • Randy Dunlap's avatar
      net: linux/skbuff.h: combine SKB_EXTENSIONS + KCOV handling · 97f53a08
      Randy Dunlap authored
      The previous Kconfig patch led to some other build errors as
      reported by the 0day bot and my own overnight build testing.
      
      These are all in <linux/skbuff.h> when KCOV is enabled but
      SKB_EXTENSIONS is not enabled, so fix those by combining those conditions
      in the header file.
      
      Fixes: 6370cc3b ("net: add kcov handle to skb extensions")
      Fixes: 85ce50d3
      
       ("net: kcov: don't select SKB_EXTENSIONS when there is no NET")
      Signed-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Cc: Aleksandr Nogikh <nogikh@google.com>
      Cc: Willem de Bruijn <willemb@google.com>
      Acked-by: default avatarFlorian Westphal <fw@strlen.de>
      Link: https://lore.kernel.org/r/20201116212108.32465-1-rdunlap@infradead.org
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      97f53a08
    • Sven Van Asbroeck's avatar
      lan743x: replace devicetree phy parse code with library function · 7c3e2b77
      Sven Van Asbroeck authored
      
      
      The code in this driver which parses the devicetree to determine
      the phy/fixed link setup, can be replaced by a single library
      function: of_phy_get_and_connect().
      
      Behaviour is identical, except that the library function will
      complain when 'phy-connection-type' is omitted, instead of
      blindly using PHY_INTERFACE_MODE_NA, which would result in an
      invalid phy configuration.
      
      The library function no longer brings out the exact phy_mode,
      but the driver doesn't need this, because phy_interface_is_rgmii()
      queries the phydev directly. Remove 'phy_mode' from the private
      adapter struct.
      
      While we're here, log info about the attached phy on connect,
      this is useful because the phy type and connection method is now
      fully configurable via the devicetree.
      
      Tested on a lan7430 chip with built-in phy. Verified that adding
      fixed-link/phy-connection-type in the devicetree results in a
      fixed-link setup. Used ethtool to verify that the devicetree
      settings are used.
      
      Tested-by: Sven Van Asbroeck <thesven73@gmail.com> # lan7430
      Signed-off-by: default avatarSven Van Asbroeck <thesven73@gmail.com>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Link: https://lore.kernel.org/r/20201116170155.26967-1-TheSven73@gmail.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      7c3e2b77
    • Heiner Kallweit's avatar
      net: phy: don't duplicate driver name in phy_attached_print · a98cabdb
      Heiner Kallweit authored
      
      
      Currently we print the driver name twice in phy_attached_print():
      - phy_dev_info() prints it as part of the device info
      - and we print it as part of the info string
      
      This is a little bit ugly, it makes the info harder to read,
      especially if the driver name is a little bit longer.
      Therefore omit the driver name (if set) in the info string.
      
      Example from r8169 that uses phylib:
      
      old: Generic FE-GE Realtek PHY r8169-300:00: attached PHY driver \
         [Generic FE-GE Realtek PHY] (mii_bus:phy_addr=r8169-300:00, irq=IGNORE)
      new: Generic FE-GE Realtek PHY r8169-300:00: attached PHY driver \
         (mii_bus:phy_addr=r8169-300:00, irq=IGNORE)
      
      Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Link: https://lore.kernel.org/r/8ab72586-f079-41d8-84ee-9f6a5bd97b2a@gmail.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      a98cabdb
    • Heiner Kallweit's avatar
      r8169: remove nr_frags argument from rtl_tx_slots_avail · 83c317d7
      Heiner Kallweit authored
      
      
      The only time when nr_frags isn't SKB_MAX_FRAGS is when entering
      rtl8169_start_xmit(). However we can use SKB_MAX_FRAGS also here
      because when queue isn't stopped there should always be room for
      MAX_SKB_FRAGS + 1 descriptors.
      
      Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
      Link: https://lore.kernel.org/r/3d1f2ad7-31d5-2cac-4f4a-394f8a3cab63@gmail.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      83c317d7
    • kernel test robot's avatar
      net: phy: mscc: fix excluded_middle.cocci warnings · b618c327
      kernel test robot authored
      
      
      Condition !A || A && B is equivalent to !A || B.
      
      Generated by: scripts/coccinelle/misc/excluded_middle.cocci
      
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Signed-off-by: default avatarkernel test robot <lkp@intel.com>
      Signed-off-by: default avatarJulia Lawall <julia.lawall@inria.fr>
      Reviewed-by: default avatarAntoine Tenart <atenart@kernel.org>
      Link: https://lore.kernel.org/r/alpine.DEB.2.22.394.2011161633240.2682@hadrien
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      b618c327
    • Jakub Kicinski's avatar
      Merge branch 'net-dsa-tag_dsa-unify-regular-and-ethertype-dsa-taggers' · f85cd064
      Jakub Kicinski authored
      
      
      Tobias Waldekranz says:
      
      ====================
      net: dsa: tag_dsa: Unify regular and ethertype DSA taggers
      
      The first patch ports tag_edsa.c's handling of IGMP/MLD traps to
      tag_dsa.c. That way, we start from two logically equivalent taggers
      that are then merged. The second commit does the heavy lifting of
      actually fusing tag_dsa.c and tag_edsa.c. The final one just follows
      up with some clean up of existing comments.
      
      v2 -> v3:
        - Add the first patch described above as suggested by Andrew.
        - Better documentation of TO_SNIFFER and FORWARD tags.
        - Spelling.
      
      v1 -> v2:
        - Fixed some grammar and whitespace errors.
        - Removed unnecessary default value in Kconfig.
        - Removed unnecessary #ifdef.
        - Split out comment fixes from functional changes.
        - Fully document enum dsa_code.
      ====================
      
      Link: https://lore.kernel.org/r/20201114234558.31203-1-tobias@waldekranz.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      f85cd064