1. 16 Sep, 2016 23 commits
  2. 15 Sep, 2016 8 commits
  3. 13 Sep, 2016 9 commits
    • David Howells's avatar
      rxrpc: Add IPv6 support · 75b54cb5
      David Howells authored
      Add IPv6 support to AF_RXRPC.  With this, AF_RXRPC sockets can be created:
      
      	service = socket(AF_RXRPC, SOCK_DGRAM, PF_INET6);
      
      instead of:
      
      	service = socket(AF_RXRPC, SOCK_DGRAM, PF_INET);
      
      The AFS filesystem doesn't support IPv6 at the moment, though, since that
      requires upgrades to some of the RPC calls.
      
      Note that a good portion of this patch is replacing "%pI4:%u" in print
      statements with "%pISpc" which is able to handle both protocols and print
      the port.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      75b54cb5
    • David Howells's avatar
      rxrpc: Use rxrpc_extract_addr_from_skb() rather than doing this manually · 1c2bc7b9
      David Howells authored
      There are two places that want to transmit a packet in response to one just
      received and manually pick the address to reply to out of the sk_buff.
      Make them use rxrpc_extract_addr_from_skb() instead so that IPv6 is handled
      automatically.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      1c2bc7b9
    • David Howells's avatar
      rxrpc: Don't specify protocol to when creating transport socket · aaa31cbc
      David Howells authored
      Pass 0 as the protocol argument when creating the transport socket rather
      than IPPROTO_UDP.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      aaa31cbc
    • David Howells's avatar
      rxrpc: Create an address for sendmsg() to bind unbound socket with · cd5892c7
      David Howells authored
      Create an address for sendmsg() to bind unbound socket with rather than
      using a completely blank address otherwise the transport socket creation
      will fail because it will try to use address family 0.
      
      We use the address family specified in the protocol argument when the
      AF_RXRPC socket was created and SOCK_DGRAM as the default.  For anything
      else, bind() must be used.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      cd5892c7
    • David Howells's avatar
      rxrpc: Correctly initialise, limit and transmit call->rx_winsize · 75e42126
      David Howells authored
      call->rx_winsize should be initialised to the sysctl setting and the sysctl
      setting should be limited to the maximum we want to permit.  Further, we
      need to place this in the ACK info instead of the sysctl setting.
      
      Furthermore, discard the idea of accepting the subpackets of a jumbo packet
      that lie beyond the receive window when the first packet of the jumbo is
      within the window.  Just discard the excess subpackets instead.  This
      allows the receive window to be opened up right to the buffer size less one
      for the dead slot.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      75e42126
    • David Howells's avatar
      rxrpc: Fix prealloc refcounting · 3432a757
      David Howells authored
      The preallocated call buffer holds a ref on the calls within that buffer.
      The ref was being released in the wrong place - it worked okay for incoming
      calls to the AFS cache manager service, but doesn't work right for incoming
      calls to a userspace service.
      
      Instead of releasing an extra ref service calls in rxrpc_release_call(),
      the ref needs to be released during the acceptance/rejectance process.  To
      this end:
      
       (1) The prealloc ref is now normally released during
           rxrpc_new_incoming_call().
      
       (2) For preallocated kernel API calls, the kernel API's ref needs to be
           released when the call is discarded on socket close.
      
       (3) We shouldn't take a second ref in rxrpc_accept_call().
      
       (4) rxrpc_recvmsg_new_call() needs to get a ref of its own when it adds
           the call to the to_be_accepted socket queue.
      
      In doing (4) above, we would prefer not to put the call's refcount down to
      0 as that entails doing cleanup in softirq context, but it's unlikely as
      there are several refs held elsewhere, at least one of which must be put by
      someone in process context calling rxrpc_release_call().  However, it's not
      a problem if we do have to do that.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      3432a757
    • David Howells's avatar
      rxrpc: Adjust the call ref tracepoint to show kernel API refs · cbd00891
      David Howells authored
      Adjust the call ref tracepoint to show references held on a call by the
      kernel API separately as much as possible and add an additional trace to at
      the allocation point from the preallocation buffer for an incoming call.
      
      Note that this doesn't show the allocation of a client call for the kernel
      separately at the moment.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      cbd00891
    • David Howells's avatar
      rxrpc: Allow tx_winsize to grow in response to an ACK · 01fd0742
      David Howells authored
      Allow tx_winsize to grow when the ACK info packet shows a larger receive
      window at the other end rather than only permitting it to shrink.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      01fd0742
    • David Howells's avatar
      rxrpc: Use skb->len not skb->data_len · 89a80ed4
      David Howells authored
      skb->len should be used rather than skb->data_len when referring to the
      amount of data in a packet.  This will only cause a malfunction in the
      following cases:
      
       (1) We receive a jumbo packet (validation and splitting both are wrong).
      
       (2) We see if there's extra ACK info in an ACK packet (we think it's not
           there and just ignore it).
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      89a80ed4