1. 26 8月, 2020 7 次提交
  2. 25 8月, 2020 5 次提交
  3. 24 8月, 2020 2 次提交
  4. 21 8月, 2020 1 次提交
  5. 20 8月, 2020 5 次提交
    • W
      net: gemini: Fix missing free_netdev() in error path of gemini_ethernet_port_probe() · cf96d977
      Wang Hai 提交于
      Replace alloc_etherdev_mq with devm_alloc_etherdev_mqs. In this way,
      when probe fails, netdev can be freed automatically.
      
      Fixes: 4d5ae32f ("net: ethernet: Add a driver for Gemini gigabit ethernet")
      Reported-by: NHulk Robot <hulkci@huawei.com>
      Signed-off-by: NWang Hai <wanghai38@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      cf96d977
    • S
      net: atlantic: Use readx_poll_timeout() for large timeout · 9553b62c
      Sebastian Andrzej Siewior 提交于
      Commit
         8dcf2ad3 ("net: atlantic: add hwmon getter for MAC temperature")
      
      implemented a read callback with an udelay(10000U). This fails to
      compile on ARM because the delay is >1ms. I doubt that it is needed to
      spin for 10ms even if possible on x86.
      
      >From looking at the code, the context appears to be preemptible so using
      usleep() should work and avoid busy spinning.
      
      Use readx_poll_timeout() in the poll loop.
      
      Fixes: 8dcf2ad3 ("net: atlantic: add hwmon getter for MAC temperature")
      Cc: Mark Starovoytov <mstarovoitov@marvell.com>
      Cc: Igor Russkikh <irusskikh@marvell.com>
      Signed-off-by: NSebastian Andrzej Siewior <sebastian@breakpoint.cc>
      Acked-by: NGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9553b62c
    • S
      net: ena: Make missed_tx stat incremental · ccd143e5
      Shay Agroskin 提交于
      Most statistics in ena driver are incremented, meaning that a stat's
      value is a sum of all increases done to it since driver/queue
      initialization.
      
      This patch makes all statistics this way, effectively making missed_tx
      statistic incremental.
      Also added a comment regarding rx_drops and tx_drops to make it
      clearer how these counters are calculated.
      
      Fixes: 11095fdb ("net: ena: add statistics for missed tx packets")
      Signed-off-by: NShay Agroskin <shayagr@amazon.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ccd143e5
    • S
      net: ena: Change WARN_ON expression in ena_del_napi_in_range() · 8b147f6f
      Shay Agroskin 提交于
      The ena_del_napi_in_range() function unregisters the napi handler for
      rings in a given range.
      This function had the following WARN_ON macro:
      
          WARN_ON(ENA_IS_XDP_INDEX(adapter, i) &&
      	    adapter->ena_napi[i].xdp_ring);
      
      This macro prints the call stack if the expression inside of it is
      true [1], but the expression inside of it is the wanted situation.
      The expression checks whether the ring has an XDP queue and its index
      corresponds to a XDP one.
      
      This patch changes the expression to
          !ENA_IS_XDP_INDEX(adapter, i) && adapter->ena_napi[i].xdp_ring
      which indicates an unwanted situation.
      
      Also, change the structure of the function. The napi handler is
      unregistered for all rings, and so there's no need to check whether the
      index is an XDP index or not. By removing this check the code becomes
      much more readable.
      
      Fixes: 548c4940 ("net: ena: Implement XDP_TX action")
      Signed-off-by: NShay Agroskin <shayagr@amazon.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8b147f6f
    • S
      net: ena: Prevent reset after device destruction · 63d4a4c1
      Shay Agroskin 提交于
      The reset work is scheduled by the timer routine whenever it
      detects that a device reset is required (e.g. when a keep_alive signal
      is missing).
      When releasing device resources in ena_destroy_device() the driver
      cancels the scheduling of the timer routine without destroying the reset
      work explicitly.
      
      This creates the following bug:
          The driver is suspended and the ena_suspend() function is called
      	-> This function calls ena_destroy_device() to free the net device
      	   resources
      	    -> The driver waits for the timer routine to finish
      	    its execution and then cancels it, thus preventing from it
      	    to be called again.
      
          If, in its final execution, the timer routine schedules a reset,
          the reset routine might be called afterwards,and a redundant call to
          ena_restore_device() would be made.
      
      By changing the reset routine we allow it to read the device's state
      accurately.
      This is achieved by checking whether ENA_FLAG_TRIGGER_RESET flag is set
      before resetting the device and making both the destruction function and
      the flag check are under rtnl lock.
      The ENA_FLAG_TRIGGER_RESET is cleared at the end of the destruction
      routine. Also surround the flag check with 'likely' because
      we expect that the reset routine would be called only when
      ENA_FLAG_TRIGGER_RESET flag is set.
      
      The destruction of the timer and reset services in __ena_shutoff() have to
      stay, even though the timer routine is destroyed in ena_destroy_device().
      This is to avoid a case in which the reset routine is scheduled after
      free_netdev() in __ena_shutoff(), which would create an access to freed
      memory in adapter->flags.
      
      Fixes: 8c5c7abd ("net: ena: add power management ops to the ENA driver")
      Signed-off-by: NShay Agroskin <shayagr@amazon.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      63d4a4c1
  6. 19 8月, 2020 7 次提交
  7. 18 8月, 2020 2 次提交
  8. 15 8月, 2020 7 次提交
    • L
      net: ethernet: 8390: axnet_cs: Document unused parameter 'txqueue' · fd29aeee
      Lee Jones 提交于
      Fixes the following W=1 kernel build warning(s):
      
       drivers/net/ethernet/8390/axnet_cs.c:907: warning: Function parameter or member 'txqueue' not described in 'axnet_tx_timeout'
      
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Jakub Kicinski <kuba@kernel.org>
      Cc: Martin Habets <mhabets@solarflare.com>
      Cc: Shannon Nelson <snelson@pensando.io>
      Cc: "Michael S. Tsirkin" <mst@redhat.com>
      Cc: William Lee <william@asix.com.tw>
      Cc: "A. Hinds --" <dahinds@users.sourceforge.net>
      Cc: reached at <becker@scyld.com>
      Cc: netdev@vger.kernel.org
      Signed-off-by: NLee Jones <lee.jones@linaro.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      fd29aeee
    • L
      net: ethernet: 3com: 3c574_cs: Remove set but unused variables 'tx' and 'rx' · 2083bebc
      Lee Jones 提交于
      Fixes the following W=1 kernel build warning(s):
      
       drivers/net/ethernet/3com/3c574_cs.c: In function ‘update_stats’:
       drivers/net/ethernet/3com/3c574_cs.c:954:9: warning: variable ‘tx’ set but not used [-Wunused-but-set-variable]
       954 | u8 rx, tx, up;
       | ^~
       drivers/net/ethernet/3com/3c574_cs.c:954:5: warning: variable ‘rx’ set but not used [-Wunused-but-set-variable]
       954 | u8 rx, tx, up;
       | ^~
      
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Jakub Kicinski <kuba@kernel.org>
      Cc: Shannon Nelson <snelson@pensando.io>
      Cc: Heiner Kallweit <hkallweit1@gmail.com>
      Cc: Martin Habets <mhabets@solarflare.com>
      Cc: "Michael S. Tsirkin" <mst@redhat.com>
      Cc: Donald Becker <becker@scyld.com>
      Cc: David Hinds <dahinds@users.sourceforge.net>
      Cc: netdev@vger.kernel.org
      Signed-off-by: NLee Jones <lee.jones@linaro.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2083bebc
    • F
      net: fec: correct the error path for regulator disable in probe · c6165cf0
      Fugang Duan 提交于
      Correct the error path for regulator disable.
      
      Fixes: 9269e556 ("net: fec: add phy-reset-gpios PROBE_DEFER check")
      Signed-off-by: NFugang Duan <fugang.duan@nxp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c6165cf0
    • G
      i40e: Fix crash during removing i40e driver · 5b6d4a7f
      Grzegorz Szczurek 提交于
      Fix the reason of crashing system by add waiting time to finish reset
      recovery process before starting remove driver procedure.
      Now VSI is releasing if VSI is not in reset recovery mode.
      Without this fix it was possible to start remove driver if other
      processing command need reset recovery procedure which resulted in
      null pointer dereference. VSI used by the ethtool process has been
      cleared by remove driver process.
      
      [ 6731.508665] BUG: kernel NULL pointer dereference, address: 0000000000000000
      [ 6731.508668] #PF: supervisor read access in kernel mode
      [ 6731.508670] #PF: error_code(0x0000) - not-present page
      [ 6731.508671] PGD 0 P4D 0
      [ 6731.508674] Oops: 0000 [#1] SMP PTI
      [ 6731.508679] Hardware name: Intel Corporation S2600WT2R/S2600WT2R, BIOS SE5C610.86B.01.01.0021.032120170601 03/21/2017
      [ 6731.508694] RIP: 0010:i40e_down+0x252/0x310 [i40e]
      [ 6731.508696] Code: c7 78 de fa c0 e8 61 02 3a c1 66 83 bb f6 0c 00 00 00 0f 84 bf 00 00 00 45 31 e4 45 31 ff eb 03 41 89 c7 48 8b 83 98 0c 00 00 <4a> 8b 3c 20 e8 a5 79 02 00 48 83 bb d0 0c 00 00 00 74 10 48 8b 83
      [ 6731.508698] RSP: 0018:ffffb75ac7b3faf0 EFLAGS: 00010246
      [ 6731.508700] RAX: 0000000000000000 RBX: ffff9c9874bd5000 RCX: 0000000000000007
      [ 6731.508701] RDX: 0000000000000000 RSI: 0000000000000096 RDI: ffff9c987f4d9780
      [ 6731.508703] RBP: ffffb75ac7b3fb30 R08: 0000000000005b60 R09: 0000000000000004
      [ 6731.508704] R10: ffffb75ac64fbd90 R11: 0000000000000001 R12: 0000000000000000
      [ 6731.508706] R13: ffff9c97a08e0000 R14: ffff9c97a08e0a68 R15: 0000000000000000
      [ 6731.508708] FS:  00007f2617cd2740(0000) GS:ffff9c987f4c0000(0000) knlGS:0000000000000000
      [ 6731.508710] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [ 6731.508711] CR2: 0000000000000000 CR3: 0000001e765c4006 CR4: 00000000003606e0
      [ 6731.508713] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      [ 6731.508714] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      [ 6731.508715] Call Trace:
      [ 6731.508734]  i40e_vsi_close+0x84/0x90 [i40e]
      [ 6731.508742]  i40e_quiesce_vsi.part.98+0x3c/0x40 [i40e]
      [ 6731.508749]  i40e_pf_quiesce_all_vsi+0x55/0x60 [i40e]
      [ 6731.508757]  i40e_prep_for_reset+0x59/0x130 [i40e]
      [ 6731.508765]  i40e_reconfig_rss_queues+0x5a/0x120 [i40e]
      [ 6731.508774]  i40e_set_channels+0xda/0x170 [i40e]
      [ 6731.508778]  ethtool_set_channels+0xe9/0x150
      [ 6731.508781]  dev_ethtool+0x1b94/0x2920
      [ 6731.508805]  dev_ioctl+0xc2/0x590
      [ 6731.508811]  sock_do_ioctl+0xae/0x150
      [ 6731.508813]  sock_ioctl+0x34f/0x3c0
      [ 6731.508821]  ksys_ioctl+0x98/0xb0
      [ 6731.508828]  __x64_sys_ioctl+0x1a/0x20
      [ 6731.508831]  do_syscall_64+0x57/0x1c0
      [ 6731.508835]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
      
      Fixes: 4b816446 ("i40e: Add common function for finding VSI by type")
      Signed-off-by: NGrzegorz Szczurek <grzegorzx.szczurek@intel.com>
      Signed-off-by: NArkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
      Tested-by: NAaron Brown <aaron.f.brown@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      5b6d4a7f
    • P
      i40e: Set RX_ONLY mode for unicast promiscuous on VLAN · 4bd5e02a
      Przemyslaw Patynowski 提交于
      Trusted VF with unicast promiscuous mode set, could listen to TX
      traffic of other VFs.
      Set unicast promiscuous mode to RX traffic, if VSI has port VLAN
      configured. Rename misleading I40E_AQC_SET_VSI_PROMISC_TX bit to
      I40E_AQC_SET_VSI_PROMISC_RX_ONLY. Aligned unicast promiscuous with
      VLAN to the one without VLAN.
      
      Fixes: 6c41a760 ("i40e: Add promiscuous on VLAN support")
      Fixes: 3b120089 ("i40e: When in promisc mode apply promisc mode to Tx Traffic as well")
      Signed-off-by: NPrzemyslaw Patynowski <przemyslawx.patynowski@intel.com>
      Signed-off-by: NAleksandr Loktionov <aleksandr.loktionov@intel.com>
      Signed-off-by: NArkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      4bd5e02a
    • E
      sfc: check hash is valid before using it · 06888543
      Edward Cree 提交于
      On EF100, the RX hash field in the packet prefix may not be valid (e.g.
       if the header parse failed), and this is indicated by a one-bit flag
       elsewhere in the packet prefix.  Only call skb_set_hash() if the
       RSS_HASH_VALID bit is set.
      Signed-off-by: NEdward Cree <ecree@solarflare.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      06888543
    • V
      igc: Fix PTP initialization · 3cda505a
      Vinicius Costa Gomes 提交于
      Right now, igc_ptp_reset() is called from igc_reset(), which is called
      from igc_probe() before igc_ptp_init() has a chance to run. It is
      detected as an attempt to use an spinlock without registering its key
      first. See log below.
      
      To avoid this problem, simplify the initialization: igc_ptp_init() is
      only called from igc_probe(), and igc_ptp_reset() is only called from
      igc_reset().
      
      [    2.736332] INFO: trying to register non-static key.
      [    2.736902] input: HDA Intel PCH Front Headphone as /devices/pci0000:00/0000:00:1f.3/sound/card0/input10
      [    2.737513] the code is fine but needs lockdep annotation.
      [    2.737513] turning off the locking correctness validator.
      [    2.737515] CPU: 8 PID: 239 Comm: systemd-udevd Tainted: G            E     5.8.0-rc7+ #13
      [    2.737515] Hardware name: Gigabyte Technology Co., Ltd. Z390 AORUS ULTRA/Z390 AORUS ULTRA-CF, BIOS F7 03/14/2019
      [    2.737516] Call Trace:
      [    2.737521]  dump_stack+0x78/0xa0
      [    2.737524]  register_lock_class+0x6b1/0x6f0
      [    2.737526]  ? lockdep_hardirqs_on_prepare+0xca/0x160
      [    2.739177]  ? _raw_spin_unlock_irq+0x24/0x50
      [    2.739179]  ? trace_hardirqs_on+0x1c/0xf0
      [    2.740820]  __lock_acquire+0x56/0x1ff0
      [    2.740823]  ? __schedule+0x30c/0x970
      [    2.740825]  lock_acquire+0x97/0x3e0
      [    2.740830]  ? igc_ptp_reset+0x35/0xf0 [igc]
      [    2.740833]  ? schedule_hrtimeout_range_clock+0xb7/0x120
      [    2.742507]  _raw_spin_lock_irqsave+0x3a/0x50
      [    2.742512]  ? igc_ptp_reset+0x35/0xf0 [igc]
      [    2.742515]  igc_ptp_reset+0x35/0xf0 [igc]
      [    2.742519]  igc_reset+0x96/0xd0 [igc]
      [    2.744148]  igc_probe+0x68f/0x7d0 [igc]
      [    2.745796]  local_pci_probe+0x3d/0x70
      [    2.745799]  pci_device_probe+0xd1/0x190
      [    2.745802]  really_probe+0x15a/0x3f0
      [    2.759936]  driver_probe_device+0xe1/0x150
      [    2.759937]  device_driver_attach+0xa8/0xb0
      [    2.761786]  __driver_attach+0x89/0x150
      [    2.761786]  ? device_driver_attach+0xb0/0xb0
      [    2.761787]  ? device_driver_attach+0xb0/0xb0
      [    2.761788]  bus_for_each_dev+0x66/0x90
      [    2.765012]  bus_add_driver+0x12e/0x1f0
      [    2.765716]  driver_register+0x8b/0xe0
      [    2.766418]  ? 0xffffffffc0230000
      [    2.767119]  do_one_initcall+0x5a/0x310
      [    2.767826]  ? kmem_cache_alloc_trace+0xe9/0x200
      [    2.768528]  do_init_module+0x5c/0x260
      [    2.769206]  __do_sys_finit_module+0x93/0xe0
      [    2.770048]  do_syscall_64+0x46/0xa0
      [    2.770716]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
      [    2.771396] RIP: 0033:0x7f83534589e0
      [    2.772073] Code: 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 2e 2e 2e 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 80 24 0d 00 f7 d8 64 89 01 48
      [    2.772074] RSP: 002b:00007ffd31d0ed18 EFLAGS: 00000246 ORIG_RAX: 0000000000000139
      [    2.774854] RAX: ffffffffffffffda RBX: 000055d52816aba0 RCX: 00007f83534589e0
      [    2.774855] RDX: 0000000000000000 RSI: 00007f83535b982f RDI: 0000000000000006
      [    2.774855] RBP: 00007ffd31d0ed60 R08: 0000000000000000 R09: 00007ffd31d0ed30
      [    2.774856] R10: 0000000000000006 R11: 0000000000000246 R12: 0000000000000000
      [    2.774856] R13: 0000000000020000 R14: 00007f83535b982f R15: 000055d527f5e120
      
      Fixes: 5f295805 ("igc: Add basic skeleton for PTP")
      Signed-off-by: NVinicius Costa Gomes <vinicius.gomes@intel.com>
      Reviewed-by: NAndre Guedes <andre.guedes@intel.com>
      Tested-by: NAaron Brown <aaron.f.brown@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      3cda505a
  9. 13 8月, 2020 3 次提交
  10. 12 8月, 2020 1 次提交