1. 29 9月, 2021 6 次提交
  2. 28 9月, 2021 2 次提交
    • M
      ice: Use the xsk batched rx allocation interface · db804cfc
      Magnus Karlsson 提交于
      Use the new xsk batched rx allocation interface for the zero-copy data
      path. As the array of struct xdp_buff pointers kept by the driver is
      really a ring that wraps, the allocation routine is modified to detect
      a wrap and in that case call the allocation function twice. The
      allocation function cannot deal with wrapped rings, only arrays. As we
      now know exactly how many buffers we get and that there is no
      wrapping, the allocation function can be simplified even more as all
      if-statements in the allocation loop can be removed, improving
      performance.
      Signed-off-by: NMagnus Karlsson <magnus.karlsson@intel.com>
      Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
      Link: https://lore.kernel.org/bpf/20210922075613.12186-5-magnus.karlsson@gmail.com
      db804cfc
    • M
      ice: Use xdp_buf instead of rx_buf for xsk zero-copy · 57f7f8b6
      Magnus Karlsson 提交于
      In order to use the new xsk batched buffer allocation interface, a
      pointer to an array of struct xsk_buff pointers need to be provided so
      that the function can put the result of the allocation there. In the
      ice driver, we already have a ring that stores pointers to
      xdp_buffs. This is only used for the xsk zero-copy driver and is a
      union with the structure that is used for the regular non zero-copy
      path. Unfortunately, that structure is larger than the xdp_buffs
      pointers which mean that there will be a stride (of 20 bytes) between
      each xdp_buff pointer. And feeding this into the xsk_buff_alloc_batch
      interface will not work since it assumes a regular array of xdp_buff
      pointers (each 8 bytes with 0 bytes in-between them on a 64-bit
      system).
      
      To fix this, remove the xdp_buff pointer from the rx_buf union and
      move it one step higher to the union above which only has pointers to
      arrays in it. This solves the problem and we can directly feed the SW
      ring of xdp_buff pointers straight into the allocation function in the
      next patch when that interface is used. This will improve performance.
      Signed-off-by: NMagnus Karlsson <magnus.karlsson@intel.com>
      Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
      Link: https://lore.kernel.org/bpf/20210922075613.12186-4-magnus.karlsson@gmail.com
      57f7f8b6
  3. 27 9月, 2021 1 次提交
  4. 24 9月, 2021 1 次提交
  5. 22 9月, 2021 1 次提交
  6. 10 9月, 2021 1 次提交
    • D
      ice: Correctly deal with PFs that do not support RDMA · bfe84435
      Dave Ertman 提交于
      There are two cases where the current PF does not support RDMA
      functionality.  The first is if the NVM loaded on the device is set
      to not support RDMA (common_caps.rdma is false).  The second is if
      the kernel bonding driver has included the current PF in an active
      link aggregate.
      
      When the driver has determined that this PF does not support RDMA, then
      auxiliary devices should not be created on the auxiliary bus.  Without
      a device on the auxiliary bus, even if the irdma driver is present, there
      will be no RDMA activity attempted on this PF.
      
      Currently, in the reset flow, an attempt to create auxiliary devices is
      performed without regard to the ability of the PF.  There needs to be a
      check in ice_aux_plug_dev (as the central point that creates auxiliary
      devices) to see if the PF is in a state to support the functionality.
      
      When disabling and re-enabling RDMA due to the inclusion/removal of the PF
      in a link aggregate, we also need to set/clear the bit which controls
      auxiliary device creation so that a reset recovery in a link aggregate
      situation doesn't try to create auxiliary devices when it shouldn't.
      
      Fixes: f9f5301e ("ice: Register auxiliary device to provide RDMA")
      Reported-by: NYongxin Liu <yongxin.liu@windriver.com>
      Signed-off-by: NDave Ertman <david.m.ertman@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bfe84435
  7. 28 8月, 2021 4 次提交
    • B
      ice: Only lock to update netdev dev_addr · b357d971
      Brett Creeley 提交于
      commit 3ba7f53f ("ice: don't remove netdev->dev_addr from uc sync
      list") introduced calls to netif_addr_lock_bh() and
      netif_addr_unlock_bh() in the driver's ndo_set_mac() callback. This is
      fine since the driver is updated the netdev's dev_addr, but since this
      is a spinlock, the driver cannot sleep when the lock is held.
      Unfortunately the functions to add/delete MAC filters depend on a mutex.
      This was causing a trace with the lock debug kernel config options
      enabled when changing the mac address via iproute.
      
      [  203.273059] BUG: sleeping function called from invalid context at kernel/locking/mutex.c:281
      [  203.273065] in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 6698, name: ip
      [  203.273068] Preemption disabled at:
      [  203.273068] [<ffffffffc04aaeab>] ice_set_mac_address+0x8b/0x1c0 [ice]
      [  203.273097] CPU: 31 PID: 6698 Comm: ip Tainted: G S      W I       5.14.0-rc4 #2
      [  203.273100] Hardware name: Intel Corporation S2600WFT/S2600WFT, BIOS SE5C620.86B.02.01.0010.010620200716 01/06/2020
      [  203.273102] Call Trace:
      [  203.273107]  dump_stack_lvl+0x33/0x42
      [  203.273113]  ? ice_set_mac_address+0x8b/0x1c0 [ice]
      [  203.273124]  ___might_sleep.cold.150+0xda/0xea
      [  203.273131]  mutex_lock+0x1c/0x40
      [  203.273136]  ice_remove_mac+0xe3/0x180 [ice]
      [  203.273155]  ? ice_fltr_add_mac_list+0x20/0x20 [ice]
      [  203.273175]  ice_fltr_prepare_mac+0x43/0xa0 [ice]
      [  203.273194]  ice_set_mac_address+0xab/0x1c0 [ice]
      [  203.273206]  dev_set_mac_address+0xb8/0x120
      [  203.273210]  dev_set_mac_address_user+0x2c/0x50
      [  203.273212]  do_setlink+0x1dd/0x10e0
      [  203.273217]  ? __nla_validate_parse+0x12d/0x1a0
      [  203.273221]  __rtnl_newlink+0x530/0x910
      [  203.273224]  ? __kmalloc_node_track_caller+0x17f/0x380
      [  203.273230]  ? preempt_count_add+0x68/0xa0
      [  203.273236]  ? _raw_spin_lock_irqsave+0x1f/0x30
      [  203.273241]  ? kmem_cache_alloc_trace+0x4d/0x440
      [  203.273244]  rtnl_newlink+0x43/0x60
      [  203.273245]  rtnetlink_rcv_msg+0x13a/0x380
      [  203.273248]  ? rtnl_calcit.isra.40+0x130/0x130
      [  203.273250]  netlink_rcv_skb+0x4e/0x100
      [  203.273256]  netlink_unicast+0x1a2/0x280
      [  203.273258]  netlink_sendmsg+0x242/0x490
      [  203.273260]  sock_sendmsg+0x58/0x60
      [  203.273263]  ____sys_sendmsg+0x1ef/0x260
      [  203.273265]  ? copy_msghdr_from_user+0x5c/0x90
      [  203.273268]  ? ____sys_recvmsg+0xe6/0x170
      [  203.273270]  ___sys_sendmsg+0x7c/0xc0
      [  203.273272]  ? copy_msghdr_from_user+0x5c/0x90
      [  203.273274]  ? ___sys_recvmsg+0x89/0xc0
      [  203.273276]  ? __netlink_sendskb+0x50/0x50
      [  203.273278]  ? mod_objcg_state+0xee/0x310
      [  203.273282]  ? __dentry_kill+0x114/0x170
      [  203.273286]  ? get_max_files+0x10/0x10
      [  203.273288]  __sys_sendmsg+0x57/0xa0
      [  203.273290]  do_syscall_64+0x37/0x80
      [  203.273295]  entry_SYSCALL_64_after_hwframe+0x44/0xae
      [  203.273296] RIP: 0033:0x7f8edf96e278
      [  203.273298] Code: 89 02 48 c7 c0 ff ff ff ff eb b5 0f 1f 80 00 00 00 00 f3 0f 1e fa 48 8d 05 25 63 2c 00 8b 00 85 c0 75 17 b8 2e 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 58 c3 0f 1f 80 00 00 00 00 41 54 41 89 d4 55
      [  203.273300] RSP: 002b:00007ffcb8bdac08 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
      [  203.273303] RAX: ffffffffffffffda RBX: 000000006115e0ae RCX: 00007f8edf96e278
      [  203.273304] RDX: 0000000000000000 RSI: 00007ffcb8bdac70 RDI: 0000000000000003
      [  203.273305] RBP: 0000000000000000 R08: 0000000000000001 R09: 00007ffcb8bda5b0
      [  203.273306] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
      [  203.273306] R13: 0000555e10092020 R14: 0000000000000000 R15: 0000000000000005
      
      Fix this by only locking when changing the netdev->dev_addr. Also, make
      sure to restore the old netdev->dev_addr on any failures.
      
      Fixes: 3ba7f53f ("ice: don't remove netdev->dev_addr from uc sync list")
      Signed-off-by: NBrett Creeley <brett.creeley@intel.com>
      Tested-by: NGurucharan G <gurucharanx.g@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      b357d971
    • J
      ice: restart periodic outputs around time changes · 9ee31343
      Jacob Keller 提交于
      When we enabled auxiliary input/output support for the E810 device, we
      forgot to add logic to restart the output when we change time. This is
      important as the periodic output will be incorrect after a time change
      otherwise.
      
      This unfortunately includes the adjust time function, even though it
      uses an atomic hardware interface. The atomic adjustment can still cause
      the pin output to stall permanently, so we need to stop and restart it.
      
      Introduce wrapper functions to temporarily disable and then re-enable
      the clock outputs.
      
      Fixes: 172db5f9 ("ice: add support for auxiliary input/output pins")
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Tested-by: NSunitha D Mekala <sunithax.d.mekala@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      9ee31343
    • J
      ice: add lock around Tx timestamp tracker flush · 4dd0d5c3
      Jacob Keller 提交于
      The driver didn't take the lock while flushing the Tx tracker, which
      could cause a race where one thread is trying to read timestamps out
      while another thread is trying to read the tracker to check the
      timestamps.
      
      Avoid this by ensuring that flushing is locked against read accesses.
      
      Fixes: ea9b847c ("ice: enable transmit timestamps for E810 devices")
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Tested-by: NGurucharan G <gurucharanx.g@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      4dd0d5c3
    • J
      ice: remove dead code for allocating pin_config · 1f0cbb3e
      Jacob Keller 提交于
      We have code in the ice driver which allocates the pin_config structure
      if n_pins is > 0, but we never set n_pins to be greater than zero.
      There's no reason to keep this code until we actually have pin_config
      support. Remove this. We can re-add it properly when we implement
      support for pin_config for E810-T devices.
      
      Fixes: 172db5f9 ("ice: add support for auxiliary input/output pins")
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Tested-by: NGurucharan G <gurucharanx.g@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      1f0cbb3e
  8. 27 8月, 2021 1 次提交
  9. 24 8月, 2021 1 次提交
  10. 20 8月, 2021 1 次提交
  11. 14 8月, 2021 1 次提交
  12. 10 8月, 2021 3 次提交
    • B
      ice: don't remove netdev->dev_addr from uc sync list · 3ba7f53f
      Brett Creeley 提交于
      In some circumstances, such as with bridging, it's possible that the
      stack will add the device's own MAC address to its unicast address list.
      
      If, later, the stack deletes this address, the driver will receive a
      request to remove this address.
      
      The driver stores its current MAC address as part of the VSI MAC filter
      list instead of separately. So, this causes a problem when the device's
      MAC address is deleted unexpectedly, which results in traffic failure in
      some cases.
      
      The following configuration steps will reproduce the previously
      mentioned problem:
      
      > ip link set eth0 up
      > ip link add dev br0 type bridge
      > ip link set br0 up
      > ip addr flush dev eth0
      > ip link set eth0 master br0
      > echo 1 > /sys/class/net/br0/bridge/vlan_filtering
      > modprobe -r veth
      > modprobe -r bridge
      > ip addr add 192.168.1.100/24 dev eth0
      
      The following ping command fails due to the netdev->dev_addr being
      deleted when removing the bridge module.
      > ping <link partner>
      
      Fix this by making sure to not delete the netdev->dev_addr during MAC
      address sync. After fixing this issue it was noticed that the
      netdev_warn() in .set_mac was overly verbose, so make it at
      netdev_dbg().
      
      Also, there is a possibility of a race condition between .set_mac and
      .set_rx_mode. Fix this by calling netif_addr_lock_bh() and
      netif_addr_unlock_bh() on the device's netdev when the netdev->dev_addr
      is going to be updated in .set_mac.
      
      Fixes: e94d4478 ("ice: Implement filter sync, NDO operations and bump version")
      Signed-off-by: NBrett Creeley <brett.creeley@intel.com>
      Tested-by: NLiang Li <liali@redhat.com>
      Tested-by: NGurucharan G <gurucharanx.g@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      3ba7f53f
    • A
      ice: Stop processing VF messages during teardown · c503e632
      Anirudh Venkataramanan 提交于
      When VFs are setup and torn down in quick succession, it is possible
      that a VF is torn down by the PF while the VF's virtchnl requests are
      still in the PF's mailbox ring. Processing the VF's virtchnl request
      when the VF itself doesn't exist results in undefined behavior. Fix
      this by adding a check to stop processing virtchnl requests when VF
      teardown is in progress.
      
      Fixes: ddf30f7f ("ice: Add handler to configure SR-IOV")
      Signed-off-by: NAnirudh Venkataramanan <anirudh.venkataramanan@intel.com>
      Tested-by: NKonrad Jankowski <konrad0.jankowski@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      c503e632
    • A
      ice: Prevent probing virtual functions · 50ac7479
      Anirudh Venkataramanan 提交于
      The userspace utility "driverctl" can be used to change/override the
      system's default driver choices. This is useful in some situations
      (buggy driver, old driver missing a device ID, trying a workaround,
      etc.) where the user needs to load a different driver.
      
      However, this is also prone to user error, where a driver is mapped
      to a device it's not designed to drive. For example, if the ice driver
      is mapped to driver iavf devices, the ice driver crashes.
      
      Add a check to return an error if the ice driver is being used to
      probe a virtual function.
      
      Fixes: 837f08fd ("ice: Add basic driver framework for Intel(R) E800 Series")
      Signed-off-by: NAnirudh Venkataramanan <anirudh.venkataramanan@intel.com>
      Tested-by: NGurucharan G <gurucharanx.g@intel.com>
      Tested-by: NKonrad Jankowski <konrad0.jankowski@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      50ac7479
  13. 09 8月, 2021 1 次提交
    • L
      devlink: Set device as early as possible · 919d13a7
      Leon Romanovsky 提交于
      All kernel devlink implementations call to devlink_alloc() during
      initialization routine for specific device which is used later as
      a parent device for devlink_register().
      
      Such late device assignment causes to the situation which requires us to
      call to device_register() before setting other parameters, but that call
      opens devlink to the world and makes accessible for the netlink users.
      
      Any attempt to move devlink_register() to be the last call generates the
      following error due to access to the devlink->dev pointer.
      
      [    8.758862]  devlink_nl_param_fill+0x2e8/0xe50
      [    8.760305]  devlink_param_notify+0x6d/0x180
      [    8.760435]  __devlink_params_register+0x2f1/0x670
      [    8.760558]  devlink_params_register+0x1e/0x20
      
      The simple change of API to set devlink device in the devlink_alloc()
      instead of devlink_register() fixes all this above and ensures that
      prior to call to devlink_register() everything already set.
      Signed-off-by: NLeon Romanovsky <leonro@nvidia.com>
      Reviewed-by: NJiri Pirko <jiri@nvidia.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      919d13a7
  14. 28 7月, 2021 1 次提交
    • A
      dev_ioctl: split out ndo_eth_ioctl · a7605370
      Arnd Bergmann 提交于
      Most users of ndo_do_ioctl are ethernet drivers that implement
      the MII commands SIOCGMIIPHY/SIOCGMIIREG/SIOCSMIIREG, or hardware
      timestamping with SIOCSHWTSTAMP/SIOCGHWTSTAMP.
      
      Separate these from the few drivers that use ndo_do_ioctl to
      implement SIOCBOND, SIOCBR and SIOCWANDEV commands.
      
      This is a purely cosmetic change intended to help readers find
      their way through the implementation.
      
      Cc: Doug Ledford <dledford@redhat.com>
      Cc: Jason Gunthorpe <jgg@ziepe.ca>
      Cc: Jay Vosburgh <j.vosburgh@gmail.com>
      Cc: Veaceslav Falico <vfalico@gmail.com>
      Cc: Andy Gospodarek <andy@greyhouse.net>
      Cc: Andrew Lunn <andrew@lunn.ch>
      Cc: Vivien Didelot <vivien.didelot@gmail.com>
      Cc: Florian Fainelli <f.fainelli@gmail.com>
      Cc: Vladimir Oltean <olteanv@gmail.com>
      Cc: Leon Romanovsky <leon@kernel.org>
      Cc: linux-rdma@vger.kernel.org
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Acked-by: NJason Gunthorpe <jgg@nvidia.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a7605370
  15. 26 6月, 2021 4 次提交
  16. 25 6月, 2021 2 次提交
  17. 18 6月, 2021 9 次提交