1. 27 Jul, 2020 34 commits
    • Edward Cree's avatar
      sfc_ef100: implement MCDI transport · 2200e6d9
      Edward Cree authored
      Signed-off-by: default avatarEdward Cree <ecree@solarflare.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2200e6d9
    • Edward Cree's avatar
      sfc_ef100: don't call efx_reset_down()/up() on EF100 · 35a36af8
      Edward Cree authored
      We handle everything ourselves in ef100_reset(), rather than relying on
       the generic down/up routines.
      Signed-off-by: default avatarEdward Cree <ecree@solarflare.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      35a36af8
    • Edward Cree's avatar
      sfc_ef100: PHY probe stub · aa86a75f
      Edward Cree authored
      We can't actually do the MCDI to probe it fully until we have working
       MCDI, which comes later, but we need efx->phy_data to be allocated so
       that when we get MCDI events the link-state change handler doesn't
       NULL-dereference.
      Signed-off-by: default avatarEdward Cree <ecree@solarflare.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      aa86a75f
    • Edward Cree's avatar
      sfc_ef100: reset-handling stub · c027f2a7
      Edward Cree authored
      We don't actually do the efx_mcdi_reset() because we don't have MCDI yet.
      Signed-off-by: default avatarEdward Cree <ecree@solarflare.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c027f2a7
    • Edward Cree's avatar
      sfc: skeleton EF100 PF driver · 51b35a45
      Edward Cree authored
      No TX or RX path, no MCDI, not even an ifup/down handler.
      Besides stubs, the bulk of the patch deals with reading the Xilinx
       extended PCIe capability, which tells us where to find our BAR.
      
      Though in the same module, EF100 has its own struct pci_driver,
       which is named sfc_ef100.
      
      A small number of additional nic_type methods are added; those in the
       TX (tx_enqueue) and RX (rx_packet) paths are called through indirect
       call wrappers to minimise the performance impact.
      Signed-off-by: default avatarEdward Cree <ecree@solarflare.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      51b35a45
    • Edward Cree's avatar
      sfc_ef100: register accesses on EF100 · 61060c5d
      Edward Cree authored
      EF100 adds a few new valid addresses for efx_writed_page(), as well as
       a Function Control Window in the BAR whose location is variable.
      Signed-off-by: default avatarEdward Cree <ecree@solarflare.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      61060c5d
    • Edward Cree's avatar
      adf72ee3
    • Edward Cree's avatar
      sfc: remove efx_ethtool_nway_reset() · 0ccf267e
      Edward Cree authored
      An MDIO-based n-way restart does not make sense for any of the NICs
       supported by this driver, nor for the coming EF100.
      Unlike on Falcon (which was already split off into a separate driver),
       the PHY on all of Siena, EF10 and EF100 is managed by MC firmware.
      While Siena can talk to the PHY over MDIO, doing so for anything other
       than debugging purposes (mdio_mii_ioctl) is likely to confuse the
       firmware.
      (According to the SFC firmware team, this support was originally added
       to the Siena driver early in the development of that product, before
       it was decided to have firmware manage the PHY.)
      Signed-off-by: default avatarEdward Cree <ecree@solarflare.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0ccf267e
    • David S. Miller's avatar
      Merge branch 'Add-PRP-driver' · 65ccbbda
      David S. Miller authored
      Murali Karicheri says:
      
      ====================
      Add PRP driver
      
      This series is dependent on the following patches sent out to
      netdev list. All (1-3) are already merged to net/master as of
      sending this, but not on the net-next master branch. So need
      to apply them to net-next before applying this series. v3 of
      the iproute2 patches can be merged to work with this series
      as there are no updates since then.
      
      [1] https://marc.info/?l=linux-netdev&m=159526378131542&w=2
      [2] https://marc.info/?l=linux-netdev&m=159499772225350&w=2
      [3] https://marc.info/?l=linux-netdev&m=159499772425352&w=2
      
      This series adds support for Parallel Redundancy Protocol (PRP)
      in the Linux HSR driver as defined in IEC-62439-3. PRP Uses a
      Redundancy Control Trailer (RCT) the format of which is
      similar to HSR Tag. This is used for implementing redundancy.
      RCT consists of 6 bytes similar to HSR tag and contain following
      fields:-
      
      - 16-bit sequence number (SeqNr);
      - 4-bit LAN identifier (LanId);
      - 12 bit frame size (LSDUsize);
      - 16-bit suffix (PRPsuffix).
      
      The PRPsuffix identifies PRP frames and distinguishes PRP frames
      from other protocols that also append a trailer to their useful
      data. The LSDUsize field allows the receiver to distinguish PRP
      frames from random, nonredundant frames as an additional check.
      LSDUsize is the size of the Ethernet payload inclusive of the
      RCT. Sequence number along with LanId is used for duplicate
      detection and discard.
      
      PRP node is also known as Dual Attached Node (DAN-P) since it
      is typically attached to two different LAN for redundancy.
      DAN-P duplicates each of L2 frames and send it over the two
      Ethernet links. Each outgoing frame is appended with RCT.
      Unlike HSR, these are added to the end of L2 frame and will be
      treated as pad by bridges and therefore would be work with
      traditional bridges or switches, where as HSR wouldn't as Tag
      is prefixed to the Ethenet frame. At the remote end, these are
      received and the duplicate frame is discarded before the stripped
      frame is send up the networking stack. Like HSR, PRP also sends
      periodic Supervision frames to the network. These frames are
      received and MAC address from the SV frames are populated in a
      database called Node Table. The above functions are grouped into
      a block called Link Redundancy Entity (LRE) in the IEC spec.
      
      As there are many similarities between HSR and PRP protocols,
      this patch re-uses the code from HSR driver to implement PRP
      driver. As per feedback from the RFC series, the implementation
      uses the existing HSR Netlink socket interface to create the
      PRP interface by adding a new proto parameter to the ip link
      command to identify the PRP protocol. iproute2 is enhanced to
      implement this new parameter. The hsr_netlink.c is enhanced
      to handle the new proto parameter. As suggested during the RFC
      review, the driver introduced a proto_ops structure to hold
      protocol specfic functions to handle HSR and PRP specific
      function pointers and use them in the code based on the
      protocol to handle protocol specific part differently in the
      driver.
      
      Please review this and provide me feedback so that I can work to
      incorporate them and spin the next version if needed.
      
      The patch was tested using two TI AM57x IDK boards for PRP which
      are connected back to back over two CPSW Ethernet ports.
      
      PRP Test setup
      ---------------
      
      --------eth0             eth0 --------
      |AM572x|----------------------|AM572x|
      |      |----------------------|      |
      --------eth1             eth1 --------
      
      To build, enable CONFIG_HSR=y or m
      make omap2plus_defconfig
      make zImage; make modules; make dtbs
      Copy the zImage and dtb files to the file system on SD card
      and power on the AM572x boards.
      This can be tested on any platforms with 2 Ethernet interfaces.
      So will appreciate if you can give it a try and provide your
      Tested-by.
      
      Command to create PRP interface
      -------------------------------
      ifconfig eth0 0.0.0.0 down
      ifconfig eth1 0.0.0.0 down
      ifconfig eth0 hw ether 70:FF:76:1C:0E:8C
      ifconfig eth1 hw ether 70:FF:76:1C:0E:8C
      ifconfig eth0 up
      ifconfig eth1 up
      ip link add name prp0 type hsr slave1 eth0 slave2 eth1 supervision 45 proto 1
      ifconfig prp0 192.168.2.10
      
      ifconfig eth0 0.0.0.0 down
      ifconfig eth1 0.0.0.0 down
      ifconfig eth0 hw ether 70:FF:76:1C:0E:8D
      ifconfig eth1 hw ether 70:FF:76:1C:0E:8D
      ifconfig eth0 up
      ifconfig eth1 up
      ip link add name prp0 type hsr slave1 eth0 slave2 eth1 supervision 45 proto 1
      ifconfig prp0 192.168.2.20
      
      command to show node table
      ----------------------------
      Ping the peer board after the prp0 interface is up.
      
      The remote node (DAN-P) will be shown in the node table as below.
      
      root@am57xx-evm:~# cat /sys/kernel/debug/hsr/prp0/node_table
      Node Table entries for (PRP) device
      MAC-Address-A,    MAC-Address-B,    time_in[A], time_in[B], Address-B port, SAN-A, SAN-B, DAN-P
      70:ff:76:1c:0e:8c 00:00:00:00:00:00   ffffe83f,   ffffe83f,              0,     0,     0,     1
      
      Try to capture the raw PRP frames at the eth0 interface as
      tcpdump -i eth0 -xxx
      
      Sample Supervision frames and ARP frames shown below.
      
      ==================================================================================
      Successive Supervision frames captured with tcpdump (with RCT at the end):
      
      03:43:29.500999 70:ff:76:1c:0e:8d (oui Unknown) > 01:15:4e:00:01:2d (oui Unknown), ethertype Unknown (0x88f
              0x0000:  0115 4e00 012d 70ff 761c 0e8d 88fb 0001
              0x0010:  7e0a 1406 70ff 761c 0e8d 0000 0000 0000
              0x0020:  0000 0000 0000 0000 0000 0000 0000 0000
              0x0030:  0000 0000 0000 0000 0000 0000 fc2b a034
              0x0040:  88fb
      
      03:43:31.581025 70:ff:76:1c:0e:8d (oui Unknown) > 01:15:4e:00:01:2d (oui Unknown), ethertype Unknown (0x88f
              0x0000:  0115 4e00 012d 70ff 761c 0e8d 88fb 0001
              0x0010:  7e0b 1406 70ff 761c 0e8d 0000 0000 0000
              0x0020:  0000 0000 0000 0000 0000 0000 0000 0000
              0x0030:  0000 0000 0000 0000 0000 0000 fc2c a034
              0x0040:  88fb
      
      ICMP Echo request frame with RCT
      03:43:33.805354 IP 192.168.2.20 > 192.168.2.10: ICMP echo request, id 63748, seq 1, length 64
              0x0000:  70ff 761c 0e8c 70ff 761c 0e8d 0800 4500
              0x0010:  0054 26a4 4000 4001 8e96 c0a8 0214 c0a8
              0x0020:  020a 0800 c28e f904 0001 202e 1c3d 0000
              0x0030:  0000 0000 0000 0000 0000 0000 0000 0000
              0x0040:  0000 0000 0000 0000 0000 0000 0000 0000
              0x0050:  0000 0000 0000 0000 0000 0000 0000 0000
              0x0060:  0000 fc31 a05a 88fb
      ==================================================================================
      The iperf3 traffic test logs can be accessed at the links below.
      DUT-1: https://pastebin.ubuntu.com/p/8SkQzWJMn8/
      DUT-2: https://pastebin.ubuntu.com/p/j2BZvvs7p4/
      
      Other tests done.
       - Connect a SAN (eth0 and eth1 without prp interface) and
         do ping test from eth0 (192.168.2.40) to prp0 (192.168.2.10)
         verify the SAN node shows at the correct link A and B as shown
         in the node table dump
       - Regress HSR interface using 3 nodes connected in a ring topology.
         create hsr link version 0. Do iperf3 test between all nodes
         create hsr link version 1. Do iperf3 test between all nodes.
      
               --------eth0             eth1 --------eth0      eth1-------|
               |AM572x|----------------------|AM572x|--------------|AM572x|
               |      |                      |      |        ------|      |
               --------eth1---|               -------        | eth0 -------
                              |-------------------------------
      
         command used for HSR interface
      
         HSR V0
      
         ifconfig eth0 0.0.0.0 down
         ifconfig eth1 0.0.0.0 down
         ifconfig eth0 hw ether 70:FF:76:1C:0E:8C
         ifconfig eth1 hw ether 70:FF:76:1C:0E:8C
         ifconfig eth0 up
         ifconfig eth1 up
         ip link add name hsr0 type hsr slave1 eth0 slave2 eth1 supervision 45 version 0
         ifconfig hsr0 192.168.2.10
      
         HSR V1
      
         ifconfig eth0 0.0.0.0 down
         ifconfig eth1 0.0.0.0 down
         ifconfig eth0 hw ether 70:FF:76:1C:0E:8C
         ifconfig eth1 hw ether 70:FF:76:1C:0E:8C
         ifconfig eth0 up
         ifconfig eth1 up
         ip link add name hsr0 type hsr slave1 eth0 slave2 eth1 supervision 45 version 1
         ifconfig hsr0 192.168.2.10
      
         Logs at
         DUT-1 : https://pastebin.ubuntu.com/p/6PSJbZwQ6y/
         DUT-2 : https://pastebin.ubuntu.com/p/T8TqJsPRHc/
         DUT-3 : https://pastebin.ubuntu.com/p/VNzpv6HzKj/
       - Build tests :-
         Build with CONFIG_HSR=m
         allmodconfig build
         build with CONFIG_HSR=y and rebuild with sparse checker
         make C=1 zImage; make modules
      
      Version history:
        v5 : Fixed comments about Kconfig changes on Patch 1/7 against v4
             Rebased to netnext/master branch.
      
        v4 : fixed following vs v3
             reverse xmas tree for local variables
             check for return type in call to skb_put_padto()
      
        v3 : Separated bug fixes from this series and send them for immediate merge
             But for that this is same as v2.
      
        v2 : updated comments on RFC. Following are the main changes:-
             - Removed the hsr_prp prefix
             - Added PRP information in header files to indicate
               the support for PRP explicitely
             - Re-use netlink socket interface with an added
               parameter proto for identifying PRP.
             - Use function pointers using a proto_ops struct
               to do things differently for PRP vs HSR.
      
         RFC: initial version posted and discussed at
             https://www.spinics.net/lists/netdev/msg656229.html
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      65ccbbda
    • Murali Karicheri's avatar
      net: prp: enhance debugfs to display PRP info · 795ec4f5
      Murali Karicheri authored
      Print PRP specific information from node table as part of debugfs
      node table display. Also display the node as DAN-H or DAN-P depending
      on the info from node table.
      Signed-off-by: default avatarMurali Karicheri <m-karicheri2@ti.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      795ec4f5
    • Murali Karicheri's avatar
      net: prp: add packet handling support · 451d8123
      Murali Karicheri authored
      DAN-P (Dual Attached Nodes PRP) nodes are expected to receive
      traditional IP packets as well as PRP (Parallel Redundancy
      Protocol) tagged (trailer) packets. PRP trailer is 6 bytes
      of PRP protocol unit called RCT, Redundancy Control Trailer
      (RCT) similar to HSR tag. PRP network can have traditional
      devices such as bridges/switches or PC attached to it and
      should be able to communicate. Regular Ethernet devices treat
      the RCT as pads.  This patch adds logic to format L2 frames
      from network stack to add a trailer (RCT) and send it as
      duplicates over the slave interfaces when the protocol is
      PRP as per IEC 62439-3. At the ingress, it strips the trailer,
      do duplicate detection and rejection and forward a stripped
      frame up the network stack. PRP device should accept frames
      from Singly Attached Nodes (SAN) and thus the driver mark
      the link where the frame came from in the node table.
      Signed-off-by: default avatarMurali Karicheri <m-karicheri2@ti.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      451d8123
    • Murali Karicheri's avatar
      net: hsr: define and use proto_ops ptrs to handle hsr specific frames · fa4dc895
      Murali Karicheri authored
      As a preparatory patch to introduce PRP, refactor the code specific to
      handling HSR frames into separate functions and call them through
      proto_ops function pointers.
      Signed-off-by: default avatarMurali Karicheri <m-karicheri2@ti.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fa4dc895
    • Murali Karicheri's avatar
      net: prp: add supervision frame generation utility function · c643ff03
      Murali Karicheri authored
      Add support for generation of PRP supervision frames. For PRP,
      supervision frame format is similar to HSR version 0, but have
      a PRP Redundancy Control Trailer (RCT) added and uses a different
      message type, PRP_TLV_LIFE_CHECK_DD. Also update
      is_supervision_frame() to include the new message type used for
      PRP supervision frame.
      Signed-off-by: default avatarMurali Karicheri <m-karicheri2@ti.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c643ff03
    • Murali Karicheri's avatar
      net: hsr: introduce protocol specific function pointers · 28e458e0
      Murali Karicheri authored
      As a preparatory patch to introduce support for PRP protocol, add a
      protocol ops ptr in the private hsr structure to hold function
      pointers as some of the functions at protocol level packet
      handling is different for HSR vs PRP. It is expected that PRP will
      add its of set of functions for protocol handling. Modify existing
      hsr_announce() function to call proto_ops->send_sv_frame() to send
      supervision frame for HSR. This is expected to be different for PRP.
      So introduce a ops function ptr, send_sv_frame() for the same and
      initialize it to send_hsr_supervsion_frame(). Modify hsr_announce()
      to call proto_ops->send_sv_frame().
      Signed-off-by: default avatarMurali Karicheri <m-karicheri2@ti.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      28e458e0
    • Murali Karicheri's avatar
      net: hsr: introduce common code for skb initialization · 121c33b0
      Murali Karicheri authored
      As a preparatory patch to introduce PRP protocol support in the
      driver, refactor the skb init code to a separate function.
      Signed-off-by: default avatarMurali Karicheri <m-karicheri2@ti.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      121c33b0
    • Murali Karicheri's avatar
      hsr: enhance netlink socket interface to support PRP · 8f4c0e01
      Murali Karicheri authored
      Parallel Redundancy Protocol (PRP) is another redundancy protocol
      introduced by IEC 63439 standard. It is similar to HSR in many
      aspects:-
      
       - Use a pair of Ethernet interfaces to created the PRP device
       - Use a 6 byte redundancy protocol part (RCT, Redundancy Check
         Trailer) similar to HSR Tag.
       - Has Link Redundancy Entity (LRE) that works with RCT to implement
         redundancy.
      
      Key difference is that the protocol unit is a trailer instead of a
      prefix as in HSR. That makes it inter-operable with tradition network
      components such as bridges/switches which treat it as pad bytes,
      whereas HSR nodes requires some kind of translators (Called redbox) to
      talk to regular network devices. This features allows regular linux box
      to be converted to a DAN-P box. DAN-P stands for Dual Attached Node - PRP
      similar to DAN-H (Dual Attached Node - HSR).
      
      Add a comment at the header/source code to explicitly state that the
      driver files also handles PRP protocol as well.
      Signed-off-by: default avatarMurali Karicheri <m-karicheri2@ti.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8f4c0e01
    • Alexander Lobakin's avatar
      qed: fix the allocation of the chains with an external PBL · 1775da47
      Alexander Lobakin authored
      Dan reports static checker warning:
      
      "The patch 9b6ee3cf: "qed: sanitize PBL chains allocation" from Jul
      23, 2020, leads to the following static checker warning:
      
      	drivers/net/ethernet/qlogic/qed/qed_chain.c:299 qed_chain_alloc_pbl()
      	error: uninitialized symbol 'pbl_virt'.
      
      drivers/net/ethernet/qlogic/qed/qed_chain.c
         249  static int qed_chain_alloc_pbl(struct qed_dev *cdev, struct qed_chain *chain)
         250  {
         251          struct device *dev = &cdev->pdev->dev;
         252          struct addr_tbl_entry *addr_tbl;
         253          dma_addr_t phys, pbl_phys;
         254          __le64 *pbl_virt;
                      ^^^^^^^^^^^^^^^^
      [...]
         271          if (chain->b_external_pbl)
         272                  goto alloc_pages;
                              ^^^^^^^^^^^^^^^^ uninitialized
      [...]
         298                  /* Fill the PBL table with the physical address of the page */
         299                  pbl_virt[i] = cpu_to_le64(phys);
                              ^^^^^^^^^^^
      [...]
      "
      
      This issue was introduced with commit c3a321b0 ("qed: simplify
      initialization of the chains with an external PBL"), when
      chain->pbl_sp.table_virt initialization was moved up to
      qed_chain_init_params().
      Fix it by initializing pbl_virt with an already filled chain struct field.
      
      Fixes: c3a321b0 ("qed: simplify initialization of the chains with an external PBL")
      Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarAlexander Lobakin <alobakin@marvell.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1775da47
    • David S. Miller's avatar
      Merge branch 'bnxt_en-update' · 43e7a0e5
      David S. Miller authored
      Michael Chan says:
      
      ====================
      bnxt_en update.
      
      This patchset removes the PCIe histogram and other debug register
      data from ethtool -S. The removed data are not counters and they have
      very large and constantly fluctuating values that are not suitable for
      the ethtool -S decimal counter display.
      
      The rest of the patches implement counter rollover for all hardware
      counters that are not 64-bit counters.  Different generations of
      hardware have different counter widths.  The driver will now query
      the counter widths of all counters from firmware and implement
      rollover support on all non-64-bit counters.
      
      The last patch adds the PCIe histogram and other PCIe register data back
      using the ethtool -d interface.
      
      v2: Fix bnxt_re RDMA driver compile issue.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      43e7a0e5
    • Vasundhara Volam's avatar
      bnxt_en: Add support for 'ethtool -d' · b5d600b0
      Vasundhara Volam authored
      Add support to dump PXP registers and PCIe statistics.
      Signed-off-by: default avatarVasundhara Volam <vasundhara-v.volam@broadcom.com>
      Signed-off-by: default avatarMichael Chan <michael.chan@broadcom.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b5d600b0
    • Michael Chan's avatar
      bnxt_en: Switch over to use the 64-bit software accumulated counters. · a0c30621
      Michael Chan authored
      Now we can report all the full 64-bit CPU endian software accumulated
      counters instead of the hw counters, some of which may be less than
      64-bit wide.  Define the necessary macros to access the software
      counters.
      Reviewed-by: default avatarVasundhara Volam <vasundhara-v.volam@broadcom.com>
      Signed-off-by: default avatarMichael Chan <michael.chan@broadcom.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a0c30621
    • Michael Chan's avatar
      bnxt_en: Accumulate all counters. · fea6b333
      Michael Chan authored
      Now that we have the infrastructure in place, add the new function
      bnxt_accumulate_all_stats() to periodically accumulate and check for
      counter rollover of all ring stats and port stats.
      
      A chip bug was also discovered that could cause some ring counters to
      become 0 during DMA.  Workaround by ignoring zeros on the affected
      chips.
      
      Some older frimware will reset port counters during ifdown.  We need
      to check for that and free the accumulated port counters during ifdown
      to prevent bogus counter overflow detection during ifup.
      Reviewed-by: default avatarVasundhara Volam <vasundhara-v.volam@broadcom.com>
      Signed-off-by: default avatarMichael Chan <michael.chan@broadcom.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fea6b333
    • Michael Chan's avatar
      bnxt_en: Retrieve hardware masks for port counters. · 531d1d26
      Michael Chan authored
      If supported by newer firmware, make the firmware call to query all
      the port counter masks.  If not supported, assume 40-bit port
      counter masks.
      Reviewed-by: default avatarVasundhara Volam <vasundhara-v.volam@broadcom.com>
      Signed-off-by: default avatarMichael Chan <michael.chan@broadcom.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      531d1d26
    • Michael Chan's avatar
      bnxt_en: Retrieve hardware counter masks from firmware if available. · d752d053
      Michael Chan authored
      Newer firmware has a new call HWRM_FUNC_QSTATS_EXT to retrieve the
      masks of all ring counters.  Make this call when supported to
      initialize the hardware masks of all ring counters.  If the call
      is not available, assume 48-bit ring counter masks on P5 chips.
      Reviewed-by: default avatarVasundhara Volam <vasundhara-v.volam@broadcom.com>
      Signed-off-by: default avatarMichael Chan <michael.chan@broadcom.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d752d053
    • Michael Chan's avatar
      bnxt_en: Allocate additional memory for all statistics blocks. · a37120b2
      Michael Chan authored
      Some of these DMAed hardware counters are not full 64-bit counters and
      so we need to accumulate them as they overflow.  Allocate copies of these
      DMA statistics memory blocks with the same size for accumulation.  The
      hardware counter widths are also counter specific so we allocate
      memory for masks that correspond to each counter.
      Reviewed-by: default avatarVasundhara Volam <vasundhara-v.volam@broadcom.com>
      Signed-off-by: default avatarMichael Chan <michael.chan@broadcom.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a37120b2
    • Michael Chan's avatar
      bnxt_en: Refactor statistics code and structures. · 177a6cde
      Michael Chan authored
      The driver manages multiple statistics structures of different sizes.
      They are all allocated, freed, and handled practically the same.  Define
      a new bnxt_stats_mem structure and common allocation and free functions
      for all staistics memory blocks.
      Reviewed-by: default avatarVasundhara Volam <vasundhara-v.volam@broadcom.com>
      Signed-off-by: default avatarMichael Chan <michael.chan@broadcom.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      177a6cde
    • Michael Chan's avatar
      bnxt_en: Use macros to define port statistics size and offset. · 24c93443
      Michael Chan authored
      The port statistics structures have hard coded padding and offset.
      Define macros to make this look cleaner.
      Reviewed-by: default avatarPavan Chebbi <pavan.chebbi@broadcom.com>
      Reviewed-by: default avatarVasundhara Volam <vasundhara-v.volam@broadcom.com>
      Signed-off-by: default avatarMichael Chan <michael.chan@broadcom.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      24c93443
    • Michael Chan's avatar
      bnxt_en: Update firmware interface to 1.10.1.54. · bfc6e5fb
      Michael Chan authored
      Main changes are 200G support and fixing the definitions of discard and
      error counters to match the hardware definitions.
      
      Because the HWRM_PORT_PHY_QCFG message size has now exceeded the max.
      encapsulated response message size of 96 bytes from the PF to the VF,
      we now need to cap this message to 96 bytes for forwarding.  The forwarded
      response only needs to contain the basic link status and speed information
      and can be capped without adding the new information.
      
      v2: Fix bnxt_re compile error.
      
      Cc: Selvin Xavier <selvin.xavier@broadcom.com>
      Reviewed-by: default avatarVasundhara Volam <vasundhara-v.volam@broadcom.com>
      Reviewed-by: default avatarEdwin Peer <edwin.peer@broadcom.com>
      Signed-off-by: default avatarMichael Chan <michael.chan@broadcom.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bfc6e5fb
    • Vasundhara Volam's avatar
      bnxt_en: Remove PCIe non-counters from ethtool statistics · dfe64de9
      Vasundhara Volam authored
      Remove PCIe non-counters display from ethtool statistics, as
      they are not simple counters but register dump.  The next few
      patches will add logic to detect counter roll-over and it won't
      work with these PCIe non-counters.
      
      There will be a follow up patch to get PCIe information via
      ethtool register dump.
      Signed-off-by: default avatarVasundhara Volam <vasundhara-v.volam@broadcom.com>
      Signed-off-by: default avatarMichael Chan <michael.chan@broadcom.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      dfe64de9
    • Martin Varghese's avatar
      net: Removed the device type check to add mpls support for devices · 350e7ab9
      Martin Varghese authored
      MPLS has no dependency with the device type of underlying devices.
      Hence the device type check to add mpls support for devices can be
      avoided.
      Signed-off-by: default avatarMartin Varghese <martin.varghese@nokia.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      350e7ab9
    • Ido Schimmel's avatar
      ipmr: Copy option to correct variable · 73cb1193
      Ido Schimmel authored
      Cited commit mistakenly copied provided option to 'val' instead of to
      'mfc':
      
      ```
      -               if (copy_from_user(&mfc, optval, sizeof(mfc))) {
      +               if (copy_from_sockptr(&val, optval, sizeof(val))) {
      ```
      
      Fix this by copying the option to 'mfc'.
      
      selftest router_multicast.sh before:
      
      $ ./router_multicast.sh
      smcroutectl: Unknown or malformed IPC message 'a' from client.
      smcroutectl: failed removing multicast route, does not exist.
      TEST: mcast IPv4                                                    [FAIL]
              Multicast not received on first host
      TEST: mcast IPv6                                                    [ OK ]
      smcroutectl: Unknown or malformed IPC message 'a' from client.
      smcroutectl: failed removing multicast route, does not exist.
      TEST: RPF IPv4                                                      [FAIL]
              Multicast not received on first host
      TEST: RPF IPv6                                                      [ OK ]
      
      selftest router_multicast.sh after:
      
      $ ./router_multicast.sh
      TEST: mcast IPv4                                                    [ OK ]
      TEST: mcast IPv6                                                    [ OK ]
      TEST: RPF IPv4                                                      [ OK ]
      TEST: RPF IPv6                                                      [ OK ]
      
      Fixes: 01ccb5b4 ("net/ipv4: switch ip_mroute_setsockopt to sockptr_t")
      Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      73cb1193
    • David S. Miller's avatar
      Merge branch 'net-smc-show-unique-rsn-code-for-exceeded-max-dmb-count' · a4e3ee7d
      David S. Miller authored
      Karsten Graul says:
      
      ====================
      net/smc: show unique rsn code for exceeded max dmb count
      
      Resolve some confusion at the user side when the reason code shows
      out-of-memory but actually there is enough memory left.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a4e3ee7d
    • Karsten Graul's avatar
      net/smc: unique reason code for exceeded max dmb count · 72b7f6c4
      Karsten Graul authored
      When the maximum dmb buffer limit for an ism device is reached no more
      dmb buffers can be registered. When this happens the reason code is set
      to SMC_CLC_DECL_MEM indicating out-of-memory. This is the same reason
      code that is used when no memory could be allocated for the new dmb
      buffer.
      This is confusing for users when they see this error but there is more
      memory available. To solve this set a separate new reason code when the
      maximum dmb limit exceeded.
      Reviewed-by: default avatarUrsula Braun <ubraun@linux.ibm.com>
      Signed-off-by: default avatarKarsten Graul <kgraul@linux.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      72b7f6c4
    • Karsten Graul's avatar
      s390/ism: indicate correct error reason in ism_alloc_dmb() · 211e5b7a
      Karsten Graul authored
      When the ism driver allocates a new dmb in ism_alloc_dmb() it must
      first check for and reserve a slot in the sba bitmap. When
      find_next_zero_bit() finds no free slot then the return code is -ENOMEM.
      This code conflicts with the error when the alloc() fails later in the
      code. As a result of that the caller can not differentiate
      between out-of-memory conditions and sba-bitmap-full conditions.
      Fix that by using the return code -ENOSPC when the sba slot
      reservation failed.
      Reviewed-by: default avatarUrsula Braun <ubraun@linux.ibm.com>
      Signed-off-by: default avatarKarsten Graul <kgraul@linux.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      211e5b7a
    • Julia Lawall's avatar
      sfc: drop unnecessary list_empty · d21a06d5
      Julia Lawall authored
      list_for_each_safe is able to handle an empty list.
      The only effect of avoiding the loop is not initializing the
      index variable.
      Drop list_empty tests in cases where these variables are not
      used.
      
      The semantic patch that makes this change is as follows:
      (http://coccinelle.lip6.fr/)
      
      <smpl>
      @@
      expression x,e;
      iterator name list_for_each_safe;
      statement S;
      identifier i,j;
      @@
      
      -if (!(list_empty(x))) {
         list_for_each_safe(i,j,x) S
      - }
       ... when != i
           when != j
      (
        i = e;
      |
      ? j = e;
      )
      </smpl>
      Signed-off-by: default avatarJulia Lawall <Julia.Lawall@inria.fr>
      Acked-by: default avatarEdward Cree <ecree@solarflare.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d21a06d5
  2. 26 Jul, 2020 1 commit
    • David S. Miller's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · a57066b1
      David S. Miller authored
      The UDP reuseport conflict was a little bit tricky.
      
      The net-next code, via bpf-next, extracted the reuseport handling
      into a helper so that the BPF sk lookup code could invoke it.
      
      At the same time, the logic for reuseport handling of unconnected
      sockets changed via commit efc6b6f6
      which changed the logic to carry on the reuseport result into the
      rest of the lookup loop if we do not return immediately.
      
      This requires moving the reuseport_has_conns() logic into the callers.
      
      While we are here, get rid of inline directives as they do not belong
      in foo.c files.
      
      The other changes were cases of more straightforward overlapping
      modifications.
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a57066b1
  3. 25 Jul, 2020 5 commits