1. 10 8月, 2019 3 次提交
    • Z
      net: hns3: fix GFP flag error in hclge_mac_update_stats() · 9e6717af
      Zhongzhu Liu 提交于
      When CONFIG_DEBUG_ATOMIC_SLEEP on, calling kzalloc with
      GFP_KERNEL in hclge_mac_update_stats() will get below warning:
      
      [   52.514677] BUG: sleeping function called from invalid context at mm/slab.h:501
      [   52.522051] in_atomic(): 0, irqs_disabled(): 0, pid: 1015, name: ifconfig
      [   52.528827] 2 locks held by ifconfig/1015:
      [   52.532921]  #0: (____ptrval____) (&p->lock){....}, at: seq_read+0x54/0x748
      [   52.539878]  #1: (____ptrval____) (rcu_read_lock){....}, at: dev_seq_start+0x0/0x140
      [   52.547610] CPU: 16 PID: 1015 Comm: ifconfig Not tainted 5.3.0-rc3-00697-g20b80be #98
      [   52.555408] Hardware name: Huawei TaiShan 2280 V2/BC82AMDC, BIOS 2280-V2 CS V3.B050.01 08/08/2019
      [   52.564242] Call trace:
      [   52.566687]  dump_backtrace+0x0/0x1f8
      [   52.570338]  show_stack+0x14/0x20
      [   52.573646]  dump_stack+0xb4/0xec
      [   52.576950]  ___might_sleep+0x178/0x198
      [   52.580773]  __might_sleep+0x74/0xe0
      [   52.584338]  __kmalloc+0x244/0x2d8
      [   52.587744]  hclge_mac_update_stats+0xc8/0x1f8 [hclge]
      [   52.592870]  hclge_update_stats+0xe0/0x170 [hclge]
      [   52.597651]  hns3_nic_get_stats64+0xa0/0x458 [hns3]
      [   52.602514]  dev_get_stats+0x58/0x138
      [   52.606165]  dev_seq_printf_stats+0x8c/0x280
      [   52.610420]  dev_seq_show+0x14/0x40
      [   52.613898]  seq_read+0x574/0x748
      [   52.617205]  proc_reg_read+0xb4/0x108
      [   52.620857]  __vfs_read+0x54/0xa8
      [   52.624162]  vfs_read+0xa0/0x190
      [   52.627380]  ksys_read+0xc8/0x178
      [   52.630685]  __arm64_sys_read+0x40/0x50
      [   52.634509]  el0_svc_common.constprop.0+0x120/0x1e0
      [   52.639369]  el0_svc_handler+0x50/0x90
      [   52.643106]  el0_svc+0x8/0xc
      
      So this patch uses GFP_ATOMIC instead of GFP_KERNEL to fix it.
      
      Fixes: d174ea75 ("net: hns3: add statistics for PFC frames and MAC control frames")
      Signed-off-by: NZhongzhu Liu <liuzhongzhu@huawei.com>
      Reviewed-by: NYunsheng Lin <linyunsheng@huawei.com>
      Reviewed-by: NPeng Li <lipeng321@huawei.com>
      Signed-off-by: NHuazhong Tan <tanhuazhong@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9e6717af
    • H
      r8169: fix performance issue on RTL8168evl · a7eb6a4f
      Holger Hoffstätte 提交于
      Disabling TSO but leaving SG active results is a significant
      performance drop. Therefore disable also SG on RTL8168evl.
      This restores the original performance.
      
      Fixes: 93681cd7 ("r8169: enable HW csum and TSO")
      Signed-off-by: NHolger Hoffstätte <holger@applied-asynchrony.com>
      Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a7eb6a4f
    • J
      devlink: remove pointless data_len arg from region snapshot create · 3a5e5234
      Jiri Pirko 提交于
      The size of the snapshot has to be the same as the size of the region,
      therefore no need to pass it again during snapshot creation. Remove the
      arg and use region->size instead.
      Signed-off-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3a5e5234
  2. 09 8月, 2019 21 次提交
  3. 07 8月, 2019 16 次提交
    • J
      nfp: flower: encode mac indexes with pre-tunnel rule check · 2e0bc7f3
      John Hurley 提交于
      When a tunnel packet arrives on the NFP card, its destination MAC is
      looked up and MAC index returned for it. This index can help verify the
      tunnel by, for example, ensuring that the packet arrived on the expected
      port. If the packet is destined for a known MAC that is not connected to a
      given physical port then the mac index can have a global value (e.g. when
      a series of bonded ports shared the same MAC).
      
      If the packet is to be detunneled at a bridge device or internal port like
      an Open vSwitch VLAN port, then it should first match a 'pre-tunnel' rule
      to direct it to that internal port.
      
      Use the MAC index to indicate if a packet should match a pre-tunnel rule
      before decap is allowed. Do this by tracking the number of internal ports
      associated with a MAC address and, if the number if >0, set a bit in the
      mac_index to forward the packet to the pre-tunnel table before continuing
      with decap.
      Signed-off-by: NJohn Hurley <john.hurley@netronome.com>
      Reviewed-by: NSimon Horman <simon.horman@netronome.com>
      Acked-by: NJakub Kicinski <jakub.kicinski@netronome.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2e0bc7f3
    • J
      nfp: flower: remove offloaded MACs when reprs are applied to OvS bridges · 09aa811b
      John Hurley 提交于
      MAC addresses along with an identifying index are offloaded to firmware to
      allow tunnel decapsulation. If a tunnel packet arrives with a matching
      destination MAC address and a verified index, it can continue on the
      decapsulation process. This replicates the MAC verifications carried out
      in the kernel network stack.
      
      When a netdev is added to a bridge (e.g. OvS) then packets arriving on
      that dev are directed through the bridge datapath instead of passing
      through the network stack. Therefore, tunnelled packets matching the MAC
      of that dev will not be decapped here.
      
      Replicate this behaviour on firmware by removing offloaded MAC addresses
      when a MAC representer is added to an OvS bridge. This can prevent any
      false positive tunnel decaps.
      Signed-off-by: NJohn Hurley <john.hurley@netronome.com>
      Reviewed-by: NSimon Horman <simon.horman@netronome.com>
      Acked-by: NJakub Kicinski <jakub.kicinski@netronome.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      09aa811b
    • J
      nfp: flower: offload pre-tunnel rules · f12725d9
      John Hurley 提交于
      Pre-tunnel rules are TC flower and OvS rules that forward a packet to the
      tunnel end point where it can then pass through the network stack and be
      decapsulated. These are required if the tunnel end point is, say, an OvS
      internal port.
      
      Currently, firmware determines that a packet is in a tunnel and decaps it
      if it has a known destination IP and MAC address. However, this bypasses
      the flower pre-tunnel rule and so does not update the stats. Further to
      this it ignores VLANs that may exist outside of the tunnel header.
      
      Offload pre-tunnel rules to the NFP. This embeds the pre-tunnel rule into
      the tunnel decap process based on (firmware) mac index and VLAN. This
      means that decap can be carried out correctly with VLANs and that stats
      can be updated for all kernel rules correctly.
      Signed-off-by: NJohn Hurley <john.hurley@netronome.com>
      Reviewed-by: NSimon Horman <simon.horman@netronome.com>
      Acked-by: NJakub Kicinski <jakub.kicinski@netronome.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f12725d9
    • J
      nfp: flower: verify pre-tunnel rules · 120ffd84
      John Hurley 提交于
      Pre-tunnel rules must direct packets to an internal port based on L2
      information. Rules that egress to an internal port are already indicated
      by a non-NULL device in its nfp_fl_payload struct. Verfiy the rest of the
      match fields indicate that the rule is a pre-tunnel rule. This requires a
      full match on the destination MAC address, an option VLAN field, and no
      specific matches on other lower layer fields (with the exception of L4
      proto and flags).
      
      If a rule is identified as a pre-tunnel rule then mark it for offload to
      the pre-tunnel table. Similarly, remove it from the pre-tunnel table on
      rule deletion. The actual offloading of these commands is left to a
      following patch.
      Signed-off-by: NJohn Hurley <john.hurley@netronome.com>
      Reviewed-by: NSimon Horman <simon.horman@netronome.com>
      Acked-by: NJakub Kicinski <jakub.kicinski@netronome.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      120ffd84
    • J
      nfp: flower: detect potential pre-tunnel rules · f5c977ee
      John Hurley 提交于
      Pre-tunnel rules are used when the tunnel end-point is on an 'internal
      port'. These rules are used to direct the tunnelled packets (based on outer
      header fields) to the internal port where they can be detunnelled. The
      rule must send the packet to ingress the internal port at the TC layer.
      
      Currently FW does not support an action to send to ingress so cannot
      offload such rules. However, in preparation for populating the pre-tunnel
      table to represent such rules, check for rules that send to the ingress of
      an internal port and mark them as such. Further validation of such rules
      is left to subsequent patches.
      Signed-off-by: NJohn Hurley <john.hurley@netronome.com>
      Reviewed-by: NSimon Horman <simon.horman@netronome.com>
      Acked-by: NJakub Kicinski <jakub.kicinski@netronome.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f5c977ee
    • J
      nfp: flower: push vlan after tunnel in merge · 4b10c53d
      John Hurley 提交于
      NFP allows the merging of 2 flows together into a single offloaded flow.
      In the kernel datapath the packet must match 1 flow, impliment its
      actions, recirculate, match the 2nd flow and also impliment its actions.
      Merging creates a single flow with all actions from the 2 original flows.
      
      Firmware impliments a tunnel header push as the packet is about to egress
      the card. Therefore, if the first merge rule candiate pushes a tunnel,
      then the second rule can only have an egress action for a valid merge to
      occur (or else the action ordering will be incorrect). This prevents the
      pushing of a tunnel header followed by the pushing of a vlan header.
      
      In order to support this behaviour, firmware allows VLAN information to
      be encoded in the tunnel push action. If this is non zero then the fw will
      push a VLAN after the tunnel header push meaning that 2 such flows with
      these actions can be merged (with action order being maintained).
      
      Support tunnel in VLAN pushes by encoding VLAN information in the tunnel
      push action of any merge flow requiring this.
      Signed-off-by: NJohn Hurley <john.hurley@netronome.com>
      Reviewed-by: NSimon Horman <simon.horman@netronome.com>
      Acked-by: NJakub Kicinski <jakub.kicinski@netronome.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4b10c53d
    • H
      r8169: sync PCIe PHY init with vendor driver 8.047.01 · a7a92cf8
      Heiner Kallweit 提交于
      Synchronize PCIe PHY initialization with vendor driver version 8.047.01.
      Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a7a92cf8
    • H
      r8169: add helper r8168_mac_ocp_modify · ef712ede
      Heiner Kallweit 提交于
      Add a helper for MAC OCP read-modify-write operations.
      Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ef712ede
    • H
      r8169: remove access to legacy register MultiIntr · a14cc4d2
      Heiner Kallweit 提交于
      This code piece was inherited from RTL8139 code, the register at
      address 0x5c however has a different meaning on RTL8169 and is unused.
      So we can remove this.
      Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a14cc4d2
    • J
      net: hisilicon: Fix dma_map_single failed on arm64 · 96a50c0d
      Jiangfeng Xiao 提交于
      On the arm64 platform, executing "ifconfig eth0 up" will fail,
      returning "ifconfig: SIOCSIFFLAGS: Input/output error."
      
      ndev->dev is not initialized, dma_map_single->get_dma_ops->
      dummy_dma_ops->__dummy_map_page will return DMA_ERROR_CODE
      directly, so when we use dma_map_single, the first parameter
      is to use the device of platform_device.
      Signed-off-by: NJiangfeng Xiao <xiaojiangfeng@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      96a50c0d
    • J
      net: hisilicon: fix hip04-xmit never return TX_BUSY · f2243b82
      Jiangfeng Xiao 提交于
      TX_DESC_NUM is 256, in tx_count, the maximum value of
      mod(TX_DESC_NUM - 1) is 254, the variable "count" in
      the hip04_mac_start_xmit function is never equal to
      (TX_DESC_NUM - 1), so hip04_mac_start_xmit never
      return NETDEV_TX_BUSY.
      
      tx_count is modified to mod(TX_DESC_NUM) so that
      the maximum value of tx_count can reach
      (TX_DESC_NUM - 1), then hip04_mac_start_xmit can reurn
      NETDEV_TX_BUSY.
      Signed-off-by: NJiangfeng Xiao <xiaojiangfeng@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f2243b82
    • J
      net: hisilicon: make hip04_tx_reclaim non-reentrant · 1a2c070a
      Jiangfeng Xiao 提交于
      If hip04_tx_reclaim is interrupted while it is running
      and then __napi_schedule continues to execute
      hip04_rx_poll->hip04_tx_reclaim, reentrancy occurs
      and oops is generated. So you need to mask the interrupt
      during the hip04_tx_reclaim run.
      
      The kernel oops exception stack is as follows:
      
      Unable to handle kernel NULL pointer dereference
      at virtual address 00000050
      pgd = c0003000
      [00000050] *pgd=80000000a04003, *pmd=00000000
      Internal error: Oops: 206 [#1] SMP ARM
      Modules linked in: hip04_eth mtdblock mtd_blkdevs mtd
      ohci_platform ehci_platform ohci_hcd ehci_hcd
      vfat fat sd_mod usb_storage scsi_mod usbcore usb_common
      CPU: 0 PID: 0 Comm: swapper/0 Tainted: G           O    4.4.185 #1
      Hardware name: Hisilicon A15
      task: c0a250e0 task.stack: c0a00000
      PC is at hip04_tx_reclaim+0xe0/0x17c [hip04_eth]
      LR is at hip04_tx_reclaim+0x30/0x17c [hip04_eth]
      pc : [<bf30c3a4>]    lr : [<bf30c2f4>]    psr: 600e0313
      sp : c0a01d88  ip : 00000000  fp : c0601f9c
      r10: 00000000  r9 : c3482380  r8 : 00000001
      r7 : 00000000  r6 : 000000e1  r5 : c3482000  r4 : 0000000c
      r3 : f2209800  r2 : 00000000  r1 : 00000000  r0 : 00000000
      Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
      Control: 32c5387d  Table: 03d28c80  DAC: 55555555
      Process swapper/0 (pid: 0, stack limit = 0xc0a00190)
      Stack: (0xc0a01d88 to 0xc0a02000)
      [<bf30c3a4>] (hip04_tx_reclaim [hip04_eth]) from [<bf30d2e0>]
                                                      (hip04_rx_poll+0x88/0x368 [hip04_eth])
      [<bf30d2e0>] (hip04_rx_poll [hip04_eth]) from [<c04c2d9c>] (net_rx_action+0x114/0x34c)
      [<c04c2d9c>] (net_rx_action) from [<c021eed8>] (__do_softirq+0x218/0x318)
      [<c021eed8>] (__do_softirq) from [<c021f284>] (irq_exit+0x88/0xac)
      [<c021f284>] (irq_exit) from [<c0240090>] (msa_irq_exit+0x11c/0x1d4)
      [<c0240090>] (msa_irq_exit) from [<c02677e0>] (__handle_domain_irq+0x110/0x148)
      [<c02677e0>] (__handle_domain_irq) from [<c0201588>] (gic_handle_irq+0xd4/0x118)
      [<c0201588>] (gic_handle_irq) from [<c0551700>] (__irq_svc+0x40/0x58)
      Exception stack(0xc0a01f30 to 0xc0a01f78)
      1f20:                                     c0ae8b40 00000000 00000000 00000000
      1f40: 00000002 ffffe000 c0601f9c 00000000 ffffffff c0a2257c c0a22440 c0831a38
      1f60: c0a01ec4 c0a01f80 c0203714 c0203718 600e0213 ffffffff
      [<c0551700>] (__irq_svc) from [<c0203718>] (arch_cpu_idle+0x20/0x3c)
      [<c0203718>] (arch_cpu_idle) from [<c025bfd8>] (cpu_startup_entry+0x244/0x29c)
      [<c025bfd8>] (cpu_startup_entry) from [<c054b0d8>] (rest_init+0xc8/0x10c)
      [<c054b0d8>] (rest_init) from [<c0800c58>] (start_kernel+0x468/0x514)
      Code: a40599e5 016086e2 018088e2 7660efe6 (503090e5)
      ---[ end trace 1db21d6d09c49d74 ]---
      Kernel panic - not syncing: Fatal exception in interrupt
      CPU3: stopping
      CPU: 3 PID: 0 Comm: swapper/3 Tainted: G      D    O    4.4.185 #1
      Signed-off-by: NJiangfeng Xiao <xiaojiangfeng@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1a2c070a
    • J
      net: stmmac: tc: Do not return a fragment entry · 4a6a1385
      Jose Abreu 提交于
      Do not try to return a fragment entry from TC list. Otherwise we may not
      clean properly allocated entries.
      Signed-off-by: NJose Abreu <joabreu@synopsys.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4a6a1385
    • J
      net: stmmac: Fix issues when number of Queues >= 4 · e8df7e8c
      Jose Abreu 提交于
      When queues >= 4 we use different registers but we were not subtracting
      the offset of 4. Fix this.
      
      Found out by Coverity.
      Signed-off-by: NJose Abreu <joabreu@synopsys.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e8df7e8c
    • J
      net: stmmac: xgmac: Fix XGMAC selftests · 0efedbf1
      Jose Abreu 提交于
      Fixup the XGMAC selftests by correctly finishing the implementation of
      set_filter callback.
      
      Result:
      $ ethtool -t enp4s0
      The test result is PASS
      The test extra info:
       1. MAC Loopback         	 0
       2. PHY Loopback         	 -95
       3. MMC Counters         	 -95
       4. EEE                  	 -95
       5. Hash Filter MC       	 0
       6. Perfect Filter UC    	 0
       7. MC Filter            	 0
       8. UC Filter            	 0
       9. Flow Control         	 0
      Signed-off-by: NJose Abreu <joabreu@synopsys.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0efedbf1
    • D
      be2net: disable bh with spin_lock in be_process_mcc · d0d006a4
      Denis Kirjanov 提交于
      be_process_mcc() is invoked in 3 different places and
      always with BHs disabled except the be_poll function
      but since it's invoked from softirq with BHs
      disabled it won't hurt.
      
      v1->v2: added explanation to the patch
      v2->v3: add a missing call from be_cmds.c
      Signed-off-by: NDenis Kirjanov <kda@linux-powerpc.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d0d006a4