1. 04 Jun, 2018 30 commits
    • David Howells's avatar
      rxrpc: Fix handling of call quietly cancelled out on server · 1a025028
      David Howells authored
      Sometimes an in-progress call will stop responding on the fileserver when
      the fileserver quietly cancels the call with an internally marked abort
      (RX_CALL_DEAD), without sending an ABORT to the client.
      
      This causes the client's call to eventually expire from lack of incoming
      packets directed its way, which currently leads to it being cancelled
      locally with ETIME.  Note that it's not currently clear as to why this
      happens as it's really hard to reproduce.
      
      The rotation policy implement by kAFS, however, doesn't differentiate
      between ETIME meaning we didn't get any response from the server and ETIME
      meaning the call got cancelled mid-flow.  The latter leads to an oops when
      fetching data as the rotation partially resets the afs_read descriptor,
      which can result in a cleared page pointer being dereferenced because that
      page has already been filled.
      
      Handle this by the following means:
      
       (1) Set a flag on a call when we receive a packet for it.
      
       (2) Store the highest packet serial number so far received for a call
           (bearing in mind this may wrap).
      
       (3) If, when the "not received anything recently" timeout expires on a
           call, we've received at least one packet for a call and the connection
           as a whole has received packets more recently than that call, then
           cancel the call locally with ECONNRESET rather than ETIME.
      
           This indicates that the call was definitely in progress on the server.
      
       (4) In kAFS, if the rotation algorithm sees ECONNRESET rather than ETIME,
           don't try the next server, but rather abort the call.
      
           This avoids the oops as we don't try to reuse the afs_read struct.
           Rather, as-yet ungotten pages will be reread at a later data.
      
      Also:
      
       (5) Add an rxrpc tracepoint to log detection of the call being reset.
      
      Without this, I occasionally see an oops like the following:
      
          general protection fault: 0000 [#1] SMP PTI
          ...
          RIP: 0010:_copy_to_iter+0x204/0x310
          RSP: 0018:ffff8800cae0f828 EFLAGS: 00010206
          RAX: 0000000000000560 RBX: 0000000000000560 RCX: 0000000000000560
          RDX: ffff8800cae0f968 RSI: ffff8800d58b3312 RDI: 0005080000000000
          RBP: ffff8800cae0f968 R08: 0000000000000560 R09: ffff8800ca00f400
          R10: ffff8800c36f28d4 R11: 00000000000008c4 R12: ffff8800cae0f958
          R13: 0000000000000560 R14: ffff8800d58b3312 R15: 0000000000000560
          FS:  00007fdaef108080(0000) GS:ffff8800ca680000(0000) knlGS:0000000000000000
          CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
          CR2: 00007fb28a8fa000 CR3: 00000000d2a76002 CR4: 00000000001606e0
          Call Trace:
           skb_copy_datagram_iter+0x14e/0x289
           rxrpc_recvmsg_data.isra.0+0x6f3/0xf68
           ? trace_buffer_unlock_commit_regs+0x4f/0x89
           rxrpc_kernel_recv_data+0x149/0x421
           afs_extract_data+0x1e0/0x798
           ? afs_wait_for_call_to_complete+0xc9/0x52e
           afs_deliver_fs_fetch_data+0x33a/0x5ab
           afs_deliver_to_call+0x1ee/0x5e0
           ? afs_wait_for_call_to_complete+0xc9/0x52e
           afs_wait_for_call_to_complete+0x12b/0x52e
           ? wake_up_q+0x54/0x54
           afs_make_call+0x287/0x462
           ? afs_fs_fetch_data+0x3e6/0x3ed
           ? rcu_read_lock_sched_held+0x5d/0x63
           afs_fs_fetch_data+0x3e6/0x3ed
           afs_fetch_data+0xbb/0x14a
           afs_readpages+0x317/0x40d
           __do_page_cache_readahead+0x203/0x2ba
           ? ondemand_readahead+0x3a7/0x3c1
           ondemand_readahead+0x3a7/0x3c1
           generic_file_buffered_read+0x18b/0x62f
           __vfs_read+0xdb/0xfe
           vfs_read+0xb2/0x137
           ksys_read+0x50/0x8c
           do_syscall_64+0x7d/0x1a0
           entry_SYSCALL_64_after_hwframe+0x49/0xbe
      
      Note the weird value in RDI which is a result of trying to kmap() a NULL
      page pointer.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1a025028
    • Chas Williams's avatar
      Allow ethtool to change tun link settings · 4e24f2dd
      Chas Williams authored
      Let user space set whatever it would like to advertise for the
      tun interface.  Preserve the existing defaults.
      Signed-off-by: default avatarChas Williams <3chas3@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4e24f2dd
    • David S. Miller's avatar
      Merge branch 'sh_eth-fix-and-clean-up-sh_eth_soft_swap' · 4cd328f8
      David S. Miller authored
      Sergei Shtylyov says:
      
      ====================
      sh_eth: fix & clean up sh_eth_soft_swap()
      
      Here's a set of 3 patches against DaveM's 'net-next.git' repo. First one fixes an
      old buffer endiannes issue (luckily, the ARM SoCs are smart enough to not actually
      care) plus couple clean ups around sh_eth_soft_swap()...
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4cd328f8
    • Sergei Shtylyov's avatar
      sh_eth: use DIV_ROUND_UP() in sh_eth_soft_swap() · 1100149a
      Sergei Shtylyov authored
      When initializing 'maxp' in sh_eth_soft_swap(), the buffer length needs
      to be rounded  up -- that's just asking for DIV_ROUND_UP()!
      Signed-off-by: default avatarSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
      Reviewed-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1100149a
    • Sergei Shtylyov's avatar
      sh_eth: uninline sh_eth_soft_swap() · bb2fa4e8
      Sergei Shtylyov authored
      sh_eth_tsu_soft_swap() is called twice by the driver, remove *inline* and
      move  that function  from the header to the driver itself to let gcc decide
      whether to expand it inline or not...
      Signed-off-by: default avatarSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
      Reviewed-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bb2fa4e8
    • Sergei Shtylyov's avatar
      sh_eth: make sh_eth_soft_swap() work on ARM · 232b6743
      Sergei Shtylyov authored
      Browsing  thru the driver disassembly, I noticed that ARM gcc generated
      no  code  whatsoever for sh_eth_soft_swap() while building a little-endian
      kernel -- apparently __LITTLE_ENDIAN__ was not being #define'd, however
      it got implicitly #define'd when building with the SH gcc (I could only
      find the explicit #define __LITTLE_ENDIAN that was #include'd when building
      a little-endian kernel).  Luckily, the Ether controller  only doing big-
      endian DMA is encountered on the early SH771x SoCs only and all ARM SoCs
      implement EDMR.DE and thus set 'sh_eth_cpu_data::hw_swap'. But anyway, we
      need to fix the #ifdef inside sh_eth_soft_swap() to something that would
      work on all architectures...
      Signed-off-by: default avatarSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
      Reviewed-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      232b6743
    • David S. Miller's avatar
      Merge branch 'mlxsw-Fixes-in-offloading-of-mirror-to-gretap' · 20677108
      David S. Miller authored
      Ido Schimmel says:
      
      ====================
      mlxsw: Fixes in offloading of mirror-to-gretap
      
      Petr says:
      
      These two patches fix issues in offloading of mirror-to-gretap when
      bridge is present in the underlay.
      
      In patch #1, reconsideration of SPAN configuration is not done right at
      the point that SWITCHDEV_OBJ_ID_PORT_VLAN deletion notification is
      distributed, but is postponed, because the notifications are actually
      distributed before the relevant change is implemented in the bridge.
      
      In patch #2, a problem in configuring VLAN tagging in situations when a
      VLAN device is on top of an 802.1Q bridge whose egress port is marked as
      "egress untagged". In that case, mlxsw would neglect to suppress the
      tagging implicitly assumed after the VLAN device was seen.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      20677108
    • Petr Machata's avatar
      mlxsw: spectrum_span: Suppress VLAN on BRIDGE_VLAN_INFO_UNTAGGED · 1fc68bb7
      Petr Machata authored
      When offloading mirroring to gretap or ip6gretap netdevices, an 802.1q
      bridge is one of the soft devices permissible in the underlay when
      resolving the packet path. After the packet path is resolved to a
      particular bridge egress device, flags on packet VLAN determine whether
      the egressed packet should be tagged.
      
      The current logic however only ever sets the VLAN tag, never suppresses
      it. Thus if there's a VLAN netdevice above the bridge that determines
      the packet VLAN, that VLAN is never unset, and mirroring is configured
      with VLAN tagging.
      
      Fix by setting the packet VLAN on both branches: set to zero (for unset)
      when BRIDGE_VLAN_INFO_UNTAGGED, copy the resolved VLAN (e.g. from bridge
      PVID) otherwise.
      
      Fixes: 946a11e7 ("mlxsw: spectrum_span: Allow bridge for gretap mirror")
      Signed-off-by: default avatarPetr Machata <petrm@mellanox.com>
      Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1fc68bb7
    • Petr Machata's avatar
      mlxsw: spectrum_switchdev: Postpone respin on object deletion · f07ff014
      Petr Machata authored
      VLAN deletion notifications are emitted before the relevant change is
      projected to bridge configuration. Thus, like with VLAN addition,
      schedule SPAN respin for later.
      
      Fixes: c520bc69 ("mlxsw: Respin SPAN on switchdev events")
      Signed-off-by: default avatarPetr Machata <petrm@mellanox.com>
      Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f07ff014
    • Michal Kubecek's avatar
      ipv6: omit traffic class when calculating flow hash · fa1be7e0
      Michal Kubecek authored
      Some of the code paths calculating flow hash for IPv6 use flowlabel member
      of struct flowi6 which, despite its name, encodes both flow label and
      traffic class. If traffic class changes within a TCP connection (as e.g.
      ssh does), ECMP route can switch between path. It's also inconsistent with
      other code paths where ip6_flowlabel() (returning only flow label) is used
      to feed the key.
      
      Use only flow label everywhere, including one place where hash key is set
      using ip6_flowinfo().
      
      Fixes: 51ebd318 ("ipv6: add support of equal cost multipath (ECMP)")
      Fixes: f70ea018 ("net: Add functions to get skb->hash based on flow structures")
      Signed-off-by: default avatarMichal Kubecek <mkubecek@suse.cz>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fa1be7e0
    • David S. Miller's avatar
      Revert "ipv6: omit traffic class when calculating flow hash" · a925ab48
      David S. Miller authored
      This reverts commit 87ae68c8.
      
      Applied the wrong version of this fix, correct version
      coming up.
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a925ab48
    • Michal Kubecek's avatar
      ipv6: omit traffic class when calculating flow hash · 87ae68c8
      Michal Kubecek authored
      Some of the code paths calculating flow hash for IPv6 use flowlabel member
      of struct flowi6 which, despite its name, encodes both flow label and
      traffic class. If traffic class changes within a TCP connection (as e.g.
      ssh does), ECMP route can switch between path. It's also incosistent with
      other code paths where ip6_flowlabel() (returning only flow label) is used
      to feed the key.
      
      Use only flow label everywhere, including one place where hash key is set
      using ip6_flowinfo().
      
      Fixes: 51ebd318 ("ipv6: add support of equal cost multipath (ECMP)")
      Fixes: f70ea018 ("net: Add functions to get skb->hash based on flow structures")
      Signed-off-by: default avatarMichal Kubecek <mkubecek@suse.cz>
      Reviewed-by: default avatarIdo Schimmel <idosch@mellanox.com>
      Tested-by: default avatarIdo Schimmel <idosch@mellanox.com>
      Acked-by: default avatarDavid Ahern <dsahern@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      87ae68c8
    • kbuild test robot's avatar
      net: mvpp2: mvpp2_percpu_read_relaxed() can be static · fe083b3f
      kbuild test robot authored
      Fixes: db9d7d36 ("net: mvpp2: Split the PPv2 driver to a dedicated directory")
      Signed-off-by: default avatarkbuild test robot <fengguang.wu@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fe083b3f
    • Eric Dumazet's avatar
      net/packet: refine check for priv area size · eb73190f
      Eric Dumazet authored
      syzbot was able to trick af_packet again [1]
      
      Various commits tried to address the problem in the past,
      but failed to take into account V3 header size.
      
      [1]
      
      tpacket_rcv: packet too big, clamped from 72 to 4294967224. macoff=96
      BUG: KASAN: use-after-free in prb_run_all_ft_ops net/packet/af_packet.c:1016 [inline]
      BUG: KASAN: use-after-free in prb_fill_curr_block.isra.59+0x4e5/0x5c0 net/packet/af_packet.c:1039
      Write of size 2 at addr ffff8801cb62000e by task kworker/1:2/2106
      
      CPU: 1 PID: 2106 Comm: kworker/1:2 Not tainted 4.17.0-rc7+ #77
      Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
      Workqueue: ipv6_addrconf addrconf_dad_work
      Call Trace:
       __dump_stack lib/dump_stack.c:77 [inline]
       dump_stack+0x1b9/0x294 lib/dump_stack.c:113
       print_address_description+0x6c/0x20b mm/kasan/report.c:256
       kasan_report_error mm/kasan/report.c:354 [inline]
       kasan_report.cold.7+0x242/0x2fe mm/kasan/report.c:412
       __asan_report_store2_noabort+0x17/0x20 mm/kasan/report.c:436
       prb_run_all_ft_ops net/packet/af_packet.c:1016 [inline]
       prb_fill_curr_block.isra.59+0x4e5/0x5c0 net/packet/af_packet.c:1039
       __packet_lookup_frame_in_block net/packet/af_packet.c:1094 [inline]
       packet_current_rx_frame net/packet/af_packet.c:1117 [inline]
       tpacket_rcv+0x1866/0x3340 net/packet/af_packet.c:2282
       dev_queue_xmit_nit+0x891/0xb90 net/core/dev.c:2018
       xmit_one net/core/dev.c:3049 [inline]
       dev_hard_start_xmit+0x16b/0xc10 net/core/dev.c:3069
       __dev_queue_xmit+0x2724/0x34c0 net/core/dev.c:3584
       dev_queue_xmit+0x17/0x20 net/core/dev.c:3617
       neigh_resolve_output+0x679/0xad0 net/core/neighbour.c:1358
       neigh_output include/net/neighbour.h:482 [inline]
       ip6_finish_output2+0xc9c/0x2810 net/ipv6/ip6_output.c:120
       ip6_finish_output+0x5fe/0xbc0 net/ipv6/ip6_output.c:154
       NF_HOOK_COND include/linux/netfilter.h:277 [inline]
       ip6_output+0x227/0x9b0 net/ipv6/ip6_output.c:171
       dst_output include/net/dst.h:444 [inline]
       NF_HOOK include/linux/netfilter.h:288 [inline]
       ndisc_send_skb+0x100d/0x1570 net/ipv6/ndisc.c:491
       ndisc_send_ns+0x3c1/0x8d0 net/ipv6/ndisc.c:633
       addrconf_dad_work+0xbef/0x1340 net/ipv6/addrconf.c:4033
       process_one_work+0xc1e/0x1b50 kernel/workqueue.c:2145
       worker_thread+0x1cc/0x1440 kernel/workqueue.c:2279
       kthread+0x345/0x410 kernel/kthread.c:240
       ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:412
      
      The buggy address belongs to the page:
      page:ffffea00072d8800 count:0 mapcount:-127 mapping:0000000000000000 index:0xffff8801cb620e80
      flags: 0x2fffc0000000000()
      raw: 02fffc0000000000 0000000000000000 ffff8801cb620e80 00000000ffffff80
      raw: ffffea00072e3820 ffffea0007132d20 0000000000000002 0000000000000000
      page dumped because: kasan: bad access detected
      
      Memory state around the buggy address:
       ffff8801cb61ff00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
       ffff8801cb61ff80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      >ffff8801cb620000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
                            ^
       ffff8801cb620080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
       ffff8801cb620100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
      
      Fixes: 2b6867c2 ("net/packet: fix overflow in check for priv area size")
      Fixes: dc808110 ("packet: handle too big packets for PACKET_V3")
      Fixes: f6fb8f10 ("af-packet: TPACKET_V3 flexible buffer implementation.")
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Reported-by: default avatarsyzbot <syzkaller@googlegroups.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      eb73190f
    • Colin Ian King's avatar
      net: aquantia: make function aq_fw2x_get_mac_permanent static · 76a45194
      Colin Ian King authored
      The function aq_fw2x_get_mac_permanent is local to the source and does
      not need to be in global scope, so make it static.
      
      Cleans up sparse warning:
      warning: symbol 'aq_fw2x_get_mac_permanent' was not declared. Should it
      be static?
      Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      76a45194
    • Eric Dumazet's avatar
      d3adce9d
    • Stephen Suryaputra's avatar
      vrf: check the original netdevice for generating redirect · 2f17becf
      Stephen Suryaputra authored
      Use the right device to determine if redirect should be sent especially
      when using vrf. Same as well as when sending the redirect.
      Signed-off-by: default avatarStephen Suryaputra <ssuryaextr@gmail.com>
      Acked-by: default avatarDavid Ahern <dsahern@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2f17becf
    • Varsha Rao's avatar
      net: ethernet: mlx4: Remove unnecessary parentheses · cfed0a2c
      Varsha Rao authored
      This patch fixes the clang warning of extraneous parentheses, with the
      following coccinelle script.
      
      @@
      identifier i;
      expression e;
      statement s;
      @@
      if (
      -(i == e)
      +i == e
       )
      s
      Suggested-by: default avatarLukas Bulwahn <lukas.bulwahn@gmail.com>
      Signed-off-by: default avatarVarsha Rao <rvarsha016@gmail.com>
      Acked-by: default avatarTariq Toukan <tariqt@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      cfed0a2c
    • Jose Abreu's avatar
      net: stmmac: Add Flexible PPS support · 9a8a02c9
      Jose Abreu authored
      This adds support for Flexible PPS output (which is equivalent
      to per_out output of PTP subsystem).
      
      Tested using an oscilloscope and the following commands:
      
      1) Start PTP4L:
      	# ptp4l -A -4 -H -m -i eth0 &
      2) Set Flexible PPS frequency:
      	# echo <idx> <ts> <tns> <ps> <pns> > /sys/class/ptp/ptpX/period
      
      Where, ts/tns is start time and ps/pns is period time, and ptpX is ptp
      of eth0.
      Signed-off-by: default avatarJose Abreu <joabreu@synopsys.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Joao Pinto <jpinto@synopsys.com>
      Cc: Vitor Soares <soares@synopsys.com>
      Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
      Cc: Alexandre Torgue <alexandre.torgue@st.com>
      Cc: Richard Cochran <richardcochran@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9a8a02c9
    • David S. Miller's avatar
      Merge branch 'qed-next' · 9db9268f
      David S. Miller authored
      Sudarsana Reddy Kalluru says:
      
      ====================
      qed: Fix issues in UFP feature commit 'cac6f691'.
      
      This patch series fixes couple of issues in the UFP feature commit,
         cac6f691: Add support for Unified Fabric Port.
      
      Changes from previous version:
      ------------------------------
      v2: Added "Fixes:" tag.
      
      Please consider applying it to "net-next".
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9db9268f
    • Sudarsana Reddy Kalluru's avatar
      qed: Fix use of incorrect shmem address. · b5fabb08
      Sudarsana Reddy Kalluru authored
      Incorrect shared memory address is used while deriving the values
      for tc and pri_type. Use shmem address corresponding to 'oem_cfg_func'
      where the management firmare saves tc/pri_type values.
      
      Fixes: cac6f691 ("qed: Add support for Unified Fabric Port")
      Signed-off-by: default avatarSudarsana Reddy Kalluru <Sudarsana.Kalluru@cavium.com>
      Signed-off-by: default avatarAriel Elior <ariel.elior@cavium.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b5fabb08
    • Sudarsana Reddy Kalluru's avatar
      qed: Fix shared memory inconsistency between driver and the MFW. · 5e9f2035
      Sudarsana Reddy Kalluru authored
      The structure shared between driver and management firmware (MFW)
      differ in sizes. The additional field defined by the MFW is not
      relevant to the current driver. Add a dummy field to the structure.
      
      Fixes: cac6f691 ("qed: Add support for Unified Fabric Port")
      Signed-off-by: default avatarSudarsana Reddy Kalluru <Sudarsana.Kalluru@cavium.com>
      Signed-off-by: default avatarAriel Elior <ariel.elior@cavium.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5e9f2035
    • David S. Miller's avatar
      Merge branch 'selftests-mirror_vlan-fixes' · 1ec23c54
      David S. Miller authored
      Petr Machata says:
      
      ====================
      selftests: forwarding: mirror_vlan: Fixlets
      
      This patchset includes two small fixes for the tests that were
      introduced in commit 1bb58d2d ("Merge branch
      'Mirroring-tests-involving-VLAN'").
      
      In patch #1, a "tc action trap" is uninstalled after the suite runs,
      instead of being installed again.
      
      In patch #2, a test in suite is renamed to differentiate it from another
      test of the same name.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1ec23c54
    • Petr Machata's avatar
      selftests: forwarding: mirror_vlan: Change test description · 6ebe5a7a
      Petr Machata authored
      The test description is displayed with the PASS/FAIL resolution after
      the test is ran. There however already is one other test described
      exactly like this, which makes it unclear which of the tests passed or
      failed. Make the description unique.
      Signed-off-by: default avatarPetr Machata <petrm@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6ebe5a7a
    • Petr Machata's avatar
      selftests: forwarding: mirror_vlan: Uninstall trap · 00d56229
      Petr Machata authored
      Instead of installing a trap before tests run and uninstalling it after
      they run, mirror_vlan.sh installs it twice due to a typo. Fix the typo.
      Signed-off-by: default avatarPetr Machata <petrm@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      00d56229
    • David S. Miller's avatar
      Merge branch 'selftests-net-various' · 8284fd4c
      David S. Miller authored
      Willem de Bruijn says:
      
      ====================
      selftests/net: various
      
      A few odds and ends to network tests:
      
      - msg_zerocopy: run as part of kselftest
      - udp gso:      add missing bounds test for minimal sizes
      - psocket_snd:  initial basic conformance test
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8284fd4c
    • Willem de Bruijn's avatar
      selftests/net: add packet socket packet_snd test · 75f0139f
      Willem de Bruijn authored
      Add regression tests for PF_PACKET transmission using packet_snd.
      
      The TPACKET ring interface has tests for transmission and reception.
      This is an initial stab at the same for the send call based interface.
      
      Packets are sent over loopback, then read twice. The entire packet is
      read from another packet socket and compared. The packet is also
      verified to arrive at a UDP socket for protocol conformance.
      
      The test sends a packet over loopback, testing the following options
      (not the full cross-product):
      
      - SOCK_DGRAM
      - SOCK_RAW
      - vlan tag
      - qdisc bypass
      - bind() and sendto()
      - virtio_net_hdr
      - csum offload (NOT actual csum feature, ignored on loopback)
      - gso
      
      Besides these basic functionality tests, the test runs from a set
      of bounds checks, positive and negative. Running over loopback, which
      has dev->min_header_len, it cannot generate variable length hhlen.
      Signed-off-by: default avatarWillem de Bruijn <willemb@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      75f0139f
    • Willem de Bruijn's avatar
      selftests/net: udpgso: test small gso_size boundary conditions · 00f333e8
      Willem de Bruijn authored
      Verify that udpgso can generate segments smaller than device mtu, down
      to the extreme case of 1B gso_size.
      
      Verify that irrespective of gso_size, udpgso restricts the number of
      segments it will generate per call (UDP_MAX_SEGMENTS).
      Signed-off-by: default avatarWillem de Bruijn <willemb@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      00f333e8
    • Willem de Bruijn's avatar
      selftests/net: enable msg_zerocopy test · 830669e6
      Willem de Bruijn authored
      The existing msg_zerocopy test takes additional protocol arguments.
      Add a variant that takes no arguments and runs all supported variants.
      Call this from kselftest.
      Signed-off-by: default avatarWillem de Bruijn <willemb@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      830669e6
    • Tonghao Zhang's avatar
      net: virtio: simplify the virtnet_find_vqs · 2fa3c8a8
      Tonghao Zhang authored
      Use the common free functions while return successfully.
      Signed-off-by: default avatarTonghao Zhang <xiangxia.m.yue@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2fa3c8a8
  2. 03 Jun, 2018 10 commits