An error occurred fetching the project authors.
  1. 22 Mar, 2024 1 commit
  2. 04 Mar, 2024 4 commits
    • Maciej Fijalkowski's avatar
      ice: avoid unnecessary devm_ usage · 90f821d7
      Maciej Fijalkowski authored
      1. pcaps are free'd right after AQ routines are done, no need for
         devm_'s
      2. a test frame for loopback test in ethtool -t is destroyed at the end
         of the test so we don't need devm_ here either.
      Signed-off-by: default avatarMaciej Fijalkowski <maciej.fijalkowski@intel.com>
      Reviewed-by: default avatarPrzemek Kitszel <przemyslaw.kitszel@intel.com>
      Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com> (A Contingent worker at Intel)
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      90f821d7
    • Jacob Keller's avatar
      ice: cleanup line splitting for context set functions · 979c2c04
      Jacob Keller authored
      The indentation for ice_set_ctx and ice_write_rxq_ctx breaks the function
      name after the return type. This style of breaking is used a lot throughout
      the ice driver, even in cases where its not actually helpful for
      readability. We no longer prefer this style of line splitting in the
      driver, and new code is avoiding it.
      
      Normally, I would leave this alone unless the actual function contents or
      description needed updating. However, a future change is going to add
      inverse functions for converting packed context to unpacked context
      structures. To keep this code uniform with the existing set functions, fix
      up the style to the modern format of keeping the type on the same line.
      Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
      Reviewed-by: default avatarPrzemek Kitszel <przemyslaw.kitszel@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      979c2c04
    • Jacob Keller's avatar
      ice: use GENMASK instead of BIT(n) - 1 in pack functions · a45d1bf5
      Jacob Keller authored
      The functions used to pack the Tx and Rx context into the hardware format
      rely on using BIT() and then subtracting 1 to get a bitmask. These
      functions even have a comment about how x86 machines can't use this method
      for certain widths because the SHL instructions will not work properly.
      
      The Linux kernel already provides the GENMASK macro for generating a
      suitable bitmask. Further, GENMASK is capable of generating the mask
      including the shift_width. Since width is the total field width, take care
      to subtract one to get the final bit position.
      
      Since we now include the shifted bits as part of the mask, shift the source
      value first before applying the mask.
      Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
      Reviewed-by: default avatarPrzemek Kitszel <przemyslaw.kitszel@intel.com>
      Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com> (A Contingent worker at Intel)
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      a45d1bf5
    • Jacob Keller's avatar
      ice: rename ice_write_* functions to ice_pack_ctx_* · 1260b45d
      Jacob Keller authored
      In ice_common.c there are 4 functions used for converting the unpacked
      software Tx and Rx context structure data into the packed format used by
      hardware. These functions have extremely generic names:
      
       * ice_write_byte
       * ice_write_word
       * ice_write_dword
       * ice_write_qword
      
      When I saw these function names my first thought was "write what? to
      where?". Understanding what these functions do requires looking at the
      implementation details. The functions take bits from an unpacked structure
      and copy them into the packed layout used by hardware.
      
      As part of live migration, we will want functions which perform the inverse
      operation of reading bits from the packed layout and copying them into the
      unpacked format. Naming these as "ice_read_byte", etc would be very
      confusing since they appear to write data.
      
      In preparation for adding this new inverse operation, rename the existing
      functions to use the prefix "ice_pack_ctx_". This makes it clear that they
      perform the bit packing while copying from the unpacked software context
      structure to the packed hardware context.
      
      The inverse operations can then neatly be named ice_unpack_ctx_*, clearly
      indicating they perform the bit unpacking while copying from the packed
      hardware context to the unpacked software context structure.
      Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
      Reviewed-by: default avatarPrzemek Kitszel <przemyslaw.kitszel@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      1260b45d
  3. 12 Feb, 2024 3 commits
  4. 02 Jan, 2024 1 commit
  5. 27 Dec, 2023 1 commit
    • Arkadiusz Kubalewski's avatar
      ice: dpll: fix phase offset value · 8278a6a4
      Arkadiusz Kubalewski authored
      Stop dividing the phase_offset value received from firmware. This fault
      is present since the initial implementation.
      The phase_offset value received from firmware is in 0.01ps resolution.
      Dpll subsystem is using the value in 0.001ps, raw value is adjusted
      before providing it to the user.
      
      The user can observe the value of phase offset with response to
      `pin-get` netlink message of dpll subsystem for an active pin:
      $ ./tools/net/ynl/cli.py --spec Documentation/netlink/specs/dpll.yaml \
      	--do pin-get --json '{"id":2}'
      
      Where example of correct response would be:
      {'board-label': 'C827_0-RCLKA',
       'capabilities': 6,
       'clock-id': 4658613174691613800,
       'frequency': 1953125,
       'id': 2,
       'module-name': 'ice',
       'parent-device': [{'direction': 'input',
                          'parent-id': 6,
                          'phase-offset': -216839550,
                          'prio': 9,
                          'state': 'connected'},
                         {'direction': 'input',
                          'parent-id': 7,
                          'phase-offset': -42930,
                          'prio': 8,
                          'state': 'connected'}],
       'phase-adjust': 0,
       'phase-adjust-max': 16723,
       'phase-adjust-min': -16723,
       'type': 'mux'}
      
      Provided phase-offset value (-42930) shall be divided by the user with
      DPLL_PHASE_OFFSET_DIVIDER to get actual value of -42.930 ps.
      
      Before the fix, the response was not correct:
      {'board-label': 'C827_0-RCLKA',
       'capabilities': 6,
       'clock-id': 4658613174691613800,
       'frequency': 1953125,
       'id': 2,
       'module-name': 'ice',
       'parent-device': [{'direction': 'input',
                          'parent-id': 6,
                          'phase-offset': -216839,
                          'prio': 9,
                          'state': 'connected'},
                         {'direction': 'input',
                          'parent-id': 7,
                          'phase-offset': -42,
                          'prio': 8,
                          'state': 'connected'}],
       'phase-adjust': 0,
       'phase-adjust-max': 16723,
       'phase-adjust-min': -16723,
       'type': 'mux'}
      
      Where phase-offset value (-42), after division
      (DPLL_PHASE_OFFSET_DIVIDER) would be: -0.042 ps.
      
      Fixes: 8a3a565f ("ice: add admin commands to access cgu configuration")
      Fixes: 90e1c907 ("ice: dpll: implement phase related callbacks")
      Reviewed-by: default avatarAleksandr Loktionov <aleksandr.loktionov@intel.com>
      Reviewed-by: default avatarPrzemek Kitszel <przemyslaw.kitszel@intel.com>
      Signed-off-by: default avatarArkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
      Reviewed-by: default avatarPaul Menzel <pmenzel@molgen.mpg.de>
      Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com> (A Contingent worker at Intel)
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      8278a6a4
  6. 18 Dec, 2023 2 commits
    • Jesse Brandeburg's avatar
      ice: field get conversion · 5a259f8e
      Jesse Brandeburg authored
      Refactor the ice driver to use FIELD_GET() for mask and shift reads,
      which reduces lines of code and adds clarity of intent.
      
      This code was generated by the following coccinelle/spatch script and
      then manually repaired.
      
      @get@
      constant shift,mask;
      type T;
      expression a;
      @@
      -(((T)(a) & mask) >> shift)
      +FIELD_GET(mask, a)
      
      and applied via:
      spatch --sp-file field_prep.cocci --in-place --dir \
       drivers/net/ethernet/intel/
      
      CC: Alexander Lobakin <aleksander.lobakin@intel.com>
      Cc: Julia Lawall <Julia.Lawall@inria.fr>
      Reviewed-by: default avatarMarcin Szycik <marcin.szycik@linux.intel.com>
      Reviewed-by: default avatarSimon Horman <horms@kernel.org>
      Signed-off-by: default avatarJesse Brandeburg <jesse.brandeburg@intel.com>
      Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com> (A Contingent worker at Intel)
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      5a259f8e
    • Jesse Brandeburg's avatar
      ice: field prep conversion · 23eca34e
      Jesse Brandeburg authored
      Refactor ice driver to use FIELD_PREP(), which reduces lines of code
      and adds clarity of intent.
      
      This code was generated by the following coccinelle/spatch script and
      then manually repaired.
      
      Several places I changed to OR into a single variable with |= instead of
      using a multi-line statement with trailing OR operators, as it
      (subjectively) makes the code clearer.
      
      A local variable vmvf_and_timeout was created and used to avoid multiple
      logical ORs being __le16 converted, which shortened some lines and makes
      the code cleaner.
      
      Also clean up a couple of places where conversions were made to have the
      code read more clearly/consistently.
      
      @prep2@
      constant shift,mask;
      type T;
      expression a;
      @@
      -(((T)(a) << shift) & mask)
      +FIELD_PREP(mask, a)
      
      @prep@
      constant shift,mask;
      type T;
      expression a;
      @@
      -((T)((a) << shift) & mask)
      +FIELD_PREP(mask, a)
      
      Cc: Julia Lawall <Julia.Lawall@inria.fr>
      CC: Alexander Lobakin <aleksander.lobakin@intel.com>
      Reviewed-by: default avatarMarcin Szycik <marcin.szycik@linux.intel.com>
      Reviewed-by: default avatarSimon Horman <horms@kernel.org>
      Signed-off-by: default avatarJesse Brandeburg <jesse.brandeburg@intel.com>
      Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com> (A Contingent worker at Intel)
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      23eca34e
  7. 14 Dec, 2023 2 commits
    • Paul M Stillwell Jr's avatar
      ice: configure FW logging · 96a9a934
      Paul M Stillwell Jr authored
      Users want the ability to debug FW issues by retrieving the
      FW logs from the E8xx devices. Use debugfs to allow the user to
      configure the log level and number of messages for FW logging.
      
      If FW logging is supported on the E8xx then the file 'fwlog' will be
      created under the PCI device ID for the ice driver. If the file does not
      exist then either the E8xx doesn't support FW logging or debugfs is not
      enabled on the system.
      
      One thing users want to do is control which events are reported. The
      user can read and write the 'fwlog/modules/<module name>' to get/set
      the log levels. Each module in the FW that supports logging ht as a file
      under 'fwlog/modules' that supports reading (to see what the current log
      level is) and writing (to change the log level).
      
      The format to set the log levels for a module are:
      
        # echo <log level> > /sys/kernel/debug/ice/0000\:18\:00.0/fwlog/modules/<module>
      
      The supported log levels are:
      
            *	none
            *	error
            *	warning
            *	normal
            *	verbose
      
      Each level includes the messages from the previous/lower level
      
      The modules that are supported are:
      
            *	general
            *	ctrl
            *	link
            *	link_topo
            *	dnl
            *	i2c
            *	sdp
            *	mdio
            *	adminq
            *	hdma
            *	lldp
            *	dcbx
            *	dcb
            *	xlr
            *	nvm
            *	auth
            *	vpd
            *	iosf
            *	parser
            *	sw
            *	scheduler
            *	txq
            *	rsvd
            *	post
            *	watchdog
            *	task_dispatch
            *	mng
            *	synce
            *	health
            *	tsdrv
            *	pfreg
            *	mdlver
            *	all
      
      The module 'all' is a special module which allows the user to read or
      write to all of the modules.
      
      The following example command would set the DCB module to the 'normal'
      log level:
      
        # echo normal > /sys/kernel/debug/ice/0000\:18\:00.0/fwlog/modules/dcb
      
      If the user wants to set the DCB, Link, and the AdminQ modules to
      'verbose' then the commands are:
      
        # echo verbose > /sys/kernel/debug/ice/0000\:18\:00.0/fwlog/modules/dcb
        # echo verbose > /sys/kernel/debug/ice/0000\:18\:00.0/fwlog/modules/link
        # echo verbose > /sys/kernel/debug/ice/0000\:18\:00.0/fwlog/modules/adminq
      
      If the user wants to set all modules to the 'warning' level then the
      command is:
      
        # echo warning > /sys/kernel/debug/ice/0000\:18\:00.0/fwlog/modules/all
      
      If the user wants to disable logging for a module then they can set the
      level to 'none'. An example setting the 'watchdog' module is:
      
        # echo none > /sys/kernel/debug/ice/0000\:18\:00.0/fwlog/modules/watchdog
      
      If the user wants to see what the log level is for a specific module
      then the command is:
      
        # cat /sys/kernel/debug/ice/0000\:18\:00.0/fwlog/modules/dcb
      
      This will return the log level for the DCB module. If the user wants to
      see the log level for all the modules then the command is:
      
        # cat /sys/kernel/debug/ice/0000\:18\:00.0/fwlog/modules/all
      
      Writing to the module file will update the configuration, but NOT enable the
      configuration (that is a separate command).
      
      In addition to configuring the modules, the user can also configure the
      number of log messages (nr_messages) to include in a single Admin Receive
      Queue (ARQ) event.The range is 1-128 (1 means push every log message, 128
      means push only when the max AQ command buffer is full). The suggested
      value is 10.
      
      To see/change the resolution the user can read/write the
      'fwlog/nr_messages' file. An example changing the value to 50 is
      
        # echo 50 > /sys/kernel/debug/ice/0000\:18\:00.0/fwlog/nr_messages
      
      To see the current value of 'nr_messages' then the command is:
      
        # cat /sys/kernel/debug/ice/0000\:18\:00.0/fwlog/nr_messages
      Signed-off-by: default avatarPaul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
      Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com> (A Contingent worker at Intel)
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      96a9a934
    • Paul M Stillwell Jr's avatar
      ice: remove FW logging code · 1953fc72
      Paul M Stillwell Jr authored
      The FW logging code doesn't work because there is no way to set
      cq_ena or uart_ena so remove the code. This code is the original
      (v1) way of FW logging so it should be replaced with the v2 way.
      Signed-off-by: default avatarPaul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
      Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com> (A Contingent worker at Intel)
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      1953fc72
  8. 05 Dec, 2023 1 commit
    • Konrad Knitter's avatar
      ice: read internal temperature sensor · 4da71a77
      Konrad Knitter authored
      Since 4.30 firmware exposes internal thermal sensor reading via admin
      queue commands. Expose those readouts via hwmon API when supported.
      
      Datasheet:
      
      Get Sensor Reading Command (Opcode: 0x0632)
      
      +--------------------+--------+--------------------+-------------------------+
      | Name               | Bytes  | Value              |          Remarks        |
      +--------------------+--------+--------------------+-------------------------+
      | Flags              | 1-0    |                    |                         |
      | Opcode             | 2-3    | 0x0632             | Command opcode          |
      | Datalen            | 4-5    | 0                  | No external buffer.     |
      | Return value       | 6-7    |                    | Return value.           |
      | Cookie High        | 8-11   | Cookie             |                         |
      | Cookie Low         | 12-15  | Cookie             |                         |
      | Sensor             | 16     |                    | 0x00: Internal temp     |
      |                    |        |                    | 0x01-0xFF: Reserved.    |
      | Format             | 17     | Requested response | Only 0x00 is supported. |
      |                    |        | format             | 0x01-0xFF: Reserved.    |
      | Reserved           | 18-23  |                    |                         |
      | Data Address high  | 24-27  | Response buffer    |                         |
      |                    |        | address            |                         |
      | Data Address low   | 28-31  | Response buffer    |                         |
      |                    |        | address            |                         |
      +--------------------+--------+--------------------+-------------------------+
      
      Get Sensor Reading Response (Opcode: 0x0632)
      
      +--------------------+--------+--------------------+-------------------------+
      | Name               | Bytes  | Value              |          Remarks        |
      +--------------------+--------+--------------------+-------------------------+
      | Flags              | 1-0    |                    |                         |
      | Opcode             | 2-3    | 0x0632             | Command opcode          |
      | Datalen            | 4-5    | 0                  | No external buffer      |
      | Return value       | 6-7    |                    | Return value.           |
      |                    |        |                    | EINVAL: Invalid         |
      |                    |        |                    | parameters              |
      |                    |        |                    | ENOENT: Unsupported     |
      |                    |        |                    | sensor                  |
      |                    |        |                    | EIO: Sensor access      |
      |                    |        |                    | error                   |
      | Cookie High        | 8-11   | Cookie             |                         |
      | Cookie Low         | 12-15  | Cookie             |                         |
      | Sensor Reading     | 16-23  |                    | Format of the reading   |
      |                    |        |                    | is dependent on request |
      | Data Address high  | 24-27  | Response buffer    |                         |
      |                    |        | address            |                         |
      | Data Address low   | 28-31  | Response buffer    |                         |
      |                    |        | address            |                         |
      +--------------------+--------+--------------------+-------------------------+
      
      Sensor Reading for Sensor 0x00 (Internal Chip Temperature):
      
      +--------------------+--------+--------------------+-------------------------+
      | Name               | Bytes  | Value              |          Remarks        |
      +--------------------+--------+--------------------+-------------------------+
      | Thermal Sensor     | 0      |                    | Reading in degrees      |
      | reading            |        |                    | Celsius. Signed int8    |
      | Warning High       | 1      |                    | Warning High threshold  |
      | threshold          |        |                    | in degrees Celsius.     |
      |                    |        |                    | Unsigned int8.          |
      |                    |        |                    | 0xFF when unsupported   |
      | Critical High      | 2      |                    | Critical High threshold |
      | threshold          |        |                    | in degrees Celsius.     |
      |                    |        |                    | Unsigned int8.          |
      |                    |        |                    | 0xFF when unsupported   |
      | Fatal High         | 3      |                    | Fatal High threshold    |
      | threshold          |        |                    | in degrees Celsius.     |
      |                    |        |                    | Unsigned int8.          |
      |                    |        |                    | 0xFF when unsupported   |
      | Reserved           | 4-7    |                    |                         |
      +--------------------+--------+--------------------+-------------------------+
      
      Driver provides current reading from HW as well as device specific
      thresholds for thermal alarm (Warning, Critical, Fatal) events.
      
      $ sensors
      
      Output
      =========================================================
      ice-pci-b100
      Adapter: PCI adapter
      temp1:        +62.0°C  (high = +95.0°C, crit = +105.0°C)
                             (emerg = +115.0°C)
      
      Tested on Intel Corporation Ethernet Controller E810-C for SFP
      Co-developed-by: default avatarMarcin Domagala <marcinx.domagala@intel.com>
      Signed-off-by: default avatarMarcin Domagala <marcinx.domagala@intel.com>
      Co-developed-by: default avatarEric Joyner <eric.joyner@intel.com>
      Signed-off-by: default avatarEric Joyner <eric.joyner@intel.com>
      Reviewed-by: default avatarMarcin Szycik <marcin.szycik@linux.intel.com>
      Reviewed-by: default avatarPrzemek Kitszel <przemyslaw.kitszel@intel.com>
      Signed-off-by: default avatarKonrad Knitter <konrad.knitter@intel.com>
      Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com> (A Contingent worker at Intel)
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      4da71a77
  9. 27 Oct, 2023 3 commits
  10. 20 Oct, 2023 1 commit
  11. 04 Oct, 2023 1 commit
    • Jacob Keller's avatar
      ice: fix linking when CONFIG_PTP_1588_CLOCK=n · 91e43ca0
      Jacob Keller authored
      The recent support for DPLL introduced by commit 8a3a565f ("ice: add
      admin commands to access cgu configuration") and commit d7999f5e ("ice:
      implement dpll interface to control cgu") broke linking the ice driver if
      CONFIG_PTP_1588_CLOCK=n:
      
      ld: vmlinux.o: in function `ice_init_feature_support':
      (.text+0x8702b8): undefined reference to `ice_is_phy_rclk_present'
      ld: (.text+0x8702cd): undefined reference to `ice_is_cgu_present'
      ld: (.text+0x8702d9): undefined reference to `ice_is_clock_mux_present_e810t'
      ld: vmlinux.o: in function `ice_dpll_init_info_direct_pins':
      ice_dpll.c:(.text+0x894167): undefined reference to `ice_cgu_get_pin_freq_supp'
      ld: ice_dpll.c:(.text+0x894197): undefined reference to `ice_cgu_get_pin_name'
      ld: ice_dpll.c:(.text+0x8941a8): undefined reference to `ice_cgu_get_pin_type'
      ld: vmlinux.o: in function `ice_dpll_update_state':
      ice_dpll.c:(.text+0x894494): undefined reference to `ice_get_cgu_state'
      ld: vmlinux.o: in function `ice_dpll_init':
      (.text+0x8953d5): undefined reference to `ice_get_cgu_rclk_pin_info'
      
      The first commit broke things by calling functions in
      ice_init_feature_support that are compiled as part of ice_ptp_hw.o,
      including:
      
      * ice_is_phy_rclk_present
      * ice_is_clock_mux_present_e810t
      * ice_is_cgU_present
      
      The second commit continued the break by calling several CGU functions
      defined in ice_ptp_hw.c in the DPLL code.
      Because the ice_dpll.c file is compiled unconditionally, it will not
      link when CONFIG_PTP_1588_CLOCK=n.
      
      It might be possible to break this dependency and expose those functions
      without CONFIG_PTP_1588_CLOCK, but that is not clear to me.
      
      For the DPLL case, simply compile ice_dpll.o only when we have
      CONFIG_PTP_1588_CLOCK. Add stub no-op implementation of ice_dpll_init() and
      ice_dpll_uninit() when CONFIG_PTP_1588_CLOCK=n into ice_dpll.h
      
      The other functions are part of checking the netlist to see if hardware
      features are enabled. These checks don't really belong in ice_ptp_hw.c, and
      make more sense as part of the ice_common.c file. We already have
      ice_is_gps_in_netlist() in ice_common.c which is doing a similar check.
      
      Move the functions into ice_common.c and rename them to have the similar
      postfix of "in_netlist()" to be more expressive of what they are actually
      checking.
      
      This also makes the ice_find_netlist_node only called from within
      ice_common.c, so its safe to mark it static and stop declaring it in the
      ice_common.h header as well.
      
      Fixes: 8a3a565f ("ice: add admin commands to access cgu configuration")
      Fixes: d7999f5e ("ice: implement dpll interface to control cgu")
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Closes: https://lore.kernel.org/oe-kbuild-all/202309191214.TaYEct4H-lkp@intel.comSigned-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
      Reviewed-by: default avatarPrzemek Kitszel <przemyslaw.kitszel@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      Reviewed-by: default avatarSimon Horman <horms@kernel.org>
      Tested-by: Simon Horman <horms@kernel.org> # build-tested
      Link: https://lore.kernel.org/r/20231002185132.1575271-1-anthony.l.nguyen@intel.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      91e43ca0
  12. 03 Oct, 2023 1 commit
  13. 20 Sep, 2023 1 commit
  14. 18 Sep, 2023 1 commit
  15. 17 Sep, 2023 1 commit
  16. 17 Aug, 2023 1 commit
  17. 07 Aug, 2023 2 commits
    • Przemek Kitszel's avatar
      ice: clean up __ice_aq_get_set_rss_lut() · b6143c9b
      Przemek Kitszel authored
      Refactor __ice_aq_get_set_rss_lut() to improve reader experience and limit
      misuse scenarios (undesired LUT size for given LUT type).
      
      Allow only 3 RSS LUT type+size variants:
      PF LUT sized 2048, GLOBAL LUT sized 512, and VSI LUT sized 64, which were
      used on default flows prior to this commit.
      
      Prior to the change, code was mixing the meaning of @params->lut_size and
      @params->lut_type, flag assigning logic was cryptic, while long defines
      made everything harder to follow.
      
      Fix that by extracting some code out to separate helpers.
      Drop some of "shift by 0" statements that originated from Intel's
      internal HW documentation.
      
      Drop some redundant VSI masks (since ice_is_vsi_valid() gives "valid" for
      up to 0x300 VSIs).
      
      After sweeping all the defines out of struct ice_aqc_get_set_rss_lut,
      it fits into 7 lines.
      
      Finally apply some cleanup to the callsite
      (use of the new enums, tmp var for lengthy bit extraction).
      
      Note that flags for 128 and 64 sized VSI LUT are the same,
      and 64 is used everywhere in the code (updated to new enum here), it just
      happened that there was 128 in flag name.
      
      __ice_aq_get_set_rss_key() uses the same VSI valid bit, make constant
      common for it and __ice_aq_get_set_rss_lut().
      Signed-off-by: default avatarPrzemek Kitszel <przemyslaw.kitszel@intel.com>
      Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
      Tested-by: Arpana Arland <arpanax.arland@intel.com> (A Contingent worker at Intel)
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      b6143c9b
    • Karol Kolacinski's avatar
      ice: Add get C827 PHY index function · 272ad794
      Karol Kolacinski authored
      Add a function to find the C827 PHY node handle and return C827 PHY
      index for the E810 products.
      
      In order to bring this function to full functionality, some
      helpers for this were written by Michal Michalik.
      Co-developed-by: default avatarMichal Michalik <michal.michalik@intel.com>
      Signed-off-by: default avatarMichal Michalik <michal.michalik@intel.com>
      Signed-off-by: default avatarKarol Kolacinski <karol.kolacinski@intel.com>
      Signed-off-by: default avatarJan Sokolowski <jan.sokolowski@intel.com>
      Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com> (A Contingent worker at Intel)
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      272ad794
  18. 27 Jul, 2023 3 commits
  19. 22 Jun, 2023 2 commits
  20. 07 Jun, 2023 1 commit
  21. 20 Apr, 2023 4 commits
  22. 14 Feb, 2023 1 commit
  23. 06 Feb, 2023 1 commit
    • Michal Swiatkowski's avatar
      ice: fix out-of-bounds KASAN warning in virtchnl · b2dbde3a
      Michal Swiatkowski authored
      KASAN reported:
      [ 9793.708867] BUG: KASAN: global-out-of-bounds in ice_get_link_speed+0x16/0x30 [ice]
      [ 9793.709205] Read of size 4 at addr ffffffffc1271b1c by task kworker/6:1/402
      
      [ 9793.709222] CPU: 6 PID: 402 Comm: kworker/6:1 Kdump: loaded Tainted: G    B      OE      6.1.0+ #3
      [ 9793.709235] Hardware name: Intel Corporation S2600WFT/S2600WFT, BIOS SE5C620.86B.00.01.0014.070920180847 07/09/2018
      [ 9793.709245] Workqueue: ice ice_service_task [ice]
      [ 9793.709575] Call Trace:
      [ 9793.709582]  <TASK>
      [ 9793.709588]  dump_stack_lvl+0x44/0x5c
      [ 9793.709613]  print_report+0x17f/0x47b
      [ 9793.709632]  ? __cpuidle_text_end+0x5/0x5
      [ 9793.709653]  ? ice_get_link_speed+0x16/0x30 [ice]
      [ 9793.709986]  ? ice_get_link_speed+0x16/0x30 [ice]
      [ 9793.710317]  kasan_report+0xb7/0x140
      [ 9793.710335]  ? ice_get_link_speed+0x16/0x30 [ice]
      [ 9793.710673]  ice_get_link_speed+0x16/0x30 [ice]
      [ 9793.711006]  ice_vc_notify_vf_link_state+0x14c/0x160 [ice]
      [ 9793.711351]  ? ice_vc_repr_cfg_promiscuous_mode+0x120/0x120 [ice]
      [ 9793.711698]  ice_vc_process_vf_msg+0x7a7/0xc00 [ice]
      [ 9793.712074]  __ice_clean_ctrlq+0x98f/0xd20 [ice]
      [ 9793.712534]  ? ice_bridge_setlink+0x410/0x410 [ice]
      [ 9793.712979]  ? __request_module+0x320/0x520
      [ 9793.713014]  ? ice_process_vflr_event+0x27/0x130 [ice]
      [ 9793.713489]  ice_service_task+0x11cf/0x1950 [ice]
      [ 9793.713948]  ? io_schedule_timeout+0xb0/0xb0
      [ 9793.713972]  process_one_work+0x3d0/0x6a0
      [ 9793.714003]  worker_thread+0x8a/0x610
      [ 9793.714031]  ? process_one_work+0x6a0/0x6a0
      [ 9793.714049]  kthread+0x164/0x1a0
      [ 9793.714071]  ? kthread_complete_and_exit+0x20/0x20
      [ 9793.714100]  ret_from_fork+0x1f/0x30
      [ 9793.714137]  </TASK>
      
      [ 9793.714151] The buggy address belongs to the variable:
      [ 9793.714158]  ice_aq_to_link_speed+0x3c/0xffffffffffff3520 [ice]
      
      [ 9793.714632] Memory state around the buggy address:
      [ 9793.714642]  ffffffffc1271a00: f9 f9 f9 f9 00 00 05 f9 f9 f9 f9 f9 00 00 02 f9
      [ 9793.714656]  ffffffffc1271a80: f9 f9 f9 f9 00 00 04 f9 f9 f9 f9 f9 00 00 00 00
      [ 9793.714670] >ffffffffc1271b00: 00 00 00 04 f9 f9 f9 f9 04 f9 f9 f9 f9 f9 f9 f9
      [ 9793.714680]                             ^
      [ 9793.714690]  ffffffffc1271b80: 00 00 00 00 00 04 f9 f9 f9 f9 f9 f9 00 00 00 00
      [ 9793.714704]  ffffffffc1271c00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      
      The ICE_AQ_LINK_SPEED_UNKNOWN define is BIT(15). The value is bigger
      than both legacy and normal link speed tables. Add one element (0 -
      unknown) to both tables. There is no need to explicitly set table size,
      leave it empty.
      
      Fixes: 1d0e28a9 ("ice: Remove and replace ice speed defines with ethtool.h versions")
      Signed-off-by: default avatarMichal Swiatkowski <michal.swiatkowski@linux.intel.com>
      Reviewed-by: default avatarAlexander Lobakin <alexandr.lobakin@intel.com>
      Tested-by: Gurucharan G <gurucharanx.g@intel.com> (A Contingent worker at Intel)
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      Reviewed-by: default avatarLeon Romanovsky <leonro@nvidia.com>
      b2dbde3a
  24. 03 Feb, 2023 1 commit
    • Michal Swiatkowski's avatar
      ice: split probe into smaller functions · 5b246e53
      Michal Swiatkowski authored
      Part of code from probe can be reused in reload flow. Move this code to
      separate function. Create unroll functions for each part of
      initialization, like: ice_init_dev() and ice_deinit_dev(). It
      simplifies unrolling and can be used in remove flow.
      
      Avoid freeing port info as it could be reused in reload path.
      Will be freed in remove path since is allocated via devm_kzalloc().
      
      Also clean the remove path to reflect the init steps.
      Signed-off-by: default avatarMichal Swiatkowski <michal.swiatkowski@linux.intel.com>
      Tested-by: Gurucharan G <gurucharanx.g@intel.com> (A Contingent worker at Intel)
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      5b246e53