From nobody Thu Sep 18 23:36:26 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AE64AC3A5A7 for ; Fri, 2 Dec 2022 00:17:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232105AbiLBARt (ORCPT ); Thu, 1 Dec 2022 19:17:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231201AbiLBARN (ORCPT ); Thu, 1 Dec 2022 19:17:13 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0BB4CEF9D for ; Thu, 1 Dec 2022 16:16:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1669940175; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qX2NtzDdDBIpK3pq8QzAj8mCbabpuW0klY+GnllIel4=; b=dqSNCtazknHg87xOkI8pOjvJPjXXMn+OJNy8HrZT5rtXqCg3QbeUodXYokob7RmGuHUDJZ ILCWm8tBbWEOxd4iPIneLDwUzR35166C5KTNn2HynX++gO1LqX4rVuoRnby08L4qsrxKWO 0/zDqvJ/8H7O1AHw5jMP9q5JNk7RgFk= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-674-Qvu3_hcQOb6-QkDiZZbssg-1; Thu, 01 Dec 2022 19:16:13 -0500 X-MC-Unique: Qvu3_hcQOb6-QkDiZZbssg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 025D42999B2C; Fri, 2 Dec 2022 00:16:13 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.33.36.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id 11BEA2166BB1; Fri, 2 Dec 2022 00:16:11 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 Subject: [PATCH net-next 08/36] rxrpc: Drop rxrpc_conn_parameters from rxrpc_connection and rxrpc_bundle From: David Howells To: netdev@vger.kernel.org Cc: Marc Dionne , linux-afs@lists.infradead.org, dhowells@redhat.com, linux-afs@lists.infradead.org, linux-kernel@vger.kernel.org Date: Fri, 02 Dec 2022 00:16:09 +0000 Message-ID: <166994016928.1732290.18363723077617934388.stgit@warthog.procyon.org.uk> In-Reply-To: <166994010342.1732290.13771061038178613124.stgit@warthog.procyon.org.uk> References: <166994010342.1732290.13771061038178613124.stgit@warthog.procyon.org.uk> User-Agent: StGit/1.5 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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: David Howells cc: Marc Dionne cc: linux-afs@lists.infradead.org --- net/rxrpc/ar-internal.h | 16 ++++++++++++-- net/rxrpc/call_accept.c | 6 +++-- net/rxrpc/call_event.c | 2 +- net/rxrpc/call_object.c | 6 +++-- net/rxrpc/conn_client.c | 53 +++++++++++++++++++++++++++---------------= --- net/rxrpc/conn_event.c | 26 +++++++++++----------- net/rxrpc/conn_object.c | 22 +++++++++---------- net/rxrpc/conn_service.c | 6 +++-- net/rxrpc/input.c | 4 ++- net/rxrpc/key.c | 2 +- net/rxrpc/output.c | 32 ++++++++++++++------------- net/rxrpc/proc.c | 6 +++-- net/rxrpc/rxkad.c | 54 +++++++++++++++++++++++-------------------= ---- net/rxrpc/security.c | 4 ++- 14 files changed, 131 insertions(+), 108 deletions(-) diff --git a/net/rxrpc/ar-internal.h b/net/rxrpc/ar-internal.h index 36ece1efb1d4..7c48b0163032 100644 --- a/net/rxrpc/ar-internal.h +++ b/net/rxrpc/ar-internal.h @@ -403,12 +403,18 @@ enum rxrpc_conn_proto_state { * RxRPC client connection bundle. */ struct rxrpc_bundle { - struct rxrpc_conn_parameters params; + struct rxrpc_local *local; /* Representation of local endpoint */ + struct rxrpc_peer *peer; /* Remote endpoint */ + struct key *key; /* Security details */ refcount_t ref; atomic_t active; /* Number of active users */ unsigned int debug_id; + u32 security_level; /* Security level selected */ + u16 service_id; /* Service ID for this connection */ bool try_upgrade; /* True if the bundle is attempting upgrade */ bool alloc_conn; /* True if someone's getting a conn */ + bool exclusive; /* T if conn is exclusive */ + bool upgrade; /* T if service ID can be upgraded */ short alloc_error; /* Error from last conn allocation */ spinlock_t channel_lock; struct rb_node local_node; /* Node in local->client_conns */ @@ -424,7 +430,9 @@ struct rxrpc_bundle { */ struct rxrpc_connection { struct rxrpc_conn_proto proto; - struct rxrpc_conn_parameters params; + struct rxrpc_local *local; /* Representation of local endpoint */ + struct rxrpc_peer *peer; /* Remote endpoint */ + struct key *key; /* Security details */ =20 refcount_t ref; struct rcu_head rcu; @@ -471,9 +479,13 @@ struct rxrpc_connection { atomic_t serial; /* packet serial number counter */ unsigned int hi_serial; /* highest serial number received */ u32 service_id; /* Service ID, possibly upgraded */ + u32 security_level; /* Security level selected */ u8 security_ix; /* security type */ u8 out_clientflag; /* RXRPC_CLIENT_INITIATED if we are client */ u8 bundle_shift; /* Index into bundle->avail_chans */ + bool exclusive; /* T if conn is exclusive */ + bool upgrade; /* T if service ID can be upgraded */ + u16 orig_service_id; /* Originally requested service ID */ short error; /* Local error code */ }; =20 diff --git a/net/rxrpc/call_accept.c b/net/rxrpc/call_accept.c index 48790ee77019..4888959e4727 100644 --- a/net/rxrpc/call_accept.c +++ b/net/rxrpc/call_accept.c @@ -305,8 +305,8 @@ static struct rxrpc_call *rxrpc_alloc_incoming_call(str= uct rxrpc_sock *rx, b->conn_backlog[conn_tail] =3D NULL; smp_store_release(&b->conn_backlog_tail, (conn_tail + 1) & (RXRPC_BACKLOG_MAX - 1)); - conn->params.local =3D rxrpc_get_local(local); - conn->params.peer =3D peer; + conn->local =3D rxrpc_get_local(local); + conn->peer =3D peer; rxrpc_see_connection(conn); rxrpc_new_incoming_connection(rx, conn, sec, skb); } else { @@ -323,7 +323,7 @@ static struct rxrpc_call *rxrpc_alloc_incoming_call(str= uct rxrpc_sock *rx, call->conn =3D conn; call->security =3D conn->security; call->security_ix =3D conn->security_ix; - call->peer =3D rxrpc_get_peer(conn->params.peer); + call->peer =3D rxrpc_get_peer(conn->peer); call->cong_ssthresh =3D call->peer->cong_ssthresh; call->tx_last_sent =3D ktime_get_real(); return call; diff --git a/net/rxrpc/call_event.c b/net/rxrpc/call_event.c index 349f3df569ba..b17ed37434bd 100644 --- a/net/rxrpc/call_event.c +++ b/net/rxrpc/call_event.c @@ -69,7 +69,7 @@ void rxrpc_propose_delay_ACK(struct rxrpc_call *call, rxr= pc_serial_t serial, void rxrpc_send_ACK(struct rxrpc_call *call, u8 ack_reason, rxrpc_serial_t serial, enum rxrpc_propose_ack_trace why) { - struct rxrpc_local *local =3D call->conn->params.local; + struct rxrpc_local *local =3D call->conn->local; struct rxrpc_txbuf *txb; =20 if (test_bit(RXRPC_CALL_DISCONNECTED, &call->flags)) diff --git a/net/rxrpc/call_object.c b/net/rxrpc/call_object.c index e36a317b2e9a..59928f0a8fe1 100644 --- a/net/rxrpc/call_object.c +++ b/net/rxrpc/call_object.c @@ -417,9 +417,9 @@ void rxrpc_incoming_call(struct rxrpc_sock *rx, conn->channels[chan].call_id =3D call->call_id; rcu_assign_pointer(conn->channels[chan].call, call); =20 - spin_lock(&conn->params.peer->lock); - hlist_add_head_rcu(&call->error_link, &conn->params.peer->error_targets); - spin_unlock(&conn->params.peer->lock); + spin_lock(&conn->peer->lock); + hlist_add_head_rcu(&call->error_link, &conn->peer->error_targets); + spin_unlock(&conn->peer->lock); =20 rxrpc_start_call_timer(call); _leave(""); diff --git a/net/rxrpc/conn_client.c b/net/rxrpc/conn_client.c index 2b76fbffd4dd..71404b33623f 100644 --- a/net/rxrpc/conn_client.c +++ b/net/rxrpc/conn_client.c @@ -51,7 +51,7 @@ static void rxrpc_deactivate_bundle(struct rxrpc_bundle *= bundle); static int rxrpc_get_client_connection_id(struct rxrpc_connection *conn, gfp_t gfp) { - struct rxrpc_net *rxnet =3D conn->params.local->rxnet; + struct rxrpc_net *rxnet =3D conn->local->rxnet; int id; =20 _enter(""); @@ -122,8 +122,13 @@ static struct rxrpc_bundle *rxrpc_alloc_bundle(struct = rxrpc_conn_parameters *cp, =20 bundle =3D kzalloc(sizeof(*bundle), gfp); if (bundle) { - bundle->params =3D *cp; - rxrpc_get_peer(bundle->params.peer); + bundle->local =3D cp->local; + bundle->peer =3D rxrpc_get_peer(cp->peer); + bundle->key =3D cp->key; + bundle->exclusive =3D cp->exclusive; + bundle->upgrade =3D cp->upgrade; + bundle->service_id =3D cp->service_id; + bundle->security_level =3D cp->security_level; refcount_set(&bundle->ref, 1); atomic_set(&bundle->active, 1); spin_lock_init(&bundle->channel_lock); @@ -140,7 +145,7 @@ struct rxrpc_bundle *rxrpc_get_bundle(struct rxrpc_bund= le *bundle) =20 static void rxrpc_free_bundle(struct rxrpc_bundle *bundle) { - rxrpc_put_peer(bundle->params.peer); + rxrpc_put_peer(bundle->peer); kfree(bundle); } =20 @@ -164,7 +169,7 @@ static struct rxrpc_connection * rxrpc_alloc_client_connection(struct rxrpc_bundle *bundle, gfp_t gfp) { struct rxrpc_connection *conn; - struct rxrpc_net *rxnet =3D bundle->params.local->rxnet; + struct rxrpc_net *rxnet =3D bundle->local->rxnet; int ret; =20 _enter(""); @@ -177,10 +182,16 @@ rxrpc_alloc_client_connection(struct rxrpc_bundle *bu= ndle, gfp_t gfp) =20 refcount_set(&conn->ref, 1); conn->bundle =3D bundle; - conn->params =3D bundle->params; + conn->local =3D bundle->local; + conn->peer =3D bundle->peer; + conn->key =3D bundle->key; + conn->exclusive =3D bundle->exclusive; + conn->upgrade =3D bundle->upgrade; + conn->orig_service_id =3D bundle->service_id; + conn->security_level =3D bundle->security_level; conn->out_clientflag =3D RXRPC_CLIENT_INITIATED; conn->state =3D RXRPC_CONN_CLIENT; - conn->service_id =3D conn->params.service_id; + conn->service_id =3D conn->orig_service_id; =20 ret =3D rxrpc_get_client_connection_id(conn, gfp); if (ret < 0) @@ -196,9 +207,9 @@ rxrpc_alloc_client_connection(struct rxrpc_bundle *bund= le, gfp_t gfp) write_unlock(&rxnet->conn_lock); =20 rxrpc_get_bundle(bundle); - rxrpc_get_peer(conn->params.peer); - rxrpc_get_local(conn->params.local); - key_get(conn->params.key); + rxrpc_get_peer(conn->peer); + rxrpc_get_local(conn->local); + key_get(conn->key); =20 trace_rxrpc_conn(conn->debug_id, rxrpc_conn_new_client, refcount_read(&conn->ref), @@ -228,7 +239,7 @@ static bool rxrpc_may_reuse_conn(struct rxrpc_connectio= n *conn) if (!conn) goto dont_reuse; =20 - rxnet =3D conn->params.local->rxnet; + rxnet =3D conn->local->rxnet; if (test_bit(RXRPC_CONN_DONT_REUSE, &conn->flags)) goto dont_reuse; =20 @@ -285,7 +296,7 @@ static struct rxrpc_bundle *rxrpc_look_up_bundle(struct= rxrpc_conn_parameters *c while (p) { bundle =3D rb_entry(p, struct rxrpc_bundle, local_node); =20 -#define cmp(X) ((long)bundle->params.X - (long)cp->X) +#define cmp(X) ((long)bundle->X - (long)cp->X) diff =3D (cmp(peer) ?: cmp(key) ?: cmp(security_level) ?: @@ -314,7 +325,7 @@ static struct rxrpc_bundle *rxrpc_look_up_bundle(struct= rxrpc_conn_parameters *c parent =3D *pp; bundle =3D rb_entry(parent, struct rxrpc_bundle, local_node); =20 -#define cmp(X) ((long)bundle->params.X - (long)cp->X) +#define cmp(X) ((long)bundle->X - (long)cp->X) diff =3D (cmp(peer) ?: cmp(key) ?: cmp(security_level) ?: @@ -532,7 +543,7 @@ static void rxrpc_activate_one_channel(struct rxrpc_con= nection *conn, =20 rxrpc_see_call(call); list_del_init(&call->chan_wait_link); - call->peer =3D rxrpc_get_peer(conn->params.peer); + call->peer =3D rxrpc_get_peer(conn->peer); call->conn =3D rxrpc_get_connection(conn); call->cid =3D conn->proto.cid | channel; call->call_id =3D call_id; @@ -569,7 +580,7 @@ static void rxrpc_activate_one_channel(struct rxrpc_con= nection *conn, */ static void rxrpc_unidle_conn(struct rxrpc_bundle *bundle, struct rxrpc_co= nnection *conn) { - struct rxrpc_net *rxnet =3D bundle->params.local->rxnet; + struct rxrpc_net *rxnet =3D bundle->local->rxnet; bool drop_ref; =20 if (!list_empty(&conn->cache_link)) { @@ -795,7 +806,7 @@ void rxrpc_disconnect_client_call(struct rxrpc_bundle *= bundle, struct rxrpc_call { struct rxrpc_connection *conn; struct rxrpc_channel *chan =3D NULL; - struct rxrpc_net *rxnet =3D bundle->params.local->rxnet; + struct rxrpc_net *rxnet =3D bundle->local->rxnet; unsigned int channel; bool may_reuse; u32 cid; @@ -936,11 +947,11 @@ static void rxrpc_unbundle_conn(struct rxrpc_connecti= on *conn) */ static void rxrpc_deactivate_bundle(struct rxrpc_bundle *bundle) { - struct rxrpc_local *local =3D bundle->params.local; + struct rxrpc_local *local =3D bundle->local; bool need_put =3D false; =20 if (atomic_dec_and_lock(&bundle->active, &local->client_bundles_lock)) { - if (!bundle->params.exclusive) { + if (!bundle->exclusive) { _debug("erase bundle"); rb_erase(&bundle->local_node, &local->client_bundles); need_put =3D true; @@ -957,7 +968,7 @@ static void rxrpc_deactivate_bundle(struct rxrpc_bundle= *bundle) */ static void rxrpc_kill_client_conn(struct rxrpc_connection *conn) { - struct rxrpc_local *local =3D conn->params.local; + struct rxrpc_local *local =3D conn->local; struct rxrpc_net *rxnet =3D local->rxnet; =20 _enter("C=3D%x", conn->debug_id); @@ -1036,7 +1047,7 @@ void rxrpc_discard_expired_client_conns(struct work_s= truct *work) expiry =3D rxrpc_conn_idle_client_expiry; if (nr_conns > rxrpc_reap_client_connections) expiry =3D rxrpc_conn_idle_client_fast_expiry; - if (conn->params.local->service_closed) + if (conn->local->service_closed) expiry =3D rxrpc_closed_conn_expiry * HZ; =20 conn_expires_at =3D conn->idle_timestamp + expiry; @@ -1110,7 +1121,7 @@ void rxrpc_clean_up_local_conns(struct rxrpc_local *l= ocal) =20 list_for_each_entry_safe(conn, tmp, &rxnet->idle_client_conns, cache_link) { - if (conn->params.local =3D=3D local) { + if (conn->local =3D=3D local) { trace_rxrpc_client(conn, -1, rxrpc_client_discard); list_move(&conn->cache_link, &graveyard); } diff --git a/net/rxrpc/conn_event.c b/net/rxrpc/conn_event.c index d5549cbfc71b..71ed6b9dc63a 100644 --- a/net/rxrpc/conn_event.c +++ b/net/rxrpc/conn_event.c @@ -52,8 +52,8 @@ static void rxrpc_conn_retransmit_call(struct rxrpc_conne= ction *conn, if (skb && call_id !=3D sp->hdr.callNumber) return; =20 - msg.msg_name =3D &conn->params.peer->srx.transport; - msg.msg_namelen =3D conn->params.peer->srx.transport_len; + msg.msg_name =3D &conn->peer->srx.transport; + msg.msg_namelen =3D conn->peer->srx.transport_len; msg.msg_control =3D NULL; msg.msg_controllen =3D 0; msg.msg_flags =3D 0; @@ -86,8 +86,8 @@ static void rxrpc_conn_retransmit_call(struct rxrpc_conne= ction *conn, break; =20 case RXRPC_PACKET_TYPE_ACK: - mtu =3D conn->params.peer->if_mtu; - mtu -=3D conn->params.peer->hdrsize; + mtu =3D conn->peer->if_mtu; + mtu -=3D conn->peer->hdrsize; pkt.ack.bufferSpace =3D 0; pkt.ack.maxSkew =3D htons(skb ? skb->priority : 0); pkt.ack.firstPacket =3D htonl(chan->last_seq + 1); @@ -131,8 +131,8 @@ static void rxrpc_conn_retransmit_call(struct rxrpc_con= nection *conn, break; } =20 - ret =3D kernel_sendmsg(conn->params.local->socket, &msg, iov, ioc, len); - conn->params.peer->last_tx_at =3D ktime_get_seconds(); + ret =3D kernel_sendmsg(conn->local->socket, &msg, iov, ioc, len); + conn->peer->last_tx_at =3D ktime_get_seconds(); if (ret < 0) trace_rxrpc_tx_fail(chan->call_debug_id, serial, ret, rxrpc_tx_point_call_final_resend); @@ -211,8 +211,8 @@ static int rxrpc_abort_connection(struct rxrpc_connecti= on *conn, set_bit(RXRPC_CONN_DONT_REUSE, &conn->flags); spin_unlock_bh(&conn->state_lock); =20 - msg.msg_name =3D &conn->params.peer->srx.transport; - msg.msg_namelen =3D conn->params.peer->srx.transport_len; + msg.msg_name =3D &conn->peer->srx.transport; + msg.msg_namelen =3D conn->peer->srx.transport_len; msg.msg_control =3D NULL; msg.msg_controllen =3D 0; msg.msg_flags =3D 0; @@ -241,7 +241,7 @@ static int rxrpc_abort_connection(struct rxrpc_connecti= on *conn, rxrpc_abort_calls(conn, RXRPC_CALL_LOCALLY_ABORTED, serial); whdr.serial =3D htonl(serial); =20 - ret =3D kernel_sendmsg(conn->params.local->socket, &msg, iov, 2, len); + ret =3D kernel_sendmsg(conn->local->socket, &msg, iov, 2, len); if (ret < 0) { trace_rxrpc_tx_fail(conn->debug_id, serial, ret, rxrpc_tx_point_conn_abort); @@ -251,7 +251,7 @@ static int rxrpc_abort_connection(struct rxrpc_connecti= on *conn, =20 trace_rxrpc_tx_packet(conn->debug_id, &whdr, rxrpc_tx_point_conn_abort); =20 - conn->params.peer->last_tx_at =3D ktime_get_seconds(); + conn->peer->last_tx_at =3D ktime_get_seconds(); =20 _leave(" =3D 0"); return 0; @@ -330,7 +330,7 @@ static int rxrpc_process_event(struct rxrpc_connection = *conn, return ret; =20 ret =3D conn->security->init_connection_security( - conn, conn->params.key->payload.data[0]); + conn, conn->key->payload.data[0]); if (ret < 0) return ret; =20 @@ -484,9 +484,9 @@ void rxrpc_process_connection(struct work_struct *work) =20 rxrpc_see_connection(conn); =20 - if (__rxrpc_use_local(conn->params.local)) { + if (__rxrpc_use_local(conn->local)) { rxrpc_do_process_connection(conn); - rxrpc_unuse_local(conn->params.local); + rxrpc_unuse_local(conn->local); } =20 rxrpc_put_connection(conn); diff --git a/net/rxrpc/conn_object.c b/net/rxrpc/conn_object.c index d5d15389406f..ad6e5ee1f069 100644 --- a/net/rxrpc/conn_object.c +++ b/net/rxrpc/conn_object.c @@ -120,10 +120,10 @@ struct rxrpc_connection *rxrpc_find_connection_rcu(st= ruct rxrpc_local *local, } =20 if (conn->proto.epoch !=3D k.epoch || - conn->params.local !=3D local) + conn->local !=3D local) goto not_found; =20 - peer =3D conn->params.peer; + peer =3D conn->peer; switch (srx.transport.family) { case AF_INET: if (peer->srx.transport.sin.sin_port !=3D @@ -231,7 +231,7 @@ void rxrpc_disconnect_call(struct rxrpc_call *call) */ void rxrpc_kill_connection(struct rxrpc_connection *conn) { - struct rxrpc_net *rxnet =3D conn->params.local->rxnet; + struct rxrpc_net *rxnet =3D conn->local->rxnet; =20 ASSERT(!rcu_access_pointer(conn->channels[0].call) && !rcu_access_pointer(conn->channels[1].call) && @@ -340,7 +340,7 @@ void rxrpc_put_service_conn(struct rxrpc_connection *co= nn) __refcount_dec(&conn->ref, &r); trace_rxrpc_conn(debug_id, rxrpc_conn_put_service, r - 1, here); if (r - 1 =3D=3D 1) - rxrpc_set_service_reap_timer(conn->params.local->rxnet, + rxrpc_set_service_reap_timer(conn->local->rxnet, jiffies + rxrpc_connection_expiry); } =20 @@ -360,13 +360,13 @@ static void rxrpc_destroy_connection(struct rcu_head = *rcu) rxrpc_purge_queue(&conn->rx_queue); =20 conn->security->clear(conn); - key_put(conn->params.key); + key_put(conn->key); rxrpc_put_bundle(conn->bundle); - rxrpc_put_peer(conn->params.peer); + rxrpc_put_peer(conn->peer); =20 - if (atomic_dec_and_test(&conn->params.local->rxnet->nr_conns)) - wake_up_var(&conn->params.local->rxnet->nr_conns); - rxrpc_put_local(conn->params.local); + if (atomic_dec_and_test(&conn->local->rxnet->nr_conns)) + wake_up_var(&conn->local->rxnet->nr_conns); + rxrpc_put_local(conn->local); =20 kfree(conn); _leave(""); @@ -397,10 +397,10 @@ void rxrpc_service_connection_reaper(struct work_stru= ct *work) if (conn->state =3D=3D RXRPC_CONN_SERVICE_PREALLOC) continue; =20 - if (rxnet->live && !conn->params.local->dead) { + if (rxnet->live && !conn->local->dead) { idle_timestamp =3D READ_ONCE(conn->idle_timestamp); expire_at =3D idle_timestamp + rxrpc_connection_expiry * HZ; - if (conn->params.local->service_closed) + if (conn->local->service_closed) expire_at =3D idle_timestamp + rxrpc_closed_conn_expiry * HZ; =20 _debug("reap CONN %d { u=3D%d,t=3D%ld }", diff --git a/net/rxrpc/conn_service.c b/net/rxrpc/conn_service.c index 75f903099eb0..a3b91864ef21 100644 --- a/net/rxrpc/conn_service.c +++ b/net/rxrpc/conn_service.c @@ -164,7 +164,7 @@ void rxrpc_new_incoming_connection(struct rxrpc_sock *r= x, =20 conn->proto.epoch =3D sp->hdr.epoch; conn->proto.cid =3D sp->hdr.cid & RXRPC_CIDMASK; - conn->params.service_id =3D sp->hdr.serviceId; + conn->orig_service_id =3D sp->hdr.serviceId; conn->service_id =3D sp->hdr.serviceId; conn->security_ix =3D sp->hdr.securityIndex; conn->out_clientflag =3D 0; @@ -183,7 +183,7 @@ void rxrpc_new_incoming_connection(struct rxrpc_sock *r= x, conn->service_id =3D rx->service_upgrade.to; =20 /* Make the connection a target for incoming packets. */ - rxrpc_publish_service_conn(conn->params.peer, conn); + rxrpc_publish_service_conn(conn->peer, conn); } =20 /* @@ -192,7 +192,7 @@ void rxrpc_new_incoming_connection(struct rxrpc_sock *r= x, */ void rxrpc_unpublish_service_conn(struct rxrpc_connection *conn) { - struct rxrpc_peer *peer =3D conn->params.peer; + struct rxrpc_peer *peer =3D conn->peer; =20 write_seqlock_bh(&peer->service_conn_lock); if (test_and_clear_bit(RXRPC_CONN_IN_SERVICE_CONNS, &conn->flags)) diff --git a/net/rxrpc/input.c b/net/rxrpc/input.c index e2461f29d765..44caf88e04b8 100644 --- a/net/rxrpc/input.c +++ b/net/rxrpc/input.c @@ -1339,10 +1339,10 @@ int rxrpc_input_packet(struct sock *udp_sk, struct = sk_buff *skb) =20 if (!test_bit(RXRPC_CONN_PROBING_FOR_UPGRADE, &conn->flags)) goto reupgrade; - old_id =3D cmpxchg(&conn->service_id, conn->params.service_id, + old_id =3D cmpxchg(&conn->service_id, conn->orig_service_id, sp->hdr.serviceId); =20 - if (old_id !=3D conn->params.service_id && + if (old_id !=3D conn->orig_service_id && old_id !=3D sp->hdr.serviceId) goto reupgrade; } diff --git a/net/rxrpc/key.c b/net/rxrpc/key.c index 830eeffe2d5b..8d53aded09c4 100644 --- a/net/rxrpc/key.c +++ b/net/rxrpc/key.c @@ -513,7 +513,7 @@ int rxrpc_get_server_data_key(struct rxrpc_connection *= conn, if (ret < 0) goto error; =20 - conn->params.key =3D key; + conn->key =3D key; _leave(" =3D 0 [%d]", key_serial(key)); return 0; =20 diff --git a/net/rxrpc/output.c b/net/rxrpc/output.c index 635acf3dbd77..b5d8eac8c49c 100644 --- a/net/rxrpc/output.c +++ b/net/rxrpc/output.c @@ -142,8 +142,8 @@ static size_t rxrpc_fill_out_ack(struct rxrpc_connectio= n *conn, txb->ack.reason =3D RXRPC_ACK_IDLE; } =20 - mtu =3D conn->params.peer->if_mtu; - mtu -=3D conn->params.peer->hdrsize; + mtu =3D conn->peer->if_mtu; + mtu -=3D conn->peer->hdrsize; jmax =3D rxrpc_rx_jumbo_max; qsize =3D (window - 1) - call->rx_consumed; rsize =3D max_t(int, call->rx_winsize - qsize, 0); @@ -259,7 +259,7 @@ static int rxrpc_send_ack_packet(struct rxrpc_local *lo= cal, struct rxrpc_txbuf * txb->ack.previousPacket =3D htonl(call->rx_highest_seq); =20 iov_iter_kvec(&msg.msg_iter, WRITE, iov, 1, len); - ret =3D do_udp_sendmsg(conn->params.local->socket, &msg, len); + ret =3D do_udp_sendmsg(conn->local->socket, &msg, len); call->peer->last_tx_at =3D ktime_get_seconds(); if (ret < 0) trace_rxrpc_tx_fail(call->debug_id, serial, ret, @@ -368,8 +368,8 @@ int rxrpc_send_abort_packet(struct rxrpc_call *call) pkt.whdr.serial =3D htonl(serial); =20 iov_iter_kvec(&msg.msg_iter, WRITE, iov, 1, sizeof(pkt)); - ret =3D do_udp_sendmsg(conn->params.local->socket, &msg, sizeof(pkt)); - conn->params.peer->last_tx_at =3D ktime_get_seconds(); + ret =3D do_udp_sendmsg(conn->local->socket, &msg, sizeof(pkt)); + conn->peer->last_tx_at =3D ktime_get_seconds(); if (ret < 0) trace_rxrpc_tx_fail(call->debug_id, serial, ret, rxrpc_tx_point_call_abort); @@ -473,7 +473,7 @@ int rxrpc_send_data_packet(struct rxrpc_call *call, str= uct rxrpc_txbuf *txb) if (txb->len >=3D call->peer->maxdata) goto send_fragmentable; =20 - down_read(&conn->params.local->defrag_sem); + down_read(&conn->local->defrag_sem); =20 txb->last_sent =3D ktime_get_real(); if (txb->wire.flags & RXRPC_REQUEST_ACK) @@ -486,10 +486,10 @@ int rxrpc_send_data_packet(struct rxrpc_call *call, s= truct rxrpc_txbuf *txb) * message and update the peer record */ rxrpc_inc_stat(call->rxnet, stat_tx_data_send); - ret =3D do_udp_sendmsg(conn->params.local->socket, &msg, len); - conn->params.peer->last_tx_at =3D ktime_get_seconds(); + ret =3D do_udp_sendmsg(conn->local->socket, &msg, len); + conn->peer->last_tx_at =3D ktime_get_seconds(); =20 - up_read(&conn->params.local->defrag_sem); + up_read(&conn->local->defrag_sem); if (ret < 0) { rxrpc_cancel_rtt_probe(call, serial, rtt_slot); trace_rxrpc_tx_fail(call->debug_id, serial, ret, @@ -549,22 +549,22 @@ int rxrpc_send_data_packet(struct rxrpc_call *call, s= truct rxrpc_txbuf *txb) /* attempt to send this message with fragmentation enabled */ _debug("send fragment"); =20 - down_write(&conn->params.local->defrag_sem); + down_write(&conn->local->defrag_sem); =20 txb->last_sent =3D ktime_get_real(); if (txb->wire.flags & RXRPC_REQUEST_ACK) rtt_slot =3D rxrpc_begin_rtt_probe(call, serial, rxrpc_rtt_tx_data); =20 - switch (conn->params.local->srx.transport.family) { + switch (conn->local->srx.transport.family) { case AF_INET6: case AF_INET: - ip_sock_set_mtu_discover(conn->params.local->socket->sk, + ip_sock_set_mtu_discover(conn->local->socket->sk, IP_PMTUDISC_DONT); rxrpc_inc_stat(call->rxnet, stat_tx_data_send_frag); - ret =3D do_udp_sendmsg(conn->params.local->socket, &msg, len); - conn->params.peer->last_tx_at =3D ktime_get_seconds(); + ret =3D do_udp_sendmsg(conn->local->socket, &msg, len); + conn->peer->last_tx_at =3D ktime_get_seconds(); =20 - ip_sock_set_mtu_discover(conn->params.local->socket->sk, + ip_sock_set_mtu_discover(conn->local->socket->sk, IP_PMTUDISC_DO); break; =20 @@ -582,7 +582,7 @@ int rxrpc_send_data_packet(struct rxrpc_call *call, str= uct rxrpc_txbuf *txb) } rxrpc_tx_backoff(call, ret); =20 - up_write(&conn->params.local->defrag_sem); + up_write(&conn->local->defrag_sem); goto done; } =20 diff --git a/net/rxrpc/proc.c b/net/rxrpc/proc.c index fae22a8b38d6..bb2edf6db896 100644 --- a/net/rxrpc/proc.c +++ b/net/rxrpc/proc.c @@ -172,9 +172,9 @@ static int rxrpc_connection_seq_show(struct seq_file *s= eq, void *v) goto print; } =20 - sprintf(lbuff, "%pISpc", &conn->params.local->srx.transport); + sprintf(lbuff, "%pISpc", &conn->local->srx.transport); =20 - sprintf(rbuff, "%pISpc", &conn->params.peer->srx.transport); + sprintf(rbuff, "%pISpc", &conn->peer->srx.transport); print: seq_printf(seq, "UDP %-47.47s %-47.47s %4x %08x %s %3u" @@ -186,7 +186,7 @@ static int rxrpc_connection_seq_show(struct seq_file *s= eq, void *v) rxrpc_conn_is_service(conn) ? "Svc" : "Clt", refcount_read(&conn->ref), rxrpc_conn_states[conn->state], - key_serial(conn->params.key), + key_serial(conn->key), atomic_read(&conn->serial), conn->hi_serial, conn->channels[0].call_id, diff --git a/net/rxrpc/rxkad.c b/net/rxrpc/rxkad.c index 36cf40442a7e..d1233720e05f 100644 --- a/net/rxrpc/rxkad.c +++ b/net/rxrpc/rxkad.c @@ -103,7 +103,7 @@ static int rxkad_init_connection_security(struct rxrpc_= connection *conn, struct crypto_sync_skcipher *ci; int ret; =20 - _enter("{%d},{%x}", conn->debug_id, key_serial(conn->params.key)); + _enter("{%d},{%x}", conn->debug_id, key_serial(conn->key)); =20 conn->security_ix =3D token->security_index; =20 @@ -118,7 +118,7 @@ static int rxkad_init_connection_security(struct rxrpc_= connection *conn, sizeof(token->kad->session_key)) < 0) BUG(); =20 - switch (conn->params.security_level) { + switch (conn->security_level) { case RXRPC_SECURITY_PLAIN: case RXRPC_SECURITY_AUTH: case RXRPC_SECURITY_ENCRYPT: @@ -150,7 +150,7 @@ static int rxkad_how_much_data(struct rxrpc_call *call,= size_t remain, { size_t shdr, buf_size, chunk; =20 - switch (call->conn->params.security_level) { + switch (call->conn->security_level) { default: buf_size =3D chunk =3D min_t(size_t, remain, RXRPC_JUMBO_DATALEN); shdr =3D 0; @@ -192,7 +192,7 @@ static int rxkad_prime_packet_security(struct rxrpc_con= nection *conn, =20 _enter(""); =20 - if (!conn->params.key) + if (!conn->key) return 0; =20 tmpbuf =3D kmalloc(tmpsize, GFP_KERNEL); @@ -205,7 +205,7 @@ static int rxkad_prime_packet_security(struct rxrpc_con= nection *conn, return -ENOMEM; } =20 - token =3D conn->params.key->payload.data[0]; + token =3D conn->key->payload.data[0]; memcpy(&iv, token->kad->session_key, sizeof(iv)); =20 tmpbuf[0] =3D htonl(conn->proto.epoch); @@ -317,7 +317,7 @@ static int rxkad_secure_packet_encrypt(const struct rxr= pc_call *call, } =20 /* encrypt from the session key */ - token =3D call->conn->params.key->payload.data[0]; + token =3D call->conn->key->payload.data[0]; memcpy(&iv, token->kad->session_key, sizeof(iv)); =20 sg_init_one(&sg, txb->data, txb->len); @@ -344,13 +344,13 @@ static int rxkad_secure_packet(struct rxrpc_call *cal= l, struct rxrpc_txbuf *txb) int ret; =20 _enter("{%d{%x}},{#%u},%u,", - call->debug_id, key_serial(call->conn->params.key), + call->debug_id, key_serial(call->conn->key), txb->seq, txb->len); =20 if (!call->conn->rxkad.cipher) return 0; =20 - ret =3D key_validate(call->conn->params.key); + ret =3D key_validate(call->conn->key); if (ret < 0) return ret; =20 @@ -380,7 +380,7 @@ static int rxkad_secure_packet(struct rxrpc_call *call,= struct rxrpc_txbuf *txb) y =3D 1; /* zero checksums are not permitted */ txb->wire.cksum =3D htons(y); =20 - switch (call->conn->params.security_level) { + switch (call->conn->security_level) { case RXRPC_SECURITY_PLAIN: ret =3D 0; break; @@ -525,7 +525,7 @@ static int rxkad_verify_packet_2(struct rxrpc_call *cal= l, struct sk_buff *skb, } =20 /* decrypt from the session key */ - token =3D call->conn->params.key->payload.data[0]; + token =3D call->conn->key->payload.data[0]; memcpy(&iv, token->kad->session_key, sizeof(iv)); =20 skcipher_request_set_sync_tfm(req, call->conn->rxkad.cipher); @@ -596,7 +596,7 @@ static int rxkad_verify_packet(struct rxrpc_call *call,= struct sk_buff *skb) u32 x, y; =20 _enter("{%d{%x}},{#%u}", - call->debug_id, key_serial(call->conn->params.key), seq); + call->debug_id, key_serial(call->conn->key), seq); =20 if (!call->conn->rxkad.cipher) return 0; @@ -632,7 +632,7 @@ static int rxkad_verify_packet(struct rxrpc_call *call,= struct sk_buff *skb) goto protocol_error; } =20 - switch (call->conn->params.security_level) { + switch (call->conn->security_level) { case RXRPC_SECURITY_PLAIN: ret =3D 0; break; @@ -678,8 +678,8 @@ static int rxkad_issue_challenge(struct rxrpc_connectio= n *conn) challenge.min_level =3D htonl(0); challenge.__padding =3D 0; =20 - msg.msg_name =3D &conn->params.peer->srx.transport; - msg.msg_namelen =3D conn->params.peer->srx.transport_len; + msg.msg_name =3D &conn->peer->srx.transport; + msg.msg_namelen =3D conn->peer->srx.transport_len; msg.msg_control =3D NULL; msg.msg_controllen =3D 0; msg.msg_flags =3D 0; @@ -705,14 +705,14 @@ static int rxkad_issue_challenge(struct rxrpc_connect= ion *conn) serial =3D atomic_inc_return(&conn->serial); whdr.serial =3D htonl(serial); =20 - ret =3D kernel_sendmsg(conn->params.local->socket, &msg, iov, 2, len); + ret =3D kernel_sendmsg(conn->local->socket, &msg, iov, 2, len); if (ret < 0) { trace_rxrpc_tx_fail(conn->debug_id, serial, ret, rxrpc_tx_point_rxkad_challenge); return -EAGAIN; } =20 - conn->params.peer->last_tx_at =3D ktime_get_seconds(); + conn->peer->last_tx_at =3D ktime_get_seconds(); trace_rxrpc_tx_packet(conn->debug_id, &whdr, rxrpc_tx_point_rxkad_challenge); _leave(" =3D 0"); @@ -736,8 +736,8 @@ static int rxkad_send_response(struct rxrpc_connection = *conn, =20 _enter(""); =20 - msg.msg_name =3D &conn->params.peer->srx.transport; - msg.msg_namelen =3D conn->params.peer->srx.transport_len; + msg.msg_name =3D &conn->peer->srx.transport; + msg.msg_namelen =3D conn->peer->srx.transport_len; msg.msg_control =3D NULL; msg.msg_controllen =3D 0; msg.msg_flags =3D 0; @@ -762,14 +762,14 @@ static int rxkad_send_response(struct rxrpc_connectio= n *conn, serial =3D atomic_inc_return(&conn->serial); whdr.serial =3D htonl(serial); =20 - ret =3D kernel_sendmsg(conn->params.local->socket, &msg, iov, 3, len); + ret =3D kernel_sendmsg(conn->local->socket, &msg, iov, 3, len); if (ret < 0) { trace_rxrpc_tx_fail(conn->debug_id, serial, ret, rxrpc_tx_point_rxkad_response); return -EAGAIN; } =20 - conn->params.peer->last_tx_at =3D ktime_get_seconds(); + conn->peer->last_tx_at =3D ktime_get_seconds(); _leave(" =3D 0"); return 0; } @@ -832,15 +832,15 @@ static int rxkad_respond_to_challenge(struct rxrpc_co= nnection *conn, u32 version, nonce, min_level, abort_code; int ret; =20 - _enter("{%d,%x}", conn->debug_id, key_serial(conn->params.key)); + _enter("{%d,%x}", conn->debug_id, key_serial(conn->key)); =20 eproto =3D tracepoint_string("chall_no_key"); abort_code =3D RX_PROTOCOL_ERROR; - if (!conn->params.key) + if (!conn->key) goto protocol_error; =20 abort_code =3D RXKADEXPIRED; - ret =3D key_validate(conn->params.key); + ret =3D key_validate(conn->key); if (ret < 0) goto other_error; =20 @@ -863,10 +863,10 @@ static int rxkad_respond_to_challenge(struct rxrpc_co= nnection *conn, =20 abort_code =3D RXKADLEVELFAIL; ret =3D -EACCES; - if (conn->params.security_level < min_level) + if (conn->security_level < min_level) goto other_error; =20 - token =3D conn->params.key->payload.data[0]; + token =3D conn->key->payload.data[0]; =20 /* build the response packet */ resp =3D kzalloc(sizeof(struct rxkad_response), GFP_NOFS); @@ -878,7 +878,7 @@ static int rxkad_respond_to_challenge(struct rxrpc_conn= ection *conn, resp->encrypted.cid =3D htonl(conn->proto.cid); resp->encrypted.securityIndex =3D htonl(conn->security_ix); resp->encrypted.inc_nonce =3D htonl(nonce + 1); - resp->encrypted.level =3D htonl(conn->params.security_level); + resp->encrypted.level =3D htonl(conn->security_level); resp->kvno =3D htonl(token->kad->kvno); resp->ticket_len =3D htonl(token->kad->ticket_len); resp->encrypted.call_id[0] =3D htonl(conn->channels[0].call_counter); @@ -1226,7 +1226,7 @@ static int rxkad_verify_response(struct rxrpc_connect= ion *conn, level =3D ntohl(response->encrypted.level); if (level > RXRPC_SECURITY_ENCRYPT) goto protocol_error_free; - conn->params.security_level =3D level; + conn->security_level =3D level; =20 /* create a key to hold the security data and expiration time - after * this the connection security can be handled in exactly the same way diff --git a/net/rxrpc/security.c b/net/rxrpc/security.c index 50cb5f1ee0c0..e6ddac9b3732 100644 --- a/net/rxrpc/security.c +++ b/net/rxrpc/security.c @@ -69,7 +69,7 @@ int rxrpc_init_client_conn_security(struct rxrpc_connecti= on *conn) { const struct rxrpc_security *sec; struct rxrpc_key_token *token; - struct key *key =3D conn->params.key; + struct key *key =3D conn->key; int ret; =20 _enter("{%d},{%x}", conn->debug_id, key_serial(key)); @@ -163,7 +163,7 @@ struct key *rxrpc_look_up_server_security(struct rxrpc_= connection *conn, =20 rcu_read_lock(); =20 - rx =3D rcu_dereference(conn->params.local->service); + rx =3D rcu_dereference(conn->local->service); if (!rx) goto out;