rxrpc: Drop channel number field from rxrpc_call struct
Drop the channel number (channel) field from the rxrpc_call struct to reduce the size of the call struct. The field is redundant: if the call is attached to a connection, the channel can be obtained from there by AND'ing with RXRPC_CHANNELMASK. Signed-off-by: David Howells <dhowells@redhat.com>
This commit is contained in:
parent
f36b5e444c
commit
01a90a4598
|
@ -432,7 +432,6 @@ struct rxrpc_call {
|
||||||
int error_report; /* Network error (ICMP/local transport) */
|
int error_report; /* Network error (ICMP/local transport) */
|
||||||
int error; /* Local error incurred */
|
int error; /* Local error incurred */
|
||||||
enum rxrpc_call_state state : 8; /* current state of call */
|
enum rxrpc_call_state state : 8; /* current state of call */
|
||||||
u8 channel; /* connection channel occupied by this call */
|
|
||||||
u16 service_id; /* service ID */
|
u16 service_id; /* service ID */
|
||||||
u32 call_id; /* call ID on connection */
|
u32 call_id; /* call ID on connection */
|
||||||
u32 cid; /* connection ID plus channel index */
|
u32 cid; /* connection ID plus channel index */
|
||||||
|
|
|
@ -317,7 +317,6 @@ struct rxrpc_call *rxrpc_incoming_call(struct rxrpc_sock *rx,
|
||||||
candidate->conn = conn;
|
candidate->conn = conn;
|
||||||
candidate->cid = sp->hdr.cid;
|
candidate->cid = sp->hdr.cid;
|
||||||
candidate->call_id = sp->hdr.callNumber;
|
candidate->call_id = sp->hdr.callNumber;
|
||||||
candidate->channel = chan;
|
|
||||||
candidate->rx_data_post = 0;
|
candidate->rx_data_post = 0;
|
||||||
candidate->state = RXRPC_CALL_SERVER_ACCEPTING;
|
candidate->state = RXRPC_CALL_SERVER_ACCEPTING;
|
||||||
candidate->flags |= (1 << RXRPC_CALL_IS_SERVICE);
|
candidate->flags |= (1 << RXRPC_CALL_IS_SERVICE);
|
||||||
|
@ -330,7 +329,7 @@ struct rxrpc_call *rxrpc_incoming_call(struct rxrpc_sock *rx,
|
||||||
call = rcu_dereference_protected(conn->channels[chan].call,
|
call = rcu_dereference_protected(conn->channels[chan].call,
|
||||||
lockdep_is_held(&conn->channel_lock));
|
lockdep_is_held(&conn->channel_lock));
|
||||||
|
|
||||||
_debug("channel[%u] is %p", candidate->channel, call);
|
_debug("channel[%u] is %p", candidate->cid & RXRPC_CHANNELMASK, call);
|
||||||
if (call && call->call_id == sp->hdr.callNumber) {
|
if (call && call->call_id == sp->hdr.callNumber) {
|
||||||
/* already set; must've been a duplicate packet */
|
/* already set; must've been a duplicate packet */
|
||||||
_debug("extant call [%d]", call->state);
|
_debug("extant call [%d]", call->state);
|
||||||
|
@ -677,8 +676,8 @@ static void rxrpc_destroy_call(struct work_struct *work)
|
||||||
struct rxrpc_call *call =
|
struct rxrpc_call *call =
|
||||||
container_of(work, struct rxrpc_call, destroyer);
|
container_of(work, struct rxrpc_call, destroyer);
|
||||||
|
|
||||||
_enter("%p{%d,%d,%p}",
|
_enter("%p{%d,%x,%p}",
|
||||||
call, atomic_read(&call->usage), call->channel, call->conn);
|
call, atomic_read(&call->usage), call->cid, call->conn);
|
||||||
|
|
||||||
ASSERTCMP(call->state, ==, RXRPC_CALL_DEAD);
|
ASSERTCMP(call->state, ==, RXRPC_CALL_DEAD);
|
||||||
|
|
||||||
|
|
|
@ -280,7 +280,6 @@ attached:
|
||||||
found_channel:
|
found_channel:
|
||||||
_debug("found chan");
|
_debug("found chan");
|
||||||
call->conn = conn;
|
call->conn = conn;
|
||||||
call->channel = chan;
|
|
||||||
call->cid = conn->proto.cid | chan;
|
call->cid = conn->proto.cid | chan;
|
||||||
call->call_id = ++conn->channels[chan].call_counter;
|
call->call_id = ++conn->channels[chan].call_counter;
|
||||||
conn->channels[chan].call_id = call->call_id;
|
conn->channels[chan].call_id = call->call_id;
|
||||||
|
|
|
@ -156,9 +156,10 @@ not_found:
|
||||||
void __rxrpc_disconnect_call(struct rxrpc_call *call)
|
void __rxrpc_disconnect_call(struct rxrpc_call *call)
|
||||||
{
|
{
|
||||||
struct rxrpc_connection *conn = call->conn;
|
struct rxrpc_connection *conn = call->conn;
|
||||||
struct rxrpc_channel *chan = &conn->channels[call->channel];
|
struct rxrpc_channel *chan =
|
||||||
|
&conn->channels[call->cid & RXRPC_CHANNELMASK];
|
||||||
|
|
||||||
_enter("%d,%d", conn->debug_id, call->channel);
|
_enter("%d,%x", conn->debug_id, call->cid);
|
||||||
|
|
||||||
if (rcu_access_pointer(chan->call) == call) {
|
if (rcu_access_pointer(chan->call) == call) {
|
||||||
/* Save the result of the call so that we can repeat it if necessary
|
/* Save the result of the call so that we can repeat it if necessary
|
||||||
|
|
|
@ -275,7 +275,7 @@ static int rxkad_secure_packet(struct rxrpc_call *call,
|
||||||
memcpy(&iv, call->conn->csum_iv.x, sizeof(iv));
|
memcpy(&iv, call->conn->csum_iv.x, sizeof(iv));
|
||||||
|
|
||||||
/* calculate the security checksum */
|
/* calculate the security checksum */
|
||||||
x = call->channel << (32 - RXRPC_CIDSHIFT);
|
x = (call->cid & RXRPC_CHANNELMASK) << (32 - RXRPC_CIDSHIFT);
|
||||||
x |= sp->hdr.seq & 0x3fffffff;
|
x |= sp->hdr.seq & 0x3fffffff;
|
||||||
call->crypto_buf[0] = htonl(sp->hdr.callNumber);
|
call->crypto_buf[0] = htonl(sp->hdr.callNumber);
|
||||||
call->crypto_buf[1] = htonl(x);
|
call->crypto_buf[1] = htonl(x);
|
||||||
|
@ -507,7 +507,7 @@ static int rxkad_verify_packet(struct rxrpc_call *call,
|
||||||
memcpy(&iv, call->conn->csum_iv.x, sizeof(iv));
|
memcpy(&iv, call->conn->csum_iv.x, sizeof(iv));
|
||||||
|
|
||||||
/* validate the security checksum */
|
/* validate the security checksum */
|
||||||
x = call->channel << (32 - RXRPC_CIDSHIFT);
|
x = (call->cid & RXRPC_CHANNELMASK) << (32 - RXRPC_CIDSHIFT);
|
||||||
x |= sp->hdr.seq & 0x3fffffff;
|
x |= sp->hdr.seq & 0x3fffffff;
|
||||||
call->crypto_buf[0] = htonl(call->call_id);
|
call->crypto_buf[0] = htonl(call->call_id);
|
||||||
call->crypto_buf[1] = htonl(x);
|
call->crypto_buf[1] = htonl(x);
|
||||||
|
|
Loading…
Reference in New Issue