Skip to content

Commit 319951e

Browse files
committed
SUNRPC: Remove ->xpo_secure_port()
There's no need for the cost of this extra virtual function call during every RPC transaction: the RQ_SECURE bit can be set properly in ->xpo_recvfrom() instead. Reviewed-by: Jeff Layton <[email protected]> Signed-off-by: Chuck Lever <[email protected]>
1 parent fcebda5 commit 319951e

File tree

5 files changed

+3
-11
lines changed

5 files changed

+3
-11
lines changed

include/linux/sunrpc/svc_xprt.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ struct svc_xprt_ops {
2626
void (*xpo_release_rqst)(struct svc_rqst *);
2727
void (*xpo_detach)(struct svc_xprt *);
2828
void (*xpo_free)(struct svc_xprt *);
29-
void (*xpo_secure_port)(struct svc_rqst *rqstp);
3029
void (*xpo_kill_temp_xprt)(struct svc_xprt *);
3130
void (*xpo_start_tls)(struct svc_xprt *);
3231
};

net/sunrpc/svc_xprt.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -886,7 +886,6 @@ int svc_recv(struct svc_rqst *rqstp, long timeout)
886886

887887
clear_bit(XPT_OLD, &xprt->xpt_flags);
888888

889-
xprt->xpt_ops->xpo_secure_port(rqstp);
890889
rqstp->rq_chandle.defer = svc_defer;
891890

892891
if (serv->sv_stats)

net/sunrpc/svcsock.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,7 @@ static int svc_udp_recvfrom(struct svc_rqst *rqstp)
508508
if (serv->sv_stats)
509509
serv->sv_stats->netudpcnt++;
510510

511+
svc_sock_secure_port(rqstp);
511512
svc_xprt_received(rqstp->rq_xprt);
512513
return len;
513514

@@ -636,7 +637,6 @@ static const struct svc_xprt_ops svc_udp_ops = {
636637
.xpo_free = svc_sock_free,
637638
.xpo_has_wspace = svc_udp_has_wspace,
638639
.xpo_accept = svc_udp_accept,
639-
.xpo_secure_port = svc_sock_secure_port,
640640
.xpo_kill_temp_xprt = svc_udp_kill_temp_xprt,
641641
};
642642

@@ -1028,6 +1028,7 @@ static int svc_tcp_recvfrom(struct svc_rqst *rqstp)
10281028
if (serv->sv_stats)
10291029
serv->sv_stats->nettcpcnt++;
10301030

1031+
svc_sock_secure_port(rqstp);
10311032
svc_xprt_received(rqstp->rq_xprt);
10321033
return rqstp->rq_arg.len;
10331034

@@ -1209,7 +1210,6 @@ static const struct svc_xprt_ops svc_tcp_ops = {
12091210
.xpo_free = svc_sock_free,
12101211
.xpo_has_wspace = svc_tcp_has_wspace,
12111212
.xpo_accept = svc_tcp_accept,
1212-
.xpo_secure_port = svc_sock_secure_port,
12131213
.xpo_kill_temp_xprt = svc_tcp_kill_temp_xprt,
12141214
};
12151215

net/sunrpc/xprtrdma/svc_rdma_recvfrom.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -847,6 +847,7 @@ int svc_rdma_recvfrom(struct svc_rqst *rqstp)
847847
rqstp->rq_xprt_ctxt = ctxt;
848848
rqstp->rq_prot = IPPROTO_MAX;
849849
svc_xprt_copy_addrs(rqstp, xprt);
850+
set_bit(RQ_SECURE, &rqstp->rq_flags);
850851
return rqstp->rq_arg.len;
851852

852853
out_err:

net/sunrpc/xprtrdma/svc_rdma_transport.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ static struct svc_xprt *svc_rdma_accept(struct svc_xprt *xprt);
7373
static void svc_rdma_detach(struct svc_xprt *xprt);
7474
static void svc_rdma_free(struct svc_xprt *xprt);
7575
static int svc_rdma_has_wspace(struct svc_xprt *xprt);
76-
static void svc_rdma_secure_port(struct svc_rqst *);
7776
static void svc_rdma_kill_temp_xprt(struct svc_xprt *);
7877

7978
static const struct svc_xprt_ops svc_rdma_ops = {
@@ -86,7 +85,6 @@ static const struct svc_xprt_ops svc_rdma_ops = {
8685
.xpo_free = svc_rdma_free,
8786
.xpo_has_wspace = svc_rdma_has_wspace,
8887
.xpo_accept = svc_rdma_accept,
89-
.xpo_secure_port = svc_rdma_secure_port,
9088
.xpo_kill_temp_xprt = svc_rdma_kill_temp_xprt,
9189
};
9290

@@ -600,11 +598,6 @@ static int svc_rdma_has_wspace(struct svc_xprt *xprt)
600598
return 1;
601599
}
602600

603-
static void svc_rdma_secure_port(struct svc_rqst *rqstp)
604-
{
605-
set_bit(RQ_SECURE, &rqstp->rq_flags);
606-
}
607-
608601
static void svc_rdma_kill_temp_xprt(struct svc_xprt *xprt)
609602
{
610603
}

0 commit comments

Comments
 (0)