1. 15 Apr, 2016 36 commits
  2. 14 Apr, 2016 4 commits
    • Weongyo Jeong's avatar
      packet: uses kfree_skb() for errors. · da37845f
      Weongyo Jeong authored
      consume_skb() isn't for error cases that kfree_skb() is more proper
      one.  At this patch, it fixed tpacket_rcv() and packet_rcv() to be
      consistent for error or non-error cases letting perf trace its event
      properly.
      Signed-off-by: default avatarWeongyo Jeong <weongyo.linux@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      da37845f
    • Parthasarathy Bhuvaragan's avatar
      tipc: fix a race condition leading to subscriber refcnt bug · 333f7962
      Parthasarathy Bhuvaragan authored
      Until now, the requests sent to topology server are queued
      to a workqueue by the generic server framework.
      These messages are processed by worker threads and trigger the
      registered callbacks.
      To reduce latency on uniprocessor systems, explicit rescheduling
      is performed using cond_resched() after MAX_RECV_MSG_COUNT(25)
      messages.
      
      This implementation on SMP systems leads to an subscriber refcnt
      error as described below:
      When a worker thread yields by calling cond_resched() in a SMP
      system, a new worker is created on another CPU to process the
      pending workitem. Sometimes the sleeping thread wakes up before
      the new thread finishes execution.
      This breaks the assumption on ordering and being single threaded.
      The fault is more frequent when MAX_RECV_MSG_COUNT is lowered.
      
      If the first thread was processing subscription create and the
      second thread processing close(), the close request will free
      the subscriber and the create request oops as follows:
      
      [31.224137] WARNING: CPU: 2 PID: 266 at include/linux/kref.h:46 tipc_subscrb_rcv_cb+0x317/0x380         [tipc]
      [31.228143] CPU: 2 PID: 266 Comm: kworker/u8:1 Not tainted 4.5.0+ #97
      [31.228377] Workqueue: tipc_rcv tipc_recv_work [tipc]
      [...]
      [31.228377] Call Trace:
      [31.228377]  [<ffffffff812fbb6b>] dump_stack+0x4d/0x72
      [31.228377]  [<ffffffff8105a311>] __warn+0xd1/0xf0
      [31.228377]  [<ffffffff8105a3fd>] warn_slowpath_null+0x1d/0x20
      [31.228377]  [<ffffffffa0098067>] tipc_subscrb_rcv_cb+0x317/0x380 [tipc]
      [31.228377]  [<ffffffffa00a4984>] tipc_receive_from_sock+0xd4/0x130 [tipc]
      [31.228377]  [<ffffffffa00a439b>] tipc_recv_work+0x2b/0x50 [tipc]
      [31.228377]  [<ffffffff81071925>] process_one_work+0x145/0x3d0
      [31.246554] ---[ end trace c3882c9baa05a4fd ]---
      [31.248327] BUG: spinlock bad magic on CPU#2, kworker/u8:1/266
      [31.249119] BUG: unable to handle kernel NULL pointer dereference at 0000000000000428
      [31.249323] IP: [<ffffffff81099d0c>] spin_dump+0x5c/0xe0
      [31.249323] PGD 0
      [31.249323] Oops: 0000 [#1] SMP
      
      In this commit, we
      - rename tipc_conn_shutdown() to tipc_conn_release().
      - move connection release callback execution from tipc_close_conn()
        to a new function tipc_sock_release(), which is executed before
        we free the connection.
      Thus we release the subscriber during connection release procedure
      rather than connection shutdown procedure.
      Signed-off-by: default avatarParthasarathy Bhuvaragan <parthasarathy.bhuvaragan@ericsson.com>
      Acked-by: default avatarYing Xue <ying.xue@windriver.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      333f7962
    • David S. Miller's avatar
      Merge branch 'gro-fixed-id-gso-partial' · edd93cd7
      David S. Miller authored
      Alexander Duyck says:
      
      ====================
      GRO Fixed IPv4 ID support and GSO partial support
      
      This patch series sets up a few different things.
      
      First it adds support for GRO of frames with a fixed IP ID value.  This
      will allow us to perform GRO for frames that go through things like an IPv6
      to IPv4 header translation.
      
      The second item we add is support for segmenting frames that are generated
      this way.  Most devices only support an incrementing IP ID value, and in
      the case of TCP the IP ID can be ignored in many cases since the DF bit
      should be set.  So we can technically segment these frames using existing
      TSO if we are willing to allow the IP ID to be mangled.  As such I have
      added a matching feature for the new form of GRO/GSO called TCP IPv4 ID
      mangling.  With this enabled we can assemble and disassemble a frame with
      the sequence number fixed and the only ill effect will be that the IPv4 ID
      will be altered which may or may not have any noticeable effect.  As such I
      have defaulted the feature to disabled.
      
      The third item this patch series adds is support for partial GSO
      segmentation.  Partial GSO segmentation allows us to split a large frame
      into two pieces.  The first piece will have an even multiple of MSS worth
      of data and the headers before the one pointed to by csum_start will have
      been updated so that they are correct for if the data payload had already
      been segmented.  By doing this we can do things such as precompute the
      outer header checksums for a frame to be segmented allowing us to perform
      TSO on devices that don't support tunneling, or tunneling with outer header
      checksums.
      
      This patch set is based on the net-next tree, but I included "net: remove
      netdevice gso_min_segs" in my tree as I assume it is likely to be applied
      before this patch set will and I wanted to avoid a merge conflict.
      
      v2: Fixed items reported by Jesse Gross
      	fixed missing GSO flag in MPLS check
      	adding DF check for MANGLEID
          Moved extra GSO feature checks into gso_features_check
          Rebased batches to account for "net: remove netdevice gso_min_segs"
      
      Driver patches from the first patch set should still be compatible.  However
      I do have a few changes in them so I will submit a v2 of those to Jeff
      Kirsher once these patches are accepted into net-next.
      
      Example driver patches for i40e, ixgbe, and igb:
      https://patchwork.ozlabs.org/patch/608221/
      https://patchwork.ozlabs.org/patch/608224/
      https://patchwork.ozlabs.org/patch/608225/
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      edd93cd7
    • Alexander Duyck's avatar
      Documentation: Add documentation for TSO and GSO features · f7a6272b
      Alexander Duyck authored
      This document is a starting point for defining the TSO and GSO features.
      The whole thing is starting to get a bit messy so I wanted to make sure we
      have notes somwhere to start describing what does and doesn't work.
      Signed-off-by: default avatarAlexander Duyck <aduyck@mirantis.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f7a6272b