An error occurred fetching the project authors.
  1. 05 Mar, 2024 2 commits
    • David Howells's avatar
      rxrpc: Don't permit resending after all Tx packets acked · a711d976
      David Howells authored
      Once all the packets transmitted as part of a call have been acked, don't
      permit any resending.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      cc: Marc Dionne <marc.dionne@auristor.com>
      cc: "David S. Miller" <davem@davemloft.net>
      cc: Eric Dumazet <edumazet@google.com>
      cc: Jakub Kicinski <kuba@kernel.org>
      cc: Paolo Abeni <pabeni@redhat.com>
      cc: linux-afs@lists.infradead.org
      cc: netdev@vger.kernel.org
      a711d976
    • David Howells's avatar
      rxrpc: Parse received packets before dealing with timeouts · 3e0b83ee
      David Howells authored
      Parse the received packets before going and processing timeouts as the
      timeouts may be reset by the reception of a packet.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      cc: Marc Dionne <marc.dionne@auristor.com>
      cc: "David S. Miller" <davem@davemloft.net>
      cc: Eric Dumazet <edumazet@google.com>
      cc: Jakub Kicinski <kuba@kernel.org>
      cc: Paolo Abeni <pabeni@redhat.com>
      cc: linux-afs@lists.infradead.org
      cc: netdev@vger.kernel.org
      3e0b83ee
  2. 29 Feb, 2024 5 commits
    • David Howells's avatar
      rxrpc: Move rxrpc_send_ACK() to output.c with rxrpc_send_ack_packet() · 99afb28c
      David Howells authored
      Move rxrpc_send_ACK() to output.c to so that it is with
      rxrpc_send_ack_packet() prior to merging the two.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      cc: Marc Dionne <marc.dionne@auristor.com>
      cc: "David S. Miller" <davem@davemloft.net>
      cc: Eric Dumazet <edumazet@google.com>
      cc: Jakub Kicinski <kuba@kernel.org>
      cc: Paolo Abeni <pabeni@redhat.com>
      cc: linux-afs@lists.infradead.org
      cc: netdev@vger.kernel.org
      99afb28c
    • David Howells's avatar
      rxrpc: Remove atomic handling on some fields only used in I/O thread · 693f9c13
      David Howells authored
      call->tx_transmitted and call->acks_prev_seq don't need to be managed with
      cmpxchg() and barriers as it's only used within the singular I/O thread.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      cc: Marc Dionne <marc.dionne@auristor.com>
      cc: "David S. Miller" <davem@davemloft.net>
      cc: Eric Dumazet <edumazet@google.com>
      cc: Jakub Kicinski <kuba@kernel.org>
      cc: Paolo Abeni <pabeni@redhat.com>
      cc: linux-afs@lists.infradead.org
      cc: netdev@vger.kernel.org
      693f9c13
    • David Howells's avatar
      rxrpc: Strip barriers and atomics off of timer tracking · d73f3a74
      David Howells authored
      Strip the atomic ops and barriering off of the call timer tracking as this
      is handled solely within the I/O thread, except for expect_term_by which is
      set by sendmsg().
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      cc: Marc Dionne <marc.dionne@auristor.com>
      cc: "David S. Miller" <davem@davemloft.net>
      cc: Eric Dumazet <edumazet@google.com>
      cc: Jakub Kicinski <kuba@kernel.org>
      cc: Paolo Abeni <pabeni@redhat.com>
      cc: linux-afs@lists.infradead.org
      cc: netdev@vger.kernel.org
      d73f3a74
    • David Howells's avatar
      rxrpc: Convert rxrpc_txbuf::flags into a mask and don't use atomics · 12bdff73
      David Howells authored
      Convert the transmission buffer flags into a mask and use | and & rather
      than bitops functions (atomic ops are not required as only the I/O thread
      can manipulate them once submitted for transmission).
      
      The bottom byte can then correspond directly to the Rx protocol header
      flags.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      cc: Marc Dionne <marc.dionne@auristor.com>
      cc: "David S. Miller" <davem@davemloft.net>
      cc: Eric Dumazet <edumazet@google.com>
      cc: Jakub Kicinski <kuba@kernel.org>
      cc: Paolo Abeni <pabeni@redhat.com>
      cc: linux-afs@lists.infradead.org
      cc: netdev@vger.kernel.org
      12bdff73
    • David Howells's avatar
      rxrpc: Record the Tx serial in the rxrpc_txbuf and retransmit trace · ba132d84
      David Howells authored
      Each Rx protocol packet contains a per-connection monotonically increasing
      serial number used to correlate outgoing messages with their replies -
      something that can be used for RTT calculation.
      
      Note this value in the rxrpc_txbuf struct in addition to the wire header
      and then log it in the rxrpc_retransmit trace for reference.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      cc: Marc Dionne <marc.dionne@auristor.com>
      cc: "David S. Miller" <davem@davemloft.net>
      cc: Eric Dumazet <edumazet@google.com>
      cc: Jakub Kicinski <kuba@kernel.org>
      cc: Paolo Abeni <pabeni@redhat.com>
      cc: linux-afs@lists.infradead.org
      cc: netdev@vger.kernel.org
      ba132d84
  3. 05 Feb, 2024 2 commits
    • David Howells's avatar
      rxrpc: Fix counting of new acks and nacks · 41b7fa15
      David Howells authored
      Fix the counting of new acks and nacks when parsing a packet - something
      that is used in congestion control.
      
      As the code stands, it merely notes if there are any nacks whereas what we
      really should do is compare the previous SACK table to the new one,
      assuming we get two successive ACK packets with nacks in them.  However, we
      really don't want to do that if we can avoid it as the tables might not
      correspond directly as one may be shifted from the other - something that
      will only get harder to deal with once extended ACK tables come into full
      use (with a capacity of up to 8192).
      
      Instead, count the number of nacks shifted out of the old SACK, the number
      of nacks retained in the portion still active and the number of new acks
      and nacks in the new table then calculate what we need.
      
      Note this ends up a bit of an estimate as the Rx protocol allows acks to be
      withdrawn by the receiver and packets requested to be retransmitted.
      
      Fixes: d57a3a15 ("rxrpc: Save last ACK's SACK table rather than marking txbufs")
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      cc: Marc Dionne <marc.dionne@auristor.com>
      cc: "David S. Miller" <davem@davemloft.net>
      cc: Eric Dumazet <edumazet@google.com>
      cc: Jakub Kicinski <kuba@kernel.org>
      cc: Paolo Abeni <pabeni@redhat.com>
      cc: linux-afs@lists.infradead.org
      cc: netdev@vger.kernel.org
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      41b7fa15
    • David Howells's avatar
      rxrpc: Fix delayed ACKs to not set the reference serial number · e7870cf1
      David Howells authored
      Fix the construction of delayed ACKs to not set the reference serial number
      as they can't be used as an RTT reference.
      
      Fixes: 17926a79 ("[AF_RXRPC]: Provide secure RxRPC sockets for use by userspace and kernel both")
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      cc: Marc Dionne <marc.dionne@auristor.com>
      cc: "David S. Miller" <davem@davemloft.net>
      cc: Eric Dumazet <edumazet@google.com>
      cc: Jakub Kicinski <kuba@kernel.org>
      cc: Paolo Abeni <pabeni@redhat.com>
      cc: linux-afs@lists.infradead.org
      cc: netdev@vger.kernel.org
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e7870cf1
  4. 31 Jan, 2023 2 commits
  5. 06 Jan, 2023 5 commits
    • David Howells's avatar
      rxrpc: Remove call->state_lock · 96b4059f
      David Howells authored
      All the setters of call->state are now in the I/O thread and thus the state
      lock is now unnecessary.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      cc: Marc Dionne <marc.dionne@auristor.com>
      cc: linux-afs@lists.infradead.org
      96b4059f
    • David Howells's avatar
      rxrpc: Move call state changes from sendmsg to I/O thread · 2d689424
      David Howells authored
      Move all the call state changes that are made in rxrpc_sendmsg() to the I/O
      thread.  This is a step towards removing the call state lock.
      
      This requires the switch to the RXRPC_CALL_CLIENT_AWAIT_REPLY and
      RXRPC_CALL_SERVER_SEND_REPLY states to be done when the last packet is
      decanted from ->tx_sendmsg to ->tx_buffer in the I/O thread, not when it is
      added to ->tx_sendmsg by sendmsg().
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      cc: Marc Dionne <marc.dionne@auristor.com>
      cc: linux-afs@lists.infradead.org
      2d689424
    • David Howells's avatar
      rxrpc: Tidy up abort generation infrastructure · 57af281e
      David Howells authored
      Tidy up the abort generation infrastructure in the following ways:
      
       (1) Create an enum and string mapping table to list the reasons an abort
           might be generated in tracing.
      
       (2) Replace the 3-char string with the values from (1) in the places that
           use that to log the abort source.  This gets rid of a memcpy() in the
           tracepoint.
      
       (3) Subsume the rxrpc_rx_eproto tracepoint with the rxrpc_abort tracepoint
           and use values from (1) to indicate the trace reason.
      
       (4) Always make a call to an abort function at the point of the abort
           rather than stashing the values into variables and using goto to get
           to a place where it reported.  The C optimiser will collapse the calls
           together as appropriate.  The abort functions return a value that can
           be returned directly if appropriate.
      
      Note that this extends into afs also at the points where that generates an
      abort.  To aid with this, the afs sources need to #define
      RXRPC_TRACE_ONLY_DEFINE_ENUMS before including the rxrpc tracing header
      because they don't have access to the rxrpc internal structures that some
      of the tracepoints make use of.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      cc: Marc Dionne <marc.dionne@auristor.com>
      cc: linux-afs@lists.infradead.org
      57af281e
    • David Howells's avatar
      rxrpc: Only disconnect calls in the I/O thread · 03fc55ad
      David Howells authored
      Only perform call disconnection in the I/O thread to reduce the locking
      requirement.
      
      This is the first part of a fix for a race that exists between call
      connection and call disconnection whereby the data transmission code adds
      the call to the peer error distribution list after the call has been
      disconnected (say by the rxrpc socket getting closed).
      
      The fix is to complete the process of moving call connection, data
      transmission and call disconnection into the I/O thread and thus forcibly
      serialising them.
      
      Note that the issue may predate the overhaul to an I/O thread model that
      were included in the merge window for v6.2, but the timing is very much
      changed by the change given below.
      
      Fixes: cf37b598 ("rxrpc: Move DATA transmission into call processor work item")
      Reported-by: syzbot+c22650d2844392afdcfd@syzkaller.appspotmail.com
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      cc: Marc Dionne <marc.dionne@auristor.com>
      cc: linux-afs@lists.infradead.org
      03fc55ad
    • David Howells's avatar
      rxrpc: Only set/transmit aborts in the I/O thread · a343b174
      David Howells authored
      Only set the abort call completion state in the I/O thread and only
      transmit ABORT packets from there.  rxrpc_abort_call() can then be made to
      actually send the packet.
      
      Further, ABORT packets should only be sent if the call has been exposed to
      the network (ie. at least one attempted DATA transmission has occurred for
      it).
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      cc: Marc Dionne <marc.dionne@auristor.com>
      cc: linux-afs@lists.infradead.org
      a343b174
  6. 01 Dec, 2022 13 commits
    • David Howells's avatar
      rxrpc: Transmit ACKs at the point of generation · b0346843
      David Howells authored
      For ACKs generated inside the I/O thread, transmit the ACK at the point of
      generation.  Where the ACK is generated outside of the I/O thread, it's
      offloaded to the I/O thread to transmit it.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      cc: Marc Dionne <marc.dionne@auristor.com>
      cc: linux-afs@lists.infradead.org
      b0346843
    • David Howells's avatar
      rxrpc: Move the cwnd degradation after transmitting packets · 5086d9a9
      David Howells authored
      When we've gone for >1RTT without transmitting a packet, we should reduce
      the ssthresh and cut the cwnd by half (as suggested in RFC2861 sec 3.1).
      
      However, we may receive ACK packets in a batch and the first of these may
      cut the cwnd, preventing further transmission, and each subsequent one cuts
      the cwnd yet further, reducing it to the floor and killing performance.
      
      Fix this by moving the cwnd reset to after doing the transmission and
      resetting the base time such that we don't cut the cwnd by half again for
      at least another RTT.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      cc: Marc Dionne <marc.dionne@auristor.com>
      cc: linux-afs@lists.infradead.org
      5086d9a9
    • David Howells's avatar
      rxrpc: Trace/count transmission underflows and cwnd resets · 32cf8edb
      David Howells authored
      Add a tracepoint to log when a cwnd reset occurs due to lack of
      transmission on a call.
      
      Add stat counters to count transmission underflows (ie. when we have tx
      window space, but sendmsg doesn't manage to keep up), cwnd resets and
      transmission failures.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      cc: Marc Dionne <marc.dionne@auristor.com>
      cc: linux-afs@lists.infradead.org
      32cf8edb
    • David Howells's avatar
      rxrpc: Remove the _bh annotation from all the spinlocks · 3dd9c8b5
      David Howells authored
      None of the spinlocks in rxrpc need a _bh annotation now as the RCU
      callback routines no longer take spinlocks and the bulk of the packet
      wrangling code is now run in the I/O thread, not softirq context.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      cc: Marc Dionne <marc.dionne@auristor.com>
      cc: linux-afs@lists.infradead.org
      3dd9c8b5
    • David Howells's avatar
      rxrpc: Make the I/O thread take over the call and local processor work · 5e6ef4f1
      David Howells authored
      Move the functions from the call->processor and local->processor work items
      into the domain of the I/O thread.
      
      The call event processor, now called from the I/O thread, then takes over
      the job of cranking the call state machine, processing incoming packets and
      transmitting DATA, ACK and ABORT packets.  In a future patch,
      rxrpc_send_ACK() will transmit the ACK on the spot rather than queuing it
      for later transmission.
      
      The call event processor becomes purely received-skb driven.  It only
      transmits things in response to events.  We use "pokes" to queue a dummy
      skb to make it do things like start/resume transmitting data.  Timer expiry
      also results in pokes.
      
      The connection event processor, becomes similar, though crypto events, such
      as dealing with CHALLENGE and RESPONSE packets is offloaded to a work item
      to avoid doing crypto in the I/O thread.
      
      The local event processor is removed and VERSION response packets are
      generated directly from the packet parser.  Similarly, ABORTs generated in
      response to protocol errors will be transmitted immediately rather than
      being pushed onto a queue for later transmission.
      
      Changes:
      ========
      ver #2)
       - Fix a couple of introduced lock context imbalances.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      cc: Marc Dionne <marc.dionne@auristor.com>
      cc: linux-afs@lists.infradead.org
      5e6ef4f1
    • David Howells's avatar
      rxrpc: Move DATA transmission into call processor work item · cf37b598
      David Howells authored
      Move DATA transmission into the call processor work item.  In a future
      patch, this will be called from the I/O thread rather than being itsown
      work item.
      
      This will allow DATA transmission to be driven directly by incoming ACKs,
      pokes and timers as those are processed.
      
      The Tx queue is also split: The queue of packets prepared by sendmsg is now
      places in call->tx_sendmsg and the packet dispatcher decants the packets
      into call->tx_buffer as space becomes available in the transmission
      window.  This allows sendmsg to run ahead of the available space to try and
      prevent an underflow in transmission.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      cc: Marc Dionne <marc.dionne@auristor.com>
      cc: linux-afs@lists.infradead.org
      cf37b598
    • David Howells's avatar
      rxrpc: Move packet reception processing into I/O thread · 446b3e14
      David Howells authored
      Split the packet input handler to make the softirq side just dump the
      received packet into the local endpoint receive queue and then call the
      remainder of the input function from the I/O thread.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      cc: Marc Dionne <marc.dionne@auristor.com>
      cc: linux-afs@lists.infradead.org
      446b3e14
    • David Howells's avatar
      rxrpc: Don't hold a ref for call timer or workqueue · 3feda9d6
      David Howells authored
      Currently, rxrpc gives the call timer a ref on the call when it starts it
      and this is passed along to the workqueue by the timer expiration function.
      The problem comes when queue_work() fails (ie. the work item is already
      queued): the timer routine must put the ref - but this may cause the
      cleanup code to run.
      
      This has the unfortunate effect that the cleanup code may then be run in
      softirq context - which means that any spinlocks it might need to touch
      have to be guarded to disable softirqs (ie. they need a "_bh" suffix).
      
      Fix this by:
      
       (1) Don't give a ref to the timer.
      
       (2) Making the expiration function not do anything if the refcount is 0.
           Note that this is more of an optimisation.
      
       (3) Make sure that the cleanup routine waits for timer to complete.
      
      However, this has a consequence that timer cannot give a ref to the work
      item.  Therefore the following fixes are also necessary:
      
       (4) Don't give a ref to the work item.
      
       (5) Make the work item return asap if it sees the ref count is 0.
      
       (6) Make sure that the cleanup routine waits for the work item to
           complete.
      
      Unfortunately, neither the timer nor the work item can simply get around
      the problem by just using refcount_inc_not_zero() as the waits would still
      have to be done, and there would still be the possibility of having to put
      the ref in the expiration function.
      
      Note the call work item is going to go away with the work being transferred
      to the I/O thread, so the wait in (6) will become obsolete.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      cc: Marc Dionne <marc.dionne@auristor.com>
      cc: linux-afs@lists.infradead.org
      3feda9d6
    • David Howells's avatar
      rxrpc: trace: Don't use __builtin_return_address for sk_buff tracing · 9a36a6bc
      David Howells authored
      In rxrpc tracing, use enums to generate lists of points of interest rather
      than __builtin_return_address() for the sk_buff tracepoint.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      cc: Marc Dionne <marc.dionne@auristor.com>
      cc: linux-afs@lists.infradead.org
      9a36a6bc
    • David Howells's avatar
      rxrpc: trace: Don't use __builtin_return_address for rxrpc_call tracing · cb0fc0c9
      David Howells authored
      In rxrpc tracing, use enums to generate lists of points of interest rather
      than __builtin_return_address() for the rxrpc_call tracepoint
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      cc: Marc Dionne <marc.dionne@auristor.com>
      cc: linux-afs@lists.infradead.org
      cb0fc0c9
    • David Howells's avatar
      rxrpc: trace: Don't use __builtin_return_address for rxrpc_local tracing · 0fde882f
      David Howells authored
      In rxrpc tracing, use enums to generate lists of points of interest rather
      than __builtin_return_address() for the rxrpc_local tracepoint
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      cc: Marc Dionne <marc.dionne@auristor.com>
      cc: linux-afs@lists.infradead.org
      0fde882f
    • David Howells's avatar
      rxrpc: Drop rxrpc_conn_parameters from rxrpc_connection and rxrpc_bundle · 2cc80086
      David Howells authored
      Remove the rxrpc_conn_parameters struct from the rxrpc_connection and
      rxrpc_bundle structs and emplace the members directly.  These are going to
      get filled in from the rxrpc_call struct in future.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      cc: Marc Dionne <marc.dionne@auristor.com>
      cc: linux-afs@lists.infradead.org
      2cc80086
    • David Howells's avatar
      rxrpc: Fix call leak · 49df54a6
      David Howells authored
      When retransmitting a packet, rxrpc_resend() shouldn't be attaching a ref
      to the call to the txbuf as that pins the call and prevents the call from
      clearing the packet buffer.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Fixes: d57a3a15 ("rxrpc: Save last ACK's SACK table rather than marking txbufs")
      cc: Marc Dionne <marc.dionne@auristor.com>
      cc: linux-afs@lists.infradead.org
      49df54a6
  7. 08 Nov, 2022 7 commits
    • David Howells's avatar
      rxrpc: Save last ACK's SACK table rather than marking txbufs · d57a3a15
      David Howells authored
      Improve the tracking of which packets need to be transmitted by saving the
      last ACK packet that we receive that has a populated soft-ACK table rather
      than marking packets.  Then we can step through the soft-ACK table and look
      at the packets we've transmitted beyond that to determine which packets we
      might want to retransmit.
      
      We also look at the highest serial number that has been acked to try and
      guess which packets we've transmitted the peer is likely to have seen.  If
      necessary, we send a ping to retrieve that number.
      
      One downside that might be a problem is that we can't then compare the
      previous acked/unacked state so easily in rxrpc_input_soft_acks() - which
      is a potential problem for the slow-start algorithm.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      cc: Marc Dionne <marc.dionne@auristor.com>
      cc: linux-afs@lists.infradead.org
      d57a3a15
    • David Howells's avatar
      rxrpc: Remove call->lock · 4e76bd40
      David Howells authored
      call->lock is no longer necessary, so remove it.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      cc: Marc Dionne <marc.dionne@auristor.com>
      cc: linux-afs@lists.infradead.org
      4e76bd40
    • David Howells's avatar
      rxrpc: Don't use a ring buffer for call Tx queue · a4ea4c47
      David Howells authored
      Change the way the Tx queueing works to make the following ends easier to
      achieve:
      
       (1) The filling of packets, the encryption of packets and the transmission
           of packets can be handled in parallel by separate threads, rather than
           rxrpc_sendmsg() allocating, filling, encrypting and transmitting each
           packet before moving onto the next one.
      
       (2) Get rid of the fixed-size ring which sets a hard limit on the number
           of packets that can be retained in the ring.  This allows the number
           of packets to increase without having to allocate a very large ring or
           having variable-sized rings.
      
           [Note: the downside of this is that it's then less efficient to locate
           a packet for retransmission as we then have to step through a list and
           examine each buffer in the list.]
      
       (3) Allow the filler/encrypter to run ahead of the transmission window.
      
       (4) Make it easier to do zero copy UDP from the packet buffers.
      
       (5) Make it easier to do zero copy from userspace to the packet buffers -
           and thence to UDP (only if for unauthenticated connections).
      
      To that end, the following changes are made:
      
       (1) Use the new rxrpc_txbuf struct instead of sk_buff for keeping packets
           to be transmitted in.  This allows them to be placed on multiple
           queues simultaneously.  An sk_buff isn't really necessary as it's
           never passed on to lower-level networking code.
      
       (2) Keep the transmissable packets in a linked list on the call struct
           rather than in a ring.  As a consequence, the annotation buffer isn't
           used either; rather a flag is set on the packet to indicate ackedness.
      
       (3) Use the RXRPC_CALL_TX_LAST flag to indicate that the last packet to be
           transmitted has been queued.  Add RXRPC_CALL_TX_ALL_ACKED to indicate
           that all packets up to and including the last got hard acked.
      
       (4) Wire headers are now stored in the txbuf rather than being concocted
           on the stack and they're stored immediately before the data, thereby
           allowing zerocopy of a single span.
      
       (5) Don't bother with instant-resend on transmission failure; rather,
           leave it for a timer or an ACK packet to trigger.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      cc: Marc Dionne <marc.dionne@auristor.com>
      cc: linux-afs@lists.infradead.org
      a4ea4c47
    • David Howells's avatar
      rxrpc: Clean up ACK handling · 530403d9
      David Howells authored
      Clean up the rxrpc_propose_ACK() function.  If deferred PING ACK proposal
      is split out, it's only really needed for deferred DELAY ACKs.  All other
      ACKs, bar terminal IDLE ACK are sent immediately.  The deferred IDLE ACK
      submission can be handled by conversion of a DELAY ACK into an IDLE ACK if
      there's nothing to be SACK'd.
      
      Also, because there's a delay between an ACK being generated and being
      transmitted, it's possible that other ACKs of the same type will be
      generated during that interval.  Apart from the ACK time and the serial
      number responded to, most of the ACK body, including window and SACK
      parameters, are not filled out till the point of transmission - so we can
      avoid generating a new ACK if there's one pending that will cover the SACK
      data we need to convey.
      
      Therefore, don't propose a new DELAY or IDLE ACK for a call if there's one
      already pending.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      cc: Marc Dionne <marc.dionne@auristor.com>
      cc: linux-afs@lists.infradead.org
      530403d9
    • David Howells's avatar
      rxrpc: Allocate ACK records at proposal and queue for transmission · 72f0c6fb
      David Howells authored
      Allocate rxrpc_txbuf records for ACKs and put onto a queue for the
      transmitter thread to dispatch.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      cc: Marc Dionne <marc.dionne@auristor.com>
      cc: linux-afs@lists.infradead.org
      72f0c6fb
    • David Howells's avatar
      rxrpc: Record statistics about ACK types · f2a676d1
      David Howells authored
      Record statistics about the different types of ACKs that have been
      transmitted and received and the number of ACKs that have been filled out
      and transmitted or that have been skipped.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      cc: Marc Dionne <marc.dionne@auristor.com>
      cc: linux-afs@lists.infradead.org
      f2a676d1
    • David Howells's avatar
      rxrpc: Add stats procfile and DATA packet stats · b0154246
      David Howells authored
      Add a procfile, /proc/net/rxrpc/stats, to display some statistics about
      what rxrpc has been doing.  Writing a blank line to the stats file will
      clear the increment-only counters.  Allocated resource counters don't get
      cleared.
      
      Add some counters to count various things about DATA packets, including the
      number created, transmitted and retransmitted and the number received, the
      number of ACK-requests markings and the number of jumbo packets received.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      cc: Marc Dionne <marc.dionne@auristor.com>
      cc: linux-afs@lists.infradead.org
      b0154246
  8. 01 Sep, 2022 1 commit
  9. 22 May, 2022 2 commits
    • David Howells's avatar
      rxrpc: Don't try to resend the request if we're receiving the reply · 114af61f
      David Howells authored
      rxrpc has a timer to trigger resending of unacked data packets in a call.
      This is not cancelled when a client call switches to the receive phase on
      the basis that most calls don't last long enough for it to ever expire.
      However, if it *does* expire after we've started to receive the reply, we
      shouldn't then go into trying to retransmit or pinging the server to find
      out if an ack got lost.
      
      Fix this by skipping the resend code if we're into receiving the reply to a
      client call.
      
      Fixes: 17926a79 ("[AF_RXRPC]: Provide secure RxRPC sockets for use by userspace and kernel both")
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      cc: linux-afs@lists.infradead.org
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      114af61f
    • David Howells's avatar
      rxrpc, afs: Fix selection of abort codes · de696c47
      David Howells authored
      The RX_USER_ABORT code should really only be used to indicate that the user
      of the rxrpc service (ie. userspace) implicitly caused a call to be aborted
      - for instance if the AF_RXRPC socket is closed whilst the call was in
      progress.  (The user may also explicitly abort a call and specify the abort
      code to use).
      
      Change some of the points of generation to use other abort codes instead:
      
       (1) Abort the call with RXGEN_SS_UNMARSHAL or RXGEN_CC_UNMARSHAL if we see
           ENOMEM and EFAULT during received data delivery and abort with
           RX_CALL_DEAD in the default case.
      
       (2) Abort with RXGEN_SS_MARSHAL if we get ENOMEM whilst trying to send a
           reply.
      
       (3) Abort with RX_CALL_DEAD if we stop hearing from the peer if we had
           heard from the peer and abort with RX_CALL_TIMEOUT if we hadn't.
      
       (4) Abort with RX_CALL_DEAD if we try to disconnect a call that's not
           completed successfully or been aborted.
      Reported-by: default avatarJeffrey Altman <jaltman@auristor.com>
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      cc: Marc Dionne <marc.dionne@auristor.com>
      cc: linux-afs@lists.infradead.org
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      de696c47
  10. 31 Mar, 2022 1 commit