1. 27 7月, 2018 23 次提交
    • J
      net: adaptec: Replace mdelay() with msleep() in starfire_init_one() · d8ad2f31
      Jia-Ju Bai 提交于
      starfire_init_one() is never called in atomic context.
      It calls mdelay() to busily wait, which is not necessary.
      mdelay() can be replaced with msleep().
      
      This is found by a static analysis tool named DCNS written by myself.
      Signed-off-by: NJia-Ju Bai <baijiaju1990@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d8ad2f31
    • J
      isdn: hisax: config: Replace GFP_ATOMIC with GFP_KERNEL · 055d624f
      Jia-Ju Bai 提交于
      hisax_cs_new() and hisax_cs_setup() are never called in atomic context.
      They call kmalloc() and kzalloc() with GFP_ATOMIC, which is not necessary.
      GFP_ATOMIC can be replaced with GFP_KERNEL.
      
      This is found by a static analysis tool named DCNS written by myself.
      Signed-off-by: NJia-Ju Bai <baijiaju1990@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      055d624f
    • J
      isdn: hisax: callc: Replace GFP_ATOMIC with GFP_KERNEL in init_PStack() · 87935aa7
      Jia-Ju Bai 提交于
      init_PStack() is never called in atomic context.
      It calls kmalloc() with GFP_ATOMIC, which is not necessary.
      GFP_ATOMIC can be replaced with GFP_KERNEL.
      
      This is found by a static analysis tool named DCNS written by myself.
      Signed-off-by: NJia-Ju Bai <baijiaju1990@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      87935aa7
    • J
      isdn: mISDN: netjet: Replace GFP_ATOMIC with GFP_KERNEL in nj_probe() · 9d8009de
      Jia-Ju Bai 提交于
      nj_probe() is never called in atomic context.
      It calls kzalloc() with GFP_ATOMIC, which is not necessary.
      GFP_ATOMIC can be replaced with GFP_KERNEL.
      
      This is found by a static analysis tool named DCNS written by myself.
      Signed-off-by: NJia-Ju Bai <baijiaju1990@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9d8009de
    • J
      isdn: mISDN: hfcpci: Replace GFP_ATOMIC with GFP_KERNEL in hfc_probe() · 8c957d66
      Jia-Ju Bai 提交于
      hfc_probe() is never called in atomic context.
      It calls kzalloc() with GFP_ATOMIC, which is not necessary.
      GFP_ATOMIC can be replaced with GFP_KERNEL.
      
      This is found by a static analysis tool named DCNS written by myself.
      Signed-off-by: NJia-Ju Bai <baijiaju1990@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8c957d66
    • Y
      net: hns: make hns_dsaf_roce_reset non static · ff7b9126
      YueHaibing 提交于
      hns_dsaf_roce_reset is exported and used in hns_roce_hw_v1.c
      In commit 336a443b ("net: hns: Make many functions static") I make
      it static wrongly.
      
      drivers/infiniband/hw/hns/hns_roce_hw_v1.o: In function `hns_roce_v1_reset':
      hns_roce_hw_v1.c:(.text+0x37ac): undefined reference to `hns_dsaf_roce_reset'
      hns_roce_hw_v1.c:(.text+0x37cc): undefined reference to `hns_dsaf_roce_reset'
      
      Fixes: 336a443b ("net: hns: Make many functions static")
      Signed-off-by: NYueHaibing <yuehaibing@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ff7b9126
    • D
      Merge branch '10GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue · 6a8fab17
      David S. Miller 提交于
      Jeff Kirsher says:
      
      ====================
      10GbE Intel Wired LAN Driver Updates 2018-07-26
      
      This series contains updates to ixgbe and igb.
      
      Tony fixes ixgbe to add checks to ensure jumbo frames or LRO get enabled
      after an XDP program is loaded.
      
      Shannon Nelson adds the missing security configuration registers to the
      ixgbe register dump, which will help in debugging.
      
      Christian Grönke fixes an issue in igb that occurs on SGMII based SPF
      mdoules, by reverting changes from 2 previous patches.  The issue was
      that initialization would fail on the fore mentioned modules because the
      driver would try to reset the PHY before obtaining the PHY address of
      the SGMII attached PHY.
      
      Venkatesh Srinivas replaces wmb() with dma_wmb() for doorbell writes,
      which avoids SFENCEs before the doorbell writes.
      
      Alex cleans up and refactors ixgbe Tx/Rx shutdown to reduce time needed
      to stop the device.  The code refactor allows us to take the completion
      time into account when disabling queues, so that on some platforms with
      higher completion times, would not result in receive queues disabled
      messages.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6a8fab17
    • J
      net: sched: unmark chain as explicitly created on delete · c921d7db
      Jiri Pirko 提交于
      Once user manually deletes the chain using "chain del", the chain cannot
      be marked as explicitly created anymore.
      Signed-off-by: NJiri Pirko <jiri@mellanox.com>
      Fixes: 32a4f5ec ("net: sched: introduce chain object to uapi")
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c921d7db
    • D
      tls: Skip zerocopy path for ITER_KVEC · 0a26cf3f
      Doron Roberts-Kedes 提交于
      The zerocopy path ultimately calls iov_iter_get_pages, which defines the
      step function for ITER_KVECs as simply, return -EFAULT. Taking the
      non-zerocopy path for ITER_KVECs avoids the unnecessary fallback.
      
      See https://lore.kernel.org/lkml/20150401023311.GL29656@ZenIV.linux.org.uk/T/#u
      for a discussion of why zerocopy for vmalloc data is not a good idea.
      
      Discovered while testing NBD traffic encrypted with ktls.
      
      Fixes: c46234eb ("tls: RX path for ktls")
      Signed-off-by: NDoron Roberts-Kedes <doronrk@fb.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0a26cf3f
    • G
      net: sched: cls_api: fix dead code in switch · 2ed9db30
      Gustavo A. R. Silva 提交于
      Code at line 1850 is unreachable. Fix this by removing the break
      statement above it, so the code for case RTM_GETCHAIN can be
      properly executed.
      
      Addresses-Coverity-ID: 1472050 ("Structurally dead code")
      Fixes: 32a4f5ec ("net: sched: introduce chain object to uapi")
      Signed-off-by: NGustavo A. R. Silva <gustavo@embeddedor.com>
      Acked-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2ed9db30
    • G
      l2tp: remove ->recv_payload_hook · 2b139e6b
      Guillaume Nault 提交于
      The tunnel reception hook is only used by l2tp_ppp for skipping PPP
      framing bytes. This is a session specific operation, but once a PPP
      session sets ->recv_payload_hook on its tunnel, all frames received by
      the tunnel will enter pppol2tp_recv_payload_hook(), including those
      targeted at Ethernet sessions (an L2TPv3 tunnel can multiplex PPP and
      Ethernet sessions).
      
      So this mechanism is wrong, and uselessly complex. Let's just move this
      functionality to the pppol2tp rx handler and drop ->recv_payload_hook.
      Signed-off-by: NGuillaume Nault <g.nault@alphalink.fr>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2b139e6b
    • Y
      tipc: add missing dev_put() on error in tipc_enable_l2_media · 63135ee0
      YueHaibing 提交于
      when tipc_own_id failed to obtain node identity,dev_put should
      be call before return -EINVAL.
      
      Fixes: 682cd3cf ("tipc: confgiure and apply UDP bearer MTU on running links")
      Signed-off-by: NYueHaibing <yuehaibing@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      63135ee0
    • V
      net/tls: Removed redundant checks for non-NULL · 201876b3
      Vakul Garg 提交于
      Removed checks against non-NULL before calling kfree_skb() and
      crypto_free_aead(). These functions are safe to be called with NULL
      as an argument.
      Signed-off-by: NVakul Garg <vakul.garg@nxp.com>
      Acked-by: NDave Watson <davejwatson@fb.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      201876b3
    • V
      cbs: Add support for the graft function · 990e35ec
      Vinicius Costa Gomes 提交于
      This will allow to install a child qdisc under cbs. The main use case
      is to install ETF (Earliest TxTime First) qdisc under cbs, so there's
      another level of control for time-sensitive traffic.
      Signed-off-by: NVinicius Costa Gomes <vinicius.gomes@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      990e35ec
    • Y
      net: hns: Make many functions static · 336a443b
      YueHaibing 提交于
      Fixes the following sparse warning:
      
      drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c:73:20: warning: symbol 'hns_ae_get_handle' was not declared. Should it be static?
      drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c:332:6: warning: symbol 'hns_ae_stop' was not declared. Should it be static?
      drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c:360:6: warning: symbol 'hns_ae_toggle_ring_irq' was not declared. Should it be static?
      drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c:580:6: warning: symbol 'hns_ae_update_stats' was not declared. Should it be static?
      drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c:663:6: warning: symbol 'hns_ae_get_stats' was not declared. Should it be static?
      drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c:695:6: warning: symbol 'hns_ae_get_strings' was not declared. Should it be static?
      drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c:728:5: warning: symbol 'hns_ae_get_sset_count' was not declared. Should it be static?
      drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c:774:6: warning: symbol 'hns_ae_update_led_status' was not declared. Should it be static?
      drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c:786:5: warning: symbol 'hns_ae_cpld_set_led_id' was not declared. Should it be static?
      drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c:798:6: warning: symbol 'hns_ae_get_regs' was not declared. Should it be static?
      drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c:823:5: warning: symbol 'hns_ae_get_regs_len' was not declared. Should it be static?
      drivers/net/ethernet/hisilicon/hns/hns_dsaf_gmac.c:342:6: warning: symbol 'hns_gmac_update_stats' was not declared. Should it be static?
      drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c:934:12: warning: symbol 'hns_mac_get_vaddr' was not declared. Should it be static?
      drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c:953:5: warning: symbol 'hns_mac_get_cfg' was not declared. Should it be static?
      drivers/net/ethernet/hisilicon/hns/hns_dsaf_misc.c:343:6: warning: symbol 'hns_dsaf_srst_chns' was not declared. Should it be static?
      drivers/net/ethernet/hisilicon/hns/hns_dsaf_misc.c:366:1: warning: symbol 'hns_dsaf_srst_chns_acpi' was not declared. Should it be static?
      drivers/net/ethernet/hisilicon/hns/hns_dsaf_misc.c:373:6: warning: symbol 'hns_dsaf_roce_srst' was not declared. Should it be static?
      drivers/net/ethernet/hisilicon/hns/hns_dsaf_misc.c:387:6: warning: symbol 'hns_dsaf_roce_srst_acpi' was not declared. Should it be static?
      drivers/net/ethernet/hisilicon/hns/hns_dsaf_misc.c:571:5: warning: symbol 'hns_mac_get_sfp_prsnt' was not declared. Should it be static?
      drivers/net/ethernet/hisilicon/hns/hns_dsaf_misc.c:589:5: warning: symbol 'hns_mac_get_sfp_prsnt_acpi' was not declared. Should it be static?
      drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c:31:12: warning: symbol 'g_dsaf_mode_match' was not declared. Should it be static?
      drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c:45:5: warning: symbol 'hns_dsaf_get_cfg' was not declared. Should it be static?
      drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c:962:6: warning: symbol 'hns_dsaf_tcam_addr_get' was not declared. Should it be static?
      drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c:2087:6: warning: symbol 'hns_dsaf_port_work_rate_cfg' was not declared. Should it be static?
      drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c:2837:5: warning: symbol 'hns_dsaf_roce_reset' was not declared. Should it be static?
      drivers/net/ethernet/hisilicon/hns/hns_dsaf_ppe.c:76:5: warning: symbol 'hns_ppe_common_get_cfg' was not declared. Should it be static?
      drivers/net/ethernet/hisilicon/hns/hns_dsaf_ppe.c:107:6: warning: symbol 'hns_ppe_common_free_cfg' was not declared. Should it be static?
      drivers/net/ethernet/hisilicon/hns/hns_dsaf_ppe.c:340:6: warning: symbol 'hns_ppe_uninit_ex' was not declared. Should it be static?
      drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.c:708:5: warning: symbol 'hns_rcb_get_ring_num' was not declared. Should it be static?
      drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.c:744:14: warning: symbol 'hns_rcb_common_get_vaddr' was not declared. Should it be static?
      drivers/net/ethernet/hisilicon/hns/hns_dsaf_xgmac.c:314:6: warning: symbol 'hns_xgmac_update_stats' was not declared. Should it be static?
      drivers/net/ethernet/hisilicon/hns/hns_enet.c:1303:6: warning: symbol 'hns_nic_update_stats' was not declared. Should it be static?
      drivers/net/ethernet/hisilicon/hns/hns_enet.c:1585:6: warning: symbol 'hns_nic_poll_controller' was not declared. Should it be static?
      drivers/net/ethernet/hisilicon/hns/hns_enet.c:1938:6: warning: symbol 'hns_set_multicast_list' was not declared. Should it be static?
      drivers/net/ethernet/hisilicon/hns/hns_enet.c:1960:6: warning: symbol 'hns_nic_set_rx_mode' was not declared. Should it be static?
      drivers/net/ethernet/hisilicon/hns/hns_ethtool.c:661:6: warning: symbol 'hns_get_ringparam' was not declared. Should it be static?
      drivers/net/ethernet/hisilicon/hns/hns_ethtool.c:811:6: warning: symbol 'hns_get_channels' was not declared. Should it be static?
      drivers/net/ethernet/hisilicon/hns/hns_ethtool.c:828:6: warning: symbol 'hns_get_ethtool_stats' was not declared. Should it be static?
      drivers/net/ethernet/hisilicon/hns/hns_ethtool.c:886:6: warning: symbol 'hns_get_strings' was not declared. Should it be static?
      drivers/net/ethernet/hisilicon/hns/hns_ethtool.c:976:5: warning: symbol 'hns_get_sset_count' was not declared. Should it be static?
      drivers/net/ethernet/hisilicon/hns/hns_ethtool.c:1010:5: warning: symbol 'hns_phy_led_set' was not declared. Should it be static?
      drivers/net/ethernet/hisilicon/hns/hns_ethtool.c:1032:5: warning: symbol 'hns_set_phys_id' was not declared. Should it be static?
      drivers/net/ethernet/hisilicon/hns/hns_ethtool.c:1106:6: warning: symbol 'hns_get_regs' was not declared. Should it be static?
      Signed-off-by: NYueHaibing <yuehaibing@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      336a443b
    • A
      selftests/net: add tls to .gitignore · eb91f42e
      Anders Roxell 提交于
      Add the tls binary to .gitignore
      
      Fixes: 7f657d5b ("selftests: tls: add selftests for TLS sockets")
      Signed-off-by: NAnders Roxell <anders.roxell@linaro.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      eb91f42e
    • J
    • A
      ixgbe: Refactor queue disable logic to take completion time into account · 1918e937
      Alexander Duyck 提交于
      This change is meant to allow us to take completion time into account when
      disabling queues. Previously we were just working with hard coded values
      for how long we should wait. This worked fine for the standard case where
      completion timeout was operating in the 50us to 50ms range, however on
      platforms that have higher completion timeout times this was resulting in
      Rx queues disable messages being displayed as we weren't waiting long
      enough for outstanding Rx DMA completions.
      Signed-off-by: NAlexander Duyck <alexander.h.duyck@intel.com>
      Tested-by: NDon Buchholz <donald.buchholz@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      1918e937
    • A
      ixgbe: Reorder Tx/Rx shutdown to reduce time needed to stop device · 3b5f14b5
      Alexander Duyck 提交于
      This change is meant to help reduce the time needed to shutdown the
      transmit and receive paths for the device. Specifically what we now do
      after this patch is disable the transmit path first at the netdev level,
      and then work on disabling the Rx. This way while we are waiting on the Rx
      queues to be disabled the Tx queues have an opportunity to drain out.
      
      In addition I have dropped the 10ms timeout that was left in the ixgbe_down
      function that seems to have been carried through from back in e1000 as far
      as I can tell. We shouldn't need it since we don't actually disable the Tx
      until much later and we have additional logic in place for verifying the Tx
      queues have been disabled.
      Signed-off-by: NAlexander Duyck <alexander.h.duyck@intel.com>
      Tested-by: NDon Buchholz <donald.buchholz@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      3b5f14b5
    • V
      igb: Use dma_wmb() instead of wmb() before doorbell writes · 73017f4e
      Venkatesh Srinivas 提交于
      igb writes to doorbells to post transmit and receive descriptors;
      after writing descriptors to memory but before writing to doorbells,
      use dma_wmb() rather than wmb(). wmb() is more heavyweight than
      necessary before doorbell writes.
      
      On x86, this avoids SFENCEs before doorbell writes in both the
      tx and rx refill paths.
      Signed-off-by: NVenkatesh Srinivas <venkateshs@google.com>
      Tested-by: NAaron Brown <aaron.f.brown@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      73017f4e
    • C
      igb: Remove superfluous reset to PHY and page 0 selection · 2a83fba6
      Christian Grönke 提交于
      This patch reverts two previous applied patches to fix an issue
      that appeared when using SGMII based SFP modules. In the current
      state the driver will try to reset the PHY before obtaining the
      phy_addr of the SGMII attached PHY. That leads to an error in
      e1000_write_phy_reg_sgmii_82575. Causing the initialization to
      fail:
      
          igb: Intel(R) Gigabit Ethernet Network Driver - version 5.4.0-k
          igb: Copyright (c) 2007-2014 Intel Corporation.
          igb: probe of ????:??:??.? failed with error -3
      
      The patches being reverted are:
      
          commit 18278533
          Author: Aaron Sierra <asierra@xes-inc.com>
          Date:   Tue Nov 29 10:03:56 2016 -0600
      
              igb: reset the PHY before reading the PHY ID
      
          commit 440aeca4
          Author: Matwey V Kornilov <matwey@sai.msu.ru>
          Date:   Thu Nov 24 13:32:48 2016 +0300
      
               igb: Explicitly select page 0 at initialization
      
      The first reverted patch directly causes the problem mentioned above.
      In case of SGMII the phy_addr is not known at this point and will
      only be obtained by 'igb_get_phy_id_82575' further down in the code.
      The second removed patch selects forces selection of page 0 in the
      PHY. Something that the reset tries to address as well.
      
      As pointed out by Alexander Duzck, the patch below fixes the same
      issue but in the proper location:
      
          commit 4e684f59
          Author: Chris J Arges <christopherarges@gmail.com>
          Date:   Wed Nov 2 09:13:42 2016 -0500
      
              igb: Workaround for igb i210 firmware issue
      
      Reverts: 440aeca4.
      Reverts: 18278533.
      Signed-off-by: NChristian Grönke <c.groenke@infodas.de>
      Reviewed-by: NAlexander Duyck <alexander.h.duyck@intel.com>
      Tested-by: NAaron Brown <aaron.f.brown@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      2a83fba6
    • S
      ixgbe: add ipsec security registers into ethtool register dump · 7f6cdbda
      Shannon Nelson 提交于
      Add the ixgbe's security configuration registers into
      the register dump.
      Signed-off-by: NShannon Nelson <shannon.nelson@oracle.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      7f6cdbda
    • T
      ixgbe: Do not allow LRO or MTU change with XDP · 38b7e7f8
      Tony Nguyen 提交于
      XDP does not support jumbo frames or LRO.  These checks are being made
      outside the driver when an XDP program is loaded, however, there is
      nothing preventing these from changing after an XDP program is loaded.
      Add the checks so that while an XDP program is loaded, do not allow MTU
      to be changed or LRO to be enabled.
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      38b7e7f8
  2. 26 7月, 2018 17 次提交