Merge tag 'drm-for-v4.15-amd-dc' of git://people.freedesktop.org/~airlied/linux
[linux-2.6-microblaze.git] / net / rxrpc / output.c
index 71e6f71..f47659c 100644 (file)
@@ -35,7 +35,8 @@ struct rxrpc_abort_buffer {
 /*
  * Fill out an ACK packet.
  */
-static size_t rxrpc_fill_out_ack(struct rxrpc_call *call,
+static size_t rxrpc_fill_out_ack(struct rxrpc_connection *conn,
+                                struct rxrpc_call *call,
                                 struct rxrpc_ack_buffer *pkt,
                                 rxrpc_seq_t *_hard_ack,
                                 rxrpc_seq_t *_top,
@@ -77,8 +78,8 @@ static size_t rxrpc_fill_out_ack(struct rxrpc_call *call,
                } while (before_eq(seq, top));
        }
 
-       mtu = call->conn->params.peer->if_mtu;
-       mtu -= call->conn->params.peer->hdrsize;
+       mtu = conn->params.peer->if_mtu;
+       mtu -= conn->params.peer->hdrsize;
        jmax = (call->nr_jumbo_bad > 3) ? 1 : rxrpc_rx_jumbo_max;
        pkt->ackinfo.rxMTU      = htonl(rxrpc_rx_mtu);
        pkt->ackinfo.maxMTU     = htonl(mtu);
@@ -148,7 +149,7 @@ int rxrpc_send_ack_packet(struct rxrpc_call *call, bool ping)
                }
                call->ackr_reason = 0;
        }
-       n = rxrpc_fill_out_ack(call, pkt, &hard_ack, &top, reason);
+       n = rxrpc_fill_out_ack(conn, call, pkt, &hard_ack, &top, reason);
 
        spin_unlock_bh(&call->lock);
 
@@ -221,6 +222,16 @@ int rxrpc_send_abort_packet(struct rxrpc_call *call)
        rxrpc_serial_t serial;
        int ret;
 
+       /* Don't bother sending aborts for a client call once the server has
+        * hard-ACK'd all of its request data.  After that point, we're not
+        * going to stop the operation proceeding, and whilst we might limit
+        * the reply, it's not worth it if we can send a new call on the same
+        * channel instead, thereby closing off this call.
+        */
+       if (rxrpc_is_client_call(call) &&
+           test_bit(RXRPC_CALL_TX_LAST, &call->flags))
+               return 0;
+
        spin_lock_bh(&call->lock);
        if (call->conn)
                conn = rxrpc_get_connection_maybe(call->conn);