1. 07 11月, 2019 10 次提交
    • M
      net: phy: at803x: fix Kconfig description · 4985dffc
      Michael Walle 提交于
      The name of the PHY is actually AR803x not AT803x. Additionally, add the
      name of the vendor and mention the AR8031 support.
      Signed-off-by: NMichael Walle <michael@walle.cc>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4985dffc
    • E
      net: silence data-races on sk_backlog.tail · 9ed498c6
      Eric Dumazet 提交于
      sk->sk_backlog.tail might be read without holding the socket spinlock,
      we need to add proper READ_ONCE()/WRITE_ONCE() to silence the warnings.
      
      KCSAN reported :
      
      BUG: KCSAN: data-race in tcp_add_backlog / tcp_recvmsg
      
      write to 0xffff8881265109f8 of 8 bytes by interrupt on cpu 1:
       __sk_add_backlog include/net/sock.h:907 [inline]
       sk_add_backlog include/net/sock.h:938 [inline]
       tcp_add_backlog+0x476/0xce0 net/ipv4/tcp_ipv4.c:1759
       tcp_v4_rcv+0x1a70/0x1bd0 net/ipv4/tcp_ipv4.c:1947
       ip_protocol_deliver_rcu+0x4d/0x420 net/ipv4/ip_input.c:204
       ip_local_deliver_finish+0x110/0x140 net/ipv4/ip_input.c:231
       NF_HOOK include/linux/netfilter.h:305 [inline]
       NF_HOOK include/linux/netfilter.h:299 [inline]
       ip_local_deliver+0x133/0x210 net/ipv4/ip_input.c:252
       dst_input include/net/dst.h:442 [inline]
       ip_rcv_finish+0x121/0x160 net/ipv4/ip_input.c:413
       NF_HOOK include/linux/netfilter.h:305 [inline]
       NF_HOOK include/linux/netfilter.h:299 [inline]
       ip_rcv+0x18f/0x1a0 net/ipv4/ip_input.c:523
       __netif_receive_skb_one_core+0xa7/0xe0 net/core/dev.c:4929
       __netif_receive_skb+0x37/0xf0 net/core/dev.c:5043
       netif_receive_skb_internal+0x59/0x190 net/core/dev.c:5133
       napi_skb_finish net/core/dev.c:5596 [inline]
       napi_gro_receive+0x28f/0x330 net/core/dev.c:5629
       receive_buf+0x284/0x30b0 drivers/net/virtio_net.c:1061
       virtnet_receive drivers/net/virtio_net.c:1323 [inline]
       virtnet_poll+0x436/0x7d0 drivers/net/virtio_net.c:1428
       napi_poll net/core/dev.c:6311 [inline]
       net_rx_action+0x3ae/0xa90 net/core/dev.c:6379
       __do_softirq+0x115/0x33f kernel/softirq.c:292
       invoke_softirq kernel/softirq.c:373 [inline]
       irq_exit+0xbb/0xe0 kernel/softirq.c:413
       exiting_irq arch/x86/include/asm/apic.h:536 [inline]
       do_IRQ+0xa6/0x180 arch/x86/kernel/irq.c:263
       ret_from_intr+0x0/0x19
       native_safe_halt+0xe/0x10 arch/x86/kernel/paravirt.c:71
       arch_cpu_idle+0x1f/0x30 arch/x86/kernel/process.c:571
       default_idle_call+0x1e/0x40 kernel/sched/idle.c:94
       cpuidle_idle_call kernel/sched/idle.c:154 [inline]
       do_idle+0x1af/0x280 kernel/sched/idle.c:263
       cpu_startup_entry+0x1b/0x20 kernel/sched/idle.c:355
       start_secondary+0x208/0x260 arch/x86/kernel/smpboot.c:264
       secondary_startup_64+0xa4/0xb0 arch/x86/kernel/head_64.S:241
      
      read to 0xffff8881265109f8 of 8 bytes by task 8057 on cpu 0:
       tcp_recvmsg+0x46e/0x1b40 net/ipv4/tcp.c:2050
       inet_recvmsg+0xbb/0x250 net/ipv4/af_inet.c:838
       sock_recvmsg_nosec net/socket.c:871 [inline]
       sock_recvmsg net/socket.c:889 [inline]
       sock_recvmsg+0x92/0xb0 net/socket.c:885
       sock_read_iter+0x15f/0x1e0 net/socket.c:967
       call_read_iter include/linux/fs.h:1889 [inline]
       new_sync_read+0x389/0x4f0 fs/read_write.c:414
       __vfs_read+0xb1/0xc0 fs/read_write.c:427
       vfs_read fs/read_write.c:461 [inline]
       vfs_read+0x143/0x2c0 fs/read_write.c:446
       ksys_read+0xd5/0x1b0 fs/read_write.c:587
       __do_sys_read fs/read_write.c:597 [inline]
       __se_sys_read fs/read_write.c:595 [inline]
       __x64_sys_read+0x4c/0x60 fs/read_write.c:595
       do_syscall_64+0xcc/0x370 arch/x86/entry/common.c:290
       entry_SYSCALL_64_after_hwframe+0x44/0xa9
      
      Reported by Kernel Concurrency Sanitizer on:
      CPU: 0 PID: 8057 Comm: syz-fuzzer Not tainted 5.4.0-rc6+ #0
      Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9ed498c6
    • I
      dpaa2-eth: fix an always true condition in dpaa2_mac_get_if_mode · 226df3ef
      Ioana Ciornei 提交于
      Convert the phy_mode() function to return the if_mode through an
      argument, similar to the new form of of_get_phy_mode().
      This will help with handling errors in a common manner and also will fix
      an always true condition.
      
      Fixes: 0c65b2b9 ("net: of_get_phy_mode: Change API to solve int/unit warnings")
      Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: NIoana Ciornei <ioana.ciornei@nxp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      226df3ef
    • W
      net: axienet: Fix error return code in axienet_probe() · eb34e98b
      Wei Yongjun 提交于
      In the DMA memory resource get failed case, the error is not
      set and 0 will be returned. Fix it by removing redundant check
      since devm_ioremap_resource() will handle it.
      
      Fixes: 28ef9ebd ("net: axienet: make use of axistream-connected attribute optional")
      Signed-off-by: NWei Yongjun <weiyongjun1@huawei.com>
      Reviewed-by: NRadhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      eb34e98b
    • W
      net: aquantia: fix return value check in aq_ptp_init() · 1dcff44a
      Wei Yongjun 提交于
      Function ptp_clock_register() returns ERR_PTR() and never returns
      NULL. The NULL test should be removed.
      Signed-off-by: NWei Yongjun <weiyongjun1@huawei.com>
      Acked-by: NIgor Russkikh <irusskikh@marvell.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1dcff44a
    • W
      ptp: ptp_clockmatrix: Fix missing unlock on error in idtcm_probe() · b97fa0b5
      Wei Yongjun 提交于
      Add the missing unlock before return from function idtcm_probe()
      in the error handling case.
      
      Fixes: 3a6ba7dc ("ptp: Add a ptp clock driver for IDT ClockMatrix.")
      Signed-off-by: NWei Yongjun <weiyongjun1@huawei.com>
      Reviewed-by: NVincent Cheng <vincent.cheng.xh@renesas.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b97fa0b5
    • C
      gianfar: Maximize Rx buffer size · a9b97286
      Claudiu Manoil 提交于
      Until now the size of a Rx buffer was artificially limited
      to 1536B (which happens to be the default, after reset, hardware
      value for a Rx buffer). This approach however leaves unused
      memory space for Rx packets, since the driver uses a paged
      allocation scheme that reserves half a page for each Rx skb.
      There's also the inconvenience that frames around 1536 bytes
      can get scattered if the limit is slightly exceeded. This limit
      can be exceeded even for standard MTU of 1500B traffic, for common
      cases like stacked VLANs, or DSA tags.
      To address these issues, let's just compute the buffer size
      starting from the upper limit of 2KB (half a page) and
      subtract the skb overhead and alignment restrictions.
      Signed-off-by: NClaudiu Manoil <claudiu.manoil@nxp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a9b97286
    • Y
      ehea: replace with page_shift() in ehea_is_hugepage() · 9439bb0f
      Yunfeng Ye 提交于
      The function page_shift() is supported after the commit 94ad9338
      ("mm: introduce page_shift()").
      
      So replace with page_shift() in ehea_is_hugepage() for readability.
      Signed-off-by: NYunfeng Ye <yeyunfeng@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9439bb0f
    • Z
      net: forcedeth: add xmit_more support · 5d8876e2
      Zhu Yanjun 提交于
      This change adds support for xmit_more based on the igb commit 6f19e12f
      ("igb: flush when in xmit_more mode and under descriptor pressure") and
      commit 6b16f9ee ("net: move skb->xmit_more hint to softnet data") that
      were made to igb to support this feature. The function netif_xmit_stopped
      is called to check whether transmit queue on device is currently unable to
      send to determine whether we must write the tail because we can add no
      further buffers.
      
      When normal packets and/or xmit_more packets fill up tx_desc, it is
      necessary to trigger NIC tx reg.
      
      Following the advice from David Miller and Jakub Kicinski, after the
      xmit_more feature is added, the following scenario will occur.
      
               |
         xmit_more packets
               |
         DMA_MAPPING
               |
         DMA_MAPPING error check
               |
         xmit_more packets already in HW xmit queue
               |
      
      In the above scenario, if DMA_MAPPING error occurrs, the xmit_more packets
      already in HW xmit queue will also be dropped. This is different from the
      behavior before xmit_more feature. So it is necessary to trigger NIC HW tx
      reg in the above scenario.
      
      To the non-xmit_more packets, the above scenario will not occur.
      
      Tested:
        - pktgen (xmit_more packets) SMP x86_64 ->
          Test command:
          ./pktgen_sample03_burst_single_flow.sh ... -b 8 -n 1000000
          Test results:
          Params:
          ...
          burst: 8
          ...
          Result: OK: 12194004(c12188996+d5007) usec, 1000001 (1500byte,0frags)
          82007pps 984Mb/sec (984084000bps) errors: 0
      
        - iperf (normal packets) SMP x86_64 ->
          Test command:
          Server: iperf -s
          Client: iperf -c serverip
          Result:
          TCP window size: 85.0 KByte (default)
          ------------------------------------------------------------
          [ ID] Interval       Transfer     Bandwidth
          [  3]  0.0-10.0 sec  1.10 GBytes   942 Mbits/sec
      
      CC: Joe Jin <joe.jin@oracle.com>
      CC: JUNXIAO_BI <junxiao.bi@oracle.com>
      Reported-and-tested-by: NNan san <nan.1986san@gmail.com>
      Signed-off-by: NZhu Yanjun <yanjun.zhu@oracle.com>
      Acked-by: NJakub Kicinski <jakub.kicinski@netronome.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5d8876e2
    • J
      netdevsim: drop code duplicated by a merge · bfcccfe7
      Jakub Kicinski 提交于
      Looks like the port adding loop makes a re-appearance on net-next
      after net was merged back into it (even though it doesn't feature
      in the merge diff).
      
      The ports are already added in nsim_dev_create() so when we try
      to add them again get EEXIST, and see:
      
      netdevsim: probe of netdevsim0 failed with error -17
      
      in the logs. When we remove the loop again the nsim_dev_probe()
      and nsim_dev_remove() become a wrapper of nsim_dev_create() and
      nsim_dev_destroy(). Remove this layer of indirection.
      
      Fixes: d31e9558 ("Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net")
      Signed-off-by: NJakub Kicinski <jakub.kicinski@netronome.com>
      Acked-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bfcccfe7
  2. 06 11月, 2019 15 次提交
  3. 05 11月, 2019 15 次提交