1. 22 Oct, 2019 10 commits
    • Jakub Kicinski's avatar
      Merge branch 'mlxsw-core-extend-qsfp-eeprom-size' · fe28afe2
      Jakub Kicinski authored
      Ido Schimmel says:
      
      ====================
      Vadim says:
      
      This patch set extends the size of QSFP EEPROM for the cable types
      SSF-8436 and SFF-8636 from 256 bytes to 640 bytes. This allows ethtool
      to show correct information for these cable types (more details below).
      
      Patch #1 adds a macro that computes the EEPROM page number from the
      provided offset specified in the request.
      
      Patch #2 teaches the driver to access the information stored in the
      upper pages of the QSFP memory map.
      
      Details and examples:
      
      SFF-8436 specification defines pages 0, 1, 2 and 3. Page 0 contains
      lower memory page offsets (from 0x00 to 0x7f) and upper page offsets
      (from 0x80 to 0xfe). Upper pages 1, 2 and 3 are optional and can be
      empty.
      
      Page 1 is provided if upper page 0 byte 0xc3 bit 6 is set.
      Page 2 is provided if upper page 0 byte 0xc3 bit 7 is set.
      Page 3 is provided if lower page 0 byte 0x02 bit 2 is cleared.
      Offset 0xc3 for the upper page is provided as 0x43 = 0xc3 - 0x80.
      
      As a result of exposing 256 bytes only, ethtool shows wrong information
      for pages 1, 2 and 3. In the below hex dump from ethtool for a cable
      compliant to SFF-8636 specification, it can be seen that EEPROM of this
      device contains optical diagnostic page (lower page 0 byte 0x02 bit 2 is
      cleared), but it is not exposed, as the length defined for this type is
      256 bytes.
      
      $ ethtool -m sfp42 hex on
      Offset          Values
      ------          ------
      0x0000:         11 07 00 ff 00 ff 00 00 00 55 55 00 00 00 00 00
      0x0010:         00 00 00 00 00 00 2a 90 00 00 82 ae 00 00 00 00
      0x0020:         00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      0x0030:         00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      0x0040:         00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      0x0050:         00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00
      0x0060:         00 00 ff 00 00 00 00 00 00 00 00 00 00 00 00 00
      0x0070:         00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      0x0080:         11 8c 0c 80 00 00 00 00 00 00 00 05 ff 00 00 23
      0x0090:         00 00 32 00 4d 65 6c 6c 61 6e 6f 78 20 20 20 20
      0x00a0:         20 20 20 20 00 00 02 c9 4d 4d 41 31 42 30 30 2d
      0x00b0:         53 53 31 20 20 20 20 20 41 32 42 68 0b b8 46 05
      0x00c0:         02 07 f5 9e 4d 54 31 38 33 34 46 54 30 33 38 34
      0x00d0:         36 20 20 20 31 38 30 37 30 33 00 00 0c 10 67 c2
      0x00e0:         38 32 36 46 4d 41 32 32 36 49 30 31 31 35 20 20
      0x00f0:         00 00 00 00 00 00 00 00 00 00 01 00 0e 00 00 00
      
      After changing the length returned by get_module_info() callback from
      256 bytes to 640 bytes, the upper pages 1, 2 and 3 are exposed by
      ethtool. In the below hex dump from the same cable it can be seen that
      the optical diagnostic page (page 3, from offset 0x0200) has non-zero
      data.
      
      $ ethtool -m sfp42 hex on
      Offset          Values
      ------          ------
      0x0000:         11 07 00 ff 00 ff 00 00 00 55 55 00 00 00 00 00
      0x0010:         00 00 00 00 00 00 27 79 00 00 82 c5 00 00 00 00
      0x0020:         00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      0x0030:         00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      0x0040:         00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      0x0050:         00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00
      0x0060:         00 00 ff 00 00 00 00 00 00 00 00 00 00 00 00 00
      0x0070:         00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      0x0080:         11 8c 0c 80 00 00 00 00 00 00 00 05 ff 00 00 23
      0x0090:         00 00 32 00 4d 65 6c 6c 61 6e 6f 78 20 20 20 20
      0x00a0:         20 20 20 20 00 00 02 c9 4d 4d 41 31 42 30 30 2d
      0x00b0:         53 53 31 20 20 20 20 20 41 32 42 68 0b b8 46 05
      0x00c0:         02 07 f5 9e 4d 54 31 38 33 34 46 54 30 33 38 34
      0x00d0:         36 20 20 20 31 38 30 37 30 33 00 00 0c 10 67 c2
      0x00e0:         38 32 36 46 4d 41 32 32 36 49 30 31 31 35 20 20
      0x00f0:         00 00 00 00 00 00 00 00 00 00 01 00 0e 00 00 00
      0x0100:         00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      0x0110:         00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      0x0120:         00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      0x0130:         00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      0x0140:         00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      0x0150:         00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      0x0160:         00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      0x0170:         00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      0x0180:         00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      0x0190:         00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      0x01a0:         00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      0x01b0:         00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      0x01c0:         00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      0x01d0:         00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      0x01e0:         00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      0x01f0:         00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      0x0200:         50 00 f6 00 46 00 00 00 00 00 00 00 00 00 00 00
      0x0210:         88 b8 79 18 87 5a 7a 76 00 00 00 00 00 00 00 00
      0x0220:         00 00 00 00 00 00 00 00 00 00 18 30 0e 61 60 b7
      0x0230:         87 71 01 d3 43 e2 03 a5 10 9a 0a ba 0f a0 0b b8
      0x0240:         87 71 02 d4 43 e2 05 a5 00 00 00 00 00 00 00 00
      0x0250:         00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      0x0260:         a7 03 00 00 00 00 00 00 00 00 44 44 22 22 11 11
      0x0270:         00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      
      And 'ethtool -m sfp42' shows the real values for the below fields, while
      before it exposed zeros for these fields:
      
      Laser bias current high alarm threshold   : 8.500 mA
      Laser bias current low alarm threshold    : 5.492 mA
      Laser bias current high warning threshold : 8.000 mA
      Laser bias current low warning threshold  : 6.000 mA
      Laser output power high alarm threshold   : 3.4673 mW / 5.40 dBm
      Laser output power low alarm threshold    : 0.0724 mW / -11.40 dBm
      Laser output power high warning threshold : 1.7378 mW / 2.40 dBm
      Laser output power low warning threshold  : 0.1445 mW / -8.40 dBm
      Module temperature high alarm threshold   : 80.00 degrees C / 176.00 F
      Module temperature low alarm threshold    : -10.00 degrees C / 14.00 F
      Module temperature high warning threshold : 70.00 degrees C / 158.00 F
      Module temperature low warning threshold  : 0.00 degrees C / 32.00 F
      Module voltage high alarm threshold       : 3.5000 V
      Module voltage low alarm threshold        : 3.1000 V
      ====================
      Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
      fe28afe2
    • Vadim Pasternak's avatar
      mlxsw: core: Extend QSFP EEPROM size for ethtool · a45bfb5a
      Vadim Pasternak authored
      Extend the size of QSFP EEPROM for the cable types SSF8436 and SFF8636
      from 256 to 640 bytes in order to expose all the EEPROM pages by
      ethtool.
      
      For SFF-8636 and SFF-8436 specifications, the driver exposes 256 bytes
      of data for ethtool's get_module_eeprom() callback. This is because the
      driver uses the below defines to specify SFF module length in ethtool's
      get_module_info() callback:
      'ETH_MODULE_SFF_8636_LEN' and 'ETH_MODULE_SFF_8436_LEN' (both are 256).
      
      As a result of exposing 256 bytes only, ethtool shows wrong "zero" info
      for pages 1, 2, 3.
      
      The patch changes the length returned by callback for get_module_info()
      to the values from the next defines: 'ETH_MODULE_SFF_8636_MAX_LEN' and
      'ETH_MODULE_SFF_8436_MAX_LEN' (both are 640) to allow exposing of upper
      page 1, 2 and 3.
      Signed-off-by: default avatarVadim Pasternak <vadimp@mellanox.com>
      Acked-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
      a45bfb5a
    • Vadim Pasternak's avatar
      mlxsw: reg: Add macro for getting QSFP module EEPROM page number · f366cd2a
      Vadim Pasternak authored
      Provide a macro for getting QSFP module EEPROM page number from the
      optional upper page number row offset, specified in request.
      Signed-off-by: default avatarVadim Pasternak <vadimp@mellanox.com>
      Acked-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
      f366cd2a
    • Juergen Gross's avatar
      xen/netback: cleanup init and deinit code · 2ac061ce
      Juergen Gross authored
      Do some cleanup of the netback init and deinit code:
      
      - add an omnipotent queue deinit function usable from
        xenvif_disconnect_data() and the error path of xenvif_connect_data()
      - only install the irq handlers after initializing all relevant items
        (especially the kthreads related to the queue)
      - there is no need to use get_task_struct() after creating a kthread
        and using put_task_struct() again after having stopped it.
      - use kthread_run() instead of kthread_create() to spare the call of
        wake_up_process().
      Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
      Reviewed-by: default avatarPaul Durrant <pdurrant@gmail.com>
      Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
      2ac061ce
    • Jakub Kicinski's avatar
      Merge branch 'r8152-phy-firmware' · 88238d2d
      Jakub Kicinski authored
      Hayes Wang says:
      
      ====================
      Support loading the firmware of the PHY with the type of RTL_FW_PHY_NC.
      ====================
      Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
      88238d2d
    • Hayes Wang's avatar
      r8152: support firmware of PHY NC for RTL8153A · af14288f
      Hayes Wang authored
      Support the firmware of PHY NC which is used to fix the issue found
      for PHY. Currently, only RTL_VER_04, RTL_VER_05, and RTL_VER_06 need
      it.
      
      The order of loading PHY firmware would be
      
      	RTL_FW_PHY_START
      	RTL_FW_PHY_NC
      	RTL_FW_PHY_STOP
      
      The RTL_FW_PHY_START/RTL_FW_PHY_STOP are used to lock/unlock the PHY,
      and set/clear the patch key from the firmware file.
      Signed-off-by: default avatarHayes Wang <hayeswang@realtek.com>
      Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
      af14288f
    • Hayes Wang's avatar
      r8152: move r8153_patch_request forward · 470e3919
      Hayes Wang authored
      Move r8153_patch_request() forward for later patch.
      Signed-off-by: default avatarHayes Wang <hayeswang@realtek.com>
      Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
      470e3919
    • Hayes Wang's avatar
      r8152: add checking fw_offset field of struct fw_mac · 5a16a3d9
      Hayes Wang authored
      Make sure @fw_offset field of struct fw_mac is more than the size
      of struct fw_mac.
      Signed-off-by: default avatarHayes Wang <hayeswang@realtek.com>
      Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
      5a16a3d9
    • Hayes Wang's avatar
      r8152: rename fw_type_1 with fw_mac · a66edaaf
      Hayes Wang authored
      The struct fw_type_1 is used by MAC only, so rename it to a meaningful one.
      
      Besides, adjust two messages. Replace "load xxx fail" with "check xxx fail"
      Signed-off-by: default avatarHayes Wang <hayeswang@realtek.com>
      Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
      a66edaaf
    • Jakub Kicinski's avatar
      Merge branch '1GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue · 39438490
      Jakub Kicinski authored
      Jeff Kirsher says:
      
      ====================
      1GbE Intel Wired LAN Driver Updates 2019-10-21
      
      This series contains updates to e1000e and igc only.
      
      Sasha adds stream control transmission protocol (SCTP) CRC checksum
      support for igc.  Also added S0ix support to the e1000e driver.  Then
      added multicast support by adding the address list to the MTA table and
      providing the option for IPv6 address for igc.  In addition, added
      receive checksum support to igc as well.  Lastly, cleaned up some code
      that was not fully implemented yet for the VLAN filter table array.
      
      v2: Dropped patch 1 & 2 from the original series.  Patch 1 is being sent
          to 'net' tree as a fix and patch 2 implementation needs to be
          re-worked.  Updated the patch to add support for S0ix to fix the
          reverse Xmas tree issues and made the entry/exit functions void
          since they constantly returned success.  All based on community
          feedback.
      v3: Cleaned up patch 4 of the series based on feedback from the
          community.  Cleaned up a stray comma in a code comment and removed
          the 'inline' of a function that would be inlined by the compiler
          anyways.
      ====================
      Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
      39438490
  2. 21 Oct, 2019 27 commits
  3. 20 Oct, 2019 1 commit
  4. 19 Oct, 2019 2 commits
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · 531e93d1
      Linus Torvalds authored
      Pull networking fixes from David Miller:
       "I was battling a cold after some recent trips, so quite a bit piled up
        meanwhile, sorry about that.
      
        Highlights:
      
         1) Fix fd leak in various bpf selftests, from Brian Vazquez.
      
         2) Fix crash in xsk when device doesn't support some methods, from
            Magnus Karlsson.
      
         3) Fix various leaks and use-after-free in rxrpc, from David Howells.
      
         4) Fix several SKB leaks due to confusion of who owns an SKB and who
            should release it in the llc code. From Eric Biggers.
      
         5) Kill a bunc of KCSAN warnings in TCP, from Eric Dumazet.
      
         6) Jumbo packets don't work after resume on r8169, as the BIOS resets
            the chip into non-jumbo mode during suspend. From Heiner Kallweit.
      
         7) Corrupt L2 header during MPLS push, from Davide Caratti.
      
         8) Prevent possible infinite loop in tc_ctl_action, from Eric
            Dumazet.
      
         9) Get register bits right in bcmgenet driver, based upon chip
            version. From Florian Fainelli.
      
        10) Fix mutex problems in microchip DSA driver, from Marek Vasut.
      
        11) Cure race between route lookup and invalidation in ipv4, from Wei
            Wang.
      
        12) Fix performance regression due to false sharing in 'net'
            structure, from Eric Dumazet"
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (145 commits)
        net: reorder 'struct net' fields to avoid false sharing
        net: dsa: fix switch tree list
        net: ethernet: dwmac-sun8i: show message only when switching to promisc
        net: aquantia: add an error handling in aq_nic_set_multicast_list
        net: netem: correct the parent's backlog when corrupted packet was dropped
        net: netem: fix error path for corrupted GSO frames
        macb: propagate errors when getting optional clocks
        xen/netback: fix error path of xenvif_connect_data()
        net: hns3: fix mis-counting IRQ vector numbers issue
        net: usb: lan78xx: Connect PHY before registering MAC
        vsock/virtio: discard packets if credit is not respected
        vsock/virtio: send a credit update when buffer size is changed
        mlxsw: spectrum_trap: Push Ethernet header before reporting trap
        net: ensure correct skb->tstamp in various fragmenters
        net: bcmgenet: reset 40nm EPHY on energy detect
        net: bcmgenet: soft reset 40nm EPHYs before MAC init
        net: phy: bcm7xxx: define soft_reset for 40nm EPHY
        net: bcmgenet: don't set phydev->link from MAC
        net: Update address for MediaTek ethernet driver in MAINTAINERS
        ipv4: fix race condition between route lookup and invalidation
        ...
      531e93d1
    • Eric Dumazet's avatar
      net: reorder 'struct net' fields to avoid false sharing · 2a06b898
      Eric Dumazet authored
      Intel test robot reported a ~7% regression on TCP_CRR tests
      that they bisected to the cited commit.
      
      Indeed, every time a new TCP socket is created or deleted,
      the atomic counter net->count is touched (via get_net(net)
      and put_net(net) calls)
      
      So cpus might have to reload a contended cache line in
      net_hash_mix(net) calls.
      
      We need to reorder 'struct net' fields to move @hash_mix
      in a read mostly cache line.
      
      We move in the first cache line fields that can be
      dirtied often.
      
      We probably will have to address in a followup patch
      the __randomize_layout that was added in linux-4.13,
      since this might break our placement choices.
      
      Fixes: 355b9855 ("netns: provide pure entropy for net_hash_mix()")
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Reported-by: default avatarkernel test robot <oliver.sang@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2a06b898