1. 04 Jan, 2024 12 commits
  2. 03 Jan, 2024 9 commits
  3. 02 Jan, 2024 5 commits
  4. 01 Jan, 2024 5 commits
  5. 29 Dec, 2023 3 commits
  6. 27 Dec, 2023 6 commits
    • Kurt Kanzenbach's avatar
      igc: Check VLAN EtherType mask · 7afd49a3
      Kurt Kanzenbach authored
      Currently the driver accepts VLAN EtherType steering rules regardless of
      the configured mask. And things might fail silently or with confusing error
      messages to the user. The VLAN EtherType can only be matched by full
      mask. Therefore, add a check for that.
      
      For instance the following rule is invalid, but the driver accepts it and
      ignores the user specified mask:
      |root@host:~# ethtool -N enp3s0 flow-type ether vlan-etype 0x8100 \
      |             m 0x00ff action 0
      |Added rule with ID 63
      |root@host:~# ethtool --show-ntuple enp3s0
      |4 RX rings available
      |Total 1 rules
      |
      |Filter: 63
      |        Flow Type: Raw Ethernet
      |        Src MAC addr: 00:00:00:00:00:00 mask: FF:FF:FF:FF:FF:FF
      |        Dest MAC addr: 00:00:00:00:00:00 mask: FF:FF:FF:FF:FF:FF
      |        Ethertype: 0x0 mask: 0xFFFF
      |        VLAN EtherType: 0x8100 mask: 0x0
      |        VLAN: 0x0 mask: 0xffff
      |        User-defined: 0x0 mask: 0xffffffffffffffff
      |        Action: Direct to queue 0
      
      After:
      |root@host:~# ethtool -N enp3s0 flow-type ether vlan-etype 0x8100 \
      |             m 0x00ff action 0
      |rmgr: Cannot insert RX class rule: Operation not supported
      
      Fixes: 2b477d05 ("igc: Integrate flex filter into ethtool ops")
      Suggested-by: default avatarSuman Ghosh <sumang@marvell.com>
      Signed-off-by: Kurt Kanzenbach's avatarKurt Kanzenbach <kurt@linutronix.de>
      Acked-by: default avatarVinicius Costa Gomes <vinicius.gomes@intel.com>
      Reviewed-by: default avatarSimon Horman <horms@kernel.org>
      Tested-by: default avatarNaama Meir <naamax.meir@linux.intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      7afd49a3
    • Kurt Kanzenbach's avatar
      igc: Check VLAN TCI mask · b5063cbe
      Kurt Kanzenbach authored
      Currently the driver accepts VLAN TCI steering rules regardless of the
      configured mask. And things might fail silently or with confusing error
      messages to the user.
      
      There are two ways to handle the VLAN TCI mask:
      
       1. Match on the PCP field using a VLAN prio filter
       2. Match on complete TCI field using a flex filter
      
      Therefore, add checks and code for that.
      
      For instance the following rule is invalid and will be converted into a
      VLAN prio rule which is not correct:
      |root@host:~# ethtool -N enp3s0 flow-type ether vlan 0x0001 m 0xf000 \
      |             action 1
      |Added rule with ID 61
      |root@host:~# ethtool --show-ntuple enp3s0
      |4 RX rings available
      |Total 1 rules
      |
      |Filter: 61
      |        Flow Type: Raw Ethernet
      |        Src MAC addr: 00:00:00:00:00:00 mask: FF:FF:FF:FF:FF:FF
      |        Dest MAC addr: 00:00:00:00:00:00 mask: FF:FF:FF:FF:FF:FF
      |        Ethertype: 0x0 mask: 0xFFFF
      |        VLAN EtherType: 0x0 mask: 0xffff
      |        VLAN: 0x1 mask: 0x1fff
      |        User-defined: 0x0 mask: 0xffffffffffffffff
      |        Action: Direct to queue 1
      
      After:
      |root@host:~# ethtool -N enp3s0 flow-type ether vlan 0x0001 m 0xf000 \
      |             action 1
      |rmgr: Cannot insert RX class rule: Operation not supported
      
      Fixes: 7991487e ("igc: Allow for Flex Filters to be installed")
      Signed-off-by: Kurt Kanzenbach's avatarKurt Kanzenbach <kurt@linutronix.de>
      Acked-by: default avatarVinicius Costa Gomes <vinicius.gomes@intel.com>
      Reviewed-by: default avatarSimon Horman <horms@kernel.org>
      Tested-by: default avatarNaama Meir <naamax.meir@linux.intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      b5063cbe
    • Kurt Kanzenbach's avatar
      igc: Report VLAN EtherType matching back to user · 088464ab
      Kurt Kanzenbach authored
      Currently the driver allows to configure matching by VLAN EtherType.
      However, the retrieval function does not report it back to the user. Add
      it.
      
      Before:
      |root@host:~# ethtool -N enp3s0 flow-type ether vlan-etype 0x8100 action 0
      |Added rule with ID 63
      |root@host:~# ethtool --show-ntuple enp3s0
      |4 RX rings available
      |Total 1 rules
      |
      |Filter: 63
      |        Flow Type: Raw Ethernet
      |        Src MAC addr: 00:00:00:00:00:00 mask: FF:FF:FF:FF:FF:FF
      |        Dest MAC addr: 00:00:00:00:00:00 mask: FF:FF:FF:FF:FF:FF
      |        Ethertype: 0x0 mask: 0xFFFF
      |        Action: Direct to queue 0
      
      After:
      |root@host:~# ethtool -N enp3s0 flow-type ether vlan-etype 0x8100 action 0
      |Added rule with ID 63
      |root@host:~# ethtool --show-ntuple enp3s0
      |4 RX rings available
      |Total 1 rules
      |
      |Filter: 63
      |        Flow Type: Raw Ethernet
      |        Src MAC addr: 00:00:00:00:00:00 mask: FF:FF:FF:FF:FF:FF
      |        Dest MAC addr: 00:00:00:00:00:00 mask: FF:FF:FF:FF:FF:FF
      |        Ethertype: 0x0 mask: 0xFFFF
      |        VLAN EtherType: 0x8100 mask: 0x0
      |        VLAN: 0x0 mask: 0xffff
      |        User-defined: 0x0 mask: 0xffffffffffffffff
      |        Action: Direct to queue 0
      
      Fixes: 2b477d05 ("igc: Integrate flex filter into ethtool ops")
      Signed-off-by: Kurt Kanzenbach's avatarKurt Kanzenbach <kurt@linutronix.de>
      Acked-by: default avatarVinicius Costa Gomes <vinicius.gomes@intel.com>
      Reviewed-by: default avatarSimon Horman <horms@kernel.org>
      Tested-by: default avatarNaama Meir <naamax.meir@linux.intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      088464ab
    • Sudheer Mogilappagari's avatar
      i40e: Fix filter input checks to prevent config with invalid values · 3e48041d
      Sudheer Mogilappagari authored
      Prevent VF from configuring filters with unsupported actions or use
      REDIRECT action with invalid tc number. Current checks could cause
      out of bounds access on PF side.
      
      Fixes: e284fc28 ("i40e: Add and delete cloud filter")
      Reviewed-by: default avatarAndrii Staikov <andrii.staikov@intel.com>
      Signed-off-by: default avatarSudheer Mogilappagari <sudheer.mogilappagari@intel.com>
      Signed-off-by: default avatarAleksandr Loktionov <aleksandr.loktionov@intel.com>
      Reviewed-by: default avatarSimon Horman <horms@kernel.org>
      Tested-by: default avatarBharathi Sreenivas <bharathi.sreenivas@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      3e48041d
    • 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
    • Ngai-Mint Kwan's avatar
      ice: Shut down VSI with "link-down-on-close" enabled · 6d05ff55
      Ngai-Mint Kwan authored
      Disabling netdev with ethtool private flag "link-down-on-close" enabled
      can cause NULL pointer dereference bug. Shut down VSI regardless of
      "link-down-on-close" state.
      
      Fixes: 8ac71327 ("ice: Fix interface being down after reset with link-down-on-close flag on")
      Reviewed-by: default avatarPrzemek Kitszel <przemyslaw.kitszel@intel.com>
      Signed-off-by: default avatarNgai-Mint Kwan <ngai-mint.kwan@intel.com>
      Signed-off-by: default avatarWojciech Drewek <wojciech.drewek@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>
      6d05ff55