1. 07 9月, 2022 8 次提交
  2. 01 9月, 2022 1 次提交
  3. 25 8月, 2022 2 次提交
    • S
      i40e: Fix incorrect address type for IPv6 flow rules · bcf3a156
      Sylwester Dziedziuch 提交于
      It was not possible to create 1-tuple flow director
      rule for IPv6 flow type. It was caused by incorrectly
      checking for source IP address when validating user provided
      destination IP address.
      
      Fix this by changing ip6src to correct ip6dst address
      in destination IP address validation for IPv6 flow type.
      
      Fixes: efca91e8 ("i40e: Add flow director support for IPv6")
      Signed-off-by: NSylwester Dziedziuch <sylwesterx.dziedziuch@intel.com>
      Tested-by: Gurucharan <gurucharanx.g@intel.com> (A Contingent worker at Intel)
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      bcf3a156
    • J
      ixgbe: stop resetting SYSTIME in ixgbe_ptp_start_cyclecounter · 25d7a5f5
      Jacob Keller 提交于
      The ixgbe_ptp_start_cyclecounter is intended to be called whenever the
      cyclecounter parameters need to be changed.
      
      Since commit a9763f3c ("ixgbe: Update PTP to support X550EM_x
      devices"), this function has cleared the SYSTIME registers and reset the
      TSAUXC DISABLE_SYSTIME bit.
      
      While these need to be cleared during ixgbe_ptp_reset, it is wrong to clear
      them during ixgbe_ptp_start_cyclecounter. This function may be called
      during both reset and link status change. When link changes, the SYSTIME
      counter is still operating normally, but the cyclecounter should be updated
      to account for the possibly changed parameters.
      
      Clearing SYSTIME when link changes causes the timecounter to jump because
      the cycle counter now reads zero.
      
      Extract the SYSTIME initialization out to a new function and call this
      during ixgbe_ptp_reset. This prevents the timecounter adjustment and avoids
      an unnecessary reset of the current time.
      
      This also restores the original SYSTIME clearing that occurred during
      ixgbe_ptp_reset before the commit above.
      Reported-by: NSteve Payne <spayne@aurora.tech>
      Reported-by: NIlya Evenbach <ievenbach@aurora.tech>
      Fixes: a9763f3c ("ixgbe: Update PTP to support X550EM_x devices")
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Tested-by: Gurucharan <gurucharanx.g@intel.com> (A Contingent worker at Intel)
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      25d7a5f5
  4. 24 8月, 2022 5 次提交
  5. 22 8月, 2022 2 次提交
    • M
      ice: xsk: use Rx ring's XDP ring when picking NAPI context · 9ead7e74
      Maciej Fijalkowski 提交于
      Ice driver allocates per cpu XDP queues so that redirect path can safely
      use smp_processor_id() as an index to the array. At the same time
      though, XDP rings are used to pick NAPI context to call napi_schedule()
      or set NAPIF_STATE_MISSED. When user reduces queue count, say to 8, and
      num_possible_cpus() of underlying platform is 44, then this means queue
      vectors with correlated NAPI contexts will carry several XDP queues.
      
      This in turn can result in a broken behavior where NAPI context of
      interest will never be scheduled and AF_XDP socket will not process any
      traffic.
      
      To fix this, let us change the way how XDP rings are assigned to Rx
      rings and use this information later on when setting
      ice_tx_ring::xsk_pool pointer. For each Rx ring, grab the associated
      queue vector and walk through Tx ring's linked list. Once we stumble
      upon XDP ring in it, assign this ring to ice_rx_ring::xdp_ring.
      
      Previous [0] approach of fixing this issue was for txonly scenario
      because of the described grouping of XDP rings across queue vectors. So,
      relying on Rx ring meant that NAPI context could be scheduled with a
      queue vector without XDP ring with associated XSK pool.
      
      [0]: https://lore.kernel.org/netdev/20220707161128.54215-1-maciej.fijalkowski@intel.com/
      
      Fixes: 2d4238f5 ("ice: Add support for AF_XDP")
      Fixes: 22bf877e ("ice: introduce XDP_TX fallback path")
      Signed-off-by: NMaciej Fijalkowski <maciej.fijalkowski@intel.com>
      Tested-by: NGeorge Kuruvinakunnel <george.kuruvinakunnel@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      9ead7e74
    • M
      ice: xsk: prohibit usage of non-balanced queue id · 5a42f112
      Maciej Fijalkowski 提交于
      Fix the following scenario:
      1. ethtool -L $IFACE rx 8 tx 96
      2. xdpsock -q 10 -t -z
      
      Above refers to a case where user would like to attach XSK socket in
      txonly mode at a queue id that does not have a corresponding Rx queue.
      At this moment ice's XSK logic is tightly bound to act on a "queue pair",
      e.g. both Tx and Rx queues at a given queue id are disabled/enabled and
      both of them will get XSK pool assigned, which is broken for the presented
      queue configuration. This results in the splat included at the bottom,
      which is basically an OOB access to Rx ring array.
      
      To fix this, allow using the ids only in scope of "combined" queues
      reported by ethtool. However, logic should be rewritten to allow such
      configurations later on, which would end up as a complete rewrite of the
      control path, so let us go with this temporary fix.
      
      [420160.558008] BUG: kernel NULL pointer dereference, address: 0000000000000082
      [420160.566359] #PF: supervisor read access in kernel mode
      [420160.572657] #PF: error_code(0x0000) - not-present page
      [420160.579002] PGD 0 P4D 0
      [420160.582756] Oops: 0000 [#1] PREEMPT SMP NOPTI
      [420160.588396] CPU: 10 PID: 21232 Comm: xdpsock Tainted: G           OE     5.19.0-rc7+ #10
      [420160.597893] Hardware name: Intel Corporation S2600WFT/S2600WFT, BIOS SE5C620.86B.02.01.0008.031920191559 03/19/2019
      [420160.609894] RIP: 0010:ice_xsk_pool_setup+0x44/0x7d0 [ice]
      [420160.616968] Code: f3 48 83 ec 40 48 8b 4f 20 48 8b 3f 65 48 8b 04 25 28 00 00 00 48 89 44 24 38 31 c0 48 8d 04 ed 00 00 00 00 48 01 c1 48 8b 11 <0f> b7 92 82 00 00 00 48 85 d2 0f 84 2d 75 00 00 48 8d 72 ff 48 85
      [420160.639421] RSP: 0018:ffffc9002d2afd48 EFLAGS: 00010282
      [420160.646650] RAX: 0000000000000050 RBX: ffff88811d8bdd00 RCX: ffff888112c14ff8
      [420160.655893] RDX: 0000000000000000 RSI: ffff88811d8bdd00 RDI: ffff888109861000
      [420160.665166] RBP: 000000000000000a R08: 000000000000000a R09: 0000000000000000
      [420160.674493] R10: 000000000000889f R11: 0000000000000000 R12: 000000000000000a
      [420160.683833] R13: 000000000000000a R14: 0000000000000000 R15: ffff888117611828
      [420160.693211] FS:  00007fa869fc1f80(0000) GS:ffff8897e0880000(0000) knlGS:0000000000000000
      [420160.703645] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [420160.711783] CR2: 0000000000000082 CR3: 00000001d076c001 CR4: 00000000007706e0
      [420160.721399] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      [420160.731045] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      [420160.740707] PKRU: 55555554
      [420160.745960] Call Trace:
      [420160.750962]  <TASK>
      [420160.755597]  ? kmalloc_large_node+0x79/0x90
      [420160.762703]  ? __kmalloc_node+0x3f5/0x4b0
      [420160.769341]  xp_assign_dev+0xfd/0x210
      [420160.775661]  ? shmem_file_read_iter+0x29a/0x420
      [420160.782896]  xsk_bind+0x152/0x490
      [420160.788943]  __sys_bind+0xd0/0x100
      [420160.795097]  ? exit_to_user_mode_prepare+0x20/0x120
      [420160.802801]  __x64_sys_bind+0x16/0x20
      [420160.809298]  do_syscall_64+0x38/0x90
      [420160.815741]  entry_SYSCALL_64_after_hwframe+0x63/0xcd
      [420160.823731] RIP: 0033:0x7fa86a0dd2fb
      [420160.830264] Code: c3 66 0f 1f 44 00 00 48 8b 15 69 8b 0c 00 f7 d8 64 89 02 b8 ff ff ff ff eb bc 0f 1f 44 00 00 f3 0f 1e fa b8 31 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 3d 8b 0c 00 f7 d8 64 89 01 48
      [420160.855410] RSP: 002b:00007ffc1146f618 EFLAGS: 00000246 ORIG_RAX: 0000000000000031
      [420160.866366] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fa86a0dd2fb
      [420160.876957] RDX: 0000000000000010 RSI: 00007ffc1146f680 RDI: 0000000000000003
      [420160.887604] RBP: 000055d7113a0520 R08: 00007fa868fb8000 R09: 0000000080000000
      [420160.898293] R10: 0000000000008001 R11: 0000000000000246 R12: 000055d7113a04e0
      [420160.909038] R13: 000055d7113a0320 R14: 000000000000000a R15: 0000000000000000
      [420160.919817]  </TASK>
      [420160.925659] Modules linked in: ice(OE) af_packet binfmt_misc nls_iso8859_1 ipmi_ssif intel_rapl_msr intel_rapl_common x86_pkg_temp_thermal intel_powerclamp mei_me coretemp ioatdma mei ipmi_si wmi ipmi_msghandler acpi_pad acpi_power_meter ip_tables x_tables autofs4 ixgbe i40e crct10dif_pclmul crc32_pclmul ghash_clmulni_intel aesni_intel crypto_simd cryptd ahci mdio dca libahci lpc_ich [last unloaded: ice]
      [420160.977576] CR2: 0000000000000082
      [420160.985037] ---[ end trace 0000000000000000 ]---
      [420161.097724] RIP: 0010:ice_xsk_pool_setup+0x44/0x7d0 [ice]
      [420161.107341] Code: f3 48 83 ec 40 48 8b 4f 20 48 8b 3f 65 48 8b 04 25 28 00 00 00 48 89 44 24 38 31 c0 48 8d 04 ed 00 00 00 00 48 01 c1 48 8b 11 <0f> b7 92 82 00 00 00 48 85 d2 0f 84 2d 75 00 00 48 8d 72 ff 48 85
      [420161.134741] RSP: 0018:ffffc9002d2afd48 EFLAGS: 00010282
      [420161.144274] RAX: 0000000000000050 RBX: ffff88811d8bdd00 RCX: ffff888112c14ff8
      [420161.155690] RDX: 0000000000000000 RSI: ffff88811d8bdd00 RDI: ffff888109861000
      [420161.168088] RBP: 000000000000000a R08: 000000000000000a R09: 0000000000000000
      [420161.179295] R10: 000000000000889f R11: 0000000000000000 R12: 000000000000000a
      [420161.190420] R13: 000000000000000a R14: 0000000000000000 R15: ffff888117611828
      [420161.201505] FS:  00007fa869fc1f80(0000) GS:ffff8897e0880000(0000) knlGS:0000000000000000
      [420161.213628] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [420161.223413] CR2: 0000000000000082 CR3: 00000001d076c001 CR4: 00000000007706e0
      [420161.234653] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      [420161.245893] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      [420161.257052] PKRU: 55555554
      
      Fixes: 2d4238f5 ("ice: Add support for AF_XDP")
      Signed-off-by: NMaciej Fijalkowski <maciej.fijalkowski@intel.com>
      Tested-by: NGeorge Kuruvinakunnel <george.kuruvinakunnel@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      5a42f112
  6. 19 8月, 2022 3 次提交
  7. 18 8月, 2022 11 次提交
  8. 17 8月, 2022 6 次提交
    • J
      ice: introduce ice_ptp_reset_cached_phctime function · b1a582e6
      Jacob Keller 提交于
      If the PTP hardware clock is adjusted, the ice driver must update the
      cached PHC timestamp. This is required in order to perform timestamp
      extension on the shorter timestamps captured by the PHY.
      
      Currently, we simply call ice_ptp_update_cached_phctime in the settime and
      adjtime callbacks. This has a few issues:
      
      1) if ICE_CFG_BUSY is set because another thread is updating the Rx rings,
         we will exit with an error. This is not checked, and the functions do
         not re-schedule the update. This could leave the cached timestamp
         incorrect until the next scheduled work item execution.
      
      2) even if we did handle an update, any currently outstanding Tx timestamp
         would be extended using the wrong cached PHC time. This would produce
         incorrect results.
      
      To fix these issues, introduce a new ice_ptp_reset_cached_phctime function.
      This function calls the ice_ptp_update_cached_phctime, and discards
      outstanding Tx timestamps.
      
      If the ice_ptp_update_cached_phctime function fails because ICE_CFG_BUSY is
      set, we log a warning and schedule the thread to execute soon. The update
      function is modified so that it always updates the cached copy in the PF
      regardless. This ensures we have the most up to date values possible and
      minimizes the risk of a packet timestamp being extended with the wrong
      value.
      
      It would be nice if we could skip reporting Rx timestamps until the cached
      values are up to date. However, we can't access the Rx rings while
      ICE_CFG_BUSY is set because they are actively being updated by another
      thread.
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Tested-by: Gurucharan <gurucharanx.g@intel.com> (A Contingent worker at Intel)
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      b1a582e6
    • J
      ice: re-arrange some static functions in ice_ptp.c · 4b1251bd
      Jacob Keller 提交于
      A following change is going to want to make use of ice_ptp_flush_tx_tracker
      earlier in the ice_ptp.c file. To make this work, move the Tx timestamp
      tracking functions higher up in the file, and pull the
      ice_ptp_update_cached_timestamp function below them. This should have no
      functional change.
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Tested-by: Gurucharan <gurucharanx.g@intel.com> (A Contingent worker at Intel)
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      4b1251bd
    • J
      ice: track and warn when PHC update is late · cd25507a
      Jacob Keller 提交于
      The ice driver requires a cached copy of the PHC time in order to perform
      timestamp extension on Tx and Rx hardware timestamp values. This cached PHC
      time must always be updated at least once every 2 seconds. Otherwise, the
      math used to perform the extension would produce invalid results.
      
      The updates are supposed to occur periodically in the PTP kthread work
      item, which is scheduled to run every half second. Thus, we do not expect
      an update to be delayed for so long. However, there are error conditions
      which can cause the update to be delayed.
      
      Track this situation by using jiffies to determine approximately how long
      ago the last update occurred. Add a new statistic and a dev_warn when we
      have failed to update the cached PHC time. This makes the error case more
      obvious.
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Tested-by: Gurucharan <gurucharanx.g@intel.com> (A Contingent worker at Intel)
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      cd25507a
    • J
      ice: track Tx timestamp stats similar to other Intel drivers · f020481b
      Jacob Keller 提交于
      Several Intel networking drivers which support PTP track when Tx timestamps
      are skipped or when they timeout without a timestamp from hardware. The
      conditions which could cause these events are rare, but it can be useful to
      know when and how often they occur.
      
      Implement similar statistics for the ice driver, tx_hwtstamp_skipped,
      tx_hwtstamp_timeouts, and tx_hwtstamp_flushed.
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Tested-by: Gurucharan <gurucharanx.g@intel.com> (A Contingent worker at Intel)
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      f020481b
    • J
      ice: initialize cached_phctime when creating Rx rings · cf6b82fd
      Jacob Keller 提交于
      When we create new Rx rings, the cached_phctime field is zero initialized.
      This could result in incorrect timestamp reporting due to the cached value
      not yet being updated. Although a background task will periodically update
      the cached value, ensure it matches the existing cached value in the PF
      structure at ring initialization.
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Tested-by: Gurucharan <gurucharanx.g@intel.com> (A Contingent worker at Intel)
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      cf6b82fd
    • J
      ice: set tx_tstamps when creating new Tx rings via ethtool · b3b17374
      Jacob Keller 提交于
      When the user changes the number of queues via ethtool, the driver
      allocates new rings. This allocation did not initialize tx_tstamps. This
      results in the tx_tstamps field being zero (due to kcalloc allocation), and
      would result in a NULL pointer dereference when attempting a transmit
      timestamp on the new ring.
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Tested-by: Gurucharan <gurucharanx.g@intel.com> (A Contingent worker at Intel)
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      b3b17374
  9. 16 8月, 2022 2 次提交