1. 28 Oct, 2021 8 commits
  2. 27 Oct, 2021 10 commits
  3. 26 Oct, 2021 17 commits
  4. 25 Oct, 2021 5 commits
    • Yongxin Liu's avatar
      ice: check whether PTP is initialized in ice_ptp_release() · fd1b5beb
      Yongxin Liu authored
      PTP is currently only supported on E810 devices, it is checked
      in ice_ptp_init(). However, there is no check in ice_ptp_release().
      For other E800 series devices, ice_ptp_release() will be wrongly executed.
      
      Fix the following calltrace.
      
        INFO: trying to register non-static key.
        The code is fine but needs lockdep annotation, or maybe
        you didn't initialize this object before use?
        turning off the locking correctness validator.
        Workqueue: ice ice_service_task [ice]
        Call Trace:
         dump_stack_lvl+0x5b/0x82
         dump_stack+0x10/0x12
         register_lock_class+0x495/0x4a0
         ? find_held_lock+0x3c/0xb0
         __lock_acquire+0x71/0x1830
         lock_acquire+0x1e6/0x330
         ? ice_ptp_release+0x3c/0x1e0 [ice]
         ? _raw_spin_lock+0x19/0x70
         ? ice_ptp_release+0x3c/0x1e0 [ice]
         _raw_spin_lock+0x38/0x70
         ? ice_ptp_release+0x3c/0x1e0 [ice]
         ice_ptp_release+0x3c/0x1e0 [ice]
         ice_prepare_for_reset+0xcb/0xe0 [ice]
         ice_do_reset+0x38/0x110 [ice]
         ice_service_task+0x138/0xf10 [ice]
         ? __this_cpu_preempt_check+0x13/0x20
         process_one_work+0x26a/0x650
         worker_thread+0x3f/0x3b0
         ? __kthread_parkme+0x51/0xb0
         ? process_one_work+0x650/0x650
         kthread+0x161/0x190
         ? set_kthread_struct+0x40/0x40
         ret_from_fork+0x1f/0x30
      
      Fixes: 4dd0d5c3 ("ice: add lock around Tx timestamp tracker flush")
      Signed-off-by: default avatarYongxin Liu <yongxin.liu@windriver.com>
      Reviewed-by: default avatarJacob Keller <jacob.e.keller@intel.com>
      Tested-by: default avatarGurucharan G <gurucharanx.g@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      fd1b5beb
    • Dave Ertman's avatar
      ice: Respond to a NETDEV_UNREGISTER event for LAG · 6a8b3572
      Dave Ertman authored
      When the PF is a member of a link aggregate, and the driver
      is removed, the process will hang unless we respond to the
      NETDEV_UNREGISTER event that is sent to the event_handler
      for LAG.
      
      Add a case statement for the ice_lag_event_handler to unlink
      the PF from the link aggregate.
      
      Also remove code that was incorrectly applying a dev_hold to
      peer_netdevs that were associated with the ice driver.
      
      Fixes: df006dd4 ("ice: Add initial support framework for LAG")
      Signed-off-by: default avatarDave Ertman <david.m.ertman@intel.com>
      Tested-by: default avatarTony Brelinski <tony.brelinski@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      6a8b3572
    • Xin Long's avatar
      net-sysfs: initialize uid and gid before calling net_ns_get_ownership · f7a1e76d
      Xin Long authored
      Currently in net_ns_get_ownership() it may not be able to set uid or gid
      if make_kuid or make_kgid returns an invalid value, and an uninit-value
      issue can be triggered by this.
      
      This patch is to fix it by initializing the uid and gid before calling
      net_ns_get_ownership(), as it does in kobject_get_ownership()
      
      Fixes: e6dee9f3 ("net-sysfs: add netdev_change_owner()")
      Reported-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Acked-by: default avatarChristian Brauner <christian.brauner@ubuntu.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f7a1e76d
    • Dongli Zhang's avatar
      xen/netfront: stop tx queues during live migration · 042b2046
      Dongli Zhang authored
      The tx queues are not stopped during the live migration. As a result, the
      ndo_start_xmit() may access netfront_info->queues which is freed by
      talk_to_netback()->xennet_destroy_queues().
      
      This patch is to netif_device_detach() at the beginning of xen-netfront
      resuming, and netif_device_attach() at the end of resuming.
      
           CPU A                                CPU B
      
       talk_to_netback()
       -> if (info->queues)
              xennet_destroy_queues(info);
          to free netfront_info->queues
      
                                              xennet_start_xmit()
                                              to access netfront_info->queues
      
        -> err = xennet_create_queues(info, &num_queues);
      
      The idea is borrowed from virtio-net.
      
      Cc: Joe Jin <joe.jin@oracle.com>
      Signed-off-by: default avatarDongli Zhang <dongli.zhang@oracle.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      042b2046
    • Michael Chan's avatar
      net: Prevent infinite while loop in skb_tx_hash() · 0c57eeec
      Michael Chan authored
      Drivers call netdev_set_num_tc() and then netdev_set_tc_queue()
      to set the queue count and offset for each TC.  So the queue count
      and offset for the TCs may be zero for a short period after dev->num_tc
      has been set.  If a TX packet is being transmitted at this time in the
      code path netdev_pick_tx() -> skb_tx_hash(), skb_tx_hash() may see
      nonzero dev->num_tc but zero qcount for the TC.  The while loop that
      keeps looping while hash >= qcount will not end.
      
      Fix it by checking the TC's qcount to be nonzero before using it.
      
      Fixes: eadec877 ("net: Add support for subordinate traffic classes to netdev_pick_tx")
      Reviewed-by: default avatarAndy Gospodarek <gospo@broadcom.com>
      Signed-off-by: default avatarMichael Chan <michael.chan@broadcom.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0c57eeec